diff --git a/.gitignore b/.gitignore index 9173b12c328..4fff675801f 100644 --- a/.gitignore +++ b/.gitignore @@ -54,3 +54,4 @@ internal/ !tests/cases/projects/projectOption/**/node_modules !tests/cases/projects/NodeModulesSearch/**/* !tests/baselines/reference/project/nodeModules*/**/* +.idea diff --git a/.travis.yml b/.travis.yml index bfc07e2b510..efbd00d5034 100644 --- a/.travis.yml +++ b/.travis.yml @@ -23,7 +23,7 @@ matrix: branches: only: - master - - transforms + - release-2.0 install: - npm uninstall typescript diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 5cde901a576..1c242022979 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -40,10 +40,6 @@ In general, things we find useful when reviewing suggestions are: # Instructions for Contributing Code -## Code of Conduct - -This project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/). For more information see the [Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/) or contact [opencode@microsoft.com](mailto:opencode@microsoft.com) with any additional questions or comments. - ## Contributing bug fixes TypeScript is currently accepting contributions in the form of bug fixes. A bug must have an issue tracking it in the issue tracker that has been approved ("Milestone == Community") by the TypeScript team. Your pull request should include a link to the bug that you are fixing. If you've submitted a PR for a bug, please post a comment in the bug to avoid duplication of effort. diff --git a/Gulpfile.ts b/Gulpfile.ts index 295a7ce03d9..b19efe5d2d3 100644 --- a/Gulpfile.ts +++ b/Gulpfile.ts @@ -39,9 +39,11 @@ const gulp = helpMaker(originalGulp); const mochaParallel = require("./scripts/mocha-parallel.js"); const {runTestsInParallel} = mochaParallel; +Error.stackTraceLimit = 1000; + const cmdLineOptions = minimist(process.argv.slice(2), { boolean: ["debug", "light", "colors", "lint", "soft"], - string: ["browser", "tests", "host", "reporter"], + string: ["browser", "tests", "host", "reporter", "stackTraceLimit"], alias: { d: "debug", t: "tests", @@ -559,6 +561,7 @@ function runConsoleTests(defaultReporter: string, runInParallel: boolean, done: const debug = cmdLineOptions["debug"]; const tests = cmdLineOptions["tests"]; const light = cmdLineOptions["light"]; + const stackTraceLimit = cmdLineOptions["stackTraceLimit"]; const testConfigFile = "test.config"; if (fs.existsSync(testConfigFile)) { fs.unlinkSync(testConfigFile); @@ -578,7 +581,7 @@ function runConsoleTests(defaultReporter: string, runInParallel: boolean, done: } if (tests || light || taskConfigsFolder) { - writeTestConfigFile(tests, light, taskConfigsFolder, workerCount); + writeTestConfigFile(tests, light, taskConfigsFolder, workerCount, stackTraceLimit); } if (tests && tests.toLocaleLowerCase() === "rwc") { @@ -727,6 +730,7 @@ gulp.task("browserify", "Runs browserify on run.js to produce a file suitable fo sourcemaps: { "built/local/_stream_0.js": originalMap, "built/local/bundle.js": maps, + "node_modules/source-map-support/source-map-support.js": undefined, } }); const finalMap = chain.apply(); @@ -756,8 +760,8 @@ function cleanTestDirs(done: (e?: any) => void) { } // used to pass data from jake command line directly to run.js -function writeTestConfigFile(tests: string, light: boolean, taskConfigsFolder?: string, workerCount?: number) { - const testConfigContents = JSON.stringify({ test: tests ? [tests] : undefined, light: light, workerCount: workerCount, taskConfigsFolder: taskConfigsFolder }); +function writeTestConfigFile(tests: string, light: boolean, taskConfigsFolder?: string, workerCount?: number, stackTraceLimit?: string) { + const testConfigContents = JSON.stringify({ test: tests ? [tests] : undefined, light, workerCount, stackTraceLimit, taskConfigsFolder }); console.log("Running tests with config: " + testConfigContents); fs.writeFileSync("test.config", testConfigContents); } @@ -887,7 +891,7 @@ gulp.task(loggedIOJsPath, false, [], (done) => { const temp = path.join(builtLocalDirectory, "temp"); mkdirP(temp, (err) => { if (err) { console.error(err); done(err); process.exit(1); }; - exec(host, [LKGCompiler, "--outdir", temp, loggedIOpath], () => { + exec(host, [LKGCompiler, "--types --outdir", temp, loggedIOpath], () => { fs.renameSync(path.join(temp, "/harness/loggedIO.js"), loggedIOJsPath); del(temp).then(() => done(), done); }, done); @@ -908,8 +912,8 @@ gulp.task(instrumenterJsPath, false, [servicesFile], () => { .pipe(gulp.dest(".")); }); -gulp.task("tsc-instrumented", "Builds an instrumented tsc.js", [loggedIOJsPath, instrumenterJsPath, servicesFile], (done) => { - exec(host, [instrumenterJsPath, "record", "iocapture", builtLocalDirectory, compilerFilename], done, done); +gulp.task("tsc-instrumented", "Builds an instrumented tsc.js", ["local", loggedIOJsPath, instrumenterJsPath, servicesFile], (done) => { + exec(host, [instrumenterJsPath, "record", "iocapture", builtLocalCompiler], done, done); }); gulp.task("update-sublime", "Updates the sublime plugin's tsserver", ["local", serverFile], () => { diff --git a/Jakefile.js b/Jakefile.js index 40a0bb2ffa5..c62a4ffd6ce 100644 --- a/Jakefile.js +++ b/Jakefile.js @@ -120,16 +120,29 @@ var servicesSources = [ ].map(function (f) { return path.join(compilerDirectory, f); }).concat([ + "types.ts", + "utilities.ts", "breakpoints.ts", + "classifier.ts", + "completions.ts", + "documentHighlights.ts", + "documentRegistry.ts", + "findAllReferences.ts", + "goToDefinition.ts", + "goToImplementation.ts", + "jsDoc.ts", + "jsTyping.ts", "navigateTo.ts", "navigationBar.ts", "outliningElementsCollector.ts", "patternMatcher.ts", + "preProcess.ts", + "rename.ts", "services.ts", "shims.ts", "signatureHelp.ts", - "types.ts", - "utilities.ts", + "symbolDisplay.ts", + "transpile.ts", "formatting/formatting.ts", "formatting/formattingContext.ts", "formatting/formattingRequestKind.ts", @@ -204,6 +217,7 @@ var harnessSources = harnessCoreSources.concat([ "moduleResolution.ts", "tsconfigParsing.ts", "commandLineParsing.ts", + "configurationExtension.ts", "convertCompilerOptionsFromJson.ts", "convertTypingOptionsFromJson.ts", "tsserverProjectSystem.ts", @@ -776,7 +790,7 @@ function cleanTestDirs() { // used to pass data from jake command line directly to run.js function writeTestConfigFile(tests, light, taskConfigsFolder, workerCount, stackTraceLimit) { - var testConfigContents = JSON.stringify({ + var testConfigContents = JSON.stringify({ test: tests ? [tests] : undefined, light: light, workerCount: workerCount, @@ -992,15 +1006,18 @@ function acceptBaseline(containerFolder) { var deleteEnding = '.delete'; for (var i in files) { var filename = files[i]; - if (filename.substr(filename.length - deleteEnding.length) === deleteEnding) { - filename = filename.substr(0, filename.length - deleteEnding.length); - fs.unlinkSync(path.join(targetFolder, filename)); - } else { - var target = path.join(targetFolder, filename); - if (fs.existsSync(target)) { - fs.unlinkSync(target); + var fullLocalPath = path.join(sourceFolder, filename); + if (fs.statSync(fullLocalPath).isFile()) { + if (filename.substr(filename.length - deleteEnding.length) === deleteEnding) { + filename = filename.substr(0, filename.length - deleteEnding.length); + fs.unlinkSync(path.join(targetFolder, filename)); + } else { + var target = path.join(targetFolder, filename); + if (fs.existsSync(target)) { + fs.unlinkSync(target); + } + fs.renameSync(path.join(sourceFolder, filename), target); } - fs.renameSync(path.join(sourceFolder, filename), target); } } } @@ -1039,7 +1056,7 @@ var loggedIOJsPath = builtLocalDirectory + 'loggedIO.js'; file(loggedIOJsPath, [builtLocalDirectory, loggedIOpath], function () { var temp = builtLocalDirectory + 'temp'; jake.mkdirP(temp); - var options = "--outdir " + temp + ' ' + loggedIOpath; + var options = "--types --outdir " + temp + ' ' + loggedIOpath; var cmd = host + " " + LKGDirectory + compilerFilename + " " + options + " "; console.log(cmd + "\n"); var ex = jake.createExec([cmd]); diff --git a/README.md b/README.md index d16bc363b26..2f631439eb0 100644 --- a/README.md +++ b/README.md @@ -30,8 +30,12 @@ There are many ways to [contribute](https://github.com/Microsoft/TypeScript/blob * Engage with other TypeScript users and developers on [StackOverflow](http://stackoverflow.com/questions/tagged/typescript). * Join the [#typescript](http://twitter.com/#!/search/realtime/%23typescript) discussion on Twitter. * [Contribute bug fixes](https://github.com/Microsoft/TypeScript/blob/master/CONTRIBUTING.md). -* Read the language specification ([docx](https://github.com/Microsoft/TypeScript/blob/master/doc/TypeScript%20Language%20Specification.docx?raw=true), [pdf](https://github.com/Microsoft/TypeScript/blob/master/doc/TypeScript%20Language%20Specification.pdf?raw=true), [md](https://github.com/Microsoft/TypeScript/blob/master/doc/spec.md)). +* Read the language specification ([docx](https://github.com/Microsoft/TypeScript/blob/master/doc/TypeScript%20Language%20Specification.docx?raw=true), + [pdf](https://github.com/Microsoft/TypeScript/blob/master/doc/TypeScript%20Language%20Specification.pdf?raw=true), [md](https://github.com/Microsoft/TypeScript/blob/master/doc/spec.md)). +This project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/). For more information see +the [Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/) or contact [opencode@microsoft.com](mailto:opencode@microsoft.com) +with any additional questions or comments. ## Documentation @@ -91,4 +95,4 @@ node built/local/tsc.js hello.ts ## Roadmap -For details on our planned features and future direction please refer to our [roadmap](https://github.com/Microsoft/TypeScript/wiki/Roadmap). +For details on our planned features and future direction please refer to our [roadmap](https://github.com/Microsoft/TypeScript/wiki/Roadmap). \ No newline at end of file diff --git a/lib/lib.es2015.collection.d.ts b/lib/lib.es2015.collection.d.ts index f014185d9e1..175f4f8725e 100644 --- a/lib/lib.es2015.collection.d.ts +++ b/lib/lib.es2015.collection.d.ts @@ -20,7 +20,7 @@ interface Map { forEach(callbackfn: (value: V, index: K, map: Map) => void, thisArg?: any): void; get(key: K): V | undefined; has(key: K): boolean; - set(key: K, value?: V): this; + set(key: K, value: V): this; readonly size: number; } @@ -36,7 +36,7 @@ interface WeakMap { delete(key: K): boolean; get(key: K): V | undefined; has(key: K): boolean; - set(key: K, value?: V): this; + set(key: K, value: V): this; } interface WeakMapConstructor { diff --git a/lib/lib.es2015.proxy.d.ts b/lib/lib.es2015.proxy.d.ts index 3908e97c17c..fa7527ef1c4 100644 --- a/lib/lib.es2015.proxy.d.ts +++ b/lib/lib.es2015.proxy.d.ts @@ -19,7 +19,7 @@ interface ProxyHandler { setPrototypeOf? (target: T, v: any): boolean; isExtensible? (target: T): boolean; preventExtensions? (target: T): boolean; - getOwnPropertyDescriptor? (target: T, p: PropertyKey): PropertyDescriptor; + getOwnPropertyDescriptor? (target: T, p: PropertyKey): PropertyDescriptor | undefined; has? (target: T, p: PropertyKey): boolean; get? (target: T, p: PropertyKey, receiver: any): any; set? (target: T, p: PropertyKey, value: any, receiver: any): boolean; @@ -35,4 +35,4 @@ interface ProxyConstructor { revocable(target: T, handler: ProxyHandler): { proxy: T; revoke: () => void; }; new (target: T, handler: ProxyHandler): T } -declare var Proxy: ProxyConstructor; \ No newline at end of file +declare var Proxy: ProxyConstructor; diff --git a/scripts/tslint/preferConstRule.ts b/scripts/tslint/preferConstRule.ts index 1d316692468..9425d2b6079 100644 --- a/scripts/tslint/preferConstRule.ts +++ b/scripts/tslint/preferConstRule.ts @@ -9,44 +9,12 @@ export class Rule extends Lint.Rules.AbstractRule { } } -function isBindingPattern(node: ts.Node): node is ts.BindingPattern { - return !!node && (node.kind === ts.SyntaxKind.ArrayBindingPattern || node.kind === ts.SyntaxKind.ObjectBindingPattern); -} - -function walkUpBindingElementsAndPatterns(node: ts.Node): ts.Node { - while (node && (node.kind === ts.SyntaxKind.BindingElement || isBindingPattern(node))) { - node = node.parent; - } - - return node; -} - -function getCombinedNodeFlags(node: ts.Node): ts.NodeFlags { - node = walkUpBindingElementsAndPatterns(node); - - let flags = node.flags; - if (node.kind === ts.SyntaxKind.VariableDeclaration) { - node = node.parent; - } - - if (node && node.kind === ts.SyntaxKind.VariableDeclarationList) { - flags |= node.flags; - node = node.parent; - } - - if (node && node.kind === ts.SyntaxKind.VariableStatement) { - flags |= node.flags; - } - - return flags; -} - function isLet(node: ts.Node) { - return !!(getCombinedNodeFlags(node) & ts.NodeFlags.Let); + return !!(ts.getCombinedNodeFlags(node) & ts.NodeFlags.Let); } function isExported(node: ts.Node) { - return !!(getCombinedNodeFlags(node) & ts.NodeFlags.Export); + return !!(ts.getCombinedModifierFlags(node) & ts.ModifierFlags.Export); } function isAssignmentOperator(token: ts.SyntaxKind): boolean { @@ -125,11 +93,16 @@ class PreferConstWalker extends Lint.RuleWalker { private visitBindingPatternIdentifiers(pattern: ts.BindingPattern) { for (const element of pattern.elements) { - if (element.name.kind === ts.SyntaxKind.Identifier) { - this.markAssignment(element.name as ts.Identifier); + if (element.kind !== ts.SyntaxKind.BindingElement) { + continue; + } + + const name = (element).name; + if (name.kind === ts.SyntaxKind.Identifier) { + this.markAssignment(name as ts.Identifier); } else { - this.visitBindingPatternIdentifiers(element.name as ts.BindingPattern); + this.visitBindingPatternIdentifiers(name as ts.BindingPattern); } } } @@ -223,7 +196,9 @@ class PreferConstWalker extends Lint.RuleWalker { private collectBindingPatternIdentifiers(value: ts.VariableDeclaration, pattern: ts.BindingPattern, table: ts.MapLike) { for (const element of pattern.elements) { - this.collectNameIdentifiers(value, element.name, table); + if (element.kind === ts.SyntaxKind.BindingElement) { + this.collectNameIdentifiers(value, (element).name, table); + } } } } diff --git a/src/compiler/binder.ts b/src/compiler/binder.ts index 50c3adf1310..3bccf6b4a9b 100644 --- a/src/compiler/binder.ts +++ b/src/compiler/binder.ts @@ -591,6 +591,9 @@ namespace ts { case SyntaxKind.PrefixUnaryExpression: bindPrefixUnaryExpressionFlow(node); break; + case SyntaxKind.PostfixUnaryExpression: + bindPostfixUnaryExpressionFlow(node); + break; case SyntaxKind.BinaryExpression: bindBinaryExpressionFlow(node); break; @@ -1106,6 +1109,16 @@ namespace ts { } else { forEachChild(node, bind); + if (node.operator === SyntaxKind.PlusEqualsToken || node.operator === SyntaxKind.MinusMinusToken) { + bindAssignmentTargetFlow(node.operand); + } + } + } + + function bindPostfixUnaryExpressionFlow(node: PostfixUnaryExpression) { + forEachChild(node, bind); + if (node.operator === SyntaxKind.PlusPlusToken || node.operator === SyntaxKind.MinusMinusToken) { + bindAssignmentTargetFlow(node.operand); } } @@ -1150,8 +1163,8 @@ namespace ts { currentFlow = finishFlowLabel(postExpressionLabel); } - function bindInitializedVariableFlow(node: VariableDeclaration | BindingElement) { - const name = node.name; + function bindInitializedVariableFlow(node: VariableDeclaration | ArrayBindingElement) { + const name = !isOmittedExpression(node) ? node.name : undefined; if (isBindingPattern(name)) { for (const child of name.elements) { bindInitializedVariableFlow(child); diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index da0b09cc781..c82e0ece074 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -334,6 +334,7 @@ namespace ts { const assignableRelation = createMap(); const comparableRelation = createMap(); const identityRelation = createMap(); + const enumRelation = createMap(); // This is for caching the result of getSymbolDisplayBuilder. Do not access directly. let _displayBuilder: SymbolDisplayBuilder; @@ -876,7 +877,8 @@ namespace ts { if (nameNotFoundMessage) { if (!errorLocation || !checkAndReportErrorForMissingPrefix(errorLocation, name, nameArg) && - !checkAndReportErrorForExtendingInterface(errorLocation)) { + !checkAndReportErrorForExtendingInterface(errorLocation) && + !checkAndReportErrorForUsingTypeAsValue(errorLocation, name, meaning)) { error(errorLocation, nameNotFoundMessage, typeof nameArg === "string" ? nameArg : declarationNameToString(nameArg)); } } @@ -986,6 +988,16 @@ namespace ts { } } + function checkAndReportErrorForUsingTypeAsValue(errorLocation: Node, name: string, meaning: SymbolFlags): boolean { + if (meaning & (SymbolFlags.Value & ~SymbolFlags.NamespaceModule)) { + const symbol = resolveSymbol(resolveName(errorLocation, name, SymbolFlags.Type & ~SymbolFlags.Value, /*nameNotFoundMessage*/undefined, /*nameArg*/ undefined)); + if (symbol && !(symbol.flags & SymbolFlags.NamespaceModule)) { + error(errorLocation, Diagnostics._0_only_refers_to_a_type_but_is_being_used_as_a_value_here, name); + return true; + } + } + return false; + } function checkResolvedBlockScopedVariable(result: Symbol, errorLocation: Node): void { Debug.assert((result.flags & SymbolFlags.BlockScopedVariable) !== 0); @@ -1043,7 +1055,7 @@ namespace ts { const moduleSymbol = resolveExternalModuleName(node, (node.parent).moduleSpecifier); if (moduleSymbol) { - const exportDefaultSymbol = isShorthandAmbientModule(moduleSymbol.valueDeclaration) ? + const exportDefaultSymbol = isShorthandAmbientModuleSymbol(moduleSymbol) ? moduleSymbol : moduleSymbol.exports["export="] ? getPropertyOfType(getTypeOfSymbol(moduleSymbol.exports["export="]), "default") : @@ -1119,7 +1131,7 @@ namespace ts { if (targetSymbol) { const name = specifier.propertyName || specifier.name; if (name.text) { - if (isShorthandAmbientModule(moduleSymbol.valueDeclaration)) { + if (isShorthandAmbientModuleSymbol(moduleSymbol)) { return moduleSymbol; } @@ -1301,11 +1313,10 @@ namespace ts { else if (namespace === unknownSymbol) { return namespace; } - symbol = getSymbol(getExportsOfSymbol(namespace), right.text, meaning); if (!symbol) { if (!ignoreErrors) { - error(right, Diagnostics.Module_0_has_no_exported_member_1, getFullyQualifiedName(namespace), declarationNameToString(right)); + error(right, Diagnostics.Namespace_0_has_no_exported_member_1, getFullyQualifiedName(namespace), declarationNameToString(right)); } return undefined; } @@ -2068,7 +2079,7 @@ namespace ts { parentSymbol = symbol; } - // const the writer know we just wrote out a symbol. The declaration emitter writer uses + // Let the writer know we just wrote out a symbol. The declaration emitter writer uses // this to determine if an import it has previously seen (and not written out) needs // to be written to the file once the walk of the tree is complete. // @@ -2076,37 +2087,34 @@ namespace ts { // up front (for example, during checking) could determine if we need to emit the imports // and we could then access that data during declaration emit. writer.trackSymbol(symbol, enclosingDeclaration, meaning); - function walkSymbol(symbol: Symbol, meaning: SymbolFlags): void { - if (symbol) { - const accessibleSymbolChain = getAccessibleSymbolChain(symbol, enclosingDeclaration, meaning, !!(flags & SymbolFormatFlags.UseOnlyExternalAliasing)); + /** @param endOfChain Set to false for recursive calls; non-recursive calls should always output something. */ + function walkSymbol(symbol: Symbol, meaning: SymbolFlags, endOfChain: boolean): void { + const accessibleSymbolChain = getAccessibleSymbolChain(symbol, enclosingDeclaration, meaning, !!(flags & SymbolFormatFlags.UseOnlyExternalAliasing)); - if (!accessibleSymbolChain || - needsQualification(accessibleSymbolChain[0], enclosingDeclaration, accessibleSymbolChain.length === 1 ? meaning : getQualifiedLeftMeaning(meaning))) { + if (!accessibleSymbolChain || + needsQualification(accessibleSymbolChain[0], enclosingDeclaration, accessibleSymbolChain.length === 1 ? meaning : getQualifiedLeftMeaning(meaning))) { - // Go up and add our parent. - walkSymbol( - getParentOfSymbol(accessibleSymbolChain ? accessibleSymbolChain[0] : symbol), - getQualifiedLeftMeaning(meaning)); + // Go up and add our parent. + const parent = getParentOfSymbol(accessibleSymbolChain ? accessibleSymbolChain[0] : symbol); + if (parent) { + walkSymbol(parent, getQualifiedLeftMeaning(meaning), /*endOfChain*/ false); } + } - if (accessibleSymbolChain) { - for (const accessibleSymbol of accessibleSymbolChain) { - appendParentTypeArgumentsAndSymbolName(accessibleSymbol); - } + if (accessibleSymbolChain) { + for (const accessibleSymbol of accessibleSymbolChain) { + appendParentTypeArgumentsAndSymbolName(accessibleSymbol); } - else { - // If we didn't find accessible symbol chain for this symbol, break if this is external module - if (!parentSymbol && ts.forEach(symbol.declarations, hasExternalModuleSymbol)) { - return; - } + } + else if ( + // If this is the last part of outputting the symbol, always output. The cases apply only to parent symbols. + endOfChain || + // If a parent symbol is an external module, don't write it. (We prefer just `x` vs `"foo/bar".x`.) + !(!parentSymbol && ts.forEach(symbol.declarations, hasExternalModuleSymbol)) && + // If a parent symbol is an anonymous type, don't write it. + !(symbol.flags & (SymbolFlags.TypeLiteral | SymbolFlags.ObjectLiteral))) { - // if this is anonymous type break - if (symbol.flags & SymbolFlags.TypeLiteral || symbol.flags & SymbolFlags.ObjectLiteral) { - return; - } - - appendParentTypeArgumentsAndSymbolName(symbol); - } + appendParentTypeArgumentsAndSymbolName(symbol); } } @@ -2116,11 +2124,11 @@ namespace ts { const isTypeParameter = symbol.flags & SymbolFlags.TypeParameter; const typeFormatFlag = TypeFormatFlags.UseFullyQualifiedType & typeFlags; if (!isTypeParameter && (enclosingDeclaration || typeFormatFlag)) { - walkSymbol(symbol, meaning); - return; + walkSymbol(symbol, meaning, /*endOfChain*/ true); + } + else { + appendParentTypeArgumentsAndSymbolName(symbol); } - - return appendParentTypeArgumentsAndSymbolName(symbol); } function buildTypeDisplay(type: Type, writer: SymbolWriter, enclosingDeclaration?: Node, globalFlags?: TypeFormatFlags, symbolStack?: Symbol[]) { @@ -2505,8 +2513,8 @@ namespace ts { } } - function buildBindingElementDisplay(bindingElement: BindingElement, writer: SymbolWriter, enclosingDeclaration?: Node, flags?: TypeFormatFlags, symbolStack?: Symbol[]) { - if (bindingElement.kind === SyntaxKind.OmittedExpression) { + function buildBindingElementDisplay(bindingElement: ArrayBindingElement, writer: SymbolWriter, enclosingDeclaration?: Node, flags?: TypeFormatFlags, symbolStack?: Symbol[]) { + if (isOmittedExpression(bindingElement)) { return; } Debug.assert(bindingElement.kind === SyntaxKind.BindingElement); @@ -2922,7 +2930,7 @@ namespace ts { // undefined or any type of the parent. if (!parentType || isTypeAny(parentType)) { if (declaration.initializer) { - return checkExpressionCached(declaration.initializer); + return checkDeclarationInitializer(declaration); } return parentType; } @@ -2982,7 +2990,9 @@ namespace ts { if (strictNullChecks && declaration.initializer && !(getFalsyFlags(checkExpressionCached(declaration.initializer)) & TypeFlags.Undefined)) { type = getTypeWithFacts(type, TypeFacts.NEUndefined); } - return type; + return declaration.initializer ? + getUnionType([type, checkExpressionCached(declaration.initializer)], /*subtypeReduction*/ true) : + type; } function getTypeForVariableLikeDeclarationFromJSDocComment(declaration: VariableLikeDeclaration) { @@ -3091,7 +3101,8 @@ namespace ts { // Use the type of the initializer expression if one is present if (declaration.initializer) { - return addOptionality(checkExpressionCached(declaration.initializer), /*optional*/ declaration.questionToken && includeOptionality); + const type = checkDeclarationInitializer(declaration); + return addOptionality(type, /*optional*/ declaration.questionToken && includeOptionality); } // If it is a short-hand property assignment, use the type of the identifier @@ -3113,7 +3124,7 @@ namespace ts { // pattern. Otherwise, it is the type any. function getTypeFromBindingElement(element: BindingElement, includePatternInType?: boolean, reportErrors?: boolean): Type { if (element.initializer) { - return checkExpressionCached(element.initializer); + return checkDeclarationInitializer(element); } if (isBindingPattern(element.name)) { return getTypeFromBindingPattern(element.name, includePatternInType, reportErrors); @@ -3125,7 +3136,7 @@ namespace ts { } // Return the type implied by an object binding pattern - function getTypeFromObjectBindingPattern(pattern: BindingPattern, includePatternInType: boolean, reportErrors: boolean): Type { + function getTypeFromObjectBindingPattern(pattern: ObjectBindingPattern, includePatternInType: boolean, reportErrors: boolean): Type { const members = createMap(); let hasComputedProperties = false; forEach(pattern.elements, e => { @@ -3156,11 +3167,12 @@ namespace ts { // Return the type implied by an array binding pattern function getTypeFromArrayBindingPattern(pattern: BindingPattern, includePatternInType: boolean, reportErrors: boolean): Type { const elements = pattern.elements; - if (elements.length === 0 || elements[elements.length - 1].dotDotDotToken) { + const lastElement = lastOrUndefined(elements); + if (elements.length === 0 || (!isOmittedExpression(lastElement) && lastElement.dotDotDotToken)) { return languageVersion >= ScriptTarget.ES6 ? createIterableType(anyType) : anyArrayType; } // If the pattern has at least one element, and no rest element, then it should imply a tuple type. - const elementTypes = map(elements, e => e.kind === SyntaxKind.OmittedExpression ? anyType : getTypeFromBindingElement(e, includePatternInType, reportErrors)); + const elementTypes = map(elements, e => isOmittedExpression(e) ? anyType : getTypeFromBindingElement(e, includePatternInType, reportErrors)); let result = createTupleType(elementTypes); if (includePatternInType) { result = cloneTypeReference(result); @@ -3178,8 +3190,8 @@ namespace ts { // the parameter. function getTypeFromBindingPattern(pattern: BindingPattern, includePatternInType?: boolean, reportErrors?: boolean): Type { return pattern.kind === SyntaxKind.ObjectBindingPattern - ? getTypeFromObjectBindingPattern(pattern, includePatternInType, reportErrors) - : getTypeFromArrayBindingPattern(pattern, includePatternInType, reportErrors); + ? getTypeFromObjectBindingPattern(pattern, includePatternInType, reportErrors) + : getTypeFromArrayBindingPattern(pattern, includePatternInType, reportErrors); } // Return the type associated with a variable, parameter, or property declaration. In the simple case this is the type @@ -3381,7 +3393,7 @@ namespace ts { function getTypeOfFuncClassEnumModule(symbol: Symbol): Type { const links = getSymbolLinks(symbol); if (!links.type) { - if (symbol.valueDeclaration.kind === SyntaxKind.ModuleDeclaration && isShorthandAmbientModule(symbol.valueDeclaration)) { + if (symbol.valueDeclaration.kind === SyntaxKind.ModuleDeclaration && isShorthandAmbientModuleSymbol(symbol)) { links.type = anyType; } else { @@ -3396,7 +3408,7 @@ namespace ts { function getTypeOfEnumMember(symbol: Symbol): Type { const links = getSymbolLinks(symbol); if (!links.type) { - links.type = getDeclaredTypeOfEnum(getParentOfSymbol(symbol)); + links.type = getDeclaredTypeOfEnumMember(symbol); } return links.type; } @@ -5711,7 +5723,7 @@ namespace ts { function getInferenceMapper(context: InferenceContext): TypeMapper { if (!context.mapper) { const mapper: TypeMapper = t => { - const typeParameters = context.typeParameters; + const typeParameters = context.signature.typeParameters; for (let i = 0; i < typeParameters.length; i++) { if (t === typeParameters[i]) { context.inferences[i].isFixed = true; @@ -5720,7 +5732,7 @@ namespace ts { } return t; }; - mapper.mappedTypes = context.typeParameters; + mapper.mappedTypes = context.signature.typeParameters; mapper.context = context; context.mapper = mapper; } @@ -6203,8 +6215,14 @@ namespace ts { if (source === target) { return true; } - if (source.symbol.name !== target.symbol.name || !(source.symbol.flags & SymbolFlags.RegularEnum) || !(target.symbol.flags & SymbolFlags.RegularEnum)) { - return false; + const id = source.id + "," + target.id; + if (enumRelation[id] !== undefined) { + return enumRelation[id]; + } + if (source.symbol.name !== target.symbol.name || + !(source.symbol.flags & SymbolFlags.RegularEnum) || !(target.symbol.flags & SymbolFlags.RegularEnum) || + (source.flags & TypeFlags.Union) !== (target.flags & TypeFlags.Union)) { + return enumRelation[id] = false; } const targetEnumType = getTypeOfSymbol(target.symbol); for (const property of getPropertiesOfType(getTypeOfSymbol(source.symbol))) { @@ -6215,11 +6233,11 @@ namespace ts { errorReporter(Diagnostics.Property_0_is_missing_in_type_1, property.name, typeToString(target, /*enclosingDeclaration*/ undefined, TypeFormatFlags.UseFullyQualifiedType)); } - return false; + return enumRelation[id] = false; } } } - return true; + return enumRelation[id] = true; } function isSimpleTypeRelatedTo(source: Type, target: Type, relation: Map, errorReporter?: ErrorReporter) { @@ -6234,8 +6252,18 @@ namespace ts { if (source.flags & TypeFlags.Null && (!strictNullChecks || target.flags & TypeFlags.Null)) return true; if (relation === assignableRelation || relation === comparableRelation) { if (source.flags & TypeFlags.Any) return true; - if (source.flags & (TypeFlags.Number | TypeFlags.NumberLiteral) && target.flags & TypeFlags.Enum) return true; - if (source.flags & TypeFlags.NumberLiteral && target.flags & TypeFlags.EnumLiteral && (source).text === (target).text) return true; + if ((source.flags & TypeFlags.Number | source.flags & TypeFlags.NumberLiteral) && target.flags & TypeFlags.EnumLike) return true; + if (source.flags & TypeFlags.EnumLiteral && + target.flags & TypeFlags.EnumLiteral && + (source).text === (target).text && + isEnumTypeRelatedTo((source).baseType, (target).baseType, errorReporter)) { + return true; + } + if (source.flags & TypeFlags.EnumLiteral && + target.flags & TypeFlags.Enum && + isEnumTypeRelatedTo(target, (source).baseType, errorReporter)) { + return true; + } } return false; } @@ -7145,15 +7173,36 @@ namespace ts { return true; } + function literalTypesWithSameBaseType(types: Type[]): boolean { + let commonBaseType: Type; + for (const t of types) { + const baseType = getBaseTypeOfLiteralType(t); + if (!commonBaseType) { + commonBaseType = baseType; + } + if (baseType === t || baseType !== commonBaseType) { + return false; + } + } + return true; + } + + // When the candidate types are all literal types with the same base type, the common + // supertype is a union of those literal types. Otherwise, the common supertype is the + // first type that is a supertype of each of the other types. + function getSupertypeOrUnion(types: Type[]): Type { + return literalTypesWithSameBaseType(types) ? getUnionType(types) : forEach(types, t => isSupertypeOfEach(t, types) ? t : undefined); + } + function getCommonSupertype(types: Type[]): Type { if (!strictNullChecks) { - return forEach(types, t => isSupertypeOfEach(t, types) ? t : undefined); + return getSupertypeOrUnion(types); } const primaryTypes = filter(types, t => !(t.flags & TypeFlags.Nullable)); if (!primaryTypes.length) { return getUnionType(types, /*subtypeReduction*/ true); } - const supertype = forEach(primaryTypes, t => isSupertypeOfEach(t, primaryTypes) ? t : undefined); + const supertype = getSupertypeOrUnion(primaryTypes); return supertype && includeFalsyTypes(supertype, getFalsyFlagsOfTypes(types) & TypeFlags.Nullable); } @@ -7217,18 +7266,18 @@ namespace ts { return (type.flags & (TypeFlags.Literal | TypeFlags.Undefined | TypeFlags.Null)) !== 0; } - function isUnitUnionType(type: Type): boolean { + function isLiteralType(type: Type): boolean { return type.flags & TypeFlags.Boolean ? true : type.flags & TypeFlags.Union ? type.flags & TypeFlags.Enum ? true : !forEach((type).types, t => !isUnitType(t)) : isUnitType(type); } - function getBaseTypeOfUnitType(type: Type): Type { + function getBaseTypeOfLiteralType(type: Type): Type { return type.flags & TypeFlags.StringLiteral ? stringType : type.flags & TypeFlags.NumberLiteral ? numberType : type.flags & TypeFlags.BooleanLiteral ? booleanType : type.flags & TypeFlags.EnumLiteral ? (type).baseType : - type.flags & TypeFlags.Union && !(type.flags & TypeFlags.Enum) ? getUnionType(map((type).types, getBaseTypeOfUnitType)) : + type.flags & TypeFlags.Union && !(type.flags & TypeFlags.Enum) ? getUnionType(map((type).types, getBaseTypeOfLiteralType)) : type; } @@ -7482,14 +7531,13 @@ namespace ts { } } - function createInferenceContext(typeParameters: TypeParameter[], inferUnionTypes: boolean): InferenceContext { - const inferences = map(typeParameters, createTypeInferencesObject); - + function createInferenceContext(signature: Signature, inferUnionTypes: boolean): InferenceContext { + const inferences = map(signature.typeParameters, createTypeInferencesObject); return { - typeParameters, + signature, inferUnionTypes, inferences, - inferredTypes: new Array(typeParameters.length), + inferredTypes: new Array(signature.typeParameters.length), }; } @@ -7497,6 +7545,7 @@ namespace ts { return { primary: undefined, secondary: undefined, + topLevel: true, isFixed: false, }; } @@ -7518,13 +7567,18 @@ namespace ts { return type.couldContainTypeParameters; } - function inferTypes(context: InferenceContext, source: Type, target: Type) { + function isTypeParameterAtTopLevel(type: Type, typeParameter: TypeParameter): boolean { + return type === typeParameter || type.flags & TypeFlags.UnionOrIntersection && forEach((type).types, t => isTypeParameterAtTopLevel(t, typeParameter)); + } + + function inferTypes(context: InferenceContext, originalSource: Type, originalTarget: Type) { + const typeParameters = context.signature.typeParameters; let sourceStack: Type[]; let targetStack: Type[]; let depth = 0; let inferiority = 0; const visited = createMap(); - inferFromTypes(source, target); + inferFromTypes(originalSource, originalTarget); function isInProcess(source: Type, target: Type) { for (let i = 0; i < depth; i++) { @@ -7578,7 +7632,6 @@ namespace ts { if (source.flags & TypeFlags.ContainsAnyFunctionType) { return; } - const typeParameters = context.typeParameters; for (let i = 0; i < typeParameters.length; i++) { if (target === typeParameters[i]) { const inferences = context.inferences[i]; @@ -7595,6 +7648,9 @@ namespace ts { if (!contains(candidates, source)) { candidates.push(source); } + if (!isTypeParameterAtTopLevel(originalTarget, target)) { + inferences.topLevel = false; + } } return; } @@ -7615,7 +7671,7 @@ namespace ts { let typeParameter: TypeParameter; // First infer to each type in union or intersection that isn't a type parameter for (const t of targetTypes) { - if (t.flags & TypeFlags.TypeParameter && contains(context.typeParameters, t)) { + if (t.flags & TypeFlags.TypeParameter && contains(typeParameters, t)) { typeParameter = t; typeParameterCount++; } @@ -7690,8 +7746,12 @@ namespace ts { } } + function inferFromParameterTypes(source: Type, target: Type) { + return inferFromTypes(source, target); + } + function inferFromSignature(source: Signature, target: Signature) { - forEachMatchingParameterType(source, target, inferFromTypes); + forEachMatchingParameterType(source, target, inferFromParameterTypes); if (source.typePredicate && target.typePredicate && source.typePredicate.kind === target.typePredicate.kind) { inferFromTypes(source.typePredicate.type, target.typePredicate.type); @@ -7750,14 +7810,28 @@ namespace ts { return inferences.primary || inferences.secondary || emptyArray; } + function hasPrimitiveConstraint(type: TypeParameter): boolean { + const constraint = getConstraintOfTypeParameter(type); + return constraint && maybeTypeOfKind(constraint, TypeFlags.Primitive); + } + function getInferredType(context: InferenceContext, index: number): Type { let inferredType = context.inferredTypes[index]; let inferenceSucceeded: boolean; if (!inferredType) { const inferences = getInferenceCandidates(context, index); if (inferences.length) { + // We widen inferred literal types if + // all inferences were made to top-level ocurrences of the type parameter, and + // the type parameter has no constraint or its constraint includes no primitive or literal types, and + // the type parameter was fixed during inference or does not occur at top-level in the return type. + const signature = context.signature; + const widenLiteralTypes = context.inferences[index].topLevel && + !hasPrimitiveConstraint(signature.typeParameters[index]) && + (context.inferences[index].isFixed || !isTypeParameterAtTopLevel(getReturnTypeOfSignature(signature), signature.typeParameters[index])); + const baseInferences = widenLiteralTypes ? map(inferences, getBaseTypeOfLiteralType) : inferences; // Infer widened union or supertype, or the unknown type for no common supertype - const unionOrSuperType = context.inferUnionTypes ? getUnionType(inferences, /*subtypeReduction*/ true) : getCommonSupertype(inferences); + const unionOrSuperType = context.inferUnionTypes ? getUnionType(baseInferences, /*subtypeReduction*/ true) : getCommonSupertype(baseInferences); inferredType = unionOrSuperType ? getWidenedType(unionOrSuperType) : unknownType; inferenceSucceeded = !!unionOrSuperType; } @@ -7773,7 +7847,7 @@ namespace ts { // Only do the constraint check if inference succeeded (to prevent cascading errors) if (inferenceSucceeded) { - const constraint = getConstraintOfTypeParameter(context.typeParameters[index]); + const constraint = getConstraintOfTypeParameter(context.signature.typeParameters[index]); if (constraint) { const instantiatedConstraint = instantiateType(constraint, getInferenceMapper(context)); if (!isTypeAssignableTo(inferredType, getTypeWithThisArgument(instantiatedConstraint, inferredType))) { @@ -7920,7 +7994,7 @@ namespace ts { if (prop && prop.flags & SymbolFlags.SyntheticProperty) { if ((prop).isDiscriminantProperty === undefined) { (prop).isDiscriminantProperty = !(prop).hasCommonType && - isUnitUnionType(getTypeOfSymbol(prop)); + isLiteralType(getTypeOfSymbol(prop)); } return (prop).isDiscriminantProperty; } @@ -8323,7 +8397,8 @@ namespace ts { // Assignments only narrow the computed type if the declared type is a union type. Thus, we // only need to evaluate the assigned type if the declared type is a union type. if (isMatchingReference(reference, node)) { - return declaredType.flags & TypeFlags.Union ? + const isIncrementOrDecrement = node.parent.kind === SyntaxKind.PrefixUnaryExpression || node.parent.kind === SyntaxKind.PostfixUnaryExpression; + return declaredType.flags & TypeFlags.Union && !isIncrementOrDecrement ? getAssignmentReducedType(declaredType, getInitialOrAssignedType(node)) : declaredType; } @@ -8536,6 +8611,9 @@ namespace ts { } function narrowTypeByEquality(type: Type, operator: SyntaxKind, value: Expression, assumeTrue: boolean): Type { + if (type.flags & TypeFlags.Any) { + return type; + } if (operator === SyntaxKind.ExclamationEqualsToken || operator === SyntaxKind.ExclamationEqualsEqualsToken) { assumeTrue = !assumeTrue; } @@ -8679,7 +8757,7 @@ namespace ts { // type. Otherwise, the types are completely unrelated, so narrow to an intersection of the // two types. const targetType = type.flags & TypeFlags.TypeParameter ? getApparentType(type) : type; - return isTypeSubtypeOf(candidate, targetType) ? candidate : + return isTypeSubtypeOf(candidate, type) ? candidate : isTypeAssignableTo(type, candidate) ? type : isTypeAssignableTo(candidate, targetType) ? candidate : getIntersectionType([type, candidate]); @@ -8919,6 +8997,7 @@ namespace ts { const isParameter = getRootDeclaration(declaration).kind === SyntaxKind.Parameter; const declarationContainer = getControlFlowContainer(declaration); let flowContainer = getControlFlowContainer(node); + const isOuterVariable = flowContainer !== declarationContainer; // When the control flow originates in a function expression or arrow function and we are referencing // a const variable or parameter from an outer function, we extend the origin of the control flow // analysis to include the immediately enclosing function. @@ -8931,7 +9010,7 @@ namespace ts { // the entire control flow graph from the variable's declaration (i.e. when the flow container and // declaration container are the same). const assumeInitialized = !strictNullChecks || (type.flags & TypeFlags.Any) !== 0 || isParameter || - flowContainer !== declarationContainer || isInAmbientContext(declaration); + isOuterVariable || isInAmbientContext(declaration); const flowType = getFlowTypeOfReference(node, type, assumeInitialized, flowContainer); // A variable is considered uninitialized when it is possible to analyze the entire control flow graph // from declaration to use, and when the variable's declared type doesn't include undefined but the @@ -9438,14 +9517,14 @@ namespace ts { if (parameter.dotDotDotToken) { const restTypes: Type[] = []; for (let i = indexOfParameter; i < iife.arguments.length; i++) { - restTypes.push(getTypeOfExpression(iife.arguments[i])); + restTypes.push(getBaseTypeOfLiteralType(checkExpression(iife.arguments[i]))); } return createArrayType(getUnionType(restTypes)); } const links = getNodeLinks(iife); const cached = links.resolvedSignature; links.resolvedSignature = anySignature; - const type = checkExpression(iife.arguments[indexOfParameter]); + const type = getBaseTypeOfLiteralType(checkExpression(iife.arguments[indexOfParameter])); links.resolvedSignature = cached; return type; } @@ -9796,6 +9875,7 @@ namespace ts { case SyntaxKind.BinaryExpression: return getContextualTypeForBinaryOperand(node); case SyntaxKind.PropertyAssignment: + case SyntaxKind.ShorthandPropertyAssignment: return getContextualTypeForObjectLiteralElement(parent); case SyntaxKind.ArrayLiteralExpression: return getContextualTypeForElementExpression(node); @@ -9815,31 +9895,6 @@ namespace ts { return undefined; } - function isLiteralTypeLocation(node: Node): boolean { - const parent = node.parent; - switch (parent.kind) { - case SyntaxKind.BinaryExpression: - switch ((parent).operatorToken.kind) { - case SyntaxKind.EqualsEqualsEqualsToken: - case SyntaxKind.ExclamationEqualsEqualsToken: - case SyntaxKind.EqualsEqualsToken: - case SyntaxKind.ExclamationEqualsToken: - return true; - } - break; - case SyntaxKind.ConditionalExpression: - return (node === (parent).whenTrue || - node === (parent).whenFalse) && - isLiteralTypeLocation(parent); - case SyntaxKind.ParenthesizedExpression: - return isLiteralTypeLocation(parent); - case SyntaxKind.CaseClause: - case SyntaxKind.LiteralType: - return true; - } - return false; - } - // If the given type is an object or union type, if that type has a single signature, and if // that signature is non-generic, return the signature. Otherwise return undefined. function getNonGenericSignature(type: Type): Signature { @@ -9976,7 +10031,7 @@ namespace ts { } } else { - const type = checkExpression(e, contextualMapper); + const type = checkExpressionForMutableLocation(e, contextualMapper); elementTypes.push(type); } hasSpreadElement = hasSpreadElement || e.kind === SyntaxKind.SpreadElementExpression; @@ -10033,6 +10088,10 @@ namespace ts { return isTypeAny(type) || isTypeOfKind(type, kind); } + function isInfinityOrNaNString(name: string): boolean { + return name === "Infinity" || name === "-Infinity" || name === "NaN"; + } + function isNumericLiteralName(name: string) { // The intent of numeric names is that // - they are names with text in a numeric form, and that @@ -10116,7 +10175,7 @@ namespace ts { } else { Debug.assert(memberDecl.kind === SyntaxKind.ShorthandPropertyAssignment); - type = checkExpression((memberDecl).name, contextualMapper); + type = checkExpressionForMutableLocation((memberDecl).name, contextualMapper); } typeFlags |= type.flags; const prop = createSymbol(SymbolFlags.Property | SymbolFlags.Transient | member.flags, member.name); @@ -10818,7 +10877,7 @@ namespace ts { const prop = getPropertyOfType(apparentType, right.text); if (!prop) { if (right.text && !checkAndReportErrorForExtendingInterface(node)) { - error(right, Diagnostics.Property_0_does_not_exist_on_type_1, declarationNameToString(right), typeToString(type.flags & TypeFlags.ThisType ? apparentType : type)); + reportNonexistentProperty(right, type.flags & TypeFlags.ThisType ? apparentType : type); } return unknownType; } @@ -10841,10 +10900,7 @@ namespace ts { checkClassPropertyAccess(node, left, apparentType, prop); } - let propType = getTypeOfSymbol(prop); - if (prop.flags & SymbolFlags.EnumMember && isLiteralContextForType(node, propType)) { - propType = getDeclaredTypeOfSymbol(prop); - } + const propType = getTypeOfSymbol(prop); // Only compute control flow type if this is a property access expression that isn't an // assignment target, and the referenced property was declared as a variable, property, @@ -10855,6 +10911,20 @@ namespace ts { return propType; } return getFlowTypeOfReference(node, propType, /*assumeInitialized*/ true, /*flowContainer*/ undefined); + + function reportNonexistentProperty(propNode: Identifier, containingType: Type) { + let errorInfo: DiagnosticMessageChain; + if (containingType.flags & TypeFlags.Union && !(containingType.flags & TypeFlags.Primitive)) { + for (const subtype of (containingType as UnionType).types) { + if (!getPropertyOfType(subtype, propNode.text)) { + errorInfo = chainDiagnosticMessages(errorInfo, Diagnostics.Property_0_does_not_exist_on_type_1, declarationNameToString(propNode), typeToString(subtype)); + break; + } + } + } + errorInfo = chainDiagnosticMessages(errorInfo, Diagnostics.Property_0_does_not_exist_on_type_1, declarationNameToString(propNode), typeToString(containingType)); + diagnostics.add(createDiagnosticForNodeFromMessageChain(propNode, errorInfo)); + } } function isValidPropertyAccess(node: PropertyAccessExpression | QualifiedName, propertyName: string): boolean { @@ -11262,7 +11332,7 @@ namespace ts { // Instantiate a generic signature in the context of a non-generic signature (section 3.8.5 in TypeScript spec) function instantiateSignatureInContextOf(signature: Signature, contextualSignature: Signature, contextualMapper: TypeMapper): Signature { - const context = createInferenceContext(signature.typeParameters, /*inferUnionTypes*/ true); + const context = createInferenceContext(signature, /*inferUnionTypes*/ true); forEachMatchingParameterType(contextualSignature, signature, (source, target) => { // Type parameters from outer context referenced by source type are fixed by instantiation of the source type inferTypes(context, instantiateType(source, contextualMapper), target); @@ -11918,7 +11988,7 @@ namespace ts { let candidate: Signature; let typeArgumentsAreValid: boolean; const inferenceContext = originalCandidate.typeParameters - ? createInferenceContext(originalCandidate.typeParameters, /*inferUnionTypes*/ false) + ? createInferenceContext(originalCandidate, /*inferUnionTypes*/ false) : undefined; while (true) { @@ -12026,7 +12096,7 @@ namespace ts { error(node, Diagnostics.Value_of_type_0_is_not_callable_Did_you_mean_to_include_new, typeToString(funcType)); } else { - error(node, Diagnostics.Cannot_invoke_an_expression_whose_type_lacks_a_call_signature); + error(node, Diagnostics.Cannot_invoke_an_expression_whose_type_lacks_a_call_signature_Type_0_has_no_compatible_call_signatures, typeToString(apparentType)); } return resolveErrorCall(node); } @@ -12188,7 +12258,7 @@ namespace ts { } if (!callSignatures.length) { - error(node, Diagnostics.Cannot_invoke_an_expression_whose_type_lacks_a_call_signature); + error(node, Diagnostics.Cannot_invoke_an_expression_whose_type_lacks_a_call_signature_Type_0_has_no_compatible_call_signatures, typeToString(apparentType)); return resolveErrorCall(node); } @@ -12236,7 +12306,7 @@ namespace ts { const headMessage = getDiagnosticHeadMessageForDecoratorResolution(node); if (!callSignatures.length) { let errorInfo: DiagnosticMessageChain; - errorInfo = chainDiagnosticMessages(errorInfo, Diagnostics.Cannot_invoke_an_expression_whose_type_lacks_a_call_signature); + errorInfo = chainDiagnosticMessages(errorInfo, Diagnostics.Cannot_invoke_an_expression_whose_type_lacks_a_call_signature_Type_0_has_no_compatible_call_signatures, typeToString(apparentType)); errorInfo = chainDiagnosticMessages(errorInfo, headMessage); diagnostics.add(createDiagnosticForNodeFromMessageChain(node, errorInfo)); return resolveErrorCall(node); @@ -12349,7 +12419,7 @@ namespace ts { } function checkAssertion(node: AssertionExpression) { - const exprType = getRegularTypeOfObjectLiteral(checkExpression(node.expression)); + const exprType = getRegularTypeOfObjectLiteral(getBaseTypeOfLiteralType(checkExpression(node.expression))); checkSourceElement(node.type); const targetType = getTypeFromTypeNode(node.type); @@ -12409,7 +12479,7 @@ namespace ts { function assignBindingElementTypes(node: VariableLikeDeclaration) { if (isBindingPattern(node.name)) { for (const element of (node.name).elements) { - if (element.kind !== SyntaxKind.OmittedExpression) { + if (!isOmittedExpression(element)) { if (element.name.kind === SyntaxKind.Identifier) { getSymbolLinks(getSymbolOfNode(element)).type = getTypeForBindingElement(element); } @@ -12539,20 +12609,8 @@ namespace ts { return isAsync ? createPromiseReturnType(func, voidType) : voidType; } } - // When yield/return statements are contextually typed we allow the return type to be a union type. - // Otherwise we require the yield/return expressions to have a best common supertype. - type = contextualSignature ? getUnionType(types, /*subtypeReduction*/ true) : getCommonSupertype(types); - if (!type) { - if (funcIsGenerator) { - error(func, Diagnostics.No_best_common_type_exists_among_yield_expressions); - return createIterableIteratorType(unknownType); - } - else { - error(func, Diagnostics.No_best_common_type_exists_among_return_expressions); - // Defer to unioning the return types so we get a) downstream errors earlier and b) better Salsa experience - return isAsync ? createPromiseReturnType(func, getUnionType(types, /*subtypeReduction*/ true)) : getUnionType(types, /*subtypeReduction*/ true); - } - } + // Return a union of the return expression types. + type = getUnionType(types, /*subtypeReduction*/ true); if (funcIsGenerator) { type = createIterableIteratorType(type); @@ -12561,6 +12619,9 @@ namespace ts { if (!contextualSignature) { reportErrorsFromWidening(func, type); } + if (isUnitType(type) && !(contextualSignature && isLiteralContextualType(getReturnTypeOfSignature(contextualSignature)))) { + type = getBaseTypeOfLiteralType(type); + } const widenedType = getWidenedType(type); // From within an async function you can return either a non-promise value or a promise. Any @@ -12596,7 +12657,7 @@ namespace ts { return false; } const type = checkExpression(node.expression); - if (!isUnitUnionType(type)) { + if (!isLiteralType(type)) { return false; } const switchTypes = getSwitchClauseTypes(node); @@ -12939,7 +13000,7 @@ namespace ts { function checkPrefixUnaryExpression(node: PrefixUnaryExpression): Type { const operandType = checkExpression(node.operand); - if (node.operator === SyntaxKind.MinusToken && node.operand.kind === SyntaxKind.NumericLiteral && isLiteralContextForType(node, numberType)) { + if (node.operator === SyntaxKind.MinusToken && node.operand.kind === SyntaxKind.NumericLiteral) { return getLiteralTypeForText(TypeFlags.NumberLiteral, "" + -(node.operand).text); } switch (node.operator) { @@ -13204,6 +13265,72 @@ namespace ts { return sourceType; } + /** + * This is a *shallow* check: An expression is side-effect-free if the + * evaluation of the expression *itself* cannot produce side effects. + * For example, x++ / 3 is side-effect free because the / operator + * does not have side effects. + * The intent is to "smell test" an expression for correctness in positions where + * its value is discarded (e.g. the left side of the comma operator). + */ + function isSideEffectFree(node: Node): boolean { + node = skipParentheses(node); + switch (node.kind) { + case SyntaxKind.Identifier: + case SyntaxKind.StringLiteral: + case SyntaxKind.RegularExpressionLiteral: + case SyntaxKind.TaggedTemplateExpression: + case SyntaxKind.TemplateExpression: + case SyntaxKind.NoSubstitutionTemplateLiteral: + case SyntaxKind.NumericLiteral: + case SyntaxKind.TrueKeyword: + case SyntaxKind.FalseKeyword: + case SyntaxKind.NullKeyword: + case SyntaxKind.UndefinedKeyword: + case SyntaxKind.FunctionExpression: + case SyntaxKind.ClassExpression: + case SyntaxKind.ArrowFunction: + case SyntaxKind.ArrayLiteralExpression: + case SyntaxKind.ObjectLiteralExpression: + case SyntaxKind.TypeOfExpression: + case SyntaxKind.NonNullExpression: + case SyntaxKind.JsxSelfClosingElement: + case SyntaxKind.JsxElement: + return true; + + case SyntaxKind.ConditionalExpression: + return isSideEffectFree((node as ConditionalExpression).whenTrue) && + isSideEffectFree((node as ConditionalExpression).whenFalse); + + case SyntaxKind.BinaryExpression: + if (isAssignmentOperator((node as BinaryExpression).operatorToken.kind)) { + return false; + } + return isSideEffectFree((node as BinaryExpression).left) && + isSideEffectFree((node as BinaryExpression).right); + + case SyntaxKind.PrefixUnaryExpression: + case SyntaxKind.PostfixUnaryExpression: + // Unary operators ~, !, +, and - have no side effects. + // The rest do. + switch ((node as PrefixUnaryExpression).operator) { + case SyntaxKind.ExclamationToken: + case SyntaxKind.PlusToken: + case SyntaxKind.MinusToken: + case SyntaxKind.TildeToken: + return true; + } + return false; + + // Some forms listed here for clarity + case SyntaxKind.VoidExpression: // Explicit opt-out + case SyntaxKind.TypeAssertionExpression: // Not SEF, but can produce useful type warnings + case SyntaxKind.AsExpression: // Not SEF, but can produce useful type warnings + default: + return false; + } + } + function isTypeEqualityComparableTo(source: Type, target: Type) { return (target.flags & TypeFlags.Nullable) !== 0 || isTypeComparableTo(source, target); } @@ -13339,11 +13466,11 @@ namespace ts { case SyntaxKind.ExclamationEqualsToken: case SyntaxKind.EqualsEqualsEqualsToken: case SyntaxKind.ExclamationEqualsEqualsToken: - const leftIsUnit = isUnitUnionType(leftType); - const rightIsUnit = isUnitUnionType(rightType); - if (!leftIsUnit || !rightIsUnit) { - leftType = leftIsUnit ? getBaseTypeOfUnitType(leftType) : leftType; - rightType = rightIsUnit ? getBaseTypeOfUnitType(rightType) : rightType; + const leftIsLiteral = isLiteralType(leftType); + const rightIsLiteral = isLiteralType(rightType); + if (!leftIsLiteral || !rightIsLiteral) { + leftType = leftIsLiteral ? getBaseTypeOfLiteralType(leftType) : leftType; + rightType = rightIsLiteral ? getBaseTypeOfLiteralType(rightType) : rightType; } if (!isTypeEqualityComparableTo(leftType, rightType) && !isTypeEqualityComparableTo(rightType, leftType)) { reportOperatorError(); @@ -13355,7 +13482,7 @@ namespace ts { return checkInExpression(left, right, leftType, rightType); case SyntaxKind.AmpersandAmpersandToken: return getTypeFacts(leftType) & TypeFacts.Truthy ? - includeFalsyTypes(rightType, getFalsyFlags(strictNullChecks ? leftType : getBaseTypeOfUnitType(rightType))) : + includeFalsyTypes(rightType, getFalsyFlags(strictNullChecks ? leftType : getBaseTypeOfLiteralType(rightType))) : leftType; case SyntaxKind.BarBarToken: return getTypeFacts(leftType) & TypeFacts.Falsy ? @@ -13365,6 +13492,9 @@ namespace ts { checkAssignmentOperator(rightType); return getRegularTypeOfObjectLiteral(rightType); case SyntaxKind.CommaToken: + if (!compilerOptions.allowUnreachableCode && isSideEffectFree(left)) { + error(left, Diagnostics.Left_side_of_comma_operator_is_unused_and_has_no_side_effects); + } return rightType; } @@ -13489,64 +13619,18 @@ namespace ts { return getBestChoiceType(type1, type2); } - function typeContainsLiteralFromEnum(type: Type, enumType: EnumType) { - if (type.flags & TypeFlags.Union) { - for (const t of (type).types) { - if (t.flags & TypeFlags.EnumLiteral && (t).baseType === enumType) { - return true; - } - } - } - if (type.flags & TypeFlags.EnumLiteral) { - return (type).baseType === enumType; - } - return false; - } - - function isLiteralContextForType(node: Expression, type: Type) { - if (isLiteralTypeLocation(node)) { - return true; - } - let contextualType = getContextualType(node); - if (contextualType) { - if (contextualType.flags & TypeFlags.TypeParameter) { - const apparentType = getApparentTypeOfTypeParameter(contextualType); - // If the type parameter is constrained to the base primitive type we're checking for, - // consider this a literal context. For example, given a type parameter 'T extends string', - // this causes us to infer string literal types for T. - if (type === apparentType) { - return true; - } - contextualType = apparentType; - } - if (type.flags & TypeFlags.String) { - return maybeTypeOfKind(contextualType, TypeFlags.StringLiteral); - } - if (type.flags & TypeFlags.Number) { - return maybeTypeOfKind(contextualType, (TypeFlags.NumberLiteral | TypeFlags.EnumLiteral)); - } - if (type.flags & TypeFlags.Boolean) { - return maybeTypeOfKind(contextualType, TypeFlags.BooleanLiteral) && !isTypeAssignableTo(booleanType, contextualType); - } - if (type.flags & TypeFlags.Enum) { - return typeContainsLiteralFromEnum(contextualType, type); - } - } - return false; - } - function checkLiteralExpression(node: Expression): Type { if (node.kind === SyntaxKind.NumericLiteral) { checkGrammarNumericLiteral(node); } switch (node.kind) { case SyntaxKind.StringLiteral: - return isLiteralContextForType(node, stringType) ? getLiteralTypeForText(TypeFlags.StringLiteral, (node).text) : stringType; + return getLiteralTypeForText(TypeFlags.StringLiteral, (node).text); case SyntaxKind.NumericLiteral: - return isLiteralContextForType(node, numberType) ? getLiteralTypeForText(TypeFlags.NumberLiteral, (node).text) : numberType; + return getLiteralTypeForText(TypeFlags.NumberLiteral, (node).text); case SyntaxKind.TrueKeyword: case SyntaxKind.FalseKeyword: - return isLiteralContextForType(node, booleanType) ? node.kind === SyntaxKind.TrueKeyword ? trueType : falseType : booleanType; + return node.kind === SyntaxKind.TrueKeyword ? trueType : falseType; } } @@ -13585,6 +13669,40 @@ namespace ts { return links.resolvedType; } + function isTypeAssertion(node: Expression) { + node = skipParenthesizedNodes(node); + return node.kind === SyntaxKind.TypeAssertionExpression || node.kind === SyntaxKind.AsExpression; + } + + function checkDeclarationInitializer(declaration: VariableLikeDeclaration) { + const type = checkExpressionCached(declaration.initializer); + return getCombinedNodeFlags(declaration) & NodeFlags.Const || + getCombinedModifierFlags(declaration) & ModifierFlags.Readonly || + isTypeAssertion(declaration.initializer) ? type : getBaseTypeOfLiteralType(type); + } + + function isLiteralContextualType(contextualType: Type) { + if (contextualType) { + if (contextualType.flags & TypeFlags.TypeParameter) { + const apparentType = getApparentTypeOfTypeParameter(contextualType); + // If the type parameter is constrained to the base primitive type we're checking for, + // consider this a literal context. For example, given a type parameter 'T extends string', + // this causes us to infer string literal types for T. + if (apparentType.flags & (TypeFlags.String | TypeFlags.Number | TypeFlags.Boolean | TypeFlags.Enum)) { + return true; + } + contextualType = apparentType; + } + return maybeTypeOfKind(contextualType, TypeFlags.Literal); + } + return false; + } + + function checkExpressionForMutableLocation(node: Expression, contextualMapper?: TypeMapper): Type { + const type = checkExpression(node, contextualMapper); + return isTypeAssertion(node) || isLiteralContextualType(getContextualType(node)) ? type : getBaseTypeOfLiteralType(type); + } + function checkPropertyAssignment(node: PropertyAssignment, contextualMapper?: TypeMapper): Type { // Do not use hasDynamicName here, because that returns false for well known symbols. // We want to perform checkComputedPropertyName for all computed properties, including @@ -13593,7 +13711,7 @@ namespace ts { checkComputedPropertyName(node.name); } - return checkExpression((node).initializer, contextualMapper); + return checkExpressionForMutableLocation((node).initializer, contextualMapper); } function checkObjectLiteralMethod(node: MethodDeclaration, contextualMapper?: TypeMapper): Type { @@ -13885,7 +14003,12 @@ namespace ts { pattern: BindingPattern, predicateVariableNode: Node, predicateVariableName: string) { - for (const { name } of pattern.elements) { + for (const element of pattern.elements) { + if (isOmittedExpression(element)) { + continue; + } + + const name = element.name; if (name.kind === SyntaxKind.Identifier && (name).text === predicateVariableName) { error(predicateVariableNode, @@ -16848,7 +16971,7 @@ namespace ts { } else { const text = getTextOfPropertyName(member.name); - if (isNumericLiteralName(text)) { + if (isNumericLiteralName(text) && !isInfinityOrNaNString(text)) { error(member.name, Diagnostics.An_enum_member_cannot_have_a_numeric_name); } } @@ -18361,8 +18484,8 @@ namespace ts { function moduleExportsSomeValue(moduleReferenceExpression: Expression): boolean { let moduleSymbol = resolveExternalModuleName(moduleReferenceExpression.parent, moduleReferenceExpression); - if (!moduleSymbol) { - // module not found - be conservative + if (!moduleSymbol || isShorthandAmbientModuleSymbol(moduleSymbol)) { + // If the module is not found or is shorthand, assume that it may export a value. return true; } @@ -18395,7 +18518,7 @@ namespace ts { // When resolved as an expression identifier, if the given node references an exported entity, return the declaration // node of the exported entity's container. Otherwise, return undefined. - function getReferencedExportContainer(node: Identifier, prefixLocals?: boolean): SourceFile | ModuleDeclaration | EnumDeclaration { + function getReferencedExportContainer(node: Identifier, prefixLocals?: boolean): SourceFile | ModuleDeclaration | EnumDeclaration | undefined { node = getParseTreeNode(node, isIdentifier); if (node) { // When resolving the export container for the name of a module or enum @@ -18417,10 +18540,11 @@ namespace ts { const parentSymbol = getParentOfSymbol(symbol); if (parentSymbol) { if (parentSymbol.flags & SymbolFlags.ValueModule && parentSymbol.valueDeclaration.kind === SyntaxKind.SourceFile) { + const symbolFile = parentSymbol.valueDeclaration; + const referenceFile = getSourceFileOfNode(node); // If `node` accesses an export and that export isn't in the same file, then symbol is a namespace export, so return undefined. - if (parentSymbol.valueDeclaration === getSourceFileOfNode(node)) { - return parentSymbol.valueDeclaration; - } + const symbolIsUmdExport = symbolFile !== referenceFile; + return symbolIsUmdExport ? undefined : symbolFile; } for (let n = node.parent; n; n = n.parent) { if (isModuleOrEnumDeclaration(n) && getSymbolOfNode(n) === parentSymbol) { @@ -18430,8 +18554,6 @@ namespace ts { } } } - - return undefined; } // When resolved as an expression identifier, if the given node references an import, return the declaration of @@ -19995,7 +20117,7 @@ namespace ts { else { const elements = (name).elements; for (const element of elements) { - if (element.kind !== SyntaxKind.OmittedExpression) { + if (!isOmittedExpression(element)) { checkGrammarNameInLetOrConstDeclarations(element.name); } } diff --git a/src/compiler/commandLineParser.ts b/src/compiler/commandLineParser.ts index cef72981323..4e8b81da81b 100644 --- a/src/compiler/commandLineParser.ts +++ b/src/compiler/commandLineParser.ts @@ -294,6 +294,7 @@ namespace ts { "classic": ModuleResolutionKind.Classic, }), description: Diagnostics.Specify_module_resolution_strategy_Colon_node_Node_js_or_classic_TypeScript_pre_1_6, + paramType: Diagnostics.STRATEGY, }, { name: "allowUnusedLabels", @@ -805,12 +806,45 @@ namespace ts { * @param basePath A root directory to resolve relative path entries in the config * file to. e.g. outDir */ - export function parseJsonConfigFileContent(json: any, host: ParseConfigHost, basePath: string, existingOptions: CompilerOptions = {}, configFileName?: string): ParsedCommandLine { + export function parseJsonConfigFileContent(json: any, host: ParseConfigHost, basePath: string, existingOptions: CompilerOptions = {}, configFileName?: string, resolutionStack: Path[] = []): ParsedCommandLine { const errors: Diagnostic[] = []; - const compilerOptions: CompilerOptions = convertCompilerOptionsFromJsonWorker(json["compilerOptions"], basePath, errors, configFileName); - const options = extend(existingOptions, compilerOptions); + const getCanonicalFileName = createGetCanonicalFileName(host.useCaseSensitiveFileNames); + const resolvedPath = toPath(configFileName || "", basePath, getCanonicalFileName); + if (resolutionStack.indexOf(resolvedPath) >= 0) { + return { + options: {}, + fileNames: [], + typingOptions: {}, + raw: json, + errors: [createCompilerDiagnostic(Diagnostics.Circularity_detected_while_resolving_configuration_Colon_0, [...resolutionStack, resolvedPath].join(" -> "))], + wildcardDirectories: {} + }; + } + + let options: CompilerOptions = convertCompilerOptionsFromJsonWorker(json["compilerOptions"], basePath, errors, configFileName); const typingOptions: TypingOptions = convertTypingOptionsFromJsonWorker(json["typingOptions"], basePath, errors, configFileName); + if (json["extends"]) { + let [include, exclude, files, baseOptions]: [string[], string[], string[], CompilerOptions] = [undefined, undefined, undefined, {}]; + if (typeof json["extends"] === "string") { + [include, exclude, files, baseOptions] = (tryExtendsName(json["extends"]) || [include, exclude, files, baseOptions]); + } + else { + errors.push(createCompilerDiagnostic(Diagnostics.Compiler_option_0_requires_a_value_of_type_1, "extends", "string")); + } + if (include && !json["include"]) { + json["include"] = include; + } + if (exclude && !json["exclude"]) { + json["exclude"] = exclude; + } + if (files && !json["files"]) { + json["files"] = files; + } + options = assign({}, baseOptions, options); + } + + options = extend(existingOptions, options); options.configFilePath = configFileName; const { fileNames, wildcardDirectories } = getFileNames(errors); @@ -824,6 +858,39 @@ namespace ts { wildcardDirectories }; + function tryExtendsName(extendedConfig: string): [string[], string[], string[], CompilerOptions] { + // If the path isn't a rooted or relative path, don't try to resolve it (we reserve the right to special case module-id like paths in the future) + if (!(isRootedDiskPath(extendedConfig) || startsWith(normalizeSlashes(extendedConfig), "./") || startsWith(normalizeSlashes(extendedConfig), "../"))) { + errors.push(createCompilerDiagnostic(Diagnostics.The_path_in_an_extends_options_must_be_relative_or_rooted)); + return; + } + let extendedConfigPath = toPath(extendedConfig, basePath, getCanonicalFileName); + if (!host.fileExists(extendedConfigPath) && !endsWith(extendedConfigPath, ".json")) { + extendedConfigPath = `${extendedConfigPath}.json` as Path; + if (!host.fileExists(extendedConfigPath)) { + errors.push(createCompilerDiagnostic(Diagnostics.File_0_does_not_exist, extendedConfig)); + return; + } + } + const extendedResult = readConfigFile(extendedConfigPath, path => host.readFile(path)); + if (extendedResult.error) { + errors.push(extendedResult.error); + return; + } + const extendedDirname = getDirectoryPath(extendedConfigPath); + const relativeDifference = convertToRelativePath(extendedDirname, basePath, getCanonicalFileName); + const updatePath: (path: string) => string = path => isRootedDiskPath(path) ? path : combinePaths(relativeDifference, path); + // Merge configs (copy the resolution stack so it is never reused between branches in potential diamond-problem scenarios) + const result = parseJsonConfigFileContent(extendedResult.config, host, extendedDirname, /*existingOptions*/undefined, getBaseFileName(extendedConfigPath), resolutionStack.concat([resolvedPath])); + errors.push(...result.errors); + const [include, exclude, files] = map(["include", "exclude", "files"], key => { + if (!json[key] && extendedResult.config[key]) { + return map(extendedResult.config[key], updatePath); + } + }); + return [include, exclude, files, result.options]; + } + function getFileNames(errors: Diagnostic[]): ExpandResult { let fileNames: string[]; if (hasProperty(json, "files")) { @@ -858,14 +925,13 @@ namespace ts { errors.push(createCompilerDiagnostic(Diagnostics.Unknown_option_excludes_Did_you_mean_exclude)); } else { - // By default, exclude common package folders + // By default, exclude common package folders and the outDir excludeSpecs = ["node_modules", "bower_components", "jspm_packages"]; - } - // Always exclude the output directory unless explicitly included - const outDir = json["compilerOptions"] && json["compilerOptions"]["outDir"]; - if (outDir) { - excludeSpecs.push(outDir); + const outDir = json["compilerOptions"] && json["compilerOptions"]["outDir"]; + if (outDir) { + excludeSpecs.push(outDir); + } } if (fileNames === undefined && includeSpecs === undefined) { diff --git a/src/compiler/core.ts b/src/compiler/core.ts index 75a724e4fd8..72d05e1cfd7 100644 --- a/src/compiler/core.ts +++ b/src/compiler/core.ts @@ -377,6 +377,20 @@ namespace ts { return result; } + export function mapObject(object: MapLike, f: (key: string, x: T) => [string, U]): MapLike { + let result: MapLike; + if (object) { + result = {}; + for (const v of getOwnKeys(object)) { + const [key, value]: [string, U] = f(v, object[v]) || [undefined, undefined]; + if (key !== undefined) { + result[key] = value; + } + } + } + return result; + } + export function concatenate(array1: T[], array2: T[]): T[] { if (!array2 || !array2.length) return array1; if (!array1 || !array1.length) return array2; @@ -639,6 +653,18 @@ namespace ts { } } + export function assign, T2, T3>(t: T1, arg1: T2, arg2: T3): T1 & T2 & T3; + export function assign, T2>(t: T1, arg1: T2): T1 & T2; + export function assign>(t: T1, ...args: any[]): any; + export function assign>(t: T1, ...args: any[]) { + for (const arg of args) { + for (const p of getOwnKeys(arg)) { + t[p] = arg[p]; + } + } + return t; + } + /** * Reduce the properties of a map. * @@ -1018,7 +1044,8 @@ namespace ts { return 0; } - export let directorySeparator = "/"; + export const directorySeparator = "/"; + const directorySeparatorCharCode = CharacterCodes.slash; function getNormalizedParts(normalizedSlashedPath: string, rootLength: number) { const parts = normalizedSlashedPath.substr(rootLength).split(directorySeparator); const normalized: string[] = []; @@ -1043,8 +1070,20 @@ namespace ts { export function normalizePath(path: string): string { path = normalizeSlashes(path); const rootLength = getRootLength(path); + const root = path.substr(0, rootLength); const normalized = getNormalizedParts(path, rootLength); - return path.substr(0, rootLength) + normalized.join(directorySeparator); + if (normalized.length) { + const joinedParts = root + normalized.join(directorySeparator); + return pathEndsWithDirectorySeparator(path) ? joinedParts + directorySeparator : joinedParts; + } + else { + return root; + } + } + + /** A path ending with '/' refers to a directory only, never a file. */ + export function pathEndsWithDirectorySeparator(path: string): boolean { + return path.charCodeAt(path.length - 1) === directorySeparatorCharCode; } export function getDirectoryPath(path: Path): Path; diff --git a/src/compiler/diagnosticMessages.json b/src/compiler/diagnosticMessages.json index cddb132f56c..0f3e90405a6 100644 --- a/src/compiler/diagnosticMessages.json +++ b/src/compiler/diagnosticMessages.json @@ -1043,7 +1043,7 @@ "category": "Error", "code": 2348 }, - "Cannot invoke an expression whose type lacks a call signature.": { + "Cannot invoke an expression whose type lacks a call signature. Type '{0}' has no compatible call signatures.": { "category": "Error", "code": 2349 }, @@ -1063,10 +1063,6 @@ "category": "Error", "code": 2353 }, - "No best common type exists among return expressions.": { - "category": "Error", - "code": 2354 - }, "A function whose declared type is neither 'void' nor 'any' must return a value.": { "category": "Error", "code": 2355 @@ -1631,10 +1627,6 @@ "category": "Error", "code": 2503 }, - "No best common type exists among yield expressions.": { - "category": "Error", - "code": 2504 - }, "A generator cannot have a 'void' type annotation.": { "category": "Error", "code": 2505 @@ -1955,6 +1947,19 @@ "category": "Error", "code": 2692 }, + "'{0}' only refers to a type, but is being used as a value here.": { + "category": "Error", + "code": 2693 + }, + "Namespace '{0}' has no exported member '{1}'.": { + "category": "Error", + "code": 2694 + }, + "Left side of comma operator is unused and has no side effects.": { + "category": "Error", + "code": 2695 + }, + "Import declaration '{0}' is using private name '{1}'.": { "category": "Error", "code": 4000 @@ -2472,6 +2477,10 @@ "category": "Message", "code": 6038 }, + "STRATEGY": { + "category": "Message", + "code": 6039 + }, "Compilation complete. Watching for file changes.": { "category": "Message", "code": 6042 @@ -2871,7 +2880,7 @@ "Element implicitly has an 'any' type because index expression is not of type 'number'.": { "category": "Error", "code": 7015 - }, + }, "Index signature of object type implicitly has an 'any' type.": { "category": "Error", "code": 7017 @@ -3047,5 +3056,14 @@ "Unknown typing option '{0}'.": { "category": "Error", "code": 17010 + }, + + "Circularity detected while resolving configuration: {0}": { + "category": "Error", + "code": 18000 + }, + "The path in an 'extends' options must be relative or rooted.": { + "category": "Error", + "code": 18001 } } diff --git a/src/compiler/emitter.ts b/src/compiler/emitter.ts index 680c446c0d5..14e743cf59f 100644 --- a/src/compiler/emitter.ts +++ b/src/compiler/emitter.ts @@ -71,43 +71,92 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge }); };`; + // The __generator helper is used by down-level transformations to emulate the runtime + // semantics of an ES2015 generator function. When called, this helper returns an + // object that implements the Iterator protocol, in that it has `next`, `return`, and + // `throw` methods that step through the generator when invoked. + // + // parameters: + // thisArg The value to use as the `this` binding for the transformed generator body. + // body A function that acts as the transformed generator body. + // + // variables: + // _ Persistent state for the generator that is shared between the helper and the + // generator body. The state object has the following members: + // sent() - A method that returns or throws the current completion value. + // label - The next point at which to resume evaluation of the generator body. + // trys - A stack of protected regions (try/catch/finally blocks). + // ops - A stack of pending instructions when inside of a finally block. + // f A value indicating whether the generator is executing. + // y An iterator to delegate for a yield*. + // t A temporary variable that holds one of the following values (note that these + // cases do not overlap): + // - The completion value when resuming from a `yield` or `yield*`. + // - The error value for a catch block. + // - The current protected region (array of try/catch/finally/end labels). + // - The verb (`next`, `throw`, or `return` method) to delegate to the expression + // of a `yield*`. + // - The result of evaluating the verb delegated to the expression of a `yield*`. + // + // functions: + // verb(n) Creates a bound callback to the `step` function for opcode `n`. + // step(op) Evaluates opcodes in a generator body until execution is suspended or + // completed. + // + // The __generator helper understands a limited set of instructions: + // 0: next(value?) - Start or resume the generator with the specified value. + // 1: throw(error) - Resume the generator with an exception. If the generator is + // suspended inside of one or more protected regions, evaluates + // any intervening finally blocks between the current label and + // the nearest catch block or function boundary. If uncaught, the + // exception is thrown to the caller. + // 2: return(value?) - Resume the generator as if with a return. If the generator is + // suspended inside of one or more protected regions, evaluates any + // intervening finally blocks. + // 3: break(label) - Jump to the specified label. If the label is outside of the + // current protected region, evaluates any intervening finally + // blocks. + // 4: yield(value?) - Yield execution to the caller with an optional value. When + // resumed, the generator will continue at the next label. + // 5: yield*(value) - Delegates evaluation to the supplied iterator. When + // delegation completes, the generator will continue at the next + // label. + // 6: catch(error) - Handles an exception thrown from within the generator body. If + // the current label is inside of one or more protected regions, + // evaluates any intervening finally blocks between the current + // label and the nearest catch block or function boundary. If + // uncaught, the exception is thrown to the caller. + // 7: endfinally - Ends a finally block, resuming the last instruction prior to + // entering a finally block. + // + // For examples of how these are used, see the comments in ./transformers/generators.ts const generatorHelper = ` var __generator = (this && this.__generator) || function (thisArg, body) { - var _ = { label: 0, sent: function() { if (sent[0] === 1) throw sent[1]; return sent[1]; }, trys: [], stack: [] }, sent, f; + var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t; + return { next: verb(0), "throw": verb(1), "return": verb(2) }; + function verb(n) { return function (v) { return step([n, v]); }; } function step(op) { if (f) throw new TypeError("Generator is already executing."); - while (1) { - if (_.done) switch (op[0]) { - case 0: return { value: void 0, done: true }; - case 1: case 6: throw op[1]; - case 2: return { value: op[1], done: true }; + while (_) try { + if (f = 1, y && (t = y[op[0] & 2 ? "return" : op[0] ? "throw" : "next"]) && !(t = t.call(y, op[1])).done) return t; + if (y = 0, t) op = [0, t.value]; + switch (op[0]) { + case 0: case 1: t = op; break; + case 4: _.label++; return { value: op[1], done: false }; + case 5: _.label++; y = op[1]; op = [0]; continue; + case 7: op = _.ops.pop(); _.trys.pop(); continue; + default: + if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } + if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } + if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } + if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } + if (t[2]) _.ops.pop(); + _.trys.pop(); continue; } - try { - switch (f = 1, op[0]) { - case 0: case 1: sent = op; break; - case 4: return _.label++, { value: op[1], done: false }; - case 7: op = _.stack.pop(), _.trys.pop(); continue; - default: - var r = _.trys.length > 0 && _.trys[_.trys.length - 1]; - if (!r && (op[0] === 6 || op[0] === 2)) { _.done = 1; continue; } - if (op[0] === 3 && (!r || (op[1] > r[0] && op[1] < r[3]))) { _.label = op[1]; break; } - if (op[0] === 6 && _.label < r[1]) { _.label = r[1], sent = op; break; } - if (r && _.label < r[2]) { _.label = r[2], _.stack.push(op); break; } - if (r[2]) { _.stack.pop(); } - _.trys.pop(); - continue; - } - op = body.call(thisArg, _); - } - catch (e) { op = [6, e]; } - finally { f = 0, sent = void 0; } - } + op = body.call(thisArg, _); + } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } + if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; } - return { - next: function (v) { return step([0, v]); }, - "throw": function (v) { return step([1, v]); }, - "return": function (v) { return step([2, v]); } - }; };`; // emit output for the __export helper function @@ -252,7 +301,9 @@ const _super = (function (geti, seti) { // Emit helpers from all the files if (isBundledEmit && moduleKind) { - forEach(sourceFiles, emitEmitHelpers); + for (const sourceFile of sourceFiles) { + emitEmitHelpers(sourceFile); + } } // Print each transformed source file. @@ -554,9 +605,9 @@ const _super = (function (geti, seti) { // Binding patterns case SyntaxKind.ObjectBindingPattern: - return emitObjectBindingPattern(node); + return emitObjectBindingPattern(node); case SyntaxKind.ArrayBindingPattern: - return emitArrayBindingPattern(node); + return emitArrayBindingPattern(node); case SyntaxKind.BindingElement: return emitBindingElement(node); @@ -2030,7 +2081,7 @@ const _super = (function (geti, seti) { emitTrailingCommentsOfPosition(commentRange.pos); } - emitExpression(node.initializer); + emitExpression(initializer); } function emitShorthandPropertyAssignment(node: ShorthandPropertyAssignment) { diff --git a/src/compiler/factory.ts b/src/compiler/factory.ts index 1930481115c..16eeb86f59a 100644 --- a/src/compiler/factory.ts +++ b/src/compiler/factory.ts @@ -368,13 +368,13 @@ namespace ts { return node; } - export function createArrayBindingPattern(elements: BindingElement[], location?: TextRange) { + export function createArrayBindingPattern(elements: ArrayBindingElement[], location?: TextRange) { const node = createNode(SyntaxKind.ArrayBindingPattern, location); node.elements = createNodeArray(elements); return node; } - export function updateArrayBindingPattern(node: ArrayBindingPattern, elements: BindingElement[]) { + export function updateArrayBindingPattern(node: ArrayBindingPattern, elements: ArrayBindingElement[]) { if (node.elements !== elements) { return updateNode(createArrayBindingPattern(elements, node), node); } diff --git a/src/compiler/parser.ts b/src/compiler/parser.ts index ac43e0fb63c..6e6b372b1c1 100644 --- a/src/compiler/parser.ts +++ b/src/compiler/parser.ts @@ -905,6 +905,10 @@ namespace ts { return currentToken = scanner.scanJsxToken(); } + function scanJsxAttributeValue(): SyntaxKind { + return currentToken = scanner.scanJsxAttributeValue(); + } + function speculationHelper(callback: () => T, isLookAhead: boolean): T { // Keep track of the state we'll need to rollback to if lookahead fails (or if the // caller asked us to always reset our state). @@ -3831,8 +3835,8 @@ namespace ts { scanJsxIdentifier(); const node = createNode(SyntaxKind.JsxAttribute); node.name = parseIdentifierName(); - if (parseOptional(SyntaxKind.EqualsToken)) { - switch (token()) { + if (token() === SyntaxKind.EqualsToken) { + switch (scanJsxAttributeValue()) { case SyntaxKind.StringLiteral: node.initializer = parseLiteralNode(); break; @@ -4811,9 +4815,9 @@ namespace ts { // DECLARATIONS - function parseArrayBindingElement(): BindingElement { + function parseArrayBindingElement(): ArrayBindingElement { if (token() === SyntaxKind.CommaToken) { - return createNode(SyntaxKind.OmittedExpression); + return createNode(SyntaxKind.OmittedExpression); } const node = createNode(SyntaxKind.BindingElement); node.dotDotDotToken = parseOptionalToken(SyntaxKind.DotDotDotToken); @@ -4838,16 +4842,16 @@ namespace ts { return finishNode(node); } - function parseObjectBindingPattern(): BindingPattern { - const node = createNode(SyntaxKind.ObjectBindingPattern); + function parseObjectBindingPattern(): ObjectBindingPattern { + const node = createNode(SyntaxKind.ObjectBindingPattern); parseExpected(SyntaxKind.OpenBraceToken); node.elements = parseDelimitedList(ParsingContext.ObjectBindingElements, parseObjectBindingElement); parseExpected(SyntaxKind.CloseBraceToken); return finishNode(node); } - function parseArrayBindingPattern(): BindingPattern { - const node = createNode(SyntaxKind.ArrayBindingPattern); + function parseArrayBindingPattern(): ArrayBindingPattern { + const node = createNode(SyntaxKind.ArrayBindingPattern); parseExpected(SyntaxKind.OpenBracketToken); node.elements = parseDelimitedList(ParsingContext.ArrayBindingElements, parseArrayBindingElement); parseExpected(SyntaxKind.CloseBracketToken); diff --git a/src/compiler/program.ts b/src/compiler/program.ts index 7c010285b70..ab306e90f3a 100644 --- a/src/compiler/program.ts +++ b/src/compiler/program.ts @@ -670,7 +670,7 @@ namespace ts { trace(state.host, Diagnostics.Loading_module_as_file_Slash_folder_candidate_module_location_0, candidate); } - const resolvedFileName = loadModuleFromFile(candidate, supportedExtensions, failedLookupLocations, onlyRecordFailures, state); + const resolvedFileName = !pathEndsWithDirectorySeparator(candidate) && loadModuleFromFile(candidate, supportedExtensions, failedLookupLocations, onlyRecordFailures, state); return resolvedFileName || loadNodeModuleFromDirectory(supportedExtensions, candidate, failedLookupLocations, onlyRecordFailures, state); } diff --git a/src/compiler/scanner.ts b/src/compiler/scanner.ts index 2d07c2998e0..bfc9591baa7 100644 --- a/src/compiler/scanner.ts +++ b/src/compiler/scanner.ts @@ -27,6 +27,7 @@ namespace ts { reScanSlashToken(): SyntaxKind; reScanTemplateToken(): SyntaxKind; scanJsxIdentifier(): SyntaxKind; + scanJsxAttributeValue(): SyntaxKind; reScanJsxToken(): SyntaxKind; scanJsxToken(): SyntaxKind; scanJSDocToken(): SyntaxKind; @@ -817,6 +818,7 @@ namespace ts { reScanSlashToken, reScanTemplateToken, scanJsxIdentifier, + scanJsxAttributeValue, reScanJsxToken, scanJsxToken, scanJSDocToken, @@ -911,7 +913,7 @@ namespace ts { return value; } - function scanString(): string { + function scanString(allowEscapes = true): string { const quote = text.charCodeAt(pos); pos++; let result = ""; @@ -929,7 +931,7 @@ namespace ts { pos++; break; } - if (ch === CharacterCodes.backslash) { + if (ch === CharacterCodes.backslash && allowEscapes) { result += text.substring(start, pos); result += scanEscapeSequence(); start = pos; @@ -1737,6 +1739,20 @@ namespace ts { return token; } + function scanJsxAttributeValue(): SyntaxKind { + startPos = pos; + + switch (text.charCodeAt(pos)) { + case CharacterCodes.doubleQuote: + case CharacterCodes.singleQuote: + tokenValue = scanString(/*allowEscapes*/ false); + return token = SyntaxKind.StringLiteral; + default: + // If this scans anything other than `{`, it's a parse error. + return scan(); + } + } + function scanJSDocToken(): SyntaxKind { if (pos >= end) { return token = SyntaxKind.EndOfFileToken; diff --git a/src/compiler/transformers/destructuring.ts b/src/compiler/transformers/destructuring.ts index e211ca61f36..c6079ee1378 100644 --- a/src/compiler/transformers/destructuring.ts +++ b/src/compiler/transformers/destructuring.ts @@ -326,12 +326,15 @@ namespace ts { } for (let i = 0; i < numElements; i++) { const element = elements[i]; - if (name.kind === SyntaxKind.ObjectBindingPattern) { + if (isOmittedExpression(element)) { + continue; + } + else if (name.kind === SyntaxKind.ObjectBindingPattern) { // Rewrite element to a declaration with an initializer that fetches property const propName = element.propertyName || element.name; emitBindingElement(element, createDestructuringPropertyAccess(value, propName)); } - else if (element.kind !== SyntaxKind.OmittedExpression) { + else { if (!element.dotDotDotToken) { // Rewrite element to a declaration that accesses array element at index i emitBindingElement(element, createElementAccess(value, i)); diff --git a/src/compiler/transformers/es6.ts b/src/compiler/transformers/es6.ts index 4e994c1acb0..44deac04279 100644 --- a/src/compiler/transformers/es6.ts +++ b/src/compiler/transformers/es6.ts @@ -541,7 +541,7 @@ namespace ts { * * @param node A ClassDeclaration node. */ - function visitClassDeclaration(node: ClassDeclaration): Statement { + function visitClassDeclaration(node: ClassDeclaration): VisitResult { // [source] // class C { } // @@ -552,8 +552,17 @@ namespace ts { // return C; // }()); + const modifierFlags = getModifierFlags(node); + const isExported = modifierFlags & ModifierFlags.Export; + const isDefault = modifierFlags & ModifierFlags.Default; + + // Add an `export` modifier to the statement if needed (for `--target es5 --module es6`) + const modifiers = isExported && !isDefault + ? filter(node.modifiers, isExportModifier) + : undefined; + const statement = createVariableStatement( - /*modifiers*/ undefined, + modifiers, createVariableDeclarationList([ createVariableDeclaration( getDeclarationName(node, /*allowComments*/ true), @@ -566,9 +575,26 @@ namespace ts { setOriginalNode(statement, node); startOnNewLine(statement); + + // Add an `export default` statement for default exports (for `--target es5 --module es6`) + if (isExported && isDefault) { + const statements: Statement[] = [statement]; + statements.push(createExportAssignment( + /*decorators*/ undefined, + /*modifiers*/ undefined, + /*isExportEquals*/ false, + getDeclarationName(node, /*allowComments*/ false) + )); + return statements; + } + return statement; } + function isExportModifier(node: Modifier) { + return node.kind === SyntaxKind.ExportKeyword; + } + /** * Visits a ClassExpression and transforms it into an expression. * @@ -1945,7 +1971,9 @@ namespace ts { } else { for (const element of (node).elements) { - visit(element.name); + if (!isOmittedExpression(element)) { + visit(element.name); + } } } } @@ -2027,9 +2055,24 @@ namespace ts { if (!isBlock(loopBody)) { loopBody = createBlock([loopBody], /*location*/ undefined, /*multiline*/ true); } + + const isAsyncBlockContainingAwait = + containingNonArrowFunction + && (containingNonArrowFunction.emitFlags & NodeEmitFlags.AsyncFunctionBody) !== 0 + && (node.statement.transformFlags & TransformFlags.ContainsYield) !== 0; + + let loopBodyFlags: NodeEmitFlags = 0; + if (currentState.containsLexicalThis) { + loopBodyFlags |= NodeEmitFlags.CapturesThis; + } + + if (isAsyncBlockContainingAwait) { + loopBodyFlags |= NodeEmitFlags.AsyncFunctionBody; + } + const convertedLoopVariable = createVariableStatement( - /*modifiers*/ undefined, + /*modifiers*/ undefined, createVariableDeclarationList( [ createVariableDeclaration( @@ -2037,16 +2080,14 @@ namespace ts { /*type*/ undefined, setNodeEmitFlags( createFunctionExpression( - /*asteriskToken*/ undefined, + isAsyncBlockContainingAwait ? createToken(SyntaxKind.AsteriskToken) : undefined, /*name*/ undefined, /*typeParameters*/ undefined, loopParameters, /*type*/ undefined, loopBody ), - currentState.containsLexicalThis - ? NodeEmitFlags.CapturesThis - : 0 + loopBodyFlags ) ) ] @@ -2132,7 +2173,7 @@ namespace ts { )); } - const convertedLoopBodyStatements = generateCallToConvertedLoop(functionName, loopParameters, currentState); + const convertedLoopBodyStatements = generateCallToConvertedLoop(functionName, loopParameters, currentState, isAsyncBlockContainingAwait); let loop: IterationStatement; if (convert) { loop = convert(node, convertedLoopBodyStatements); @@ -2145,12 +2186,17 @@ namespace ts { loop = visitEachChild(loop, visitor, context); // set loop statement loop.statement = createBlock( - generateCallToConvertedLoop(functionName, loopParameters, currentState), + convertedLoopBodyStatements, /*location*/ undefined, /*multiline*/ true ); + + // reset and re-aggregate the transform flags + loop.transformFlags = 0; + aggregateTransformFlags(loop); } + statements.push( currentParent.kind === SyntaxKind.LabeledStatement ? createLabel((currentParent).label, loop) @@ -2171,7 +2217,7 @@ namespace ts { } } - function generateCallToConvertedLoop(loopFunctionExpressionName: Identifier, parameters: ParameterDeclaration[], state: ConvertedLoopState): Statement[] { + function generateCallToConvertedLoop(loopFunctionExpressionName: Identifier, parameters: ParameterDeclaration[], state: ConvertedLoopState, isAsyncBlockContainingAwait: boolean): Statement[] { const outerConvertedLoopState = convertedLoopState; const statements: Statement[] = []; @@ -2184,8 +2230,9 @@ namespace ts { !state.labeledNonLocalContinues; const call = createCall(loopFunctionExpressionName, /*typeArguments*/ undefined, map(parameters, p => p.name)); + const callResult = isAsyncBlockContainingAwait ? createYield(createToken(SyntaxKind.AsteriskToken), call) : call; if (isSimpleLoop) { - statements.push(createStatement(call)); + statements.push(createStatement(callResult)); copyOutParameters(state.loopOutParameters, CopyDirection.ToOriginal, statements); } else { @@ -2193,7 +2240,7 @@ namespace ts { const stateVariable = createVariableStatement( /*modifiers*/ undefined, createVariableDeclarationList( - [createVariableDeclaration(loopResultName, /*type*/ undefined, call)] + [createVariableDeclaration(loopResultName, /*type*/ undefined, callResult)] ) ); statements.push(stateVariable); @@ -2289,7 +2336,9 @@ namespace ts { const name = decl.name; if (isBindingPattern(name)) { for (const element of name.elements) { - processLoopVariableDeclaration(element, loopParameters, loopOutParameters); + if (!isOmittedExpression(element)) { + processLoopVariableDeclaration(element, loopParameters, loopOutParameters); + } } } else { diff --git a/src/compiler/transformers/generators.ts b/src/compiler/transformers/generators.ts index 9a4b567cb80..d1e2b6033a6 100644 --- a/src/compiler/transformers/generators.ts +++ b/src/compiler/transformers/generators.ts @@ -21,10 +21,11 @@ // .brfalse LABEL, (x) - Jump to a label IIF the expression `x` is falsey. // If jumping out of a protected region, all .finally // blocks are executed. -// .yield RESUME, (x) - Yield the value of the optional expression `x`. -// Resume at the label RESUME. -// .yieldstar RESUME, (x) - Delegate yield to the value of the optional -// expression `x`. Resume at the label RESUME. +// .yield (x) - Yield the value of the optional expression `x`. +// Resume at the next label. +// .yieldstar (x) - Delegate yield to the value of the optional +// expression `x`. Resume at the next label. +// NOTE: `x` must be an Iterator, not an Iterable. // .loop CONTINUE, BREAK - Marks the beginning of a loop. Any "continue" or // "break" abrupt completions jump to the CONTINUE or // BREAK labels, respectively. @@ -80,13 +81,13 @@ // -------------------------------|---------------------------------------------- // .brfalse LABEL, (x) | if (!(x)) return [3, /*break*/, LABEL]; // -------------------------------|---------------------------------------------- -// .yield RESUME, (x) | return [4 /*yield*/, x]; +// .yield (x) | return [4 /*yield*/, x]; // .mark RESUME | case RESUME: -// a = %sent%; | a = state.sent(); +// a = %sent%; | a = state.sent(); // -------------------------------|---------------------------------------------- -// .yieldstar RESUME, (X) | return [5 /*yield**/, x]; +// .yieldstar (x) | return [5 /*yield**/, x]; // .mark RESUME | case RESUME: -// a = %sent%; | a = state.sent(); +// a = %sent%; | a = state.sent(); // -------------------------------|---------------------------------------------- // .with (_a) | with (_a) { // a(); | a(); @@ -109,7 +110,7 @@ // .br END | return [3 /*break*/, END]; // .catch (e) | // .mark CATCH | case CATCH: -// | e = state.error; +// | e = state.sent(); // b(); | b(); // .br END | return [3 /*break*/, END]; // .finally | @@ -906,7 +907,7 @@ namespace ts { * * @param node The node to visit. */ - function visitYieldExpression(node: YieldExpression) { + function visitYieldExpression(node: YieldExpression): LeftHandSideExpression { // [source] // x = yield a(); // @@ -917,7 +918,14 @@ namespace ts { // NOTE: we are explicitly not handling YieldStar at this time. const resumeLabel = defineLabel(); - emitYield(visitNode(node.expression, visitor, isExpression), /*location*/ node); + const expression = visitNode(node.expression, visitor, isExpression); + if (node.asteriskToken) { + emitYieldStar(expression, /*location*/ node); + } + else { + emitYield(expression, /*location*/ node); + } + markLabel(resumeLabel); return createGeneratorResume(); } @@ -2480,6 +2488,16 @@ namespace ts { emitWorker(OpCode.BreakWhenFalse, [label, condition], location); } + /** + * Emits a YieldStar operation for the provided expression. + * + * @param expression An optional value for the yield operation. + * @param location An optional source map location for the assignment. + */ + function emitYieldStar(expression?: Expression, location?: TextRange): void { + emitWorker(OpCode.YieldStar, [expression], location); + } + /** * Emits a Yield operation for the provided expression. * @@ -2629,7 +2647,7 @@ namespace ts { * Flush the final label of the generator function body. */ function flushFinalLabel(operationIndex: number): void { - if (!lastOperationWasCompletion) { + if (isFinalLabelReachable(operationIndex)) { tryEnterLabel(operationIndex); withBlockStack = undefined; writeReturn(/*expression*/ undefined, /*operationLocation*/ undefined); @@ -2642,6 +2660,34 @@ namespace ts { updateLabelExpressions(); } + /** + * Tests whether the final label of the generator function body + * is reachable by user code. + */ + function isFinalLabelReachable(operationIndex: number) { + // if the last operation was *not* a completion (return/throw) then + // the final label is reachable. + if (!lastOperationWasCompletion) { + return true; + } + + // if there are no labels defined or referenced, then the final label is + // not reachable. + if (!labelOffsets || !labelExpressions) { + return false; + } + + // if the label for this offset is referenced, then the final label + // is reachable. + for (let label = 0; label < labelOffsets.length; label++) { + if (labelOffsets[label] === operationIndex && labelExpressions[label]) { + return true; + } + } + + return false; + } + /** * Appends a case clause for the last label and sets the new label. * diff --git a/src/compiler/transformers/jsx.ts b/src/compiler/transformers/jsx.ts index 4bc523a262f..9e6aa507cce 100644 --- a/src/compiler/transformers/jsx.ts +++ b/src/compiler/transformers/jsx.ts @@ -140,7 +140,8 @@ namespace ts { return createLiteral(true); } else if (node.kind === SyntaxKind.StringLiteral) { - return node; + const decoded = tryDecodeEntities((node).text); + return decoded ? createLiteral(decoded, /*location*/ node) : node; } else if (node.kind === SyntaxKind.JsxExpression) { return visitJsxExpression(node); @@ -210,19 +211,31 @@ namespace ts { } /** - * Decodes JSX entities. + * Replace entities like " ", "{", and "�" with the characters they encode. + * See https://en.wikipedia.org/wiki/List_of_XML_and_HTML_character_entity_references */ - function decodeEntities(text: string) { - return text.replace(/&(\w+);/g, function(s: any, m: string) { - if (entities[m] !== undefined) { - return String.fromCharCode(entities[m]); + function decodeEntities(text: string): string { + return text.replace(/&((#((\d+)|x([\da-fA-F]+)))|(\w+));/g, (match, _all, _number, _digits, decimal, hex, word) => { + if (decimal) { + return String.fromCharCode(parseInt(decimal, 10)); + } + else if (hex) { + return String.fromCharCode(parseInt(hex, 16)); } else { - return s; + const ch = entities[word]; + // If this is not a valid entity, then just use `match` (replace it with itself, i.e. don't replace) + return ch ? String.fromCharCode(ch) : match; } }); } + /** Like `decodeEntities` but returns `undefined` if there were no entities to decode. */ + function tryDecodeEntities(text: string): string | undefined { + const decoded = decodeEntities(text); + return decoded === text ? undefined : decoded; + } + function getTagName(node: JsxElement | JsxOpeningLikeElement): Expression { if (node.kind === SyntaxKind.JsxElement) { return getTagName((node).openingElement); diff --git a/src/compiler/transformers/module/module.ts b/src/compiler/transformers/module/module.ts index 144420b7ae9..da7bf32f801 100644 --- a/src/compiler/transformers/module/module.ts +++ b/src/compiler/transformers/module/module.ts @@ -660,7 +660,9 @@ namespace ts { function addExportMemberAssignmentsForBindingName(resultStatements: Statement[], name: BindingName): void { if (isBindingPattern(name)) { for (const element of name.elements) { - addExportMemberAssignmentsForBindingName(resultStatements, element.name); + if (!isOmittedExpression(element)) { + addExportMemberAssignmentsForBindingName(resultStatements, element.name); + } } } else { @@ -703,7 +705,7 @@ namespace ts { createFunctionDeclaration( /*decorators*/ undefined, /*modifiers*/ undefined, - /*asteriskToken*/ undefined, + node.asteriskToken, name, /*typeParameters*/ undefined, node.parameters, diff --git a/src/compiler/transformers/module/system.ts b/src/compiler/transformers/module/system.ts index d303dd580ef..7b013e18e7d 100644 --- a/src/compiler/transformers/module/system.ts +++ b/src/compiler/transformers/module/system.ts @@ -1368,7 +1368,11 @@ namespace ts { exportedFunctionDeclarations.push(createDeclarationExport(node)); } - function hoistBindingElement(node: VariableDeclaration | BindingElement, isExported: boolean): void { + function hoistBindingElement(node: VariableDeclaration | ArrayBindingElement, isExported: boolean): void { + if (isOmittedExpression(node)) { + return; + } + const name = node.name; if (isIdentifier(name)) { hoistVariableDeclaration(getSynthesizedClone(name)); @@ -1381,11 +1385,11 @@ namespace ts { } } - function hoistExportedBindingElement(node: VariableDeclaration | BindingElement) { + function hoistExportedBindingElement(node: VariableDeclaration | ArrayBindingElement) { hoistBindingElement(node, /*isExported*/ true); } - function hoistNonExportedBindingElement(node: VariableDeclaration | BindingElement) { + function hoistNonExportedBindingElement(node: VariableDeclaration | ArrayBindingElement) { hoistBindingElement(node, /*isExported*/ false); } diff --git a/src/compiler/transformers/ts.ts b/src/compiler/transformers/ts.ts index efb247ba663..e0765ed7025 100644 --- a/src/compiler/transformers/ts.ts +++ b/src/compiler/transformers/ts.ts @@ -2187,7 +2187,7 @@ namespace ts { * * @param node The function expression node. */ - function visitFunctionExpression(node: FunctionExpression) { + function visitFunctionExpression(node: FunctionExpression): Expression { if (nodeIsMissing(node.body)) { return createOmittedExpression(); } diff --git a/src/compiler/types.ts b/src/compiler/types.ts index f7b92b643ca..82844980ca7 100644 --- a/src/compiler/types.ts +++ b/src/compiler/types.ts @@ -435,6 +435,8 @@ namespace ts { TypeExcludesFlags = YieldContext | AwaitContext, } + export type ModifiersArray = NodeArray; + export const enum ModifierFlags { None = 0, Export = 1 << 0, // Declarations @@ -480,7 +482,7 @@ namespace ts { /* @internal */ modifierFlagsCache?: ModifierFlags; /* @internal */ transformFlags?: TransformFlags; decorators?: NodeArray; // Array of decorators (in document order) - modifiers?: NodeArray; // Array of modifiers + modifiers?: ModifiersArray; // Array of modifiers /* @internal */ id?: number; // Unique id (used to look up NodeLinks) parent?: Node; // Parent node (initialized by binding) /* @internal */ original?: Node; // The original node if this is an updated node. @@ -686,14 +688,20 @@ namespace ts { } export interface BindingPattern extends Node { - elements: NodeArray; + elements: NodeArray; } // @kind(SyntaxKind.ObjectBindingPattern) - export interface ObjectBindingPattern extends BindingPattern { } + export interface ObjectBindingPattern extends BindingPattern { + elements: NodeArray; + } + + export type ArrayBindingElement = BindingElement | OmittedExpression; // @kind(SyntaxKind.ArrayBindingPattern) - export interface ArrayBindingPattern extends BindingPattern { } + export interface ArrayBindingPattern extends BindingPattern { + elements: NodeArray; + } /** * Several node kinds share function-like features such as a signature, @@ -866,7 +874,9 @@ namespace ts { } // @kind(SyntaxKind.OmittedExpression) - export interface OmittedExpression extends Expression { } + export interface OmittedExpression extends Expression { + _omittedExpressionBrand: any; + } // Represents an expression that is elided as part of a transformation to emit comments on a // not-emitted node. The 'expression' property of a NotEmittedExpression should be emitted. @@ -1797,6 +1807,8 @@ namespace ts { * @param path The path to test. */ fileExists(path: string): boolean; + + readFile(path: string): string; } export interface WriteFileCallback { @@ -2583,13 +2595,14 @@ namespace ts { export interface TypeInferences { primary: Type[]; // Inferences made directly to a type parameter secondary: Type[]; // Inferences made to a type parameter in a union type + topLevel: boolean; // True if all inferences were made from top-level (not nested in object type) locations isFixed: boolean; // Whether the type parameter is fixed, as defined in section 4.12.2 of the TypeScript spec // If a type parameter is fixed, no more inferences can be made for the type parameter } /* @internal */ export interface InferenceContext { - typeParameters: TypeParameter[]; // Type parameters for which inferences are made + signature: Signature; // Generic signature for which inferences are made inferUnionTypes: boolean; // Infer union types for disjoint candidates (otherwise undefinedType) inferences: TypeInferences[]; // Inferences made for each type parameter inferredTypes: Type[]; // Inferred type for each type parameter diff --git a/src/compiler/utilities.ts b/src/compiler/utilities.ts index 2b734c98044..6c948a8e6d9 100644 --- a/src/compiler/utilities.ts +++ b/src/compiler/utilities.ts @@ -414,7 +414,11 @@ namespace ts { ((node).name.kind === SyntaxKind.StringLiteral || isGlobalScopeAugmentation(node)); } - export function isShorthandAmbientModule(node: Node): boolean { + export function isShorthandAmbientModuleSymbol(moduleSymbol: Symbol): boolean { + return isShorthandAmbientModule(moduleSymbol.valueDeclaration); + } + + function isShorthandAmbientModule(node: Node): boolean { // The only kind of module that can be missing a body is a shorthand ambient module. return node.kind === SyntaxKind.ModuleDeclaration && (!(node).body); } @@ -596,60 +600,6 @@ namespace ts { return node.kind === SyntaxKind.EnumDeclaration && isConst(node); } - function walkUpBindingElementsAndPatterns(node: Node): Node { - while (node && (node.kind === SyntaxKind.BindingElement || isBindingPattern(node))) { - node = node.parent; - } - - return node; - } - - export function getCombinedModifierFlags(node: Node): ModifierFlags { - node = walkUpBindingElementsAndPatterns(node); - let flags = getModifierFlags(node); - if (node.kind === SyntaxKind.VariableDeclaration) { - node = node.parent; - } - - if (node && node.kind === SyntaxKind.VariableDeclarationList) { - flags |= getModifierFlags(node); - node = node.parent; - } - - if (node && node.kind === SyntaxKind.VariableStatement) { - flags |= getModifierFlags(node); - } - - return flags; - } - - // Returns the node flags for this node and all relevant parent nodes. This is done so that - // nodes like variable declarations and binding elements can returned a view of their flags - // that includes the modifiers from their container. i.e. flags like export/declare aren't - // stored on the variable declaration directly, but on the containing variable statement - // (if it has one). Similarly, flags for let/const are store on the variable declaration - // list. By calling this function, all those flags are combined so that the client can treat - // the node as if it actually had those flags. - export function getCombinedNodeFlags(node: Node): NodeFlags { - node = walkUpBindingElementsAndPatterns(node); - - let flags = node.flags; - if (node.kind === SyntaxKind.VariableDeclaration) { - node = node.parent; - } - - if (node && node.kind === SyntaxKind.VariableDeclarationList) { - flags |= node.flags; - node = node.parent; - } - - if (node && node.kind === SyntaxKind.VariableStatement) { - flags |= node.flags; - } - - return flags; - } - export function isConst(node: Node): boolean { return !!(getCombinedNodeFlags(node) & NodeFlags.Const) || !!(getCombinedModifierFlags(node) & ModifierFlags.Const); @@ -3755,6 +3705,12 @@ namespace ts { return node.kind === SyntaxKind.BindingElement; } + export function isArrayBindingElement(node: Node): node is ArrayBindingElement { + const kind = node.kind; + return kind === SyntaxKind.BindingElement + || kind === SyntaxKind.OmittedExpression; + } + // Expression export function isPropertyAccessExpression(node: Node): node is PropertyAccessExpression { @@ -3871,6 +3827,10 @@ namespace ts { || isPartiallyEmittedExpression(node); } + export function isOmittedExpression(node: Node): node is OmittedExpression { + return node.kind === SyntaxKind.OmittedExpression; + } + // Misc export function isTemplateSpan(node: Node): node is TemplateSpan { @@ -4370,4 +4330,58 @@ namespace ts { export function isParameterPropertyDeclaration(node: ParameterDeclaration): boolean { return hasModifier(node, ModifierFlags.ParameterPropertyModifier) && node.parent.kind === SyntaxKind.Constructor && isClassLike(node.parent.parent); } + + function walkUpBindingElementsAndPatterns(node: Node): Node { + while (node && (node.kind === SyntaxKind.BindingElement || isBindingPattern(node))) { + node = node.parent; + } + + return node; + } + + export function getCombinedModifierFlags(node: Node): ModifierFlags { + node = walkUpBindingElementsAndPatterns(node); + let flags = getModifierFlags(node); + if (node.kind === SyntaxKind.VariableDeclaration) { + node = node.parent; + } + + if (node && node.kind === SyntaxKind.VariableDeclarationList) { + flags |= getModifierFlags(node); + node = node.parent; + } + + if (node && node.kind === SyntaxKind.VariableStatement) { + flags |= getModifierFlags(node); + } + + return flags; + } + + // Returns the node flags for this node and all relevant parent nodes. This is done so that + // nodes like variable declarations and binding elements can returned a view of their flags + // that includes the modifiers from their container. i.e. flags like export/declare aren't + // stored on the variable declaration directly, but on the containing variable statement + // (if it has one). Similarly, flags for let/const are store on the variable declaration + // list. By calling this function, all those flags are combined so that the client can treat + // the node as if it actually had those flags. + export function getCombinedNodeFlags(node: Node): NodeFlags { + node = walkUpBindingElementsAndPatterns(node); + + let flags = node.flags; + if (node.kind === SyntaxKind.VariableDeclaration) { + node = node.parent; + } + + if (node && node.kind === SyntaxKind.VariableDeclarationList) { + flags |= node.flags; + node = node.parent; + } + + if (node && node.kind === SyntaxKind.VariableStatement) { + flags |= node.flags; + } + + return flags; + } } diff --git a/src/compiler/visitor.ts b/src/compiler/visitor.ts index 648fd235c44..1e0cadaaa6b 100644 --- a/src/compiler/visitor.ts +++ b/src/compiler/visitor.ts @@ -757,7 +757,7 @@ namespace ts { case SyntaxKind.ArrayBindingPattern: return updateArrayBindingPattern(node, - visitNodes((node).elements, visitor, isBindingElement)); + visitNodes((node).elements, visitor, isArrayBindingElement)); case SyntaxKind.BindingElement: return updateBindingElement(node, diff --git a/src/harness/fourslash.ts b/src/harness/fourslash.ts index cd619a90deb..a076812462e 100644 --- a/src/harness/fourslash.ts +++ b/src/harness/fourslash.ts @@ -367,6 +367,7 @@ namespace FourSlash { InsertSpaceAfterOpeningAndBeforeClosingNonemptyBraces: true, InsertSpaceAfterOpeningAndBeforeClosingTemplateStringBraces: false, InsertSpaceAfterOpeningAndBeforeClosingJsxExpressionBraces: false, + InsertSpaceAfterTypeAssertion: false, PlaceOpenBraceOnNewLineForFunctions: false, PlaceOpenBraceOnNewLineForControlBlocks: false, }; @@ -958,29 +959,35 @@ namespace FourSlash { assert.equal(actual, expected); } - public verifyQuickInfoString(negative: boolean, expectedText?: string, expectedDocumentation?: string) { + public verifyQuickInfoAt(markerName: string, expectedText: string, expectedDocumentation?: string) { + this.goToMarker(markerName); + this.verifyQuickInfoString(expectedText, expectedDocumentation); + } + + public verifyQuickInfos(namesAndTexts: { [name: string]: string | [string, string] }) { + ts.forEachProperty(ts.createMap(namesAndTexts), (text, name) => { + if (text instanceof Array) { + assert(text.length === 2); + const [expectedText, expectedDocumentation] = text; + this.verifyQuickInfoAt(name, expectedText, expectedDocumentation); + } + else { + this.verifyQuickInfoAt(name, text); + } + }); + } + + public verifyQuickInfoString(expectedText: string, expectedDocumentation?: string) { + if (expectedDocumentation === "") { + throw new Error("Use 'undefined' instead"); + } + const actualQuickInfo = this.languageService.getQuickInfoAtPosition(this.activeFile.fileName, this.currentCaretPosition); const actualQuickInfoText = actualQuickInfo ? ts.displayPartsToString(actualQuickInfo.displayParts) : ""; const actualQuickInfoDocumentation = actualQuickInfo ? ts.displayPartsToString(actualQuickInfo.documentation) : ""; - if (negative) { - if (expectedText !== undefined) { - assert.notEqual(actualQuickInfoText, expectedText, this.messageAtLastKnownMarker("quick info text")); - } - // TODO: should be '==='? - if (expectedDocumentation != undefined) { - assert.notEqual(actualQuickInfoDocumentation, expectedDocumentation, this.messageAtLastKnownMarker("quick info doc comment")); - } - } - else { - if (expectedText !== undefined) { - assert.equal(actualQuickInfoText, expectedText, this.messageAtLastKnownMarker("quick info text")); - } - // TODO: should be '==='? - if (expectedDocumentation != undefined) { - assert.equal(actualQuickInfoDocumentation, expectedDocumentation, this.assertionMessageAtLastKnownMarker("quick info doc")); - } - } + assert.equal(actualQuickInfoText, expectedText, this.messageAtLastKnownMarker("quick info text")); + assert.equal(actualQuickInfoDocumentation, expectedDocumentation || "", this.assertionMessageAtLastKnownMarker("quick info doc")); } public verifyQuickInfoDisplayParts(kind: string, kindModifiers: string, textSpan: { start: number; length: number; }, @@ -1298,6 +1305,22 @@ namespace FourSlash { }); } + public baselineQuickInfo() { + let baselineFile = this.testData.globalOptions[metadataOptionNames.baselineFile]; + if (!baselineFile) { + baselineFile = ts.getBaseFileName(this.activeFile.fileName).replace(".ts", ".baseline"); + } + + Harness.Baseline.runBaseline( + baselineFile, + () => stringify( + this.testData.markers.map(marker => ({ + marker, + quickInfo: this.languageService.getQuickInfoAtPosition(marker.fileName, marker.position) + })) + )); + } + public printBreakpointLocation(pos: number) { Harness.IO.log("\n**Pos: " + pos + " " + this.spanInfoToString(pos, this.getBreakpointStatementLocation(pos), " ")); } @@ -2106,11 +2129,12 @@ namespace FourSlash { } /* - Check number of navigationItems which match both searchValue and matchKind. + Check number of navigationItems which match both searchValue and matchKind, + if a filename is passed in, limit the results to that file. Report an error if expected value and actual value do not match. */ - public verifyNavigationItemsCount(expected: number, searchValue: string, matchKind?: string) { - const items = this.languageService.getNavigateToItems(searchValue); + public verifyNavigationItemsCount(expected: number, searchValue: string, matchKind?: string, fileName?: string) { + const items = this.languageService.getNavigateToItems(searchValue, /*maxResultCount*/ undefined, fileName); let actual = 0; let item: ts.NavigateToItem; @@ -3048,10 +3072,6 @@ namespace FourSlashInterface { this.state.verifyErrorExistsAfterMarker(markerName, !this.negative, /*after*/ false); } - public quickInfoIs(expectedText?: string, expectedDocumentation?: string) { - this.state.verifyQuickInfoString(this.negative, expectedText, expectedDocumentation); - } - public quickInfoExists() { this.state.verifyQuickInfoExists(this.negative); } @@ -3074,6 +3094,18 @@ namespace FourSlashInterface { super(state); } + public quickInfoIs(expectedText: string, expectedDocumentation?: string) { + this.state.verifyQuickInfoString(expectedText, expectedDocumentation); + } + + public quickInfoAt(markerName: string, expectedText?: string, expectedDocumentation?: string) { + this.state.verifyQuickInfoAt(markerName, expectedText, expectedDocumentation); + } + + public quickInfos(namesAndTexts: { [name: string]: string }) { + this.state.verifyQuickInfos(namesAndTexts); + } + public caretAtMarker(markerName?: string) { this.state.verifyCaretAtMarker(markerName); } @@ -3202,6 +3234,10 @@ namespace FourSlashInterface { this.state.baselineGetEmitOutput(); } + public baselineQuickInfo() { + this.state.baselineQuickInfo(); + } + public nameOrDottedNameSpanTextIs(text: string) { this.state.verifyCurrentNameOrDottedNameSpanText(text); } @@ -3234,8 +3270,8 @@ namespace FourSlashInterface { this.state.verifyNavigationBar(json); } - public navigationItemsListCount(count: number, searchValue: string, matchKind?: string) { - this.state.verifyNavigationItemsCount(count, searchValue, matchKind); + public navigationItemsListCount(count: number, searchValue: string, matchKind?: string, fileName?: string) { + this.state.verifyNavigationItemsCount(count, searchValue, matchKind, fileName); } public navigationItemsListContains( diff --git a/src/harness/harness.ts b/src/harness/harness.ts index c5816deb924..0863c58851d 100644 --- a/src/harness/harness.ts +++ b/src/harness/harness.ts @@ -1844,7 +1844,8 @@ namespace Harness { const parseConfigHost: ts.ParseConfigHost = { useCaseSensitiveFileNames: false, readDirectory: (name) => [], - fileExists: (name) => true + fileExists: (name) => true, + readFile: (name) => ts.forEach(testUnitData, data => data.name.toLowerCase() === name.toLowerCase() ? data.content : undefined) }; // check if project has tsconfig.json in the list of files diff --git a/src/harness/harnessLanguageService.ts b/src/harness/harnessLanguageService.ts index c859a93d0c1..f96676747e4 100644 --- a/src/harness/harnessLanguageService.ts +++ b/src/harness/harnessLanguageService.ts @@ -408,6 +408,9 @@ namespace Harness.LanguageService { getCompletionEntryDetails(fileName: string, position: number, entryName: string): ts.CompletionEntryDetails { return unwrapJSONCallResult(this.shim.getCompletionEntryDetails(fileName, position, entryName)); } + getCompletionEntrySymbol(fileName: string, position: number, entryName: string): ts.Symbol { + throw new Error("getCompletionEntrySymbol not implemented across the shim layer."); + } getQuickInfoAtPosition(fileName: string, position: number): ts.QuickInfo { return unwrapJSONCallResult(this.shim.getQuickInfoAtPosition(fileName, position)); } diff --git a/src/harness/loggedIO.ts b/src/harness/loggedIO.ts index 33a46450a17..07dbf4a4e1c 100644 --- a/src/harness/loggedIO.ts +++ b/src/harness/loggedIO.ts @@ -1,6 +1,8 @@ /// /// +/// /// +/// interface FileInformation { contents: string; diff --git a/src/harness/projectsRunner.ts b/src/harness/projectsRunner.ts index 6b35064883e..415c09caff6 100644 --- a/src/harness/projectsRunner.ts +++ b/src/harness/projectsRunner.ts @@ -222,6 +222,7 @@ class ProjectRunner extends RunnerBase { useCaseSensitiveFileNames: Harness.IO.useCaseSensitiveFileNames(), fileExists, readDirectory, + readFile }; const configParseResult = ts.parseJsonConfigFileContent(configObject, configParseHost, ts.getDirectoryPath(configFileName), compilerOptions); if (configParseResult.errors.length > 0) { @@ -292,6 +293,10 @@ class ProjectRunner extends RunnerBase { return Harness.IO.fileExists(getFileNameInTheProjectTest(fileName)); } + function readFile(fileName: string): string { + return Harness.IO.readFile(getFileNameInTheProjectTest(fileName)); + } + function getSourceFileText(fileName: string): string { let text: string = undefined; try { diff --git a/src/harness/rwcRunner.ts b/src/harness/rwcRunner.ts index fff0d6bfb49..9f9bf8589f0 100644 --- a/src/harness/rwcRunner.ts +++ b/src/harness/rwcRunner.ts @@ -79,6 +79,7 @@ namespace RWC { useCaseSensitiveFileNames: Harness.IO.useCaseSensitiveFileNames(), fileExists: Harness.IO.fileExists, readDirectory: Harness.IO.readDirectory, + readFile: Harness.IO.readFile }; const configParseResult = ts.parseJsonConfigFileContent(parsedTsconfigFileContents.config, configParseHost, ts.getDirectoryPath(tsconfigFile.path)); fileNames = configParseResult.fileNames; diff --git a/src/harness/tsconfig.json b/src/harness/tsconfig.json index a21faf9dd07..8444d1d4a75 100644 --- a/src/harness/tsconfig.json +++ b/src/harness/tsconfig.json @@ -22,6 +22,19 @@ "../compiler/utilities.ts", "../compiler/binder.ts", "../compiler/checker.ts", + "../compiler/factory.ts", + "../compiler/visitor.ts", + "../compiler/transformers/ts.ts", + "../compiler/transformers/jsx.ts", + "../compiler/transformers/es7.ts", + "../compiler/transformers/es6.ts", + "../compiler/transformers/generators.ts", + "../compiler/transformers/destructuring.ts", + "../compiler/transformers/module/module.ts", + "../compiler/transformers/module/system.ts", + "../compiler/transformers/module/es6.ts", + "../compiler/transformer.ts", + "../compiler/comments.ts", "../compiler/sourcemap.ts", "../compiler/declarationEmitter.ts", "../compiler/emitter.ts", @@ -86,6 +99,7 @@ "./unittests/moduleResolution.ts", "./unittests/tsconfigParsing.ts", "./unittests/commandLineParsing.ts", + "./unittests/configurationExtension.ts", "./unittests/convertCompilerOptionsFromJson.ts", "./unittests/convertTypingOptionsFromJson.ts", "./unittests/tsserverProjectSystem.ts", diff --git a/src/harness/unittests/configurationExtension.ts b/src/harness/unittests/configurationExtension.ts new file mode 100644 index 00000000000..4537dc77576 --- /dev/null +++ b/src/harness/unittests/configurationExtension.ts @@ -0,0 +1,187 @@ +/// +/// + +namespace ts { + const testContents = { + "/dev/tsconfig.json": `{ + "extends": "./configs/base", + "files": [ + "main.ts", + "supplemental.ts" + ] +}`, + "/dev/tsconfig.nostrictnull.json": `{ + "extends": "./tsconfig", + "compilerOptions": { + "strictNullChecks": false + } +}`, + "/dev/configs/base.json": `{ + "compilerOptions": { + "allowJs": true, + "noImplicitAny": true, + "strictNullChecks": true + } +}`, + "/dev/configs/tests.json": `{ + "compilerOptions": { + "preserveConstEnums": true, + "removeComments": false, + "sourceMap": true + }, + "exclude": [ + "../tests/baselines", + "../tests/scenarios" + ], + "include": [ + "../tests/**/*.ts" + ] +}`, + "/dev/circular.json": `{ + "extends": "./circular2", + "compilerOptions": { + "module": "amd" + } +}`, + "/dev/circular2.json": `{ + "extends": "./circular", + "compilerOptions": { + "module": "commonjs" + } +}`, + "/dev/missing.json": `{ + "extends": "./missing2", + "compilerOptions": { + "types": [] + } +}`, + "/dev/failure.json": `{ + "extends": "./failure2.json", + "compilerOptions": { + "typeRoots": [] + } +}`, + "/dev/failure2.json": `{ + "excludes": ["*.js"] +}`, + "/dev/configs/first.json": `{ + "extends": "./base", + "compilerOptions": { + "module": "commonjs" + }, + "files": ["../main.ts"] +}`, + "/dev/configs/second.json": `{ + "extends": "./base", + "compilerOptions": { + "module": "amd" + }, + "include": ["../supplemental.*"] +}`, + "/dev/extends.json": `{ "extends": 42 }`, + "/dev/extends2.json": `{ "extends": "configs/base" }`, + "/dev/main.ts": "", + "/dev/supplemental.ts": "", + "/dev/tests/unit/spec.ts": "", + "/dev/tests/utils.ts": "", + "/dev/tests/scenarios/first.json": "", + "/dev/tests/baselines/first/output.ts": "" + }; + + const caseInsensitiveBasePath = "c:/dev/"; + const caseInsensitiveHost = new Utils.MockParseConfigHost(caseInsensitiveBasePath, /*useCaseSensitiveFileNames*/ false, mapObject(testContents, (key, content) => [`c:${key}`, content])); + + const caseSensitiveBasePath = "/dev/"; + const caseSensitiveHost = new Utils.MockParseConfigHost(caseSensitiveBasePath, /*useCaseSensitiveFileNames*/ true, testContents); + + function verifyDiagnostics(actual: Diagnostic[], expected: {code: number, category: DiagnosticCategory, messageText: string}[]) { + assert.isTrue(expected.length === actual.length, `Expected error: ${JSON.stringify(expected)}. Actual error: ${JSON.stringify(actual)}.`); + for (let i = 0; i < actual.length; i++) { + const actualError = actual[i]; + const expectedError = expected[i]; + assert.equal(actualError.code, expectedError.code, "Error code mismatch"); + assert.equal(actualError.category, expectedError.category, "Category mismatch"); + assert.equal(flattenDiagnosticMessageText(actualError.messageText, "\n"), expectedError.messageText); + } + } + + describe("Configuration Extension", () => { + forEach<[string, string, Utils.MockParseConfigHost], void>([ + ["under a case insensitive host", caseInsensitiveBasePath, caseInsensitiveHost], + ["under a case sensitive host", caseSensitiveBasePath, caseSensitiveHost] + ], ([testName, basePath, host]) => { + function testSuccess(name: string, entry: string, expected: CompilerOptions, expectedFiles: string[]) { + it(name, () => { + const {config, error} = ts.readConfigFile(entry, name => host.readFile(name)); + assert(config && !error, flattenDiagnosticMessageText(error && error.messageText, "\n")); + const parsed = ts.parseJsonConfigFileContent(config, host, basePath, {}, entry); + assert(!parsed.errors.length, flattenDiagnosticMessageText(parsed.errors[0] && parsed.errors[0].messageText, "\n")); + expected.configFilePath = entry; + assert.deepEqual(parsed.options, expected); + assert.deepEqual(parsed.fileNames, expectedFiles); + }); + } + + function testFailure(name: string, entry: string, expectedDiagnostics: {code: number, category: DiagnosticCategory, messageText: string}[]) { + it(name, () => { + const {config, error} = ts.readConfigFile(entry, name => host.readFile(name)); + assert(config && !error, flattenDiagnosticMessageText(error && error.messageText, "\n")); + const parsed = ts.parseJsonConfigFileContent(config, host, basePath, {}, entry); + verifyDiagnostics(parsed.errors, expectedDiagnostics); + }); + } + + describe(testName, () => { + testSuccess("can resolve an extension with a base extension", "tsconfig.json", { + allowJs: true, + noImplicitAny: true, + strictNullChecks: true, + }, [ + combinePaths(basePath, "main.ts"), + combinePaths(basePath, "supplemental.ts"), + ]); + + testSuccess("can resolve an extension with a base extension that overrides options", "tsconfig.nostrictnull.json", { + allowJs: true, + noImplicitAny: true, + strictNullChecks: false, + }, [ + combinePaths(basePath, "main.ts"), + combinePaths(basePath, "supplemental.ts"), + ]); + + testFailure("can report errors on circular imports", "circular.json", [ + { + code: 18000, + category: DiagnosticCategory.Error, + messageText: `Circularity detected while resolving configuration: ${[combinePaths(basePath, "circular.json"), combinePaths(basePath, "circular2.json"), combinePaths(basePath, "circular.json")].join(" -> ")}` + } + ]); + + testFailure("can report missing configurations", "missing.json", [{ + code: 6096, + category: DiagnosticCategory.Message, + messageText: `File './missing2' does not exist.` + }]); + + testFailure("can report errors in extended configs", "failure.json", [{ + code: 6114, + category: DiagnosticCategory.Error, + messageText: `Unknown option 'excludes'. Did you mean 'exclude'?` + }]); + + testFailure("can error when 'extends' is not a string", "extends.json", [{ + code: 5024, + category: DiagnosticCategory.Error, + messageText: `Compiler option 'extends' requires a value of type string.` + }]); + + testFailure("can error when 'extends' is neither relative nor rooted.", "extends2.json", [{ + code: 18001, + category: DiagnosticCategory.Error, + messageText: `The path in an 'extends' options must be relative or rooted.` + }]); + }); + }); + }); +} \ No newline at end of file diff --git a/src/harness/unittests/tsconfigParsing.ts b/src/harness/unittests/tsconfigParsing.ts index eccf3537643..447b69094b1 100644 --- a/src/harness/unittests/tsconfigParsing.ts +++ b/src/harness/unittests/tsconfigParsing.ts @@ -151,7 +151,7 @@ namespace ts { ); }); - it("always exclude outDir", () => { + it("exclude outDir unless overridden", () => { const tsconfigWithoutExclude = `{ "compilerOptions": { @@ -169,7 +169,7 @@ namespace ts { const allFiles = ["/bin/a.ts", "/b.ts"]; const expectedFiles = ["/b.ts"]; assertParseFileList(tsconfigWithoutExclude, "tsconfig.json", rootDir, allFiles, expectedFiles); - assertParseFileList(tsconfigWithExclude, "tsconfig.json", rootDir, allFiles, expectedFiles); + assertParseFileList(tsconfigWithExclude, "tsconfig.json", rootDir, allFiles, allFiles); }); it("implicitly exclude common package folders", () => { diff --git a/src/harness/virtualFileSystem.ts b/src/harness/virtualFileSystem.ts index b6d234acd59..852363b3658 100644 --- a/src/harness/virtualFileSystem.ts +++ b/src/harness/virtualFileSystem.ts @@ -10,9 +10,9 @@ namespace Utils { this.name = name; } - isDirectory() { return false; } - isFile() { return false; } - isFileSystem() { return false; } + isDirectory(): this is VirtualDirectory { return false; } + isFile(): this is VirtualFile { return false; } + isFileSystem(): this is VirtualFileSystem { return false; } } export class VirtualFile extends VirtualFileSystemEntry { @@ -82,9 +82,8 @@ namespace Utils { return file; } else if (entry.isFile()) { - const file = entry; - file.content = content; - return file; + entry.content = content; + return entry; } else { return undefined; @@ -196,10 +195,18 @@ namespace Utils { } export class MockParseConfigHost extends VirtualFileSystem implements ts.ParseConfigHost { - constructor(currentDirectory: string, ignoreCase: boolean, files: string[]) { + constructor(currentDirectory: string, ignoreCase: boolean, files: ts.MapLike | string[]) { super(currentDirectory, ignoreCase); - for (const file of files) { - this.addFile(file); + const fileNames = (files instanceof Array) ? files : ts.getOwnKeys(files); + for (const file of fileNames) { + this.addFile(file, new Harness.LanguageService.ScriptInfo(file, (files as ts.MapLike)[file], /*isRootFile*/false)); + } + } + + readFile(path: string): string { + const value = this.traversePath(path); + if (value && value.isFile()) { + return value.content.content; } } diff --git a/src/lib/es2015.core.d.ts b/src/lib/es2015.core.d.ts index 15fbb1b77c5..7550a02b15e 100644 --- a/src/lib/es2015.core.d.ts +++ b/src/lib/es2015.core.d.ts @@ -13,10 +13,10 @@ interface Array { find(predicate: (value: T, index: number, obj: Array) => boolean, thisArg?: any): T | undefined; /** - * Returns the index of the first element in the array where predicate is true, and undefined + * Returns the index of the first element in the array where predicate is true, and -1 * otherwise. * @param predicate find calls predicate once for each element of the array, in ascending - * order, until it finds one where predicate returns true. If such an element is found, + * order, until it finds one where predicate returns true. If such an element is found, * findIndex immediately returns that element index. Otherwise, findIndex returns -1. * @param thisArg If provided, it will be used as the this value for each invocation of * predicate. If it is not provided, undefined is used instead. @@ -360,10 +360,10 @@ interface ReadonlyArray { find(predicate: (value: T, index: number, obj: ReadonlyArray) => boolean, thisArg?: any): T | undefined; /** - * Returns the index of the first element in the array where predicate is true, and undefined + * Returns the index of the first element in the array where predicate is true, and -1 * otherwise. * @param predicate find calls predicate once for each element of the array, in ascending - * order, until it finds one where predicate returns true. If such an element is found, + * order, until it finds one where predicate returns true. If such an element is found, * findIndex immediately returns that element index. Otherwise, findIndex returns -1. * @param thisArg If provided, it will be used as the this value for each invocation of * predicate. If it is not provided, undefined is used instead. diff --git a/src/lib/es2015.promise.d.ts b/src/lib/es2015.promise.d.ts index c5af984f7e0..e27da2ce11b 100644 --- a/src/lib/es2015.promise.d.ts +++ b/src/lib/es2015.promise.d.ts @@ -8,7 +8,7 @@ interface Promise { * @param onrejected The callback to execute when the Promise is rejected. * @returns A Promise for the completion of which ever callback is executed. */ - then(onfulfilled: (value: T) => TResult1 | PromiseLike, onrejected: (reason: any) => TResult2 | PromiseLike): Promise; + then(onfulfilled?: ((value: T) => T | PromiseLike) | undefined | null, onrejected?: ((reason: any) => T | PromiseLike) | undefined | null): Promise; /** * Attaches callbacks for the resolution and/or rejection of the Promise. @@ -16,20 +16,30 @@ interface Promise { * @param onrejected The callback to execute when the Promise is rejected. * @returns A Promise for the completion of which ever callback is executed. */ - then(onfulfilled: (value: T) => TResult | PromiseLike, onrejected: (reason: any) => TResult | PromiseLike): Promise; + then(onfulfilled: ((value: T) => T | PromiseLike) | undefined | null, onrejected: (reason: any) => TResult | PromiseLike): Promise; /** * Attaches callbacks for the resolution and/or rejection of the Promise. * @param onfulfilled The callback to execute when the Promise is resolved. + * @param onrejected The callback to execute when the Promise is rejected. * @returns A Promise for the completion of which ever callback is executed. */ - then(onfulfilled: (value: T) => TResult | PromiseLike): Promise; + then(onfulfilled: (value: T) => TResult | PromiseLike, onrejected?: ((reason: any) => TResult | PromiseLike) | undefined | null): Promise; /** - * Creates a new Promise with the same internal state of this Promise. - * @returns A Promise. + * Attaches callbacks for the resolution and/or rejection of the Promise. + * @param onfulfilled The callback to execute when the Promise is resolved. + * @param onrejected The callback to execute when the Promise is rejected. + * @returns A Promise for the completion of which ever callback is executed. */ - then(): Promise; + then(onfulfilled: (value: T) => TResult1 | PromiseLike, onrejected: (reason: any) => TResult2 | PromiseLike): Promise; + + /** + * Attaches a callback for only the rejection of the Promise. + * @param onrejected The callback to execute when the Promise is rejected. + * @returns A Promise for the completion of the callback. + */ + catch(onrejected?: ((reason: any) => T | PromiseLike) | undefined | null): Promise; /** * Attaches a callback for only the rejection of the Promise. @@ -37,13 +47,6 @@ interface Promise { * @returns A Promise for the completion of the callback. */ catch(onrejected: (reason: any) => TResult | PromiseLike): Promise; - - /** - * Attaches a callback for only the rejection of the Promise. - * @param onrejected The callback to execute when the Promise is rejected. - * @returns A Promise for the completion of the callback. - */ - catch(onrejected: (reason: any) => T | PromiseLike): Promise; } interface PromiseConstructor { @@ -140,6 +143,86 @@ interface PromiseConstructor { */ all(values: (T | PromiseLike)[]): Promise; + /** + * Creates a Promise that is resolved or rejected when any of the provided Promises are resolved + * or rejected. + * @param values An array of Promises. + * @returns A new Promise. + */ + race(values: [T1 | PromiseLike, T2 | PromiseLike, T3 | PromiseLike, T4 | PromiseLike, T5 | PromiseLike, T6 | PromiseLike, T7 | PromiseLike, T8 | PromiseLike, T9 | PromiseLike, T10 | PromiseLike]): Promise; + + /** + * Creates a Promise that is resolved or rejected when any of the provided Promises are resolved + * or rejected. + * @param values An array of Promises. + * @returns A new Promise. + */ + race(values: [T1 | PromiseLike, T2 | PromiseLike, T3 | PromiseLike, T4 | PromiseLike, T5 | PromiseLike, T6 | PromiseLike, T7 | PromiseLike, T8 | PromiseLike, T9 | PromiseLike]): Promise; + + /** + * Creates a Promise that is resolved or rejected when any of the provided Promises are resolved + * or rejected. + * @param values An array of Promises. + * @returns A new Promise. + */ + race(values: [T1 | PromiseLike, T2 | PromiseLike, T3 | PromiseLike, T4 | PromiseLike, T5 | PromiseLike, T6 | PromiseLike, T7 | PromiseLike, T8 | PromiseLike]): Promise; + + /** + * Creates a Promise that is resolved or rejected when any of the provided Promises are resolved + * or rejected. + * @param values An array of Promises. + * @returns A new Promise. + */ + race(values: [T1 | PromiseLike, T2 | PromiseLike, T3 | PromiseLike, T4 | PromiseLike, T5 | PromiseLike, T6 | PromiseLike, T7 | PromiseLike]): Promise; + + /** + * Creates a Promise that is resolved or rejected when any of the provided Promises are resolved + * or rejected. + * @param values An array of Promises. + * @returns A new Promise. + */ + race(values: [T1 | PromiseLike, T2 | PromiseLike, T3 | PromiseLike, T4 | PromiseLike, T5 | PromiseLike, T6 | PromiseLike]): Promise; + + /** + * Creates a Promise that is resolved or rejected when any of the provided Promises are resolved + * or rejected. + * @param values An array of Promises. + * @returns A new Promise. + */ + race(values: [T1 | PromiseLike, T2 | PromiseLike, T3 | PromiseLike, T4 | PromiseLike, T5 | PromiseLike]): Promise; + + /** + * Creates a Promise that is resolved or rejected when any of the provided Promises are resolved + * or rejected. + * @param values An array of Promises. + * @returns A new Promise. + */ + race(values: [T1 | PromiseLike, T2 | PromiseLike, T3 | PromiseLike, T4 | PromiseLike]): Promise; + + /** + * Creates a Promise that is resolved or rejected when any of the provided Promises are resolved + * or rejected. + * @param values An array of Promises. + * @returns A new Promise. + */ + race(values: [T1 | PromiseLike, T2 | PromiseLike, T3 | PromiseLike]): Promise; + + /** + * Creates a Promise that is resolved or rejected when any of the provided Promises are resolved + * or rejected. + * @param values An array of Promises. + * @returns A new Promise. + */ + race(values: [T1 | PromiseLike, T2 | PromiseLike]): Promise; + + /** + * Creates a Promise that is resolved or rejected when any of the provided Promises are resolved + * or rejected. + * @param values An array of Promises. + * @returns A new Promise. + */ + race(values: (T | PromiseLike)[]): Promise; + /** * Creates a new rejected promise for the provided reason. * @param reason The reason the promise was rejected. diff --git a/src/lib/es5.d.ts b/src/lib/es5.d.ts index a91ad4b126e..9421b4376e4 100644 --- a/src/lib/es5.d.ts +++ b/src/lib/es5.d.ts @@ -1271,13 +1271,44 @@ declare type PromiseConstructorLike = new (executor: (resolve: (value?: T | P interface PromiseLike { /** - * Attaches callbacks for the resolution and/or rejection of the Promise. - * @param onfulfilled The callback to execute when the Promise is resolved. - * @param onrejected The callback to execute when the Promise is rejected. - * @returns A Promise for the completion of which ever callback is executed. - */ - then(onfulfilled?: (value: T) => TResult | PromiseLike, onrejected?: (reason: any) => TResult | PromiseLike): PromiseLike; - then(onfulfilled?: (value: T) => TResult | PromiseLike, onrejected?: (reason: any) => void): PromiseLike; + * Attaches callbacks for the resolution and/or rejection of the Promise. + * @param onfulfilled The callback to execute when the Promise is resolved. + * @param onrejected The callback to execute when the Promise is rejected. + * @returns A Promise for the completion of which ever callback is executed. + */ + then( + onfulfilled?: ((value: T) => T | PromiseLike) | undefined | null, + onrejected?: ((reason: any) => T | PromiseLike) | undefined | null): PromiseLike; + + /** + * Attaches callbacks for the resolution and/or rejection of the Promise. + * @param onfulfilled The callback to execute when the Promise is resolved. + * @param onrejected The callback to execute when the Promise is rejected. + * @returns A Promise for the completion of which ever callback is executed. + */ + then( + onfulfilled: ((value: T) => T | PromiseLike) | undefined | null, + onrejected: (reason: any) => TResult | PromiseLike): PromiseLike; + + /** + * Attaches callbacks for the resolution and/or rejection of the Promise. + * @param onfulfilled The callback to execute when the Promise is resolved. + * @param onrejected The callback to execute when the Promise is rejected. + * @returns A Promise for the completion of which ever callback is executed. + */ + then( + onfulfilled: (value: T) => TResult | PromiseLike, + onrejected?: ((reason: any) => TResult | PromiseLike) | undefined | null): PromiseLike; + + /** + * Attaches callbacks for the resolution and/or rejection of the Promise. + * @param onfulfilled The callback to execute when the Promise is resolved. + * @param onrejected The callback to execute when the Promise is rejected. + * @returns A Promise for the completion of which ever callback is executed. + */ + then( + onfulfilled: (value: T) => TResult1 | PromiseLike, + onrejected: (reason: any) => TResult2 | PromiseLike): PromiseLike; } interface ArrayLike { @@ -1537,7 +1568,7 @@ interface Int8Array { find(predicate: (value: number, index: number, obj: Array) => boolean, thisArg?: any): number | undefined; /** - * Returns the index of the first element in the array where predicate is true, and undefined + * Returns the index of the first element in the array where predicate is true, and -1 * otherwise. * @param predicate find calls predicate once for each element of the array, in ascending * order, until it finds one where predicate returns true. If such an element is found, @@ -1810,7 +1841,7 @@ interface Uint8Array { find(predicate: (value: number, index: number, obj: Array) => boolean, thisArg?: any): number | undefined; /** - * Returns the index of the first element in the array where predicate is true, and undefined + * Returns the index of the first element in the array where predicate is true, and -1 * otherwise. * @param predicate find calls predicate once for each element of the array, in ascending * order, until it finds one where predicate returns true. If such an element is found, @@ -2084,7 +2115,7 @@ interface Uint8ClampedArray { find(predicate: (value: number, index: number, obj: Array) => boolean, thisArg?: any): number | undefined; /** - * Returns the index of the first element in the array where predicate is true, and undefined + * Returns the index of the first element in the array where predicate is true, and -1 * otherwise. * @param predicate find calls predicate once for each element of the array, in ascending * order, until it finds one where predicate returns true. If such an element is found, @@ -2357,7 +2388,7 @@ interface Int16Array { find(predicate: (value: number, index: number, obj: Array) => boolean, thisArg?: any): number | undefined; /** - * Returns the index of the first element in the array where predicate is true, and undefined + * Returns the index of the first element in the array where predicate is true, and -1 * otherwise. * @param predicate find calls predicate once for each element of the array, in ascending * order, until it finds one where predicate returns true. If such an element is found, @@ -2631,7 +2662,7 @@ interface Uint16Array { find(predicate: (value: number, index: number, obj: Array) => boolean, thisArg?: any): number | undefined; /** - * Returns the index of the first element in the array where predicate is true, and undefined + * Returns the index of the first element in the array where predicate is true, and -1 * otherwise. * @param predicate find calls predicate once for each element of the array, in ascending * order, until it finds one where predicate returns true. If such an element is found, @@ -2904,7 +2935,7 @@ interface Int32Array { find(predicate: (value: number, index: number, obj: Array) => boolean, thisArg?: any): number | undefined; /** - * Returns the index of the first element in the array where predicate is true, and undefined + * Returns the index of the first element in the array where predicate is true, and -1 * otherwise. * @param predicate find calls predicate once for each element of the array, in ascending * order, until it finds one where predicate returns true. If such an element is found, @@ -3177,7 +3208,7 @@ interface Uint32Array { find(predicate: (value: number, index: number, obj: Array) => boolean, thisArg?: any): number | undefined; /** - * Returns the index of the first element in the array where predicate is true, and undefined + * Returns the index of the first element in the array where predicate is true, and -1 * otherwise. * @param predicate find calls predicate once for each element of the array, in ascending * order, until it finds one where predicate returns true. If such an element is found, @@ -3450,7 +3481,7 @@ interface Float32Array { find(predicate: (value: number, index: number, obj: Array) => boolean, thisArg?: any): number | undefined; /** - * Returns the index of the first element in the array where predicate is true, and undefined + * Returns the index of the first element in the array where predicate is true, and -1 * otherwise. * @param predicate find calls predicate once for each element of the array, in ascending * order, until it finds one where predicate returns true. If such an element is found, @@ -3724,7 +3755,7 @@ interface Float64Array { find(predicate: (value: number, index: number, obj: Array) => boolean, thisArg?: any): number | undefined; /** - * Returns the index of the first element in the array where predicate is true, and undefined + * Returns the index of the first element in the array where predicate is true, and -1 * otherwise. * @param predicate find calls predicate once for each element of the array, in ascending * order, until it finds one where predicate returns true. If such an element is found, @@ -3949,12 +3980,9 @@ declare module Intl { resolvedOptions(): ResolvedCollatorOptions; } var Collator: { - new (locales?: string[], options?: CollatorOptions): Collator; - new (locale?: string, options?: CollatorOptions): Collator; - (locales?: string[], options?: CollatorOptions): Collator; - (locale?: string, options?: CollatorOptions): Collator; - supportedLocalesOf(locales: string[], options?: CollatorOptions): string[]; - supportedLocalesOf(locale: string, options?: CollatorOptions): string[]; + new (locales?: string | string[], options?: CollatorOptions): Collator; + (locales?: string | string[], options?: CollatorOptions): Collator; + supportedLocalesOf(locales: string | string[], options?: CollatorOptions): string[]; } interface NumberFormatOptions { @@ -3989,12 +4017,9 @@ declare module Intl { resolvedOptions(): ResolvedNumberFormatOptions; } var NumberFormat: { - new (locales?: string[], options?: NumberFormatOptions): NumberFormat; - new (locale?: string, options?: NumberFormatOptions): NumberFormat; - (locales?: string[], options?: NumberFormatOptions): NumberFormat; - (locale?: string, options?: NumberFormatOptions): NumberFormat; - supportedLocalesOf(locales: string[], options?: NumberFormatOptions): string[]; - supportedLocalesOf(locale: string, options?: NumberFormatOptions): string[]; + new (locales?: string | string[], options?: NumberFormatOptions): NumberFormat; + (locales?: string | string[], options?: NumberFormatOptions): NumberFormat; + supportedLocalesOf(locales: string | string[], options?: NumberFormatOptions): string[]; } interface DateTimeFormatOptions { @@ -4035,88 +4060,49 @@ declare module Intl { resolvedOptions(): ResolvedDateTimeFormatOptions; } var DateTimeFormat: { - new (locales?: string[], options?: DateTimeFormatOptions): DateTimeFormat; - new (locale?: string, options?: DateTimeFormatOptions): DateTimeFormat; - (locales?: string[], options?: DateTimeFormatOptions): DateTimeFormat; - (locale?: string, options?: DateTimeFormatOptions): DateTimeFormat; - supportedLocalesOf(locales: string[], options?: DateTimeFormatOptions): string[]; - supportedLocalesOf(locale: string, options?: DateTimeFormatOptions): string[]; + new (locales?: string | string[], options?: DateTimeFormatOptions): DateTimeFormat; + (locales?: string | string[], options?: DateTimeFormatOptions): DateTimeFormat; + supportedLocalesOf(locales: string | string[], options?: DateTimeFormatOptions): string[]; } } interface String { /** - * Determines whether two strings are equivalent in the current locale. + * Determines whether two strings are equivalent in the current or specified locale. * @param that String to compare to target string - * @param locales An array of locale strings that contain one or more language or locale tags. If you include more than one locale string, list them in descending order of priority so that the first entry is the preferred locale. If you omit this parameter, the default locale of the JavaScript runtime is used. This parameter must conform to BCP 47 standards; see the Intl.Collator object for details. + * @param locales A locale string or array of locale strings that contain one or more language or locale tags. If you include more than one locale string, list them in descending order of priority so that the first entry is the preferred locale. If you omit this parameter, the default locale of the JavaScript runtime is used. This parameter must conform to BCP 47 standards; see the Intl.Collator object for details. * @param options An object that contains one or more properties that specify comparison options. see the Intl.Collator object for details. */ - localeCompare(that: string, locales: string[], options?: Intl.CollatorOptions): number; - - /** - * Determines whether two strings are equivalent in the current locale. - * @param that String to compare to target string - * @param locale Locale tag. If you omit this parameter, the default locale of the JavaScript runtime is used. This parameter must conform to BCP 47 standards; see the Intl.Collator object for details. - * @param options An object that contains one or more properties that specify comparison options. see the Intl.Collator object for details. - */ - localeCompare(that: string, locale: string, options?: Intl.CollatorOptions): number; + localeCompare(that: string, locales?: string | string[], options?: Intl.CollatorOptions): number; } interface Number { /** * Converts a number to a string by using the current or specified locale. - * @param locales An array of locale strings that contain one or more language or locale tags. If you include more than one locale string, list them in descending order of priority so that the first entry is the preferred locale. If you omit this parameter, the default locale of the JavaScript runtime is used. + * @param locales A locale string or array of locale strings that contain one or more language or locale tags. If you include more than one locale string, list them in descending order of priority so that the first entry is the preferred locale. If you omit this parameter, the default locale of the JavaScript runtime is used. * @param options An object that contains one or more properties that specify comparison options. */ - toLocaleString(locales?: string[], options?: Intl.NumberFormatOptions): string; - - /** - * Converts a number to a string by using the current or specified locale. - * @param locale Locale tag. If you omit this parameter, the default locale of the JavaScript runtime is used. - * @param options An object that contains one or more properties that specify comparison options. - */ - toLocaleString(locale?: string, options?: Intl.NumberFormatOptions): string; + toLocaleString(locales?: string | string[], options?: Intl.NumberFormatOptions): string; } interface Date { /** * Converts a date and time to a string by using the current or specified locale. - * @param locales An array of locale strings that contain one or more language or locale tags. If you include more than one locale string, list them in descending order of priority so that the first entry is the preferred locale. If you omit this parameter, the default locale of the JavaScript runtime is used. + * @param locales A locale string or array of locale strings that contain one or more language or locale tags. If you include more than one locale string, list them in descending order of priority so that the first entry is the preferred locale. If you omit this parameter, the default locale of the JavaScript runtime is used. * @param options An object that contains one or more properties that specify comparison options. */ - toLocaleString(locales?: string[], options?: Intl.DateTimeFormatOptions): string; + toLocaleString(locales?: string | string[], options?: Intl.DateTimeFormatOptions): string; /** * Converts a date to a string by using the current or specified locale. - * @param locales An array of locale strings that contain one or more language or locale tags. If you include more than one locale string, list them in descending order of priority so that the first entry is the preferred locale. If you omit this parameter, the default locale of the JavaScript runtime is used. + * @param locales A locale string or array of locale strings that contain one or more language or locale tags. If you include more than one locale string, list them in descending order of priority so that the first entry is the preferred locale. If you omit this parameter, the default locale of the JavaScript runtime is used. * @param options An object that contains one or more properties that specify comparison options. */ - toLocaleDateString(locales?: string[], options?: Intl.DateTimeFormatOptions): string; + toLocaleDateString(locales?: string | string[], options?: Intl.DateTimeFormatOptions): string; /** * Converts a time to a string by using the current or specified locale. - * @param locale Locale tag. If you omit this parameter, the default locale of the JavaScript runtime is used. + * @param locales A locale string or array of locale strings that contain one or more language or locale tags. If you include more than one locale string, list them in descending order of priority so that the first entry is the preferred locale. If you omit this parameter, the default locale of the JavaScript runtime is used. * @param options An object that contains one or more properties that specify comparison options. */ - toLocaleTimeString(locale?: string[], options?: Intl.DateTimeFormatOptions): string; - - /** - * Converts a date and time to a string by using the current or specified locale. - * @param locale Locale tag. If you omit this parameter, the default locale of the JavaScript runtime is used. - * @param options An object that contains one or more properties that specify comparison options. - */ - toLocaleString(locale?: string, options?: Intl.DateTimeFormatOptions): string; - - /** - * Converts a date to a string by using the current or specified locale. - * @param locale Locale tag. If you omit this parameter, the default locale of the JavaScript runtime is used. - * @param options An object that contains one or more properties that specify comparison options. - */ - toLocaleDateString(locale?: string, options?: Intl.DateTimeFormatOptions): string; - - /** - * Converts a time to a string by using the current or specified locale. - * @param locale Locale tag. If you omit this parameter, the default locale of the JavaScript runtime is used. - * @param options An object that contains one or more properties that specify comparison options. - */ - toLocaleTimeString(locale?: string, options?: Intl.DateTimeFormatOptions): string; + toLocaleTimeString(locales?: string | string[], options?: Intl.DateTimeFormatOptions): string; } diff --git a/src/server/client.ts b/src/server/client.ts index 5af9cec6e4c..7268c3c9573 100644 --- a/src/server/client.ts +++ b/src/server/client.ts @@ -246,6 +246,10 @@ namespace ts.server { return response.body[0]; } + getCompletionEntrySymbol(fileName: string, position: number, entryName: string): Symbol { + throw new Error("Not Implemented Yet."); + } + getNavigateToItems(searchValue: string): NavigateToItem[] { const args: protocol.NavtoRequestArgs = { searchValue, diff --git a/src/server/editorServices.ts b/src/server/editorServices.ts index e0f9e8d5cf6..e8df088a5c2 100644 --- a/src/server/editorServices.ts +++ b/src/server/editorServices.ts @@ -1597,6 +1597,7 @@ namespace ts.server { InsertSpaceAfterOpeningAndBeforeClosingNonemptyBraces: true, InsertSpaceAfterOpeningAndBeforeClosingTemplateStringBraces: false, InsertSpaceAfterOpeningAndBeforeClosingJsxExpressionBraces: false, + InsertSpaceAfterTypeAssertion: false, PlaceOpenBraceOnNewLineForFunctions: false, PlaceOpenBraceOnNewLineForControlBlocks: false, }); diff --git a/src/server/protocol.d.ts b/src/server/protocol.d.ts index 26227b5c4e2..ebf43cdbb9e 100644 --- a/src/server/protocol.d.ts +++ b/src/server/protocol.d.ts @@ -1156,6 +1156,11 @@ declare namespace ts.server.protocol { * Optional limit on the number of items to return. */ maxResultCount?: number; + /** + * Optional flag to indicate we want results for just the current file + * or the entire project. + */ + currentFileOnly?: boolean; } /** diff --git a/src/server/session.ts b/src/server/session.ts index 9cbab96c42f..1cf971cf5cf 100644 --- a/src/server/session.ts +++ b/src/server/session.ts @@ -963,7 +963,7 @@ namespace ts.server { return this.decorateNavigationBarItem(project, fileName, items, compilerService.host.getLineIndex(fileName)); } - private getNavigateToItems(searchValue: string, fileName: string, maxResultCount?: number): protocol.NavtoItem[] { + private getNavigateToItems(searchValue: string, fileName: string, maxResultCount?: number, currentFileOnly?: boolean): protocol.NavtoItem[] { const file = ts.normalizePath(fileName); const info = this.projectService.getScriptInfo(file); const projects = this.projectService.findReferencingProjects(info); @@ -976,7 +976,7 @@ namespace ts.server { projectsWithLanguageServiceEnabeld, (project: Project) => { const compilerService = project.compilerService; - const navItems = compilerService.languageService.getNavigateToItems(searchValue, maxResultCount); + const navItems = compilerService.languageService.getNavigateToItems(searchValue, maxResultCount, currentFileOnly ? fileName : undefined); if (!navItems) { return []; } @@ -1215,7 +1215,7 @@ namespace ts.server { }, [CommandNames.Navto]: (request: protocol.Request) => { const navtoArgs = request.arguments; - return { response: this.getNavigateToItems(navtoArgs.searchValue, navtoArgs.file, navtoArgs.maxResultCount), responseRequired: true }; + return { response: this.getNavigateToItems(navtoArgs.searchValue, navtoArgs.file, navtoArgs.maxResultCount, navtoArgs.currentFileOnly), responseRequired: true }; }, [CommandNames.Brace]: (request: protocol.Request) => { const braceArguments = request.arguments; diff --git a/src/services/classifier.ts b/src/services/classifier.ts new file mode 100644 index 00000000000..0c19fbc74f9 --- /dev/null +++ b/src/services/classifier.ts @@ -0,0 +1,985 @@ +namespace ts { + /// Classifier + export function createClassifier(): Classifier { + const scanner = createScanner(ScriptTarget.Latest, /*skipTrivia*/ false); + + /// We do not have a full parser support to know when we should parse a regex or not + /// If we consider every slash token to be a regex, we could be missing cases like "1/2/3", where + /// we have a series of divide operator. this list allows us to be more accurate by ruling out + /// locations where a regexp cannot exist. + const noRegexTable: boolean[] = []; + noRegexTable[SyntaxKind.Identifier] = true; + noRegexTable[SyntaxKind.StringLiteral] = true; + noRegexTable[SyntaxKind.NumericLiteral] = true; + noRegexTable[SyntaxKind.RegularExpressionLiteral] = true; + noRegexTable[SyntaxKind.ThisKeyword] = true; + noRegexTable[SyntaxKind.PlusPlusToken] = true; + noRegexTable[SyntaxKind.MinusMinusToken] = true; + noRegexTable[SyntaxKind.CloseParenToken] = true; + noRegexTable[SyntaxKind.CloseBracketToken] = true; + noRegexTable[SyntaxKind.CloseBraceToken] = true; + noRegexTable[SyntaxKind.TrueKeyword] = true; + noRegexTable[SyntaxKind.FalseKeyword] = true; + + // Just a stack of TemplateHeads and OpenCurlyBraces, used to perform rudimentary (inexact) + // classification on template strings. Because of the context free nature of templates, + // the only precise way to classify a template portion would be by propagating the stack across + // lines, just as we do with the end-of-line state. However, this is a burden for implementers, + // and the behavior is entirely subsumed by the syntactic classifier anyway, so we instead + // flatten any nesting when the template stack is non-empty and encode it in the end-of-line state. + // Situations in which this fails are + // 1) When template strings are nested across different lines: + // `hello ${ `world + // ` }` + // + // Where on the second line, you will get the closing of a template, + // a closing curly, and a new template. + // + // 2) When substitution expressions have curly braces and the curly brace falls on the next line: + // `hello ${ () => { + // return "world" } } ` + // + // Where on the second line, you will get the 'return' keyword, + // a string literal, and a template end consisting of '} } `'. + const templateStack: SyntaxKind[] = []; + + /** Returns true if 'keyword2' can legally follow 'keyword1' in any language construct. */ + function canFollow(keyword1: SyntaxKind, keyword2: SyntaxKind) { + if (isAccessibilityModifier(keyword1)) { + if (keyword2 === SyntaxKind.GetKeyword || + keyword2 === SyntaxKind.SetKeyword || + keyword2 === SyntaxKind.ConstructorKeyword || + keyword2 === SyntaxKind.StaticKeyword) { + + // Allow things like "public get", "public constructor" and "public static". + // These are all legal. + return true; + } + + // Any other keyword following "public" is actually an identifier an not a real + // keyword. + return false; + } + + // Assume any other keyword combination is legal. This can be refined in the future + // if there are more cases we want the classifier to be better at. + return true; + } + + function convertClassifications(classifications: Classifications, text: string): ClassificationResult { + const entries: ClassificationInfo[] = []; + const dense = classifications.spans; + let lastEnd = 0; + + for (let i = 0, n = dense.length; i < n; i += 3) { + const start = dense[i]; + const length = dense[i + 1]; + const type = dense[i + 2]; + + // Make a whitespace entry between the last item and this one. + if (lastEnd >= 0) { + const whitespaceLength = start - lastEnd; + if (whitespaceLength > 0) { + entries.push({ length: whitespaceLength, classification: TokenClass.Whitespace }); + } + } + + entries.push({ length, classification: convertClassification(type) }); + lastEnd = start + length; + } + + const whitespaceLength = text.length - lastEnd; + if (whitespaceLength > 0) { + entries.push({ length: whitespaceLength, classification: TokenClass.Whitespace }); + } + + return { entries, finalLexState: classifications.endOfLineState }; + } + + function convertClassification(type: ClassificationType): TokenClass { + switch (type) { + case ClassificationType.comment: return TokenClass.Comment; + case ClassificationType.keyword: return TokenClass.Keyword; + case ClassificationType.numericLiteral: return TokenClass.NumberLiteral; + case ClassificationType.operator: return TokenClass.Operator; + case ClassificationType.stringLiteral: return TokenClass.StringLiteral; + case ClassificationType.whiteSpace: return TokenClass.Whitespace; + case ClassificationType.punctuation: return TokenClass.Punctuation; + case ClassificationType.identifier: + case ClassificationType.className: + case ClassificationType.enumName: + case ClassificationType.interfaceName: + case ClassificationType.moduleName: + case ClassificationType.typeParameterName: + case ClassificationType.typeAliasName: + case ClassificationType.text: + case ClassificationType.parameterName: + default: + return TokenClass.Identifier; + } + } + + function getClassificationsForLine(text: string, lexState: EndOfLineState, syntacticClassifierAbsent: boolean): ClassificationResult { + return convertClassifications(getEncodedLexicalClassifications(text, lexState, syntacticClassifierAbsent), text); + } + + // If there is a syntactic classifier ('syntacticClassifierAbsent' is false), + // we will be more conservative in order to avoid conflicting with the syntactic classifier. + function getEncodedLexicalClassifications(text: string, lexState: EndOfLineState, syntacticClassifierAbsent: boolean): Classifications { + let offset = 0; + let token = SyntaxKind.Unknown; + let lastNonTriviaToken = SyntaxKind.Unknown; + + // Empty out the template stack for reuse. + while (templateStack.length > 0) { + templateStack.pop(); + } + + // If we're in a string literal, then prepend: "\ + // (and a newline). That way when we lex we'll think we're still in a string literal. + // + // If we're in a multiline comment, then prepend: /* + // (and a newline). That way when we lex we'll think we're still in a multiline comment. + switch (lexState) { + case EndOfLineState.InDoubleQuoteStringLiteral: + text = "\"\\\n" + text; + offset = 3; + break; + case EndOfLineState.InSingleQuoteStringLiteral: + text = "'\\\n" + text; + offset = 3; + break; + case EndOfLineState.InMultiLineCommentTrivia: + text = "/*\n" + text; + offset = 3; + break; + case EndOfLineState.InTemplateHeadOrNoSubstitutionTemplate: + text = "`\n" + text; + offset = 2; + break; + case EndOfLineState.InTemplateMiddleOrTail: + text = "}\n" + text; + offset = 2; + // fallthrough + case EndOfLineState.InTemplateSubstitutionPosition: + templateStack.push(SyntaxKind.TemplateHead); + break; + } + + scanner.setText(text); + + const result: Classifications = { + endOfLineState: EndOfLineState.None, + spans: [] + }; + + // We can run into an unfortunate interaction between the lexical and syntactic classifier + // when the user is typing something generic. Consider the case where the user types: + // + // Foo tokens. It's a weak heuristic, but should + // work well enough in practice. + let angleBracketStack = 0; + + do { + token = scanner.scan(); + + if (!isTrivia(token)) { + if ((token === SyntaxKind.SlashToken || token === SyntaxKind.SlashEqualsToken) && !noRegexTable[lastNonTriviaToken]) { + if (scanner.reScanSlashToken() === SyntaxKind.RegularExpressionLiteral) { + token = SyntaxKind.RegularExpressionLiteral; + } + } + else if (lastNonTriviaToken === SyntaxKind.DotToken && isKeyword(token)) { + token = SyntaxKind.Identifier; + } + else if (isKeyword(lastNonTriviaToken) && isKeyword(token) && !canFollow(lastNonTriviaToken, token)) { + // We have two keywords in a row. Only treat the second as a keyword if + // it's a sequence that could legally occur in the language. Otherwise + // treat it as an identifier. This way, if someone writes "private var" + // we recognize that 'var' is actually an identifier here. + token = SyntaxKind.Identifier; + } + else if (lastNonTriviaToken === SyntaxKind.Identifier && + token === SyntaxKind.LessThanToken) { + // Could be the start of something generic. Keep track of that by bumping + // up the current count of generic contexts we may be in. + angleBracketStack++; + } + else if (token === SyntaxKind.GreaterThanToken && angleBracketStack > 0) { + // If we think we're currently in something generic, then mark that that + // generic entity is complete. + angleBracketStack--; + } + else if (token === SyntaxKind.AnyKeyword || + token === SyntaxKind.StringKeyword || + token === SyntaxKind.NumberKeyword || + token === SyntaxKind.BooleanKeyword || + token === SyntaxKind.SymbolKeyword) { + if (angleBracketStack > 0 && !syntacticClassifierAbsent) { + // If it looks like we're could be in something generic, don't classify this + // as a keyword. We may just get overwritten by the syntactic classifier, + // causing a noisy experience for the user. + token = SyntaxKind.Identifier; + } + } + else if (token === SyntaxKind.TemplateHead) { + templateStack.push(token); + } + else if (token === SyntaxKind.OpenBraceToken) { + // If we don't have anything on the template stack, + // then we aren't trying to keep track of a previously scanned template head. + if (templateStack.length > 0) { + templateStack.push(token); + } + } + else if (token === SyntaxKind.CloseBraceToken) { + // If we don't have anything on the template stack, + // then we aren't trying to keep track of a previously scanned template head. + if (templateStack.length > 0) { + const lastTemplateStackToken = lastOrUndefined(templateStack); + + if (lastTemplateStackToken === SyntaxKind.TemplateHead) { + token = scanner.reScanTemplateToken(); + + // Only pop on a TemplateTail; a TemplateMiddle indicates there is more for us. + if (token === SyntaxKind.TemplateTail) { + templateStack.pop(); + } + else { + Debug.assert(token === SyntaxKind.TemplateMiddle, "Should have been a template middle. Was " + token); + } + } + else { + Debug.assert(lastTemplateStackToken === SyntaxKind.OpenBraceToken, "Should have been an open brace. Was: " + token); + templateStack.pop(); + } + } + } + + lastNonTriviaToken = token; + } + + processToken(); + } + while (token !== SyntaxKind.EndOfFileToken); + + return result; + + function processToken(): void { + const start = scanner.getTokenPos(); + const end = scanner.getTextPos(); + + addResult(start, end, classFromKind(token)); + + if (end >= text.length) { + if (token === SyntaxKind.StringLiteral) { + // Check to see if we finished up on a multiline string literal. + const tokenText = scanner.getTokenText(); + if (scanner.isUnterminated()) { + const lastCharIndex = tokenText.length - 1; + + let numBackslashes = 0; + while (tokenText.charCodeAt(lastCharIndex - numBackslashes) === CharacterCodes.backslash) { + numBackslashes++; + } + + // If we have an odd number of backslashes, then the multiline string is unclosed + if (numBackslashes & 1) { + const quoteChar = tokenText.charCodeAt(0); + result.endOfLineState = quoteChar === CharacterCodes.doubleQuote + ? EndOfLineState.InDoubleQuoteStringLiteral + : EndOfLineState.InSingleQuoteStringLiteral; + } + } + } + else if (token === SyntaxKind.MultiLineCommentTrivia) { + // Check to see if the multiline comment was unclosed. + if (scanner.isUnterminated()) { + result.endOfLineState = EndOfLineState.InMultiLineCommentTrivia; + } + } + else if (isTemplateLiteralKind(token)) { + if (scanner.isUnterminated()) { + if (token === SyntaxKind.TemplateTail) { + result.endOfLineState = EndOfLineState.InTemplateMiddleOrTail; + } + else if (token === SyntaxKind.NoSubstitutionTemplateLiteral) { + result.endOfLineState = EndOfLineState.InTemplateHeadOrNoSubstitutionTemplate; + } + else { + Debug.fail("Only 'NoSubstitutionTemplateLiteral's and 'TemplateTail's can be unterminated; got SyntaxKind #" + token); + } + } + } + else if (templateStack.length > 0 && lastOrUndefined(templateStack) === SyntaxKind.TemplateHead) { + result.endOfLineState = EndOfLineState.InTemplateSubstitutionPosition; + } + } + } + + function addResult(start: number, end: number, classification: ClassificationType): void { + if (classification === ClassificationType.whiteSpace) { + // Don't bother with whitespace classifications. They're not needed. + return; + } + + if (start === 0 && offset > 0) { + // We're classifying the first token, and this was a case where we prepended + // text. We should consider the start of this token to be at the start of + // the original text. + start += offset; + } + + // All our tokens are in relation to the augmented text. Move them back to be + // relative to the original text. + start -= offset; + end -= offset; + const length = end - start; + + if (length > 0) { + result.spans.push(start); + result.spans.push(length); + result.spans.push(classification); + } + } + } + + function isBinaryExpressionOperatorToken(token: SyntaxKind): boolean { + switch (token) { + case SyntaxKind.AsteriskToken: + case SyntaxKind.SlashToken: + case SyntaxKind.PercentToken: + case SyntaxKind.PlusToken: + case SyntaxKind.MinusToken: + case SyntaxKind.LessThanLessThanToken: + case SyntaxKind.GreaterThanGreaterThanToken: + case SyntaxKind.GreaterThanGreaterThanGreaterThanToken: + case SyntaxKind.LessThanToken: + case SyntaxKind.GreaterThanToken: + case SyntaxKind.LessThanEqualsToken: + case SyntaxKind.GreaterThanEqualsToken: + case SyntaxKind.InstanceOfKeyword: + case SyntaxKind.InKeyword: + case SyntaxKind.AsKeyword: + case SyntaxKind.EqualsEqualsToken: + case SyntaxKind.ExclamationEqualsToken: + case SyntaxKind.EqualsEqualsEqualsToken: + case SyntaxKind.ExclamationEqualsEqualsToken: + case SyntaxKind.AmpersandToken: + case SyntaxKind.CaretToken: + case SyntaxKind.BarToken: + case SyntaxKind.AmpersandAmpersandToken: + case SyntaxKind.BarBarToken: + case SyntaxKind.BarEqualsToken: + case SyntaxKind.AmpersandEqualsToken: + case SyntaxKind.CaretEqualsToken: + case SyntaxKind.LessThanLessThanEqualsToken: + case SyntaxKind.GreaterThanGreaterThanEqualsToken: + case SyntaxKind.GreaterThanGreaterThanGreaterThanEqualsToken: + case SyntaxKind.PlusEqualsToken: + case SyntaxKind.MinusEqualsToken: + case SyntaxKind.AsteriskEqualsToken: + case SyntaxKind.SlashEqualsToken: + case SyntaxKind.PercentEqualsToken: + case SyntaxKind.EqualsToken: + case SyntaxKind.CommaToken: + return true; + default: + return false; + } + } + + function isPrefixUnaryExpressionOperatorToken(token: SyntaxKind): boolean { + switch (token) { + case SyntaxKind.PlusToken: + case SyntaxKind.MinusToken: + case SyntaxKind.TildeToken: + case SyntaxKind.ExclamationToken: + case SyntaxKind.PlusPlusToken: + case SyntaxKind.MinusMinusToken: + return true; + default: + return false; + } + } + + function isKeyword(token: SyntaxKind): boolean { + return token >= SyntaxKind.FirstKeyword && token <= SyntaxKind.LastKeyword; + } + + function classFromKind(token: SyntaxKind): ClassificationType { + if (isKeyword(token)) { + return ClassificationType.keyword; + } + else if (isBinaryExpressionOperatorToken(token) || isPrefixUnaryExpressionOperatorToken(token)) { + return ClassificationType.operator; + } + else if (token >= SyntaxKind.FirstPunctuation && token <= SyntaxKind.LastPunctuation) { + return ClassificationType.punctuation; + } + + switch (token) { + case SyntaxKind.NumericLiteral: + return ClassificationType.numericLiteral; + case SyntaxKind.StringLiteral: + return ClassificationType.stringLiteral; + case SyntaxKind.RegularExpressionLiteral: + return ClassificationType.regularExpressionLiteral; + case SyntaxKind.ConflictMarkerTrivia: + case SyntaxKind.MultiLineCommentTrivia: + case SyntaxKind.SingleLineCommentTrivia: + return ClassificationType.comment; + case SyntaxKind.WhitespaceTrivia: + case SyntaxKind.NewLineTrivia: + return ClassificationType.whiteSpace; + case SyntaxKind.Identifier: + default: + if (isTemplateLiteralKind(token)) { + return ClassificationType.stringLiteral; + } + return ClassificationType.identifier; + } + } + + return { + getClassificationsForLine, + getEncodedLexicalClassifications + }; + } + + /* @internal */ + export function getSemanticClassifications(typeChecker: TypeChecker, cancellationToken: CancellationToken, sourceFile: SourceFile, classifiableNames: Map, span: TextSpan): ClassifiedSpan[] { + return convertClassifications(getEncodedSemanticClassifications(typeChecker, cancellationToken, sourceFile, classifiableNames, span)); + } + + function checkForClassificationCancellation(cancellationToken: CancellationToken, kind: SyntaxKind) { + // We don't want to actually call back into our host on every node to find out if we've + // been canceled. That would be an enormous amount of chattyness, along with the all + // the overhead of marshalling the data to/from the host. So instead we pick a few + // reasonable node kinds to bother checking on. These node kinds represent high level + // constructs that we would expect to see commonly, but just at a far less frequent + // interval. + // + // For example, in checker.ts (around 750k) we only have around 600 of these constructs. + // That means we're calling back into the host around every 1.2k of the file we process. + // Lib.d.ts has similar numbers. + switch (kind) { + case SyntaxKind.ModuleDeclaration: + case SyntaxKind.ClassDeclaration: + case SyntaxKind.InterfaceDeclaration: + case SyntaxKind.FunctionDeclaration: + cancellationToken.throwIfCancellationRequested(); + } + } + + /* @internal */ + export function getEncodedSemanticClassifications(typeChecker: TypeChecker, cancellationToken: CancellationToken, sourceFile: SourceFile, classifiableNames: Map, span: TextSpan): Classifications { + const result: number[] = []; + processNode(sourceFile); + + return { spans: result, endOfLineState: EndOfLineState.None }; + + function pushClassification(start: number, length: number, type: ClassificationType) { + result.push(start); + result.push(length); + result.push(type); + } + + function classifySymbol(symbol: Symbol, meaningAtPosition: SemanticMeaning): ClassificationType { + const flags = symbol.getFlags(); + if ((flags & SymbolFlags.Classifiable) === SymbolFlags.None) { + return; + } + + if (flags & SymbolFlags.Class) { + return ClassificationType.className; + } + else if (flags & SymbolFlags.Enum) { + return ClassificationType.enumName; + } + else if (flags & SymbolFlags.TypeAlias) { + return ClassificationType.typeAliasName; + } + else if (meaningAtPosition & SemanticMeaning.Type) { + if (flags & SymbolFlags.Interface) { + return ClassificationType.interfaceName; + } + else if (flags & SymbolFlags.TypeParameter) { + return ClassificationType.typeParameterName; + } + } + else if (flags & SymbolFlags.Module) { + // Only classify a module as such if + // - It appears in a namespace context. + // - There exists a module declaration which actually impacts the value side. + if (meaningAtPosition & SemanticMeaning.Namespace || + (meaningAtPosition & SemanticMeaning.Value && hasValueSideModule(symbol))) { + return ClassificationType.moduleName; + } + } + + return undefined; + + /** + * Returns true if there exists a module that introduces entities on the value side. + */ + function hasValueSideModule(symbol: Symbol): boolean { + return forEach(symbol.declarations, declaration => { + return declaration.kind === SyntaxKind.ModuleDeclaration && + getModuleInstanceState(declaration) === ModuleInstanceState.Instantiated; + }); + } + } + + function processNode(node: Node) { + // Only walk into nodes that intersect the requested span. + if (node && textSpanIntersectsWith(span, node.getFullStart(), node.getFullWidth())) { + const kind = node.kind; + checkForClassificationCancellation(cancellationToken, kind); + + if (kind === SyntaxKind.Identifier && !nodeIsMissing(node)) { + const identifier = node; + + // Only bother calling into the typechecker if this is an identifier that + // could possibly resolve to a type name. This makes classification run + // in a third of the time it would normally take. + if (classifiableNames[identifier.text]) { + const symbol = typeChecker.getSymbolAtLocation(node); + if (symbol) { + const type = classifySymbol(symbol, getMeaningFromLocation(node)); + if (type) { + pushClassification(node.getStart(), node.getWidth(), type); + } + } + } + } + + forEachChild(node, processNode); + } + } + } + + function getClassificationTypeName(type: ClassificationType) { + switch (type) { + case ClassificationType.comment: return ClassificationTypeNames.comment; + case ClassificationType.identifier: return ClassificationTypeNames.identifier; + case ClassificationType.keyword: return ClassificationTypeNames.keyword; + case ClassificationType.numericLiteral: return ClassificationTypeNames.numericLiteral; + case ClassificationType.operator: return ClassificationTypeNames.operator; + case ClassificationType.stringLiteral: return ClassificationTypeNames.stringLiteral; + case ClassificationType.whiteSpace: return ClassificationTypeNames.whiteSpace; + case ClassificationType.text: return ClassificationTypeNames.text; + case ClassificationType.punctuation: return ClassificationTypeNames.punctuation; + case ClassificationType.className: return ClassificationTypeNames.className; + case ClassificationType.enumName: return ClassificationTypeNames.enumName; + case ClassificationType.interfaceName: return ClassificationTypeNames.interfaceName; + case ClassificationType.moduleName: return ClassificationTypeNames.moduleName; + case ClassificationType.typeParameterName: return ClassificationTypeNames.typeParameterName; + case ClassificationType.typeAliasName: return ClassificationTypeNames.typeAliasName; + case ClassificationType.parameterName: return ClassificationTypeNames.parameterName; + case ClassificationType.docCommentTagName: return ClassificationTypeNames.docCommentTagName; + case ClassificationType.jsxOpenTagName: return ClassificationTypeNames.jsxOpenTagName; + case ClassificationType.jsxCloseTagName: return ClassificationTypeNames.jsxCloseTagName; + case ClassificationType.jsxSelfClosingTagName: return ClassificationTypeNames.jsxSelfClosingTagName; + case ClassificationType.jsxAttribute: return ClassificationTypeNames.jsxAttribute; + case ClassificationType.jsxText: return ClassificationTypeNames.jsxText; + case ClassificationType.jsxAttributeStringLiteralValue: return ClassificationTypeNames.jsxAttributeStringLiteralValue; + } + } + + function convertClassifications(classifications: Classifications): ClassifiedSpan[] { + Debug.assert(classifications.spans.length % 3 === 0); + const dense = classifications.spans; + const result: ClassifiedSpan[] = []; + for (let i = 0, n = dense.length; i < n; i += 3) { + result.push({ + textSpan: createTextSpan(dense[i], dense[i + 1]), + classificationType: getClassificationTypeName(dense[i + 2]) + }); + } + + return result; + } + + /* @internal */ + export function getSyntacticClassifications(cancellationToken: CancellationToken, sourceFile: SourceFile, span: TextSpan): ClassifiedSpan[] { + return convertClassifications(getEncodedSyntacticClassifications(cancellationToken, sourceFile, span)); + } + + /* @internal */ + export function getEncodedSyntacticClassifications(cancellationToken: CancellationToken, sourceFile: SourceFile, span: TextSpan): Classifications { + const spanStart = span.start; + const spanLength = span.length; + + // Make a scanner we can get trivia from. + const triviaScanner = createScanner(ScriptTarget.Latest, /*skipTrivia*/ false, sourceFile.languageVariant, sourceFile.text); + const mergeConflictScanner = createScanner(ScriptTarget.Latest, /*skipTrivia*/ false, sourceFile.languageVariant, sourceFile.text); + + const result: number[] = []; + processElement(sourceFile); + + return { spans: result, endOfLineState: EndOfLineState.None }; + + function pushClassification(start: number, length: number, type: ClassificationType) { + result.push(start); + result.push(length); + result.push(type); + } + + function classifyLeadingTriviaAndGetTokenStart(token: Node): number { + triviaScanner.setTextPos(token.pos); + while (true) { + const start = triviaScanner.getTextPos(); + // only bother scanning if we have something that could be trivia. + if (!couldStartTrivia(sourceFile.text, start)) { + return start; + } + + const kind = triviaScanner.scan(); + const end = triviaScanner.getTextPos(); + const width = end - start; + + // The moment we get something that isn't trivia, then stop processing. + if (!isTrivia(kind)) { + return start; + } + + // Don't bother with newlines/whitespace. + if (kind === SyntaxKind.NewLineTrivia || kind === SyntaxKind.WhitespaceTrivia) { + continue; + } + + // Only bother with the trivia if it at least intersects the span of interest. + if (isComment(kind)) { + classifyComment(token, kind, start, width); + + // Classifying a comment might cause us to reuse the trivia scanner + // (because of jsdoc comments). So after we classify the comment make + // sure we set the scanner position back to where it needs to be. + triviaScanner.setTextPos(end); + continue; + } + + if (kind === SyntaxKind.ConflictMarkerTrivia) { + const text = sourceFile.text; + const ch = text.charCodeAt(start); + + // for the <<<<<<< and >>>>>>> markers, we just add them in as comments + // in the classification stream. + if (ch === CharacterCodes.lessThan || ch === CharacterCodes.greaterThan) { + pushClassification(start, width, ClassificationType.comment); + continue; + } + + // for the ======== add a comment for the first line, and then lex all + // subsequent lines up until the end of the conflict marker. + Debug.assert(ch === CharacterCodes.equals); + classifyDisabledMergeCode(text, start, end); + } + } + } + + function classifyComment(token: Node, kind: SyntaxKind, start: number, width: number) { + if (kind === SyntaxKind.MultiLineCommentTrivia) { + // See if this is a doc comment. If so, we'll classify certain portions of it + // specially. + const docCommentAndDiagnostics = parseIsolatedJSDocComment(sourceFile.text, start, width); + if (docCommentAndDiagnostics && docCommentAndDiagnostics.jsDocComment) { + docCommentAndDiagnostics.jsDocComment.parent = token; + classifyJSDocComment(docCommentAndDiagnostics.jsDocComment); + return; + } + } + + // Simple comment. Just add as is. + pushCommentRange(start, width); + } + + function pushCommentRange(start: number, width: number) { + pushClassification(start, width, ClassificationType.comment); + } + + function classifyJSDocComment(docComment: JSDocComment) { + let pos = docComment.pos; + + for (const tag of docComment.tags) { + // As we walk through each tag, classify the portion of text from the end of + // the last tag (or the start of the entire doc comment) as 'comment'. + if (tag.pos !== pos) { + pushCommentRange(pos, tag.pos - pos); + } + + pushClassification(tag.atToken.pos, tag.atToken.end - tag.atToken.pos, ClassificationType.punctuation); + pushClassification(tag.tagName.pos, tag.tagName.end - tag.tagName.pos, ClassificationType.docCommentTagName); + + pos = tag.tagName.end; + + switch (tag.kind) { + case SyntaxKind.JSDocParameterTag: + processJSDocParameterTag(tag); + break; + case SyntaxKind.JSDocTemplateTag: + processJSDocTemplateTag(tag); + break; + case SyntaxKind.JSDocTypeTag: + processElement((tag).typeExpression); + break; + case SyntaxKind.JSDocReturnTag: + processElement((tag).typeExpression); + break; + } + + pos = tag.end; + } + + if (pos !== docComment.end) { + pushCommentRange(pos, docComment.end - pos); + } + + return; + + function processJSDocParameterTag(tag: JSDocParameterTag) { + if (tag.preParameterName) { + pushCommentRange(pos, tag.preParameterName.pos - pos); + pushClassification(tag.preParameterName.pos, tag.preParameterName.end - tag.preParameterName.pos, ClassificationType.parameterName); + pos = tag.preParameterName.end; + } + + if (tag.typeExpression) { + pushCommentRange(pos, tag.typeExpression.pos - pos); + processElement(tag.typeExpression); + pos = tag.typeExpression.end; + } + + if (tag.postParameterName) { + pushCommentRange(pos, tag.postParameterName.pos - pos); + pushClassification(tag.postParameterName.pos, tag.postParameterName.end - tag.postParameterName.pos, ClassificationType.parameterName); + pos = tag.postParameterName.end; + } + } + } + + function processJSDocTemplateTag(tag: JSDocTemplateTag) { + for (const child of tag.getChildren()) { + processElement(child); + } + } + + function classifyDisabledMergeCode(text: string, start: number, end: number) { + // Classify the line that the ======= marker is on as a comment. Then just lex + // all further tokens and add them to the result. + let i: number; + for (i = start; i < end; i++) { + if (isLineBreak(text.charCodeAt(i))) { + break; + } + } + pushClassification(start, i - start, ClassificationType.comment); + mergeConflictScanner.setTextPos(i); + + while (mergeConflictScanner.getTextPos() < end) { + classifyDisabledCodeToken(); + } + } + + function classifyDisabledCodeToken() { + const start = mergeConflictScanner.getTextPos(); + const tokenKind = mergeConflictScanner.scan(); + const end = mergeConflictScanner.getTextPos(); + + const type = classifyTokenType(tokenKind); + if (type) { + pushClassification(start, end - start, type); + } + } + + /** + * Returns true if node should be treated as classified and no further processing is required. + * False will mean that node is not classified and traverse routine should recurse into node contents. + */ + function tryClassifyNode(node: Node): boolean { + if (isJSDocTag(node)) { + return true; + } + + if (nodeIsMissing(node)) { + return true; + } + + const classifiedElementName = tryClassifyJsxElementName(node); + if (!isToken(node) && node.kind !== SyntaxKind.JsxText && classifiedElementName === undefined) { + return false; + } + + const tokenStart = node.kind === SyntaxKind.JsxText ? node.pos : classifyLeadingTriviaAndGetTokenStart(node); + + const tokenWidth = node.end - tokenStart; + Debug.assert(tokenWidth >= 0); + if (tokenWidth > 0) { + const type = classifiedElementName || classifyTokenType(node.kind, node); + if (type) { + pushClassification(tokenStart, tokenWidth, type); + } + } + + return true; + } + + function tryClassifyJsxElementName(token: Node): ClassificationType { + switch (token.parent && token.parent.kind) { + case SyntaxKind.JsxOpeningElement: + if ((token.parent).tagName === token) { + return ClassificationType.jsxOpenTagName; + } + break; + case SyntaxKind.JsxClosingElement: + if ((token.parent).tagName === token) { + return ClassificationType.jsxCloseTagName; + } + break; + case SyntaxKind.JsxSelfClosingElement: + if ((token.parent).tagName === token) { + return ClassificationType.jsxSelfClosingTagName; + } + break; + case SyntaxKind.JsxAttribute: + if ((token.parent).name === token) { + return ClassificationType.jsxAttribute; + } + break; + } + return undefined; + } + + // for accurate classification, the actual token should be passed in. however, for + // cases like 'disabled merge code' classification, we just get the token kind and + // classify based on that instead. + function classifyTokenType(tokenKind: SyntaxKind, token?: Node): ClassificationType { + if (isKeyword(tokenKind)) { + return ClassificationType.keyword; + } + + // Special case < and > If they appear in a generic context they are punctuation, + // not operators. + if (tokenKind === SyntaxKind.LessThanToken || tokenKind === SyntaxKind.GreaterThanToken) { + // If the node owning the token has a type argument list or type parameter list, then + // we can effectively assume that a '<' and '>' belong to those lists. + if (token && getTypeArgumentOrTypeParameterList(token.parent)) { + return ClassificationType.punctuation; + } + } + + if (isPunctuation(tokenKind)) { + if (token) { + if (tokenKind === SyntaxKind.EqualsToken) { + // the '=' in a variable declaration is special cased here. + if (token.parent.kind === SyntaxKind.VariableDeclaration || + token.parent.kind === SyntaxKind.PropertyDeclaration || + token.parent.kind === SyntaxKind.Parameter || + token.parent.kind === SyntaxKind.JsxAttribute) { + return ClassificationType.operator; + } + } + + if (token.parent.kind === SyntaxKind.BinaryExpression || + token.parent.kind === SyntaxKind.PrefixUnaryExpression || + token.parent.kind === SyntaxKind.PostfixUnaryExpression || + token.parent.kind === SyntaxKind.ConditionalExpression) { + return ClassificationType.operator; + } + } + + return ClassificationType.punctuation; + } + else if (tokenKind === SyntaxKind.NumericLiteral) { + return ClassificationType.numericLiteral; + } + else if (tokenKind === SyntaxKind.StringLiteral) { + return token.parent.kind === SyntaxKind.JsxAttribute ? ClassificationType.jsxAttributeStringLiteralValue : ClassificationType.stringLiteral; + } + else if (tokenKind === SyntaxKind.RegularExpressionLiteral) { + // TODO: we should get another classification type for these literals. + return ClassificationType.stringLiteral; + } + else if (isTemplateLiteralKind(tokenKind)) { + // TODO (drosen): we should *also* get another classification type for these literals. + return ClassificationType.stringLiteral; + } + else if (tokenKind === SyntaxKind.JsxText) { + return ClassificationType.jsxText; + } + else if (tokenKind === SyntaxKind.Identifier) { + if (token) { + switch (token.parent.kind) { + case SyntaxKind.ClassDeclaration: + if ((token.parent).name === token) { + return ClassificationType.className; + } + return; + case SyntaxKind.TypeParameter: + if ((token.parent).name === token) { + return ClassificationType.typeParameterName; + } + return; + case SyntaxKind.InterfaceDeclaration: + if ((token.parent).name === token) { + return ClassificationType.interfaceName; + } + return; + case SyntaxKind.EnumDeclaration: + if ((token.parent).name === token) { + return ClassificationType.enumName; + } + return; + case SyntaxKind.ModuleDeclaration: + if ((token.parent).name === token) { + return ClassificationType.moduleName; + } + return; + case SyntaxKind.Parameter: + if ((token.parent).name === token) { + const isThis = token.kind === SyntaxKind.Identifier && (token).originalKeywordKind === SyntaxKind.ThisKeyword; + return isThis ? ClassificationType.keyword : ClassificationType.parameterName; + } + return; + } + } + return ClassificationType.identifier; + } + } + + function processElement(element: Node) { + if (!element) { + return; + } + + // Ignore nodes that don't intersect the original span to classify. + if (decodedTextSpanIntersectsWith(spanStart, spanLength, element.pos, element.getFullWidth())) { + checkForClassificationCancellation(cancellationToken, element.kind); + + const children = element.getChildren(sourceFile); + for (let i = 0, n = children.length; i < n; i++) { + const child = children[i]; + if (!tryClassifyNode(child)) { + // Recurse into our child nodes. + processElement(child); + } + } + } + } + } +} \ No newline at end of file diff --git a/src/services/completions.ts b/src/services/completions.ts new file mode 100644 index 00000000000..d6a4da89ed1 --- /dev/null +++ b/src/services/completions.ts @@ -0,0 +1,1711 @@ +/* @internal */ +namespace ts.Completions { + export function getCompletionsAtPosition(host: LanguageServiceHost, typeChecker: TypeChecker, log: (message: string) => void, compilerOptions: CompilerOptions, sourceFile: SourceFile, position: number): CompletionInfo { + if (isInReferenceComment(sourceFile, position)) { + return getTripleSlashReferenceCompletion(sourceFile, position); + } + + if (isInString(sourceFile, position)) { + return getStringLiteralCompletionEntries(sourceFile, position); + } + + const completionData = getCompletionData(typeChecker, log, sourceFile, position); + if (!completionData) { + return undefined; + } + + const { symbols, isMemberCompletion, isNewIdentifierLocation, location, isJsDocTagName } = completionData; + + if (isJsDocTagName) { + // If the current position is a jsDoc tag name, only tag names should be provided for completion + return { isMemberCompletion: false, isNewIdentifierLocation: false, entries: JsDoc.getAllJsDocCompletionEntries() }; + } + + const entries: CompletionEntry[] = []; + + if (isSourceFileJavaScript(sourceFile)) { + const uniqueNames = getCompletionEntriesFromSymbols(symbols, entries, location, /*performCharacterChecks*/ false); + addRange(entries, getJavaScriptCompletionEntries(sourceFile, location.pos, uniqueNames)); + } + else { + if (!symbols || symbols.length === 0) { + if (sourceFile.languageVariant === LanguageVariant.JSX && + location.parent && location.parent.kind === SyntaxKind.JsxClosingElement) { + // In the TypeScript JSX element, if such element is not defined. When users query for completion at closing tag, + // instead of simply giving unknown value, the completion will return the tag-name of an associated opening-element. + // For example: + // var x =
completion list at "1" will contain "div" with type any + const tagName = (location.parent.parent).openingElement.tagName; + entries.push({ + name: (tagName).text, + kind: undefined, + kindModifiers: undefined, + sortText: "0", + }); + } + else { + return undefined; + } + } + + getCompletionEntriesFromSymbols(symbols, entries, location, /*performCharacterChecks*/ true); + } + + // Add keywords if this is not a member completion list + if (!isMemberCompletion && !isJsDocTagName) { + addRange(entries, keywordCompletions); + } + + return { isMemberCompletion, isNewIdentifierLocation: isNewIdentifierLocation || isSourceFileJavaScript(sourceFile), entries }; + + function getJavaScriptCompletionEntries(sourceFile: SourceFile, position: number, uniqueNames: Map): CompletionEntry[] { + const entries: CompletionEntry[] = []; + + const nameTable = getNameTable(sourceFile); + for (const name in nameTable) { + // Skip identifiers produced only from the current location + if (nameTable[name] === position) { + continue; + } + + if (!uniqueNames[name]) { + uniqueNames[name] = name; + const displayName = getCompletionEntryDisplayName(unescapeIdentifier(name), compilerOptions.target, /*performCharacterChecks*/ true); + if (displayName) { + const entry = { + name: displayName, + kind: ScriptElementKind.warning, + kindModifiers: "", + sortText: "1" + }; + entries.push(entry); + } + } + } + + return entries; + } + + function createCompletionEntry(symbol: Symbol, location: Node, performCharacterChecks: boolean): CompletionEntry { + // Try to get a valid display name for this symbol, if we could not find one, then ignore it. + // We would like to only show things that can be added after a dot, so for instance numeric properties can + // not be accessed with a dot (a.1 <- invalid) + const displayName = getCompletionEntryDisplayNameForSymbol(typeChecker, symbol, compilerOptions.target, performCharacterChecks, location); + if (!displayName) { + return undefined; + } + + // TODO(drosen): Right now we just permit *all* semantic meanings when calling + // 'getSymbolKind' which is permissible given that it is backwards compatible; but + // really we should consider passing the meaning for the node so that we don't report + // that a suggestion for a value is an interface. We COULD also just do what + // 'getSymbolModifiers' does, which is to use the first declaration. + + // Use a 'sortText' of 0' so that all symbol completion entries come before any other + // entries (like JavaScript identifier entries). + return { + name: displayName, + kind: SymbolDisplay.getSymbolKind(typeChecker, symbol, location), + kindModifiers: SymbolDisplay.getSymbolModifiers(symbol), + sortText: "0", + }; + + } + + function getCompletionEntriesFromSymbols(symbols: Symbol[], entries: CompletionEntry[], location: Node, performCharacterChecks: boolean): Map { + const start = timestamp(); + const uniqueNames = createMap(); + if (symbols) { + for (const symbol of symbols) { + const entry = createCompletionEntry(symbol, location, performCharacterChecks); + if (entry) { + const id = escapeIdentifier(entry.name); + if (!uniqueNames[id]) { + entries.push(entry); + uniqueNames[id] = id; + } + } + } + } + + log("getCompletionsAtPosition: getCompletionEntriesFromSymbols: " + (timestamp() - start)); + return uniqueNames; + } + + function getStringLiteralCompletionEntries(sourceFile: SourceFile, position: number) { + const node = findPrecedingToken(position, sourceFile); + if (!node || node.kind !== SyntaxKind.StringLiteral) { + return undefined; + } + + if (node.parent.kind === SyntaxKind.PropertyAssignment && node.parent.parent.kind === SyntaxKind.ObjectLiteralExpression) { + // Get quoted name of properties of the object literal expression + // i.e. interface ConfigFiles { + // 'jspm:dev': string + // } + // let files: ConfigFiles = { + // '/*completion position*/' + // } + // + // function foo(c: ConfigFiles) {} + // foo({ + // '/*completion position*/' + // }); + return getStringLiteralCompletionEntriesFromPropertyAssignment(node.parent); + } + else if (isElementAccessExpression(node.parent) && node.parent.argumentExpression === node) { + // Get all names of properties on the expression + // i.e. interface A { + // 'prop1': string + // } + // let a: A; + // a['/*completion position*/'] + return getStringLiteralCompletionEntriesFromElementAccess(node.parent); + } + else if (node.parent.kind === SyntaxKind.ImportDeclaration || isExpressionOfExternalModuleImportEqualsDeclaration(node) || isRequireCall(node.parent, false)) { + // Get all known external module names or complete a path to a module + // i.e. import * as ns from "/*completion position*/"; + // import x = require("/*completion position*/"); + // var y = require("/*completion position*/"); + return getStringLiteralCompletionEntriesFromModuleNames(node); + } + else { + const argumentInfo = SignatureHelp.getContainingArgumentInfo(node, position, sourceFile); + if (argumentInfo) { + // Get string literal completions from specialized signatures of the target + // i.e. declare function f(a: 'A'); + // f("/*completion position*/") + return getStringLiteralCompletionEntriesFromCallExpression(argumentInfo, node); + } + + // Get completion for string literal from string literal type + // i.e. var x: "hi" | "hello" = "/*completion position*/" + return getStringLiteralCompletionEntriesFromContextualType(node); + } + } + + function getStringLiteralCompletionEntriesFromPropertyAssignment(element: ObjectLiteralElement) { + const type = typeChecker.getContextualType((element.parent)); + const entries: CompletionEntry[] = []; + if (type) { + getCompletionEntriesFromSymbols(type.getApparentProperties(), entries, element, /*performCharacterChecks*/false); + if (entries.length) { + return { isMemberCompletion: true, isNewIdentifierLocation: true, entries }; + } + } + } + + function getStringLiteralCompletionEntriesFromCallExpression(argumentInfo: SignatureHelp.ArgumentListInfo, location: Node) { + const candidates: Signature[] = []; + const entries: CompletionEntry[] = []; + + typeChecker.getResolvedSignature(argumentInfo.invocation, candidates); + + for (const candidate of candidates) { + if (candidate.parameters.length > argumentInfo.argumentIndex) { + const parameter = candidate.parameters[argumentInfo.argumentIndex]; + addStringLiteralCompletionsFromType(typeChecker.getTypeAtLocation(parameter.valueDeclaration), entries); + } + } + + if (entries.length) { + return { isMemberCompletion: false, isNewIdentifierLocation: true, entries }; + } + + return undefined; + } + + function getStringLiteralCompletionEntriesFromElementAccess(node: ElementAccessExpression) { + const type = typeChecker.getTypeAtLocation(node.expression); + const entries: CompletionEntry[] = []; + if (type) { + getCompletionEntriesFromSymbols(type.getApparentProperties(), entries, node, /*performCharacterChecks*/false); + if (entries.length) { + return { isMemberCompletion: true, isNewIdentifierLocation: true, entries }; + } + } + return undefined; + } + + function getStringLiteralCompletionEntriesFromContextualType(node: StringLiteral) { + const type = typeChecker.getContextualType(node); + if (type) { + const entries: CompletionEntry[] = []; + addStringLiteralCompletionsFromType(type, entries); + if (entries.length) { + return { isMemberCompletion: false, isNewIdentifierLocation: false, entries }; + } + } + return undefined; + } + + function addStringLiteralCompletionsFromType(type: Type, result: CompletionEntry[]): void { + if (!type) { + return; + } + if (type.flags & TypeFlags.Union) { + forEach((type).types, t => addStringLiteralCompletionsFromType(t, result)); + } + else { + if (type.flags & TypeFlags.StringLiteral) { + result.push({ + name: (type).text, + kindModifiers: ScriptElementKindModifier.none, + kind: ScriptElementKind.variableElement, + sortText: "0" + }); + } + } + } + + function getStringLiteralCompletionEntriesFromModuleNames(node: StringLiteral): CompletionInfo { + const literalValue = normalizeSlashes(node.text); + + const scriptPath = node.getSourceFile().path; + const scriptDirectory = getDirectoryPath(scriptPath); + + const span = getDirectoryFragmentTextSpan((node).text, node.getStart() + 1); + let entries: CompletionEntry[]; + if (isPathRelativeToScript(literalValue) || isRootedDiskPath(literalValue)) { + if (compilerOptions.rootDirs) { + entries = getCompletionEntriesForDirectoryFragmentWithRootDirs( + compilerOptions.rootDirs, literalValue, scriptDirectory, getSupportedExtensions(compilerOptions), /*includeExtensions*/false, span, scriptPath); + } + else { + entries = getCompletionEntriesForDirectoryFragment( + literalValue, scriptDirectory, getSupportedExtensions(compilerOptions), /*includeExtensions*/false, span, scriptPath); + } + } + else { + // Check for node modules + entries = getCompletionEntriesForNonRelativeModules(literalValue, scriptDirectory, span); + } + return { + isMemberCompletion: false, + isNewIdentifierLocation: true, + entries + }; + } + + /** + * Takes a script path and returns paths for all potential folders that could be merged with its + * containing folder via the "rootDirs" compiler option + */ + function getBaseDirectoriesFromRootDirs(rootDirs: string[], basePath: string, scriptPath: string, ignoreCase: boolean): string[] { + // Make all paths absolute/normalized if they are not already + rootDirs = map(rootDirs, rootDirectory => normalizePath(isRootedDiskPath(rootDirectory) ? rootDirectory : combinePaths(basePath, rootDirectory))); + + // Determine the path to the directory containing the script relative to the root directory it is contained within + let relativeDirectory: string; + for (const rootDirectory of rootDirs) { + if (containsPath(rootDirectory, scriptPath, basePath, ignoreCase)) { + relativeDirectory = scriptPath.substr(rootDirectory.length); + break; + } + } + + // Now find a path for each potential directory that is to be merged with the one containing the script + return deduplicate(map(rootDirs, rootDirectory => combinePaths(rootDirectory, relativeDirectory))); + } + + function getCompletionEntriesForDirectoryFragmentWithRootDirs(rootDirs: string[], fragment: string, scriptPath: string, extensions: string[], includeExtensions: boolean, span: TextSpan, exclude?: string): CompletionEntry[] { + const basePath = compilerOptions.project || host.getCurrentDirectory(); + const ignoreCase = !(host.useCaseSensitiveFileNames && host.useCaseSensitiveFileNames()); + const baseDirectories = getBaseDirectoriesFromRootDirs(rootDirs, basePath, scriptPath, ignoreCase); + + const result: CompletionEntry[] = []; + + for (const baseDirectory of baseDirectories) { + getCompletionEntriesForDirectoryFragment(fragment, baseDirectory, extensions, includeExtensions, span, exclude, result); + } + + return result; + } + + function getCompletionEntriesForDirectoryFragment(fragment: string, scriptPath: string, extensions: string[], includeExtensions: boolean, span: TextSpan, exclude?: string, result: CompletionEntry[] = []): CompletionEntry[] { + fragment = getDirectoryPath(fragment); + if (!fragment) { + fragment = "./"; + } + else { + fragment = ensureTrailingDirectorySeparator(fragment); + } + + const absolutePath = normalizeAndPreserveTrailingSlash(isRootedDiskPath(fragment) ? fragment : combinePaths(scriptPath, fragment)); + const baseDirectory = getDirectoryPath(absolutePath); + const ignoreCase = !(host.useCaseSensitiveFileNames && host.useCaseSensitiveFileNames()); + + if (tryDirectoryExists(host, baseDirectory)) { + // Enumerate the available files if possible + const files = tryReadDirectory(host, baseDirectory, extensions, /*exclude*/undefined, /*include*/["./*"]); + + if (files) { + const foundFiles = createMap(); + for (let filePath of files) { + filePath = normalizePath(filePath); + if (exclude && comparePaths(filePath, exclude, scriptPath, ignoreCase) === Comparison.EqualTo) { + continue; + } + + const foundFileName = includeExtensions ? getBaseFileName(filePath) : removeFileExtension(getBaseFileName(filePath)); + + if (!foundFiles[foundFileName]) { + foundFiles[foundFileName] = true; + } + } + + for (const foundFile in foundFiles) { + result.push(createCompletionEntryForModule(foundFile, ScriptElementKind.scriptElement, span)); + } + } + + // If possible, get folder completion as well + const directories = tryGetDirectories(host, baseDirectory); + + if (directories) { + for (const directory of directories) { + const directoryName = getBaseFileName(normalizePath(directory)); + + result.push(createCompletionEntryForModule(directoryName, ScriptElementKind.directory, span)); + } + } + } + + return result; + } + + /** + * Check all of the declared modules and those in node modules. Possible sources of modules: + * Modules that are found by the type checker + * Modules found relative to "baseUrl" compliler options (including patterns from "paths" compiler option) + * Modules from node_modules (i.e. those listed in package.json) + * This includes all files that are found in node_modules/moduleName/ with acceptable file extensions + */ + function getCompletionEntriesForNonRelativeModules(fragment: string, scriptPath: string, span: TextSpan): CompletionEntry[] { + const { baseUrl, paths } = compilerOptions; + + let result: CompletionEntry[]; + + if (baseUrl) { + const fileExtensions = getSupportedExtensions(compilerOptions); + const projectDir = compilerOptions.project || host.getCurrentDirectory(); + const absolute = isRootedDiskPath(baseUrl) ? baseUrl : combinePaths(projectDir, baseUrl); + result = getCompletionEntriesForDirectoryFragment(fragment, normalizePath(absolute), fileExtensions, /*includeExtensions*/false, span); + + if (paths) { + for (const path in paths) { + if (paths.hasOwnProperty(path)) { + if (path === "*") { + if (paths[path]) { + for (const pattern of paths[path]) { + for (const match of getModulesForPathsPattern(fragment, baseUrl, pattern, fileExtensions)) { + result.push(createCompletionEntryForModule(match, ScriptElementKind.externalModuleName, span)); + } + } + } + } + else if (startsWith(path, fragment)) { + const entry = paths[path] && paths[path].length === 1 && paths[path][0]; + if (entry) { + result.push(createCompletionEntryForModule(path, ScriptElementKind.externalModuleName, span)); + } + } + } + } + } + } + else { + result = []; + } + + getCompletionEntriesFromTypings(host, compilerOptions, scriptPath, span, result); + + for (const moduleName of enumeratePotentialNonRelativeModules(fragment, scriptPath, compilerOptions)) { + result.push(createCompletionEntryForModule(moduleName, ScriptElementKind.externalModuleName, span)); + } + + return result; + } + + function getModulesForPathsPattern(fragment: string, baseUrl: string, pattern: string, fileExtensions: string[]): string[] { + if (host.readDirectory) { + const parsed = hasZeroOrOneAsteriskCharacter(pattern) ? tryParsePattern(pattern) : undefined; + if (parsed) { + // The prefix has two effective parts: the directory path and the base component after the filepath that is not a + // full directory component. For example: directory/path/of/prefix/base* + const normalizedPrefix = normalizeAndPreserveTrailingSlash(parsed.prefix); + const normalizedPrefixDirectory = getDirectoryPath(normalizedPrefix); + const normalizedPrefixBase = getBaseFileName(normalizedPrefix); + + const fragmentHasPath = fragment.indexOf(directorySeparator) !== -1; + + // Try and expand the prefix to include any path from the fragment so that we can limit the readDirectory call + const expandedPrefixDirectory = fragmentHasPath ? combinePaths(normalizedPrefixDirectory, normalizedPrefixBase + getDirectoryPath(fragment)) : normalizedPrefixDirectory; + + const normalizedSuffix = normalizePath(parsed.suffix); + const baseDirectory = combinePaths(baseUrl, expandedPrefixDirectory); + const completePrefix = fragmentHasPath ? baseDirectory : ensureTrailingDirectorySeparator(baseDirectory) + normalizedPrefixBase; + + // If we have a suffix, then we need to read the directory all the way down. We could create a glob + // that encodes the suffix, but we would have to escape the character "?" which readDirectory + // doesn't support. For now, this is safer but slower + const includeGlob = normalizedSuffix ? "**/*" : "./*"; + + const matches = tryReadDirectory(host, baseDirectory, fileExtensions, undefined, [includeGlob]); + if (matches) { + const result: string[] = []; + + // Trim away prefix and suffix + for (const match of matches) { + const normalizedMatch = normalizePath(match); + if (!endsWith(normalizedMatch, normalizedSuffix) || !startsWith(normalizedMatch, completePrefix)) { + continue; + } + + const start = completePrefix.length; + const length = normalizedMatch.length - start - normalizedSuffix.length; + + result.push(removeFileExtension(normalizedMatch.substr(start, length))); + } + return result; + } + } + } + + return undefined; + } + + function enumeratePotentialNonRelativeModules(fragment: string, scriptPath: string, options: CompilerOptions): string[] { + // Check If this is a nested module + const isNestedModule = fragment.indexOf(directorySeparator) !== -1; + const moduleNameFragment = isNestedModule ? fragment.substr(0, fragment.lastIndexOf(directorySeparator)) : undefined; + + // Get modules that the type checker picked up + const ambientModules = map(typeChecker.getAmbientModules(), sym => stripQuotes(sym.name)); + let nonRelativeModules = filter(ambientModules, moduleName => startsWith(moduleName, fragment)); + + // Nested modules of the form "module-name/sub" need to be adjusted to only return the string + // after the last '/' that appears in the fragment because that's where the replacement span + // starts + if (isNestedModule) { + const moduleNameWithSeperator = ensureTrailingDirectorySeparator(moduleNameFragment); + nonRelativeModules = map(nonRelativeModules, moduleName => { + if (startsWith(fragment, moduleNameWithSeperator)) { + return moduleName.substr(moduleNameWithSeperator.length); + } + return moduleName; + }); + } + + + if (!options.moduleResolution || options.moduleResolution === ModuleResolutionKind.NodeJs) { + for (const visibleModule of enumerateNodeModulesVisibleToScript(host, scriptPath)) { + if (!isNestedModule) { + nonRelativeModules.push(visibleModule.moduleName); + } + else if (startsWith(visibleModule.moduleName, moduleNameFragment)) { + const nestedFiles = tryReadDirectory(host, visibleModule.moduleDir, supportedTypeScriptExtensions, /*exclude*/undefined, /*include*/["./*"]); + if (nestedFiles) { + for (let f of nestedFiles) { + f = normalizePath(f); + const nestedModule = removeFileExtension(getBaseFileName(f)); + nonRelativeModules.push(nestedModule); + } + } + } + } + } + + return deduplicate(nonRelativeModules); + } + + function getTripleSlashReferenceCompletion(sourceFile: SourceFile, position: number): CompletionInfo { + const token = getTokenAtPosition(sourceFile, position); + if (!token) { + return undefined; + } + const commentRanges: CommentRange[] = getLeadingCommentRanges(sourceFile.text, token.pos); + + if (!commentRanges || !commentRanges.length) { + return undefined; + } + + const range = forEach(commentRanges, commentRange => position >= commentRange.pos && position <= commentRange.end && commentRange); + + if (!range) { + return undefined; + } + + const text = sourceFile.text.substr(range.pos, position - range.pos); + + const match = tripleSlashDirectiveFragmentRegex.exec(text); + if (match) { + const prefix = match[1]; + const kind = match[2]; + const toComplete = match[3]; + + const scriptPath = getDirectoryPath(sourceFile.path); + let entries: CompletionEntry[]; + if (kind === "path") { + // Give completions for a relative path + const span: TextSpan = getDirectoryFragmentTextSpan(toComplete, range.pos + prefix.length); + entries = getCompletionEntriesForDirectoryFragment(toComplete, scriptPath, getSupportedExtensions(compilerOptions), /*includeExtensions*/true, span, sourceFile.path); + } + else { + // Give completions based on the typings available + const span: TextSpan = { start: range.pos + prefix.length, length: match[0].length - prefix.length }; + entries = getCompletionEntriesFromTypings(host, compilerOptions, scriptPath, span); + } + + return { + isMemberCompletion: false, + isNewIdentifierLocation: true, + entries + }; + } + + return undefined; + } + + function getCompletionEntriesFromTypings(host: LanguageServiceHost, options: CompilerOptions, scriptPath: string, span: TextSpan, result: CompletionEntry[] = []): CompletionEntry[] { + // Check for typings specified in compiler options + if (options.types) { + for (const moduleName of options.types) { + result.push(createCompletionEntryForModule(moduleName, ScriptElementKind.externalModuleName, span)); + } + } + else if (host.getDirectories) { + let typeRoots: string[]; + try { + // Wrap in try catch because getEffectiveTypeRoots touches the filesystem + typeRoots = getEffectiveTypeRoots(options, host); + } + catch (e) {} + + if (typeRoots) { + for (const root of typeRoots) { + getCompletionEntriesFromDirectories(host, options, root, span, result); + } + } + } + + if (host.getDirectories) { + // Also get all @types typings installed in visible node_modules directories + for (const packageJson of findPackageJsons(scriptPath)) { + const typesDir = combinePaths(getDirectoryPath(packageJson), "node_modules/@types"); + getCompletionEntriesFromDirectories(host, options, typesDir, span, result); + } + } + + return result; + } + + function getCompletionEntriesFromDirectories(host: LanguageServiceHost, options: CompilerOptions, directory: string, span: TextSpan, result: CompletionEntry[]) { + if (host.getDirectories && tryDirectoryExists(host, directory)) { + const directories = tryGetDirectories(host, directory); + if (directories) { + for (let typeDirectory of directories) { + typeDirectory = normalizePath(typeDirectory); + result.push(createCompletionEntryForModule(getBaseFileName(typeDirectory), ScriptElementKind.externalModuleName, span)); + } + } + } + } + + function findPackageJsons(currentDir: string): string[] { + const paths: string[] = []; + let currentConfigPath: string; + while (true) { + currentConfigPath = findConfigFile(currentDir, (f) => tryFileExists(host, f), "package.json"); + if (currentConfigPath) { + paths.push(currentConfigPath); + + currentDir = getDirectoryPath(currentConfigPath); + const parent = getDirectoryPath(currentDir); + if (currentDir === parent) { + break; + } + currentDir = parent; + } + else { + break; + } + } + + return paths; + } + + + function enumerateNodeModulesVisibleToScript(host: LanguageServiceHost, scriptPath: string) { + const result: VisibleModuleInfo[] = []; + + if (host.readFile && host.fileExists) { + for (const packageJson of findPackageJsons(scriptPath)) { + const contents = tryReadingPackageJson(packageJson); + if (!contents) { + return; + } + + const nodeModulesDir = combinePaths(getDirectoryPath(packageJson), "node_modules"); + const foundModuleNames: string[] = []; + + // Provide completions for all non @types dependencies + for (const key of nodeModulesDependencyKeys) { + addPotentialPackageNames(contents[key], foundModuleNames); + } + + for (const moduleName of foundModuleNames) { + const moduleDir = combinePaths(nodeModulesDir, moduleName); + result.push({ + moduleName, + moduleDir + }); + } + } + } + + return result; + + function tryReadingPackageJson(filePath: string) { + try { + const fileText = tryReadFile(host, filePath); + return fileText ? JSON.parse(fileText) : undefined; + } + catch (e) { + return undefined; + } + } + + function addPotentialPackageNames(dependencies: any, result: string[]) { + if (dependencies) { + for (const dep in dependencies) { + if (dependencies.hasOwnProperty(dep) && !startsWith(dep, "@types/")) { + result.push(dep); + } + } + } + } + } + + function createCompletionEntryForModule(name: string, kind: string, replacementSpan: TextSpan): CompletionEntry { + return { name, kind, kindModifiers: ScriptElementKindModifier.none, sortText: name, replacementSpan }; + } + + // Replace everything after the last directory seperator that appears + function getDirectoryFragmentTextSpan(text: string, textStart: number): TextSpan { + const index = text.lastIndexOf(directorySeparator); + const offset = index !== -1 ? index + 1 : 0; + return { start: textStart + offset, length: text.length - offset }; + } + + // Returns true if the path is explicitly relative to the script (i.e. relative to . or ..) + function isPathRelativeToScript(path: string) { + if (path && path.length >= 2 && path.charCodeAt(0) === CharacterCodes.dot) { + const slashIndex = path.length >= 3 && path.charCodeAt(1) === CharacterCodes.dot ? 2 : 1; + const slashCharCode = path.charCodeAt(slashIndex); + return slashCharCode === CharacterCodes.slash || slashCharCode === CharacterCodes.backslash; + } + return false; + } + + function normalizeAndPreserveTrailingSlash(path: string) { + return hasTrailingDirectorySeparator(path) ? ensureTrailingDirectorySeparator(normalizePath(path)) : normalizePath(path); + } + } + + export function getCompletionEntryDetails(typeChecker: TypeChecker, log: (message: string) => void, compilerOptions: CompilerOptions, sourceFile: SourceFile, position: number, entryName: string): CompletionEntryDetails { + // Compute all the completion symbols again. + const completionData = getCompletionData(typeChecker, log, sourceFile, position); + if (completionData) { + const { symbols, location } = completionData; + + // Find the symbol with the matching entry name. + // We don't need to perform character checks here because we're only comparing the + // name against 'entryName' (which is known to be good), not building a new + // completion entry. + const symbol = forEach(symbols, s => getCompletionEntryDisplayNameForSymbol(typeChecker, s, compilerOptions.target, /*performCharacterChecks*/ false, location) === entryName ? s : undefined); + + if (symbol) { + const { displayParts, documentation, symbolKind } = SymbolDisplay.getSymbolDisplayPartsDocumentationAndSymbolKind(typeChecker, symbol, sourceFile, location, location, SemanticMeaning.All); + return { + name: entryName, + kindModifiers: SymbolDisplay.getSymbolModifiers(symbol), + kind: symbolKind, + displayParts, + documentation + }; + } + } + + // Didn't find a symbol with this name. See if we can find a keyword instead. + const keywordCompletion = forEach(keywordCompletions, c => c.name === entryName); + if (keywordCompletion) { + return { + name: entryName, + kind: ScriptElementKind.keyword, + kindModifiers: ScriptElementKindModifier.none, + displayParts: [displayPart(entryName, SymbolDisplayPartKind.keyword)], + documentation: undefined + }; + } + + return undefined; + } + + export function getCompletionEntrySymbol(typeChecker: TypeChecker, log: (message: string) => void, compilerOptions: CompilerOptions, sourceFile: SourceFile, position: number, entryName: string): Symbol { + // Compute all the completion symbols again. + const completionData = getCompletionData(typeChecker, log, sourceFile, position); + if (completionData) { + const { symbols, location } = completionData; + + // Find the symbol with the matching entry name. + // We don't need to perform character checks here because we're only comparing the + // name against 'entryName' (which is known to be good), not building a new + // completion entry. + return forEach(symbols, s => getCompletionEntryDisplayNameForSymbol(typeChecker, s, compilerOptions.target, /*performCharacterChecks*/ false, location) === entryName ? s : undefined); + } + + return undefined; + } + + function getCompletionData(typeChecker: TypeChecker, log: (message: string) => void, sourceFile: SourceFile, position: number) { + const isJavaScriptFile = isSourceFileJavaScript(sourceFile); + + let isJsDocTagName = false; + + let start = timestamp(); + const currentToken = getTokenAtPosition(sourceFile, position); + log("getCompletionData: Get current token: " + (timestamp() - start)); + + start = timestamp(); + // Completion not allowed inside comments, bail out if this is the case + const insideComment = isInsideComment(sourceFile, currentToken, position); + log("getCompletionData: Is inside comment: " + (timestamp() - start)); + + if (insideComment) { + // The current position is next to the '@' sign, when no tag name being provided yet. + // Provide a full list of tag names + if (hasDocComment(sourceFile, position) && sourceFile.text.charCodeAt(position - 1) === CharacterCodes.at) { + isJsDocTagName = true; + } + + // Completion should work inside certain JsDoc tags. For example: + // /** @type {number | string} */ + // Completion should work in the brackets + let insideJsDocTagExpression = false; + const tag = getJsDocTagAtPosition(sourceFile, position); + if (tag) { + if (tag.tagName.pos <= position && position <= tag.tagName.end) { + isJsDocTagName = true; + } + + switch (tag.kind) { + case SyntaxKind.JSDocTypeTag: + case SyntaxKind.JSDocParameterTag: + case SyntaxKind.JSDocReturnTag: + const tagWithExpression = tag; + if (tagWithExpression.typeExpression) { + insideJsDocTagExpression = tagWithExpression.typeExpression.pos < position && position < tagWithExpression.typeExpression.end; + } + break; + } + } + + if (isJsDocTagName) { + return { symbols: undefined, isMemberCompletion: false, isNewIdentifierLocation: false, location: undefined, isRightOfDot: false, isJsDocTagName }; + } + + if (!insideJsDocTagExpression) { + // Proceed if the current position is in jsDoc tag expression; otherwise it is a normal + // comment or the plain text part of a jsDoc comment, so no completion should be available + log("Returning an empty list because completion was inside a regular comment or plain text part of a JsDoc comment."); + return undefined; + } + } + + start = timestamp(); + const previousToken = findPrecedingToken(position, sourceFile); + log("getCompletionData: Get previous token 1: " + (timestamp() - start)); + + // The decision to provide completion depends on the contextToken, which is determined through the previousToken. + // Note: 'previousToken' (and thus 'contextToken') can be undefined if we are the beginning of the file + let contextToken = previousToken; + + // Check if the caret is at the end of an identifier; this is a partial identifier that we want to complete: e.g. a.toS| + // Skip this partial identifier and adjust the contextToken to the token that precedes it. + if (contextToken && position <= contextToken.end && isWord(contextToken.kind)) { + const start = timestamp(); + contextToken = findPrecedingToken(contextToken.getFullStart(), sourceFile); + log("getCompletionData: Get previous token 2: " + (timestamp() - start)); + } + + // Find the node where completion is requested on. + // Also determine whether we are trying to complete with members of that node + // or attributes of a JSX tag. + let node = currentToken; + let isRightOfDot = false; + let isRightOfOpenTag = false; + let isStartingCloseTag = false; + + let location = getTouchingPropertyName(sourceFile, position); + if (contextToken) { + // Bail out if this is a known invalid completion location + if (isCompletionListBlocker(contextToken)) { + log("Returning an empty list because completion was requested in an invalid position."); + return undefined; + } + + const { parent, kind } = contextToken; + if (kind === SyntaxKind.DotToken) { + if (parent.kind === SyntaxKind.PropertyAccessExpression) { + node = (contextToken.parent).expression; + isRightOfDot = true; + } + else if (parent.kind === SyntaxKind.QualifiedName) { + node = (contextToken.parent).left; + isRightOfDot = true; + } + else { + // There is nothing that precedes the dot, so this likely just a stray character + // or leading into a '...' token. Just bail out instead. + return undefined; + } + } + else if (sourceFile.languageVariant === LanguageVariant.JSX) { + if (kind === SyntaxKind.LessThanToken) { + isRightOfOpenTag = true; + location = contextToken; + } + else if (kind === SyntaxKind.SlashToken && contextToken.parent.kind === SyntaxKind.JsxClosingElement) { + isStartingCloseTag = true; + location = contextToken; + } + } + } + + const semanticStart = timestamp(); + let isMemberCompletion: boolean; + let isNewIdentifierLocation: boolean; + let symbols: Symbol[] = []; + + if (isRightOfDot) { + getTypeScriptMemberSymbols(); + } + else if (isRightOfOpenTag) { + const tagSymbols = typeChecker.getJsxIntrinsicTagNames(); + if (tryGetGlobalSymbols()) { + symbols = tagSymbols.concat(symbols.filter(s => !!(s.flags & (SymbolFlags.Value | SymbolFlags.Alias)))); + } + else { + symbols = tagSymbols; + } + isMemberCompletion = true; + isNewIdentifierLocation = false; + } + else if (isStartingCloseTag) { + const tagName = (contextToken.parent.parent).openingElement.tagName; + const tagSymbol = typeChecker.getSymbolAtLocation(tagName); + + if (!typeChecker.isUnknownSymbol(tagSymbol)) { + symbols = [tagSymbol]; + } + isMemberCompletion = true; + isNewIdentifierLocation = false; + } + else { + // For JavaScript or TypeScript, if we're not after a dot, then just try to get the + // global symbols in scope. These results should be valid for either language as + // the set of symbols that can be referenced from this location. + if (!tryGetGlobalSymbols()) { + return undefined; + } + } + + log("getCompletionData: Semantic work: " + (timestamp() - semanticStart)); + + return { symbols, isMemberCompletion, isNewIdentifierLocation, location, isRightOfDot: (isRightOfDot || isRightOfOpenTag), isJsDocTagName }; + + function getTypeScriptMemberSymbols(): void { + // Right of dot member completion list + isMemberCompletion = true; + isNewIdentifierLocation = false; + + if (node.kind === SyntaxKind.Identifier || node.kind === SyntaxKind.QualifiedName || node.kind === SyntaxKind.PropertyAccessExpression) { + let symbol = typeChecker.getSymbolAtLocation(node); + + // This is an alias, follow what it aliases + if (symbol && symbol.flags & SymbolFlags.Alias) { + symbol = typeChecker.getAliasedSymbol(symbol); + } + + if (symbol && symbol.flags & SymbolFlags.HasExports) { + // Extract module or enum members + const exportedSymbols = typeChecker.getExportsOfModule(symbol); + forEach(exportedSymbols, symbol => { + if (typeChecker.isValidPropertyAccess((node.parent), symbol.name)) { + symbols.push(symbol); + } + }); + } + } + + const type = typeChecker.getTypeAtLocation(node); + addTypeProperties(type); + } + + function addTypeProperties(type: Type) { + if (type) { + // Filter private properties + for (const symbol of type.getApparentProperties()) { + if (typeChecker.isValidPropertyAccess((node.parent), symbol.name)) { + symbols.push(symbol); + } + } + + if (isJavaScriptFile && type.flags & TypeFlags.Union) { + // In javascript files, for union types, we don't just get the members that + // the individual types have in common, we also include all the members that + // each individual type has. This is because we're going to add all identifiers + // anyways. So we might as well elevate the members that were at least part + // of the individual types to a higher status since we know what they are. + const unionType = type; + for (const elementType of unionType.types) { + addTypeProperties(elementType); + } + } + } + } + + function tryGetGlobalSymbols(): boolean { + let objectLikeContainer: ObjectLiteralExpression | BindingPattern; + let namedImportsOrExports: NamedImportsOrExports; + let jsxContainer: JsxOpeningLikeElement; + + if (objectLikeContainer = tryGetObjectLikeCompletionContainer(contextToken)) { + return tryGetObjectLikeCompletionSymbols(objectLikeContainer); + } + + if (namedImportsOrExports = tryGetNamedImportsOrExportsForCompletion(contextToken)) { + // cursor is in an import clause + // try to show exported member for imported module + return tryGetImportOrExportClauseCompletionSymbols(namedImportsOrExports); + } + + if (jsxContainer = tryGetContainingJsxElement(contextToken)) { + let attrsType: Type; + if ((jsxContainer.kind === SyntaxKind.JsxSelfClosingElement) || (jsxContainer.kind === SyntaxKind.JsxOpeningElement)) { + // Cursor is inside a JSX self-closing element or opening element + attrsType = typeChecker.getJsxElementAttributesType(jsxContainer); + + if (attrsType) { + symbols = filterJsxAttributes(typeChecker.getPropertiesOfType(attrsType), (jsxContainer).attributes); + isMemberCompletion = true; + isNewIdentifierLocation = false; + return true; + } + + } + } + + // Get all entities in the current scope. + isMemberCompletion = false; + isNewIdentifierLocation = isNewIdentifierDefinitionLocation(contextToken); + + if (previousToken !== contextToken) { + Debug.assert(!!previousToken, "Expected 'contextToken' to be defined when different from 'previousToken'."); + } + // We need to find the node that will give us an appropriate scope to begin + // aggregating completion candidates. This is achieved in 'getScopeNode' + // by finding the first node that encompasses a position, accounting for whether a node + // is "complete" to decide whether a position belongs to the node. + // + // However, at the end of an identifier, we are interested in the scope of the identifier + // itself, but fall outside of the identifier. For instance: + // + // xyz => x$ + // + // the cursor is outside of both the 'x' and the arrow function 'xyz => x', + // so 'xyz' is not returned in our results. + // + // We define 'adjustedPosition' so that we may appropriately account for + // being at the end of an identifier. The intention is that if requesting completion + // at the end of an identifier, it should be effectively equivalent to requesting completion + // anywhere inside/at the beginning of the identifier. So in the previous case, the + // 'adjustedPosition' will work as if requesting completion in the following: + // + // xyz => $x + // + // If previousToken !== contextToken, then + // - 'contextToken' was adjusted to the token prior to 'previousToken' + // because we were at the end of an identifier. + // - 'previousToken' is defined. + const adjustedPosition = previousToken !== contextToken ? + previousToken.getStart() : + position; + + const scopeNode = getScopeNode(contextToken, adjustedPosition, sourceFile) || sourceFile; + + /// TODO filter meaning based on the current context + const symbolMeanings = SymbolFlags.Type | SymbolFlags.Value | SymbolFlags.Namespace | SymbolFlags.Alias; + symbols = typeChecker.getSymbolsInScope(scopeNode, symbolMeanings); + + return true; + } + + /** + * Finds the first node that "embraces" the position, so that one may + * accurately aggregate locals from the closest containing scope. + */ + function getScopeNode(initialToken: Node, position: number, sourceFile: SourceFile) { + let scope = initialToken; + while (scope && !positionBelongsToNode(scope, position, sourceFile)) { + scope = scope.parent; + } + return scope; + } + + function isCompletionListBlocker(contextToken: Node): boolean { + const start = timestamp(); + const result = isInStringOrRegularExpressionOrTemplateLiteral(contextToken) || + isSolelyIdentifierDefinitionLocation(contextToken) || + isDotOfNumericLiteral(contextToken) || + isInJsxText(contextToken); + log("getCompletionsAtPosition: isCompletionListBlocker: " + (timestamp() - start)); + return result; + } + + function isInJsxText(contextToken: Node): boolean { + if (contextToken.kind === SyntaxKind.JsxText) { + return true; + } + + if (contextToken.kind === SyntaxKind.GreaterThanToken && contextToken.parent) { + if (contextToken.parent.kind === SyntaxKind.JsxOpeningElement) { + return true; + } + + if (contextToken.parent.kind === SyntaxKind.JsxClosingElement || contextToken.parent.kind === SyntaxKind.JsxSelfClosingElement) { + return contextToken.parent.parent && contextToken.parent.parent.kind === SyntaxKind.JsxElement; + } + } + return false; + } + + function isNewIdentifierDefinitionLocation(previousToken: Node): boolean { + if (previousToken) { + const containingNodeKind = previousToken.parent.kind; + switch (previousToken.kind) { + case SyntaxKind.CommaToken: + return containingNodeKind === SyntaxKind.CallExpression // func( a, | + || containingNodeKind === SyntaxKind.Constructor // constructor( a, | /* public, protected, private keywords are allowed here, so show completion */ + || containingNodeKind === SyntaxKind.NewExpression // new C(a, | + || containingNodeKind === SyntaxKind.ArrayLiteralExpression // [a, | + || containingNodeKind === SyntaxKind.BinaryExpression // const x = (a, | + || containingNodeKind === SyntaxKind.FunctionType; // var x: (s: string, list| + + case SyntaxKind.OpenParenToken: + return containingNodeKind === SyntaxKind.CallExpression // func( | + || containingNodeKind === SyntaxKind.Constructor // constructor( | + || containingNodeKind === SyntaxKind.NewExpression // new C(a| + || containingNodeKind === SyntaxKind.ParenthesizedExpression // const x = (a| + || containingNodeKind === SyntaxKind.ParenthesizedType; // function F(pred: (a| /* this can become an arrow function, where 'a' is the argument */ + + case SyntaxKind.OpenBracketToken: + return containingNodeKind === SyntaxKind.ArrayLiteralExpression // [ | + || containingNodeKind === SyntaxKind.IndexSignature // [ | : string ] + || containingNodeKind === SyntaxKind.ComputedPropertyName; // [ | /* this can become an index signature */ + + case SyntaxKind.ModuleKeyword: // module | + case SyntaxKind.NamespaceKeyword: // namespace | + return true; + + case SyntaxKind.DotToken: + return containingNodeKind === SyntaxKind.ModuleDeclaration; // module A.| + + case SyntaxKind.OpenBraceToken: + return containingNodeKind === SyntaxKind.ClassDeclaration; // class A{ | + + case SyntaxKind.EqualsToken: + return containingNodeKind === SyntaxKind.VariableDeclaration // const x = a| + || containingNodeKind === SyntaxKind.BinaryExpression; // x = a| + + case SyntaxKind.TemplateHead: + return containingNodeKind === SyntaxKind.TemplateExpression; // `aa ${| + + case SyntaxKind.TemplateMiddle: + return containingNodeKind === SyntaxKind.TemplateSpan; // `aa ${10} dd ${| + + case SyntaxKind.PublicKeyword: + case SyntaxKind.PrivateKeyword: + case SyntaxKind.ProtectedKeyword: + return containingNodeKind === SyntaxKind.PropertyDeclaration; // class A{ public | + } + + // Previous token may have been a keyword that was converted to an identifier. + switch (previousToken.getText()) { + case "public": + case "protected": + case "private": + return true; + } + } + + return false; + } + + function isInStringOrRegularExpressionOrTemplateLiteral(contextToken: Node): boolean { + if (contextToken.kind === SyntaxKind.StringLiteral + || contextToken.kind === SyntaxKind.RegularExpressionLiteral + || isTemplateLiteralKind(contextToken.kind)) { + const start = contextToken.getStart(); + const end = contextToken.getEnd(); + + // To be "in" one of these literals, the position has to be: + // 1. entirely within the token text. + // 2. at the end position of an unterminated token. + // 3. at the end of a regular expression (due to trailing flags like '/foo/g'). + if (start < position && position < end) { + return true; + } + + if (position === end) { + return !!(contextToken).isUnterminated + || contextToken.kind === SyntaxKind.RegularExpressionLiteral; + } + } + + return false; + } + + /** + * Aggregates relevant symbols for completion in object literals and object binding patterns. + * Relevant symbols are stored in the captured 'symbols' variable. + * + * @returns true if 'symbols' was successfully populated; false otherwise. + */ + function tryGetObjectLikeCompletionSymbols(objectLikeContainer: ObjectLiteralExpression | BindingPattern): boolean { + // We're looking up possible property names from contextual/inferred/declared type. + isMemberCompletion = true; + + let typeForObject: Type; + let existingMembers: Declaration[]; + + if (objectLikeContainer.kind === SyntaxKind.ObjectLiteralExpression) { + // We are completing on contextual types, but may also include properties + // other than those within the declared type. + isNewIdentifierLocation = true; + + // If the object literal is being assigned to something of type 'null | { hello: string }', + // it clearly isn't trying to satisfy the 'null' type. So we grab the non-nullable type if possible. + typeForObject = typeChecker.getContextualType(objectLikeContainer); + typeForObject = typeForObject && typeForObject.getNonNullableType(); + + existingMembers = (objectLikeContainer).properties; + } + else if (objectLikeContainer.kind === SyntaxKind.ObjectBindingPattern) { + // We are *only* completing on properties from the type being destructured. + isNewIdentifierLocation = false; + + const rootDeclaration = getRootDeclaration(objectLikeContainer.parent); + if (isVariableLike(rootDeclaration)) { + // We don't want to complete using the type acquired by the shape + // of the binding pattern; we are only interested in types acquired + // through type declaration or inference. + // Also proceed if rootDeclaration is a parameter and if its containing function expression/arrow function is contextually typed - + // type of parameter will flow in from the contextual type of the function + let canGetType = !!(rootDeclaration.initializer || rootDeclaration.type); + if (!canGetType && rootDeclaration.kind === SyntaxKind.Parameter) { + if (isExpression(rootDeclaration.parent)) { + canGetType = !!typeChecker.getContextualType(rootDeclaration.parent); + } + else if (rootDeclaration.parent.kind === SyntaxKind.MethodDeclaration || rootDeclaration.parent.kind === SyntaxKind.SetAccessor) { + canGetType = isExpression(rootDeclaration.parent.parent) && !!typeChecker.getContextualType(rootDeclaration.parent.parent); + } + } + if (canGetType) { + typeForObject = typeChecker.getTypeAtLocation(objectLikeContainer); + existingMembers = (objectLikeContainer).elements; + } + } + else { + Debug.fail("Root declaration is not variable-like."); + } + } + else { + Debug.fail("Expected object literal or binding pattern, got " + objectLikeContainer.kind); + } + + if (!typeForObject) { + return false; + } + + const typeMembers = typeChecker.getPropertiesOfType(typeForObject); + if (typeMembers && typeMembers.length > 0) { + // Add filtered items to the completion list + symbols = filterObjectMembersList(typeMembers, existingMembers); + } + return true; + } + + /** + * Aggregates relevant symbols for completion in import clauses and export clauses + * whose declarations have a module specifier; for instance, symbols will be aggregated for + * + * import { | } from "moduleName"; + * export { a as foo, | } from "moduleName"; + * + * but not for + * + * export { | }; + * + * Relevant symbols are stored in the captured 'symbols' variable. + * + * @returns true if 'symbols' was successfully populated; false otherwise. + */ + function tryGetImportOrExportClauseCompletionSymbols(namedImportsOrExports: NamedImportsOrExports): boolean { + const declarationKind = namedImportsOrExports.kind === SyntaxKind.NamedImports ? + SyntaxKind.ImportDeclaration : + SyntaxKind.ExportDeclaration; + const importOrExportDeclaration = getAncestor(namedImportsOrExports, declarationKind); + const moduleSpecifier = importOrExportDeclaration.moduleSpecifier; + + if (!moduleSpecifier) { + return false; + } + + isMemberCompletion = true; + isNewIdentifierLocation = false; + + let exports: Symbol[]; + const moduleSpecifierSymbol = typeChecker.getSymbolAtLocation(importOrExportDeclaration.moduleSpecifier); + if (moduleSpecifierSymbol) { + exports = typeChecker.getExportsOfModule(moduleSpecifierSymbol); + } + + symbols = exports ? filterNamedImportOrExportCompletionItems(exports, namedImportsOrExports.elements) : emptyArray; + + return true; + } + + /** + * Returns the immediate owning object literal or binding pattern of a context token, + * on the condition that one exists and that the context implies completion should be given. + */ + function tryGetObjectLikeCompletionContainer(contextToken: Node): ObjectLiteralExpression | BindingPattern { + if (contextToken) { + switch (contextToken.kind) { + case SyntaxKind.OpenBraceToken: // const x = { | + case SyntaxKind.CommaToken: // const x = { a: 0, | + const parent = contextToken.parent; + if (parent && (parent.kind === SyntaxKind.ObjectLiteralExpression || parent.kind === SyntaxKind.ObjectBindingPattern)) { + return parent; + } + break; + } + } + + return undefined; + } + + /** + * Returns the containing list of named imports or exports of a context token, + * on the condition that one exists and that the context implies completion should be given. + */ + function tryGetNamedImportsOrExportsForCompletion(contextToken: Node): NamedImportsOrExports { + if (contextToken) { + switch (contextToken.kind) { + case SyntaxKind.OpenBraceToken: // import { | + case SyntaxKind.CommaToken: // import { a as 0, | + switch (contextToken.parent.kind) { + case SyntaxKind.NamedImports: + case SyntaxKind.NamedExports: + return contextToken.parent; + } + } + } + + return undefined; + } + + function tryGetContainingJsxElement(contextToken: Node): JsxOpeningLikeElement { + if (contextToken) { + const parent = contextToken.parent; + switch (contextToken.kind) { + case SyntaxKind.LessThanSlashToken: + case SyntaxKind.SlashToken: + case SyntaxKind.Identifier: + case SyntaxKind.JsxAttribute: + case SyntaxKind.JsxSpreadAttribute: + if (parent && (parent.kind === SyntaxKind.JsxSelfClosingElement || parent.kind === SyntaxKind.JsxOpeningElement)) { + return parent; + } + else if (parent.kind === SyntaxKind.JsxAttribute) { + return parent.parent; + } + break; + + // The context token is the closing } or " of an attribute, which means + // its parent is a JsxExpression, whose parent is a JsxAttribute, + // whose parent is a JsxOpeningLikeElement + case SyntaxKind.StringLiteral: + if (parent && ((parent.kind === SyntaxKind.JsxAttribute) || (parent.kind === SyntaxKind.JsxSpreadAttribute))) { + return parent.parent; + } + + break; + + case SyntaxKind.CloseBraceToken: + if (parent && + parent.kind === SyntaxKind.JsxExpression && + parent.parent && + (parent.parent.kind === SyntaxKind.JsxAttribute)) { + return parent.parent.parent; + } + + if (parent && parent.kind === SyntaxKind.JsxSpreadAttribute) { + return parent.parent; + } + + break; + } + } + return undefined; + } + + function isFunction(kind: SyntaxKind): boolean { + switch (kind) { + case SyntaxKind.FunctionExpression: + case SyntaxKind.ArrowFunction: + case SyntaxKind.FunctionDeclaration: + case SyntaxKind.MethodDeclaration: + case SyntaxKind.MethodSignature: + case SyntaxKind.GetAccessor: + case SyntaxKind.SetAccessor: + case SyntaxKind.CallSignature: + case SyntaxKind.ConstructSignature: + case SyntaxKind.IndexSignature: + return true; + } + return false; + } + + /** + * @returns true if we are certain that the currently edited location must define a new location; false otherwise. + */ + function isSolelyIdentifierDefinitionLocation(contextToken: Node): boolean { + const containingNodeKind = contextToken.parent.kind; + switch (contextToken.kind) { + case SyntaxKind.CommaToken: + return containingNodeKind === SyntaxKind.VariableDeclaration || + containingNodeKind === SyntaxKind.VariableDeclarationList || + containingNodeKind === SyntaxKind.VariableStatement || + containingNodeKind === SyntaxKind.EnumDeclaration || // enum a { foo, | + isFunction(containingNodeKind) || + containingNodeKind === SyntaxKind.ClassDeclaration || // class A(); + + for (const element of namedImportsOrExports) { + // If this is the current item we are editing right now, do not filter it out + if (element.getStart() <= position && position <= element.getEnd()) { + continue; + } + + const name = element.propertyName || element.name; + existingImportsOrExports[name.text] = true; + } + + if (!someProperties(existingImportsOrExports)) { + return filter(exportsOfModule, e => e.name !== "default"); + } + + return filter(exportsOfModule, e => e.name !== "default" && !existingImportsOrExports[e.name]); + } + + /** + * Filters out completion suggestions for named imports or exports. + * + * @returns Symbols to be suggested in an object binding pattern or object literal expression, barring those whose declarations + * do not occur at the current position and have not otherwise been typed. + */ + function filterObjectMembersList(contextualMemberSymbols: Symbol[], existingMembers: Declaration[]): Symbol[] { + if (!existingMembers || existingMembers.length === 0) { + return contextualMemberSymbols; + } + + const existingMemberNames = createMap(); + for (const m of existingMembers) { + // Ignore omitted expressions for missing members + if (m.kind !== SyntaxKind.PropertyAssignment && + m.kind !== SyntaxKind.ShorthandPropertyAssignment && + m.kind !== SyntaxKind.BindingElement && + m.kind !== SyntaxKind.MethodDeclaration) { + continue; + } + + // If this is the current item we are editing right now, do not filter it out + if (m.getStart() <= position && position <= m.getEnd()) { + continue; + } + + let existingName: string; + + if (m.kind === SyntaxKind.BindingElement && (m).propertyName) { + // include only identifiers in completion list + if ((m).propertyName.kind === SyntaxKind.Identifier) { + existingName = ((m).propertyName).text; + } + } + else { + // TODO(jfreeman): Account for computed property name + // NOTE: if one only performs this step when m.name is an identifier, + // things like '__proto__' are not filtered out. + existingName = (m.name).text; + } + + existingMemberNames[existingName] = true; + } + + return filter(contextualMemberSymbols, m => !existingMemberNames[m.name]); + } + + /** + * Filters out completion suggestions from 'symbols' according to existing JSX attributes. + * + * @returns Symbols to be suggested in a JSX element, barring those whose attributes + * do not occur at the current position and have not otherwise been typed. + */ + function filterJsxAttributes(symbols: Symbol[], attributes: NodeArray): Symbol[] { + const seenNames = createMap(); + for (const attr of attributes) { + // If this is the current item we are editing right now, do not filter it out + if (attr.getStart() <= position && position <= attr.getEnd()) { + continue; + } + + if (attr.kind === SyntaxKind.JsxAttribute) { + seenNames[(attr).name.text] = true; + } + } + + return filter(symbols, a => !seenNames[a.name]); + } + } + + /** + * Get the name to be display in completion from a given symbol. + * + * @return undefined if the name is of external module otherwise a name with striped of any quote + */ + function getCompletionEntryDisplayNameForSymbol(typeChecker: TypeChecker, symbol: Symbol, target: ScriptTarget, performCharacterChecks: boolean, location: Node): string { + const displayName: string = getDeclaredName(typeChecker, symbol, location); + + if (displayName) { + const firstCharCode = displayName.charCodeAt(0); + // First check of the displayName is not external module; if it is an external module, it is not valid entry + if ((symbol.flags & SymbolFlags.Namespace) && (firstCharCode === CharacterCodes.singleQuote || firstCharCode === CharacterCodes.doubleQuote)) { + // If the symbol is external module, don't show it in the completion list + // (i.e declare module "http" { const x; } | // <= request completion here, "http" should not be there) + return undefined; + } + } + + return getCompletionEntryDisplayName(displayName, target, performCharacterChecks); + } + + /** + * Get a displayName from a given for completion list, performing any necessary quotes stripping + * and checking whether the name is valid identifier name. + */ + function getCompletionEntryDisplayName(name: string, target: ScriptTarget, performCharacterChecks: boolean): string { + if (!name) { + return undefined; + } + + name = stripQuotes(name); + + if (!name) { + return undefined; + } + + // If the user entered name for the symbol was quoted, removing the quotes is not enough, as the name could be an + // invalid identifier name. We need to check if whatever was inside the quotes is actually a valid identifier name. + // e.g "b a" is valid quoted name but when we strip off the quotes, it is invalid. + // We, thus, need to check if whatever was inside the quotes is actually a valid identifier name. + if (performCharacterChecks) { + if (!isIdentifierText(name, target)) { + return undefined; + } + } + + return name; + } + + // A cache of completion entries for keywords, these do not change between sessions + const keywordCompletions: CompletionEntry[] = []; + for (let i = SyntaxKind.FirstKeyword; i <= SyntaxKind.LastKeyword; i++) { + keywordCompletions.push({ + name: tokenToString(i), + kind: ScriptElementKind.keyword, + kindModifiers: ScriptElementKindModifier.none, + sortText: "0" + }); + } + + /** + * Matches a triple slash reference directive with an incomplete string literal for its path. Used + * to determine if the caret is currently within the string literal and capture the literal fragment + * for completions. + * For example, this matches /// (host: LanguageServiceHost, toApply: (...a: any[]) => T, ...args: any[]) { + try { + return toApply && toApply.apply(host, args); + } + catch (e) {} + return undefined; + } +} diff --git a/src/services/documentHighlights.ts b/src/services/documentHighlights.ts new file mode 100644 index 00000000000..0f18427e568 --- /dev/null +++ b/src/services/documentHighlights.ts @@ -0,0 +1,638 @@ +/* @internal */ +namespace ts.DocumentHighlights { + export function getDocumentHighlights(typeChecker: TypeChecker, cancellationToken: CancellationToken, sourceFile: SourceFile, position: number, sourceFilesToSearch: SourceFile[]): DocumentHighlights[] { + const node = getTouchingWord(sourceFile, position); + if (!node) { + return undefined; + } + + return getSemanticDocumentHighlights(node) || getSyntacticDocumentHighlights(node); + + function getHighlightSpanForNode(node: Node): HighlightSpan { + const start = node.getStart(); + const end = node.getEnd(); + + return { + fileName: sourceFile.fileName, + textSpan: createTextSpanFromBounds(start, end), + kind: HighlightSpanKind.none + }; + } + + function getSemanticDocumentHighlights(node: Node): DocumentHighlights[] { + if (node.kind === SyntaxKind.Identifier || + node.kind === SyntaxKind.ThisKeyword || + node.kind === SyntaxKind.ThisType || + node.kind === SyntaxKind.SuperKeyword || + node.kind === SyntaxKind.StringLiteral || + isLiteralNameOfPropertyDeclarationOrIndexAccess(node)) { + + const referencedSymbols = FindAllReferences.getReferencedSymbolsForNode(typeChecker, cancellationToken, node, sourceFilesToSearch, /*findInStrings*/ false, /*findInComments*/ false, /*implementations*/false); + return convertReferencedSymbols(referencedSymbols); + + } + + return undefined; + + function convertReferencedSymbols(referencedSymbols: ReferencedSymbol[]): DocumentHighlights[] { + if (!referencedSymbols) { + return undefined; + } + + const fileNameToDocumentHighlights = createMap(); + const result: DocumentHighlights[] = []; + for (const referencedSymbol of referencedSymbols) { + for (const referenceEntry of referencedSymbol.references) { + const fileName = referenceEntry.fileName; + let documentHighlights = fileNameToDocumentHighlights[fileName]; + if (!documentHighlights) { + documentHighlights = { fileName, highlightSpans: [] }; + + fileNameToDocumentHighlights[fileName] = documentHighlights; + result.push(documentHighlights); + } + + documentHighlights.highlightSpans.push({ + textSpan: referenceEntry.textSpan, + kind: referenceEntry.isWriteAccess ? HighlightSpanKind.writtenReference : HighlightSpanKind.reference + }); + } + } + + return result; + } + } + + function getSyntacticDocumentHighlights(node: Node): DocumentHighlights[] { + const fileName = sourceFile.fileName; + + const highlightSpans = getHighlightSpans(node); + if (!highlightSpans || highlightSpans.length === 0) { + return undefined; + } + + return [{ fileName, highlightSpans }]; + + // returns true if 'node' is defined and has a matching 'kind'. + function hasKind(node: Node, kind: SyntaxKind) { + return node !== undefined && node.kind === kind; + } + + // Null-propagating 'parent' function. + function parent(node: Node): Node { + return node && node.parent; + } + + function getHighlightSpans(node: Node): HighlightSpan[] { + if (node) { + switch (node.kind) { + case SyntaxKind.IfKeyword: + case SyntaxKind.ElseKeyword: + if (hasKind(node.parent, SyntaxKind.IfStatement)) { + return getIfElseOccurrences(node.parent); + } + break; + case SyntaxKind.ReturnKeyword: + if (hasKind(node.parent, SyntaxKind.ReturnStatement)) { + return getReturnOccurrences(node.parent); + } + break; + case SyntaxKind.ThrowKeyword: + if (hasKind(node.parent, SyntaxKind.ThrowStatement)) { + return getThrowOccurrences(node.parent); + } + break; + case SyntaxKind.CatchKeyword: + if (hasKind(parent(parent(node)), SyntaxKind.TryStatement)) { + return getTryCatchFinallyOccurrences(node.parent.parent); + } + break; + case SyntaxKind.TryKeyword: + case SyntaxKind.FinallyKeyword: + if (hasKind(parent(node), SyntaxKind.TryStatement)) { + return getTryCatchFinallyOccurrences(node.parent); + } + break; + case SyntaxKind.SwitchKeyword: + if (hasKind(node.parent, SyntaxKind.SwitchStatement)) { + return getSwitchCaseDefaultOccurrences(node.parent); + } + break; + case SyntaxKind.CaseKeyword: + case SyntaxKind.DefaultKeyword: + if (hasKind(parent(parent(parent(node))), SyntaxKind.SwitchStatement)) { + return getSwitchCaseDefaultOccurrences(node.parent.parent.parent); + } + break; + case SyntaxKind.BreakKeyword: + case SyntaxKind.ContinueKeyword: + if (hasKind(node.parent, SyntaxKind.BreakStatement) || hasKind(node.parent, SyntaxKind.ContinueStatement)) { + return getBreakOrContinueStatementOccurrences(node.parent); + } + break; + case SyntaxKind.ForKeyword: + if (hasKind(node.parent, SyntaxKind.ForStatement) || + hasKind(node.parent, SyntaxKind.ForInStatement) || + hasKind(node.parent, SyntaxKind.ForOfStatement)) { + return getLoopBreakContinueOccurrences(node.parent); + } + break; + case SyntaxKind.WhileKeyword: + case SyntaxKind.DoKeyword: + if (hasKind(node.parent, SyntaxKind.WhileStatement) || hasKind(node.parent, SyntaxKind.DoStatement)) { + return getLoopBreakContinueOccurrences(node.parent); + } + break; + case SyntaxKind.ConstructorKeyword: + if (hasKind(node.parent, SyntaxKind.Constructor)) { + return getConstructorOccurrences(node.parent); + } + break; + case SyntaxKind.GetKeyword: + case SyntaxKind.SetKeyword: + if (hasKind(node.parent, SyntaxKind.GetAccessor) || hasKind(node.parent, SyntaxKind.SetAccessor)) { + return getGetAndSetOccurrences(node.parent); + } + break; + default: + if (isModifierKind(node.kind) && node.parent && + (isDeclaration(node.parent) || node.parent.kind === SyntaxKind.VariableStatement)) { + return getModifierOccurrences(node.kind, node.parent); + } + } + } + + return undefined; + } + + /** + * Aggregates all throw-statements within this node *without* crossing + * into function boundaries and try-blocks with catch-clauses. + */ + function aggregateOwnedThrowStatements(node: Node): ThrowStatement[] { + const statementAccumulator: ThrowStatement[] = []; + aggregate(node); + return statementAccumulator; + + function aggregate(node: Node): void { + if (node.kind === SyntaxKind.ThrowStatement) { + statementAccumulator.push(node); + } + else if (node.kind === SyntaxKind.TryStatement) { + const tryStatement = node; + + if (tryStatement.catchClause) { + aggregate(tryStatement.catchClause); + } + else { + // Exceptions thrown within a try block lacking a catch clause + // are "owned" in the current context. + aggregate(tryStatement.tryBlock); + } + + if (tryStatement.finallyBlock) { + aggregate(tryStatement.finallyBlock); + } + } + // Do not cross function boundaries. + else if (!isFunctionLike(node)) { + forEachChild(node, aggregate); + } + } + } + + /** + * For lack of a better name, this function takes a throw statement and returns the + * nearest ancestor that is a try-block (whose try statement has a catch clause), + * function-block, or source file. + */ + function getThrowStatementOwner(throwStatement: ThrowStatement): Node { + let child: Node = throwStatement; + + while (child.parent) { + const parent = child.parent; + + if (isFunctionBlock(parent) || parent.kind === SyntaxKind.SourceFile) { + return parent; + } + + // A throw-statement is only owned by a try-statement if the try-statement has + // a catch clause, and if the throw-statement occurs within the try block. + if (parent.kind === SyntaxKind.TryStatement) { + const tryStatement = parent; + + if (tryStatement.tryBlock === child && tryStatement.catchClause) { + return child; + } + } + + child = parent; + } + + return undefined; + } + + function aggregateAllBreakAndContinueStatements(node: Node): BreakOrContinueStatement[] { + const statementAccumulator: BreakOrContinueStatement[] = []; + aggregate(node); + return statementAccumulator; + + function aggregate(node: Node): void { + if (node.kind === SyntaxKind.BreakStatement || node.kind === SyntaxKind.ContinueStatement) { + statementAccumulator.push(node); + } + // Do not cross function boundaries. + else if (!isFunctionLike(node)) { + forEachChild(node, aggregate); + } + } + } + + function ownsBreakOrContinueStatement(owner: Node, statement: BreakOrContinueStatement): boolean { + const actualOwner = getBreakOrContinueOwner(statement); + + return actualOwner && actualOwner === owner; + } + + function getBreakOrContinueOwner(statement: BreakOrContinueStatement): Node { + for (let node = statement.parent; node; node = node.parent) { + switch (node.kind) { + case SyntaxKind.SwitchStatement: + if (statement.kind === SyntaxKind.ContinueStatement) { + continue; + } + // Fall through. + case SyntaxKind.ForStatement: + case SyntaxKind.ForInStatement: + case SyntaxKind.ForOfStatement: + case SyntaxKind.WhileStatement: + case SyntaxKind.DoStatement: + if (!statement.label || isLabeledBy(node, statement.label.text)) { + return node; + } + break; + default: + // Don't cross function boundaries. + if (isFunctionLike(node)) { + return undefined; + } + break; + } + } + + return undefined; + } + + function getModifierOccurrences(modifier: SyntaxKind, declaration: Node): HighlightSpan[] { + const container = declaration.parent; + + // Make sure we only highlight the keyword when it makes sense to do so. + if (isAccessibilityModifier(modifier)) { + if (!(container.kind === SyntaxKind.ClassDeclaration || + container.kind === SyntaxKind.ClassExpression || + (declaration.kind === SyntaxKind.Parameter && hasKind(container, SyntaxKind.Constructor)))) { + return undefined; + } + } + else if (modifier === SyntaxKind.StaticKeyword) { + if (!(container.kind === SyntaxKind.ClassDeclaration || container.kind === SyntaxKind.ClassExpression)) { + return undefined; + } + } + else if (modifier === SyntaxKind.ExportKeyword || modifier === SyntaxKind.DeclareKeyword) { + if (!(container.kind === SyntaxKind.ModuleBlock || container.kind === SyntaxKind.SourceFile)) { + return undefined; + } + } + else if (modifier === SyntaxKind.AbstractKeyword) { + if (!(container.kind === SyntaxKind.ClassDeclaration || declaration.kind === SyntaxKind.ClassDeclaration)) { + return undefined; + } + } + else { + // unsupported modifier + return undefined; + } + + const keywords: Node[] = []; + const modifierFlag: ModifierFlags = getFlagFromModifier(modifier); + + let nodes: Node[]; + switch (container.kind) { + case SyntaxKind.ModuleBlock: + case SyntaxKind.SourceFile: + // Container is either a class declaration or the declaration is a classDeclaration + if (modifierFlag & ModifierFlags.Abstract) { + nodes = ((declaration).members).concat(declaration); + } + else { + nodes = (container).statements; + } + break; + case SyntaxKind.Constructor: + nodes = ((container).parameters).concat( + (container.parent).members); + break; + case SyntaxKind.ClassDeclaration: + case SyntaxKind.ClassExpression: + nodes = (container).members; + + // If we're an accessibility modifier, we're in an instance member and should search + // the constructor's parameter list for instance members as well. + if (modifierFlag & ModifierFlags.AccessibilityModifier) { + const constructor = forEach((container).members, member => { + return member.kind === SyntaxKind.Constructor && member; + }); + + if (constructor) { + nodes = nodes.concat(constructor.parameters); + } + } + else if (modifierFlag & ModifierFlags.Abstract) { + nodes = nodes.concat(container); + } + break; + default: + Debug.fail("Invalid container kind."); + } + + forEach(nodes, node => { + if (getModifierFlags(node) & modifierFlag) { + forEach(node.modifiers, child => pushKeywordIf(keywords, child, modifier)); + } + }); + + return map(keywords, getHighlightSpanForNode); + + function getFlagFromModifier(modifier: SyntaxKind) { + switch (modifier) { + case SyntaxKind.PublicKeyword: + return ModifierFlags.Public; + case SyntaxKind.PrivateKeyword: + return ModifierFlags.Private; + case SyntaxKind.ProtectedKeyword: + return ModifierFlags.Protected; + case SyntaxKind.StaticKeyword: + return ModifierFlags.Static; + case SyntaxKind.ExportKeyword: + return ModifierFlags.Export; + case SyntaxKind.DeclareKeyword: + return ModifierFlags.Ambient; + case SyntaxKind.AbstractKeyword: + return ModifierFlags.Abstract; + default: + Debug.fail(); + } + } + } + + function pushKeywordIf(keywordList: Node[], token: Node, ...expected: SyntaxKind[]): boolean { + if (token && contains(expected, token.kind)) { + keywordList.push(token); + return true; + } + + return false; + } + + function getGetAndSetOccurrences(accessorDeclaration: AccessorDeclaration): HighlightSpan[] { + const keywords: Node[] = []; + + tryPushAccessorKeyword(accessorDeclaration.symbol, SyntaxKind.GetAccessor); + tryPushAccessorKeyword(accessorDeclaration.symbol, SyntaxKind.SetAccessor); + + return map(keywords, getHighlightSpanForNode); + + function tryPushAccessorKeyword(accessorSymbol: Symbol, accessorKind: SyntaxKind): void { + const accessor = getDeclarationOfKind(accessorSymbol, accessorKind); + + if (accessor) { + forEach(accessor.getChildren(), child => pushKeywordIf(keywords, child, SyntaxKind.GetKeyword, SyntaxKind.SetKeyword)); + } + } + } + + function getConstructorOccurrences(constructorDeclaration: ConstructorDeclaration): HighlightSpan[] { + const declarations = constructorDeclaration.symbol.getDeclarations(); + + const keywords: Node[] = []; + + forEach(declarations, declaration => { + forEach(declaration.getChildren(), token => { + return pushKeywordIf(keywords, token, SyntaxKind.ConstructorKeyword); + }); + }); + + return map(keywords, getHighlightSpanForNode); + } + + function getLoopBreakContinueOccurrences(loopNode: IterationStatement): HighlightSpan[] { + const keywords: Node[] = []; + + if (pushKeywordIf(keywords, loopNode.getFirstToken(), SyntaxKind.ForKeyword, SyntaxKind.WhileKeyword, SyntaxKind.DoKeyword)) { + // If we succeeded and got a do-while loop, then start looking for a 'while' keyword. + if (loopNode.kind === SyntaxKind.DoStatement) { + const loopTokens = loopNode.getChildren(); + + for (let i = loopTokens.length - 1; i >= 0; i--) { + if (pushKeywordIf(keywords, loopTokens[i], SyntaxKind.WhileKeyword)) { + break; + } + } + } + } + + const breaksAndContinues = aggregateAllBreakAndContinueStatements(loopNode.statement); + + forEach(breaksAndContinues, statement => { + if (ownsBreakOrContinueStatement(loopNode, statement)) { + pushKeywordIf(keywords, statement.getFirstToken(), SyntaxKind.BreakKeyword, SyntaxKind.ContinueKeyword); + } + }); + + return map(keywords, getHighlightSpanForNode); + } + + function getBreakOrContinueStatementOccurrences(breakOrContinueStatement: BreakOrContinueStatement): HighlightSpan[] { + const owner = getBreakOrContinueOwner(breakOrContinueStatement); + + if (owner) { + switch (owner.kind) { + case SyntaxKind.ForStatement: + case SyntaxKind.ForInStatement: + case SyntaxKind.ForOfStatement: + case SyntaxKind.DoStatement: + case SyntaxKind.WhileStatement: + return getLoopBreakContinueOccurrences(owner); + case SyntaxKind.SwitchStatement: + return getSwitchCaseDefaultOccurrences(owner); + + } + } + + return undefined; + } + + function getSwitchCaseDefaultOccurrences(switchStatement: SwitchStatement): HighlightSpan[] { + const keywords: Node[] = []; + + pushKeywordIf(keywords, switchStatement.getFirstToken(), SyntaxKind.SwitchKeyword); + + // Go through each clause in the switch statement, collecting the 'case'/'default' keywords. + forEach(switchStatement.caseBlock.clauses, clause => { + pushKeywordIf(keywords, clause.getFirstToken(), SyntaxKind.CaseKeyword, SyntaxKind.DefaultKeyword); + + const breaksAndContinues = aggregateAllBreakAndContinueStatements(clause); + + forEach(breaksAndContinues, statement => { + if (ownsBreakOrContinueStatement(switchStatement, statement)) { + pushKeywordIf(keywords, statement.getFirstToken(), SyntaxKind.BreakKeyword); + } + }); + }); + + return map(keywords, getHighlightSpanForNode); + } + + function getTryCatchFinallyOccurrences(tryStatement: TryStatement): HighlightSpan[] { + const keywords: Node[] = []; + + pushKeywordIf(keywords, tryStatement.getFirstToken(), SyntaxKind.TryKeyword); + + if (tryStatement.catchClause) { + pushKeywordIf(keywords, tryStatement.catchClause.getFirstToken(), SyntaxKind.CatchKeyword); + } + + if (tryStatement.finallyBlock) { + const finallyKeyword = findChildOfKind(tryStatement, SyntaxKind.FinallyKeyword, sourceFile); + pushKeywordIf(keywords, finallyKeyword, SyntaxKind.FinallyKeyword); + } + + return map(keywords, getHighlightSpanForNode); + } + + function getThrowOccurrences(throwStatement: ThrowStatement): HighlightSpan[] { + const owner = getThrowStatementOwner(throwStatement); + + if (!owner) { + return undefined; + } + + const keywords: Node[] = []; + + forEach(aggregateOwnedThrowStatements(owner), throwStatement => { + pushKeywordIf(keywords, throwStatement.getFirstToken(), SyntaxKind.ThrowKeyword); + }); + + // If the "owner" is a function, then we equate 'return' and 'throw' statements in their + // ability to "jump out" of the function, and include occurrences for both. + if (isFunctionBlock(owner)) { + forEachReturnStatement(owner, returnStatement => { + pushKeywordIf(keywords, returnStatement.getFirstToken(), SyntaxKind.ReturnKeyword); + }); + } + + return map(keywords, getHighlightSpanForNode); + } + + function getReturnOccurrences(returnStatement: ReturnStatement): HighlightSpan[] { + const func = getContainingFunction(returnStatement); + + // If we didn't find a containing function with a block body, bail out. + if (!(func && hasKind(func.body, SyntaxKind.Block))) { + return undefined; + } + + const keywords: Node[] = []; + forEachReturnStatement(func.body, returnStatement => { + pushKeywordIf(keywords, returnStatement.getFirstToken(), SyntaxKind.ReturnKeyword); + }); + + // Include 'throw' statements that do not occur within a try block. + forEach(aggregateOwnedThrowStatements(func.body), throwStatement => { + pushKeywordIf(keywords, throwStatement.getFirstToken(), SyntaxKind.ThrowKeyword); + }); + + return map(keywords, getHighlightSpanForNode); + } + + function getIfElseOccurrences(ifStatement: IfStatement): HighlightSpan[] { + const keywords: Node[] = []; + + // Traverse upwards through all parent if-statements linked by their else-branches. + while (hasKind(ifStatement.parent, SyntaxKind.IfStatement) && (ifStatement.parent).elseStatement === ifStatement) { + ifStatement = ifStatement.parent; + } + + // Now traverse back down through the else branches, aggregating if/else keywords of if-statements. + while (ifStatement) { + const children = ifStatement.getChildren(); + pushKeywordIf(keywords, children[0], SyntaxKind.IfKeyword); + + // Generally the 'else' keyword is second-to-last, so we traverse backwards. + for (let i = children.length - 1; i >= 0; i--) { + if (pushKeywordIf(keywords, children[i], SyntaxKind.ElseKeyword)) { + break; + } + } + + if (!hasKind(ifStatement.elseStatement, SyntaxKind.IfStatement)) { + break; + } + + ifStatement = ifStatement.elseStatement; + } + + const result: HighlightSpan[] = []; + + // We'd like to highlight else/ifs together if they are only separated by whitespace + // (i.e. the keywords are separated by no comments, no newlines). + for (let i = 0; i < keywords.length; i++) { + if (keywords[i].kind === SyntaxKind.ElseKeyword && i < keywords.length - 1) { + const elseKeyword = keywords[i]; + const ifKeyword = keywords[i + 1]; // this *should* always be an 'if' keyword. + + let shouldCombindElseAndIf = true; + + // Avoid recalculating getStart() by iterating backwards. + for (let j = ifKeyword.getStart() - 1; j >= elseKeyword.end; j--) { + if (!isWhiteSpaceSingleLine(sourceFile.text.charCodeAt(j))) { + shouldCombindElseAndIf = false; + break; + } + } + + if (shouldCombindElseAndIf) { + result.push({ + fileName: fileName, + textSpan: createTextSpanFromBounds(elseKeyword.getStart(), ifKeyword.end), + kind: HighlightSpanKind.reference + }); + i++; // skip the next keyword + continue; + } + } + + // Ordinary case: just highlight the keyword. + result.push(getHighlightSpanForNode(keywords[i])); + } + + return result; + } + } + } + + /** + * Whether or not a 'node' is preceded by a label of the given string. + * Note: 'node' cannot be a SourceFile. + */ + function isLabeledBy(node: Node, labelName: string) { + for (let owner = node.parent; owner.kind === SyntaxKind.LabeledStatement; owner = owner.parent) { + if ((owner).label.text === labelName) { + return true; + } + } + + return false; + } +} diff --git a/src/services/documentRegistry.ts b/src/services/documentRegistry.ts new file mode 100644 index 00000000000..d73e4d3b0a1 --- /dev/null +++ b/src/services/documentRegistry.ts @@ -0,0 +1,240 @@ +namespace ts { + /** + * The document registry represents a store of SourceFile objects that can be shared between + * multiple LanguageService instances. A LanguageService instance holds on the SourceFile (AST) + * of files in the context. + * SourceFile objects account for most of the memory usage by the language service. Sharing + * the same DocumentRegistry instance between different instances of LanguageService allow + * for more efficient memory utilization since all projects will share at least the library + * file (lib.d.ts). + * + * A more advanced use of the document registry is to serialize sourceFile objects to disk + * and re-hydrate them when needed. + * + * To create a default DocumentRegistry, use createDocumentRegistry to create one, and pass it + * to all subsequent createLanguageService calls. + */ + export interface DocumentRegistry { + /** + * Request a stored SourceFile with a given fileName and compilationSettings. + * The first call to acquire will call createLanguageServiceSourceFile to generate + * the SourceFile if was not found in the registry. + * + * @param fileName The name of the file requested + * @param compilationSettings Some compilation settings like target affects the + * shape of a the resulting SourceFile. This allows the DocumentRegistry to store + * multiple copies of the same file for different compilation settings. + * @parm scriptSnapshot Text of the file. Only used if the file was not found + * in the registry and a new one was created. + * @parm version Current version of the file. Only used if the file was not found + * in the registry and a new one was created. + */ + acquireDocument( + fileName: string, + compilationSettings: CompilerOptions, + scriptSnapshot: IScriptSnapshot, + version: string, + scriptKind?: ScriptKind): SourceFile; + + acquireDocumentWithKey( + fileName: string, + path: Path, + compilationSettings: CompilerOptions, + key: DocumentRegistryBucketKey, + scriptSnapshot: IScriptSnapshot, + version: string, + scriptKind?: ScriptKind): SourceFile; + + /** + * Request an updated version of an already existing SourceFile with a given fileName + * and compilationSettings. The update will in-turn call updateLanguageServiceSourceFile + * to get an updated SourceFile. + * + * @param fileName The name of the file requested + * @param compilationSettings Some compilation settings like target affects the + * shape of a the resulting SourceFile. This allows the DocumentRegistry to store + * multiple copies of the same file for different compilation settings. + * @param scriptSnapshot Text of the file. + * @param version Current version of the file. + */ + updateDocument( + fileName: string, + compilationSettings: CompilerOptions, + scriptSnapshot: IScriptSnapshot, + version: string, + scriptKind?: ScriptKind): SourceFile; + + updateDocumentWithKey( + fileName: string, + path: Path, + compilationSettings: CompilerOptions, + key: DocumentRegistryBucketKey, + scriptSnapshot: IScriptSnapshot, + version: string, + scriptKind?: ScriptKind): SourceFile; + + getKeyForCompilationSettings(settings: CompilerOptions): DocumentRegistryBucketKey; + /** + * Informs the DocumentRegistry that a file is not needed any longer. + * + * Note: It is not allowed to call release on a SourceFile that was not acquired from + * this registry originally. + * + * @param fileName The name of the file to be released + * @param compilationSettings The compilation settings used to acquire the file + */ + releaseDocument(fileName: string, compilationSettings: CompilerOptions): void; + + releaseDocumentWithKey(path: Path, key: DocumentRegistryBucketKey): void; + + reportStats(): string; + } + + export type DocumentRegistryBucketKey = string & { __bucketKey: any }; + + interface DocumentRegistryEntry { + sourceFile: SourceFile; + + // The number of language services that this source file is referenced in. When no more + // language services are referencing the file, then the file can be removed from the + // registry. + languageServiceRefCount: number; + owners: string[]; + } + + export function createDocumentRegistry(useCaseSensitiveFileNames?: boolean, currentDirectory = ""): DocumentRegistry { + // Maps from compiler setting target (ES3, ES5, etc.) to all the cached documents we have + // for those settings. + const buckets = createMap>(); + const getCanonicalFileName = createGetCanonicalFileName(!!useCaseSensitiveFileNames); + + function getKeyForCompilationSettings(settings: CompilerOptions): DocumentRegistryBucketKey { + return `_${settings.target}|${settings.module}|${settings.noResolve}|${settings.jsx}|${settings.allowJs}|${settings.baseUrl}|${JSON.stringify(settings.typeRoots)}|${JSON.stringify(settings.rootDirs)}|${JSON.stringify(settings.paths)}`; + } + + function getBucketForCompilationSettings(key: DocumentRegistryBucketKey, createIfMissing: boolean): FileMap { + let bucket = buckets[key]; + if (!bucket && createIfMissing) { + buckets[key] = bucket = createFileMap(); + } + return bucket; + } + + function reportStats() { + const bucketInfoArray = Object.keys(buckets).filter(name => name && name.charAt(0) === "_").map(name => { + const entries = buckets[name]; + const sourceFiles: { name: string; refCount: number; references: string[]; }[] = []; + entries.forEachValue((key, entry) => { + sourceFiles.push({ + name: key, + refCount: entry.languageServiceRefCount, + references: entry.owners.slice(0) + }); + }); + sourceFiles.sort((x, y) => y.refCount - x.refCount); + return { + bucket: name, + sourceFiles + }; + }); + return JSON.stringify(bucketInfoArray, undefined, 2); + } + + function acquireDocument(fileName: string, compilationSettings: CompilerOptions, scriptSnapshot: IScriptSnapshot, version: string, scriptKind?: ScriptKind): SourceFile { + const path = toPath(fileName, currentDirectory, getCanonicalFileName); + const key = getKeyForCompilationSettings(compilationSettings); + return acquireDocumentWithKey(fileName, path, compilationSettings, key, scriptSnapshot, version, scriptKind); + } + + function acquireDocumentWithKey(fileName: string, path: Path, compilationSettings: CompilerOptions, key: DocumentRegistryBucketKey, scriptSnapshot: IScriptSnapshot, version: string, scriptKind?: ScriptKind): SourceFile { + return acquireOrUpdateDocument(fileName, path, compilationSettings, key, scriptSnapshot, version, /*acquiring*/ true, scriptKind); + } + + function updateDocument(fileName: string, compilationSettings: CompilerOptions, scriptSnapshot: IScriptSnapshot, version: string, scriptKind?: ScriptKind): SourceFile { + const path = toPath(fileName, currentDirectory, getCanonicalFileName); + const key = getKeyForCompilationSettings(compilationSettings); + return updateDocumentWithKey(fileName, path, compilationSettings, key, scriptSnapshot, version, scriptKind); + } + + function updateDocumentWithKey(fileName: string, path: Path, compilationSettings: CompilerOptions, key: DocumentRegistryBucketKey, scriptSnapshot: IScriptSnapshot, version: string, scriptKind?: ScriptKind): SourceFile { + return acquireOrUpdateDocument(fileName, path, compilationSettings, key, scriptSnapshot, version, /*acquiring*/ false, scriptKind); + } + + function acquireOrUpdateDocument( + fileName: string, + path: Path, + compilationSettings: CompilerOptions, + key: DocumentRegistryBucketKey, + scriptSnapshot: IScriptSnapshot, + version: string, + acquiring: boolean, + scriptKind?: ScriptKind): SourceFile { + + const bucket = getBucketForCompilationSettings(key, /*createIfMissing*/ true); + let entry = bucket.get(path); + if (!entry) { + Debug.assert(acquiring, "How could we be trying to update a document that the registry doesn't have?"); + + // Have never seen this file with these settings. Create a new source file for it. + const sourceFile = createLanguageServiceSourceFile(fileName, scriptSnapshot, compilationSettings.target, version, /*setNodeParents*/ false, scriptKind); + + entry = { + sourceFile: sourceFile, + languageServiceRefCount: 0, + owners: [] + }; + bucket.set(path, entry); + } + else { + // We have an entry for this file. However, it may be for a different version of + // the script snapshot. If so, update it appropriately. Otherwise, we can just + // return it as is. + if (entry.sourceFile.version !== version) { + entry.sourceFile = updateLanguageServiceSourceFile(entry.sourceFile, scriptSnapshot, version, + scriptSnapshot.getChangeRange(entry.sourceFile.scriptSnapshot)); + } + } + + // If we're acquiring, then this is the first time this LS is asking for this document. + // Increase our ref count so we know there's another LS using the document. If we're + // not acquiring, then that means the LS is 'updating' the file instead, and that means + // it has already acquired the document previously. As such, we do not need to increase + // the ref count. + if (acquiring) { + entry.languageServiceRefCount++; + } + + return entry.sourceFile; + } + + function releaseDocument(fileName: string, compilationSettings: CompilerOptions): void { + const path = toPath(fileName, currentDirectory, getCanonicalFileName); + const key = getKeyForCompilationSettings(compilationSettings); + return releaseDocumentWithKey(path, key); + } + + function releaseDocumentWithKey(path: Path, key: DocumentRegistryBucketKey): void { + const bucket = getBucketForCompilationSettings(key, /*createIfMissing*/false); + Debug.assert(bucket !== undefined); + + const entry = bucket.get(path); + entry.languageServiceRefCount--; + + Debug.assert(entry.languageServiceRefCount >= 0); + if (entry.languageServiceRefCount === 0) { + bucket.remove(path); + } + } + + return { + acquireDocument, + acquireDocumentWithKey, + updateDocument, + updateDocumentWithKey, + releaseDocument, + releaseDocumentWithKey, + reportStats, + getKeyForCompilationSettings + }; + } +} diff --git a/src/services/findAllReferences.ts b/src/services/findAllReferences.ts new file mode 100644 index 00000000000..2127c401315 --- /dev/null +++ b/src/services/findAllReferences.ts @@ -0,0 +1,1405 @@ +/* @internal */ +namespace ts.FindAllReferences { + export function findReferencedSymbols(typeChecker: TypeChecker, cancellationToken: CancellationToken, sourceFiles: SourceFile[], sourceFile: SourceFile, position: number, findInStrings: boolean, findInComments: boolean): ReferencedSymbol[] { + const node = getTouchingPropertyName(sourceFile, position, /*includeJsDocComment*/ true); + if (node === sourceFile) { + return undefined; + } + + switch (node.kind) { + case SyntaxKind.NumericLiteral: + if (!isLiteralNameOfPropertyDeclarationOrIndexAccess(node)) { + break; + } + // Fallthrough + case SyntaxKind.Identifier: + case SyntaxKind.ThisKeyword: + // case SyntaxKind.SuperKeyword: TODO:GH#9268 + case SyntaxKind.ConstructorKeyword: + case SyntaxKind.StringLiteral: + return getReferencedSymbolsForNode(typeChecker, cancellationToken, node, sourceFiles, findInStrings, findInComments, /*implementations*/false); + } + return undefined; + } + + export function getReferencedSymbolsForNode(typeChecker: TypeChecker, cancellationToken: CancellationToken, node: Node, sourceFiles: SourceFile[], findInStrings: boolean, findInComments: boolean, implementations: boolean): ReferencedSymbol[] { + if (!implementations) { + // Labels + if (isLabelName(node)) { + if (isJumpStatementTarget(node)) { + const labelDefinition = getTargetLabel((node.parent), (node).text); + // if we have a label definition, look within its statement for references, if not, then + // the label is undefined and we have no results.. + return labelDefinition ? getLabelReferencesInNode(labelDefinition.parent, labelDefinition) : undefined; + } + else { + // it is a label definition and not a target, search within the parent labeledStatement + return getLabelReferencesInNode(node.parent, node); + } + } + + if (isThis(node)) { + return getReferencesForThisKeyword(node, sourceFiles); + } + + if (node.kind === SyntaxKind.SuperKeyword) { + return getReferencesForSuperKeyword(node); + } + } + + // `getSymbolAtLocation` normally returns the symbol of the class when given the constructor keyword, + // so we have to specify that we want the constructor symbol. + const symbol = typeChecker.getSymbolAtLocation(node); + + if (!implementations && !symbol && node.kind === SyntaxKind.StringLiteral) { + return getReferencesForStringLiteral(node, sourceFiles); + } + + + // Could not find a symbol e.g. unknown identifier + if (!symbol) { + // Can't have references to something that we have no symbol for. + return undefined; + } + + const declarations = symbol.declarations; + + // The symbol was an internal symbol and does not have a declaration e.g. undefined symbol + if (!declarations || !declarations.length) { + return undefined; + } + + let result: ReferencedSymbol[]; + + // Compute the meaning from the location and the symbol it references + const searchMeaning = getIntersectingMeaningFromDeclarations(getMeaningFromLocation(node), declarations); + + // Get the text to search for. + // Note: if this is an external module symbol, the name doesn't include quotes. + const declaredName = stripQuotes(getDeclaredName(typeChecker, symbol, node)); + + // Try to get the smallest valid scope that we can limit our search to; + // otherwise we'll need to search globally (i.e. include each file). + const scope = getSymbolScope(symbol); + + // Maps from a symbol ID to the ReferencedSymbol entry in 'result'. + const symbolToIndex: number[] = []; + + if (scope) { + result = []; + getReferencesInNode(scope, symbol, declaredName, node, searchMeaning, findInStrings, findInComments, result, symbolToIndex); + } + else { + const internedName = getInternedName(symbol, node, declarations); + for (const sourceFile of sourceFiles) { + cancellationToken.throwIfCancellationRequested(); + + const nameTable = getNameTable(sourceFile); + + if (nameTable[internedName] !== undefined) { + result = result || []; + getReferencesInNode(sourceFile, symbol, declaredName, node, searchMeaning, findInStrings, findInComments, result, symbolToIndex); + } + } + } + + return result; + + function getDefinition(symbol: Symbol): ReferencedSymbolDefinitionInfo { + const info = SymbolDisplay.getSymbolDisplayPartsDocumentationAndSymbolKind(typeChecker, symbol, node.getSourceFile(), getContainerNode(node), node); + const name = map(info.displayParts, p => p.text).join(""); + const declarations = symbol.declarations; + if (!declarations || declarations.length === 0) { + return undefined; + } + + return { + containerKind: "", + containerName: "", + name, + kind: info.symbolKind, + fileName: declarations[0].getSourceFile().fileName, + textSpan: createTextSpan(declarations[0].getStart(), 0), + displayParts: info.displayParts + }; + } + + function getAliasSymbolForPropertyNameSymbol(symbol: Symbol, location: Node): Symbol | undefined { + if (symbol.flags & SymbolFlags.Alias) { + // Default import get alias + const defaultImport = getDeclarationOfKind(symbol, SyntaxKind.ImportClause); + if (defaultImport) { + return typeChecker.getAliasedSymbol(symbol); + } + + const importOrExportSpecifier = forEach(symbol.declarations, + declaration => (declaration.kind === SyntaxKind.ImportSpecifier || + declaration.kind === SyntaxKind.ExportSpecifier) ? declaration : undefined); + if (importOrExportSpecifier && + // export { a } + (!importOrExportSpecifier.propertyName || + // export {a as class } where a is location + importOrExportSpecifier.propertyName === location)) { + // If Import specifier -> get alias + // else Export specifier -> get local target + return importOrExportSpecifier.kind === SyntaxKind.ImportSpecifier ? + typeChecker.getAliasedSymbol(symbol) : + typeChecker.getExportSpecifierLocalTargetSymbol(importOrExportSpecifier); + } + } + return undefined; + } + + function followAliasIfNecessary(symbol: Symbol, location: Node): Symbol { + return getAliasSymbolForPropertyNameSymbol(symbol, location) || symbol; + } + + function getPropertySymbolOfDestructuringAssignment(location: Node) { + return isArrayLiteralOrObjectLiteralDestructuringPattern(location.parent.parent) && + typeChecker.getPropertySymbolOfDestructuringAssignment(location); + } + + function isObjectBindingPatternElementWithoutPropertyName(symbol: Symbol) { + const bindingElement = getDeclarationOfKind(symbol, SyntaxKind.BindingElement); + return bindingElement && + bindingElement.parent.kind === SyntaxKind.ObjectBindingPattern && + !bindingElement.propertyName; + } + + function getPropertySymbolOfObjectBindingPatternWithoutPropertyName(symbol: Symbol) { + if (isObjectBindingPatternElementWithoutPropertyName(symbol)) { + const bindingElement = getDeclarationOfKind(symbol, SyntaxKind.BindingElement); + const typeOfPattern = typeChecker.getTypeAtLocation(bindingElement.parent); + return typeOfPattern && typeChecker.getPropertyOfType(typeOfPattern, (bindingElement.name).text); + } + return undefined; + } + + function getInternedName(symbol: Symbol, location: Node, declarations: Declaration[]): string { + // If this is an export or import specifier it could have been renamed using the 'as' syntax. + // If so we want to search for whatever under the cursor. + if (isImportOrExportSpecifierName(location)) { + return location.getText(); + } + + // Try to get the local symbol if we're dealing with an 'export default' + // since that symbol has the "true" name. + const localExportDefaultSymbol = getLocalSymbolForExportDefault(symbol); + symbol = localExportDefaultSymbol || symbol; + + return stripQuotes(symbol.name); + } + + /** + * Determines the smallest scope in which a symbol may have named references. + * Note that not every construct has been accounted for. This function can + * probably be improved. + * + * @returns undefined if the scope cannot be determined, implying that + * a reference to a symbol can occur anywhere. + */ + function getSymbolScope(symbol: Symbol): Node { + // If this is the symbol of a named function expression or named class expression, + // then named references are limited to its own scope. + const valueDeclaration = symbol.valueDeclaration; + if (valueDeclaration && (valueDeclaration.kind === SyntaxKind.FunctionExpression || valueDeclaration.kind === SyntaxKind.ClassExpression)) { + return valueDeclaration; + } + + // If this is private property or method, the scope is the containing class + if (symbol.flags & (SymbolFlags.Property | SymbolFlags.Method)) { + const privateDeclaration = forEach(symbol.getDeclarations(), d => (getModifierFlags(d) & ModifierFlags.Private) ? d : undefined); + if (privateDeclaration) { + return getAncestor(privateDeclaration, SyntaxKind.ClassDeclaration); + } + } + + // If the symbol is an import we would like to find it if we are looking for what it imports. + // So consider it visible outside its declaration scope. + if (symbol.flags & SymbolFlags.Alias) { + return undefined; + } + + // If symbol is of object binding pattern element without property name we would want to + // look for property too and that could be anywhere + if (isObjectBindingPatternElementWithoutPropertyName(symbol)) { + return undefined; + } + + // if this symbol is visible from its parent container, e.g. exported, then bail out + // if symbol correspond to the union property - bail out + if (symbol.parent || (symbol.flags & SymbolFlags.SyntheticProperty)) { + return undefined; + } + + let scope: Node; + + const declarations = symbol.getDeclarations(); + if (declarations) { + for (const declaration of declarations) { + const container = getContainerNode(declaration); + + if (!container) { + return undefined; + } + + if (scope && scope !== container) { + // Different declarations have different containers, bail out + return undefined; + } + + if (container.kind === SyntaxKind.SourceFile && !isExternalModule(container)) { + // This is a global variable and not an external module, any declaration defined + // within this scope is visible outside the file + return undefined; + } + + // The search scope is the container node + scope = container; + } + } + + return scope; + } + + function getPossibleSymbolReferencePositions(sourceFile: SourceFile, symbolName: string, start: number, end: number): number[] { + const positions: number[] = []; + + /// TODO: Cache symbol existence for files to save text search + // Also, need to make this work for unicode escapes. + + // Be resilient in the face of a symbol with no name or zero length name + if (!symbolName || !symbolName.length) { + return positions; + } + + const text = sourceFile.text; + const sourceLength = text.length; + const symbolNameLength = symbolName.length; + + let position = text.indexOf(symbolName, start); + while (position >= 0) { + cancellationToken.throwIfCancellationRequested(); + + // If we are past the end, stop looking + if (position > end) break; + + // We found a match. Make sure it's not part of a larger word (i.e. the char + // before and after it have to be a non-identifier char). + const endPosition = position + symbolNameLength; + + if ((position === 0 || !isIdentifierPart(text.charCodeAt(position - 1), ScriptTarget.Latest)) && + (endPosition === sourceLength || !isIdentifierPart(text.charCodeAt(endPosition), ScriptTarget.Latest))) { + // Found a real match. Keep searching. + positions.push(position); + } + position = text.indexOf(symbolName, position + symbolNameLength + 1); + } + + return positions; + } + + function getLabelReferencesInNode(container: Node, targetLabel: Identifier): ReferencedSymbol[] { + const references: ReferenceEntry[] = []; + const sourceFile = container.getSourceFile(); + const labelName = targetLabel.text; + const possiblePositions = getPossibleSymbolReferencePositions(sourceFile, labelName, container.getStart(), container.getEnd()); + forEach(possiblePositions, position => { + cancellationToken.throwIfCancellationRequested(); + + const node = getTouchingWord(sourceFile, position); + if (!node || node.getWidth() !== labelName.length) { + return; + } + + // Only pick labels that are either the target label, or have a target that is the target label + if (node === targetLabel || + (isJumpStatementTarget(node) && getTargetLabel(node, labelName) === targetLabel)) { + references.push(getReferenceEntryFromNode(node)); + } + }); + + const definition: ReferencedSymbolDefinitionInfo = { + containerKind: "", + containerName: "", + fileName: targetLabel.getSourceFile().fileName, + kind: ScriptElementKind.label, + name: labelName, + textSpan: createTextSpanFromBounds(targetLabel.getStart(), targetLabel.getEnd()), + displayParts: [displayPart(labelName, SymbolDisplayPartKind.text)] + }; + + return [{ definition, references }]; + } + + function isValidReferencePosition(node: Node, searchSymbolName: string): boolean { + if (node) { + // Compare the length so we filter out strict superstrings of the symbol we are looking for + switch (node.kind) { + case SyntaxKind.Identifier: + return node.getWidth() === searchSymbolName.length; + + case SyntaxKind.StringLiteral: + if (isLiteralNameOfPropertyDeclarationOrIndexAccess(node) || + isNameOfExternalModuleImportOrDeclaration(node)) { + // For string literals we have two additional chars for the quotes + return node.getWidth() === searchSymbolName.length + 2; + } + break; + + case SyntaxKind.NumericLiteral: + if (isLiteralNameOfPropertyDeclarationOrIndexAccess(node)) { + return node.getWidth() === searchSymbolName.length; + } + break; + } + } + + return false; + } + + /** Search within node "container" for references for a search value, where the search value is defined as a + * tuple of(searchSymbol, searchText, searchLocation, and searchMeaning). + * searchLocation: a node where the search value + */ + function getReferencesInNode(container: Node, + searchSymbol: Symbol, + searchText: string, + searchLocation: Node, + searchMeaning: SemanticMeaning, + findInStrings: boolean, + findInComments: boolean, + result: ReferencedSymbol[], + symbolToIndex: number[]): void { + + const sourceFile = container.getSourceFile(); + + const start = findInComments ? container.getFullStart() : container.getStart(); + const possiblePositions = getPossibleSymbolReferencePositions(sourceFile, searchText, start, container.getEnd()); + + const parents = getParentSymbolsOfPropertyAccess(); + const inheritsFromCache: Map = createMap(); + + if (possiblePositions.length) { + // Build the set of symbols to search for, initially it has only the current symbol + const searchSymbols = populateSearchSymbolSet(searchSymbol, searchLocation); + + forEach(possiblePositions, position => { + cancellationToken.throwIfCancellationRequested(); + + const referenceLocation = getTouchingPropertyName(sourceFile, position); + if (!isValidReferencePosition(referenceLocation, searchText)) { + // This wasn't the start of a token. Check to see if it might be a + // match in a comment or string if that's what the caller is asking + // for. + if (!implementations && ((findInStrings && isInString(sourceFile, position)) || + (findInComments && isInNonReferenceComment(sourceFile, position)))) { + + // In the case where we're looking inside comments/strings, we don't have + // an actual definition. So just use 'undefined' here. Features like + // 'Rename' won't care (as they ignore the definitions), and features like + // 'FindReferences' will just filter out these results. + result.push({ + definition: undefined, + references: [{ + fileName: sourceFile.fileName, + textSpan: createTextSpan(position, searchText.length), + isWriteAccess: false, + isDefinition: false + }] + }); + } + return; + } + + if (!(getMeaningFromLocation(referenceLocation) & searchMeaning)) { + return; + } + + const referenceSymbol = typeChecker.getSymbolAtLocation(referenceLocation); + if (referenceSymbol) { + const referenceSymbolDeclaration = referenceSymbol.valueDeclaration; + const shorthandValueSymbol = typeChecker.getShorthandAssignmentValueSymbol(referenceSymbolDeclaration); + const relatedSymbol = getRelatedSymbol(searchSymbols, referenceSymbol, referenceLocation, + /*searchLocationIsConstructor*/ searchLocation.kind === SyntaxKind.ConstructorKeyword, parents, inheritsFromCache); + + if (relatedSymbol) { + addReferenceToRelatedSymbol(referenceLocation, relatedSymbol); + } + /* Because in short-hand property assignment, an identifier which stored as name of the short-hand property assignment + * has two meaning : property name and property value. Therefore when we do findAllReference at the position where + * an identifier is declared, the language service should return the position of the variable declaration as well as + * the position in short-hand property assignment excluding property accessing. However, if we do findAllReference at the + * position of property accessing, the referenceEntry of such position will be handled in the first case. + */ + else if (!(referenceSymbol.flags & SymbolFlags.Transient) && searchSymbols.indexOf(shorthandValueSymbol) >= 0) { + addReferenceToRelatedSymbol(referenceSymbolDeclaration.name, shorthandValueSymbol); + } + else if (searchLocation.kind === SyntaxKind.ConstructorKeyword) { + findAdditionalConstructorReferences(referenceSymbol, referenceLocation); + } + } + }); + } + return; + + /* If we are just looking for implementations and this is a property access expression, we need to get the + * symbol of the local type of the symbol the property is being accessed on. This is because our search + * symbol may have a different parent symbol if the local type's symbol does not declare the property + * being accessed (i.e. it is declared in some parent class or interface) + */ + function getParentSymbolsOfPropertyAccess(): Symbol[] | undefined { + if (implementations) { + const propertyAccessExpression = getPropertyAccessExpressionFromRightHandSide(searchLocation); + if (propertyAccessExpression) { + const localParentType = typeChecker.getTypeAtLocation(propertyAccessExpression.expression); + if (localParentType) { + if (localParentType.symbol && localParentType.symbol.flags & (SymbolFlags.Class | SymbolFlags.Interface) && localParentType.symbol !== searchSymbol.parent) { + return [localParentType.symbol]; + } + else if (localParentType.flags & TypeFlags.UnionOrIntersection) { + return getSymbolsForClassAndInterfaceComponents(localParentType); + } + } + } + } + } + + function getPropertyAccessExpressionFromRightHandSide(node: Node): PropertyAccessExpression { + return isRightSideOfPropertyAccess(node) && node.parent; + } + + /** Adds references when a constructor is used with `new this()` in its own class and `super()` calls in subclasses. */ + function findAdditionalConstructorReferences(referenceSymbol: Symbol, referenceLocation: Node): void { + Debug.assert(isClassLike(searchSymbol.valueDeclaration)); + + const referenceClass = referenceLocation.parent; + if (referenceSymbol === searchSymbol && isClassLike(referenceClass)) { + Debug.assert(referenceClass.name === referenceLocation); + // This is the class declaration containing the constructor. + addReferences(findOwnConstructorCalls(searchSymbol)); + } + else { + // If this class appears in `extends C`, then the extending class' "super" calls are references. + const classExtending = tryGetClassByExtendingIdentifier(referenceLocation); + if (classExtending && isClassLike(classExtending) && followAliasIfNecessary(referenceSymbol, referenceLocation) === searchSymbol) { + addReferences(superConstructorAccesses(classExtending)); + } + } + } + + function addReferences(references: Node[]): void { + if (references.length) { + const referencedSymbol = getReferencedSymbol(searchSymbol); + addRange(referencedSymbol.references, map(references, getReferenceEntryFromNode)); + } + } + + /** `classSymbol` is the class where the constructor was defined. + * Reference the constructor and all calls to `new this()`. + */ + function findOwnConstructorCalls(classSymbol: Symbol): Node[] { + const result: Node[] = []; + + for (const decl of classSymbol.members["__constructor"].declarations) { + Debug.assert(decl.kind === SyntaxKind.Constructor); + const ctrKeyword = decl.getChildAt(0); + Debug.assert(ctrKeyword.kind === SyntaxKind.ConstructorKeyword); + result.push(ctrKeyword); + } + + forEachProperty(classSymbol.exports, member => { + const decl = member.valueDeclaration; + if (decl && decl.kind === SyntaxKind.MethodDeclaration) { + const body = (decl).body; + if (body) { + forEachDescendantOfKind(body, SyntaxKind.ThisKeyword, thisKeyword => { + if (isNewExpressionTarget(thisKeyword)) { + result.push(thisKeyword); + } + }); + } + } + }); + + return result; + } + + /** Find references to `super` in the constructor of an extending class. */ + function superConstructorAccesses(cls: ClassLikeDeclaration): Node[] { + const symbol = cls.symbol; + const ctr = symbol.members["__constructor"]; + if (!ctr) { + return []; + } + + const result: Node[] = []; + for (const decl of ctr.declarations) { + Debug.assert(decl.kind === SyntaxKind.Constructor); + const body = (decl).body; + if (body) { + forEachDescendantOfKind(body, SyntaxKind.SuperKeyword, node => { + if (isCallExpressionTarget(node)) { + result.push(node); + } + }); + } + }; + return result; + } + + function getReferencedSymbol(symbol: Symbol): ReferencedSymbol { + const symbolId = getSymbolId(symbol); + let index = symbolToIndex[symbolId]; + if (index === undefined) { + index = result.length; + symbolToIndex[symbolId] = index; + + result.push({ + definition: getDefinition(symbol), + references: [] + }); + } + + return result[index]; + } + + function addReferenceToRelatedSymbol(node: Node, relatedSymbol: Symbol) { + const references = getReferencedSymbol(relatedSymbol).references; + if (implementations) { + getImplementationReferenceEntryForNode(node, references); + } + else { + references.push(getReferenceEntryFromNode(node)); + } + } + } + + function getImplementationReferenceEntryForNode(refNode: Node, result: ReferenceEntry[]): void { + // Check if we found a function/propertyAssignment/method with an implementation or initializer + if (isDeclarationName(refNode) && isImplementation(refNode.parent)) { + result.push(getReferenceEntryFromNode(refNode.parent)); + } + else if (refNode.kind === SyntaxKind.Identifier) { + if (refNode.parent.kind === SyntaxKind.ShorthandPropertyAssignment) { + // Go ahead and dereference the shorthand assignment by going to its definition + getReferenceEntriesForShorthandPropertyAssignment(refNode, typeChecker, result); + } + + // Check if the node is within an extends or implements clause + const containingClass = getContainingClassIfInHeritageClause(refNode); + if (containingClass) { + result.push(getReferenceEntryFromNode(containingClass)); + return; + } + + // If we got a type reference, try and see if the reference applies to any expressions that can implement an interface + const containingTypeReference = getContainingTypeReference(refNode); + if (containingTypeReference) { + const parent = containingTypeReference.parent; + if (isVariableLike(parent) && parent.type === containingTypeReference && parent.initializer && isImplementationExpression(parent.initializer)) { + maybeAdd(getReferenceEntryFromNode(parent.initializer)); + } + else if (isFunctionLike(parent) && parent.type === containingTypeReference && parent.body) { + if (parent.body.kind === SyntaxKind.Block) { + forEachReturnStatement(parent.body, returnStatement => { + if (returnStatement.expression && isImplementationExpression(returnStatement.expression)) { + maybeAdd(getReferenceEntryFromNode(returnStatement.expression)); + } + }); + } + else if (isImplementationExpression(parent.body)) { + maybeAdd(getReferenceEntryFromNode(parent.body)); + } + } + else if (isAssertionExpression(parent) && isImplementationExpression(parent.expression)) { + maybeAdd(getReferenceEntryFromNode(parent.expression)); + } + } + } + + // Type nodes can contain multiple references to the same type. For example: + // let x: Foo & (Foo & Bar) = ... + // Because we are returning the implementation locations and not the identifier locations, + // duplicate entries would be returned here as each of the type references is part of + // the same implementation. For that reason, check before we add a new entry + function maybeAdd(a: ReferenceEntry) { + if (!forEach(result, b => a.fileName === b.fileName && a.textSpan.start === b.textSpan.start && a.textSpan.length === b.textSpan.length)) { + result.push(a); + } + } + } + + function getSymbolsForClassAndInterfaceComponents(type: UnionOrIntersectionType, result: Symbol[] = []): Symbol[] { + for (const componentType of type.types) { + if (componentType.symbol && componentType.symbol.getFlags() & (SymbolFlags.Class | SymbolFlags.Interface)) { + result.push(componentType.symbol); + } + if (componentType.getFlags() & TypeFlags.UnionOrIntersection) { + getSymbolsForClassAndInterfaceComponents(componentType, result); + } + } + return result; + } + + function getContainingTypeReference(node: Node): Node { + let topLevelTypeReference: Node = undefined; + + while (node) { + if (isTypeNode(node)) { + topLevelTypeReference = node; + } + node = node.parent; + } + + return topLevelTypeReference; + } + + function getContainingClassIfInHeritageClause(node: Node): ClassLikeDeclaration { + if (node && node.parent) { + if (node.kind === SyntaxKind.ExpressionWithTypeArguments + && node.parent.kind === SyntaxKind.HeritageClause + && isClassLike(node.parent.parent)) { + return node.parent.parent; + } + + else if (node.kind === SyntaxKind.Identifier || node.kind === SyntaxKind.PropertyAccessExpression) { + return getContainingClassIfInHeritageClause(node.parent); + } + } + return undefined; + } + + /** + * Returns true if this is an expression that can be considered an implementation + */ + function isImplementationExpression(node: Expression): boolean { + // Unwrap parentheses + if (node.kind === SyntaxKind.ParenthesizedExpression) { + return isImplementationExpression((node).expression); + } + + return node.kind === SyntaxKind.ArrowFunction || + node.kind === SyntaxKind.FunctionExpression || + node.kind === SyntaxKind.ObjectLiteralExpression || + node.kind === SyntaxKind.ClassExpression || + node.kind === SyntaxKind.ArrayLiteralExpression; + } + + /** + * Determines if the parent symbol occurs somewhere in the child's ancestry. If the parent symbol + * is an interface, determines if some ancestor of the child symbol extends or inherits from it. + * Also takes in a cache of previous results which makes this slightly more efficient and is + * necessary to avoid potential loops like so: + * class A extends B { } + * class B extends A { } + * + * We traverse the AST rather than using the type checker because users are typically only interested + * in explicit implementations of an interface/class when calling "Go to Implementation". Sibling + * implementations of types that share a common ancestor with the type whose implementation we are + * searching for need to be filtered out of the results. The type checker doesn't let us make the + * distinction between structurally compatible implementations and explicit implementations, so we + * must use the AST. + * + * @param child A class or interface Symbol + * @param parent Another class or interface Symbol + * @param cachedResults A map of symbol id pairs (i.e. "child,parent") to booleans indicating previous results + */ + function explicitlyInheritsFrom(child: Symbol, parent: Symbol, cachedResults: Map): boolean { + const parentIsInterface = parent.getFlags() & SymbolFlags.Interface; + return searchHierarchy(child); + + function searchHierarchy(symbol: Symbol): boolean { + if (symbol === parent) { + return true; + } + + const key = getSymbolId(symbol) + "," + getSymbolId(parent); + if (key in cachedResults) { + return cachedResults[key]; + } + + // Set the key so that we don't infinitely recurse + cachedResults[key] = false; + + const inherits = forEach(symbol.getDeclarations(), (declaration) => { + if (isClassLike(declaration)) { + if (parentIsInterface) { + const interfaceReferences = getClassImplementsHeritageClauseElements(declaration); + if (interfaceReferences) { + for (const typeReference of interfaceReferences) { + if (searchTypeReference(typeReference)) { + return true; + } + } + } + } + return searchTypeReference(getClassExtendsHeritageClauseElement(declaration)); + } + else if (declaration.kind === SyntaxKind.InterfaceDeclaration) { + if (parentIsInterface) { + return forEach(getInterfaceBaseTypeNodes(declaration), searchTypeReference); + } + } + return false; + }); + + cachedResults[key] = inherits; + return inherits; + } + + function searchTypeReference(typeReference: ExpressionWithTypeArguments): boolean { + if (typeReference) { + const type = typeChecker.getTypeAtLocation(typeReference); + if (type && type.symbol) { + return searchHierarchy(type.symbol); + } + } + return false; + } + } + + function getReferencesForSuperKeyword(superKeyword: Node): ReferencedSymbol[] { + let searchSpaceNode = getSuperContainer(superKeyword, /*stopOnFunctions*/ false); + if (!searchSpaceNode) { + return undefined; + } + // Whether 'super' occurs in a static context within a class. + let staticFlag = ModifierFlags.Static; + + switch (searchSpaceNode.kind) { + case SyntaxKind.PropertyDeclaration: + case SyntaxKind.PropertySignature: + case SyntaxKind.MethodDeclaration: + case SyntaxKind.MethodSignature: + case SyntaxKind.Constructor: + case SyntaxKind.GetAccessor: + case SyntaxKind.SetAccessor: + staticFlag &= getModifierFlags(searchSpaceNode); + searchSpaceNode = searchSpaceNode.parent; // re-assign to be the owning class + break; + default: + return undefined; + } + + const references: ReferenceEntry[] = []; + + const sourceFile = searchSpaceNode.getSourceFile(); + const possiblePositions = getPossibleSymbolReferencePositions(sourceFile, "super", searchSpaceNode.getStart(), searchSpaceNode.getEnd()); + forEach(possiblePositions, position => { + cancellationToken.throwIfCancellationRequested(); + + const node = getTouchingWord(sourceFile, position); + + if (!node || node.kind !== SyntaxKind.SuperKeyword) { + return; + } + + const container = getSuperContainer(node, /*stopOnFunctions*/ false); + + // If we have a 'super' container, we must have an enclosing class. + // Now make sure the owning class is the same as the search-space + // and has the same static qualifier as the original 'super's owner. + if (container && (ModifierFlags.Static & getModifierFlags(container)) === staticFlag && container.parent.symbol === searchSpaceNode.symbol) { + references.push(getReferenceEntryFromNode(node)); + } + }); + + const definition = getDefinition(searchSpaceNode.symbol); + return [{ definition, references }]; + } + + function getReferencesForThisKeyword(thisOrSuperKeyword: Node, sourceFiles: SourceFile[]): ReferencedSymbol[] { + let searchSpaceNode = getThisContainer(thisOrSuperKeyword, /* includeArrowFunctions */ false); + + // Whether 'this' occurs in a static context within a class. + let staticFlag = ModifierFlags.Static; + + switch (searchSpaceNode.kind) { + case SyntaxKind.MethodDeclaration: + case SyntaxKind.MethodSignature: + if (isObjectLiteralMethod(searchSpaceNode)) { + break; + } + // fall through + case SyntaxKind.PropertyDeclaration: + case SyntaxKind.PropertySignature: + case SyntaxKind.Constructor: + case SyntaxKind.GetAccessor: + case SyntaxKind.SetAccessor: + staticFlag &= getModifierFlags(searchSpaceNode); + searchSpaceNode = searchSpaceNode.parent; // re-assign to be the owning class + break; + case SyntaxKind.SourceFile: + if (isExternalModule(searchSpaceNode)) { + return undefined; + } + // Fall through + case SyntaxKind.FunctionDeclaration: + case SyntaxKind.FunctionExpression: + break; + // Computed properties in classes are not handled here because references to this are illegal, + // so there is no point finding references to them. + default: + return undefined; + } + + const references: ReferenceEntry[] = []; + + let possiblePositions: number[]; + if (searchSpaceNode.kind === SyntaxKind.SourceFile) { + forEach(sourceFiles, sourceFile => { + possiblePositions = getPossibleSymbolReferencePositions(sourceFile, "this", sourceFile.getStart(), sourceFile.getEnd()); + getThisReferencesInFile(sourceFile, sourceFile, possiblePositions, references); + }); + } + else { + const sourceFile = searchSpaceNode.getSourceFile(); + possiblePositions = getPossibleSymbolReferencePositions(sourceFile, "this", searchSpaceNode.getStart(), searchSpaceNode.getEnd()); + getThisReferencesInFile(sourceFile, searchSpaceNode, possiblePositions, references); + } + + const thisOrSuperSymbol = typeChecker.getSymbolAtLocation(thisOrSuperKeyword); + + const displayParts = thisOrSuperSymbol && SymbolDisplay.getSymbolDisplayPartsDocumentationAndSymbolKind( + typeChecker, thisOrSuperSymbol, thisOrSuperKeyword.getSourceFile(), getContainerNode(thisOrSuperKeyword), thisOrSuperKeyword).displayParts; + + return [{ + definition: { + containerKind: "", + containerName: "", + fileName: node.getSourceFile().fileName, + kind: ScriptElementKind.variableElement, + name: "this", + textSpan: createTextSpanFromBounds(node.getStart(), node.getEnd()), + displayParts + }, + references: references + }]; + + function getThisReferencesInFile(sourceFile: SourceFile, searchSpaceNode: Node, possiblePositions: number[], result: ReferenceEntry[]): void { + forEach(possiblePositions, position => { + cancellationToken.throwIfCancellationRequested(); + + const node = getTouchingWord(sourceFile, position); + if (!node || !isThis(node)) { + return; + } + + const container = getThisContainer(node, /* includeArrowFunctions */ false); + + switch (searchSpaceNode.kind) { + case SyntaxKind.FunctionExpression: + case SyntaxKind.FunctionDeclaration: + if (searchSpaceNode.symbol === container.symbol) { + result.push(getReferenceEntryFromNode(node)); + } + break; + case SyntaxKind.MethodDeclaration: + case SyntaxKind.MethodSignature: + if (isObjectLiteralMethod(searchSpaceNode) && searchSpaceNode.symbol === container.symbol) { + result.push(getReferenceEntryFromNode(node)); + } + break; + case SyntaxKind.ClassExpression: + case SyntaxKind.ClassDeclaration: + // Make sure the container belongs to the same class + // and has the appropriate static modifier from the original container. + if (container.parent && searchSpaceNode.symbol === container.parent.symbol && (getModifierFlags(container) & ModifierFlags.Static) === staticFlag) { + result.push(getReferenceEntryFromNode(node)); + } + break; + case SyntaxKind.SourceFile: + if (container.kind === SyntaxKind.SourceFile && !isExternalModule(container)) { + result.push(getReferenceEntryFromNode(node)); + } + break; + } + }); + } + } + + + function getReferencesForStringLiteral(node: StringLiteral, sourceFiles: SourceFile[]): ReferencedSymbol[] { + const type = getStringLiteralTypeForNode(node, typeChecker); + + if (!type) { + // nothing to do here. moving on + return undefined; + } + + const references: ReferenceEntry[] = []; + + for (const sourceFile of sourceFiles) { + const possiblePositions = getPossibleSymbolReferencePositions(sourceFile, type.text, sourceFile.getStart(), sourceFile.getEnd()); + getReferencesForStringLiteralInFile(sourceFile, type, possiblePositions, references); + } + + return [{ + definition: { + containerKind: "", + containerName: "", + fileName: node.getSourceFile().fileName, + kind: ScriptElementKind.variableElement, + name: type.text, + textSpan: createTextSpanFromBounds(node.getStart(), node.getEnd()), + displayParts: [displayPart(getTextOfNode(node), SymbolDisplayPartKind.stringLiteral)] + }, + references: references + }]; + + function getReferencesForStringLiteralInFile(sourceFile: SourceFile, searchType: Type, possiblePositions: number[], references: ReferenceEntry[]): void { + for (const position of possiblePositions) { + cancellationToken.throwIfCancellationRequested(); + + const node = getTouchingWord(sourceFile, position); + if (!node || node.kind !== SyntaxKind.StringLiteral) { + return; + } + + const type = getStringLiteralTypeForNode(node, typeChecker); + if (type === searchType) { + references.push(getReferenceEntryFromNode(node)); + } + } + } + } + + function populateSearchSymbolSet(symbol: Symbol, location: Node): Symbol[] { + // The search set contains at least the current symbol + let result = [symbol]; + + // If the location is name of property symbol from object literal destructuring pattern + // Search the property symbol + // for ( { property: p2 } of elems) { } + const containingObjectLiteralElement = getContainingObjectLiteralElement(location); + if (containingObjectLiteralElement && containingObjectLiteralElement.kind !== SyntaxKind.ShorthandPropertyAssignment) { + const propertySymbol = getPropertySymbolOfDestructuringAssignment(location); + if (propertySymbol) { + result.push(propertySymbol); + } + } + + // If the symbol is an alias, add what it aliases to the list + // import {a} from "mod"; + // export {a} + // If the symbol is an alias to default declaration, add what it aliases to the list + // declare "mod" { export default class B { } } + // import B from "mod"; + //// For export specifiers, the exported name can be referring to a local symbol, e.g.: + //// import {a} from "mod"; + //// export {a as somethingElse} + //// We want the *local* declaration of 'a' as declared in the import, + //// *not* as declared within "mod" (or farther) + const aliasSymbol = getAliasSymbolForPropertyNameSymbol(symbol, location); + if (aliasSymbol) { + result = result.concat(populateSearchSymbolSet(aliasSymbol, location)); + } + + // If the location is in a context sensitive location (i.e. in an object literal) try + // to get a contextual type for it, and add the property symbol from the contextual + // type to the search set + if (containingObjectLiteralElement) { + forEach(getPropertySymbolsFromContextualType(containingObjectLiteralElement), contextualSymbol => { + addRange(result, typeChecker.getRootSymbols(contextualSymbol)); + }); + + /* Because in short-hand property assignment, location has two meaning : property name and as value of the property + * When we do findAllReference at the position of the short-hand property assignment, we would want to have references to position of + * property name and variable declaration of the identifier. + * Like in below example, when querying for all references for an identifier 'name', of the property assignment, the language service + * should show both 'name' in 'obj' and 'name' in variable declaration + * const name = "Foo"; + * const obj = { name }; + * In order to do that, we will populate the search set with the value symbol of the identifier as a value of the property assignment + * so that when matching with potential reference symbol, both symbols from property declaration and variable declaration + * will be included correctly. + */ + const shorthandValueSymbol = typeChecker.getShorthandAssignmentValueSymbol(location.parent); + if (shorthandValueSymbol) { + result.push(shorthandValueSymbol); + } + } + + // If the symbol.valueDeclaration is a property parameter declaration, + // we should include both parameter declaration symbol and property declaration symbol + // Parameter Declaration symbol is only visible within function scope, so the symbol is stored in constructor.locals. + // Property Declaration symbol is a member of the class, so the symbol is stored in its class Declaration.symbol.members + if (symbol.valueDeclaration && symbol.valueDeclaration.kind === SyntaxKind.Parameter && + isParameterPropertyDeclaration(symbol.valueDeclaration)) { + result = result.concat(typeChecker.getSymbolsOfParameterPropertyDeclaration(symbol.valueDeclaration, symbol.name)); + } + + // If this is symbol of binding element without propertyName declaration in Object binding pattern + // Include the property in the search + const bindingElementPropertySymbol = getPropertySymbolOfObjectBindingPatternWithoutPropertyName(symbol); + if (bindingElementPropertySymbol) { + result.push(bindingElementPropertySymbol); + } + + // If this is a union property, add all the symbols from all its source symbols in all unioned types. + // If the symbol is an instantiation from a another symbol (e.g. widened symbol) , add the root the list + forEach(typeChecker.getRootSymbols(symbol), rootSymbol => { + if (rootSymbol !== symbol) { + result.push(rootSymbol); + } + + // Add symbol of properties/methods of the same name in base classes and implemented interfaces definitions + if (!implementations && rootSymbol.parent && rootSymbol.parent.flags & (SymbolFlags.Class | SymbolFlags.Interface)) { + getPropertySymbolsFromBaseTypes(rootSymbol.parent, rootSymbol.getName(), result, /*previousIterationSymbolsCache*/ createMap()); + } + }); + + return result; + } + + /** + * Find symbol of the given property-name and add the symbol to the given result array + * @param symbol a symbol to start searching for the given propertyName + * @param propertyName a name of property to search for + * @param result an array of symbol of found property symbols + * @param previousIterationSymbolsCache a cache of symbol from previous iterations of calling this function to prevent infinite revisiting of the same symbol. + * The value of previousIterationSymbol is undefined when the function is first called. + */ + function getPropertySymbolsFromBaseTypes(symbol: Symbol, propertyName: string, result: Symbol[], + previousIterationSymbolsCache: SymbolTable): void { + if (!symbol) { + return; + } + + // If the current symbol is the same as the previous-iteration symbol, we can just return the symbol that has already been visited + // This is particularly important for the following cases, so that we do not infinitely visit the same symbol. + // For example: + // interface C extends C { + // /*findRef*/propName: string; + // } + // The first time getPropertySymbolsFromBaseTypes is called when finding-all-references at propName, + // the symbol argument will be the symbol of an interface "C" and previousIterationSymbol is undefined, + // the function will add any found symbol of the property-name, then its sub-routine will call + // getPropertySymbolsFromBaseTypes again to walk up any base types to prevent revisiting already + // visited symbol, interface "C", the sub-routine will pass the current symbol as previousIterationSymbol. + if (symbol.name in previousIterationSymbolsCache) { + return; + } + + if (symbol.flags & (SymbolFlags.Class | SymbolFlags.Interface)) { + forEach(symbol.getDeclarations(), declaration => { + if (isClassLike(declaration)) { + getPropertySymbolFromTypeReference(getClassExtendsHeritageClauseElement(declaration)); + forEach(getClassImplementsHeritageClauseElements(declaration), getPropertySymbolFromTypeReference); + } + else if (declaration.kind === SyntaxKind.InterfaceDeclaration) { + forEach(getInterfaceBaseTypeNodes(declaration), getPropertySymbolFromTypeReference); + } + }); + } + return; + + function getPropertySymbolFromTypeReference(typeReference: ExpressionWithTypeArguments) { + if (typeReference) { + const type = typeChecker.getTypeAtLocation(typeReference); + if (type) { + const propertySymbol = typeChecker.getPropertyOfType(type, propertyName); + if (propertySymbol) { + result.push(...typeChecker.getRootSymbols(propertySymbol)); + } + + // Visit the typeReference as well to see if it directly or indirectly use that property + previousIterationSymbolsCache[symbol.name] = symbol; + getPropertySymbolsFromBaseTypes(type.symbol, propertyName, result, previousIterationSymbolsCache); + } + } + } + } + + function getRelatedSymbol(searchSymbols: Symbol[], referenceSymbol: Symbol, referenceLocation: Node, searchLocationIsConstructor: boolean, parents: Symbol[] | undefined, cache: Map): Symbol { + if (contains(searchSymbols, referenceSymbol)) { + // If we are searching for constructor uses, they must be 'new' expressions. + return (!searchLocationIsConstructor || isNewExpressionTarget(referenceLocation)) && referenceSymbol; + } + + // If the reference symbol is an alias, check if what it is aliasing is one of the search + // symbols but by looking up for related symbol of this alias so it can handle multiple level of indirectness. + const aliasSymbol = getAliasSymbolForPropertyNameSymbol(referenceSymbol, referenceLocation); + if (aliasSymbol) { + return getRelatedSymbol(searchSymbols, aliasSymbol, referenceLocation, searchLocationIsConstructor, parents, cache); + } + + // If the reference location is in an object literal, try to get the contextual type for the + // object literal, lookup the property symbol in the contextual type, and use this symbol to + // compare to our searchSymbol + const containingObjectLiteralElement = getContainingObjectLiteralElement(referenceLocation); + if (containingObjectLiteralElement) { + const contextualSymbol = forEach(getPropertySymbolsFromContextualType(containingObjectLiteralElement), contextualSymbol => { + return forEach(typeChecker.getRootSymbols(contextualSymbol), s => searchSymbols.indexOf(s) >= 0 ? s : undefined); + }); + + if (contextualSymbol) { + return contextualSymbol; + } + + // If the reference location is the name of property from object literal destructuring pattern + // Get the property symbol from the object literal's type and look if thats the search symbol + // In below eg. get 'property' from type of elems iterating type + // for ( { property: p2 } of elems) { } + const propertySymbol = getPropertySymbolOfDestructuringAssignment(referenceLocation); + if (propertySymbol && searchSymbols.indexOf(propertySymbol) >= 0) { + return propertySymbol; + } + } + + // If the reference location is the binding element and doesn't have property name + // then include the binding element in the related symbols + // let { a } : { a }; + const bindingElementPropertySymbol = getPropertySymbolOfObjectBindingPatternWithoutPropertyName(referenceSymbol); + if (bindingElementPropertySymbol && searchSymbols.indexOf(bindingElementPropertySymbol) >= 0) { + return bindingElementPropertySymbol; + } + + // Unwrap symbols to get to the root (e.g. transient symbols as a result of widening) + // Or a union property, use its underlying unioned symbols + return forEach(typeChecker.getRootSymbols(referenceSymbol), rootSymbol => { + // if it is in the list, then we are done + if (searchSymbols.indexOf(rootSymbol) >= 0) { + return rootSymbol; + } + + // Finally, try all properties with the same name in any type the containing type extended or implemented, and + // see if any is in the list. If we were passed a parent symbol, only include types that are subtypes of the + // parent symbol + if (rootSymbol.parent && rootSymbol.parent.flags & (SymbolFlags.Class | SymbolFlags.Interface)) { + // Parents will only be defined if implementations is true + if (parents) { + if (!forEach(parents, parent => explicitlyInheritsFrom(rootSymbol.parent, parent, cache))) { + return undefined; + } + } + + const result: Symbol[] = []; + getPropertySymbolsFromBaseTypes(rootSymbol.parent, rootSymbol.getName(), result, /*previousIterationSymbolsCache*/ createMap()); + return forEach(result, s => searchSymbols.indexOf(s) >= 0 ? s : undefined); + } + + return undefined; + }); + } + + function getNameFromObjectLiteralElement(node: ObjectLiteralElement) { + if (node.name.kind === SyntaxKind.ComputedPropertyName) { + const nameExpression = (node.name).expression; + // treat computed property names where expression is string/numeric literal as just string/numeric literal + if (isStringOrNumericLiteral(nameExpression.kind)) { + return (nameExpression).text; + } + return undefined; + } + return (node.name).text; + } + + function getPropertySymbolsFromContextualType(node: ObjectLiteralElement): Symbol[] { + const objectLiteral = node.parent; + const contextualType = typeChecker.getContextualType(objectLiteral); + const name = getNameFromObjectLiteralElement(node); + if (name && contextualType) { + const result: Symbol[] = []; + const symbol = contextualType.getProperty(name); + if (symbol) { + result.push(symbol); + } + + if (contextualType.flags & TypeFlags.Union) { + forEach((contextualType).types, t => { + const symbol = t.getProperty(name); + if (symbol) { + result.push(symbol); + } + }); + } + return result; + } + return undefined; + } + + /** Given an initial searchMeaning, extracted from a location, widen the search scope based on the declarations + * of the corresponding symbol. e.g. if we are searching for "Foo" in value position, but "Foo" references a class + * then we need to widen the search to include type positions as well. + * On the contrary, if we are searching for "Bar" in type position and we trace bar to an interface, and an uninstantiated + * module, we want to keep the search limited to only types, as the two declarations (interface and uninstantiated module) + * do not intersect in any of the three spaces. + */ + function getIntersectingMeaningFromDeclarations(meaning: SemanticMeaning, declarations: Declaration[]): SemanticMeaning { + if (declarations) { + let lastIterationMeaning: SemanticMeaning; + do { + // The result is order-sensitive, for instance if initialMeaning === Namespace, and declarations = [class, instantiated module] + // we need to consider both as they initialMeaning intersects with the module in the namespace space, and the module + // intersects with the class in the value space. + // To achieve that we will keep iterating until the result stabilizes. + + // Remember the last meaning + lastIterationMeaning = meaning; + + for (const declaration of declarations) { + const declarationMeaning = getMeaningFromDeclaration(declaration); + + if (declarationMeaning & meaning) { + meaning |= declarationMeaning; + } + } + } + while (meaning !== lastIterationMeaning); + } + return meaning; + } + } + + export function convertReferences(referenceSymbols: ReferencedSymbol[]): ReferenceEntry[] { + if (!referenceSymbols) { + return undefined; + } + + const referenceEntries: ReferenceEntry[] = []; + + for (const referenceSymbol of referenceSymbols) { + addRange(referenceEntries, referenceSymbol.references); + } + + return referenceEntries; + } + + function isImplementation(node: Node): boolean { + if (!node) { + return false; + } + else if (isVariableLike(node)) { + if (node.initializer) { + return true; + } + else if (node.kind === SyntaxKind.VariableDeclaration) { + const parentStatement = getParentStatementOfVariableDeclaration(node); + return parentStatement && hasModifier(parentStatement, ModifierFlags.Ambient); + } + } + else if (isFunctionLike(node)) { + return !!node.body || hasModifier(node, ModifierFlags.Ambient); + } + else { + switch (node.kind) { + case SyntaxKind.ClassDeclaration: + case SyntaxKind.ClassExpression: + case SyntaxKind.EnumDeclaration: + case SyntaxKind.ModuleDeclaration: + return true; + } + } + return false; + } + + function getParentStatementOfVariableDeclaration(node: VariableDeclaration): VariableStatement { + if (node.parent && node.parent.parent && node.parent.parent.kind === SyntaxKind.VariableStatement) { + Debug.assert(node.parent.kind === SyntaxKind.VariableDeclarationList); + return node.parent.parent; + } + } + + export function getReferenceEntriesForShorthandPropertyAssignment(node: Node, typeChecker: TypeChecker, result: ReferenceEntry[]): void { + const refSymbol = typeChecker.getSymbolAtLocation(node); + const shorthandSymbol = typeChecker.getShorthandAssignmentValueSymbol(refSymbol.valueDeclaration); + + if (shorthandSymbol) { + for (const declaration of shorthandSymbol.getDeclarations()) { + if (getMeaningFromDeclaration(declaration) & SemanticMeaning.Value) { + result.push(getReferenceEntryFromNode(declaration)); + } + } + } + } + + export function getReferenceEntryFromNode(node: Node): ReferenceEntry { + let start = node.getStart(); + let end = node.getEnd(); + + if (node.kind === SyntaxKind.StringLiteral) { + start += 1; + end -= 1; + } + + return { + fileName: node.getSourceFile().fileName, + textSpan: createTextSpanFromBounds(start, end), + isWriteAccess: isWriteAccess(node), + isDefinition: isDeclarationName(node) || isLiteralComputedPropertyDeclarationName(node) + }; + } + + /** A node is considered a writeAccess iff it is a name of a declaration or a target of an assignment */ + function isWriteAccess(node: Node): boolean { + if (node.kind === SyntaxKind.Identifier && isDeclarationName(node)) { + return true; + } + + const parent = node.parent; + if (parent) { + if (parent.kind === SyntaxKind.PostfixUnaryExpression || parent.kind === SyntaxKind.PrefixUnaryExpression) { + return true; + } + else if (parent.kind === SyntaxKind.BinaryExpression && (parent).left === node) { + const operator = (parent).operatorToken.kind; + return SyntaxKind.FirstAssignment <= operator && operator <= SyntaxKind.LastAssignment; + } + } + + return false; + } + + function forEachDescendantOfKind(node: Node, kind: SyntaxKind, action: (node: Node) => void) { + forEachChild(node, child => { + if (child.kind === kind) { + action(child); + } + forEachDescendantOfKind(child, kind, action); + }); + } + + /** + * Returns the containing object literal property declaration given a possible name node, e.g. "a" in x = { "a": 1 } + */ + function getContainingObjectLiteralElement(node: Node): ObjectLiteralElement { + switch (node.kind) { + case SyntaxKind.StringLiteral: + case SyntaxKind.NumericLiteral: + if (node.parent.kind === SyntaxKind.ComputedPropertyName) { + return isObjectLiteralPropertyDeclaration(node.parent.parent) ? node.parent.parent : undefined; + } + // intential fall through + case SyntaxKind.Identifier: + return isObjectLiteralPropertyDeclaration(node.parent) && node.parent.name === node ? node.parent : undefined; + } + return undefined; + } + + function isObjectLiteralPropertyDeclaration(node: Node): node is ObjectLiteralElement { + switch (node.kind) { + case SyntaxKind.PropertyAssignment: + case SyntaxKind.ShorthandPropertyAssignment: + case SyntaxKind.MethodDeclaration: + case SyntaxKind.GetAccessor: + case SyntaxKind.SetAccessor: + return true; + } + return false; + } + + /** Get `C` given `N` if `N` is in the position `class C extends N` or `class C extends foo.N` where `N` is an identifier. */ + function tryGetClassByExtendingIdentifier(node: Node): ClassLikeDeclaration | undefined { + return tryGetClassExtendingExpressionWithTypeArguments(climbPastPropertyAccess(node).parent); + } + + function isNameOfExternalModuleImportOrDeclaration(node: Node): boolean { + if (node.kind === SyntaxKind.StringLiteral) { + return isNameOfModuleDeclaration(node) || isExpressionOfExternalModuleImportEqualsDeclaration(node); + } + + return false; + } +} diff --git a/src/services/formatting/rules.ts b/src/services/formatting/rules.ts index 17ee9d435bf..2095f062bd1 100644 --- a/src/services/formatting/rules.ts +++ b/src/services/formatting/rules.ts @@ -138,7 +138,6 @@ namespace ts.formatting { public NoSpaceAfterOpenAngularBracket: Rule; public NoSpaceBeforeCloseAngularBracket: Rule; public NoSpaceAfterCloseAngularBracket: Rule; - public NoSpaceAfterTypeAssertion: Rule; // Remove spaces in empty interface literals. e.g.: x: {} public NoSpaceBetweenEmptyInterfaceBraceBrackets: Rule; @@ -240,6 +239,10 @@ namespace ts.formatting { public NoSpaceBeforeEqualInJsxAttribute: Rule; public NoSpaceAfterEqualInJsxAttribute: Rule; + // No space after type assertions + public NoSpaceAfterTypeAssertion: Rule; + public SpaceAfterTypeAssertion: Rule; + constructor() { /// /// Common Rules @@ -375,7 +378,6 @@ namespace ts.formatting { this.NoSpaceAfterOpenAngularBracket = new Rule(RuleDescriptor.create3(SyntaxKind.LessThanToken, Shared.TokenRange.Any), RuleOperation.create2(new RuleOperationContext(Rules.IsNonJsxSameLineTokenContext, Rules.IsTypeArgumentOrParameterOrAssertionContext), RuleAction.Delete)); this.NoSpaceBeforeCloseAngularBracket = new Rule(RuleDescriptor.create2(Shared.TokenRange.Any, SyntaxKind.GreaterThanToken), RuleOperation.create2(new RuleOperationContext(Rules.IsNonJsxSameLineTokenContext, Rules.IsTypeArgumentOrParameterOrAssertionContext), RuleAction.Delete)); this.NoSpaceAfterCloseAngularBracket = new Rule(RuleDescriptor.create3(SyntaxKind.GreaterThanToken, Shared.TokenRange.FromTokens([SyntaxKind.OpenParenToken, SyntaxKind.OpenBracketToken, SyntaxKind.GreaterThanToken, SyntaxKind.CommaToken])), RuleOperation.create2(new RuleOperationContext(Rules.IsNonJsxSameLineTokenContext, Rules.IsTypeArgumentOrParameterOrAssertionContext), RuleAction.Delete)); - this.NoSpaceAfterTypeAssertion = new Rule(RuleDescriptor.create3(SyntaxKind.GreaterThanToken, Shared.TokenRange.Any), RuleOperation.create2(new RuleOperationContext(Rules.IsNonJsxSameLineTokenContext, Rules.IsTypeAssertionContext), RuleAction.Delete)); // Remove spaces in empty interface literals. e.g.: x: {} this.NoSpaceBetweenEmptyInterfaceBraceBrackets = new Rule(RuleDescriptor.create1(SyntaxKind.OpenBraceToken, SyntaxKind.CloseBraceToken), RuleOperation.create2(new RuleOperationContext(Rules.IsNonJsxSameLineTokenContext, Rules.IsObjectTypeContext), RuleAction.Delete)); @@ -447,7 +449,6 @@ namespace ts.formatting { this.NoSpaceAfterOpenAngularBracket, this.NoSpaceBeforeCloseAngularBracket, this.NoSpaceAfterCloseAngularBracket, - this.NoSpaceAfterTypeAssertion, this.SpaceBeforeAt, this.NoSpaceAfterAt, this.SpaceAfterDecorator, @@ -526,6 +527,11 @@ namespace ts.formatting { // Insert space after function keyword for anonymous functions this.SpaceAfterAnonymousFunctionKeyword = new Rule(RuleDescriptor.create1(SyntaxKind.FunctionKeyword, SyntaxKind.OpenParenToken), RuleOperation.create2(new RuleOperationContext(Rules.IsFunctionDeclContext), RuleAction.Space)); this.NoSpaceAfterAnonymousFunctionKeyword = new Rule(RuleDescriptor.create1(SyntaxKind.FunctionKeyword, SyntaxKind.OpenParenToken), RuleOperation.create2(new RuleOperationContext(Rules.IsFunctionDeclContext), RuleAction.Delete)); + + // No space after type assertion + this.NoSpaceAfterTypeAssertion = new Rule(RuleDescriptor.create3(SyntaxKind.GreaterThanToken, Shared.TokenRange.Any), RuleOperation.create2(new RuleOperationContext(Rules.IsNonJsxSameLineTokenContext, Rules.IsTypeAssertionContext), RuleAction.Delete)); + this.SpaceAfterTypeAssertion = new Rule(RuleDescriptor.create3(SyntaxKind.GreaterThanToken, Shared.TokenRange.Any), RuleOperation.create2(new RuleOperationContext(Rules.IsNonJsxSameLineTokenContext, Rules.IsTypeAssertionContext), RuleAction.Space)); + } /// diff --git a/src/services/formatting/rulesProvider.ts b/src/services/formatting/rulesProvider.ts index b885accaf5e..eac99ce2b28 100644 --- a/src/services/formatting/rulesProvider.ts +++ b/src/services/formatting/rulesProvider.ts @@ -137,9 +137,16 @@ namespace ts.formatting { rules.push(this.globalRules.NewLineBeforeOpenBraceInTypeScriptDeclWithBlock); } + if (options.InsertSpaceAfterTypeAssertion) { + rules.push(this.globalRules.SpaceAfterTypeAssertion); + } + else { + rules.push(this.globalRules.NoSpaceAfterTypeAssertion); + } + rules = rules.concat(this.globalRules.LowPriorityCommonRules); return rules; } } -} \ No newline at end of file +} diff --git a/src/services/goToDefinition.ts b/src/services/goToDefinition.ts new file mode 100644 index 00000000000..4c005640d6a --- /dev/null +++ b/src/services/goToDefinition.ts @@ -0,0 +1,256 @@ +/* @internal */ +namespace ts.GoToDefinition { + export function getDefinitionAtPosition(program: Program, sourceFile: SourceFile, position: number): DefinitionInfo[] { + /// Triple slash reference comments + const comment = findReferenceInPosition(sourceFile.referencedFiles, position); + if (comment) { + const referenceFile = tryResolveScriptReference(program, sourceFile, comment); + if (referenceFile) { + return [getDefinitionInfoForFileReference(comment.fileName, referenceFile.fileName)]; + } + return undefined; + } + + // Type reference directives + const typeReferenceDirective = findReferenceInPosition(sourceFile.typeReferenceDirectives, position); + if (typeReferenceDirective) { + const referenceFile = program.getResolvedTypeReferenceDirectives()[typeReferenceDirective.fileName]; + if (referenceFile && referenceFile.resolvedFileName) { + return [getDefinitionInfoForFileReference(typeReferenceDirective.fileName, referenceFile.resolvedFileName)]; + } + return undefined; + } + + const node = getTouchingPropertyName(sourceFile, position); + if (node === sourceFile) { + return undefined; + } + + // Labels + if (isJumpStatementTarget(node)) { + const labelName = (node).text; + const label = getTargetLabel((node.parent), (node).text); + return label ? [createDefinitionInfo(label, ScriptElementKind.label, labelName, /*containerName*/ undefined)] : undefined; + } + + const typeChecker = program.getTypeChecker(); + + const calledDeclaration = tryGetSignatureDeclaration(typeChecker, node); + if (calledDeclaration) { + return [createDefinitionFromSignatureDeclaration(typeChecker, calledDeclaration)]; + } + + let symbol = typeChecker.getSymbolAtLocation(node); + + // Could not find a symbol e.g. node is string or number keyword, + // or the symbol was an internal symbol and does not have a declaration e.g. undefined symbol + if (!symbol) { + return undefined; + } + + // If this is an alias, and the request came at the declaration location + // get the aliased symbol instead. This allows for goto def on an import e.g. + // import {A, B} from "mod"; + // to jump to the implementation directly. + if (symbol.flags & SymbolFlags.Alias) { + const declaration = symbol.declarations[0]; + + // Go to the original declaration for cases: + // + // (1) when the aliased symbol was declared in the location(parent). + // (2) when the aliased symbol is originating from a named import. + // + if (node.kind === SyntaxKind.Identifier && + (node.parent === declaration || + (declaration.kind === SyntaxKind.ImportSpecifier && declaration.parent && declaration.parent.kind === SyntaxKind.NamedImports))) { + + symbol = typeChecker.getAliasedSymbol(symbol); + } + } + + // Because name in short-hand property assignment has two different meanings: property name and property value, + // using go-to-definition at such position should go to the variable declaration of the property value rather than + // go to the declaration of the property name (in this case stay at the same position). However, if go-to-definition + // is performed at the location of property access, we would like to go to definition of the property in the short-hand + // assignment. This case and others are handled by the following code. + if (node.parent.kind === SyntaxKind.ShorthandPropertyAssignment) { + const shorthandSymbol = typeChecker.getShorthandAssignmentValueSymbol(symbol.valueDeclaration); + if (!shorthandSymbol) { + return []; + } + + const shorthandDeclarations = shorthandSymbol.getDeclarations(); + const shorthandSymbolKind = SymbolDisplay.getSymbolKind(typeChecker, shorthandSymbol, node); + const shorthandSymbolName = typeChecker.symbolToString(shorthandSymbol); + const shorthandContainerName = typeChecker.symbolToString(symbol.parent, node); + return map(shorthandDeclarations, + declaration => createDefinitionInfo(declaration, shorthandSymbolKind, shorthandSymbolName, shorthandContainerName)); + } + + return getDefinitionFromSymbol(typeChecker, symbol, node); + } + + /// Goto type + export function getTypeDefinitionAtPosition(typeChecker: TypeChecker, sourceFile: SourceFile, position: number): DefinitionInfo[] { + const node = getTouchingPropertyName(sourceFile, position); + if (node === sourceFile) { + return undefined; + } + + const symbol = typeChecker.getSymbolAtLocation(node); + if (!symbol) { + return undefined; + } + + const type = typeChecker.getTypeOfSymbolAtLocation(symbol, node); + if (!type) { + return undefined; + } + + if (type.flags & TypeFlags.Union && !(type.flags & TypeFlags.Enum)) { + const result: DefinitionInfo[] = []; + forEach((type).types, t => { + if (t.symbol) { + addRange(/*to*/ result, /*from*/ getDefinitionFromSymbol(typeChecker, t.symbol, node)); + } + }); + return result; + } + + if (!type.symbol) { + return undefined; + } + + return getDefinitionFromSymbol(typeChecker, type.symbol, node); + } + + function getDefinitionFromSymbol(typeChecker: TypeChecker, symbol: Symbol, node: Node): DefinitionInfo[] { + const result: DefinitionInfo[] = []; + const declarations = symbol.getDeclarations(); + const { symbolName, symbolKind, containerName } = getSymbolInfo(typeChecker, symbol, node); + + if (!tryAddConstructSignature(symbol, node, symbolKind, symbolName, containerName, result) && + !tryAddCallSignature(symbol, node, symbolKind, symbolName, containerName, result)) { + // Just add all the declarations. + forEach(declarations, declaration => { + result.push(createDefinitionInfo(declaration, symbolKind, symbolName, containerName)); + }); + } + + return result; + + function tryAddConstructSignature(symbol: Symbol, location: Node, symbolKind: string, symbolName: string, containerName: string, result: DefinitionInfo[]) { + // Applicable only if we are in a new expression, or we are on a constructor declaration + // and in either case the symbol has a construct signature definition, i.e. class + if (isNewExpressionTarget(location) || location.kind === SyntaxKind.ConstructorKeyword) { + if (symbol.flags & SymbolFlags.Class) { + // Find the first class-like declaration and try to get the construct signature. + for (const declaration of symbol.getDeclarations()) { + if (isClassLike(declaration)) { + return tryAddSignature(declaration.members, + /*selectConstructors*/ true, + symbolKind, + symbolName, + containerName, + result); + } + } + + Debug.fail("Expected declaration to have at least one class-like declaration"); + } + } + return false; + } + + function tryAddCallSignature(symbol: Symbol, location: Node, symbolKind: string, symbolName: string, containerName: string, result: DefinitionInfo[]) { + if (isCallExpressionTarget(location) || isNewExpressionTarget(location) || isNameOfFunctionDeclaration(location)) { + return tryAddSignature(symbol.declarations, /*selectConstructors*/ false, symbolKind, symbolName, containerName, result); + } + return false; + } + + function tryAddSignature(signatureDeclarations: Declaration[], selectConstructors: boolean, symbolKind: string, symbolName: string, containerName: string, result: DefinitionInfo[]) { + const declarations: Declaration[] = []; + let definition: Declaration; + + forEach(signatureDeclarations, d => { + if ((selectConstructors && d.kind === SyntaxKind.Constructor) || + (!selectConstructors && (d.kind === SyntaxKind.FunctionDeclaration || d.kind === SyntaxKind.MethodDeclaration || d.kind === SyntaxKind.MethodSignature))) { + declarations.push(d); + if ((d).body) definition = d; + } + }); + + if (definition) { + result.push(createDefinitionInfo(definition, symbolKind, symbolName, containerName)); + return true; + } + else if (declarations.length) { + result.push(createDefinitionInfo(lastOrUndefined(declarations), symbolKind, symbolName, containerName)); + return true; + } + + return false; + } + } + + function createDefinitionInfo(node: Node, symbolKind: string, symbolName: string, containerName: string): DefinitionInfo { + return { + fileName: node.getSourceFile().fileName, + textSpan: createTextSpanFromBounds(node.getStart(), node.getEnd()), + kind: symbolKind, + name: symbolName, + containerKind: undefined, + containerName + }; + } + + function getSymbolInfo(typeChecker: TypeChecker, symbol: Symbol, node: Node) { + return { + symbolName: typeChecker.symbolToString(symbol), // Do not get scoped name, just the name of the symbol + symbolKind: SymbolDisplay.getSymbolKind(typeChecker, symbol, node), + containerName: symbol.parent ? typeChecker.symbolToString(symbol.parent, node) : "" + }; + } + + function createDefinitionFromSignatureDeclaration(typeChecker: TypeChecker, decl: SignatureDeclaration): DefinitionInfo { + const { symbolName, symbolKind, containerName } = getSymbolInfo(typeChecker, decl.symbol, decl); + return createDefinitionInfo(decl, symbolKind, symbolName, containerName); + } + + function findReferenceInPosition(refs: FileReference[], pos: number): FileReference { + for (const ref of refs) { + if (ref.pos <= pos && pos < ref.end) { + return ref; + } + } + return undefined; + } + + function getDefinitionInfoForFileReference(name: string, targetFileName: string): DefinitionInfo { + return { + fileName: targetFileName, + textSpan: createTextSpanFromBounds(0, 0), + kind: ScriptElementKind.scriptElement, + name: name, + containerName: undefined, + containerKind: undefined + }; + } + + /** Returns a CallLikeExpression where `node` is the target being invoked. */ + function getAncestorCallLikeExpression(node: Node): CallLikeExpression | undefined { + const target = climbPastManyPropertyAccesses(node); + const callLike = target.parent; + return callLike && isCallLikeExpression(callLike) && getInvokedExpression(callLike) === target && callLike; + } + + function climbPastManyPropertyAccesses(node: Node): Node { + return isRightSideOfPropertyAccess(node) ? climbPastManyPropertyAccesses(node.parent) : node; + } + + function tryGetSignatureDeclaration(typeChecker: TypeChecker, node: Node): SignatureDeclaration | undefined { + const callLike = getAncestorCallLikeExpression(node); + return callLike && typeChecker.getResolvedSignature(callLike).declaration; + } +} diff --git a/src/services/goToImplementation.ts b/src/services/goToImplementation.ts new file mode 100644 index 00000000000..48c0791eb04 --- /dev/null +++ b/src/services/goToImplementation.ts @@ -0,0 +1,27 @@ +/* @internal */ +namespace ts.GoToImplementation { + export function getImplementationAtPosition(typeChecker: TypeChecker, cancellationToken: CancellationToken, sourceFiles: SourceFile[], node: Node): ImplementationLocation[] { + // If invoked directly on a shorthand property assignment, then return + // the declaration of the symbol being assigned (not the symbol being assigned to). + if (node.parent.kind === SyntaxKind.ShorthandPropertyAssignment) { + const result: ReferenceEntry[] = []; + FindAllReferences.getReferenceEntriesForShorthandPropertyAssignment(node, typeChecker, result); + return result.length > 0 ? result : undefined; + } + else if (node.kind === SyntaxKind.SuperKeyword || isSuperProperty(node.parent)) { + // References to and accesses on the super keyword only have one possible implementation, so no + // need to "Find all References" + const symbol = typeChecker.getSymbolAtLocation(node); + return symbol.valueDeclaration && [FindAllReferences.getReferenceEntryFromNode(symbol.valueDeclaration)]; + } + else { + // Perform "Find all References" and retrieve only those that are implementations + const referencedSymbols = FindAllReferences.getReferencedSymbolsForNode(typeChecker, cancellationToken, + node, sourceFiles, /*findInStrings*/false, /*findInComments*/false, /*implementations*/true); + const result = flatMap(referencedSymbols, symbol => + map(symbol.references, ({ textSpan, fileName }) => ({ textSpan, fileName }))); + + return result && result.length > 0 ? result : undefined; + } + } +} diff --git a/src/services/jsDoc.ts b/src/services/jsDoc.ts new file mode 100644 index 00000000000..f40a8013426 --- /dev/null +++ b/src/services/jsDoc.ts @@ -0,0 +1,545 @@ +/* @internal */ +namespace ts.JsDoc { + const jsDocTagNames = [ + "augments", + "author", + "argument", + "borrows", + "class", + "constant", + "constructor", + "constructs", + "default", + "deprecated", + "description", + "event", + "example", + "extends", + "field", + "fileOverview", + "function", + "ignore", + "inner", + "lends", + "link", + "memberOf", + "name", + "namespace", + "param", + "private", + "property", + "public", + "requires", + "returns", + "see", + "since", + "static", + "throws", + "type", + "typedef", + "property", + "prop", + "version" + ]; + let jsDocCompletionEntries: CompletionEntry[]; + + export function getJsDocCommentsFromDeclarations(declarations: Declaration[], name: string, canUseParsedParamTagComments: boolean) { + const documentationComment = []; + const docComments = getJsDocCommentsSeparatedByNewLines(); + ts.forEach(docComments, docComment => { + if (documentationComment.length) { + documentationComment.push(lineBreakPart()); + } + documentationComment.push(docComment); + }); + + return documentationComment; + + function getJsDocCommentsSeparatedByNewLines() { + const paramTag = "@param"; + const jsDocCommentParts: SymbolDisplayPart[] = []; + + ts.forEach(declarations, (declaration, indexOfDeclaration) => { + // Make sure we are collecting doc comment from declaration once, + // In case of union property there might be same declaration multiple times + // which only varies in type parameter + // Eg. const a: Array | Array; a.length + // The property length will have two declarations of property length coming + // from Array - Array and Array + if (indexOf(declarations, declaration) === indexOfDeclaration) { + const sourceFileOfDeclaration = getSourceFileOfNode(declaration); + // If it is parameter - try and get the jsDoc comment with @param tag from function declaration's jsDoc comments + if (canUseParsedParamTagComments && declaration.kind === SyntaxKind.Parameter) { + if ((declaration.parent.kind === SyntaxKind.FunctionExpression || declaration.parent.kind === SyntaxKind.ArrowFunction) && + declaration.parent.parent.kind === SyntaxKind.VariableDeclaration) { + addCommentParts(declaration.parent.parent.parent, sourceFileOfDeclaration, getCleanedParamJsDocComment); + } + addCommentParts(declaration.parent, sourceFileOfDeclaration, getCleanedParamJsDocComment); + } + + // If this is left side of dotted module declaration, there is no doc comments associated with this node + if (declaration.kind === SyntaxKind.ModuleDeclaration && (declaration).body && (declaration).body.kind === SyntaxKind.ModuleDeclaration) { + return; + } + + if ((declaration.kind === SyntaxKind.FunctionExpression || declaration.kind === SyntaxKind.ArrowFunction) && + declaration.parent.kind === SyntaxKind.VariableDeclaration) { + addCommentParts(declaration.parent.parent, sourceFileOfDeclaration, getCleanedJsDocComment); + } + + // If this is dotted module name, get the doc comments from the parent + while (declaration.kind === SyntaxKind.ModuleDeclaration && declaration.parent.kind === SyntaxKind.ModuleDeclaration) { + declaration = declaration.parent; + } + addCommentParts(declaration.kind === SyntaxKind.VariableDeclaration ? declaration.parent.parent : declaration, + sourceFileOfDeclaration, + getCleanedJsDocComment); + + if (declaration.kind === SyntaxKind.VariableDeclaration) { + const init = (declaration as VariableDeclaration).initializer; + if (init && (init.kind === SyntaxKind.FunctionExpression || init.kind === SyntaxKind.ArrowFunction)) { + // Get the cleaned js doc comment text from the initializer + addCommentParts(init, sourceFileOfDeclaration, getCleanedJsDocComment); + } + } + } + }); + + return jsDocCommentParts; + + function addCommentParts(commented: Node, + sourceFileOfDeclaration: SourceFile, + getCommentPart: (pos: number, end: number, file: SourceFile) => SymbolDisplayPart[]): void { + const ranges = getJsDocCommentTextRange(commented, sourceFileOfDeclaration); + // Get the cleaned js doc comment text from the declaration + ts.forEach(ranges, jsDocCommentTextRange => { + const cleanedComment = getCommentPart(jsDocCommentTextRange.pos, jsDocCommentTextRange.end, sourceFileOfDeclaration); + if (cleanedComment) { + addRange(jsDocCommentParts, cleanedComment); + } + }); + } + + function getJsDocCommentTextRange(node: Node, sourceFile: SourceFile): TextRange[] { + return ts.map(getJsDocComments(node, sourceFile), + jsDocComment => { + return { + pos: jsDocComment.pos + "/*".length, // Consume /* from the comment + end: jsDocComment.end - "*/".length // Trim off comment end indicator + }; + }); + } + + function consumeWhiteSpacesOnTheLine(pos: number, end: number, sourceFile: SourceFile, maxSpacesToRemove?: number) { + if (maxSpacesToRemove !== undefined) { + end = Math.min(end, pos + maxSpacesToRemove); + } + + for (; pos < end; pos++) { + const ch = sourceFile.text.charCodeAt(pos); + if (!isWhiteSpaceSingleLine(ch)) { + return pos; + } + } + + return end; + } + + function consumeLineBreaks(pos: number, end: number, sourceFile: SourceFile) { + while (pos < end && isLineBreak(sourceFile.text.charCodeAt(pos))) { + pos++; + } + + return pos; + } + + function isName(pos: number, end: number, sourceFile: SourceFile, name: string) { + return pos + name.length < end && + sourceFile.text.substr(pos, name.length) === name && + isWhiteSpace(sourceFile.text.charCodeAt(pos + name.length)); + } + + function isParamTag(pos: number, end: number, sourceFile: SourceFile) { + // If it is @param tag + return isName(pos, end, sourceFile, paramTag); + } + + function pushDocCommentLineText(docComments: SymbolDisplayPart[], text: string, blankLineCount: number) { + // Add the empty lines in between texts + while (blankLineCount) { + blankLineCount--; + docComments.push(textPart("")); + } + + docComments.push(textPart(text)); + } + + function getCleanedJsDocComment(pos: number, end: number, sourceFile: SourceFile) { + let spacesToRemoveAfterAsterisk: number; + const docComments: SymbolDisplayPart[] = []; + let blankLineCount = 0; + let isInParamTag = false; + + while (pos < end) { + let docCommentTextOfLine = ""; + // First consume leading white space + pos = consumeWhiteSpacesOnTheLine(pos, end, sourceFile); + + // If the comment starts with '*' consume the spaces on this line + if (pos < end && sourceFile.text.charCodeAt(pos) === CharacterCodes.asterisk) { + const lineStartPos = pos + 1; + pos = consumeWhiteSpacesOnTheLine(pos + 1, end, sourceFile, spacesToRemoveAfterAsterisk); + + // Set the spaces to remove after asterisk as margin if not already set + if (spacesToRemoveAfterAsterisk === undefined && pos < end && !isLineBreak(sourceFile.text.charCodeAt(pos))) { + spacesToRemoveAfterAsterisk = pos - lineStartPos; + } + } + else if (spacesToRemoveAfterAsterisk === undefined) { + spacesToRemoveAfterAsterisk = 0; + } + + // Analyze text on this line + while (pos < end && !isLineBreak(sourceFile.text.charCodeAt(pos))) { + const ch = sourceFile.text.charAt(pos); + if (ch === "@") { + // If it is @param tag + if (isParamTag(pos, end, sourceFile)) { + isInParamTag = true; + pos += paramTag.length; + continue; + } + else { + isInParamTag = false; + } + } + + // Add the ch to doc text if we arent in param tag + if (!isInParamTag) { + docCommentTextOfLine += ch; + } + + // Scan next character + pos++; + } + + // Continue with next line + pos = consumeLineBreaks(pos, end, sourceFile); + if (docCommentTextOfLine) { + pushDocCommentLineText(docComments, docCommentTextOfLine, blankLineCount); + blankLineCount = 0; + } + else if (!isInParamTag && docComments.length) { + // This is blank line when there is text already parsed + blankLineCount++; + } + } + + return docComments; + } + + function getCleanedParamJsDocComment(pos: number, end: number, sourceFile: SourceFile) { + let paramHelpStringMargin: number; + const paramDocComments: SymbolDisplayPart[] = []; + while (pos < end) { + if (isParamTag(pos, end, sourceFile)) { + let blankLineCount = 0; + let recordedParamTag = false; + // Consume leading spaces + pos = consumeWhiteSpaces(pos + paramTag.length); + if (pos >= end) { + break; + } + + // Ignore type expression + if (sourceFile.text.charCodeAt(pos) === CharacterCodes.openBrace) { + pos++; + for (let curlies = 1; pos < end; pos++) { + const charCode = sourceFile.text.charCodeAt(pos); + + // { character means we need to find another } to match the found one + if (charCode === CharacterCodes.openBrace) { + curlies++; + continue; + } + + // } char + if (charCode === CharacterCodes.closeBrace) { + curlies--; + if (curlies === 0) { + // We do not have any more } to match the type expression is ignored completely + pos++; + break; + } + else { + // there are more { to be matched with } + continue; + } + } + + // Found start of another tag + if (charCode === CharacterCodes.at) { + break; + } + } + + // Consume white spaces + pos = consumeWhiteSpaces(pos); + if (pos >= end) { + break; + } + } + + // Parameter name + if (isName(pos, end, sourceFile, name)) { + // Found the parameter we are looking for consume white spaces + pos = consumeWhiteSpaces(pos + name.length); + if (pos >= end) { + break; + } + + let paramHelpString = ""; + const firstLineParamHelpStringPos = pos; + while (pos < end) { + const ch = sourceFile.text.charCodeAt(pos); + + // at line break, set this comment line text and go to next line + if (isLineBreak(ch)) { + if (paramHelpString) { + pushDocCommentLineText(paramDocComments, paramHelpString, blankLineCount); + paramHelpString = ""; + blankLineCount = 0; + recordedParamTag = true; + } + else if (recordedParamTag) { + blankLineCount++; + } + + // Get the pos after cleaning start of the line + setPosForParamHelpStringOnNextLine(firstLineParamHelpStringPos); + continue; + } + + // Done scanning param help string - next tag found + if (ch === CharacterCodes.at) { + break; + } + + paramHelpString += sourceFile.text.charAt(pos); + + // Go to next character + pos++; + } + + // If there is param help text, add it top the doc comments + if (paramHelpString) { + pushDocCommentLineText(paramDocComments, paramHelpString, blankLineCount); + } + paramHelpStringMargin = undefined; + } + + // If this is the start of another tag, continue with the loop in search of param tag with symbol name + if (sourceFile.text.charCodeAt(pos) === CharacterCodes.at) { + continue; + } + } + + // Next character + pos++; + } + + return paramDocComments; + + function consumeWhiteSpaces(pos: number) { + while (pos < end && isWhiteSpaceSingleLine(sourceFile.text.charCodeAt(pos))) { + pos++; + } + + return pos; + } + + function setPosForParamHelpStringOnNextLine(firstLineParamHelpStringPos: number) { + // Get the pos after consuming line breaks + pos = consumeLineBreaks(pos, end, sourceFile); + if (pos >= end) { + return; + } + + if (paramHelpStringMargin === undefined) { + paramHelpStringMargin = sourceFile.getLineAndCharacterOfPosition(firstLineParamHelpStringPos).character; + } + + // Now consume white spaces max + const startOfLinePos = pos; + pos = consumeWhiteSpacesOnTheLine(pos, end, sourceFile, paramHelpStringMargin); + if (pos >= end) { + return; + } + + const consumedSpaces = pos - startOfLinePos; + if (consumedSpaces < paramHelpStringMargin) { + const ch = sourceFile.text.charCodeAt(pos); + if (ch === CharacterCodes.asterisk) { + // Consume more spaces after asterisk + pos = consumeWhiteSpacesOnTheLine(pos + 1, end, sourceFile, paramHelpStringMargin - consumedSpaces - 1); + } + } + } + } + } + } + + export function getAllJsDocCompletionEntries(): CompletionEntry[] { + return jsDocCompletionEntries || (jsDocCompletionEntries = ts.map(jsDocTagNames, tagName => { + return { + name: tagName, + kind: ScriptElementKind.keyword, + kindModifiers: "", + sortText: "0", + }; + })); + } + + /** + * Checks if position points to a valid position to add JSDoc comments, and if so, + * returns the appropriate template. Otherwise returns an empty string. + * Valid positions are + * - outside of comments, statements, and expressions, and + * - preceding a: + * - function/constructor/method declaration + * - class declarations + * - variable statements + * - namespace declarations + * + * Hosts should ideally check that: + * - The line is all whitespace up to 'position' before performing the insertion. + * - If the keystroke sequence "/\*\*" induced the call, we also check that the next + * non-whitespace character is '*', which (approximately) indicates whether we added + * the second '*' to complete an existing (JSDoc) comment. + * @param fileName The file in which to perform the check. + * @param position The (character-indexed) position in the file where the check should + * be performed. + */ + export function getDocCommentTemplateAtPosition(newLine: string, sourceFile: SourceFile, position: number): TextInsertion { + // Check if in a context where we don't want to perform any insertion + if (isInString(sourceFile, position) || isInComment(sourceFile, position) || hasDocComment(sourceFile, position)) { + return undefined; + } + + const tokenAtPos = getTokenAtPosition(sourceFile, position); + const tokenStart = tokenAtPos.getStart(); + if (!tokenAtPos || tokenStart < position) { + return undefined; + } + + // TODO: add support for: + // - enums/enum members + // - interfaces + // - property declarations + // - potentially property assignments + let commentOwner: Node; + findOwner: for (commentOwner = tokenAtPos; commentOwner; commentOwner = commentOwner.parent) { + switch (commentOwner.kind) { + case SyntaxKind.FunctionDeclaration: + case SyntaxKind.MethodDeclaration: + case SyntaxKind.Constructor: + case SyntaxKind.ClassDeclaration: + case SyntaxKind.VariableStatement: + break findOwner; + case SyntaxKind.SourceFile: + return undefined; + case SyntaxKind.ModuleDeclaration: + // If in walking up the tree, we hit a a nested namespace declaration, + // then we must be somewhere within a dotted namespace name; however we don't + // want to give back a JSDoc template for the 'b' or 'c' in 'namespace a.b.c { }'. + if (commentOwner.parent.kind === SyntaxKind.ModuleDeclaration) { + return undefined; + } + break findOwner; + } + } + + if (!commentOwner || commentOwner.getStart() < position) { + return undefined; + } + + const parameters = getParametersForJsDocOwningNode(commentOwner); + const posLineAndChar = sourceFile.getLineAndCharacterOfPosition(position); + const lineStart = sourceFile.getLineStarts()[posLineAndChar.line]; + + const indentationStr = sourceFile.text.substr(lineStart, posLineAndChar.character); + + let docParams = ""; + for (let i = 0, numParams = parameters.length; i < numParams; i++) { + const currentName = parameters[i].name; + const paramName = currentName.kind === SyntaxKind.Identifier ? + (currentName).text : + "param" + i; + + docParams += `${indentationStr} * @param ${paramName}${newLine}`; + } + + // A doc comment consists of the following + // * The opening comment line + // * the first line (without a param) for the object's untagged info (this is also where the caret ends up) + // * the '@param'-tagged lines + // * TODO: other tags. + // * the closing comment line + // * if the caret was directly in front of the object, then we add an extra line and indentation. + const preamble = "/**" + newLine + + indentationStr + " * "; + const result = + preamble + newLine + + docParams + + indentationStr + " */" + + (tokenStart === position ? newLine + indentationStr : ""); + + return { newText: result, caretOffset: preamble.length }; + } + + function getParametersForJsDocOwningNode(commentOwner: Node): ParameterDeclaration[] { + if (isFunctionLike(commentOwner)) { + return commentOwner.parameters; + } + + if (commentOwner.kind === SyntaxKind.VariableStatement) { + const varStatement = commentOwner; + const varDeclarations = varStatement.declarationList.declarations; + + if (varDeclarations.length === 1 && varDeclarations[0].initializer) { + return getParametersFromRightHandSideOfAssignment(varDeclarations[0].initializer); + } + } + + return emptyArray; + } + + /** + * Digs into an an initializer or RHS operand of an assignment operation + * to get the parameters of an apt signature corresponding to a + * function expression or a class expression. + * + * @param rightHandSide the expression which may contain an appropriate set of parameters + * @returns the parameters of a signature found on the RHS if one exists; otherwise 'emptyArray'. + */ + function getParametersFromRightHandSideOfAssignment(rightHandSide: Expression): ParameterDeclaration[] { + while (rightHandSide.kind === SyntaxKind.ParenthesizedExpression) { + rightHandSide = (rightHandSide).expression; + } + + switch (rightHandSide.kind) { + case SyntaxKind.FunctionExpression: + case SyntaxKind.ArrowFunction: + return (rightHandSide).parameters; + case SyntaxKind.ClassExpression: + for (const member of (rightHandSide).members) { + if (member.kind === SyntaxKind.Constructor) { + return (member).parameters; + } + } + break; + } + + return emptyArray; + } +} diff --git a/src/services/navigateTo.ts b/src/services/navigateTo.ts index ccded188e61..a73a82db4b7 100644 --- a/src/services/navigateTo.ts +++ b/src/services/navigateTo.ts @@ -2,7 +2,7 @@ namespace ts.NavigateTo { type RawNavigateToItem = { name: string; fileName: string; matchKind: PatternMatchKind; isCaseSensitive: boolean; declaration: Declaration }; - export function getNavigateToItems(program: Program, checker: TypeChecker, cancellationToken: CancellationToken, searchValue: string, maxResultCount: number): NavigateToItem[] { + export function getNavigateToItems(sourceFiles: SourceFile[], checker: TypeChecker, cancellationToken: CancellationToken, searchValue: string, maxResultCount: number): NavigateToItem[] { const patternMatcher = createPatternMatcher(searchValue); let rawItems: RawNavigateToItem[] = []; @@ -10,7 +10,7 @@ namespace ts.NavigateTo { const baseSensitivity: Intl.CollatorOptions = { sensitivity: "base" }; // Search the declarations in all files and output matched NavigateToItem into array of NavigateToItem[] - forEach(program.getSourceFiles(), sourceFile => { + forEach(sourceFiles, sourceFile => { cancellationToken.throwIfCancellationRequested(); const nameToDeclarations = sourceFile.getNamedDeclarations(); diff --git a/src/services/preProcess.ts b/src/services/preProcess.ts new file mode 100644 index 00000000000..0f0702066e1 --- /dev/null +++ b/src/services/preProcess.ts @@ -0,0 +1,359 @@ +namespace ts { + export function preProcessFile(sourceText: string, readImportFiles = true, detectJavaScriptImports = false): PreProcessedFileInfo { + const referencedFiles: FileReference[] = []; + const typeReferenceDirectives: FileReference[] = []; + const importedFiles: FileReference[] = []; + let ambientExternalModules: { ref: FileReference, depth: number }[]; + let isNoDefaultLib = false; + let braceNesting = 0; + // assume that text represent an external module if it contains at least one top level import/export + // ambient modules that are found inside external modules are interpreted as module augmentations + let externalModule = false; + + function nextToken() { + const token = scanner.scan(); + if (token === SyntaxKind.OpenBraceToken) { + braceNesting++; + } + else if (token === SyntaxKind.CloseBraceToken) { + braceNesting--; + } + return token; + } + + function processTripleSlashDirectives(): void { + const commentRanges = getLeadingCommentRanges(sourceText, 0); + forEach(commentRanges, commentRange => { + const comment = sourceText.substring(commentRange.pos, commentRange.end); + const referencePathMatchResult = getFileReferenceFromReferencePath(comment, commentRange); + if (referencePathMatchResult) { + isNoDefaultLib = referencePathMatchResult.isNoDefaultLib; + const fileReference = referencePathMatchResult.fileReference; + if (fileReference) { + const collection = referencePathMatchResult.isTypeReferenceDirective + ? typeReferenceDirectives + : referencedFiles; + + collection.push(fileReference); + } + } + }); + } + + function getFileReference() { + const file = scanner.getTokenValue(); + const pos = scanner.getTokenPos(); + return { + fileName: file, + pos: pos, + end: pos + file.length + }; + } + + function recordAmbientExternalModule(): void { + if (!ambientExternalModules) { + ambientExternalModules = []; + } + ambientExternalModules.push({ ref: getFileReference(), depth: braceNesting }); + } + + function recordModuleName() { + importedFiles.push(getFileReference()); + + markAsExternalModuleIfTopLevel(); + } + + function markAsExternalModuleIfTopLevel() { + if (braceNesting === 0) { + externalModule = true; + } + } + + /** + * Returns true if at least one token was consumed from the stream + */ + function tryConsumeDeclare(): boolean { + let token = scanner.getToken(); + if (token === SyntaxKind.DeclareKeyword) { + // declare module "mod" + token = nextToken(); + if (token === SyntaxKind.ModuleKeyword) { + token = nextToken(); + if (token === SyntaxKind.StringLiteral) { + recordAmbientExternalModule(); + } + } + return true; + } + + return false; + } + + /** + * Returns true if at least one token was consumed from the stream + */ + function tryConsumeImport(): boolean { + let token = scanner.getToken(); + if (token === SyntaxKind.ImportKeyword) { + + token = nextToken(); + if (token === SyntaxKind.StringLiteral) { + // import "mod"; + recordModuleName(); + return true; + } + else { + if (token === SyntaxKind.Identifier || isKeyword(token)) { + token = nextToken(); + if (token === SyntaxKind.FromKeyword) { + token = nextToken(); + if (token === SyntaxKind.StringLiteral) { + // import d from "mod"; + recordModuleName(); + return true; + } + } + else if (token === SyntaxKind.EqualsToken) { + if (tryConsumeRequireCall(/*skipCurrentToken*/ true)) { + return true; + } + } + else if (token === SyntaxKind.CommaToken) { + // consume comma and keep going + token = nextToken(); + } + else { + // unknown syntax + return true; + } + } + + if (token === SyntaxKind.OpenBraceToken) { + token = nextToken(); + // consume "{ a as B, c, d as D}" clauses + // make sure that it stops on EOF + while (token !== SyntaxKind.CloseBraceToken && token !== SyntaxKind.EndOfFileToken) { + token = nextToken(); + } + + if (token === SyntaxKind.CloseBraceToken) { + token = nextToken(); + if (token === SyntaxKind.FromKeyword) { + token = nextToken(); + if (token === SyntaxKind.StringLiteral) { + // import {a as A} from "mod"; + // import d, {a, b as B} from "mod" + recordModuleName(); + } + } + } + } + else if (token === SyntaxKind.AsteriskToken) { + token = nextToken(); + if (token === SyntaxKind.AsKeyword) { + token = nextToken(); + if (token === SyntaxKind.Identifier || isKeyword(token)) { + token = nextToken(); + if (token === SyntaxKind.FromKeyword) { + token = nextToken(); + if (token === SyntaxKind.StringLiteral) { + // import * as NS from "mod" + // import d, * as NS from "mod" + recordModuleName(); + } + } + } + } + } + } + + return true; + } + + return false; + } + + function tryConsumeExport(): boolean { + let token = scanner.getToken(); + if (token === SyntaxKind.ExportKeyword) { + markAsExternalModuleIfTopLevel(); + token = nextToken(); + if (token === SyntaxKind.OpenBraceToken) { + token = nextToken(); + // consume "{ a as B, c, d as D}" clauses + // make sure it stops on EOF + while (token !== SyntaxKind.CloseBraceToken && token !== SyntaxKind.EndOfFileToken) { + token = nextToken(); + } + + if (token === SyntaxKind.CloseBraceToken) { + token = nextToken(); + if (token === SyntaxKind.FromKeyword) { + token = nextToken(); + if (token === SyntaxKind.StringLiteral) { + // export {a as A} from "mod"; + // export {a, b as B} from "mod" + recordModuleName(); + } + } + } + } + else if (token === SyntaxKind.AsteriskToken) { + token = nextToken(); + if (token === SyntaxKind.FromKeyword) { + token = nextToken(); + if (token === SyntaxKind.StringLiteral) { + // export * from "mod" + recordModuleName(); + } + } + } + else if (token === SyntaxKind.ImportKeyword) { + token = nextToken(); + if (token === SyntaxKind.Identifier || isKeyword(token)) { + token = nextToken(); + if (token === SyntaxKind.EqualsToken) { + if (tryConsumeRequireCall(/*skipCurrentToken*/ true)) { + return true; + } + } + } + } + + return true; + } + + return false; + } + + function tryConsumeRequireCall(skipCurrentToken: boolean): boolean { + let token = skipCurrentToken ? nextToken() : scanner.getToken(); + if (token === SyntaxKind.RequireKeyword) { + token = nextToken(); + if (token === SyntaxKind.OpenParenToken) { + token = nextToken(); + if (token === SyntaxKind.StringLiteral) { + // require("mod"); + recordModuleName(); + } + } + return true; + } + return false; + } + + function tryConsumeDefine(): boolean { + let token = scanner.getToken(); + if (token === SyntaxKind.Identifier && scanner.getTokenValue() === "define") { + token = nextToken(); + if (token !== SyntaxKind.OpenParenToken) { + return true; + } + + token = nextToken(); + if (token === SyntaxKind.StringLiteral) { + // looks like define ("modname", ... - skip string literal and comma + token = nextToken(); + if (token === SyntaxKind.CommaToken) { + token = nextToken(); + } + else { + // unexpected token + return true; + } + } + + // should be start of dependency list + if (token !== SyntaxKind.OpenBracketToken) { + return true; + } + + // skip open bracket + token = nextToken(); + let i = 0; + // scan until ']' or EOF + while (token !== SyntaxKind.CloseBracketToken && token !== SyntaxKind.EndOfFileToken) { + // record string literals as module names + if (token === SyntaxKind.StringLiteral) { + recordModuleName(); + i++; + } + + token = nextToken(); + } + return true; + + } + return false; + } + + function processImports(): void { + scanner.setText(sourceText); + nextToken(); + // Look for: + // import "mod"; + // import d from "mod" + // import {a as A } from "mod"; + // import * as NS from "mod" + // import d, {a, b as B} from "mod" + // import i = require("mod"); + // + // export * from "mod" + // export {a as b} from "mod" + // export import i = require("mod") + // (for JavaScript files) require("mod") + + while (true) { + if (scanner.getToken() === SyntaxKind.EndOfFileToken) { + break; + } + + // check if at least one of alternative have moved scanner forward + if (tryConsumeDeclare() || + tryConsumeImport() || + tryConsumeExport() || + (detectJavaScriptImports && (tryConsumeRequireCall(/*skipCurrentToken*/ false) || tryConsumeDefine()))) { + continue; + } + else { + nextToken(); + } + } + + scanner.setText(undefined); + } + + if (readImportFiles) { + processImports(); + } + processTripleSlashDirectives(); + if (externalModule) { + // for external modules module all nested ambient modules are augmentations + if (ambientExternalModules) { + // move all detected ambient modules to imported files since they need to be resolved + for (const decl of ambientExternalModules) { + importedFiles.push(decl.ref); + } + } + return { referencedFiles, typeReferenceDirectives, importedFiles, isLibFile: isNoDefaultLib, ambientExternalModules: undefined }; + } + else { + // for global scripts ambient modules still can have augmentations - look for ambient modules with depth > 0 + let ambientModuleNames: string[]; + if (ambientExternalModules) { + for (const decl of ambientExternalModules) { + if (decl.depth === 0) { + if (!ambientModuleNames) { + ambientModuleNames = []; + } + ambientModuleNames.push(decl.ref.fileName); + } + else { + importedFiles.push(decl.ref); + } + } + } + return { referencedFiles, typeReferenceDirectives, importedFiles, isLibFile: isNoDefaultLib, ambientExternalModules: ambientModuleNames }; + } + } +} diff --git a/src/services/rename.ts b/src/services/rename.ts new file mode 100644 index 00000000000..6f28e505f79 --- /dev/null +++ b/src/services/rename.ts @@ -0,0 +1,98 @@ +/* @internal */ +namespace ts.Rename { + export function getRenameInfo(typeChecker: TypeChecker, defaultLibFileName: string, getCanonicalFileName: (fileName: string) => string, sourceFile: SourceFile, position: number): RenameInfo { + const canonicalDefaultLibName = getCanonicalFileName(ts.normalizePath(defaultLibFileName)); + + const node = getTouchingWord(sourceFile, position, /*includeJsDocComment*/ true); + + if (node) { + if (node.kind === SyntaxKind.Identifier || + node.kind === SyntaxKind.StringLiteral || + isLiteralNameOfPropertyDeclarationOrIndexAccess(node) || + isThis(node)) { + const symbol = typeChecker.getSymbolAtLocation(node); + + // Only allow a symbol to be renamed if it actually has at least one declaration. + if (symbol) { + const declarations = symbol.getDeclarations(); + if (declarations && declarations.length > 0) { + // Disallow rename for elements that are defined in the standard TypeScript library. + if (forEach(declarations, isDefinedInLibraryFile)) { + return getRenameInfoError(getLocaleSpecificMessage(Diagnostics.You_cannot_rename_elements_that_are_defined_in_the_standard_TypeScript_library)); + } + + const displayName = stripQuotes(getDeclaredName(typeChecker, symbol, node)); + const kind = SymbolDisplay.getSymbolKind(typeChecker, symbol, node); + if (kind) { + return { + canRename: true, + kind, + displayName, + localizedErrorMessage: undefined, + fullDisplayName: typeChecker.getFullyQualifiedName(symbol), + kindModifiers: SymbolDisplay.getSymbolModifiers(symbol), + triggerSpan: createTriggerSpanForNode(node, sourceFile) + }; + } + } + } + else if (node.kind === SyntaxKind.StringLiteral) { + const type = getStringLiteralTypeForNode(node, typeChecker); + if (type) { + if (isDefinedInLibraryFile(node)) { + return getRenameInfoError(getLocaleSpecificMessage(Diagnostics.You_cannot_rename_elements_that_are_defined_in_the_standard_TypeScript_library)); + } + else { + const displayName = stripQuotes(type.text); + return { + canRename: true, + kind: ScriptElementKind.variableElement, + displayName, + localizedErrorMessage: undefined, + fullDisplayName: displayName, + kindModifiers: ScriptElementKindModifier.none, + triggerSpan: createTriggerSpanForNode(node, sourceFile) + }; + } + } + } + } + } + + return getRenameInfoError(getLocaleSpecificMessage(Diagnostics.You_cannot_rename_this_element)); + + function getRenameInfoError(localizedErrorMessage: string): RenameInfo { + return { + canRename: false, + localizedErrorMessage: localizedErrorMessage, + displayName: undefined, + fullDisplayName: undefined, + kind: undefined, + kindModifiers: undefined, + triggerSpan: undefined + }; + } + + function isDefinedInLibraryFile(declaration: Node) { + if (defaultLibFileName) { + const sourceFile = declaration.getSourceFile(); + const canonicalName = getCanonicalFileName(ts.normalizePath(sourceFile.fileName)); + if (canonicalName === canonicalDefaultLibName) { + return true; + } + } + return false; + } + + function createTriggerSpanForNode(node: Node, sourceFile: SourceFile) { + let start = node.getStart(sourceFile); + let width = node.getWidth(sourceFile); + if (node.kind === SyntaxKind.StringLiteral) { + // Exclude the quotes + start += 1; + width -= 2; + } + return createTextSpan(start, width); + } + } +} diff --git a/src/services/services.ts b/src/services/services.ts index 366fc783c43..001bbcfaec2 100644 --- a/src/services/services.ts +++ b/src/services/services.ts @@ -1,15 +1,27 @@ /// /// -/// -/// -/// -/// -/// -/// /// /// +/// +/// +/// +/// +/// +/// +/// +/// +/// /// +/// +/// +/// +/// +/// +/// +/// +/// +/// /// /// @@ -17,53 +29,6 @@ namespace ts { /** The version of the language service API */ export const servicesVersion = "0.5"; - const scanner: Scanner = createScanner(ScriptTarget.Latest, /*skipTrivia*/ true); - - const emptyArray: any[] = []; - - const jsDocTagNames = [ - "augments", - "author", - "argument", - "borrows", - "class", - "constant", - "constructor", - "constructs", - "default", - "deprecated", - "description", - "event", - "example", - "extends", - "field", - "fileOverview", - "function", - "ignore", - "inner", - "lends", - "link", - "memberOf", - "name", - "namespace", - "param", - "private", - "property", - "public", - "requires", - "returns", - "see", - "since", - "static", - "throws", - "type", - "typedef", - "property", - "prop", - "version" - ]; - let jsDocCompletionEntries: CompletionEntry[]; - function createNode(kind: SyntaxKind, pos: number, end: number, parent?: Node): NodeObject | TokenObject | IdentifierObject { const node = kind >= SyntaxKind.FirstNode ? new NodeObject(kind, pos, end) : kind === SyntaxKind.Identifier ? new IdentifierObject(kind, pos, end) : @@ -127,7 +92,10 @@ namespace ts { } public getText(sourceFile?: SourceFile): string { - return (sourceFile || this.getSourceFile()).text.substring(this.getStart(), this.getEnd()); + if (!sourceFile) { + sourceFile = this.getSourceFile(); + } + return sourceFile.text.substring(this.getStart(sourceFile), this.getEnd()); } private addSyntheticNodes(nodes: Node[], pos: number, end: number, useJSDocScanner?: boolean): number { @@ -316,21 +284,6 @@ namespace ts { } } - class TokenObject extends TokenOrIdentifierObject { - public kind: SyntaxKind; - constructor(kind: SyntaxKind, pos: number, end: number) { - super(pos, end); - this.kind = kind; - } - } - - class IdentifierObject extends TokenOrIdentifierObject { - constructor(kind: SyntaxKind, pos: number, end: number) { - super(pos, end); - } - } - IdentifierObject.prototype.kind = SyntaxKind.Identifier; - class SymbolObject implements Symbol { flags: SymbolFlags; name: string; @@ -359,359 +312,28 @@ namespace ts { getDocumentationComment(): SymbolDisplayPart[] { if (this.documentationComment === undefined) { - this.documentationComment = getJsDocCommentsFromDeclarations(this.declarations, this.name, !(this.flags & SymbolFlags.Property)); + this.documentationComment = JsDoc.getJsDocCommentsFromDeclarations(this.declarations, this.name, !(this.flags & SymbolFlags.Property)); } return this.documentationComment; } } - function getJsDocCommentsFromDeclarations(declarations: Declaration[], name: string, canUseParsedParamTagComments: boolean) { - const documentationComment = []; - const docComments = getJsDocCommentsSeparatedByNewLines(); - ts.forEach(docComments, docComment => { - if (documentationComment.length) { - documentationComment.push(lineBreakPart()); - } - documentationComment.push(docComment); - }); - - return documentationComment; - - function getJsDocCommentsSeparatedByNewLines() { - const paramTag = "@param"; - const jsDocCommentParts: SymbolDisplayPart[] = []; - - ts.forEach(declarations, (declaration, indexOfDeclaration) => { - // Make sure we are collecting doc comment from declaration once, - // In case of union property there might be same declaration multiple times - // which only varies in type parameter - // Eg. const a: Array | Array; a.length - // The property length will have two declarations of property length coming - // from Array - Array and Array - if (indexOf(declarations, declaration) === indexOfDeclaration) { - const sourceFileOfDeclaration = getSourceFileOfNode(declaration); - // If it is parameter - try and get the jsDoc comment with @param tag from function declaration's jsDoc comments - if (canUseParsedParamTagComments && declaration.kind === SyntaxKind.Parameter) { - if ((declaration.parent.kind === SyntaxKind.FunctionExpression || declaration.parent.kind === SyntaxKind.ArrowFunction) && - declaration.parent.parent.kind === SyntaxKind.VariableDeclaration) { - addCommentParts(declaration.parent.parent.parent, sourceFileOfDeclaration, getCleanedParamJsDocComment); - } - addCommentParts(declaration.parent, sourceFileOfDeclaration, getCleanedParamJsDocComment); - } - - // If this is left side of dotted module declaration, there is no doc comments associated with this node - if (declaration.kind === SyntaxKind.ModuleDeclaration && (declaration).body && (declaration).body.kind === SyntaxKind.ModuleDeclaration) { - return; - } - - if ((declaration.kind === SyntaxKind.FunctionExpression || declaration.kind === SyntaxKind.ArrowFunction) && - declaration.parent.kind === SyntaxKind.VariableDeclaration) { - addCommentParts(declaration.parent.parent, sourceFileOfDeclaration, getCleanedJsDocComment); - } - - // If this is dotted module name, get the doc comments from the parent - while (declaration.kind === SyntaxKind.ModuleDeclaration && declaration.parent.kind === SyntaxKind.ModuleDeclaration) { - declaration = declaration.parent; - } - addCommentParts(declaration.kind === SyntaxKind.VariableDeclaration ? declaration.parent.parent : declaration, - sourceFileOfDeclaration, - getCleanedJsDocComment); - - if (declaration.kind === SyntaxKind.VariableDeclaration) { - const init = (declaration as VariableDeclaration).initializer; - if (init && (init.kind === SyntaxKind.FunctionExpression || init.kind === SyntaxKind.ArrowFunction)) { - // Get the cleaned js doc comment text from the initializer - addCommentParts(init, sourceFileOfDeclaration, getCleanedJsDocComment); - } - } - } - }); - - return jsDocCommentParts; - - function addCommentParts(commented: Node, - sourceFileOfDeclaration: SourceFile, - getCommentPart: (pos: number, end: number, file: SourceFile) => SymbolDisplayPart[]): void { - const ranges = getJsDocCommentTextRange(commented, sourceFileOfDeclaration); - // Get the cleaned js doc comment text from the declaration - ts.forEach(ranges, jsDocCommentTextRange => { - const cleanedComment = getCommentPart(jsDocCommentTextRange.pos, jsDocCommentTextRange.end, sourceFileOfDeclaration); - if (cleanedComment) { - addRange(jsDocCommentParts, cleanedComment); - } - }); - } - - function getJsDocCommentTextRange(node: Node, sourceFile: SourceFile): TextRange[] { - return ts.map(getJsDocComments(node, sourceFile), - jsDocComment => { - return { - pos: jsDocComment.pos + "/*".length, // Consume /* from the comment - end: jsDocComment.end - "*/".length // Trim off comment end indicator - }; - }); - } - - function consumeWhiteSpacesOnTheLine(pos: number, end: number, sourceFile: SourceFile, maxSpacesToRemove?: number) { - if (maxSpacesToRemove !== undefined) { - end = Math.min(end, pos + maxSpacesToRemove); - } - - for (; pos < end; pos++) { - const ch = sourceFile.text.charCodeAt(pos); - if (!isWhiteSpaceSingleLine(ch)) { - return pos; - } - } - - return end; - } - - function consumeLineBreaks(pos: number, end: number, sourceFile: SourceFile) { - while (pos < end && isLineBreak(sourceFile.text.charCodeAt(pos))) { - pos++; - } - - return pos; - } - - function isName(pos: number, end: number, sourceFile: SourceFile, name: string) { - return pos + name.length < end && - sourceFile.text.substr(pos, name.length) === name && - isWhiteSpace(sourceFile.text.charCodeAt(pos + name.length)); - } - - function isParamTag(pos: number, end: number, sourceFile: SourceFile) { - // If it is @param tag - return isName(pos, end, sourceFile, paramTag); - } - - function pushDocCommentLineText(docComments: SymbolDisplayPart[], text: string, blankLineCount: number) { - // Add the empty lines in between texts - while (blankLineCount) { - blankLineCount--; - docComments.push(textPart("")); - } - - docComments.push(textPart(text)); - } - - function getCleanedJsDocComment(pos: number, end: number, sourceFile: SourceFile) { - let spacesToRemoveAfterAsterisk: number; - const docComments: SymbolDisplayPart[] = []; - let blankLineCount = 0; - let isInParamTag = false; - - while (pos < end) { - let docCommentTextOfLine = ""; - // First consume leading white space - pos = consumeWhiteSpacesOnTheLine(pos, end, sourceFile); - - // If the comment starts with '*' consume the spaces on this line - if (pos < end && sourceFile.text.charCodeAt(pos) === CharacterCodes.asterisk) { - const lineStartPos = pos + 1; - pos = consumeWhiteSpacesOnTheLine(pos + 1, end, sourceFile, spacesToRemoveAfterAsterisk); - - // Set the spaces to remove after asterisk as margin if not already set - if (spacesToRemoveAfterAsterisk === undefined && pos < end && !isLineBreak(sourceFile.text.charCodeAt(pos))) { - spacesToRemoveAfterAsterisk = pos - lineStartPos; - } - } - else if (spacesToRemoveAfterAsterisk === undefined) { - spacesToRemoveAfterAsterisk = 0; - } - - // Analyze text on this line - while (pos < end && !isLineBreak(sourceFile.text.charCodeAt(pos))) { - const ch = sourceFile.text.charAt(pos); - if (ch === "@") { - // If it is @param tag - if (isParamTag(pos, end, sourceFile)) { - isInParamTag = true; - pos += paramTag.length; - continue; - } - else { - isInParamTag = false; - } - } - - // Add the ch to doc text if we arent in param tag - if (!isInParamTag) { - docCommentTextOfLine += ch; - } - - // Scan next character - pos++; - } - - // Continue with next line - pos = consumeLineBreaks(pos, end, sourceFile); - if (docCommentTextOfLine) { - pushDocCommentLineText(docComments, docCommentTextOfLine, blankLineCount); - blankLineCount = 0; - } - else if (!isInParamTag && docComments.length) { - // This is blank line when there is text already parsed - blankLineCount++; - } - } - - return docComments; - } - - function getCleanedParamJsDocComment(pos: number, end: number, sourceFile: SourceFile) { - let paramHelpStringMargin: number; - const paramDocComments: SymbolDisplayPart[] = []; - while (pos < end) { - if (isParamTag(pos, end, sourceFile)) { - let blankLineCount = 0; - let recordedParamTag = false; - // Consume leading spaces - pos = consumeWhiteSpaces(pos + paramTag.length); - if (pos >= end) { - break; - } - - // Ignore type expression - if (sourceFile.text.charCodeAt(pos) === CharacterCodes.openBrace) { - pos++; - for (let curlies = 1; pos < end; pos++) { - const charCode = sourceFile.text.charCodeAt(pos); - - // { character means we need to find another } to match the found one - if (charCode === CharacterCodes.openBrace) { - curlies++; - continue; - } - - // } char - if (charCode === CharacterCodes.closeBrace) { - curlies--; - if (curlies === 0) { - // We do not have any more } to match the type expression is ignored completely - pos++; - break; - } - else { - // there are more { to be matched with } - continue; - } - } - - // Found start of another tag - if (charCode === CharacterCodes.at) { - break; - } - } - - // Consume white spaces - pos = consumeWhiteSpaces(pos); - if (pos >= end) { - break; - } - } - - // Parameter name - if (isName(pos, end, sourceFile, name)) { - // Found the parameter we are looking for consume white spaces - pos = consumeWhiteSpaces(pos + name.length); - if (pos >= end) { - break; - } - - let paramHelpString = ""; - const firstLineParamHelpStringPos = pos; - while (pos < end) { - const ch = sourceFile.text.charCodeAt(pos); - - // at line break, set this comment line text and go to next line - if (isLineBreak(ch)) { - if (paramHelpString) { - pushDocCommentLineText(paramDocComments, paramHelpString, blankLineCount); - paramHelpString = ""; - blankLineCount = 0; - recordedParamTag = true; - } - else if (recordedParamTag) { - blankLineCount++; - } - - // Get the pos after cleaning start of the line - setPosForParamHelpStringOnNextLine(firstLineParamHelpStringPos); - continue; - } - - // Done scanning param help string - next tag found - if (ch === CharacterCodes.at) { - break; - } - - paramHelpString += sourceFile.text.charAt(pos); - - // Go to next character - pos++; - } - - // If there is param help text, add it top the doc comments - if (paramHelpString) { - pushDocCommentLineText(paramDocComments, paramHelpString, blankLineCount); - } - paramHelpStringMargin = undefined; - } - - // If this is the start of another tag, continue with the loop in search of param tag with symbol name - if (sourceFile.text.charCodeAt(pos) === CharacterCodes.at) { - continue; - } - } - - // Next character - pos++; - } - - return paramDocComments; - - function consumeWhiteSpaces(pos: number) { - while (pos < end && isWhiteSpaceSingleLine(sourceFile.text.charCodeAt(pos))) { - pos++; - } - - return pos; - } - - function setPosForParamHelpStringOnNextLine(firstLineParamHelpStringPos: number) { - // Get the pos after consuming line breaks - pos = consumeLineBreaks(pos, end, sourceFile); - if (pos >= end) { - return; - } - - if (paramHelpStringMargin === undefined) { - paramHelpStringMargin = sourceFile.getLineAndCharacterOfPosition(firstLineParamHelpStringPos).character; - } - - // Now consume white spaces max - const startOfLinePos = pos; - pos = consumeWhiteSpacesOnTheLine(pos, end, sourceFile, paramHelpStringMargin); - if (pos >= end) { - return; - } - - const consumedSpaces = pos - startOfLinePos; - if (consumedSpaces < paramHelpStringMargin) { - const ch = sourceFile.text.charCodeAt(pos); - if (ch === CharacterCodes.asterisk) { - // Consume more spaces after asterisk - pos = consumeWhiteSpacesOnTheLine(pos + 1, end, sourceFile, paramHelpStringMargin - consumedSpaces - 1); - } - } - } - } + class TokenObject extends TokenOrIdentifierObject { + public kind: SyntaxKind; + constructor(kind: SyntaxKind, pos: number, end: number) { + super(pos, end); + this.kind = kind; } } + class IdentifierObject extends TokenOrIdentifierObject { + constructor(kind: SyntaxKind, pos: number, end: number) { + super(pos, end); + } + } + IdentifierObject.prototype.kind = SyntaxKind.Identifier; + class TypeObject implements Type { checker: TypeChecker; flags: TypeFlags; @@ -791,7 +413,7 @@ namespace ts { getDocumentationComment(): SymbolDisplayPart[] { if (this.documentationComment === undefined) { - this.documentationComment = this.declaration ? getJsDocCommentsFromDeclarations( + this.documentationComment = this.declaration ? JsDoc.getJsDocCommentsFromDeclarations( [this.declaration], /*name*/ undefined, /*canUseParsedParamTagComments*/ false) : []; @@ -1029,6 +651,18 @@ namespace ts { } } + function getServicesObjectAllocator(): ObjectAllocator { + return { + getNodeConstructor: () => NodeObject, + getTokenConstructor: () => TokenObject, + getIdentifierConstructor: () => IdentifierObject, + getSourceFileConstructor: () => SourceFileObject, + getSymbolConstructor: () => SymbolObject, + getTypeConstructor: () => TypeObject, + getSignatureConstructor: () => SignatureObject, + }; + } + /// Language Service // Information about a specific host file. @@ -1039,21 +673,6 @@ namespace ts { scriptKind: ScriptKind; } - interface DocumentRegistryEntry { - sourceFile: SourceFile; - - // The number of language services that this source file is referenced in. When no more - // language services are referencing the file, then the file can be removed from the - // registry. - languageServiceRefCount: number; - owners: string[]; - } - - interface VisibleModuleInfo { - moduleName: string; - moduleDir: string; - } - export interface DisplayPartsSymbolWriter extends SymbolWriter { displayParts(): SymbolDisplayPart[]; } @@ -1066,34 +685,6 @@ namespace ts { return ""; } - function isLocalVariableOrFunction(symbol: Symbol) { - if (symbol.parent) { - return false; // This is exported symbol - } - - return ts.forEach(symbol.declarations, declaration => { - // Function expressions are local - if (declaration.kind === SyntaxKind.FunctionExpression) { - return true; - } - - if (declaration.kind !== SyntaxKind.VariableDeclaration && declaration.kind !== SyntaxKind.FunctionDeclaration) { - return false; - } - - // If the parent is not sourceFile or module block it is local variable - for (let parent = declaration.parent; !isFunctionBlock(parent); parent = parent.parent) { - // Reached source file or module block - if (parent.kind === SyntaxKind.SourceFile || parent.kind === SyntaxKind.ModuleBlock) { - return false; - } - } - - // parent is in function block - return true; - }); - } - export function getDefaultCompilerOptions(): CompilerOptions { // Always default to "ScriptTarget.ES5" for the language service return { @@ -1236,169 +827,6 @@ namespace ts { sourceFile.scriptSnapshot = scriptSnapshot; } - export interface TranspileOptions { - compilerOptions?: CompilerOptions; - fileName?: string; - reportDiagnostics?: boolean; - moduleName?: string; - renamedDependencies?: MapLike; - } - - export interface TranspileOutput { - outputText: string; - diagnostics?: Diagnostic[]; - sourceMapText?: string; - } - - /** - * Matches a triple slash reference directive with an incomplete string literal for its path. Used - * to determine if the caret is currently within the string literal and capture the literal fragment - * for completions. - * For example, this matches /// filter(optionDeclarations, o => - typeof o.type === "object" && !forEachProperty(o.type, v => typeof v !== "number")); - - options = clone(options); - - for (const opt of commandLineOptionsStringToEnum) { - if (!hasProperty(options, opt.name)) { - continue; - } - - const value = options[opt.name]; - // Value should be a key of opt.type - if (typeof value === "string") { - // If value is not a string, this will fail - options[opt.name] = parseCustomTypeOption(opt, value, diagnostics); - } - else { - if (!forEachProperty(opt.type, v => v === value)) { - // Supplied value isn't a valid enum value. - diagnostics.push(createCompilerDiagnosticForInvalidCustomType(opt)); - } - } - } - - return options; - } - - /* - * This function will compile source text from 'input' argument using specified compiler options. - * If not options are provided - it will use a set of default compiler options. - * Extra compiler options that will unconditionally be used by this function are: - * - isolatedModules = true - * - allowNonTsExtensions = true - * - noLib = true - * - noResolve = true - */ - export function transpileModule(input: string, transpileOptions: TranspileOptions): TranspileOutput { - const diagnostics: Diagnostic[] = []; - - const options: CompilerOptions = transpileOptions.compilerOptions ? fixupCompilerOptions(transpileOptions.compilerOptions, diagnostics) : getDefaultCompilerOptions(); - - options.isolatedModules = true; - - // transpileModule does not write anything to disk so there is no need to verify that there are no conflicts between input and output paths. - options.suppressOutputPathCheck = true; - - // Filename can be non-ts file. - options.allowNonTsExtensions = true; - - // We are not returning a sourceFile for lib file when asked by the program, - // so pass --noLib to avoid reporting a file not found error. - options.noLib = true; - - // Clear out other settings that would not be used in transpiling this module - options.lib = undefined; - options.types = undefined; - options.noEmit = undefined; - options.noEmitOnError = undefined; - options.paths = undefined; - options.rootDirs = undefined; - options.declaration = undefined; - options.declarationDir = undefined; - options.out = undefined; - options.outFile = undefined; - - // We are not doing a full typecheck, we are not resolving the whole context, - // so pass --noResolve to avoid reporting missing file errors. - options.noResolve = true; - - // if jsx is specified then treat file as .tsx - const inputFileName = transpileOptions.fileName || (options.jsx ? "module.tsx" : "module.ts"); - const sourceFile = createSourceFile(inputFileName, input, options.target); - if (transpileOptions.moduleName) { - sourceFile.moduleName = transpileOptions.moduleName; - } - - if (transpileOptions.renamedDependencies) { - sourceFile.renamedDependencies = createMap(transpileOptions.renamedDependencies); - } - - const newLine = getNewLineCharacter(options); - - // Output - let outputText: string; - let sourceMapText: string; - - // Create a compilerHost object to allow the compiler to read and write files - const compilerHost: CompilerHost = { - getSourceFile: (fileName, target) => fileName === normalizePath(inputFileName) ? sourceFile : undefined, - writeFile: (name, text, writeByteOrderMark) => { - if (fileExtensionIs(name, ".map")) { - Debug.assert(sourceMapText === undefined, `Unexpected multiple source map outputs for the file '${name}'`); - sourceMapText = text; - } - else { - Debug.assert(outputText === undefined, `Unexpected multiple outputs for the file: '${name}'`); - outputText = text; - } - }, - getDefaultLibFileName: () => "lib.d.ts", - useCaseSensitiveFileNames: () => false, - getCanonicalFileName: fileName => fileName, - getCurrentDirectory: () => "", - getNewLine: () => newLine, - fileExists: (fileName): boolean => fileName === inputFileName, - readFile: (fileName): string => "", - directoryExists: directoryExists => true, - getDirectories: (path: string) => [] - }; - - const program = createProgram([inputFileName], options, compilerHost); - - if (transpileOptions.reportDiagnostics) { - addRange(/*to*/ diagnostics, /*from*/ program.getSyntacticDiagnostics(sourceFile)); - addRange(/*to*/ diagnostics, /*from*/ program.getOptionsDiagnostics()); - } - // Emit - program.emit(); - - Debug.assert(outputText !== undefined, "Output generation failed"); - - return { outputText, diagnostics, sourceMapText }; - } - - /* - * This is a shortcut function for transpileModule - it accepts transpileOptions as parameters and returns only outputText part of the result. - */ - export function transpile(input: string, compilerOptions?: CompilerOptions, fileName?: string, diagnostics?: Diagnostic[], moduleName?: string): string { - const output = transpileModule(input, { compilerOptions, fileName, reportDiagnostics: !!diagnostics, moduleName }); - // addRange correctly handles cases when wither 'from' or 'to' argument is missing - addRange(diagnostics, output.diagnostics); - return output.outputText; - } - export function createLanguageServiceSourceFile(fileName: string, scriptSnapshot: IScriptSnapshot, scriptTarget: ScriptTarget, version: string, setNodeParents: boolean, scriptKind?: ScriptKind): SourceFile { const text = scriptSnapshot.getText(0, scriptSnapshot.getLength()); const sourceFile = createSourceFile(fileName, text, scriptTarget, setNodeParents, scriptKind); @@ -1466,797 +894,6 @@ namespace ts { return createLanguageServiceSourceFile(sourceFile.fileName, scriptSnapshot, sourceFile.languageVersion, version, /*setNodeParents*/ true, sourceFile.scriptKind); } - export function createDocumentRegistry(useCaseSensitiveFileNames?: boolean, currentDirectory = ""): DocumentRegistry { - // Maps from compiler setting target (ES3, ES5, etc.) to all the cached documents we have - // for those settings. - const buckets = createMap>(); - const getCanonicalFileName = createGetCanonicalFileName(!!useCaseSensitiveFileNames); - - function getKeyForCompilationSettings(settings: CompilerOptions): DocumentRegistryBucketKey { - return `_${settings.target}|${settings.module}|${settings.noResolve}|${settings.jsx}|${settings.allowJs}|${settings.baseUrl}|${JSON.stringify(settings.typeRoots)}|${JSON.stringify(settings.rootDirs)}|${JSON.stringify(settings.paths)}`; - } - - function getBucketForCompilationSettings(key: DocumentRegistryBucketKey, createIfMissing: boolean): FileMap { - let bucket = buckets[key]; - if (!bucket && createIfMissing) { - buckets[key] = bucket = createFileMap(); - } - return bucket; - } - - function reportStats() { - const bucketInfoArray = Object.keys(buckets).filter(name => name && name.charAt(0) === "_").map(name => { - const entries = buckets[name]; - const sourceFiles: { name: string; refCount: number; references: string[]; }[] = []; - entries.forEachValue((key, entry) => { - sourceFiles.push({ - name: key, - refCount: entry.languageServiceRefCount, - references: entry.owners.slice(0) - }); - }); - sourceFiles.sort((x, y) => y.refCount - x.refCount); - return { - bucket: name, - sourceFiles - }; - }); - return JSON.stringify(bucketInfoArray, undefined, 2); - } - - function acquireDocument(fileName: string, compilationSettings: CompilerOptions, scriptSnapshot: IScriptSnapshot, version: string, scriptKind?: ScriptKind): SourceFile { - const path = toPath(fileName, currentDirectory, getCanonicalFileName); - const key = getKeyForCompilationSettings(compilationSettings); - return acquireDocumentWithKey(fileName, path, compilationSettings, key, scriptSnapshot, version, scriptKind); - } - - function acquireDocumentWithKey(fileName: string, path: Path, compilationSettings: CompilerOptions, key: DocumentRegistryBucketKey, scriptSnapshot: IScriptSnapshot, version: string, scriptKind?: ScriptKind): SourceFile { - return acquireOrUpdateDocument(fileName, path, compilationSettings, key, scriptSnapshot, version, /*acquiring*/ true, scriptKind); - } - - function updateDocument(fileName: string, compilationSettings: CompilerOptions, scriptSnapshot: IScriptSnapshot, version: string, scriptKind?: ScriptKind): SourceFile { - const path = toPath(fileName, currentDirectory, getCanonicalFileName); - const key = getKeyForCompilationSettings(compilationSettings); - return updateDocumentWithKey(fileName, path, compilationSettings, key, scriptSnapshot, version, scriptKind); - } - - function updateDocumentWithKey(fileName: string, path: Path, compilationSettings: CompilerOptions, key: DocumentRegistryBucketKey, scriptSnapshot: IScriptSnapshot, version: string, scriptKind?: ScriptKind): SourceFile { - return acquireOrUpdateDocument(fileName, path, compilationSettings, key, scriptSnapshot, version, /*acquiring*/ false, scriptKind); - } - - function acquireOrUpdateDocument( - fileName: string, - path: Path, - compilationSettings: CompilerOptions, - key: DocumentRegistryBucketKey, - scriptSnapshot: IScriptSnapshot, - version: string, - acquiring: boolean, - scriptKind?: ScriptKind): SourceFile { - - const bucket = getBucketForCompilationSettings(key, /*createIfMissing*/ true); - let entry = bucket.get(path); - if (!entry) { - Debug.assert(acquiring, "How could we be trying to update a document that the registry doesn't have?"); - - // Have never seen this file with these settings. Create a new source file for it. - const sourceFile = createLanguageServiceSourceFile(fileName, scriptSnapshot, compilationSettings.target, version, /*setNodeParents*/ false, scriptKind); - - entry = { - sourceFile: sourceFile, - languageServiceRefCount: 0, - owners: [] - }; - bucket.set(path, entry); - } - else { - // We have an entry for this file. However, it may be for a different version of - // the script snapshot. If so, update it appropriately. Otherwise, we can just - // return it as is. - if (entry.sourceFile.version !== version) { - entry.sourceFile = updateLanguageServiceSourceFile(entry.sourceFile, scriptSnapshot, version, - scriptSnapshot.getChangeRange(entry.sourceFile.scriptSnapshot)); - } - } - - // If we're acquiring, then this is the first time this LS is asking for this document. - // Increase our ref count so we know there's another LS using the document. If we're - // not acquiring, then that means the LS is 'updating' the file instead, and that means - // it has already acquired the document previously. As such, we do not need to increase - // the ref count. - if (acquiring) { - entry.languageServiceRefCount++; - } - - return entry.sourceFile; - } - - function releaseDocument(fileName: string, compilationSettings: CompilerOptions): void { - const path = toPath(fileName, currentDirectory, getCanonicalFileName); - const key = getKeyForCompilationSettings(compilationSettings); - return releaseDocumentWithKey(path, key); - } - - function releaseDocumentWithKey(path: Path, key: DocumentRegistryBucketKey): void { - const bucket = getBucketForCompilationSettings(key, /*createIfMissing*/false); - Debug.assert(bucket !== undefined); - - const entry = bucket.get(path); - entry.languageServiceRefCount--; - - Debug.assert(entry.languageServiceRefCount >= 0); - if (entry.languageServiceRefCount === 0) { - bucket.remove(path); - } - } - - return { - acquireDocument, - acquireDocumentWithKey, - updateDocument, - updateDocumentWithKey, - releaseDocument, - releaseDocumentWithKey, - reportStats, - getKeyForCompilationSettings - }; - } - - export function preProcessFile(sourceText: string, readImportFiles = true, detectJavaScriptImports = false): PreProcessedFileInfo { - const referencedFiles: FileReference[] = []; - const typeReferenceDirectives: FileReference[] = []; - const importedFiles: FileReference[] = []; - let ambientExternalModules: { ref: FileReference, depth: number }[]; - let isNoDefaultLib = false; - let braceNesting = 0; - // assume that text represent an external module if it contains at least one top level import/export - // ambient modules that are found inside external modules are interpreted as module augmentations - let externalModule = false; - - function nextToken() { - const token = scanner.scan(); - if (token === SyntaxKind.OpenBraceToken) { - braceNesting++; - } - else if (token === SyntaxKind.CloseBraceToken) { - braceNesting--; - } - return token; - } - - function processTripleSlashDirectives(): void { - const commentRanges = getLeadingCommentRanges(sourceText, 0); - forEach(commentRanges, commentRange => { - const comment = sourceText.substring(commentRange.pos, commentRange.end); - const referencePathMatchResult = getFileReferenceFromReferencePath(comment, commentRange); - if (referencePathMatchResult) { - isNoDefaultLib = referencePathMatchResult.isNoDefaultLib; - const fileReference = referencePathMatchResult.fileReference; - if (fileReference) { - const collection = referencePathMatchResult.isTypeReferenceDirective - ? typeReferenceDirectives - : referencedFiles; - - collection.push(fileReference); - } - } - }); - } - - function getFileReference() { - const file = scanner.getTokenValue(); - const pos = scanner.getTokenPos(); - return { - fileName: file, - pos: pos, - end: pos + file.length - }; - } - - function recordAmbientExternalModule(): void { - if (!ambientExternalModules) { - ambientExternalModules = []; - } - ambientExternalModules.push({ ref: getFileReference(), depth: braceNesting }); - } - - function recordModuleName() { - importedFiles.push(getFileReference()); - - markAsExternalModuleIfTopLevel(); - } - - function markAsExternalModuleIfTopLevel() { - if (braceNesting === 0) { - externalModule = true; - } - } - - /** - * Returns true if at least one token was consumed from the stream - */ - function tryConsumeDeclare(): boolean { - let token = scanner.getToken(); - if (token === SyntaxKind.DeclareKeyword) { - // declare module "mod" - token = nextToken(); - if (token === SyntaxKind.ModuleKeyword) { - token = nextToken(); - if (token === SyntaxKind.StringLiteral) { - recordAmbientExternalModule(); - } - } - return true; - } - - return false; - } - - /** - * Returns true if at least one token was consumed from the stream - */ - function tryConsumeImport(): boolean { - let token = scanner.getToken(); - if (token === SyntaxKind.ImportKeyword) { - - token = nextToken(); - if (token === SyntaxKind.StringLiteral) { - // import "mod"; - recordModuleName(); - return true; - } - else { - if (token === SyntaxKind.Identifier || isKeyword(token)) { - token = nextToken(); - if (token === SyntaxKind.FromKeyword) { - token = nextToken(); - if (token === SyntaxKind.StringLiteral) { - // import d from "mod"; - recordModuleName(); - return true; - } - } - else if (token === SyntaxKind.EqualsToken) { - if (tryConsumeRequireCall(/*skipCurrentToken*/ true)) { - return true; - } - } - else if (token === SyntaxKind.CommaToken) { - // consume comma and keep going - token = nextToken(); - } - else { - // unknown syntax - return true; - } - } - - if (token === SyntaxKind.OpenBraceToken) { - token = nextToken(); - // consume "{ a as B, c, d as D}" clauses - // make sure that it stops on EOF - while (token !== SyntaxKind.CloseBraceToken && token !== SyntaxKind.EndOfFileToken) { - token = nextToken(); - } - - if (token === SyntaxKind.CloseBraceToken) { - token = nextToken(); - if (token === SyntaxKind.FromKeyword) { - token = nextToken(); - if (token === SyntaxKind.StringLiteral) { - // import {a as A} from "mod"; - // import d, {a, b as B} from "mod" - recordModuleName(); - } - } - } - } - else if (token === SyntaxKind.AsteriskToken) { - token = nextToken(); - if (token === SyntaxKind.AsKeyword) { - token = nextToken(); - if (token === SyntaxKind.Identifier || isKeyword(token)) { - token = nextToken(); - if (token === SyntaxKind.FromKeyword) { - token = nextToken(); - if (token === SyntaxKind.StringLiteral) { - // import * as NS from "mod" - // import d, * as NS from "mod" - recordModuleName(); - } - } - } - } - } - } - - return true; - } - - return false; - } - - function tryConsumeExport(): boolean { - let token = scanner.getToken(); - if (token === SyntaxKind.ExportKeyword) { - markAsExternalModuleIfTopLevel(); - token = nextToken(); - if (token === SyntaxKind.OpenBraceToken) { - token = nextToken(); - // consume "{ a as B, c, d as D}" clauses - // make sure it stops on EOF - while (token !== SyntaxKind.CloseBraceToken && token !== SyntaxKind.EndOfFileToken) { - token = nextToken(); - } - - if (token === SyntaxKind.CloseBraceToken) { - token = nextToken(); - if (token === SyntaxKind.FromKeyword) { - token = nextToken(); - if (token === SyntaxKind.StringLiteral) { - // export {a as A} from "mod"; - // export {a, b as B} from "mod" - recordModuleName(); - } - } - } - } - else if (token === SyntaxKind.AsteriskToken) { - token = nextToken(); - if (token === SyntaxKind.FromKeyword) { - token = nextToken(); - if (token === SyntaxKind.StringLiteral) { - // export * from "mod" - recordModuleName(); - } - } - } - else if (token === SyntaxKind.ImportKeyword) { - token = nextToken(); - if (token === SyntaxKind.Identifier || isKeyword(token)) { - token = nextToken(); - if (token === SyntaxKind.EqualsToken) { - if (tryConsumeRequireCall(/*skipCurrentToken*/ true)) { - return true; - } - } - } - } - - return true; - } - - return false; - } - - function tryConsumeRequireCall(skipCurrentToken: boolean): boolean { - let token = skipCurrentToken ? nextToken() : scanner.getToken(); - if (token === SyntaxKind.RequireKeyword) { - token = nextToken(); - if (token === SyntaxKind.OpenParenToken) { - token = nextToken(); - if (token === SyntaxKind.StringLiteral) { - // require("mod"); - recordModuleName(); - } - } - return true; - } - return false; - } - - function tryConsumeDefine(): boolean { - let token = scanner.getToken(); - if (token === SyntaxKind.Identifier && scanner.getTokenValue() === "define") { - token = nextToken(); - if (token !== SyntaxKind.OpenParenToken) { - return true; - } - - token = nextToken(); - if (token === SyntaxKind.StringLiteral) { - // looks like define ("modname", ... - skip string literal and comma - token = nextToken(); - if (token === SyntaxKind.CommaToken) { - token = nextToken(); - } - else { - // unexpected token - return true; - } - } - - // should be start of dependency list - if (token !== SyntaxKind.OpenBracketToken) { - return true; - } - - // skip open bracket - token = nextToken(); - let i = 0; - // scan until ']' or EOF - while (token !== SyntaxKind.CloseBracketToken && token !== SyntaxKind.EndOfFileToken) { - // record string literals as module names - if (token === SyntaxKind.StringLiteral) { - recordModuleName(); - i++; - } - - token = nextToken(); - } - return true; - - } - return false; - } - - function processImports(): void { - scanner.setText(sourceText); - nextToken(); - // Look for: - // import "mod"; - // import d from "mod" - // import {a as A } from "mod"; - // import * as NS from "mod" - // import d, {a, b as B} from "mod" - // import i = require("mod"); - // - // export * from "mod" - // export {a as b} from "mod" - // export import i = require("mod") - // (for JavaScript files) require("mod") - - while (true) { - if (scanner.getToken() === SyntaxKind.EndOfFileToken) { - break; - } - - // check if at least one of alternative have moved scanner forward - if (tryConsumeDeclare() || - tryConsumeImport() || - tryConsumeExport() || - (detectJavaScriptImports && (tryConsumeRequireCall(/*skipCurrentToken*/ false) || tryConsumeDefine()))) { - continue; - } - else { - nextToken(); - } - } - - scanner.setText(undefined); - } - - if (readImportFiles) { - processImports(); - } - processTripleSlashDirectives(); - if (externalModule) { - // for external modules module all nested ambient modules are augmentations - if (ambientExternalModules) { - // move all detected ambient modules to imported files since they need to be resolved - for (const decl of ambientExternalModules) { - importedFiles.push(decl.ref); - } - } - return { referencedFiles, typeReferenceDirectives, importedFiles, isLibFile: isNoDefaultLib, ambientExternalModules: undefined }; - } - else { - // for global scripts ambient modules still can have augmentations - look for ambient modules with depth > 0 - let ambientModuleNames: string[]; - if (ambientExternalModules) { - for (const decl of ambientExternalModules) { - if (decl.depth === 0) { - if (!ambientModuleNames) { - ambientModuleNames = []; - } - ambientModuleNames.push(decl.ref.fileName); - } - else { - importedFiles.push(decl.ref); - } - } - } - return { referencedFiles, typeReferenceDirectives, importedFiles, isLibFile: isNoDefaultLib, ambientExternalModules: ambientModuleNames }; - } - } - - /// Helpers - function getTargetLabel(referenceNode: Node, labelName: string): Identifier { - while (referenceNode) { - if (referenceNode.kind === SyntaxKind.LabeledStatement && (referenceNode).label.text === labelName) { - return (referenceNode).label; - } - referenceNode = referenceNode.parent; - } - return undefined; - } - - function isJumpStatementTarget(node: Node): boolean { - return node.kind === SyntaxKind.Identifier && - (node.parent.kind === SyntaxKind.BreakStatement || node.parent.kind === SyntaxKind.ContinueStatement) && - (node.parent).label === node; - } - - function isLabelOfLabeledStatement(node: Node): boolean { - return node.kind === SyntaxKind.Identifier && - node.parent.kind === SyntaxKind.LabeledStatement && - (node.parent).label === node; - } - - /** - * Whether or not a 'node' is preceded by a label of the given string. - * Note: 'node' cannot be a SourceFile. - */ - function isLabeledBy(node: Node, labelName: string) { - for (let owner = node.parent; owner.kind === SyntaxKind.LabeledStatement; owner = owner.parent) { - if ((owner).label.text === labelName) { - return true; - } - } - - return false; - } - - function isLabelName(node: Node): boolean { - return isLabelOfLabeledStatement(node) || isJumpStatementTarget(node); - } - - function isRightSideOfQualifiedName(node: Node) { - return node.parent.kind === SyntaxKind.QualifiedName && (node.parent).right === node; - } - - function isRightSideOfPropertyAccess(node: Node) { - return node && node.parent && node.parent.kind === SyntaxKind.PropertyAccessExpression && (node.parent).name === node; - } - - function climbPastPropertyAccess(node: Node) { - return isRightSideOfPropertyAccess(node) ? node.parent : node; - } - - /** Get `C` given `N` if `N` is in the position `class C extends N` or `class C extends foo.N` where `N` is an identifier. */ - function tryGetClassByExtendingIdentifier(node: Node): ClassLikeDeclaration | undefined { - return tryGetClassExtendingExpressionWithTypeArguments(climbPastPropertyAccess(node).parent); - } - - function isCallExpressionTarget(node: Node): boolean { - return isCallOrNewExpressionTarget(node, SyntaxKind.CallExpression); - } - - function isNewExpressionTarget(node: Node): boolean { - return isCallOrNewExpressionTarget(node, SyntaxKind.NewExpression); - } - - function isCallOrNewExpressionTarget(node: Node, kind: SyntaxKind) { - const target = climbPastPropertyAccess(node); - return target && target.parent && target.parent.kind === kind && (target.parent).expression === target; - } - - function climbPastManyPropertyAccesses(node: Node): Node { - return isRightSideOfPropertyAccess(node) ? climbPastManyPropertyAccesses(node.parent) : node; - } - - /** Returns a CallLikeExpression where `node` is the target being invoked. */ - function getAncestorCallLikeExpression(node: Node): CallLikeExpression | undefined { - const target = climbPastManyPropertyAccesses(node); - const callLike = target.parent; - return callLike && isCallLikeExpression(callLike) && getInvokedExpression(callLike) === target && callLike; - } - - function tryGetSignatureDeclaration(typeChecker: TypeChecker, node: Node): SignatureDeclaration | undefined { - const callLike = getAncestorCallLikeExpression(node); - return callLike && typeChecker.getResolvedSignature(callLike).declaration; - } - - function isNameOfModuleDeclaration(node: Node) { - return node.parent.kind === SyntaxKind.ModuleDeclaration && (node.parent).name === node; - } - - function isNameOfFunctionDeclaration(node: Node): boolean { - return node.kind === SyntaxKind.Identifier && - isFunctionLike(node.parent) && (node.parent).name === node; - } - - function isObjectLiteralPropertyDeclaration(node: Node): node is ObjectLiteralElement { - switch (node.kind) { - case SyntaxKind.PropertyAssignment: - case SyntaxKind.ShorthandPropertyAssignment: - case SyntaxKind.MethodDeclaration: - case SyntaxKind.GetAccessor: - case SyntaxKind.SetAccessor: - return true; - } - return false; - } - - /** - * Returns the containing object literal property declaration given a possible name node, e.g. "a" in x = { "a": 1 } - */ - function getContainingObjectLiteralElement(node: Node): ObjectLiteralElement { - switch (node.kind) { - case SyntaxKind.StringLiteral: - case SyntaxKind.NumericLiteral: - if (node.parent.kind === SyntaxKind.ComputedPropertyName) { - return isObjectLiteralPropertyDeclaration(node.parent.parent) ? node.parent.parent : undefined; - } - // intential fall through - case SyntaxKind.Identifier: - return isObjectLiteralPropertyDeclaration(node.parent) && node.parent.name === node ? node.parent : undefined; - } - return undefined; - } - - function isLiteralNameOfPropertyDeclarationOrIndexAccess(node: Node): boolean { - if (node.kind === SyntaxKind.StringLiteral || node.kind === SyntaxKind.NumericLiteral) { - switch (node.parent.kind) { - case SyntaxKind.PropertyDeclaration: - case SyntaxKind.PropertySignature: - case SyntaxKind.PropertyAssignment: - case SyntaxKind.EnumMember: - case SyntaxKind.MethodDeclaration: - case SyntaxKind.MethodSignature: - case SyntaxKind.GetAccessor: - case SyntaxKind.SetAccessor: - case SyntaxKind.ModuleDeclaration: - return (node.parent).name === node; - case SyntaxKind.ElementAccessExpression: - return (node.parent).argumentExpression === node; - case SyntaxKind.ComputedPropertyName: - return true; - } - } - - return false; - } - - function isNameOfExternalModuleImportOrDeclaration(node: Node): boolean { - if (node.kind === SyntaxKind.StringLiteral) { - return isNameOfModuleDeclaration(node) || isExpressionOfExternalModuleImportEqualsDeclaration(node); - } - - return false; - } - - function isExpressionOfExternalModuleImportEqualsDeclaration(node: Node) { - return isExternalModuleImportEqualsDeclaration(node.parent.parent) && - getExternalModuleImportEqualsDeclarationExpression(node.parent.parent) === node; - } - - /** Returns true if the position is within a comment */ - function isInsideComment(sourceFile: SourceFile, token: Node, position: number): boolean { - // The position has to be: 1. in the leading trivia (before token.getStart()), and 2. within a comment - return position <= token.getStart(sourceFile) && - (isInsideCommentRange(getTrailingCommentRanges(sourceFile.text, token.getFullStart())) || - isInsideCommentRange(getLeadingCommentRanges(sourceFile.text, token.getFullStart()))); - - function isInsideCommentRange(comments: CommentRange[]): boolean { - return forEach(comments, comment => { - // either we are 1. completely inside the comment, or 2. at the end of the comment - if (comment.pos < position && position < comment.end) { - return true; - } - else if (position === comment.end) { - const text = sourceFile.text; - const width = comment.end - comment.pos; - // is single line comment or just /* - if (width <= 2 || text.charCodeAt(comment.pos + 1) === CharacterCodes.slash) { - return true; - } - else { - // is unterminated multi-line comment - return !(text.charCodeAt(comment.end - 1) === CharacterCodes.slash && - text.charCodeAt(comment.end - 2) === CharacterCodes.asterisk); - } - } - return false; - }); - } - } - - const enum SemanticMeaning { - None = 0x0, - Value = 0x1, - Type = 0x2, - Namespace = 0x4, - All = Value | Type | Namespace - } - - const enum BreakContinueSearchType { - None = 0x0, - Unlabeled = 0x1, - Labeled = 0x2, - All = Unlabeled | Labeled - } - - // A cache of completion entries for keywords, these do not change between sessions - const keywordCompletions: CompletionEntry[] = []; - for (let i = SyntaxKind.FirstKeyword; i <= SyntaxKind.LastKeyword; i++) { - keywordCompletions.push({ - name: tokenToString(i), - kind: ScriptElementKind.keyword, - kindModifiers: ScriptElementKindModifier.none, - sortText: "0" - }); - } - - /* @internal */ export function getContainerNode(node: Node): Declaration { - while (true) { - node = node.parent; - if (!node) { - return undefined; - } - switch (node.kind) { - case SyntaxKind.SourceFile: - case SyntaxKind.MethodDeclaration: - case SyntaxKind.MethodSignature: - case SyntaxKind.FunctionDeclaration: - case SyntaxKind.FunctionExpression: - case SyntaxKind.GetAccessor: - case SyntaxKind.SetAccessor: - case SyntaxKind.ClassDeclaration: - case SyntaxKind.InterfaceDeclaration: - case SyntaxKind.EnumDeclaration: - case SyntaxKind.ModuleDeclaration: - return node; - } - } - } - - /* @internal */ export function getNodeKind(node: Node): string { - switch (node.kind) { - case SyntaxKind.SourceFile: - return isExternalModule(node) ? ScriptElementKind.moduleElement : ScriptElementKind.scriptElement; - case SyntaxKind.ModuleDeclaration: - return ScriptElementKind.moduleElement; - case SyntaxKind.ClassDeclaration: - case SyntaxKind.ClassExpression: - return ScriptElementKind.classElement; - case SyntaxKind.InterfaceDeclaration: return ScriptElementKind.interfaceElement; - case SyntaxKind.TypeAliasDeclaration: return ScriptElementKind.typeElement; - case SyntaxKind.EnumDeclaration: return ScriptElementKind.enumElement; - case SyntaxKind.VariableDeclaration: - return getKindOfVariableDeclaration(node); - case SyntaxKind.BindingElement: - return getKindOfVariableDeclaration(getRootDeclaration(node)); - case SyntaxKind.ArrowFunction: - case SyntaxKind.FunctionDeclaration: - case SyntaxKind.FunctionExpression: - return ScriptElementKind.functionElement; - case SyntaxKind.GetAccessor: return ScriptElementKind.memberGetAccessorElement; - case SyntaxKind.SetAccessor: return ScriptElementKind.memberSetAccessorElement; - case SyntaxKind.MethodDeclaration: - case SyntaxKind.MethodSignature: - return ScriptElementKind.memberFunctionElement; - case SyntaxKind.PropertyDeclaration: - case SyntaxKind.PropertySignature: - return ScriptElementKind.memberVariableElement; - case SyntaxKind.IndexSignature: return ScriptElementKind.indexSignatureElement; - case SyntaxKind.ConstructSignature: return ScriptElementKind.constructSignatureElement; - case SyntaxKind.CallSignature: return ScriptElementKind.callSignatureElement; - case SyntaxKind.Constructor: return ScriptElementKind.constructorImplementationElement; - case SyntaxKind.TypeParameter: return ScriptElementKind.typeParameterElement; - case SyntaxKind.EnumMember: return ScriptElementKind.enumMemberElement; - case SyntaxKind.Parameter: return hasModifier(node, ModifierFlags.ParameterPropertyModifier) ? ScriptElementKind.memberVariableElement : ScriptElementKind.parameterElement; - case SyntaxKind.ImportEqualsDeclaration: - case SyntaxKind.ImportSpecifier: - case SyntaxKind.ImportClause: - case SyntaxKind.ExportSpecifier: - case SyntaxKind.NamespaceImport: - return ScriptElementKind.alias; - case SyntaxKind.JSDocTypedefTag: - return ScriptElementKind.typeElement; - default: - return ScriptElementKind.unknown; - } - - function getKindOfVariableDeclaration(v: VariableDeclaration): string { - return isConst(v) - ? ScriptElementKind.constElement - : isLet(v) - ? ScriptElementKind.letElement - : ScriptElementKind.variableElement; - } - } - class CancellationTokenObject implements CancellationToken { constructor(private cancellationToken: HostCancellationToken) { } @@ -2563,2147 +1200,19 @@ namespace ts { program.getGlobalDiagnostics(cancellationToken)); } - /** - * Get the name to be display in completion from a given symbol. - * - * @return undefined if the name is of external module otherwise a name with striped of any quote - */ - function getCompletionEntryDisplayNameForSymbol(symbol: Symbol, target: ScriptTarget, performCharacterChecks: boolean, location: Node): string { - const displayName: string = getDeclaredName(program.getTypeChecker(), symbol, location); - - if (displayName) { - const firstCharCode = displayName.charCodeAt(0); - // First check of the displayName is not external module; if it is an external module, it is not valid entry - if ((symbol.flags & SymbolFlags.Namespace) && (firstCharCode === CharacterCodes.singleQuote || firstCharCode === CharacterCodes.doubleQuote)) { - // If the symbol is external module, don't show it in the completion list - // (i.e declare module "http" { const x; } | // <= request completion here, "http" should not be there) - return undefined; - } - } - - return getCompletionEntryDisplayName(displayName, target, performCharacterChecks); - } - - /** - * Get a displayName from a given for completion list, performing any necessary quotes stripping - * and checking whether the name is valid identifier name. - */ - function getCompletionEntryDisplayName(name: string, target: ScriptTarget, performCharacterChecks: boolean): string { - if (!name) { - return undefined; - } - - name = stripQuotes(name); - - if (!name) { - return undefined; - } - - // If the user entered name for the symbol was quoted, removing the quotes is not enough, as the name could be an - // invalid identifier name. We need to check if whatever was inside the quotes is actually a valid identifier name. - // e.g "b a" is valid quoted name but when we strip off the quotes, it is invalid. - // We, thus, need to check if whatever was inside the quotes is actually a valid identifier name. - if (performCharacterChecks) { - if (!isIdentifierText(name, target)) { - return undefined; - } - } - - return name; - } - - function getCompletionData(fileName: string, position: number) { - const typeChecker = program.getTypeChecker(); - const sourceFile = getValidSourceFile(fileName); - const isJavaScriptFile = isSourceFileJavaScript(sourceFile); - - let isJsDocTagName = false; - - let start = timestamp(); - const currentToken = getTokenAtPosition(sourceFile, position); - log("getCompletionData: Get current token: " + (timestamp() - start)); - - start = timestamp(); - // Completion not allowed inside comments, bail out if this is the case - const insideComment = isInsideComment(sourceFile, currentToken, position); - log("getCompletionData: Is inside comment: " + (timestamp() - start)); - - if (insideComment) { - // The current position is next to the '@' sign, when no tag name being provided yet. - // Provide a full list of tag names - if (hasDocComment(sourceFile, position) && sourceFile.text.charCodeAt(position - 1) === CharacterCodes.at) { - isJsDocTagName = true; - } - - // Completion should work inside certain JsDoc tags. For example: - // /** @type {number | string} */ - // Completion should work in the brackets - let insideJsDocTagExpression = false; - const tag = getJsDocTagAtPosition(sourceFile, position); - if (tag) { - if (tag.tagName.pos <= position && position <= tag.tagName.end) { - isJsDocTagName = true; - } - - switch (tag.kind) { - case SyntaxKind.JSDocTypeTag: - case SyntaxKind.JSDocParameterTag: - case SyntaxKind.JSDocReturnTag: - const tagWithExpression = tag; - if (tagWithExpression.typeExpression) { - insideJsDocTagExpression = tagWithExpression.typeExpression.pos < position && position < tagWithExpression.typeExpression.end; - } - break; - } - } - - if (isJsDocTagName) { - return { symbols: undefined, isMemberCompletion: false, isNewIdentifierLocation: false, location: undefined, isRightOfDot: false, isJsDocTagName }; - } - - if (!insideJsDocTagExpression) { - // Proceed if the current position is in jsDoc tag expression; otherwise it is a normal - // comment or the plain text part of a jsDoc comment, so no completion should be available - log("Returning an empty list because completion was inside a regular comment or plain text part of a JsDoc comment."); - return undefined; - } - } - - start = timestamp(); - const previousToken = findPrecedingToken(position, sourceFile); - log("getCompletionData: Get previous token 1: " + (timestamp() - start)); - - // The decision to provide completion depends on the contextToken, which is determined through the previousToken. - // Note: 'previousToken' (and thus 'contextToken') can be undefined if we are the beginning of the file - let contextToken = previousToken; - - // Check if the caret is at the end of an identifier; this is a partial identifier that we want to complete: e.g. a.toS| - // Skip this partial identifier and adjust the contextToken to the token that precedes it. - if (contextToken && position <= contextToken.end && isWord(contextToken.kind)) { - const start = timestamp(); - contextToken = findPrecedingToken(contextToken.getFullStart(), sourceFile); - log("getCompletionData: Get previous token 2: " + (timestamp() - start)); - } - - // Find the node where completion is requested on. - // Also determine whether we are trying to complete with members of that node - // or attributes of a JSX tag. - let node = currentToken; - let isRightOfDot = false; - let isRightOfOpenTag = false; - let isStartingCloseTag = false; - - let location = getTouchingPropertyName(sourceFile, position); - if (contextToken) { - // Bail out if this is a known invalid completion location - if (isCompletionListBlocker(contextToken)) { - log("Returning an empty list because completion was requested in an invalid position."); - return undefined; - } - - const { parent, kind } = contextToken; - if (kind === SyntaxKind.DotToken) { - if (parent.kind === SyntaxKind.PropertyAccessExpression) { - node = (contextToken.parent).expression; - isRightOfDot = true; - } - else if (parent.kind === SyntaxKind.QualifiedName) { - node = (contextToken.parent).left; - isRightOfDot = true; - } - else { - // There is nothing that precedes the dot, so this likely just a stray character - // or leading into a '...' token. Just bail out instead. - return undefined; - } - } - else if (sourceFile.languageVariant === LanguageVariant.JSX) { - if (kind === SyntaxKind.LessThanToken) { - isRightOfOpenTag = true; - location = contextToken; - } - else if (kind === SyntaxKind.SlashToken && contextToken.parent.kind === SyntaxKind.JsxClosingElement) { - isStartingCloseTag = true; - location = contextToken; - } - } - } - - const semanticStart = timestamp(); - let isMemberCompletion: boolean; - let isNewIdentifierLocation: boolean; - let symbols: Symbol[] = []; - - if (isRightOfDot) { - getTypeScriptMemberSymbols(); - } - else if (isRightOfOpenTag) { - const tagSymbols = typeChecker.getJsxIntrinsicTagNames(); - if (tryGetGlobalSymbols()) { - symbols = tagSymbols.concat(symbols.filter(s => !!(s.flags & (SymbolFlags.Value | SymbolFlags.Alias)))); - } - else { - symbols = tagSymbols; - } - isMemberCompletion = true; - isNewIdentifierLocation = false; - } - else if (isStartingCloseTag) { - const tagName = (contextToken.parent.parent).openingElement.tagName; - const tagSymbol = typeChecker.getSymbolAtLocation(tagName); - - if (!typeChecker.isUnknownSymbol(tagSymbol)) { - symbols = [tagSymbol]; - } - isMemberCompletion = true; - isNewIdentifierLocation = false; - } - else { - // For JavaScript or TypeScript, if we're not after a dot, then just try to get the - // global symbols in scope. These results should be valid for either language as - // the set of symbols that can be referenced from this location. - if (!tryGetGlobalSymbols()) { - return undefined; - } - } - - log("getCompletionData: Semantic work: " + (timestamp() - semanticStart)); - - return { symbols, isMemberCompletion, isNewIdentifierLocation, location, isRightOfDot: (isRightOfDot || isRightOfOpenTag), isJsDocTagName }; - - function getTypeScriptMemberSymbols(): void { - // Right of dot member completion list - isMemberCompletion = true; - isNewIdentifierLocation = false; - - if (node.kind === SyntaxKind.Identifier || node.kind === SyntaxKind.QualifiedName || node.kind === SyntaxKind.PropertyAccessExpression) { - let symbol = typeChecker.getSymbolAtLocation(node); - - // This is an alias, follow what it aliases - if (symbol && symbol.flags & SymbolFlags.Alias) { - symbol = typeChecker.getAliasedSymbol(symbol); - } - - if (symbol && symbol.flags & SymbolFlags.HasExports) { - // Extract module or enum members - const exportedSymbols = typeChecker.getExportsOfModule(symbol); - forEach(exportedSymbols, symbol => { - if (typeChecker.isValidPropertyAccess((node.parent), symbol.name)) { - symbols.push(symbol); - } - }); - } - } - - const type = typeChecker.getTypeAtLocation(node); - addTypeProperties(type); - } - - function addTypeProperties(type: Type) { - if (type) { - // Filter private properties - for (const symbol of type.getApparentProperties()) { - if (typeChecker.isValidPropertyAccess((node.parent), symbol.name)) { - symbols.push(symbol); - } - } - - if (isJavaScriptFile && type.flags & TypeFlags.Union) { - // In javascript files, for union types, we don't just get the members that - // the individual types have in common, we also include all the members that - // each individual type has. This is because we're going to add all identifiers - // anyways. So we might as well elevate the members that were at least part - // of the individual types to a higher status since we know what they are. - const unionType = type; - for (const elementType of unionType.types) { - addTypeProperties(elementType); - } - } - } - } - - function tryGetGlobalSymbols(): boolean { - let objectLikeContainer: ObjectLiteralExpression | BindingPattern; - let namedImportsOrExports: NamedImportsOrExports; - let jsxContainer: JsxOpeningLikeElement; - - if (objectLikeContainer = tryGetObjectLikeCompletionContainer(contextToken)) { - return tryGetObjectLikeCompletionSymbols(objectLikeContainer); - } - - if (namedImportsOrExports = tryGetNamedImportsOrExportsForCompletion(contextToken)) { - // cursor is in an import clause - // try to show exported member for imported module - return tryGetImportOrExportClauseCompletionSymbols(namedImportsOrExports); - } - - if (jsxContainer = tryGetContainingJsxElement(contextToken)) { - let attrsType: Type; - if ((jsxContainer.kind === SyntaxKind.JsxSelfClosingElement) || (jsxContainer.kind === SyntaxKind.JsxOpeningElement)) { - // Cursor is inside a JSX self-closing element or opening element - attrsType = typeChecker.getJsxElementAttributesType(jsxContainer); - - if (attrsType) { - symbols = filterJsxAttributes(typeChecker.getPropertiesOfType(attrsType), (jsxContainer).attributes); - isMemberCompletion = true; - isNewIdentifierLocation = false; - return true; - } - - } - } - - // Get all entities in the current scope. - isMemberCompletion = false; - isNewIdentifierLocation = isNewIdentifierDefinitionLocation(contextToken); - - if (previousToken !== contextToken) { - Debug.assert(!!previousToken, "Expected 'contextToken' to be defined when different from 'previousToken'."); - } - // We need to find the node that will give us an appropriate scope to begin - // aggregating completion candidates. This is achieved in 'getScopeNode' - // by finding the first node that encompasses a position, accounting for whether a node - // is "complete" to decide whether a position belongs to the node. - // - // However, at the end of an identifier, we are interested in the scope of the identifier - // itself, but fall outside of the identifier. For instance: - // - // xyz => x$ - // - // the cursor is outside of both the 'x' and the arrow function 'xyz => x', - // so 'xyz' is not returned in our results. - // - // We define 'adjustedPosition' so that we may appropriately account for - // being at the end of an identifier. The intention is that if requesting completion - // at the end of an identifier, it should be effectively equivalent to requesting completion - // anywhere inside/at the beginning of the identifier. So in the previous case, the - // 'adjustedPosition' will work as if requesting completion in the following: - // - // xyz => $x - // - // If previousToken !== contextToken, then - // - 'contextToken' was adjusted to the token prior to 'previousToken' - // because we were at the end of an identifier. - // - 'previousToken' is defined. - const adjustedPosition = previousToken !== contextToken ? - previousToken.getStart() : - position; - - const scopeNode = getScopeNode(contextToken, adjustedPosition, sourceFile) || sourceFile; - - /// TODO filter meaning based on the current context - const symbolMeanings = SymbolFlags.Type | SymbolFlags.Value | SymbolFlags.Namespace | SymbolFlags.Alias; - symbols = typeChecker.getSymbolsInScope(scopeNode, symbolMeanings); - - return true; - } - - /** - * Finds the first node that "embraces" the position, so that one may - * accurately aggregate locals from the closest containing scope. - */ - function getScopeNode(initialToken: Node, position: number, sourceFile: SourceFile) { - let scope = initialToken; - while (scope && !positionBelongsToNode(scope, position, sourceFile)) { - scope = scope.parent; - } - return scope; - } - - function isCompletionListBlocker(contextToken: Node): boolean { - const start = timestamp(); - const result = isInStringOrRegularExpressionOrTemplateLiteral(contextToken) || - isSolelyIdentifierDefinitionLocation(contextToken) || - isDotOfNumericLiteral(contextToken) || - isInJsxText(contextToken); - log("getCompletionsAtPosition: isCompletionListBlocker: " + (timestamp() - start)); - return result; - } - - function isInJsxText(contextToken: Node): boolean { - if (contextToken.kind === SyntaxKind.JsxText) { - return true; - } - - if (contextToken.kind === SyntaxKind.GreaterThanToken && contextToken.parent) { - if (contextToken.parent.kind === SyntaxKind.JsxOpeningElement) { - return true; - } - - if (contextToken.parent.kind === SyntaxKind.JsxClosingElement || contextToken.parent.kind === SyntaxKind.JsxSelfClosingElement) { - return contextToken.parent.parent && contextToken.parent.parent.kind === SyntaxKind.JsxElement; - } - } - return false; - } - - function isNewIdentifierDefinitionLocation(previousToken: Node): boolean { - if (previousToken) { - const containingNodeKind = previousToken.parent.kind; - switch (previousToken.kind) { - case SyntaxKind.CommaToken: - return containingNodeKind === SyntaxKind.CallExpression // func( a, | - || containingNodeKind === SyntaxKind.Constructor // constructor( a, | /* public, protected, private keywords are allowed here, so show completion */ - || containingNodeKind === SyntaxKind.NewExpression // new C(a, | - || containingNodeKind === SyntaxKind.ArrayLiteralExpression // [a, | - || containingNodeKind === SyntaxKind.BinaryExpression // const x = (a, | - || containingNodeKind === SyntaxKind.FunctionType; // var x: (s: string, list| - - case SyntaxKind.OpenParenToken: - return containingNodeKind === SyntaxKind.CallExpression // func( | - || containingNodeKind === SyntaxKind.Constructor // constructor( | - || containingNodeKind === SyntaxKind.NewExpression // new C(a| - || containingNodeKind === SyntaxKind.ParenthesizedExpression // const x = (a| - || containingNodeKind === SyntaxKind.ParenthesizedType; // function F(pred: (a| /* this can become an arrow function, where 'a' is the argument */ - - case SyntaxKind.OpenBracketToken: - return containingNodeKind === SyntaxKind.ArrayLiteralExpression // [ | - || containingNodeKind === SyntaxKind.IndexSignature // [ | : string ] - || containingNodeKind === SyntaxKind.ComputedPropertyName; // [ | /* this can become an index signature */ - - case SyntaxKind.ModuleKeyword: // module | - case SyntaxKind.NamespaceKeyword: // namespace | - return true; - - case SyntaxKind.DotToken: - return containingNodeKind === SyntaxKind.ModuleDeclaration; // module A.| - - case SyntaxKind.OpenBraceToken: - return containingNodeKind === SyntaxKind.ClassDeclaration; // class A{ | - - case SyntaxKind.EqualsToken: - return containingNodeKind === SyntaxKind.VariableDeclaration // const x = a| - || containingNodeKind === SyntaxKind.BinaryExpression; // x = a| - - case SyntaxKind.TemplateHead: - return containingNodeKind === SyntaxKind.TemplateExpression; // `aa ${| - - case SyntaxKind.TemplateMiddle: - return containingNodeKind === SyntaxKind.TemplateSpan; // `aa ${10} dd ${| - - case SyntaxKind.PublicKeyword: - case SyntaxKind.PrivateKeyword: - case SyntaxKind.ProtectedKeyword: - return containingNodeKind === SyntaxKind.PropertyDeclaration; // class A{ public | - } - - // Previous token may have been a keyword that was converted to an identifier. - switch (previousToken.getText()) { - case "public": - case "protected": - case "private": - return true; - } - } - - return false; - } - - function isInStringOrRegularExpressionOrTemplateLiteral(contextToken: Node): boolean { - if (contextToken.kind === SyntaxKind.StringLiteral - || contextToken.kind === SyntaxKind.RegularExpressionLiteral - || isTemplateLiteralKind(contextToken.kind)) { - const start = contextToken.getStart(); - const end = contextToken.getEnd(); - - // To be "in" one of these literals, the position has to be: - // 1. entirely within the token text. - // 2. at the end position of an unterminated token. - // 3. at the end of a regular expression (due to trailing flags like '/foo/g'). - if (start < position && position < end) { - return true; - } - - if (position === end) { - return !!(contextToken).isUnterminated - || contextToken.kind === SyntaxKind.RegularExpressionLiteral; - } - } - - return false; - } - - /** - * Aggregates relevant symbols for completion in object literals and object binding patterns. - * Relevant symbols are stored in the captured 'symbols' variable. - * - * @returns true if 'symbols' was successfully populated; false otherwise. - */ - function tryGetObjectLikeCompletionSymbols(objectLikeContainer: ObjectLiteralExpression | BindingPattern): boolean { - // We're looking up possible property names from contextual/inferred/declared type. - isMemberCompletion = true; - - let typeForObject: Type; - let existingMembers: Declaration[]; - - if (objectLikeContainer.kind === SyntaxKind.ObjectLiteralExpression) { - // We are completing on contextual types, but may also include properties - // other than those within the declared type. - isNewIdentifierLocation = true; - - // If the object literal is being assigned to something of type 'null | { hello: string }', - // it clearly isn't trying to satisfy the 'null' type. So we grab the non-nullable type if possible. - typeForObject = typeChecker.getContextualType(objectLikeContainer); - typeForObject = typeForObject && typeForObject.getNonNullableType(); - - existingMembers = (objectLikeContainer).properties; - } - else if (objectLikeContainer.kind === SyntaxKind.ObjectBindingPattern) { - // We are *only* completing on properties from the type being destructured. - isNewIdentifierLocation = false; - - const rootDeclaration = getRootDeclaration(objectLikeContainer.parent); - if (isVariableLike(rootDeclaration)) { - // We don't want to complete using the type acquired by the shape - // of the binding pattern; we are only interested in types acquired - // through type declaration or inference. - // Also proceed if rootDeclaration is a parameter and if its containing function expression/arrow function is contextually typed - - // type of parameter will flow in from the contextual type of the function - let canGetType = !!(rootDeclaration.initializer || rootDeclaration.type); - if (!canGetType && rootDeclaration.kind === SyntaxKind.Parameter) { - if (isExpression(rootDeclaration.parent)) { - canGetType = !!typeChecker.getContextualType(rootDeclaration.parent); - } - else if (rootDeclaration.parent.kind === SyntaxKind.MethodDeclaration || rootDeclaration.parent.kind === SyntaxKind.SetAccessor) { - canGetType = isExpression(rootDeclaration.parent.parent) && !!typeChecker.getContextualType(rootDeclaration.parent.parent); - } - } - if (canGetType) { - typeForObject = typeChecker.getTypeAtLocation(objectLikeContainer); - existingMembers = (objectLikeContainer).elements; - } - } - else { - Debug.fail("Root declaration is not variable-like."); - } - } - else { - Debug.fail("Expected object literal or binding pattern, got " + objectLikeContainer.kind); - } - - if (!typeForObject) { - return false; - } - - const typeMembers = typeChecker.getPropertiesOfType(typeForObject); - if (typeMembers && typeMembers.length > 0) { - // Add filtered items to the completion list - symbols = filterObjectMembersList(typeMembers, existingMembers); - } - return true; - } - - /** - * Aggregates relevant symbols for completion in import clauses and export clauses - * whose declarations have a module specifier; for instance, symbols will be aggregated for - * - * import { | } from "moduleName"; - * export { a as foo, | } from "moduleName"; - * - * but not for - * - * export { | }; - * - * Relevant symbols are stored in the captured 'symbols' variable. - * - * @returns true if 'symbols' was successfully populated; false otherwise. - */ - function tryGetImportOrExportClauseCompletionSymbols(namedImportsOrExports: NamedImportsOrExports): boolean { - const declarationKind = namedImportsOrExports.kind === SyntaxKind.NamedImports ? - SyntaxKind.ImportDeclaration : - SyntaxKind.ExportDeclaration; - const importOrExportDeclaration = getAncestor(namedImportsOrExports, declarationKind); - const moduleSpecifier = importOrExportDeclaration.moduleSpecifier; - - if (!moduleSpecifier) { - return false; - } - - isMemberCompletion = true; - isNewIdentifierLocation = false; - - let exports: Symbol[]; - const moduleSpecifierSymbol = typeChecker.getSymbolAtLocation(importOrExportDeclaration.moduleSpecifier); - if (moduleSpecifierSymbol) { - exports = typeChecker.getExportsOfModule(moduleSpecifierSymbol); - } - - symbols = exports ? filterNamedImportOrExportCompletionItems(exports, namedImportsOrExports.elements) : emptyArray; - - return true; - } - - /** - * Returns the immediate owning object literal or binding pattern of a context token, - * on the condition that one exists and that the context implies completion should be given. - */ - function tryGetObjectLikeCompletionContainer(contextToken: Node): ObjectLiteralExpression | BindingPattern { - if (contextToken) { - switch (contextToken.kind) { - case SyntaxKind.OpenBraceToken: // const x = { | - case SyntaxKind.CommaToken: // const x = { a: 0, | - const parent = contextToken.parent; - if (parent && (parent.kind === SyntaxKind.ObjectLiteralExpression || parent.kind === SyntaxKind.ObjectBindingPattern)) { - return parent; - } - break; - } - } - - return undefined; - } - - /** - * Returns the containing list of named imports or exports of a context token, - * on the condition that one exists and that the context implies completion should be given. - */ - function tryGetNamedImportsOrExportsForCompletion(contextToken: Node): NamedImportsOrExports { - if (contextToken) { - switch (contextToken.kind) { - case SyntaxKind.OpenBraceToken: // import { | - case SyntaxKind.CommaToken: // import { a as 0, | - switch (contextToken.parent.kind) { - case SyntaxKind.NamedImports: - case SyntaxKind.NamedExports: - return contextToken.parent; - } - } - } - - return undefined; - } - - function tryGetContainingJsxElement(contextToken: Node): JsxOpeningLikeElement { - if (contextToken) { - const parent = contextToken.parent; - switch (contextToken.kind) { - case SyntaxKind.LessThanSlashToken: - case SyntaxKind.SlashToken: - case SyntaxKind.Identifier: - case SyntaxKind.JsxAttribute: - case SyntaxKind.JsxSpreadAttribute: - if (parent && (parent.kind === SyntaxKind.JsxSelfClosingElement || parent.kind === SyntaxKind.JsxOpeningElement)) { - return parent; - } - else if (parent.kind === SyntaxKind.JsxAttribute) { - return parent.parent; - } - break; - - // The context token is the closing } or " of an attribute, which means - // its parent is a JsxExpression, whose parent is a JsxAttribute, - // whose parent is a JsxOpeningLikeElement - case SyntaxKind.StringLiteral: - if (parent && ((parent.kind === SyntaxKind.JsxAttribute) || (parent.kind === SyntaxKind.JsxSpreadAttribute))) { - return parent.parent; - } - - break; - - case SyntaxKind.CloseBraceToken: - if (parent && - parent.kind === SyntaxKind.JsxExpression && - parent.parent && - (parent.parent.kind === SyntaxKind.JsxAttribute)) { - return parent.parent.parent; - } - - if (parent && parent.kind === SyntaxKind.JsxSpreadAttribute) { - return parent.parent; - } - - break; - } - } - return undefined; - } - - function isFunction(kind: SyntaxKind): boolean { - switch (kind) { - case SyntaxKind.FunctionExpression: - case SyntaxKind.ArrowFunction: - case SyntaxKind.FunctionDeclaration: - case SyntaxKind.MethodDeclaration: - case SyntaxKind.MethodSignature: - case SyntaxKind.GetAccessor: - case SyntaxKind.SetAccessor: - case SyntaxKind.CallSignature: - case SyntaxKind.ConstructSignature: - case SyntaxKind.IndexSignature: - return true; - } - return false; - } - - /** - * @returns true if we are certain that the currently edited location must define a new location; false otherwise. - */ - function isSolelyIdentifierDefinitionLocation(contextToken: Node): boolean { - const containingNodeKind = contextToken.parent.kind; - switch (contextToken.kind) { - case SyntaxKind.CommaToken: - return containingNodeKind === SyntaxKind.VariableDeclaration || - containingNodeKind === SyntaxKind.VariableDeclarationList || - containingNodeKind === SyntaxKind.VariableStatement || - containingNodeKind === SyntaxKind.EnumDeclaration || // enum a { foo, | - isFunction(containingNodeKind) || - containingNodeKind === SyntaxKind.ClassDeclaration || // class A(); - - for (const element of namedImportsOrExports) { - // If this is the current item we are editing right now, do not filter it out - if (element.getStart() <= position && position <= element.getEnd()) { - continue; - } - - const name = element.propertyName || element.name; - existingImportsOrExports[name.text] = true; - } - - if (!someProperties(existingImportsOrExports)) { - return filter(exportsOfModule, e => e.name !== "default"); - } - - return filter(exportsOfModule, e => e.name !== "default" && !existingImportsOrExports[e.name]); - } - - /** - * Filters out completion suggestions for named imports or exports. - * - * @returns Symbols to be suggested in an object binding pattern or object literal expression, barring those whose declarations - * do not occur at the current position and have not otherwise been typed. - */ - function filterObjectMembersList(contextualMemberSymbols: Symbol[], existingMembers: Declaration[]): Symbol[] { - if (!existingMembers || existingMembers.length === 0) { - return contextualMemberSymbols; - } - - const existingMemberNames = createMap(); - for (const m of existingMembers) { - // Ignore omitted expressions for missing members - if (m.kind !== SyntaxKind.PropertyAssignment && - m.kind !== SyntaxKind.ShorthandPropertyAssignment && - m.kind !== SyntaxKind.BindingElement && - m.kind !== SyntaxKind.MethodDeclaration) { - continue; - } - - // If this is the current item we are editing right now, do not filter it out - if (m.getStart() <= position && position <= m.getEnd()) { - continue; - } - - let existingName: string; - - if (m.kind === SyntaxKind.BindingElement && (m).propertyName) { - // include only identifiers in completion list - if ((m).propertyName.kind === SyntaxKind.Identifier) { - existingName = ((m).propertyName).text; - } - } - else { - // TODO(jfreeman): Account for computed property name - // NOTE: if one only performs this step when m.name is an identifier, - // things like '__proto__' are not filtered out. - existingName = (m.name).text; - } - - existingMemberNames[existingName] = true; - } - - return filter(contextualMemberSymbols, m => !existingMemberNames[m.name]); - } - - /** - * Filters out completion suggestions from 'symbols' according to existing JSX attributes. - * - * @returns Symbols to be suggested in a JSX element, barring those whose attributes - * do not occur at the current position and have not otherwise been typed. - */ - function filterJsxAttributes(symbols: Symbol[], attributes: NodeArray): Symbol[] { - const seenNames = createMap(); - for (const attr of attributes) { - // If this is the current item we are editing right now, do not filter it out - if (attr.getStart() <= position && position <= attr.getEnd()) { - continue; - } - - if (attr.kind === SyntaxKind.JsxAttribute) { - seenNames[(attr).name.text] = true; - } - } - - return filter(symbols, a => !seenNames[a.name]); - } - } - function getCompletionsAtPosition(fileName: string, position: number): CompletionInfo { synchronizeHostData(); - - const sourceFile = getValidSourceFile(fileName); - - if (isInReferenceComment(sourceFile, position)) { - return getTripleSlashReferenceCompletion(sourceFile, position); - } - - if (isInString(sourceFile, position)) { - return getStringLiteralCompletionEntries(sourceFile, position); - } - - const completionData = getCompletionData(fileName, position); - if (!completionData) { - return undefined; - } - - const { symbols, isMemberCompletion, isNewIdentifierLocation, location, isJsDocTagName } = completionData; - - if (isJsDocTagName) { - // If the current position is a jsDoc tag name, only tag names should be provided for completion - return { isMemberCompletion: false, isNewIdentifierLocation: false, entries: getAllJsDocCompletionEntries() }; - } - - const entries: CompletionEntry[] = []; - - if (isSourceFileJavaScript(sourceFile)) { - const uniqueNames = getCompletionEntriesFromSymbols(symbols, entries, location, /*performCharacterChecks*/ false); - addRange(entries, getJavaScriptCompletionEntries(sourceFile, location.pos, uniqueNames)); - } - else { - if (!symbols || symbols.length === 0) { - if (sourceFile.languageVariant === LanguageVariant.JSX && - location.parent && location.parent.kind === SyntaxKind.JsxClosingElement) { - // In the TypeScript JSX element, if such element is not defined. When users query for completion at closing tag, - // instead of simply giving unknown value, the completion will return the tag-name of an associated opening-element. - // For example: - // var x =
completion list at "1" will contain "div" with type any - const tagName = (location.parent.parent).openingElement.tagName; - entries.push({ - name: (tagName).text, - kind: undefined, - kindModifiers: undefined, - sortText: "0", - }); - } - else { - return undefined; - } - } - - getCompletionEntriesFromSymbols(symbols, entries, location, /*performCharacterChecks*/ true); - } - - // Add keywords if this is not a member completion list - if (!isMemberCompletion && !isJsDocTagName) { - addRange(entries, keywordCompletions); - } - - return { isMemberCompletion, isNewIdentifierLocation: isNewIdentifierLocation || isSourceFileJavaScript(sourceFile), entries }; - - function getJavaScriptCompletionEntries(sourceFile: SourceFile, position: number, uniqueNames: Map): CompletionEntry[] { - const entries: CompletionEntry[] = []; - const target = program.getCompilerOptions().target; - - const nameTable = getNameTable(sourceFile); - for (const name in nameTable) { - // Skip identifiers produced only from the current location - if (nameTable[name] === position) { - continue; - } - - if (!uniqueNames[name]) { - uniqueNames[name] = name; - const displayName = getCompletionEntryDisplayName(unescapeIdentifier(name), target, /*performCharacterChecks*/ true); - if (displayName) { - const entry = { - name: displayName, - kind: ScriptElementKind.warning, - kindModifiers: "", - sortText: "1" - }; - entries.push(entry); - } - } - } - - return entries; - } - - function getAllJsDocCompletionEntries(): CompletionEntry[] { - return jsDocCompletionEntries || (jsDocCompletionEntries = ts.map(jsDocTagNames, tagName => { - return { - name: tagName, - kind: ScriptElementKind.keyword, - kindModifiers: "", - sortText: "0", - }; - })); - } - - function createCompletionEntry(symbol: Symbol, location: Node, performCharacterChecks: boolean): CompletionEntry { - // Try to get a valid display name for this symbol, if we could not find one, then ignore it. - // We would like to only show things that can be added after a dot, so for instance numeric properties can - // not be accessed with a dot (a.1 <- invalid) - const displayName = getCompletionEntryDisplayNameForSymbol(symbol, program.getCompilerOptions().target, performCharacterChecks, location); - if (!displayName) { - return undefined; - } - - // TODO(drosen): Right now we just permit *all* semantic meanings when calling - // 'getSymbolKind' which is permissible given that it is backwards compatible; but - // really we should consider passing the meaning for the node so that we don't report - // that a suggestion for a value is an interface. We COULD also just do what - // 'getSymbolModifiers' does, which is to use the first declaration. - - // Use a 'sortText' of 0' so that all symbol completion entries come before any other - // entries (like JavaScript identifier entries). - return { - name: displayName, - kind: getSymbolKind(symbol, location), - kindModifiers: getSymbolModifiers(symbol), - sortText: "0", - }; - - } - - function getCompletionEntriesFromSymbols(symbols: Symbol[], entries: CompletionEntry[], location: Node, performCharacterChecks: boolean): Map { - const start = timestamp(); - const uniqueNames = createMap(); - if (symbols) { - for (const symbol of symbols) { - const entry = createCompletionEntry(symbol, location, performCharacterChecks); - if (entry) { - const id = escapeIdentifier(entry.name); - if (!uniqueNames[id]) { - entries.push(entry); - uniqueNames[id] = id; - } - } - } - } - - log("getCompletionsAtPosition: getCompletionEntriesFromSymbols: " + (timestamp() - start)); - return uniqueNames; - } - - function getStringLiteralCompletionEntries(sourceFile: SourceFile, position: number) { - const node = findPrecedingToken(position, sourceFile); - if (!node || node.kind !== SyntaxKind.StringLiteral) { - return undefined; - } - - if (node.parent.kind === SyntaxKind.PropertyAssignment && node.parent.parent.kind === SyntaxKind.ObjectLiteralExpression) { - // Get quoted name of properties of the object literal expression - // i.e. interface ConfigFiles { - // 'jspm:dev': string - // } - // let files: ConfigFiles = { - // '/*completion position*/' - // } - // - // function foo(c: ConfigFiles) {} - // foo({ - // '/*completion position*/' - // }); - return getStringLiteralCompletionEntriesFromPropertyAssignment(node.parent); - } - else if (isElementAccessExpression(node.parent) && node.parent.argumentExpression === node) { - // Get all names of properties on the expression - // i.e. interface A { - // 'prop1': string - // } - // let a: A; - // a['/*completion position*/'] - return getStringLiteralCompletionEntriesFromElementAccess(node.parent); - } - else if (node.parent.kind === SyntaxKind.ImportDeclaration || isExpressionOfExternalModuleImportEqualsDeclaration(node) || isRequireCall(node.parent, false)) { - // Get all known external module names or complete a path to a module - // i.e. import * as ns from "/*completion position*/"; - // import x = require("/*completion position*/"); - // var y = require("/*completion position*/"); - return getStringLiteralCompletionEntriesFromModuleNames(node); - } - else { - const argumentInfo = SignatureHelp.getContainingArgumentInfo(node, position, sourceFile); - if (argumentInfo) { - // Get string literal completions from specialized signatures of the target - // i.e. declare function f(a: 'A'); - // f("/*completion position*/") - return getStringLiteralCompletionEntriesFromCallExpression(argumentInfo, node); - } - - // Get completion for string literal from string literal type - // i.e. var x: "hi" | "hello" = "/*completion position*/" - return getStringLiteralCompletionEntriesFromContextualType(node); - } - } - - function getStringLiteralCompletionEntriesFromPropertyAssignment(element: ObjectLiteralElement) { - const typeChecker = program.getTypeChecker(); - const type = typeChecker.getContextualType((element.parent)); - const entries: CompletionEntry[] = []; - if (type) { - getCompletionEntriesFromSymbols(type.getApparentProperties(), entries, element, /*performCharacterChecks*/false); - if (entries.length) { - return { isMemberCompletion: true, isNewIdentifierLocation: true, entries }; - } - } - } - - function getStringLiteralCompletionEntriesFromCallExpression(argumentInfo: SignatureHelp.ArgumentListInfo, location: Node) { - const typeChecker = program.getTypeChecker(); - const candidates: Signature[] = []; - const entries: CompletionEntry[] = []; - - typeChecker.getResolvedSignature(argumentInfo.invocation, candidates); - - for (const candidate of candidates) { - if (candidate.parameters.length > argumentInfo.argumentIndex) { - const parameter = candidate.parameters[argumentInfo.argumentIndex]; - addStringLiteralCompletionsFromType(typeChecker.getTypeAtLocation(parameter.valueDeclaration), entries); - } - } - - if (entries.length) { - return { isMemberCompletion: false, isNewIdentifierLocation: true, entries }; - } - - return undefined; - } - - function getStringLiteralCompletionEntriesFromElementAccess(node: ElementAccessExpression) { - const typeChecker = program.getTypeChecker(); - const type = typeChecker.getTypeAtLocation(node.expression); - const entries: CompletionEntry[] = []; - if (type) { - getCompletionEntriesFromSymbols(type.getApparentProperties(), entries, node, /*performCharacterChecks*/false); - if (entries.length) { - return { isMemberCompletion: true, isNewIdentifierLocation: true, entries }; - } - } - return undefined; - } - - function getStringLiteralCompletionEntriesFromContextualType(node: StringLiteral) { - const typeChecker = program.getTypeChecker(); - const type = typeChecker.getContextualType(node); - if (type) { - const entries: CompletionEntry[] = []; - addStringLiteralCompletionsFromType(type, entries); - if (entries.length) { - return { isMemberCompletion: false, isNewIdentifierLocation: false, entries }; - } - } - return undefined; - } - - function addStringLiteralCompletionsFromType(type: Type, result: CompletionEntry[]): void { - if (!type) { - return; - } - if (type.flags & TypeFlags.Union) { - forEach((type).types, t => addStringLiteralCompletionsFromType(t, result)); - } - else { - if (type.flags & TypeFlags.StringLiteral) { - result.push({ - name: (type).text, - kindModifiers: ScriptElementKindModifier.none, - kind: ScriptElementKind.variableElement, - sortText: "0" - }); - } - } - } - - function getStringLiteralCompletionEntriesFromModuleNames(node: StringLiteral): CompletionInfo { - const literalValue = normalizeSlashes(node.text); - - const scriptPath = node.getSourceFile().path; - const scriptDirectory = getDirectoryPath(scriptPath); - - const span = getDirectoryFragmentTextSpan((node).text, node.getStart() + 1); - let entries: CompletionEntry[]; - if (isPathRelativeToScript(literalValue) || isRootedDiskPath(literalValue)) { - const compilerOptions = program.getCompilerOptions(); - if (compilerOptions.rootDirs) { - entries = getCompletionEntriesForDirectoryFragmentWithRootDirs( - compilerOptions.rootDirs, literalValue, scriptDirectory, getSupportedExtensions(program.getCompilerOptions()), /*includeExtensions*/false, span, scriptPath); - } - else { - entries = getCompletionEntriesForDirectoryFragment( - literalValue, scriptDirectory, getSupportedExtensions(program.getCompilerOptions()), /*includeExtensions*/false, span, scriptPath); - } - } - else { - // Check for node modules - entries = getCompletionEntriesForNonRelativeModules(literalValue, scriptDirectory, span); - } - return { - isMemberCompletion: false, - isNewIdentifierLocation: true, - entries - }; - } - - /** - * Takes a script path and returns paths for all potential folders that could be merged with its - * containing folder via the "rootDirs" compiler option - */ - function getBaseDirectoriesFromRootDirs(rootDirs: string[], basePath: string, scriptPath: string, ignoreCase: boolean): string[] { - // Make all paths absolute/normalized if they are not already - rootDirs = map(rootDirs, rootDirectory => normalizePath(isRootedDiskPath(rootDirectory) ? rootDirectory : combinePaths(basePath, rootDirectory))); - - // Determine the path to the directory containing the script relative to the root directory it is contained within - let relativeDirectory: string; - for (const rootDirectory of rootDirs) { - if (containsPath(rootDirectory, scriptPath, basePath, ignoreCase)) { - relativeDirectory = scriptPath.substr(rootDirectory.length); - break; - } - } - - // Now find a path for each potential directory that is to be merged with the one containing the script - return deduplicate(map(rootDirs, rootDirectory => combinePaths(rootDirectory, relativeDirectory))); - } - - function getCompletionEntriesForDirectoryFragmentWithRootDirs(rootDirs: string[], fragment: string, scriptPath: string, extensions: string[], includeExtensions: boolean, span: TextSpan, exclude?: string): CompletionEntry[] { - const basePath = program.getCompilerOptions().project || host.getCurrentDirectory(); - const ignoreCase = !(host.useCaseSensitiveFileNames && host.useCaseSensitiveFileNames()); - const baseDirectories = getBaseDirectoriesFromRootDirs(rootDirs, basePath, scriptPath, ignoreCase); - - const result: CompletionEntry[] = []; - - for (const baseDirectory of baseDirectories) { - getCompletionEntriesForDirectoryFragment(fragment, baseDirectory, extensions, includeExtensions, span, exclude, result); - } - - return result; - } - - function getCompletionEntriesForDirectoryFragment(fragment: string, scriptPath: string, extensions: string[], includeExtensions: boolean, span: TextSpan, exclude?: string, result: CompletionEntry[] = []): CompletionEntry[] { - fragment = getDirectoryPath(fragment); - if (!fragment) { - fragment = "./"; - } - else { - fragment = ensureTrailingDirectorySeparator(fragment); - } - - const absolutePath = normalizeAndPreserveTrailingSlash(isRootedDiskPath(fragment) ? fragment : combinePaths(scriptPath, fragment)); - const baseDirectory = getDirectoryPath(absolutePath); - const ignoreCase = !(host.useCaseSensitiveFileNames && host.useCaseSensitiveFileNames()); - - if (directoryProbablyExists(baseDirectory, host)) { - if (host.readDirectory) { - // Enumerate the available files if possible - const files = host.readDirectory(baseDirectory, extensions, /*exclude*/undefined, /*include*/["./*"]); - const foundFiles = createMap(); - for (let filePath of files) { - filePath = normalizePath(filePath); - if (exclude && comparePaths(filePath, exclude, scriptPath, ignoreCase) === Comparison.EqualTo) { - continue; - } - - const foundFileName = includeExtensions ? getBaseFileName(filePath) : removeFileExtension(getBaseFileName(filePath)); - - if (!foundFiles[foundFileName]) { - foundFiles[foundFileName] = true; - } - } - - for (const foundFile in foundFiles) { - result.push(createCompletionEntryForModule(foundFile, ScriptElementKind.scriptElement, span)); - } - } - - // If possible, get folder completion as well - if (host.getDirectories) { - const directories = host.getDirectories(baseDirectory); - for (const directory of directories) { - const directoryName = getBaseFileName(normalizePath(directory)); - - result.push(createCompletionEntryForModule(directoryName, ScriptElementKind.directory, span)); - } - } - } - - return result; - } - - /** - * Check all of the declared modules and those in node modules. Possible sources of modules: - * Modules that are found by the type checker - * Modules found relative to "baseUrl" compliler options (including patterns from "paths" compiler option) - * Modules from node_modules (i.e. those listed in package.json) - * This includes all files that are found in node_modules/moduleName/ with acceptable file extensions - */ - function getCompletionEntriesForNonRelativeModules(fragment: string, scriptPath: string, span: TextSpan): CompletionEntry[] { - const options = program.getCompilerOptions(); - const { baseUrl, paths } = options; - - let result: CompletionEntry[]; - - if (baseUrl) { - const fileExtensions = getSupportedExtensions(options); - const projectDir = options.project || host.getCurrentDirectory(); - const absolute = isRootedDiskPath(baseUrl) ? baseUrl : combinePaths(projectDir, baseUrl); - result = getCompletionEntriesForDirectoryFragment(fragment, normalizePath(absolute), fileExtensions, /*includeExtensions*/false, span); - - if (paths) { - for (const path in paths) { - if (paths.hasOwnProperty(path)) { - if (path === "*") { - if (paths[path]) { - for (const pattern of paths[path]) { - for (const match of getModulesForPathsPattern(fragment, baseUrl, pattern, fileExtensions)) { - result.push(createCompletionEntryForModule(match, ScriptElementKind.externalModuleName, span)); - } - } - } - } - else if (startsWith(path, fragment)) { - const entry = paths[path] && paths[path].length === 1 && paths[path][0]; - if (entry) { - result.push(createCompletionEntryForModule(path, ScriptElementKind.externalModuleName, span)); - } - } - } - } - } - } - else { - result = []; - } - - getCompletionEntriesFromTypings(host, options, scriptPath, span, result); - - for (const moduleName of enumeratePotentialNonRelativeModules(fragment, scriptPath, options)) { - result.push(createCompletionEntryForModule(moduleName, ScriptElementKind.externalModuleName, span)); - } - - return result; - } - - function getModulesForPathsPattern(fragment: string, baseUrl: string, pattern: string, fileExtensions: string[]): string[] { - if (host.readDirectory) { - const parsed = hasZeroOrOneAsteriskCharacter(pattern) ? tryParsePattern(pattern) : undefined; - if (parsed) { - // The prefix has two effective parts: the directory path and the base component after the filepath that is not a - // full directory component. For example: directory/path/of/prefix/base* - const normalizedPrefix = normalizeAndPreserveTrailingSlash(parsed.prefix); - const normalizedPrefixDirectory = getDirectoryPath(normalizedPrefix); - const normalizedPrefixBase = getBaseFileName(normalizedPrefix); - - const fragmentHasPath = fragment.indexOf(directorySeparator) !== -1; - - // Try and expand the prefix to include any path from the fragment so that we can limit the readDirectory call - const expandedPrefixDirectory = fragmentHasPath ? combinePaths(normalizedPrefixDirectory, normalizedPrefixBase + getDirectoryPath(fragment)) : normalizedPrefixDirectory; - - const normalizedSuffix = normalizePath(parsed.suffix); - const baseDirectory = combinePaths(baseUrl, expandedPrefixDirectory); - const completePrefix = fragmentHasPath ? baseDirectory : ensureTrailingDirectorySeparator(baseDirectory) + normalizedPrefixBase; - - // If we have a suffix, then we need to read the directory all the way down. We could create a glob - // that encodes the suffix, but we would have to escape the character "?" which readDirectory - // doesn't support. For now, this is safer but slower - const includeGlob = normalizedSuffix ? "**/*" : "./*"; - - const matches = host.readDirectory(baseDirectory, fileExtensions, undefined, [includeGlob]); - const result: string[] = []; - - // Trim away prefix and suffix - for (const match of matches) { - const normalizedMatch = normalizePath(match); - if (!endsWith(normalizedMatch, normalizedSuffix) || !startsWith(normalizedMatch, completePrefix)) { - continue; - } - - const start = completePrefix.length; - const length = normalizedMatch.length - start - normalizedSuffix.length; - - result.push(removeFileExtension(normalizedMatch.substr(start, length))); - } - return result; - } - } - - return undefined; - } - - function enumeratePotentialNonRelativeModules(fragment: string, scriptPath: string, options: CompilerOptions): string[] { - // Check If this is a nested module - const isNestedModule = fragment.indexOf(directorySeparator) !== -1; - const moduleNameFragment = isNestedModule ? fragment.substr(0, fragment.lastIndexOf(directorySeparator)) : undefined; - - // Get modules that the type checker picked up - const ambientModules = map(program.getTypeChecker().getAmbientModules(), sym => stripQuotes(sym.name)); - let nonRelativeModules = filter(ambientModules, moduleName => startsWith(moduleName, fragment)); - - // Nested modules of the form "module-name/sub" need to be adjusted to only return the string - // after the last '/' that appears in the fragment because that's where the replacement span - // starts - if (isNestedModule) { - const moduleNameWithSeperator = ensureTrailingDirectorySeparator(moduleNameFragment); - nonRelativeModules = map(nonRelativeModules, moduleName => { - if (startsWith(fragment, moduleNameWithSeperator)) { - return moduleName.substr(moduleNameWithSeperator.length); - } - return moduleName; - }); - } - - - if (!options.moduleResolution || options.moduleResolution === ModuleResolutionKind.NodeJs) { - for (const visibleModule of enumerateNodeModulesVisibleToScript(host, scriptPath)) { - if (!isNestedModule) { - nonRelativeModules.push(visibleModule.moduleName); - } - else if (host.readDirectory && startsWith(visibleModule.moduleName, moduleNameFragment)) { - const nestedFiles = host.readDirectory(visibleModule.moduleDir, supportedTypeScriptExtensions, /*exclude*/undefined, /*include*/["./*"]); - - for (let f of nestedFiles) { - f = normalizePath(f); - const nestedModule = removeFileExtension(getBaseFileName(f)); - nonRelativeModules.push(nestedModule); - } - } - } - } - - return deduplicate(nonRelativeModules); - } - - function getTripleSlashReferenceCompletion(sourceFile: SourceFile, position: number): CompletionInfo { - const token = getTokenAtPosition(sourceFile, position); - if (!token) { - return undefined; - } - const commentRanges: CommentRange[] = getLeadingCommentRanges(sourceFile.text, token.pos); - - if (!commentRanges || !commentRanges.length) { - return undefined; - } - - const range = forEach(commentRanges, commentRange => position >= commentRange.pos && position <= commentRange.end && commentRange); - - if (!range) { - return undefined; - } - - const text = sourceFile.text.substr(range.pos, position - range.pos); - - const match = tripleSlashDirectiveFragmentRegex.exec(text); - if (match) { - const prefix = match[1]; - const kind = match[2]; - const toComplete = match[3]; - - const scriptPath = getDirectoryPath(sourceFile.path); - let entries: CompletionEntry[]; - if (kind === "path") { - // Give completions for a relative path - const span: TextSpan = getDirectoryFragmentTextSpan(toComplete, range.pos + prefix.length); - entries = getCompletionEntriesForDirectoryFragment(toComplete, scriptPath, getSupportedExtensions(program.getCompilerOptions()), /*includeExtensions*/true, span, sourceFile.path); - } - else { - // Give completions based on the typings available - const span: TextSpan = { start: range.pos + prefix.length, length: match[0].length - prefix.length }; - entries = getCompletionEntriesFromTypings(host, program.getCompilerOptions(), scriptPath, span); - } - - return { - isMemberCompletion: false, - isNewIdentifierLocation: true, - entries - }; - } - - return undefined; - } - - function getCompletionEntriesFromTypings(host: LanguageServiceHost, options: CompilerOptions, scriptPath: string, span: TextSpan, result: CompletionEntry[] = []): CompletionEntry[] { - // Check for typings specified in compiler options - if (options.types) { - for (const moduleName of options.types) { - result.push(createCompletionEntryForModule(moduleName, ScriptElementKind.externalModuleName, span)); - } - } - else if (host.getDirectories) { - const typeRoots = getEffectiveTypeRoots(options, host); - for (const root of typeRoots) { - getCompletionEntriesFromDirectories(host, options, root, span, result); - } - } - - if (host.getDirectories) { - // Also get all @types typings installed in visible node_modules directories - for (const package of findPackageJsons(scriptPath)) { - const typesDir = combinePaths(getDirectoryPath(package), "node_modules/@types"); - getCompletionEntriesFromDirectories(host, options, typesDir, span, result); - } - } - - return result; - } - - function getCompletionEntriesFromDirectories(host: LanguageServiceHost, options: CompilerOptions, directory: string, span: TextSpan, result: CompletionEntry[]) { - if (host.getDirectories && directoryProbablyExists(directory, host)) { - for (let typeDirectory of host.getDirectories(directory)) { - typeDirectory = normalizePath(typeDirectory); - result.push(createCompletionEntryForModule(getBaseFileName(typeDirectory), ScriptElementKind.externalModuleName, span)); - } - } - } - - function findPackageJsons(currentDir: string): string[] { - const paths: string[] = []; - let currentConfigPath: string; - while (true) { - currentConfigPath = findConfigFile(currentDir, (f) => host.fileExists(f), "package.json"); - if (currentConfigPath) { - paths.push(currentConfigPath); - - currentDir = getDirectoryPath(currentConfigPath); - const parent = getDirectoryPath(currentDir); - if (currentDir === parent) { - break; - } - currentDir = parent; - } - else { - break; - } - } - - return paths; - } - - - function enumerateNodeModulesVisibleToScript(host: LanguageServiceHost, scriptPath: string) { - const result: VisibleModuleInfo[] = []; - - if (host.readFile && host.fileExists) { - for (const packageJson of findPackageJsons(scriptPath)) { - const package = tryReadingPackageJson(packageJson); - if (!package) { - return; - } - - const nodeModulesDir = combinePaths(getDirectoryPath(packageJson), "node_modules"); - const foundModuleNames: string[] = []; - - // Provide completions for all non @types dependencies - for (const key of nodeModulesDependencyKeys) { - addPotentialPackageNames(package[key], foundModuleNames); - } - - for (const moduleName of foundModuleNames) { - const moduleDir = combinePaths(nodeModulesDir, moduleName); - result.push({ - moduleName, - moduleDir - }); - } - } - } - - return result; - - function tryReadingPackageJson(filePath: string) { - try { - const fileText = host.readFile(filePath); - return JSON.parse(fileText); - } - catch (e) { - return undefined; - } - } - - function addPotentialPackageNames(dependencies: any, result: string[]) { - if (dependencies) { - for (const dep in dependencies) { - if (dependencies.hasOwnProperty(dep) && !startsWith(dep, "@types/")) { - result.push(dep); - } - } - } - } - } - - function createCompletionEntryForModule(name: string, kind: string, replacementSpan: TextSpan): CompletionEntry { - return { name, kind, kindModifiers: ScriptElementKindModifier.none, sortText: name, replacementSpan }; - } - - // Replace everything after the last directory seperator that appears - function getDirectoryFragmentTextSpan(text: string, textStart: number): TextSpan { - const index = text.lastIndexOf(directorySeparator); - const offset = index !== -1 ? index + 1 : 0; - return { start: textStart + offset, length: text.length - offset }; - } - - // Returns true if the path is explicitly relative to the script (i.e. relative to . or ..) - function isPathRelativeToScript(path: string) { - if (path && path.length >= 2 && path.charCodeAt(0) === CharacterCodes.dot) { - const slashIndex = path.length >= 3 && path.charCodeAt(1) === CharacterCodes.dot ? 2 : 1; - const slashCharCode = path.charCodeAt(slashIndex); - return slashCharCode === CharacterCodes.slash || slashCharCode === CharacterCodes.backslash; - } - return false; - } - - function normalizeAndPreserveTrailingSlash(path: string) { - return hasTrailingDirectorySeparator(path) ? ensureTrailingDirectorySeparator(normalizePath(path)) : normalizePath(path); - } + return Completions.getCompletionsAtPosition(host, program.getTypeChecker(), log, program.getCompilerOptions(), getValidSourceFile(fileName), position); } function getCompletionEntryDetails(fileName: string, position: number, entryName: string): CompletionEntryDetails { synchronizeHostData(); - - // Compute all the completion symbols again. - const completionData = getCompletionData(fileName, position); - if (completionData) { - const { symbols, location } = completionData; - - // Find the symbol with the matching entry name. - const target = program.getCompilerOptions().target; - // We don't need to perform character checks here because we're only comparing the - // name against 'entryName' (which is known to be good), not building a new - // completion entry. - const symbol = forEach(symbols, s => getCompletionEntryDisplayNameForSymbol(s, target, /*performCharacterChecks*/ false, location) === entryName ? s : undefined); - - if (symbol) { - const { displayParts, documentation, symbolKind } = getSymbolDisplayPartsDocumentationAndSymbolKind(symbol, getValidSourceFile(fileName), location, location, SemanticMeaning.All); - return { - name: entryName, - kindModifiers: getSymbolModifiers(symbol), - kind: symbolKind, - displayParts, - documentation - }; - } - } - - // Didn't find a symbol with this name. See if we can find a keyword instead. - const keywordCompletion = forEach(keywordCompletions, c => c.name === entryName); - if (keywordCompletion) { - return { - name: entryName, - kind: ScriptElementKind.keyword, - kindModifiers: ScriptElementKindModifier.none, - displayParts: [displayPart(entryName, SymbolDisplayPartKind.keyword)], - documentation: undefined - }; - } - - return undefined; + return Completions.getCompletionEntryDetails(program.getTypeChecker(), log, program.getCompilerOptions(), getValidSourceFile(fileName), position, entryName); } - // TODO(drosen): use contextual SemanticMeaning. - function getSymbolKind(symbol: Symbol, location: Node): string { - const flags = symbol.getFlags(); - - if (flags & SymbolFlags.Class) return getDeclarationOfKind(symbol, SyntaxKind.ClassExpression) ? - ScriptElementKind.localClassElement : ScriptElementKind.classElement; - if (flags & SymbolFlags.Enum) return ScriptElementKind.enumElement; - if (flags & SymbolFlags.TypeAlias) return ScriptElementKind.typeElement; - if (flags & SymbolFlags.Interface) return ScriptElementKind.interfaceElement; - if (flags & SymbolFlags.TypeParameter) return ScriptElementKind.typeParameterElement; - - const result = getSymbolKindOfConstructorPropertyMethodAccessorFunctionOrVar(symbol, flags, location); - if (result === ScriptElementKind.unknown) { - if (flags & SymbolFlags.TypeParameter) return ScriptElementKind.typeParameterElement; - if (flags & SymbolFlags.EnumMember) return ScriptElementKind.variableElement; - if (flags & SymbolFlags.Alias) return ScriptElementKind.alias; - if (flags & SymbolFlags.Module) return ScriptElementKind.moduleElement; - } - - return result; - } - - function getSymbolKindOfConstructorPropertyMethodAccessorFunctionOrVar(symbol: Symbol, flags: SymbolFlags, location: Node) { - const typeChecker = program.getTypeChecker(); - - if (typeChecker.isUndefinedSymbol(symbol)) { - return ScriptElementKind.variableElement; - } - if (typeChecker.isArgumentsSymbol(symbol)) { - return ScriptElementKind.localVariableElement; - } - if (location.kind === SyntaxKind.ThisKeyword && isExpression(location)) { - return ScriptElementKind.parameterElement; - } - if (flags & SymbolFlags.Variable) { - if (isFirstDeclarationOfSymbolParameter(symbol)) { - return ScriptElementKind.parameterElement; - } - else if (symbol.valueDeclaration && isConst(symbol.valueDeclaration)) { - return ScriptElementKind.constElement; - } - else if (forEach(symbol.declarations, isLet)) { - return ScriptElementKind.letElement; - } - return isLocalVariableOrFunction(symbol) ? ScriptElementKind.localVariableElement : ScriptElementKind.variableElement; - } - if (flags & SymbolFlags.Function) return isLocalVariableOrFunction(symbol) ? ScriptElementKind.localFunctionElement : ScriptElementKind.functionElement; - if (flags & SymbolFlags.GetAccessor) return ScriptElementKind.memberGetAccessorElement; - if (flags & SymbolFlags.SetAccessor) return ScriptElementKind.memberSetAccessorElement; - if (flags & SymbolFlags.Method) return ScriptElementKind.memberFunctionElement; - if (flags & SymbolFlags.Constructor) return ScriptElementKind.constructorImplementationElement; - - if (flags & SymbolFlags.Property) { - if (flags & SymbolFlags.SyntheticProperty) { - // If union property is result of union of non method (property/accessors/variables), it is labeled as property - const unionPropertyKind = forEach(typeChecker.getRootSymbols(symbol), rootSymbol => { - const rootSymbolFlags = rootSymbol.getFlags(); - if (rootSymbolFlags & (SymbolFlags.PropertyOrAccessor | SymbolFlags.Variable)) { - return ScriptElementKind.memberVariableElement; - } - Debug.assert(!!(rootSymbolFlags & SymbolFlags.Method)); - }); - if (!unionPropertyKind) { - // If this was union of all methods, - // make sure it has call signatures before we can label it as method - const typeOfUnionProperty = typeChecker.getTypeOfSymbolAtLocation(symbol, location); - if (typeOfUnionProperty.getCallSignatures().length) { - return ScriptElementKind.memberFunctionElement; - } - return ScriptElementKind.memberVariableElement; - } - return unionPropertyKind; - } - return ScriptElementKind.memberVariableElement; - } - - return ScriptElementKind.unknown; - } - - function getSymbolModifiers(symbol: Symbol): string { - return symbol && symbol.declarations && symbol.declarations.length > 0 - ? getNodeModifiers(symbol.declarations[0]) - : ScriptElementKindModifier.none; - } - - // TODO(drosen): Currently completion entry details passes the SemanticMeaning.All instead of using semanticMeaning of location - function getSymbolDisplayPartsDocumentationAndSymbolKind(symbol: Symbol, sourceFile: SourceFile, enclosingDeclaration: Node, - location: Node, semanticMeaning = getMeaningFromLocation(location)) { - - const typeChecker = program.getTypeChecker(); - - const displayParts: SymbolDisplayPart[] = []; - let documentation: SymbolDisplayPart[]; - const symbolFlags = symbol.flags; - let symbolKind = getSymbolKindOfConstructorPropertyMethodAccessorFunctionOrVar(symbol, symbolFlags, location); - let hasAddedSymbolInfo: boolean; - const isThisExpression = location.kind === SyntaxKind.ThisKeyword && isExpression(location); - let type: Type; - - // Class at constructor site need to be shown as constructor apart from property,method, vars - if (symbolKind !== ScriptElementKind.unknown || symbolFlags & SymbolFlags.Class || symbolFlags & SymbolFlags.Alias) { - // If it is accessor they are allowed only if location is at name of the accessor - if (symbolKind === ScriptElementKind.memberGetAccessorElement || symbolKind === ScriptElementKind.memberSetAccessorElement) { - symbolKind = ScriptElementKind.memberVariableElement; - } - - let signature: Signature; - type = isThisExpression ? typeChecker.getTypeAtLocation(location) : typeChecker.getTypeOfSymbolAtLocation(symbol, location); - if (type) { - if (location.parent && location.parent.kind === SyntaxKind.PropertyAccessExpression) { - const right = (location.parent).name; - // Either the location is on the right of a property access, or on the left and the right is missing - if (right === location || (right && right.getFullWidth() === 0)) { - location = location.parent; - } - } - - // try get the call/construct signature from the type if it matches - let callExpression: CallExpression; - if (location.kind === SyntaxKind.CallExpression || location.kind === SyntaxKind.NewExpression) { - callExpression = location; - } - else if (isCallExpressionTarget(location) || isNewExpressionTarget(location)) { - callExpression = location.parent; - } - - if (callExpression) { - const candidateSignatures: Signature[] = []; - signature = typeChecker.getResolvedSignature(callExpression, candidateSignatures); - if (!signature && candidateSignatures.length) { - // Use the first candidate: - signature = candidateSignatures[0]; - } - - const useConstructSignatures = callExpression.kind === SyntaxKind.NewExpression || callExpression.expression.kind === SyntaxKind.SuperKeyword; - const allSignatures = useConstructSignatures ? type.getConstructSignatures() : type.getCallSignatures(); - - if (!contains(allSignatures, signature.target) && !contains(allSignatures, signature)) { - // Get the first signature if there is one -- allSignatures may contain - // either the original signature or its target, so check for either - signature = allSignatures.length ? allSignatures[0] : undefined; - } - - if (signature) { - if (useConstructSignatures && (symbolFlags & SymbolFlags.Class)) { - // Constructor - symbolKind = ScriptElementKind.constructorImplementationElement; - addPrefixForAnyFunctionOrVar(type.symbol, symbolKind); - } - else if (symbolFlags & SymbolFlags.Alias) { - symbolKind = ScriptElementKind.alias; - pushTypePart(symbolKind); - displayParts.push(spacePart()); - if (useConstructSignatures) { - displayParts.push(keywordPart(SyntaxKind.NewKeyword)); - displayParts.push(spacePart()); - } - addFullSymbolName(symbol); - } - else { - addPrefixForAnyFunctionOrVar(symbol, symbolKind); - } - - switch (symbolKind) { - case ScriptElementKind.memberVariableElement: - case ScriptElementKind.variableElement: - case ScriptElementKind.constElement: - case ScriptElementKind.letElement: - case ScriptElementKind.parameterElement: - case ScriptElementKind.localVariableElement: - // If it is call or construct signature of lambda's write type name - displayParts.push(punctuationPart(SyntaxKind.ColonToken)); - displayParts.push(spacePart()); - if (useConstructSignatures) { - displayParts.push(keywordPart(SyntaxKind.NewKeyword)); - displayParts.push(spacePart()); - } - if (!(type.flags & TypeFlags.Anonymous) && type.symbol) { - addRange(displayParts, symbolToDisplayParts(typeChecker, type.symbol, enclosingDeclaration, /*meaning*/ undefined, SymbolFormatFlags.WriteTypeParametersOrArguments)); - } - addSignatureDisplayParts(signature, allSignatures, TypeFormatFlags.WriteArrowStyleSignature); - break; - - default: - // Just signature - addSignatureDisplayParts(signature, allSignatures); - } - hasAddedSymbolInfo = true; - } - } - else if ((isNameOfFunctionDeclaration(location) && !(symbol.flags & SymbolFlags.Accessor)) || // name of function declaration - (location.kind === SyntaxKind.ConstructorKeyword && location.parent.kind === SyntaxKind.Constructor)) { // At constructor keyword of constructor declaration - // get the signature from the declaration and write it - const functionDeclaration = location.parent; - const allSignatures = functionDeclaration.kind === SyntaxKind.Constructor ? type.getNonNullableType().getConstructSignatures() : type.getNonNullableType().getCallSignatures(); - if (!typeChecker.isImplementationOfOverload(functionDeclaration)) { - signature = typeChecker.getSignatureFromDeclaration(functionDeclaration); - } - else { - signature = allSignatures[0]; - } - - if (functionDeclaration.kind === SyntaxKind.Constructor) { - // show (constructor) Type(...) signature - symbolKind = ScriptElementKind.constructorImplementationElement; - addPrefixForAnyFunctionOrVar(type.symbol, symbolKind); - } - else { - // (function/method) symbol(..signature) - addPrefixForAnyFunctionOrVar(functionDeclaration.kind === SyntaxKind.CallSignature && - !(type.symbol.flags & SymbolFlags.TypeLiteral || type.symbol.flags & SymbolFlags.ObjectLiteral) ? type.symbol : symbol, symbolKind); - } - - addSignatureDisplayParts(signature, allSignatures); - hasAddedSymbolInfo = true; - } - } - } - if (symbolFlags & SymbolFlags.Class && !hasAddedSymbolInfo && !isThisExpression) { - if (getDeclarationOfKind(symbol, SyntaxKind.ClassExpression)) { - // Special case for class expressions because we would like to indicate that - // the class name is local to the class body (similar to function expression) - // (local class) class - pushTypePart(ScriptElementKind.localClassElement); - } - else { - // Class declaration has name which is not local. - displayParts.push(keywordPart(SyntaxKind.ClassKeyword)); - } - displayParts.push(spacePart()); - addFullSymbolName(symbol); - writeTypeParametersOfSymbol(symbol, sourceFile); - } - if ((symbolFlags & SymbolFlags.Interface) && (semanticMeaning & SemanticMeaning.Type)) { - addNewLineIfDisplayPartsExist(); - displayParts.push(keywordPart(SyntaxKind.InterfaceKeyword)); - displayParts.push(spacePart()); - addFullSymbolName(symbol); - writeTypeParametersOfSymbol(symbol, sourceFile); - } - if (symbolFlags & SymbolFlags.TypeAlias) { - addNewLineIfDisplayPartsExist(); - displayParts.push(keywordPart(SyntaxKind.TypeKeyword)); - displayParts.push(spacePart()); - addFullSymbolName(symbol); - writeTypeParametersOfSymbol(symbol, sourceFile); - displayParts.push(spacePart()); - displayParts.push(operatorPart(SyntaxKind.EqualsToken)); - displayParts.push(spacePart()); - addRange(displayParts, typeToDisplayParts(typeChecker, typeChecker.getDeclaredTypeOfSymbol(symbol), enclosingDeclaration, TypeFormatFlags.InTypeAlias)); - } - if (symbolFlags & SymbolFlags.Enum) { - addNewLineIfDisplayPartsExist(); - if (forEach(symbol.declarations, isConstEnumDeclaration)) { - displayParts.push(keywordPart(SyntaxKind.ConstKeyword)); - displayParts.push(spacePart()); - } - displayParts.push(keywordPart(SyntaxKind.EnumKeyword)); - displayParts.push(spacePart()); - addFullSymbolName(symbol); - } - if (symbolFlags & SymbolFlags.Module) { - addNewLineIfDisplayPartsExist(); - const declaration = getDeclarationOfKind(symbol, SyntaxKind.ModuleDeclaration); - const isNamespace = declaration && declaration.name && declaration.name.kind === SyntaxKind.Identifier; - displayParts.push(keywordPart(isNamespace ? SyntaxKind.NamespaceKeyword : SyntaxKind.ModuleKeyword)); - displayParts.push(spacePart()); - addFullSymbolName(symbol); - } - if ((symbolFlags & SymbolFlags.TypeParameter) && (semanticMeaning & SemanticMeaning.Type)) { - addNewLineIfDisplayPartsExist(); - displayParts.push(punctuationPart(SyntaxKind.OpenParenToken)); - displayParts.push(textPart("type parameter")); - displayParts.push(punctuationPart(SyntaxKind.CloseParenToken)); - displayParts.push(spacePart()); - addFullSymbolName(symbol); - displayParts.push(spacePart()); - displayParts.push(keywordPart(SyntaxKind.InKeyword)); - displayParts.push(spacePart()); - if (symbol.parent) { - // Class/Interface type parameter - addFullSymbolName(symbol.parent, enclosingDeclaration); - writeTypeParametersOfSymbol(symbol.parent, enclosingDeclaration); - } - else { - // Method/function type parameter - let declaration = getDeclarationOfKind(symbol, SyntaxKind.TypeParameter); - Debug.assert(declaration !== undefined); - declaration = declaration.parent; - - if (declaration) { - if (isFunctionLikeKind(declaration.kind)) { - const signature = typeChecker.getSignatureFromDeclaration(declaration); - if (declaration.kind === SyntaxKind.ConstructSignature) { - displayParts.push(keywordPart(SyntaxKind.NewKeyword)); - displayParts.push(spacePart()); - } - else if (declaration.kind !== SyntaxKind.CallSignature && (declaration).name) { - addFullSymbolName(declaration.symbol); - } - addRange(displayParts, signatureToDisplayParts(typeChecker, signature, sourceFile, TypeFormatFlags.WriteTypeArgumentsOfSignature)); - } - else { - // Type alias type parameter - // For example - // type list = T[]; // Both T will go through same code path - displayParts.push(keywordPart(SyntaxKind.TypeKeyword)); - displayParts.push(spacePart()); - addFullSymbolName(declaration.symbol); - writeTypeParametersOfSymbol(declaration.symbol, sourceFile); - } - } - } - } - if (symbolFlags & SymbolFlags.EnumMember) { - addPrefixForAnyFunctionOrVar(symbol, "enum member"); - const declaration = symbol.declarations[0]; - if (declaration.kind === SyntaxKind.EnumMember) { - const constantValue = typeChecker.getConstantValue(declaration); - if (constantValue !== undefined) { - displayParts.push(spacePart()); - displayParts.push(operatorPart(SyntaxKind.EqualsToken)); - displayParts.push(spacePart()); - displayParts.push(displayPart(constantValue.toString(), SymbolDisplayPartKind.numericLiteral)); - } - } - } - if (symbolFlags & SymbolFlags.Alias) { - addNewLineIfDisplayPartsExist(); - if (symbol.declarations[0].kind === SyntaxKind.NamespaceExportDeclaration) { - displayParts.push(keywordPart(SyntaxKind.ExportKeyword)); - displayParts.push(spacePart()); - displayParts.push(keywordPart(SyntaxKind.NamespaceKeyword)); - } - else { - displayParts.push(keywordPart(SyntaxKind.ImportKeyword)); - } - displayParts.push(spacePart()); - addFullSymbolName(symbol); - ts.forEach(symbol.declarations, declaration => { - if (declaration.kind === SyntaxKind.ImportEqualsDeclaration) { - const importEqualsDeclaration = declaration; - if (isExternalModuleImportEqualsDeclaration(importEqualsDeclaration)) { - displayParts.push(spacePart()); - displayParts.push(operatorPart(SyntaxKind.EqualsToken)); - displayParts.push(spacePart()); - displayParts.push(keywordPart(SyntaxKind.RequireKeyword)); - displayParts.push(punctuationPart(SyntaxKind.OpenParenToken)); - displayParts.push(displayPart(getTextOfNode(getExternalModuleImportEqualsDeclarationExpression(importEqualsDeclaration)), SymbolDisplayPartKind.stringLiteral)); - displayParts.push(punctuationPart(SyntaxKind.CloseParenToken)); - } - else { - const internalAliasSymbol = typeChecker.getSymbolAtLocation(importEqualsDeclaration.moduleReference); - if (internalAliasSymbol) { - displayParts.push(spacePart()); - displayParts.push(operatorPart(SyntaxKind.EqualsToken)); - displayParts.push(spacePart()); - addFullSymbolName(internalAliasSymbol, enclosingDeclaration); - } - } - return true; - } - }); - } - if (!hasAddedSymbolInfo) { - if (symbolKind !== ScriptElementKind.unknown) { - if (type) { - if (isThisExpression) { - addNewLineIfDisplayPartsExist(); - displayParts.push(keywordPart(SyntaxKind.ThisKeyword)); - } - else { - addPrefixForAnyFunctionOrVar(symbol, symbolKind); - } - - // For properties, variables and local vars: show the type - if (symbolKind === ScriptElementKind.memberVariableElement || - symbolFlags & SymbolFlags.Variable || - symbolKind === ScriptElementKind.localVariableElement || - isThisExpression) { - displayParts.push(punctuationPart(SyntaxKind.ColonToken)); - displayParts.push(spacePart()); - // If the type is type parameter, format it specially - if (type.symbol && type.symbol.flags & SymbolFlags.TypeParameter) { - const typeParameterParts = mapToDisplayParts(writer => { - typeChecker.getSymbolDisplayBuilder().buildTypeParameterDisplay(type, writer, enclosingDeclaration); - }); - addRange(displayParts, typeParameterParts); - } - else { - addRange(displayParts, typeToDisplayParts(typeChecker, type, enclosingDeclaration)); - } - } - else if (symbolFlags & SymbolFlags.Function || - symbolFlags & SymbolFlags.Method || - symbolFlags & SymbolFlags.Constructor || - symbolFlags & SymbolFlags.Signature || - symbolFlags & SymbolFlags.Accessor || - symbolKind === ScriptElementKind.memberFunctionElement) { - const allSignatures = type.getNonNullableType().getCallSignatures(); - addSignatureDisplayParts(allSignatures[0], allSignatures); - } - } - } - else { - symbolKind = getSymbolKind(symbol, location); - } - } - - if (!documentation) { - documentation = symbol.getDocumentationComment(); - if (documentation.length === 0 && symbol.flags & SymbolFlags.Property) { - // For some special property access expressions like `experts.foo = foo` or `module.exports.foo = foo` - // there documentation comments might be attached to the right hand side symbol of their declarations. - // The pattern of such special property access is that the parent symbol is the symbol of the file. - if (symbol.parent && forEach(symbol.parent.declarations, declaration => declaration.kind === SyntaxKind.SourceFile)) { - for (const declaration of symbol.declarations) { - if (!declaration.parent || declaration.parent.kind !== SyntaxKind.BinaryExpression) { - continue; - } - - const rhsSymbol = program.getTypeChecker().getSymbolAtLocation((declaration.parent).right); - if (!rhsSymbol) { - continue; - } - - documentation = rhsSymbol.getDocumentationComment(); - if (documentation.length > 0) { - break; - } - } - } - } - } - - return { displayParts, documentation, symbolKind }; - - function addNewLineIfDisplayPartsExist() { - if (displayParts.length) { - displayParts.push(lineBreakPart()); - } - } - - function addFullSymbolName(symbol: Symbol, enclosingDeclaration?: Node) { - const fullSymbolDisplayParts = symbolToDisplayParts(typeChecker, symbol, enclosingDeclaration || sourceFile, /*meaning*/ undefined, - SymbolFormatFlags.WriteTypeParametersOrArguments | SymbolFormatFlags.UseOnlyExternalAliasing); - addRange(displayParts, fullSymbolDisplayParts); - } - - function addPrefixForAnyFunctionOrVar(symbol: Symbol, symbolKind: string) { - addNewLineIfDisplayPartsExist(); - if (symbolKind) { - pushTypePart(symbolKind); - displayParts.push(spacePart()); - addFullSymbolName(symbol); - } - } - - function pushTypePart(symbolKind: string) { - switch (symbolKind) { - case ScriptElementKind.variableElement: - case ScriptElementKind.functionElement: - case ScriptElementKind.letElement: - case ScriptElementKind.constElement: - case ScriptElementKind.constructorImplementationElement: - displayParts.push(textOrKeywordPart(symbolKind)); - return; - default: - displayParts.push(punctuationPart(SyntaxKind.OpenParenToken)); - displayParts.push(textOrKeywordPart(symbolKind)); - displayParts.push(punctuationPart(SyntaxKind.CloseParenToken)); - return; - } - } - - function addSignatureDisplayParts(signature: Signature, allSignatures: Signature[], flags?: TypeFormatFlags) { - addRange(displayParts, signatureToDisplayParts(typeChecker, signature, enclosingDeclaration, flags | TypeFormatFlags.WriteTypeArgumentsOfSignature)); - if (allSignatures.length > 1) { - displayParts.push(spacePart()); - displayParts.push(punctuationPart(SyntaxKind.OpenParenToken)); - displayParts.push(operatorPart(SyntaxKind.PlusToken)); - displayParts.push(displayPart((allSignatures.length - 1).toString(), SymbolDisplayPartKind.numericLiteral)); - displayParts.push(spacePart()); - displayParts.push(textPart(allSignatures.length === 2 ? "overload" : "overloads")); - displayParts.push(punctuationPart(SyntaxKind.CloseParenToken)); - } - documentation = signature.getDocumentationComment(); - } - - function writeTypeParametersOfSymbol(symbol: Symbol, enclosingDeclaration: Node) { - const typeParameterParts = mapToDisplayParts(writer => { - typeChecker.getSymbolDisplayBuilder().buildTypeParameterDisplayFromSymbol(symbol, writer, enclosingDeclaration); - }); - addRange(displayParts, typeParameterParts); - } + function getCompletionEntrySymbol(fileName: string, position: number, entryName: string): Symbol { + synchronizeHostData(); + return Completions.getCompletionEntrySymbol(program.getTypeChecker(), log, program.getCompilerOptions(), getValidSourceFile(fileName), position, entryName); } function getQuickInfoAtPosition(fileName: string, position: number): QuickInfo { @@ -4747,343 +1256,32 @@ namespace ts { return undefined; } - const displayPartsDocumentationsAndKind = getSymbolDisplayPartsDocumentationAndSymbolKind(symbol, sourceFile, getContainerNode(node), node); + const displayPartsDocumentationsAndKind = SymbolDisplay.getSymbolDisplayPartsDocumentationAndSymbolKind(typeChecker, symbol, sourceFile, getContainerNode(node), node); return { kind: displayPartsDocumentationsAndKind.symbolKind, - kindModifiers: getSymbolModifiers(symbol), + kindModifiers: SymbolDisplay.getSymbolModifiers(symbol), textSpan: createTextSpan(node.getStart(), node.getWidth()), displayParts: displayPartsDocumentationsAndKind.displayParts, documentation: displayPartsDocumentationsAndKind.documentation }; } - function createDefinitionInfo(node: Node, symbolKind: string, symbolName: string, containerName: string): DefinitionInfo { - return { - fileName: node.getSourceFile().fileName, - textSpan: createTextSpanFromBounds(node.getStart(), node.getEnd()), - kind: symbolKind, - name: symbolName, - containerKind: undefined, - containerName - }; - } - - function getSymbolInfo(typeChecker: TypeChecker, symbol: Symbol, node: Node) { - return { - symbolName: typeChecker.symbolToString(symbol), // Do not get scoped name, just the name of the symbol - symbolKind: getSymbolKind(symbol, node), - containerName: symbol.parent ? typeChecker.symbolToString(symbol.parent, node) : "" - }; - } - - function createDefinitionFromSignatureDeclaration(decl: SignatureDeclaration): DefinitionInfo { - const typeChecker = program.getTypeChecker(); - const { symbolName, symbolKind, containerName } = getSymbolInfo(typeChecker, decl.symbol, decl); - return createDefinitionInfo(decl, symbolKind, symbolName, containerName); - } - - function getDefinitionFromSymbol(symbol: Symbol, node: Node): DefinitionInfo[] { - const typeChecker = program.getTypeChecker(); - const result: DefinitionInfo[] = []; - const declarations = symbol.getDeclarations(); - const { symbolName, symbolKind, containerName } = getSymbolInfo(typeChecker, symbol, node); - - if (!tryAddConstructSignature(symbol, node, symbolKind, symbolName, containerName, result) && - !tryAddCallSignature(symbol, node, symbolKind, symbolName, containerName, result)) { - // Just add all the declarations. - forEach(declarations, declaration => { - result.push(createDefinitionInfo(declaration, symbolKind, symbolName, containerName)); - }); - } - - return result; - - function tryAddConstructSignature(symbol: Symbol, location: Node, symbolKind: string, symbolName: string, containerName: string, result: DefinitionInfo[]) { - // Applicable only if we are in a new expression, or we are on a constructor declaration - // and in either case the symbol has a construct signature definition, i.e. class - if (isNewExpressionTarget(location) || location.kind === SyntaxKind.ConstructorKeyword) { - if (symbol.flags & SymbolFlags.Class) { - // Find the first class-like declaration and try to get the construct signature. - for (const declaration of symbol.getDeclarations()) { - if (isClassLike(declaration)) { - return tryAddSignature(declaration.members, - /*selectConstructors*/ true, - symbolKind, - symbolName, - containerName, - result); - } - } - - Debug.fail("Expected declaration to have at least one class-like declaration"); - } - } - return false; - } - - function tryAddCallSignature(symbol: Symbol, location: Node, symbolKind: string, symbolName: string, containerName: string, result: DefinitionInfo[]) { - if (isCallExpressionTarget(location) || isNewExpressionTarget(location) || isNameOfFunctionDeclaration(location)) { - return tryAddSignature(symbol.declarations, /*selectConstructors*/ false, symbolKind, symbolName, containerName, result); - } - return false; - } - - function tryAddSignature(signatureDeclarations: Declaration[], selectConstructors: boolean, symbolKind: string, symbolName: string, containerName: string, result: DefinitionInfo[]) { - const declarations: Declaration[] = []; - let definition: Declaration; - - forEach(signatureDeclarations, d => { - if ((selectConstructors && d.kind === SyntaxKind.Constructor) || - (!selectConstructors && (d.kind === SyntaxKind.FunctionDeclaration || d.kind === SyntaxKind.MethodDeclaration || d.kind === SyntaxKind.MethodSignature))) { - declarations.push(d); - if ((d).body) definition = d; - } - }); - - if (definition) { - result.push(createDefinitionInfo(definition, symbolKind, symbolName, containerName)); - return true; - } - else if (declarations.length) { - result.push(createDefinitionInfo(lastOrUndefined(declarations), symbolKind, symbolName, containerName)); - return true; - } - - return false; - } - } - - function findReferenceInPosition(refs: FileReference[], pos: number): FileReference { - for (const ref of refs) { - if (ref.pos <= pos && pos < ref.end) { - return ref; - } - } - return undefined; - } - - function getDefinitionInfoForFileReference(name: string, targetFileName: string): DefinitionInfo { - return { - fileName: targetFileName, - textSpan: createTextSpanFromBounds(0, 0), - kind: ScriptElementKind.scriptElement, - name: name, - containerName: undefined, - containerKind: undefined - }; - } - /// Goto definition function getDefinitionAtPosition(fileName: string, position: number): DefinitionInfo[] { synchronizeHostData(); - - const sourceFile = getValidSourceFile(fileName); - - /// Triple slash reference comments - const comment = findReferenceInPosition(sourceFile.referencedFiles, position); - if (comment) { - const referenceFile = tryResolveScriptReference(program, sourceFile, comment); - if (referenceFile) { - return [getDefinitionInfoForFileReference(comment.fileName, referenceFile.fileName)]; - } - return undefined; - } - - // Type reference directives - const typeReferenceDirective = findReferenceInPosition(sourceFile.typeReferenceDirectives, position); - if (typeReferenceDirective) { - const referenceFile = program.getResolvedTypeReferenceDirectives()[typeReferenceDirective.fileName]; - if (referenceFile && referenceFile.resolvedFileName) { - return [getDefinitionInfoForFileReference(typeReferenceDirective.fileName, referenceFile.resolvedFileName)]; - } - return undefined; - } - - const node = getTouchingPropertyName(sourceFile, position); - if (node === sourceFile) { - return undefined; - } - - // Labels - if (isJumpStatementTarget(node)) { - const labelName = (node).text; - const label = getTargetLabel((node.parent), (node).text); - return label ? [createDefinitionInfo(label, ScriptElementKind.label, labelName, /*containerName*/ undefined)] : undefined; - } - - const typeChecker = program.getTypeChecker(); - - const calledDeclaration = tryGetSignatureDeclaration(typeChecker, node); - if (calledDeclaration) { - return [createDefinitionFromSignatureDeclaration(calledDeclaration)]; - } - - let symbol = typeChecker.getSymbolAtLocation(node); - - // Could not find a symbol e.g. node is string or number keyword, - // or the symbol was an internal symbol and does not have a declaration e.g. undefined symbol - if (!symbol) { - return undefined; - } - - // If this is an alias, and the request came at the declaration location - // get the aliased symbol instead. This allows for goto def on an import e.g. - // import {A, B} from "mod"; - // to jump to the implementation directly. - if (symbol.flags & SymbolFlags.Alias) { - const declaration = symbol.declarations[0]; - - // Go to the original declaration for cases: - // - // (1) when the aliased symbol was declared in the location(parent). - // (2) when the aliased symbol is originating from a named import. - // - if (node.kind === SyntaxKind.Identifier && - (node.parent === declaration || - (declaration.kind === SyntaxKind.ImportSpecifier && declaration.parent && declaration.parent.kind === SyntaxKind.NamedImports))) { - - symbol = typeChecker.getAliasedSymbol(symbol); - } - } - - // Because name in short-hand property assignment has two different meanings: property name and property value, - // using go-to-definition at such position should go to the variable declaration of the property value rather than - // go to the declaration of the property name (in this case stay at the same position). However, if go-to-definition - // is performed at the location of property access, we would like to go to definition of the property in the short-hand - // assignment. This case and others are handled by the following code. - if (node.parent.kind === SyntaxKind.ShorthandPropertyAssignment) { - const shorthandSymbol = typeChecker.getShorthandAssignmentValueSymbol(symbol.valueDeclaration); - if (!shorthandSymbol) { - return []; - } - - const shorthandDeclarations = shorthandSymbol.getDeclarations(); - const shorthandSymbolKind = getSymbolKind(shorthandSymbol, node); - const shorthandSymbolName = typeChecker.symbolToString(shorthandSymbol); - const shorthandContainerName = typeChecker.symbolToString(symbol.parent, node); - return map(shorthandDeclarations, - declaration => createDefinitionInfo(declaration, shorthandSymbolKind, shorthandSymbolName, shorthandContainerName)); - } - - return getDefinitionFromSymbol(symbol, node); + return GoToDefinition.getDefinitionAtPosition(program, getValidSourceFile(fileName), position); } - /// Goto type - function getTypeDefinitionAtPosition(fileName: string, position: number): DefinitionInfo[] { - synchronizeHostData(); - - const sourceFile = getValidSourceFile(fileName); - - const node = getTouchingPropertyName(sourceFile, position); - if (node === sourceFile) { - return undefined; - } - - const typeChecker = program.getTypeChecker(); - - const symbol = typeChecker.getSymbolAtLocation(node); - if (!symbol) { - return undefined; - } - - const type = typeChecker.getTypeOfSymbolAtLocation(symbol, node); - if (!type) { - return undefined; - } - - if (type.flags & TypeFlags.Union && !(type.flags & TypeFlags.Enum)) { - const result: DefinitionInfo[] = []; - forEach((type).types, t => { - if (t.symbol) { - addRange(/*to*/ result, /*from*/ getDefinitionFromSymbol(t.symbol, node)); - } - }); - return result; - } - - if (!type.symbol) { - return undefined; - } - - return getDefinitionFromSymbol(type.symbol, node); - } - - /// Goto implementation + /// Goto implementation function getImplementationAtPosition(fileName: string, position: number): ImplementationLocation[] { synchronizeHostData(); - - const node = getTouchingPropertyName(getValidSourceFile(fileName), position); - const typeChecker = program.getTypeChecker(); - - // If invoked directly on a shorthand property assignment, then return - // the declaration of the symbol being assigned (not the symbol being assigned to). - if (node.parent.kind === SyntaxKind.ShorthandPropertyAssignment) { - const result: ReferenceEntry[] = []; - getReferenceEntriesForShorthandPropertyAssignment(node, typeChecker, result); - return result.length > 0 ? result : undefined; - } - else if (node.kind === SyntaxKind.SuperKeyword || isSuperProperty(node.parent)) { - // References to and accesses on the super keyword only have one possible implementation, so no - // need to "Find all References" - const symbol = typeChecker.getSymbolAtLocation(node); - return symbol.valueDeclaration && [getReferenceEntryFromNode(symbol.valueDeclaration)]; - } - else { - // Perform "Find all References" and retrieve only those that are implementations - const referencedSymbols = getReferencedSymbolsForNode(node, program.getSourceFiles(), /*findInStrings*/false, /*findInComments*/false, /*implementations*/true); - const result = flatMap(referencedSymbols, symbol => - map(symbol.references, ({ textSpan, fileName }) => ({ textSpan, fileName }))); - - return result && result.length > 0 ? result : undefined; - } + return GoToImplementation.getImplementationAtPosition(program.getTypeChecker(), cancellationToken, + program.getSourceFiles(), getTouchingPropertyName(getValidSourceFile(fileName), position)); } - function getReferenceEntriesForShorthandPropertyAssignment(node: Node, typeChecker: TypeChecker, result: ReferenceEntry[]): void { - const refSymbol = typeChecker.getSymbolAtLocation(node); - const shorthandSymbol = typeChecker.getShorthandAssignmentValueSymbol(refSymbol.valueDeclaration); - - if (shorthandSymbol) { - for (const declaration of shorthandSymbol.getDeclarations()) { - if (getMeaningFromDeclaration(declaration) & SemanticMeaning.Value) { - result.push(getReferenceEntryFromNode(declaration)); - } - } - } - } - - function isImplementation(node: Node): boolean { - if (!node) { - return false; - } - else if (isVariableLike(node)) { - if (node.initializer) { - return true; - } - else if (node.kind === SyntaxKind.VariableDeclaration) { - const parentStatement = getParentStatementOfVariableDeclaration(node); - return parentStatement && hasModifier(parentStatement, ModifierFlags.Ambient); - } - } - else if (isFunctionLike(node)) { - return !!node.body || hasModifier(node, ModifierFlags.Ambient); - } - else { - switch (node.kind) { - case SyntaxKind.ClassDeclaration: - case SyntaxKind.ClassExpression: - case SyntaxKind.EnumDeclaration: - case SyntaxKind.ModuleDeclaration: - return true; - } - } - return false; - } - - function getParentStatementOfVariableDeclaration(node: VariableDeclaration): VariableStatement { - if (node.parent && node.parent.parent && node.parent.parent.kind === SyntaxKind.VariableStatement) { - Debug.assert(node.parent.kind === SyntaxKind.VariableDeclarationList); - return node.parent.parent; - } + function getTypeDefinitionAtPosition(fileName: string, position: number): DefinitionInfo[] { + synchronizeHostData(); + return GoToDefinition.getTypeDefinitionAtPosition(program.getTypeChecker(), getValidSourceFile(fileName), position); } function getOccurrencesAtPosition(fileName: string, position: number): ReferenceEntry[] { @@ -5102,628 +1300,9 @@ namespace ts { function getDocumentHighlights(fileName: string, position: number, filesToSearch: string[]): DocumentHighlights[] { synchronizeHostData(); - const sourceFilesToSearch = map(filesToSearch, f => program.getSourceFile(f)); const sourceFile = getValidSourceFile(fileName); - - const node = getTouchingWord(sourceFile, position); - if (!node) { - return undefined; - } - - return getSemanticDocumentHighlights(node) || getSyntacticDocumentHighlights(node); - - function getHighlightSpanForNode(node: Node): HighlightSpan { - const start = node.getStart(); - const end = node.getEnd(); - - return { - fileName: sourceFile.fileName, - textSpan: createTextSpanFromBounds(start, end), - kind: HighlightSpanKind.none - }; - } - - function getSemanticDocumentHighlights(node: Node): DocumentHighlights[] { - if (node.kind === SyntaxKind.Identifier || - node.kind === SyntaxKind.ThisKeyword || - node.kind === SyntaxKind.ThisType || - node.kind === SyntaxKind.SuperKeyword || - node.kind === SyntaxKind.StringLiteral || - isLiteralNameOfPropertyDeclarationOrIndexAccess(node)) { - - const referencedSymbols = getReferencedSymbolsForNode(node, sourceFilesToSearch, /*findInStrings*/ false, /*findInComments*/ false, /*implementations*/false); - return convertReferencedSymbols(referencedSymbols); - } - - return undefined; - - function convertReferencedSymbols(referencedSymbols: ReferencedSymbol[]): DocumentHighlights[] { - if (!referencedSymbols) { - return undefined; - } - - const fileNameToDocumentHighlights = createMap(); - const result: DocumentHighlights[] = []; - for (const referencedSymbol of referencedSymbols) { - for (const referenceEntry of referencedSymbol.references) { - const fileName = referenceEntry.fileName; - let documentHighlights = fileNameToDocumentHighlights[fileName]; - if (!documentHighlights) { - documentHighlights = { fileName, highlightSpans: [] }; - - fileNameToDocumentHighlights[fileName] = documentHighlights; - result.push(documentHighlights); - } - - documentHighlights.highlightSpans.push({ - textSpan: referenceEntry.textSpan, - kind: referenceEntry.isWriteAccess ? HighlightSpanKind.writtenReference : HighlightSpanKind.reference - }); - } - } - - return result; - } - } - - function getSyntacticDocumentHighlights(node: Node): DocumentHighlights[] { - const fileName = sourceFile.fileName; - - const highlightSpans = getHighlightSpans(node); - if (!highlightSpans || highlightSpans.length === 0) { - return undefined; - } - - return [{ fileName, highlightSpans }]; - - // returns true if 'node' is defined and has a matching 'kind'. - function hasKind(node: Node, kind: SyntaxKind) { - return node !== undefined && node.kind === kind; - } - - // Null-propagating 'parent' function. - function parent(node: Node): Node { - return node && node.parent; - } - - function getHighlightSpans(node: Node): HighlightSpan[] { - if (node) { - switch (node.kind) { - case SyntaxKind.IfKeyword: - case SyntaxKind.ElseKeyword: - if (hasKind(node.parent, SyntaxKind.IfStatement)) { - return getIfElseOccurrences(node.parent); - } - break; - case SyntaxKind.ReturnKeyword: - if (hasKind(node.parent, SyntaxKind.ReturnStatement)) { - return getReturnOccurrences(node.parent); - } - break; - case SyntaxKind.ThrowKeyword: - if (hasKind(node.parent, SyntaxKind.ThrowStatement)) { - return getThrowOccurrences(node.parent); - } - break; - case SyntaxKind.CatchKeyword: - if (hasKind(parent(parent(node)), SyntaxKind.TryStatement)) { - return getTryCatchFinallyOccurrences(node.parent.parent); - } - break; - case SyntaxKind.TryKeyword: - case SyntaxKind.FinallyKeyword: - if (hasKind(parent(node), SyntaxKind.TryStatement)) { - return getTryCatchFinallyOccurrences(node.parent); - } - break; - case SyntaxKind.SwitchKeyword: - if (hasKind(node.parent, SyntaxKind.SwitchStatement)) { - return getSwitchCaseDefaultOccurrences(node.parent); - } - break; - case SyntaxKind.CaseKeyword: - case SyntaxKind.DefaultKeyword: - if (hasKind(parent(parent(parent(node))), SyntaxKind.SwitchStatement)) { - return getSwitchCaseDefaultOccurrences(node.parent.parent.parent); - } - break; - case SyntaxKind.BreakKeyword: - case SyntaxKind.ContinueKeyword: - if (hasKind(node.parent, SyntaxKind.BreakStatement) || hasKind(node.parent, SyntaxKind.ContinueStatement)) { - return getBreakOrContinueStatementOccurrences(node.parent); - } - break; - case SyntaxKind.ForKeyword: - if (hasKind(node.parent, SyntaxKind.ForStatement) || - hasKind(node.parent, SyntaxKind.ForInStatement) || - hasKind(node.parent, SyntaxKind.ForOfStatement)) { - return getLoopBreakContinueOccurrences(node.parent); - } - break; - case SyntaxKind.WhileKeyword: - case SyntaxKind.DoKeyword: - if (hasKind(node.parent, SyntaxKind.WhileStatement) || hasKind(node.parent, SyntaxKind.DoStatement)) { - return getLoopBreakContinueOccurrences(node.parent); - } - break; - case SyntaxKind.ConstructorKeyword: - if (hasKind(node.parent, SyntaxKind.Constructor)) { - return getConstructorOccurrences(node.parent); - } - break; - case SyntaxKind.GetKeyword: - case SyntaxKind.SetKeyword: - if (hasKind(node.parent, SyntaxKind.GetAccessor) || hasKind(node.parent, SyntaxKind.SetAccessor)) { - return getGetAndSetOccurrences(node.parent); - } - break; - default: - if (isModifierKind(node.kind) && node.parent && - (isDeclaration(node.parent) || node.parent.kind === SyntaxKind.VariableStatement)) { - return getModifierOccurrences(node.kind, node.parent); - } - } - } - - return undefined; - } - - /** - * Aggregates all throw-statements within this node *without* crossing - * into function boundaries and try-blocks with catch-clauses. - */ - function aggregateOwnedThrowStatements(node: Node): ThrowStatement[] { - const statementAccumulator: ThrowStatement[] = []; - aggregate(node); - return statementAccumulator; - - function aggregate(node: Node): void { - if (node.kind === SyntaxKind.ThrowStatement) { - statementAccumulator.push(node); - } - else if (node.kind === SyntaxKind.TryStatement) { - const tryStatement = node; - - if (tryStatement.catchClause) { - aggregate(tryStatement.catchClause); - } - else { - // Exceptions thrown within a try block lacking a catch clause - // are "owned" in the current context. - aggregate(tryStatement.tryBlock); - } - - if (tryStatement.finallyBlock) { - aggregate(tryStatement.finallyBlock); - } - } - // Do not cross function boundaries. - else if (!isFunctionLike(node)) { - forEachChild(node, aggregate); - } - } - } - - /** - * For lack of a better name, this function takes a throw statement and returns the - * nearest ancestor that is a try-block (whose try statement has a catch clause), - * function-block, or source file. - */ - function getThrowStatementOwner(throwStatement: ThrowStatement): Node { - let child: Node = throwStatement; - - while (child.parent) { - const parent = child.parent; - - if (isFunctionBlock(parent) || parent.kind === SyntaxKind.SourceFile) { - return parent; - } - - // A throw-statement is only owned by a try-statement if the try-statement has - // a catch clause, and if the throw-statement occurs within the try block. - if (parent.kind === SyntaxKind.TryStatement) { - const tryStatement = parent; - - if (tryStatement.tryBlock === child && tryStatement.catchClause) { - return child; - } - } - - child = parent; - } - - return undefined; - } - - function aggregateAllBreakAndContinueStatements(node: Node): BreakOrContinueStatement[] { - const statementAccumulator: BreakOrContinueStatement[] = []; - aggregate(node); - return statementAccumulator; - - function aggregate(node: Node): void { - if (node.kind === SyntaxKind.BreakStatement || node.kind === SyntaxKind.ContinueStatement) { - statementAccumulator.push(node); - } - // Do not cross function boundaries. - else if (!isFunctionLike(node)) { - forEachChild(node, aggregate); - } - } - } - - function ownsBreakOrContinueStatement(owner: Node, statement: BreakOrContinueStatement): boolean { - const actualOwner = getBreakOrContinueOwner(statement); - - return actualOwner && actualOwner === owner; - } - - function getBreakOrContinueOwner(statement: BreakOrContinueStatement): Node { - for (let node = statement.parent; node; node = node.parent) { - switch (node.kind) { - case SyntaxKind.SwitchStatement: - if (statement.kind === SyntaxKind.ContinueStatement) { - continue; - } - // Fall through. - case SyntaxKind.ForStatement: - case SyntaxKind.ForInStatement: - case SyntaxKind.ForOfStatement: - case SyntaxKind.WhileStatement: - case SyntaxKind.DoStatement: - if (!statement.label || isLabeledBy(node, statement.label.text)) { - return node; - } - break; - default: - // Don't cross function boundaries. - if (isFunctionLike(node)) { - return undefined; - } - break; - } - } - - return undefined; - } - - function getModifierOccurrences(modifier: SyntaxKind, declaration: Node): HighlightSpan[] { - const container = declaration.parent; - - // Make sure we only highlight the keyword when it makes sense to do so. - if (isAccessibilityModifier(modifier)) { - if (!(container.kind === SyntaxKind.ClassDeclaration || - container.kind === SyntaxKind.ClassExpression || - (declaration.kind === SyntaxKind.Parameter && hasKind(container, SyntaxKind.Constructor)))) { - return undefined; - } - } - else if (modifier === SyntaxKind.StaticKeyword) { - if (!(container.kind === SyntaxKind.ClassDeclaration || container.kind === SyntaxKind.ClassExpression)) { - return undefined; - } - } - else if (modifier === SyntaxKind.ExportKeyword || modifier === SyntaxKind.DeclareKeyword) { - if (!(container.kind === SyntaxKind.ModuleBlock || container.kind === SyntaxKind.SourceFile)) { - return undefined; - } - } - else if (modifier === SyntaxKind.AbstractKeyword) { - if (!(container.kind === SyntaxKind.ClassDeclaration || declaration.kind === SyntaxKind.ClassDeclaration)) { - return undefined; - } - } - else { - // unsupported modifier - return undefined; - } - - const keywords: Node[] = []; - const modifierFlag: ModifierFlags = getFlagFromModifier(modifier); - - let nodes: Node[]; - switch (container.kind) { - case SyntaxKind.ModuleBlock: - case SyntaxKind.SourceFile: - // Container is either a class declaration or the declaration is a classDeclaration - if (modifierFlag & ModifierFlags.Abstract) { - nodes = ((declaration).members).concat(declaration); - } - else { - nodes = (container).statements; - } - break; - case SyntaxKind.Constructor: - nodes = ((container).parameters).concat( - (container.parent).members); - break; - case SyntaxKind.ClassDeclaration: - case SyntaxKind.ClassExpression: - nodes = (container).members; - - // If we're an accessibility modifier, we're in an instance member and should search - // the constructor's parameter list for instance members as well. - if (modifierFlag & ModifierFlags.AccessibilityModifier) { - const constructor = forEach((container).members, member => { - return member.kind === SyntaxKind.Constructor && member; - }); - - if (constructor) { - nodes = nodes.concat(constructor.parameters); - } - } - else if (modifierFlag & ModifierFlags.Abstract) { - nodes = nodes.concat(container); - } - break; - default: - Debug.fail("Invalid container kind."); - } - - forEach(nodes, node => { - if (getModifierFlags(node) & modifierFlag) { - forEach(node.modifiers, child => pushKeywordIf(keywords, child, modifier)); - } - }); - - return map(keywords, getHighlightSpanForNode); - - function getFlagFromModifier(modifier: SyntaxKind) { - switch (modifier) { - case SyntaxKind.PublicKeyword: - return ModifierFlags.Public; - case SyntaxKind.PrivateKeyword: - return ModifierFlags.Private; - case SyntaxKind.ProtectedKeyword: - return ModifierFlags.Protected; - case SyntaxKind.StaticKeyword: - return ModifierFlags.Static; - case SyntaxKind.ExportKeyword: - return ModifierFlags.Export; - case SyntaxKind.DeclareKeyword: - return ModifierFlags.Ambient; - case SyntaxKind.AbstractKeyword: - return ModifierFlags.Abstract; - default: - Debug.fail(); - } - } - } - - function pushKeywordIf(keywordList: Node[], token: Node, ...expected: SyntaxKind[]): boolean { - if (token && contains(expected, token.kind)) { - keywordList.push(token); - return true; - } - - return false; - } - - function getGetAndSetOccurrences(accessorDeclaration: AccessorDeclaration): HighlightSpan[] { - const keywords: Node[] = []; - - tryPushAccessorKeyword(accessorDeclaration.symbol, SyntaxKind.GetAccessor); - tryPushAccessorKeyword(accessorDeclaration.symbol, SyntaxKind.SetAccessor); - - return map(keywords, getHighlightSpanForNode); - - function tryPushAccessorKeyword(accessorSymbol: Symbol, accessorKind: SyntaxKind): void { - const accessor = getDeclarationOfKind(accessorSymbol, accessorKind); - - if (accessor) { - forEach(accessor.getChildren(), child => pushKeywordIf(keywords, child, SyntaxKind.GetKeyword, SyntaxKind.SetKeyword)); - } - } - } - - function getConstructorOccurrences(constructorDeclaration: ConstructorDeclaration): HighlightSpan[] { - const declarations = constructorDeclaration.symbol.getDeclarations(); - - const keywords: Node[] = []; - - forEach(declarations, declaration => { - forEach(declaration.getChildren(), token => { - return pushKeywordIf(keywords, token, SyntaxKind.ConstructorKeyword); - }); - }); - - return map(keywords, getHighlightSpanForNode); - } - - function getLoopBreakContinueOccurrences(loopNode: IterationStatement): HighlightSpan[] { - const keywords: Node[] = []; - - if (pushKeywordIf(keywords, loopNode.getFirstToken(), SyntaxKind.ForKeyword, SyntaxKind.WhileKeyword, SyntaxKind.DoKeyword)) { - // If we succeeded and got a do-while loop, then start looking for a 'while' keyword. - if (loopNode.kind === SyntaxKind.DoStatement) { - const loopTokens = loopNode.getChildren(); - - for (let i = loopTokens.length - 1; i >= 0; i--) { - if (pushKeywordIf(keywords, loopTokens[i], SyntaxKind.WhileKeyword)) { - break; - } - } - } - } - - const breaksAndContinues = aggregateAllBreakAndContinueStatements(loopNode.statement); - - forEach(breaksAndContinues, statement => { - if (ownsBreakOrContinueStatement(loopNode, statement)) { - pushKeywordIf(keywords, statement.getFirstToken(), SyntaxKind.BreakKeyword, SyntaxKind.ContinueKeyword); - } - }); - - return map(keywords, getHighlightSpanForNode); - } - - function getBreakOrContinueStatementOccurrences(breakOrContinueStatement: BreakOrContinueStatement): HighlightSpan[] { - const owner = getBreakOrContinueOwner(breakOrContinueStatement); - - if (owner) { - switch (owner.kind) { - case SyntaxKind.ForStatement: - case SyntaxKind.ForInStatement: - case SyntaxKind.ForOfStatement: - case SyntaxKind.DoStatement: - case SyntaxKind.WhileStatement: - return getLoopBreakContinueOccurrences(owner); - case SyntaxKind.SwitchStatement: - return getSwitchCaseDefaultOccurrences(owner); - - } - } - - return undefined; - } - - function getSwitchCaseDefaultOccurrences(switchStatement: SwitchStatement): HighlightSpan[] { - const keywords: Node[] = []; - - pushKeywordIf(keywords, switchStatement.getFirstToken(), SyntaxKind.SwitchKeyword); - - // Go through each clause in the switch statement, collecting the 'case'/'default' keywords. - forEach(switchStatement.caseBlock.clauses, clause => { - pushKeywordIf(keywords, clause.getFirstToken(), SyntaxKind.CaseKeyword, SyntaxKind.DefaultKeyword); - - const breaksAndContinues = aggregateAllBreakAndContinueStatements(clause); - - forEach(breaksAndContinues, statement => { - if (ownsBreakOrContinueStatement(switchStatement, statement)) { - pushKeywordIf(keywords, statement.getFirstToken(), SyntaxKind.BreakKeyword); - } - }); - }); - - return map(keywords, getHighlightSpanForNode); - } - - function getTryCatchFinallyOccurrences(tryStatement: TryStatement): HighlightSpan[] { - const keywords: Node[] = []; - - pushKeywordIf(keywords, tryStatement.getFirstToken(), SyntaxKind.TryKeyword); - - if (tryStatement.catchClause) { - pushKeywordIf(keywords, tryStatement.catchClause.getFirstToken(), SyntaxKind.CatchKeyword); - } - - if (tryStatement.finallyBlock) { - const finallyKeyword = findChildOfKind(tryStatement, SyntaxKind.FinallyKeyword, sourceFile); - pushKeywordIf(keywords, finallyKeyword, SyntaxKind.FinallyKeyword); - } - - return map(keywords, getHighlightSpanForNode); - } - - function getThrowOccurrences(throwStatement: ThrowStatement): HighlightSpan[] { - const owner = getThrowStatementOwner(throwStatement); - - if (!owner) { - return undefined; - } - - const keywords: Node[] = []; - - forEach(aggregateOwnedThrowStatements(owner), throwStatement => { - pushKeywordIf(keywords, throwStatement.getFirstToken(), SyntaxKind.ThrowKeyword); - }); - - // If the "owner" is a function, then we equate 'return' and 'throw' statements in their - // ability to "jump out" of the function, and include occurrences for both. - if (isFunctionBlock(owner)) { - forEachReturnStatement(owner, returnStatement => { - pushKeywordIf(keywords, returnStatement.getFirstToken(), SyntaxKind.ReturnKeyword); - }); - } - - return map(keywords, getHighlightSpanForNode); - } - - function getReturnOccurrences(returnStatement: ReturnStatement): HighlightSpan[] { - const func = getContainingFunction(returnStatement); - - // If we didn't find a containing function with a block body, bail out. - if (!(func && hasKind(func.body, SyntaxKind.Block))) { - return undefined; - } - - const keywords: Node[] = []; - forEachReturnStatement(func.body, returnStatement => { - pushKeywordIf(keywords, returnStatement.getFirstToken(), SyntaxKind.ReturnKeyword); - }); - - // Include 'throw' statements that do not occur within a try block. - forEach(aggregateOwnedThrowStatements(func.body), throwStatement => { - pushKeywordIf(keywords, throwStatement.getFirstToken(), SyntaxKind.ThrowKeyword); - }); - - return map(keywords, getHighlightSpanForNode); - } - - function getIfElseOccurrences(ifStatement: IfStatement): HighlightSpan[] { - const keywords: Node[] = []; - - // Traverse upwards through all parent if-statements linked by their else-branches. - while (hasKind(ifStatement.parent, SyntaxKind.IfStatement) && (ifStatement.parent).elseStatement === ifStatement) { - ifStatement = ifStatement.parent; - } - - // Now traverse back down through the else branches, aggregating if/else keywords of if-statements. - while (ifStatement) { - const children = ifStatement.getChildren(); - pushKeywordIf(keywords, children[0], SyntaxKind.IfKeyword); - - // Generally the 'else' keyword is second-to-last, so we traverse backwards. - for (let i = children.length - 1; i >= 0; i--) { - if (pushKeywordIf(keywords, children[i], SyntaxKind.ElseKeyword)) { - break; - } - } - - if (!hasKind(ifStatement.elseStatement, SyntaxKind.IfStatement)) { - break; - } - - ifStatement = ifStatement.elseStatement; - } - - const result: HighlightSpan[] = []; - - // We'd like to highlight else/ifs together if they are only separated by whitespace - // (i.e. the keywords are separated by no comments, no newlines). - for (let i = 0; i < keywords.length; i++) { - if (keywords[i].kind === SyntaxKind.ElseKeyword && i < keywords.length - 1) { - const elseKeyword = keywords[i]; - const ifKeyword = keywords[i + 1]; // this *should* always be an 'if' keyword. - - let shouldCombindElseAndIf = true; - - // Avoid recalculating getStart() by iterating backwards. - for (let j = ifKeyword.getStart() - 1; j >= elseKeyword.end; j--) { - if (!isWhiteSpaceSingleLine(sourceFile.text.charCodeAt(j))) { - shouldCombindElseAndIf = false; - break; - } - } - - if (shouldCombindElseAndIf) { - result.push({ - fileName: fileName, - textSpan: createTextSpanFromBounds(elseKeyword.getStart(), ifKeyword.end), - kind: HighlightSpanKind.reference - }); - i++; // skip the next keyword - continue; - } - } - - // Ordinary case: just highlight the keyword. - result.push(getHighlightSpanForNode(keywords[i])); - } - - return result; - } - } + return DocumentHighlights.getDocumentHighlights(program.getTypeChecker(), cancellationToken, sourceFile, position, sourceFilesToSearch); } /// References and Occurrences @@ -5753,28 +1332,14 @@ namespace ts { } } - function convertReferences(referenceSymbols: ReferencedSymbol[]): ReferenceEntry[] { - if (!referenceSymbols) { - return undefined; - } - - const referenceEntries: ReferenceEntry[] = []; - - for (const referenceSymbol of referenceSymbols) { - addRange(referenceEntries, referenceSymbol.references); - } - - return referenceEntries; - } - function findRenameLocations(fileName: string, position: number, findInStrings: boolean, findInComments: boolean): RenameLocation[] { const referencedSymbols = findReferencedSymbols(fileName, position, findInStrings, findInComments); - return convertReferences(referencedSymbols); + return FindAllReferences.convertReferences(referencedSymbols); } function getReferencesAtPosition(fileName: string, position: number): ReferenceEntry[] { const referencedSymbols = findReferencedSymbols(fileName, position, /*findInStrings*/ false, /*findInComments*/ false); - return convertReferences(referencedSymbols); + return FindAllReferences.convertReferences(referencedSymbols); } function findReferences(fileName: string, position: number): ReferencedSymbol[] { @@ -5786,1319 +1351,15 @@ namespace ts { function findReferencedSymbols(fileName: string, position: number, findInStrings: boolean, findInComments: boolean): ReferencedSymbol[] { synchronizeHostData(); - - const sourceFile = getValidSourceFile(fileName); - - const node = getTouchingPropertyName(sourceFile, position, /*includeJsDocComment*/ true); - if (node === sourceFile) { - return undefined; - } - - switch (node.kind) { - case SyntaxKind.NumericLiteral: - if (!isLiteralNameOfPropertyDeclarationOrIndexAccess(node)) { - break; - } - // Fallthrough - case SyntaxKind.Identifier: - case SyntaxKind.ThisKeyword: - // case SyntaxKind.SuperKeyword: TODO:GH#9268 - case SyntaxKind.ConstructorKeyword: - case SyntaxKind.StringLiteral: - return getReferencedSymbolsForNode(node, program.getSourceFiles(), findInStrings, findInComments, /*implementations*/false); - } - return undefined; - } - - function isThis(node: Node): boolean { - switch (node.kind) { - case SyntaxKind.ThisKeyword: - // case SyntaxKind.ThisType: TODO: GH#9267 - return true; - case SyntaxKind.Identifier: - // 'this' as a parameter - return (node as Identifier).originalKeywordKind === SyntaxKind.ThisKeyword && node.parent.kind === SyntaxKind.Parameter; - default: - return false; - } - } - - function getReferencedSymbolsForNode(node: Node, sourceFiles: SourceFile[], findInStrings: boolean, findInComments: boolean, implementations: boolean): ReferencedSymbol[] { - const typeChecker = program.getTypeChecker(); - - if (!implementations) { - // Labels - if (isLabelName(node)) { - if (isJumpStatementTarget(node)) { - const labelDefinition = getTargetLabel((node.parent), (node).text); - // if we have a label definition, look within its statement for references, if not, then - // the label is undefined and we have no results.. - return labelDefinition ? getLabelReferencesInNode(labelDefinition.parent, labelDefinition) : undefined; - } - else { - // it is a label definition and not a target, search within the parent labeledStatement - return getLabelReferencesInNode(node.parent, node); - } - } - - if (isThis(node)) { - return getReferencesForThisKeyword(node, sourceFiles); - } - - if (node.kind === SyntaxKind.SuperKeyword) { - return getReferencesForSuperKeyword(node); - } - } - - // `getSymbolAtLocation` normally returns the symbol of the class when given the constructor keyword, - // so we have to specify that we want the constructor symbol. - const symbol = typeChecker.getSymbolAtLocation(node); - - if (!implementations && !symbol && node.kind === SyntaxKind.StringLiteral) { - return getReferencesForStringLiteral(node, sourceFiles); - } - - - // Could not find a symbol e.g. unknown identifier - if (!symbol) { - // Can't have references to something that we have no symbol for. - return undefined; - } - - const declarations = symbol.declarations; - - // The symbol was an internal symbol and does not have a declaration e.g. undefined symbol - if (!declarations || !declarations.length) { - return undefined; - } - - let result: ReferencedSymbol[]; - - // Compute the meaning from the location and the symbol it references - const searchMeaning = getIntersectingMeaningFromDeclarations(getMeaningFromLocation(node), declarations); - - // Get the text to search for. - // Note: if this is an external module symbol, the name doesn't include quotes. - const declaredName = stripQuotes(getDeclaredName(typeChecker, symbol, node)); - - // Try to get the smallest valid scope that we can limit our search to; - // otherwise we'll need to search globally (i.e. include each file). - const scope = getSymbolScope(symbol); - - // Maps from a symbol ID to the ReferencedSymbol entry in 'result'. - const symbolToIndex: number[] = []; - - if (scope) { - result = []; - getReferencesInNode(scope, symbol, declaredName, node, searchMeaning, findInStrings, findInComments, result, symbolToIndex); - } - else { - const internedName = getInternedName(symbol, node, declarations); - for (const sourceFile of sourceFiles) { - cancellationToken.throwIfCancellationRequested(); - - const nameTable = getNameTable(sourceFile); - - if (nameTable[internedName] !== undefined) { - result = result || []; - getReferencesInNode(sourceFile, symbol, declaredName, node, searchMeaning, findInStrings, findInComments, result, symbolToIndex); - } - } - } - - return result; - - function getDefinition(symbol: Symbol): ReferencedSymbolDefinitionInfo { - const info = getSymbolDisplayPartsDocumentationAndSymbolKind(symbol, node.getSourceFile(), getContainerNode(node), node); - const name = map(info.displayParts, p => p.text).join(""); - const declarations = symbol.declarations; - if (!declarations || declarations.length === 0) { - return undefined; - } - - return { - containerKind: "", - containerName: "", - name, - kind: info.symbolKind, - fileName: declarations[0].getSourceFile().fileName, - textSpan: createTextSpan(declarations[0].getStart(), 0), - displayParts: info.displayParts - }; - } - - function getAliasSymbolForPropertyNameSymbol(symbol: Symbol, location: Node): Symbol | undefined { - if (symbol.flags & SymbolFlags.Alias) { - // Default import get alias - const defaultImport = getDeclarationOfKind(symbol, SyntaxKind.ImportClause); - if (defaultImport) { - return typeChecker.getAliasedSymbol(symbol); - } - - const importOrExportSpecifier = forEach(symbol.declarations, - declaration => (declaration.kind === SyntaxKind.ImportSpecifier || - declaration.kind === SyntaxKind.ExportSpecifier) ? declaration : undefined); - if (importOrExportSpecifier && - // export { a } - (!importOrExportSpecifier.propertyName || - // export {a as class } where a is location - importOrExportSpecifier.propertyName === location)) { - // If Import specifier -> get alias - // else Export specifier -> get local target - return importOrExportSpecifier.kind === SyntaxKind.ImportSpecifier ? - typeChecker.getAliasedSymbol(symbol) : - typeChecker.getExportSpecifierLocalTargetSymbol(importOrExportSpecifier); - } - } - return undefined; - } - - function followAliasIfNecessary(symbol: Symbol, location: Node): Symbol { - return getAliasSymbolForPropertyNameSymbol(symbol, location) || symbol; - } - - function getPropertySymbolOfDestructuringAssignment(location: Node) { - return isArrayLiteralOrObjectLiteralDestructuringPattern(location.parent.parent) && - typeChecker.getPropertySymbolOfDestructuringAssignment(location); - } - - function isObjectBindingPatternElementWithoutPropertyName(symbol: Symbol) { - const bindingElement = getDeclarationOfKind(symbol, SyntaxKind.BindingElement); - return bindingElement && - bindingElement.parent.kind === SyntaxKind.ObjectBindingPattern && - !bindingElement.propertyName; - } - - function getPropertySymbolOfObjectBindingPatternWithoutPropertyName(symbol: Symbol) { - if (isObjectBindingPatternElementWithoutPropertyName(symbol)) { - const bindingElement = getDeclarationOfKind(symbol, SyntaxKind.BindingElement); - const typeOfPattern = typeChecker.getTypeAtLocation(bindingElement.parent); - return typeOfPattern && typeChecker.getPropertyOfType(typeOfPattern, (bindingElement.name).text); - } - return undefined; - } - - function getInternedName(symbol: Symbol, location: Node, declarations: Declaration[]): string { - // If this is an export or import specifier it could have been renamed using the 'as' syntax. - // If so we want to search for whatever under the cursor. - if (isImportOrExportSpecifierName(location)) { - return location.getText(); - } - - // Try to get the local symbol if we're dealing with an 'export default' - // since that symbol has the "true" name. - const localExportDefaultSymbol = getLocalSymbolForExportDefault(symbol); - symbol = localExportDefaultSymbol || symbol; - - return stripQuotes(symbol.name); - } - - /** - * Determines the smallest scope in which a symbol may have named references. - * Note that not every construct has been accounted for. This function can - * probably be improved. - * - * @returns undefined if the scope cannot be determined, implying that - * a reference to a symbol can occur anywhere. - */ - function getSymbolScope(symbol: Symbol): Node { - // If this is the symbol of a named function expression or named class expression, - // then named references are limited to its own scope. - const valueDeclaration = symbol.valueDeclaration; - if (valueDeclaration && (valueDeclaration.kind === SyntaxKind.FunctionExpression || valueDeclaration.kind === SyntaxKind.ClassExpression)) { - return valueDeclaration; - } - - // If this is private property or method, the scope is the containing class - if (symbol.flags & (SymbolFlags.Property | SymbolFlags.Method)) { - const privateDeclaration = forEach(symbol.getDeclarations(), d => (getModifierFlags(d) & ModifierFlags.Private) ? d : undefined); - if (privateDeclaration) { - return getAncestor(privateDeclaration, SyntaxKind.ClassDeclaration); - } - } - - // If the symbol is an import we would like to find it if we are looking for what it imports. - // So consider it visible outside its declaration scope. - if (symbol.flags & SymbolFlags.Alias) { - return undefined; - } - - // If symbol is of object binding pattern element without property name we would want to - // look for property too and that could be anywhere - if (isObjectBindingPatternElementWithoutPropertyName(symbol)) { - return undefined; - } - - // if this symbol is visible from its parent container, e.g. exported, then bail out - // if symbol correspond to the union property - bail out - if (symbol.parent || (symbol.flags & SymbolFlags.SyntheticProperty)) { - return undefined; - } - - let scope: Node; - - const declarations = symbol.getDeclarations(); - if (declarations) { - for (const declaration of declarations) { - const container = getContainerNode(declaration); - - if (!container) { - return undefined; - } - - if (scope && scope !== container) { - // Different declarations have different containers, bail out - return undefined; - } - - if (container.kind === SyntaxKind.SourceFile && !isExternalModule(container)) { - // This is a global variable and not an external module, any declaration defined - // within this scope is visible outside the file - return undefined; - } - - // The search scope is the container node - scope = container; - } - } - - return scope; - } - - function getPossibleSymbolReferencePositions(sourceFile: SourceFile, symbolName: string, start: number, end: number): number[] { - const positions: number[] = []; - - /// TODO: Cache symbol existence for files to save text search - // Also, need to make this work for unicode escapes. - - // Be resilient in the face of a symbol with no name or zero length name - if (!symbolName || !symbolName.length) { - return positions; - } - - const text = sourceFile.text; - const sourceLength = text.length; - const symbolNameLength = symbolName.length; - - let position = text.indexOf(symbolName, start); - while (position >= 0) { - cancellationToken.throwIfCancellationRequested(); - - // If we are past the end, stop looking - if (position > end) break; - - // We found a match. Make sure it's not part of a larger word (i.e. the char - // before and after it have to be a non-identifier char). - const endPosition = position + symbolNameLength; - - if ((position === 0 || !isIdentifierPart(text.charCodeAt(position - 1), ScriptTarget.Latest)) && - (endPosition === sourceLength || !isIdentifierPart(text.charCodeAt(endPosition), ScriptTarget.Latest))) { - // Found a real match. Keep searching. - positions.push(position); - } - position = text.indexOf(symbolName, position + symbolNameLength + 1); - } - - return positions; - } - - function getLabelReferencesInNode(container: Node, targetLabel: Identifier): ReferencedSymbol[] { - const references: ReferenceEntry[] = []; - const sourceFile = container.getSourceFile(); - const labelName = targetLabel.text; - const possiblePositions = getPossibleSymbolReferencePositions(sourceFile, labelName, container.getStart(), container.getEnd()); - forEach(possiblePositions, position => { - cancellationToken.throwIfCancellationRequested(); - - const node = getTouchingWord(sourceFile, position); - if (!node || node.getWidth() !== labelName.length) { - return; - } - - // Only pick labels that are either the target label, or have a target that is the target label - if (node === targetLabel || - (isJumpStatementTarget(node) && getTargetLabel(node, labelName) === targetLabel)) { - references.push(getReferenceEntryFromNode(node)); - } - }); - - const definition: ReferencedSymbolDefinitionInfo = { - containerKind: "", - containerName: "", - fileName: targetLabel.getSourceFile().fileName, - kind: ScriptElementKind.label, - name: labelName, - textSpan: createTextSpanFromBounds(targetLabel.getStart(), targetLabel.getEnd()), - displayParts: [displayPart(labelName, SymbolDisplayPartKind.text)] - }; - - return [{ definition, references }]; - } - - function isValidReferencePosition(node: Node, searchSymbolName: string): boolean { - if (node) { - // Compare the length so we filter out strict superstrings of the symbol we are looking for - switch (node.kind) { - case SyntaxKind.Identifier: - return node.getWidth() === searchSymbolName.length; - - case SyntaxKind.StringLiteral: - if (isLiteralNameOfPropertyDeclarationOrIndexAccess(node) || - isNameOfExternalModuleImportOrDeclaration(node)) { - // For string literals we have two additional chars for the quotes - return node.getWidth() === searchSymbolName.length + 2; - } - break; - - case SyntaxKind.NumericLiteral: - if (isLiteralNameOfPropertyDeclarationOrIndexAccess(node)) { - return node.getWidth() === searchSymbolName.length; - } - break; - } - } - - return false; - } - - /** Search within node "container" for references for a search value, where the search value is defined as a - * tuple of(searchSymbol, searchText, searchLocation, and searchMeaning). - * searchLocation: a node where the search value - */ - function getReferencesInNode(container: Node, - searchSymbol: Symbol, - searchText: string, - searchLocation: Node, - searchMeaning: SemanticMeaning, - findInStrings: boolean, - findInComments: boolean, - result: ReferencedSymbol[], - symbolToIndex: number[]): void { - - const sourceFile = container.getSourceFile(); - - const start = findInComments ? container.getFullStart() : container.getStart(); - const possiblePositions = getPossibleSymbolReferencePositions(sourceFile, searchText, start, container.getEnd()); - - const parents = getParentSymbolsOfPropertyAccess(); - const inheritsFromCache: Map = createMap(); - - if (possiblePositions.length) { - // Build the set of symbols to search for, initially it has only the current symbol - const searchSymbols = populateSearchSymbolSet(searchSymbol, searchLocation); - - forEach(possiblePositions, position => { - cancellationToken.throwIfCancellationRequested(); - - const referenceLocation = getTouchingPropertyName(sourceFile, position); - if (!isValidReferencePosition(referenceLocation, searchText)) { - // This wasn't the start of a token. Check to see if it might be a - // match in a comment or string if that's what the caller is asking - // for. - if (!implementations && ((findInStrings && isInString(sourceFile, position)) || - (findInComments && isInNonReferenceComment(sourceFile, position)))) { - - // In the case where we're looking inside comments/strings, we don't have - // an actual definition. So just use 'undefined' here. Features like - // 'Rename' won't care (as they ignore the definitions), and features like - // 'FindReferences' will just filter out these results. - result.push({ - definition: undefined, - references: [{ - fileName: sourceFile.fileName, - textSpan: createTextSpan(position, searchText.length), - isWriteAccess: false, - isDefinition: false - }] - }); - } - return; - } - - if (!(getMeaningFromLocation(referenceLocation) & searchMeaning)) { - return; - } - - const referenceSymbol = typeChecker.getSymbolAtLocation(referenceLocation); - if (referenceSymbol) { - const referenceSymbolDeclaration = referenceSymbol.valueDeclaration; - const shorthandValueSymbol = typeChecker.getShorthandAssignmentValueSymbol(referenceSymbolDeclaration); - const relatedSymbol = getRelatedSymbol(searchSymbols, referenceSymbol, referenceLocation, - /*searchLocationIsConstructor*/ searchLocation.kind === SyntaxKind.ConstructorKeyword, parents, inheritsFromCache); - - if (relatedSymbol) { - addReferenceToRelatedSymbol(referenceLocation, relatedSymbol); - } - /* Because in short-hand property assignment, an identifier which stored as name of the short-hand property assignment - * has two meaning : property name and property value. Therefore when we do findAllReference at the position where - * an identifier is declared, the language service should return the position of the variable declaration as well as - * the position in short-hand property assignment excluding property accessing. However, if we do findAllReference at the - * position of property accessing, the referenceEntry of such position will be handled in the first case. - */ - else if (!(referenceSymbol.flags & SymbolFlags.Transient) && searchSymbols.indexOf(shorthandValueSymbol) >= 0) { - addReferenceToRelatedSymbol(referenceSymbolDeclaration.name, shorthandValueSymbol); - } - else if (searchLocation.kind === SyntaxKind.ConstructorKeyword) { - findAdditionalConstructorReferences(referenceSymbol, referenceLocation); - } - } - }); - } - return; - - /* If we are just looking for implementations and this is a property access expression, we need to get the - * symbol of the local type of the symbol the property is being accessed on. This is because our search - * symbol may have a different parent symbol if the local type's symbol does not declare the property - * being accessed (i.e. it is declared in some parent class or interface) - */ - function getParentSymbolsOfPropertyAccess(): Symbol[] | undefined { - if (implementations) { - const propertyAccessExpression = getPropertyAccessExpressionFromRightHandSide(searchLocation); - if (propertyAccessExpression) { - const localParentType = typeChecker.getTypeAtLocation(propertyAccessExpression.expression); - if (localParentType) { - if (localParentType.symbol && localParentType.symbol.flags & (SymbolFlags.Class | SymbolFlags.Interface) && localParentType.symbol !== searchSymbol.parent) { - return [localParentType.symbol]; - } - else if (localParentType.flags & TypeFlags.UnionOrIntersection) { - return getSymbolsForClassAndInterfaceComponents(localParentType); - } - } - } - } - } - - function getPropertyAccessExpressionFromRightHandSide(node: Node): PropertyAccessExpression { - return isRightSideOfPropertyAccess(node) && node.parent; - } - - /** Adds references when a constructor is used with `new this()` in its own class and `super()` calls in subclasses. */ - function findAdditionalConstructorReferences(referenceSymbol: Symbol, referenceLocation: Node): void { - Debug.assert(isClassLike(searchSymbol.valueDeclaration)); - - const referenceClass = referenceLocation.parent; - if (referenceSymbol === searchSymbol && isClassLike(referenceClass)) { - Debug.assert(referenceClass.name === referenceLocation); - // This is the class declaration containing the constructor. - addReferences(findOwnConstructorCalls(searchSymbol)); - } - else { - // If this class appears in `extends C`, then the extending class' "super" calls are references. - const classExtending = tryGetClassByExtendingIdentifier(referenceLocation); - if (classExtending && isClassLike(classExtending) && followAliasIfNecessary(referenceSymbol, referenceLocation) === searchSymbol) { - addReferences(superConstructorAccesses(classExtending)); - } - } - } - - function addReferences(references: Node[]): void { - if (references.length) { - const referencedSymbol = getReferencedSymbol(searchSymbol); - addRange(referencedSymbol.references, map(references, getReferenceEntryFromNode)); - } - } - - /** `classSymbol` is the class where the constructor was defined. - * Reference the constructor and all calls to `new this()`. - */ - function findOwnConstructorCalls(classSymbol: Symbol): Node[] { - const result: Node[] = []; - - for (const decl of classSymbol.members["__constructor"].declarations) { - Debug.assert(decl.kind === SyntaxKind.Constructor); - const ctrKeyword = decl.getChildAt(0); - Debug.assert(ctrKeyword.kind === SyntaxKind.ConstructorKeyword); - result.push(ctrKeyword); - } - - forEachProperty(classSymbol.exports, member => { - const decl = member.valueDeclaration; - if (decl && decl.kind === SyntaxKind.MethodDeclaration) { - const body = (decl).body; - if (body) { - forEachDescendantOfKind(body, SyntaxKind.ThisKeyword, thisKeyword => { - if (isNewExpressionTarget(thisKeyword)) { - result.push(thisKeyword); - } - }); - } - } - }); - - return result; - } - - /** Find references to `super` in the constructor of an extending class. */ - function superConstructorAccesses(cls: ClassLikeDeclaration): Node[] { - const symbol = cls.symbol; - const ctr = symbol.members["__constructor"]; - if (!ctr) { - return []; - } - - const result: Node[] = []; - for (const decl of ctr.declarations) { - Debug.assert(decl.kind === SyntaxKind.Constructor); - const body = (decl).body; - if (body) { - forEachDescendantOfKind(body, SyntaxKind.SuperKeyword, node => { - if (isCallExpressionTarget(node)) { - result.push(node); - } - }); - } - }; - return result; - } - - function getReferencedSymbol(symbol: Symbol): ReferencedSymbol { - const symbolId = getSymbolId(symbol); - let index = symbolToIndex[symbolId]; - if (index === undefined) { - index = result.length; - symbolToIndex[symbolId] = index; - - result.push({ - definition: getDefinition(symbol), - references: [] - }); - } - - return result[index]; - } - - function addReferenceToRelatedSymbol(node: Node, relatedSymbol: Symbol) { - const references = getReferencedSymbol(relatedSymbol).references; - if (implementations) { - getImplementationReferenceEntryForNode(node, references); - } - else { - references.push(getReferenceEntryFromNode(node)); - } - } - } - - function getImplementationReferenceEntryForNode(refNode: Node, result: ReferenceEntry[]): void { - // Check if we found a function/propertyAssignment/method with an implementation or initializer - if (isDeclarationName(refNode) && isImplementation(refNode.parent)) { - result.push(getReferenceEntryFromNode(refNode.parent)); - } - else if (refNode.kind === SyntaxKind.Identifier) { - if (refNode.parent.kind === SyntaxKind.ShorthandPropertyAssignment) { - // Go ahead and dereference the shorthand assignment by going to its definition - getReferenceEntriesForShorthandPropertyAssignment(refNode, typeChecker, result); - } - - // Check if the node is within an extends or implements clause - const containingClass = getContainingClassIfInHeritageClause(refNode); - if (containingClass) { - result.push(getReferenceEntryFromNode(containingClass)); - return; - } - - // If we got a type reference, try and see if the reference applies to any expressions that can implement an interface - const containingTypeReference = getContainingTypeReference(refNode); - if (containingTypeReference) { - const parent = containingTypeReference.parent; - if (isVariableLike(parent) && parent.type === containingTypeReference && parent.initializer && isImplementationExpression(parent.initializer)) { - maybeAdd(getReferenceEntryFromNode(parent.initializer)); - } - else if (isFunctionLike(parent) && parent.type === containingTypeReference && parent.body) { - if (parent.body.kind === SyntaxKind.Block) { - forEachReturnStatement(parent.body, returnStatement => { - if (returnStatement.expression && isImplementationExpression(returnStatement.expression)) { - maybeAdd(getReferenceEntryFromNode(returnStatement.expression)); - } - }); - } - else if (isImplementationExpression(parent.body)) { - maybeAdd(getReferenceEntryFromNode(parent.body)); - } - } - else if (isAssertionExpression(parent) && isImplementationExpression(parent.expression)) { - maybeAdd(getReferenceEntryFromNode(parent.expression)); - } - } - } - - // Type nodes can contain multiple references to the same type. For example: - // let x: Foo & (Foo & Bar) = ... - // Because we are returning the implementation locations and not the identifier locations, - // duplicate entries would be returned here as each of the type references is part of - // the same implementation. For that reason, check before we add a new entry - function maybeAdd(a: ReferenceEntry) { - if (!forEach(result, b => a.fileName === b.fileName && a.textSpan.start === b.textSpan.start && a.textSpan.length === b.textSpan.length)) { - result.push(a); - } - } - } - - function getSymbolsForClassAndInterfaceComponents(type: UnionOrIntersectionType, result: Symbol[] = []): Symbol[] { - for (const componentType of type.types) { - if (componentType.symbol && componentType.symbol.getFlags() & (SymbolFlags.Class | SymbolFlags.Interface)) { - result.push(componentType.symbol); - } - if (componentType.getFlags() & TypeFlags.UnionOrIntersection) { - getSymbolsForClassAndInterfaceComponents(componentType, result); - } - } - return result; - } - - function getContainingTypeReference(node: Node): Node { - let topLevelTypeReference: Node = undefined; - - while (node) { - if (isTypeNode(node)) { - topLevelTypeReference = node; - } - node = node.parent; - } - - return topLevelTypeReference; - } - - function getContainingClassIfInHeritageClause(node: Node): ClassLikeDeclaration { - if (node && node.parent) { - if (node.kind === SyntaxKind.ExpressionWithTypeArguments - && node.parent.kind === SyntaxKind.HeritageClause - && isClassLike(node.parent.parent)) { - return node.parent.parent; - } - - else if (node.kind === SyntaxKind.Identifier || node.kind === SyntaxKind.PropertyAccessExpression) { - return getContainingClassIfInHeritageClause(node.parent); - } - } - return undefined; - } - - /** - * Returns true if this is an expression that can be considered an implementation - */ - function isImplementationExpression(node: Expression): boolean { - // Unwrap parentheses - if (node.kind === SyntaxKind.ParenthesizedExpression) { - return isImplementationExpression((node).expression); - } - - return node.kind === SyntaxKind.ArrowFunction || - node.kind === SyntaxKind.FunctionExpression || - node.kind === SyntaxKind.ObjectLiteralExpression || - node.kind === SyntaxKind.ClassExpression || - node.kind === SyntaxKind.ArrayLiteralExpression; - } - - /** - * Determines if the parent symbol occurs somewhere in the child's ancestry. If the parent symbol - * is an interface, determines if some ancestor of the child symbol extends or inherits from it. - * Also takes in a cache of previous results which makes this slightly more efficient and is - * necessary to avoid potential loops like so: - * class A extends B { } - * class B extends A { } - * - * We traverse the AST rather than using the type checker because users are typically only interested - * in explicit implementations of an interface/class when calling "Go to Implementation". Sibling - * implementations of types that share a common ancestor with the type whose implementation we are - * searching for need to be filtered out of the results. The type checker doesn't let us make the - * distinction between structurally compatible implementations and explicit implementations, so we - * must use the AST. - * - * @param child A class or interface Symbol - * @param parent Another class or interface Symbol - * @param cachedResults A map of symbol id pairs (i.e. "child,parent") to booleans indicating previous results - */ - function explicitlyInheritsFrom(child: Symbol, parent: Symbol, cachedResults: Map): boolean { - const parentIsInterface = parent.getFlags() & SymbolFlags.Interface; - return searchHierarchy(child); - - function searchHierarchy(symbol: Symbol): boolean { - if (symbol === parent) { - return true; - } - - const key = getSymbolId(symbol) + "," + getSymbolId(parent); - if (key in cachedResults) { - return cachedResults[key]; - } - - // Set the key so that we don't infinitely recurse - cachedResults[key] = false; - - const inherits = forEach(symbol.getDeclarations(), (declaration) => { - if (isClassLike(declaration)) { - if (parentIsInterface) { - const interfaceReferences = getClassImplementsHeritageClauseElements(declaration); - if (interfaceReferences) { - for (const typeReference of interfaceReferences) { - if (searchTypeReference(typeReference)) { - return true; - } - } - } - } - return searchTypeReference(getClassExtendsHeritageClauseElement(declaration)); - } - else if (declaration.kind === SyntaxKind.InterfaceDeclaration) { - if (parentIsInterface) { - return forEach(getInterfaceBaseTypeNodes(declaration), searchTypeReference); - } - } - return false; - }); - - cachedResults[key] = inherits; - return inherits; - } - - function searchTypeReference(typeReference: ExpressionWithTypeArguments): boolean { - if (typeReference) { - const type = typeChecker.getTypeAtLocation(typeReference); - if (type && type.symbol) { - return searchHierarchy(type.symbol); - } - } - return false; - } - } - - function getReferencesForSuperKeyword(superKeyword: Node): ReferencedSymbol[] { - let searchSpaceNode = getSuperContainer(superKeyword, /*stopOnFunctions*/ false); - if (!searchSpaceNode) { - return undefined; - } - // Whether 'super' occurs in a static context within a class. - let staticFlag = ModifierFlags.Static; - - switch (searchSpaceNode.kind) { - case SyntaxKind.PropertyDeclaration: - case SyntaxKind.PropertySignature: - case SyntaxKind.MethodDeclaration: - case SyntaxKind.MethodSignature: - case SyntaxKind.Constructor: - case SyntaxKind.GetAccessor: - case SyntaxKind.SetAccessor: - staticFlag &= getModifierFlags(searchSpaceNode); - searchSpaceNode = searchSpaceNode.parent; // re-assign to be the owning class - break; - default: - return undefined; - } - - const references: ReferenceEntry[] = []; - - const sourceFile = searchSpaceNode.getSourceFile(); - const possiblePositions = getPossibleSymbolReferencePositions(sourceFile, "super", searchSpaceNode.getStart(), searchSpaceNode.getEnd()); - forEach(possiblePositions, position => { - cancellationToken.throwIfCancellationRequested(); - - const node = getTouchingWord(sourceFile, position); - - if (!node || node.kind !== SyntaxKind.SuperKeyword) { - return; - } - - const container = getSuperContainer(node, /*stopOnFunctions*/ false); - - // If we have a 'super' container, we must have an enclosing class. - // Now make sure the owning class is the same as the search-space - // and has the same static qualifier as the original 'super's owner. - if (container && (ModifierFlags.Static & getModifierFlags(container)) === staticFlag && container.parent.symbol === searchSpaceNode.symbol) { - references.push(getReferenceEntryFromNode(node)); - } - }); - - const definition = getDefinition(searchSpaceNode.symbol); - return [{ definition, references }]; - } - - function getReferencesForThisKeyword(thisOrSuperKeyword: Node, sourceFiles: SourceFile[]): ReferencedSymbol[] { - let searchSpaceNode = getThisContainer(thisOrSuperKeyword, /* includeArrowFunctions */ false); - - // Whether 'this' occurs in a static context within a class. - let staticFlag = ModifierFlags.Static; - - switch (searchSpaceNode.kind) { - case SyntaxKind.MethodDeclaration: - case SyntaxKind.MethodSignature: - if (isObjectLiteralMethod(searchSpaceNode)) { - break; - } - // fall through - case SyntaxKind.PropertyDeclaration: - case SyntaxKind.PropertySignature: - case SyntaxKind.Constructor: - case SyntaxKind.GetAccessor: - case SyntaxKind.SetAccessor: - staticFlag &= getModifierFlags(searchSpaceNode); - searchSpaceNode = searchSpaceNode.parent; // re-assign to be the owning class - break; - case SyntaxKind.SourceFile: - if (isExternalModule(searchSpaceNode)) { - return undefined; - } - // Fall through - case SyntaxKind.FunctionDeclaration: - case SyntaxKind.FunctionExpression: - break; - // Computed properties in classes are not handled here because references to this are illegal, - // so there is no point finding references to them. - default: - return undefined; - } - - const references: ReferenceEntry[] = []; - - let possiblePositions: number[]; - if (searchSpaceNode.kind === SyntaxKind.SourceFile) { - forEach(sourceFiles, sourceFile => { - possiblePositions = getPossibleSymbolReferencePositions(sourceFile, "this", sourceFile.getStart(), sourceFile.getEnd()); - getThisReferencesInFile(sourceFile, sourceFile, possiblePositions, references); - }); - } - else { - const sourceFile = searchSpaceNode.getSourceFile(); - possiblePositions = getPossibleSymbolReferencePositions(sourceFile, "this", searchSpaceNode.getStart(), searchSpaceNode.getEnd()); - getThisReferencesInFile(sourceFile, searchSpaceNode, possiblePositions, references); - } - - const thisOrSuperSymbol = typeChecker.getSymbolAtLocation(thisOrSuperKeyword); - - const displayParts = thisOrSuperSymbol && getSymbolDisplayPartsDocumentationAndSymbolKind( - thisOrSuperSymbol, thisOrSuperKeyword.getSourceFile(), getContainerNode(thisOrSuperKeyword), thisOrSuperKeyword).displayParts; - - return [{ - definition: { - containerKind: "", - containerName: "", - fileName: node.getSourceFile().fileName, - kind: ScriptElementKind.variableElement, - name: "this", - textSpan: createTextSpanFromBounds(node.getStart(), node.getEnd()), - displayParts - }, - references: references - }]; - - function getThisReferencesInFile(sourceFile: SourceFile, searchSpaceNode: Node, possiblePositions: number[], result: ReferenceEntry[]): void { - forEach(possiblePositions, position => { - cancellationToken.throwIfCancellationRequested(); - - const node = getTouchingWord(sourceFile, position); - if (!node || !isThis(node)) { - return; - } - - const container = getThisContainer(node, /* includeArrowFunctions */ false); - - switch (searchSpaceNode.kind) { - case SyntaxKind.FunctionExpression: - case SyntaxKind.FunctionDeclaration: - if (searchSpaceNode.symbol === container.symbol) { - result.push(getReferenceEntryFromNode(node)); - } - break; - case SyntaxKind.MethodDeclaration: - case SyntaxKind.MethodSignature: - if (isObjectLiteralMethod(searchSpaceNode) && searchSpaceNode.symbol === container.symbol) { - result.push(getReferenceEntryFromNode(node)); - } - break; - case SyntaxKind.ClassExpression: - case SyntaxKind.ClassDeclaration: - // Make sure the container belongs to the same class - // and has the appropriate static modifier from the original container. - if (container.parent && searchSpaceNode.symbol === container.parent.symbol && (getModifierFlags(container) & ModifierFlags.Static) === staticFlag) { - result.push(getReferenceEntryFromNode(node)); - } - break; - case SyntaxKind.SourceFile: - if (container.kind === SyntaxKind.SourceFile && !isExternalModule(container)) { - result.push(getReferenceEntryFromNode(node)); - } - break; - } - }); - } - } - - - function getReferencesForStringLiteral(node: StringLiteral, sourceFiles: SourceFile[]): ReferencedSymbol[] { - const typeChecker = program.getTypeChecker(); - const type = getStringLiteralTypeForNode(node, typeChecker); - - if (!type) { - // nothing to do here. moving on - return undefined; - } - - const references: ReferenceEntry[] = []; - - for (const sourceFile of sourceFiles) { - const possiblePositions = getPossibleSymbolReferencePositions(sourceFile, type.text, sourceFile.getStart(), sourceFile.getEnd()); - getReferencesForStringLiteralInFile(sourceFile, type, possiblePositions, references); - } - - return [{ - definition: { - containerKind: "", - containerName: "", - fileName: node.getSourceFile().fileName, - kind: ScriptElementKind.variableElement, - name: type.text, - textSpan: createTextSpanFromBounds(node.getStart(), node.getEnd()), - displayParts: [displayPart(getTextOfNode(node), SymbolDisplayPartKind.stringLiteral)] - }, - references: references - }]; - - function getReferencesForStringLiteralInFile(sourceFile: SourceFile, searchType: Type, possiblePositions: number[], references: ReferenceEntry[]): void { - for (const position of possiblePositions) { - cancellationToken.throwIfCancellationRequested(); - - const node = getTouchingWord(sourceFile, position); - if (!node || node.kind !== SyntaxKind.StringLiteral) { - return; - } - - const type = getStringLiteralTypeForNode(node, typeChecker); - if (type === searchType) { - references.push(getReferenceEntryFromNode(node)); - } - } - } - } - - function populateSearchSymbolSet(symbol: Symbol, location: Node): Symbol[] { - // The search set contains at least the current symbol - let result = [symbol]; - - // If the location is name of property symbol from object literal destructuring pattern - // Search the property symbol - // for ( { property: p2 } of elems) { } - const containingObjectLiteralElement = getContainingObjectLiteralElement(location); - if (containingObjectLiteralElement && containingObjectLiteralElement.kind !== SyntaxKind.ShorthandPropertyAssignment) { - const propertySymbol = getPropertySymbolOfDestructuringAssignment(location); - if (propertySymbol) { - result.push(propertySymbol); - } - } - - // If the symbol is an alias, add what it aliases to the list - // import {a} from "mod"; - // export {a} - // If the symbol is an alias to default declaration, add what it aliases to the list - // declare "mod" { export default class B { } } - // import B from "mod"; - //// For export specifiers, the exported name can be referring to a local symbol, e.g.: - //// import {a} from "mod"; - //// export {a as somethingElse} - //// We want the *local* declaration of 'a' as declared in the import, - //// *not* as declared within "mod" (or farther) - const aliasSymbol = getAliasSymbolForPropertyNameSymbol(symbol, location); - if (aliasSymbol) { - result = result.concat(populateSearchSymbolSet(aliasSymbol, location)); - } - - // If the location is in a context sensitive location (i.e. in an object literal) try - // to get a contextual type for it, and add the property symbol from the contextual - // type to the search set - if (containingObjectLiteralElement) { - forEach(getPropertySymbolsFromContextualType(containingObjectLiteralElement), contextualSymbol => { - addRange(result, typeChecker.getRootSymbols(contextualSymbol)); - }); - - /* Because in short-hand property assignment, location has two meaning : property name and as value of the property - * When we do findAllReference at the position of the short-hand property assignment, we would want to have references to position of - * property name and variable declaration of the identifier. - * Like in below example, when querying for all references for an identifier 'name', of the property assignment, the language service - * should show both 'name' in 'obj' and 'name' in variable declaration - * const name = "Foo"; - * const obj = { name }; - * In order to do that, we will populate the search set with the value symbol of the identifier as a value of the property assignment - * so that when matching with potential reference symbol, both symbols from property declaration and variable declaration - * will be included correctly. - */ - const shorthandValueSymbol = typeChecker.getShorthandAssignmentValueSymbol(location.parent); - if (shorthandValueSymbol) { - result.push(shorthandValueSymbol); - } - } - - // If the symbol.valueDeclaration is a property parameter declaration, - // we should include both parameter declaration symbol and property declaration symbol - // Parameter Declaration symbol is only visible within function scope, so the symbol is stored in constructor.locals. - // Property Declaration symbol is a member of the class, so the symbol is stored in its class Declaration.symbol.members - if (symbol.valueDeclaration && symbol.valueDeclaration.kind === SyntaxKind.Parameter && - isParameterPropertyDeclaration(symbol.valueDeclaration)) { - result = result.concat(typeChecker.getSymbolsOfParameterPropertyDeclaration(symbol.valueDeclaration, symbol.name)); - } - - // If this is symbol of binding element without propertyName declaration in Object binding pattern - // Include the property in the search - const bindingElementPropertySymbol = getPropertySymbolOfObjectBindingPatternWithoutPropertyName(symbol); - if (bindingElementPropertySymbol) { - result.push(bindingElementPropertySymbol); - } - - // If this is a union property, add all the symbols from all its source symbols in all unioned types. - // If the symbol is an instantiation from a another symbol (e.g. widened symbol) , add the root the list - forEach(typeChecker.getRootSymbols(symbol), rootSymbol => { - if (rootSymbol !== symbol) { - result.push(rootSymbol); - } - - // Add symbol of properties/methods of the same name in base classes and implemented interfaces definitions - if (!implementations && rootSymbol.parent && rootSymbol.parent.flags & (SymbolFlags.Class | SymbolFlags.Interface)) { - getPropertySymbolsFromBaseTypes(rootSymbol.parent, rootSymbol.getName(), result, /*previousIterationSymbolsCache*/ createMap()); - } - }); - - return result; - } - - /** - * Find symbol of the given property-name and add the symbol to the given result array - * @param symbol a symbol to start searching for the given propertyName - * @param propertyName a name of property to search for - * @param result an array of symbol of found property symbols - * @param previousIterationSymbolsCache a cache of symbol from previous iterations of calling this function to prevent infinite revisiting of the same symbol. - * The value of previousIterationSymbol is undefined when the function is first called. - */ - function getPropertySymbolsFromBaseTypes(symbol: Symbol, propertyName: string, result: Symbol[], - previousIterationSymbolsCache: SymbolTable): void { - if (!symbol) { - return; - } - - // If the current symbol is the same as the previous-iteration symbol, we can just return the symbol that has already been visited - // This is particularly important for the following cases, so that we do not infinitely visit the same symbol. - // For example: - // interface C extends C { - // /*findRef*/propName: string; - // } - // The first time getPropertySymbolsFromBaseTypes is called when finding-all-references at propName, - // the symbol argument will be the symbol of an interface "C" and previousIterationSymbol is undefined, - // the function will add any found symbol of the property-name, then its sub-routine will call - // getPropertySymbolsFromBaseTypes again to walk up any base types to prevent revisiting already - // visited symbol, interface "C", the sub-routine will pass the current symbol as previousIterationSymbol. - if (symbol.name in previousIterationSymbolsCache) { - return; - } - - if (symbol.flags & (SymbolFlags.Class | SymbolFlags.Interface)) { - forEach(symbol.getDeclarations(), declaration => { - if (isClassLike(declaration)) { - getPropertySymbolFromTypeReference(getClassExtendsHeritageClauseElement(declaration)); - forEach(getClassImplementsHeritageClauseElements(declaration), getPropertySymbolFromTypeReference); - } - else if (declaration.kind === SyntaxKind.InterfaceDeclaration) { - forEach(getInterfaceBaseTypeNodes(declaration), getPropertySymbolFromTypeReference); - } - }); - } - return; - - function getPropertySymbolFromTypeReference(typeReference: ExpressionWithTypeArguments) { - if (typeReference) { - const type = typeChecker.getTypeAtLocation(typeReference); - if (type) { - const propertySymbol = typeChecker.getPropertyOfType(type, propertyName); - if (propertySymbol) { - result.push(...typeChecker.getRootSymbols(propertySymbol)); - } - - // Visit the typeReference as well to see if it directly or indirectly use that property - previousIterationSymbolsCache[symbol.name] = symbol; - getPropertySymbolsFromBaseTypes(type.symbol, propertyName, result, previousIterationSymbolsCache); - } - } - } - } - - function getRelatedSymbol(searchSymbols: Symbol[], referenceSymbol: Symbol, referenceLocation: Node, searchLocationIsConstructor: boolean, parents: Symbol[] | undefined, cache: Map): Symbol { - if (contains(searchSymbols, referenceSymbol)) { - // If we are searching for constructor uses, they must be 'new' expressions. - return (!searchLocationIsConstructor || isNewExpressionTarget(referenceLocation)) && referenceSymbol; - } - - // If the reference symbol is an alias, check if what it is aliasing is one of the search - // symbols but by looking up for related symbol of this alias so it can handle multiple level of indirectness. - const aliasSymbol = getAliasSymbolForPropertyNameSymbol(referenceSymbol, referenceLocation); - if (aliasSymbol) { - return getRelatedSymbol(searchSymbols, aliasSymbol, referenceLocation, searchLocationIsConstructor, parents, cache); - } - - // If the reference location is in an object literal, try to get the contextual type for the - // object literal, lookup the property symbol in the contextual type, and use this symbol to - // compare to our searchSymbol - const containingObjectLiteralElement = getContainingObjectLiteralElement(referenceLocation); - if (containingObjectLiteralElement) { - const contextualSymbol = forEach(getPropertySymbolsFromContextualType(containingObjectLiteralElement), contextualSymbol => { - return forEach(typeChecker.getRootSymbols(contextualSymbol), s => searchSymbols.indexOf(s) >= 0 ? s : undefined); - }); - - if (contextualSymbol) { - return contextualSymbol; - } - - // If the reference location is the name of property from object literal destructuring pattern - // Get the property symbol from the object literal's type and look if thats the search symbol - // In below eg. get 'property' from type of elems iterating type - // for ( { property: p2 } of elems) { } - const propertySymbol = getPropertySymbolOfDestructuringAssignment(referenceLocation); - if (propertySymbol && searchSymbols.indexOf(propertySymbol) >= 0) { - return propertySymbol; - } - } - - // If the reference location is the binding element and doesn't have property name - // then include the binding element in the related symbols - // let { a } : { a }; - const bindingElementPropertySymbol = getPropertySymbolOfObjectBindingPatternWithoutPropertyName(referenceSymbol); - if (bindingElementPropertySymbol && searchSymbols.indexOf(bindingElementPropertySymbol) >= 0) { - return bindingElementPropertySymbol; - } - - // Unwrap symbols to get to the root (e.g. transient symbols as a result of widening) - // Or a union property, use its underlying unioned symbols - return forEach(typeChecker.getRootSymbols(referenceSymbol), rootSymbol => { - // if it is in the list, then we are done - if (searchSymbols.indexOf(rootSymbol) >= 0) { - return rootSymbol; - } - - // Finally, try all properties with the same name in any type the containing type extended or implemented, and - // see if any is in the list. If we were passed a parent symbol, only include types that are subtypes of the - // parent symbol - if (rootSymbol.parent && rootSymbol.parent.flags & (SymbolFlags.Class | SymbolFlags.Interface)) { - // Parents will only be defined if implementations is true - if (parents) { - if (!forEach(parents, parent => explicitlyInheritsFrom(rootSymbol.parent, parent, cache))) { - return undefined; - } - } - - const result: Symbol[] = []; - getPropertySymbolsFromBaseTypes(rootSymbol.parent, rootSymbol.getName(), result, /*previousIterationSymbolsCache*/ createMap()); - return forEach(result, s => searchSymbols.indexOf(s) >= 0 ? s : undefined); - } - - return undefined; - }); - } - - function getNameFromObjectLiteralElement(node: ObjectLiteralElement) { - if (node.name.kind === SyntaxKind.ComputedPropertyName) { - const nameExpression = (node.name).expression; - // treat computed property names where expression is string/numeric literal as just string/numeric literal - if (isStringOrNumericLiteral(nameExpression.kind)) { - return (nameExpression).text; - } - return undefined; - } - return (node.name).text; - } - - function getPropertySymbolsFromContextualType(node: ObjectLiteralElement): Symbol[] { - const objectLiteral = node.parent; - const contextualType = typeChecker.getContextualType(objectLiteral); - const name = getNameFromObjectLiteralElement(node); - if (name && contextualType) { - const result: Symbol[] = []; - const symbol = contextualType.getProperty(name); - if (symbol) { - result.push(symbol); - } - - if (contextualType.flags & TypeFlags.Union) { - forEach((contextualType).types, t => { - const symbol = t.getProperty(name); - if (symbol) { - result.push(symbol); - } - }); - } - return result; - } - return undefined; - } - - /** Given an initial searchMeaning, extracted from a location, widen the search scope based on the declarations - * of the corresponding symbol. e.g. if we are searching for "Foo" in value position, but "Foo" references a class - * then we need to widen the search to include type positions as well. - * On the contrary, if we are searching for "Bar" in type position and we trace bar to an interface, and an uninstantiated - * module, we want to keep the search limited to only types, as the two declarations (interface and uninstantiated module) - * do not intersect in any of the three spaces. - */ - function getIntersectingMeaningFromDeclarations(meaning: SemanticMeaning, declarations: Declaration[]): SemanticMeaning { - if (declarations) { - let lastIterationMeaning: SemanticMeaning; - do { - // The result is order-sensitive, for instance if initialMeaning === Namespace, and declarations = [class, instantiated module] - // we need to consider both as they initialMeaning intersects with the module in the namespace space, and the module - // intersects with the class in the value space. - // To achieve that we will keep iterating until the result stabilizes. - - // Remember the last meaning - lastIterationMeaning = meaning; - - for (const declaration of declarations) { - const declarationMeaning = getMeaningFromDeclaration(declaration); - - if (declarationMeaning & meaning) { - meaning |= declarationMeaning; - } - } - } - while (meaning !== lastIterationMeaning); - } - return meaning; - } - } - - function getReferenceEntryFromNode(node: Node): ReferenceEntry { - let start = node.getStart(); - let end = node.getEnd(); - - if (node.kind === SyntaxKind.StringLiteral) { - start += 1; - end -= 1; - } - - return { - fileName: node.getSourceFile().fileName, - textSpan: createTextSpanFromBounds(start, end), - isWriteAccess: isWriteAccess(node), - isDefinition: isDeclarationName(node) || isLiteralComputedPropertyDeclarationName(node) - }; - } - - /** A node is considered a writeAccess iff it is a name of a declaration or a target of an assignment */ - function isWriteAccess(node: Node): boolean { - if (node.kind === SyntaxKind.Identifier && isDeclarationName(node)) { - return true; - } - - const parent = node.parent; - if (parent) { - if (parent.kind === SyntaxKind.PostfixUnaryExpression || parent.kind === SyntaxKind.PrefixUnaryExpression) { - return true; - } - else if (parent.kind === SyntaxKind.BinaryExpression && (parent).left === node) { - const operator = (parent).operatorToken.kind; - return SyntaxKind.FirstAssignment <= operator && operator <= SyntaxKind.LastAssignment; - } - } - - return false; + return FindAllReferences.findReferencedSymbols(program.getTypeChecker(), cancellationToken, program.getSourceFiles(), getValidSourceFile(fileName), position, findInStrings, findInComments); } /// NavigateTo - function getNavigateToItems(searchValue: string, maxResultCount?: number): NavigateToItem[] { + function getNavigateToItems(searchValue: string, maxResultCount?: number, fileName?: string): NavigateToItem[] { synchronizeHostData(); - const checker = getProgram().getTypeChecker(); - return ts.NavigateTo.getNavigateToItems(program, checker, cancellationToken, searchValue, maxResultCount); + + const sourceFiles = fileName ? [getValidSourceFile(fileName)] : program.getSourceFiles(); + return ts.NavigateTo.getNavigateToItems(sourceFiles, program.getTypeChecker(), cancellationToken, searchValue, maxResultCount); } function getEmitOutput(fileName: string): EmitOutput { @@ -7123,156 +1384,6 @@ namespace ts { }; } - function getMeaningFromDeclaration(node: Node): SemanticMeaning { - switch (node.kind) { - case SyntaxKind.Parameter: - case SyntaxKind.VariableDeclaration: - case SyntaxKind.BindingElement: - case SyntaxKind.PropertyDeclaration: - case SyntaxKind.PropertySignature: - case SyntaxKind.PropertyAssignment: - case SyntaxKind.ShorthandPropertyAssignment: - case SyntaxKind.EnumMember: - case SyntaxKind.MethodDeclaration: - case SyntaxKind.MethodSignature: - case SyntaxKind.Constructor: - case SyntaxKind.GetAccessor: - case SyntaxKind.SetAccessor: - case SyntaxKind.FunctionDeclaration: - case SyntaxKind.FunctionExpression: - case SyntaxKind.ArrowFunction: - case SyntaxKind.CatchClause: - return SemanticMeaning.Value; - - case SyntaxKind.TypeParameter: - case SyntaxKind.InterfaceDeclaration: - case SyntaxKind.TypeAliasDeclaration: - case SyntaxKind.TypeLiteral: - return SemanticMeaning.Type; - - case SyntaxKind.ClassDeclaration: - case SyntaxKind.EnumDeclaration: - return SemanticMeaning.Value | SemanticMeaning.Type; - - case SyntaxKind.ModuleDeclaration: - if (isAmbientModule(node)) { - return SemanticMeaning.Namespace | SemanticMeaning.Value; - } - else if (getModuleInstanceState(node) === ModuleInstanceState.Instantiated) { - return SemanticMeaning.Namespace | SemanticMeaning.Value; - } - else { - return SemanticMeaning.Namespace; - } - - case SyntaxKind.NamedImports: - case SyntaxKind.ImportSpecifier: - case SyntaxKind.ImportEqualsDeclaration: - case SyntaxKind.ImportDeclaration: - case SyntaxKind.ExportAssignment: - case SyntaxKind.ExportDeclaration: - return SemanticMeaning.Value | SemanticMeaning.Type | SemanticMeaning.Namespace; - - // An external module can be a Value - case SyntaxKind.SourceFile: - return SemanticMeaning.Namespace | SemanticMeaning.Value; - } - - return SemanticMeaning.Value | SemanticMeaning.Type | SemanticMeaning.Namespace; - } - - function isTypeReference(node: Node): boolean { - if (isRightSideOfQualifiedNameOrPropertyAccess(node)) { - node = node.parent; - } - - return node.parent.kind === SyntaxKind.TypeReference || - (node.parent.kind === SyntaxKind.ExpressionWithTypeArguments && !isExpressionWithTypeArgumentsInClassExtendsClause(node.parent)) || - (node.kind === SyntaxKind.ThisKeyword && !isPartOfExpression(node)) || - node.kind === SyntaxKind.ThisType; - } - - function isNamespaceReference(node: Node): boolean { - return isQualifiedNameNamespaceReference(node) || isPropertyAccessNamespaceReference(node); - } - - function isPropertyAccessNamespaceReference(node: Node): boolean { - let root = node; - let isLastClause = true; - if (root.parent.kind === SyntaxKind.PropertyAccessExpression) { - while (root.parent && root.parent.kind === SyntaxKind.PropertyAccessExpression) { - root = root.parent; - } - - isLastClause = (root).name === node; - } - - if (!isLastClause && root.parent.kind === SyntaxKind.ExpressionWithTypeArguments && root.parent.parent.kind === SyntaxKind.HeritageClause) { - const decl = root.parent.parent.parent; - return (decl.kind === SyntaxKind.ClassDeclaration && (root.parent.parent).token === SyntaxKind.ImplementsKeyword) || - (decl.kind === SyntaxKind.InterfaceDeclaration && (root.parent.parent).token === SyntaxKind.ExtendsKeyword); - } - - return false; - } - - function isQualifiedNameNamespaceReference(node: Node): boolean { - let root = node; - let isLastClause = true; - if (root.parent.kind === SyntaxKind.QualifiedName) { - while (root.parent && root.parent.kind === SyntaxKind.QualifiedName) { - root = root.parent; - } - - isLastClause = (root).right === node; - } - - return root.parent.kind === SyntaxKind.TypeReference && !isLastClause; - } - - function isInRightSideOfImport(node: Node) { - while (node.parent.kind === SyntaxKind.QualifiedName) { - node = node.parent; - } - return isInternalModuleImportEqualsDeclaration(node.parent) && (node.parent).moduleReference === node; - } - - function getMeaningFromRightHandSideOfImportEquals(node: Node) { - Debug.assert(node.kind === SyntaxKind.Identifier); - - // import a = |b|; // Namespace - // import a = |b.c|; // Value, type, namespace - // import a = |b.c|.d; // Namespace - - if (node.parent.kind === SyntaxKind.QualifiedName && - (node.parent).right === node && - node.parent.parent.kind === SyntaxKind.ImportEqualsDeclaration) { - return SemanticMeaning.Value | SemanticMeaning.Type | SemanticMeaning.Namespace; - } - return SemanticMeaning.Namespace; - } - - function getMeaningFromLocation(node: Node): SemanticMeaning { - if (node.parent.kind === SyntaxKind.ExportAssignment) { - return SemanticMeaning.Value | SemanticMeaning.Type | SemanticMeaning.Namespace; - } - else if (isInRightSideOfImport(node)) { - return getMeaningFromRightHandSideOfImportEquals(node); - } - else if (isDeclarationName(node)) { - return getMeaningFromDeclaration(node.parent); - } - else if (isTypeReference(node)) { - return SemanticMeaning.Type; - } - else if (isNamespaceReference(node)) { - return SemanticMeaning.Namespace; - } - else { - return SemanticMeaning.Value; - } - } - // Signature help /** * This is a semantic operation. @@ -7361,529 +1472,23 @@ namespace ts { } function getSemanticClassifications(fileName: string, span: TextSpan): ClassifiedSpan[] { - return convertClassifications(getEncodedSemanticClassifications(fileName, span)); - } - - function checkForClassificationCancellation(kind: SyntaxKind) { - // We don't want to actually call back into our host on every node to find out if we've - // been canceled. That would be an enormous amount of chattyness, along with the all - // the overhead of marshalling the data to/from the host. So instead we pick a few - // reasonable node kinds to bother checking on. These node kinds represent high level - // constructs that we would expect to see commonly, but just at a far less frequent - // interval. - // - // For example, in checker.ts (around 750k) we only have around 600 of these constructs. - // That means we're calling back into the host around every 1.2k of the file we process. - // Lib.d.ts has similar numbers. - switch (kind) { - case SyntaxKind.ModuleDeclaration: - case SyntaxKind.ClassDeclaration: - case SyntaxKind.InterfaceDeclaration: - case SyntaxKind.FunctionDeclaration: - cancellationToken.throwIfCancellationRequested(); - } + synchronizeHostData(); + return ts.getSemanticClassifications(program.getTypeChecker(), cancellationToken, getValidSourceFile(fileName), program.getClassifiableNames(), span); } function getEncodedSemanticClassifications(fileName: string, span: TextSpan): Classifications { synchronizeHostData(); - - const sourceFile = getValidSourceFile(fileName); - const typeChecker = program.getTypeChecker(); - - const result: number[] = []; - const classifiableNames = program.getClassifiableNames(); - processNode(sourceFile); - - return { spans: result, endOfLineState: EndOfLineState.None }; - - function pushClassification(start: number, length: number, type: ClassificationType) { - result.push(start); - result.push(length); - result.push(type); - } - - function classifySymbol(symbol: Symbol, meaningAtPosition: SemanticMeaning): ClassificationType { - const flags = symbol.getFlags(); - if ((flags & SymbolFlags.Classifiable) === SymbolFlags.None) { - return; - } - - if (flags & SymbolFlags.Class) { - return ClassificationType.className; - } - else if (flags & SymbolFlags.Enum) { - return ClassificationType.enumName; - } - else if (flags & SymbolFlags.TypeAlias) { - return ClassificationType.typeAliasName; - } - else if (meaningAtPosition & SemanticMeaning.Type) { - if (flags & SymbolFlags.Interface) { - return ClassificationType.interfaceName; - } - else if (flags & SymbolFlags.TypeParameter) { - return ClassificationType.typeParameterName; - } - } - else if (flags & SymbolFlags.Module) { - // Only classify a module as such if - // - It appears in a namespace context. - // - There exists a module declaration which actually impacts the value side. - if (meaningAtPosition & SemanticMeaning.Namespace || - (meaningAtPosition & SemanticMeaning.Value && hasValueSideModule(symbol))) { - return ClassificationType.moduleName; - } - } - - return undefined; - - /** - * Returns true if there exists a module that introduces entities on the value side. - */ - function hasValueSideModule(symbol: Symbol): boolean { - return forEach(symbol.declarations, declaration => { - return declaration.kind === SyntaxKind.ModuleDeclaration && - getModuleInstanceState(declaration) === ModuleInstanceState.Instantiated; - }); - } - } - - function processNode(node: Node) { - // Only walk into nodes that intersect the requested span. - if (node && textSpanIntersectsWith(span, node.getFullStart(), node.getFullWidth())) { - const kind = node.kind; - checkForClassificationCancellation(kind); - - if (kind === SyntaxKind.Identifier && !nodeIsMissing(node)) { - const identifier = node; - - // Only bother calling into the typechecker if this is an identifier that - // could possibly resolve to a type name. This makes classification run - // in a third of the time it would normally take. - if (classifiableNames[identifier.text]) { - const symbol = typeChecker.getSymbolAtLocation(node); - if (symbol) { - const type = classifySymbol(symbol, getMeaningFromLocation(node)); - if (type) { - pushClassification(node.getStart(), node.getWidth(), type); - } - } - } - } - - forEachChild(node, processNode); - } - } - } - - function getClassificationTypeName(type: ClassificationType) { - switch (type) { - case ClassificationType.comment: return ClassificationTypeNames.comment; - case ClassificationType.identifier: return ClassificationTypeNames.identifier; - case ClassificationType.keyword: return ClassificationTypeNames.keyword; - case ClassificationType.numericLiteral: return ClassificationTypeNames.numericLiteral; - case ClassificationType.operator: return ClassificationTypeNames.operator; - case ClassificationType.stringLiteral: return ClassificationTypeNames.stringLiteral; - case ClassificationType.whiteSpace: return ClassificationTypeNames.whiteSpace; - case ClassificationType.text: return ClassificationTypeNames.text; - case ClassificationType.punctuation: return ClassificationTypeNames.punctuation; - case ClassificationType.className: return ClassificationTypeNames.className; - case ClassificationType.enumName: return ClassificationTypeNames.enumName; - case ClassificationType.interfaceName: return ClassificationTypeNames.interfaceName; - case ClassificationType.moduleName: return ClassificationTypeNames.moduleName; - case ClassificationType.typeParameterName: return ClassificationTypeNames.typeParameterName; - case ClassificationType.typeAliasName: return ClassificationTypeNames.typeAliasName; - case ClassificationType.parameterName: return ClassificationTypeNames.parameterName; - case ClassificationType.docCommentTagName: return ClassificationTypeNames.docCommentTagName; - case ClassificationType.jsxOpenTagName: return ClassificationTypeNames.jsxOpenTagName; - case ClassificationType.jsxCloseTagName: return ClassificationTypeNames.jsxCloseTagName; - case ClassificationType.jsxSelfClosingTagName: return ClassificationTypeNames.jsxSelfClosingTagName; - case ClassificationType.jsxAttribute: return ClassificationTypeNames.jsxAttribute; - case ClassificationType.jsxText: return ClassificationTypeNames.jsxText; - case ClassificationType.jsxAttributeStringLiteralValue: return ClassificationTypeNames.jsxAttributeStringLiteralValue; - } - } - - function convertClassifications(classifications: Classifications): ClassifiedSpan[] { - Debug.assert(classifications.spans.length % 3 === 0); - const dense = classifications.spans; - const result: ClassifiedSpan[] = []; - for (let i = 0, n = dense.length; i < n; i += 3) { - result.push({ - textSpan: createTextSpan(dense[i], dense[i + 1]), - classificationType: getClassificationTypeName(dense[i + 2]) - }); - } - - return result; + return ts.getEncodedSemanticClassifications(program.getTypeChecker(), cancellationToken, getValidSourceFile(fileName), program.getClassifiableNames(), span); } function getSyntacticClassifications(fileName: string, span: TextSpan): ClassifiedSpan[] { - return convertClassifications(getEncodedSyntacticClassifications(fileName, span)); + // doesn't use compiler - no need to synchronize with host + return ts.getSyntacticClassifications(cancellationToken, syntaxTreeCache.getCurrentSourceFile(fileName), span); } function getEncodedSyntacticClassifications(fileName: string, span: TextSpan): Classifications { // doesn't use compiler - no need to synchronize with host - const sourceFile = syntaxTreeCache.getCurrentSourceFile(fileName); - const spanStart = span.start; - const spanLength = span.length; - - // Make a scanner we can get trivia from. - const triviaScanner = createScanner(ScriptTarget.Latest, /*skipTrivia*/ false, sourceFile.languageVariant, sourceFile.text); - const mergeConflictScanner = createScanner(ScriptTarget.Latest, /*skipTrivia*/ false, sourceFile.languageVariant, sourceFile.text); - - const result: number[] = []; - processElement(sourceFile); - - return { spans: result, endOfLineState: EndOfLineState.None }; - - function pushClassification(start: number, length: number, type: ClassificationType) { - result.push(start); - result.push(length); - result.push(type); - } - - function classifyLeadingTriviaAndGetTokenStart(token: Node): number { - triviaScanner.setTextPos(token.pos); - while (true) { - const start = triviaScanner.getTextPos(); - // only bother scanning if we have something that could be trivia. - if (!couldStartTrivia(sourceFile.text, start)) { - return start; - } - - const kind = triviaScanner.scan(); - const end = triviaScanner.getTextPos(); - const width = end - start; - - // The moment we get something that isn't trivia, then stop processing. - if (!isTrivia(kind)) { - return start; - } - - // Don't bother with newlines/whitespace. - if (kind === SyntaxKind.NewLineTrivia || kind === SyntaxKind.WhitespaceTrivia) { - continue; - } - - // Only bother with the trivia if it at least intersects the span of interest. - if (isComment(kind)) { - classifyComment(token, kind, start, width); - - // Classifying a comment might cause us to reuse the trivia scanner - // (because of jsdoc comments). So after we classify the comment make - // sure we set the scanner position back to where it needs to be. - triviaScanner.setTextPos(end); - continue; - } - - if (kind === SyntaxKind.ConflictMarkerTrivia) { - const text = sourceFile.text; - const ch = text.charCodeAt(start); - - // for the <<<<<<< and >>>>>>> markers, we just add them in as comments - // in the classification stream. - if (ch === CharacterCodes.lessThan || ch === CharacterCodes.greaterThan) { - pushClassification(start, width, ClassificationType.comment); - continue; - } - - // for the ======== add a comment for the first line, and then lex all - // subsequent lines up until the end of the conflict marker. - Debug.assert(ch === CharacterCodes.equals); - classifyDisabledMergeCode(text, start, end); - } - } - } - - function classifyComment(token: Node, kind: SyntaxKind, start: number, width: number) { - if (kind === SyntaxKind.MultiLineCommentTrivia) { - // See if this is a doc comment. If so, we'll classify certain portions of it - // specially. - const docCommentAndDiagnostics = parseIsolatedJSDocComment(sourceFile.text, start, width); - if (docCommentAndDiagnostics && docCommentAndDiagnostics.jsDocComment) { - docCommentAndDiagnostics.jsDocComment.parent = token; - classifyJSDocComment(docCommentAndDiagnostics.jsDocComment); - return; - } - } - - // Simple comment. Just add as is. - pushCommentRange(start, width); - } - - function pushCommentRange(start: number, width: number) { - pushClassification(start, width, ClassificationType.comment); - } - - function classifyJSDocComment(docComment: JSDocComment) { - let pos = docComment.pos; - - for (const tag of docComment.tags) { - // As we walk through each tag, classify the portion of text from the end of - // the last tag (or the start of the entire doc comment) as 'comment'. - if (tag.pos !== pos) { - pushCommentRange(pos, tag.pos - pos); - } - - pushClassification(tag.atToken.pos, tag.atToken.end - tag.atToken.pos, ClassificationType.punctuation); - pushClassification(tag.tagName.pos, tag.tagName.end - tag.tagName.pos, ClassificationType.docCommentTagName); - - pos = tag.tagName.end; - - switch (tag.kind) { - case SyntaxKind.JSDocParameterTag: - processJSDocParameterTag(tag); - break; - case SyntaxKind.JSDocTemplateTag: - processJSDocTemplateTag(tag); - break; - case SyntaxKind.JSDocTypeTag: - processElement((tag).typeExpression); - break; - case SyntaxKind.JSDocReturnTag: - processElement((tag).typeExpression); - break; - } - - pos = tag.end; - } - - if (pos !== docComment.end) { - pushCommentRange(pos, docComment.end - pos); - } - - return; - - function processJSDocParameterTag(tag: JSDocParameterTag) { - if (tag.preParameterName) { - pushCommentRange(pos, tag.preParameterName.pos - pos); - pushClassification(tag.preParameterName.pos, tag.preParameterName.end - tag.preParameterName.pos, ClassificationType.parameterName); - pos = tag.preParameterName.end; - } - - if (tag.typeExpression) { - pushCommentRange(pos, tag.typeExpression.pos - pos); - processElement(tag.typeExpression); - pos = tag.typeExpression.end; - } - - if (tag.postParameterName) { - pushCommentRange(pos, tag.postParameterName.pos - pos); - pushClassification(tag.postParameterName.pos, tag.postParameterName.end - tag.postParameterName.pos, ClassificationType.parameterName); - pos = tag.postParameterName.end; - } - } - } - - function processJSDocTemplateTag(tag: JSDocTemplateTag) { - for (const child of tag.getChildren()) { - processElement(child); - } - } - - function classifyDisabledMergeCode(text: string, start: number, end: number) { - // Classify the line that the ======= marker is on as a comment. Then just lex - // all further tokens and add them to the result. - let i: number; - for (i = start; i < end; i++) { - if (isLineBreak(text.charCodeAt(i))) { - break; - } - } - pushClassification(start, i - start, ClassificationType.comment); - mergeConflictScanner.setTextPos(i); - - while (mergeConflictScanner.getTextPos() < end) { - classifyDisabledCodeToken(); - } - } - - function classifyDisabledCodeToken() { - const start = mergeConflictScanner.getTextPos(); - const tokenKind = mergeConflictScanner.scan(); - const end = mergeConflictScanner.getTextPos(); - - const type = classifyTokenType(tokenKind); - if (type) { - pushClassification(start, end - start, type); - } - } - - /** - * Returns true if node should be treated as classified and no further processing is required. - * False will mean that node is not classified and traverse routine should recurse into node contents. - */ - function tryClassifyNode(node: Node): boolean { - if (isJSDocTag(node)) { - return true; - } - - if (nodeIsMissing(node)) { - return true; - } - - const classifiedElementName = tryClassifyJsxElementName(node); - if (!isToken(node) && node.kind !== SyntaxKind.JsxText && classifiedElementName === undefined) { - return false; - } - - const tokenStart = node.kind === SyntaxKind.JsxText ? node.pos : classifyLeadingTriviaAndGetTokenStart(node); - - const tokenWidth = node.end - tokenStart; - Debug.assert(tokenWidth >= 0); - if (tokenWidth > 0) { - const type = classifiedElementName || classifyTokenType(node.kind, node); - if (type) { - pushClassification(tokenStart, tokenWidth, type); - } - } - - return true; - } - - function tryClassifyJsxElementName(token: Node): ClassificationType { - switch (token.parent && token.parent.kind) { - case SyntaxKind.JsxOpeningElement: - if ((token.parent).tagName === token) { - return ClassificationType.jsxOpenTagName; - } - break; - case SyntaxKind.JsxClosingElement: - if ((token.parent).tagName === token) { - return ClassificationType.jsxCloseTagName; - } - break; - case SyntaxKind.JsxSelfClosingElement: - if ((token.parent).tagName === token) { - return ClassificationType.jsxSelfClosingTagName; - } - break; - case SyntaxKind.JsxAttribute: - if ((token.parent).name === token) { - return ClassificationType.jsxAttribute; - } - break; - } - return undefined; - } - - // for accurate classification, the actual token should be passed in. however, for - // cases like 'disabled merge code' classification, we just get the token kind and - // classify based on that instead. - function classifyTokenType(tokenKind: SyntaxKind, token?: Node): ClassificationType { - if (isKeyword(tokenKind)) { - return ClassificationType.keyword; - } - - // Special case < and > If they appear in a generic context they are punctuation, - // not operators. - if (tokenKind === SyntaxKind.LessThanToken || tokenKind === SyntaxKind.GreaterThanToken) { - // If the node owning the token has a type argument list or type parameter list, then - // we can effectively assume that a '<' and '>' belong to those lists. - if (token && getTypeArgumentOrTypeParameterList(token.parent)) { - return ClassificationType.punctuation; - } - } - - if (isPunctuation(tokenKind)) { - if (token) { - if (tokenKind === SyntaxKind.EqualsToken) { - // the '=' in a variable declaration is special cased here. - if (token.parent.kind === SyntaxKind.VariableDeclaration || - token.parent.kind === SyntaxKind.PropertyDeclaration || - token.parent.kind === SyntaxKind.Parameter || - token.parent.kind === SyntaxKind.JsxAttribute) { - return ClassificationType.operator; - } - } - - if (token.parent.kind === SyntaxKind.BinaryExpression || - token.parent.kind === SyntaxKind.PrefixUnaryExpression || - token.parent.kind === SyntaxKind.PostfixUnaryExpression || - token.parent.kind === SyntaxKind.ConditionalExpression) { - return ClassificationType.operator; - } - } - - return ClassificationType.punctuation; - } - else if (tokenKind === SyntaxKind.NumericLiteral) { - return ClassificationType.numericLiteral; - } - else if (tokenKind === SyntaxKind.StringLiteral) { - return token.parent.kind === SyntaxKind.JsxAttribute ? ClassificationType.jsxAttributeStringLiteralValue : ClassificationType.stringLiteral; - } - else if (tokenKind === SyntaxKind.RegularExpressionLiteral) { - // TODO: we should get another classification type for these literals. - return ClassificationType.stringLiteral; - } - else if (isTemplateLiteralKind(tokenKind)) { - // TODO (drosen): we should *also* get another classification type for these literals. - return ClassificationType.stringLiteral; - } - else if (tokenKind === SyntaxKind.JsxText) { - return ClassificationType.jsxText; - } - else if (tokenKind === SyntaxKind.Identifier) { - if (token) { - switch (token.parent.kind) { - case SyntaxKind.ClassDeclaration: - if ((token.parent).name === token) { - return ClassificationType.className; - } - return; - case SyntaxKind.TypeParameter: - if ((token.parent).name === token) { - return ClassificationType.typeParameterName; - } - return; - case SyntaxKind.InterfaceDeclaration: - if ((token.parent).name === token) { - return ClassificationType.interfaceName; - } - return; - case SyntaxKind.EnumDeclaration: - if ((token.parent).name === token) { - return ClassificationType.enumName; - } - return; - case SyntaxKind.ModuleDeclaration: - if ((token.parent).name === token) { - return ClassificationType.moduleName; - } - return; - case SyntaxKind.Parameter: - if ((token.parent).name === token) { - const isThis = token.kind === SyntaxKind.Identifier && (token).originalKeywordKind === SyntaxKind.ThisKeyword; - return isThis ? ClassificationType.keyword : ClassificationType.parameterName; - } - return; - } - } - return ClassificationType.identifier; - } - } - - function processElement(element: Node) { - if (!element) { - return; - } - - // Ignore nodes that don't intersect the original span to classify. - if (decodedTextSpanIntersectsWith(spanStart, spanLength, element.pos, element.getFullWidth())) { - checkForClassificationCancellation(element.kind); - - const children = element.getChildren(sourceFile); - for (let i = 0, n = children.length; i < n; i++) { - const child = children[i]; - if (!tryClassifyNode(child)) { - // Recurse into our child nodes. - processElement(child); - } - } - } - } + return ts.getEncodedSyntacticClassifications(cancellationToken, syntaxTreeCache.getCurrentSourceFile(fileName), span); } function getOutliningSpans(fileName: string): OutliningSpan[] { @@ -7982,109 +1587,11 @@ namespace ts { return []; } - /** - * Checks if position points to a valid position to add JSDoc comments, and if so, - * returns the appropriate template. Otherwise returns an empty string. - * Valid positions are - * - outside of comments, statements, and expressions, and - * - preceding a: - * - function/constructor/method declaration - * - class declarations - * - variable statements - * - namespace declarations - * - * Hosts should ideally check that: - * - The line is all whitespace up to 'position' before performing the insertion. - * - If the keystroke sequence "/\*\*" induced the call, we also check that the next - * non-whitespace character is '*', which (approximately) indicates whether we added - * the second '*' to complete an existing (JSDoc) comment. - * @param fileName The file in which to perform the check. - * @param position The (character-indexed) position in the file where the check should - * be performed. - */ function getDocCommentTemplateAtPosition(fileName: string, position: number): TextInsertion { - const sourceFile = syntaxTreeCache.getCurrentSourceFile(fileName); - - // Check if in a context where we don't want to perform any insertion - if (isInString(sourceFile, position) || isInComment(sourceFile, position) || hasDocComment(sourceFile, position)) { - return undefined; - } - - const tokenAtPos = getTokenAtPosition(sourceFile, position); - const tokenStart = tokenAtPos.getStart(); - if (!tokenAtPos || tokenStart < position) { - return undefined; - } - - // TODO: add support for: - // - enums/enum members - // - interfaces - // - property declarations - // - potentially property assignments - let commentOwner: Node; - findOwner: for (commentOwner = tokenAtPos; commentOwner; commentOwner = commentOwner.parent) { - switch (commentOwner.kind) { - case SyntaxKind.FunctionDeclaration: - case SyntaxKind.MethodDeclaration: - case SyntaxKind.Constructor: - case SyntaxKind.ClassDeclaration: - case SyntaxKind.VariableStatement: - break findOwner; - case SyntaxKind.SourceFile: - return undefined; - case SyntaxKind.ModuleDeclaration: - // If in walking up the tree, we hit a a nested namespace declaration, - // then we must be somewhere within a dotted namespace name; however we don't - // want to give back a JSDoc template for the 'b' or 'c' in 'namespace a.b.c { }'. - if (commentOwner.parent.kind === SyntaxKind.ModuleDeclaration) { - return undefined; - } - break findOwner; - } - } - - if (!commentOwner || commentOwner.getStart() < position) { - return undefined; - } - - const parameters = getParametersForJsDocOwningNode(commentOwner); - const posLineAndChar = sourceFile.getLineAndCharacterOfPosition(position); - const lineStart = sourceFile.getLineStarts()[posLineAndChar.line]; - - const indentationStr = sourceFile.text.substr(lineStart, posLineAndChar.character); - - const newLine = getNewLineOrDefaultFromHost(host); - - let docParams = ""; - for (let i = 0, numParams = parameters.length; i < numParams; i++) { - const currentName = parameters[i].name; - const paramName = currentName.kind === SyntaxKind.Identifier ? - (currentName).text : - "param" + i; - - docParams += `${indentationStr} * @param ${paramName}${newLine}`; - } - - // A doc comment consists of the following - // * The opening comment line - // * the first line (without a param) for the object's untagged info (this is also where the caret ends up) - // * the '@param'-tagged lines - // * TODO: other tags. - // * the closing comment line - // * if the caret was directly in front of the object, then we add an extra line and indentation. - const preamble = "/**" + newLine + - indentationStr + " * "; - const result = - preamble + newLine + - docParams + - indentationStr + " */" + - (tokenStart === position ? newLine + indentationStr : ""); - - return { newText: result, caretOffset: preamble.length }; + return JsDoc.getDocCommentTemplateAtPosition(getNewLineOrDefaultFromHost(host), syntaxTreeCache.getCurrentSourceFile(fileName), position); } function isValidBraceCompletionAtPosition(fileName: string, position: number, openingBrace: number): boolean { - // '<' is currently not supported, figuring out if we're in a Generic Type vs. a comparison is too // expensive to do during typing scenarios // i.e. whether we're dealing with: @@ -8113,52 +1620,6 @@ namespace ts { return true; } - function getParametersForJsDocOwningNode(commentOwner: Node): ParameterDeclaration[] { - if (isFunctionLike(commentOwner)) { - return commentOwner.parameters; - } - - if (commentOwner.kind === SyntaxKind.VariableStatement) { - const varStatement = commentOwner; - const varDeclarations = varStatement.declarationList.declarations; - - if (varDeclarations.length === 1 && varDeclarations[0].initializer) { - return getParametersFromRightHandSideOfAssignment(varDeclarations[0].initializer); - } - } - - return emptyArray; - } - - /** - * Digs into an an initializer or RHS operand of an assignment operation - * to get the parameters of an apt signature corresponding to a - * function expression or a class expression. - * - * @param rightHandSide the expression which may contain an appropriate set of parameters - * @returns the parameters of a signature found on the RHS if one exists; otherwise 'emptyArray'. - */ - function getParametersFromRightHandSideOfAssignment(rightHandSide: Expression): ParameterDeclaration[] { - while (rightHandSide.kind === SyntaxKind.ParenthesizedExpression) { - rightHandSide = (rightHandSide).expression; - } - - switch (rightHandSide.kind) { - case SyntaxKind.FunctionExpression: - case SyntaxKind.ArrowFunction: - return (rightHandSide).parameters; - case SyntaxKind.ClassExpression: - for (const member of (rightHandSide).members) { - if (member.kind === SyntaxKind.Constructor) { - return (member).parameters; - } - } - break; - } - - return emptyArray; - } - function getTodoComments(fileName: string, descriptors: TodoCommentDescriptor[]): TodoComment[] { // Note: while getting todo comments seems like a syntactic operation, we actually // treat it as a semantic operation here. This is because we expect our host to call @@ -8306,115 +1767,10 @@ namespace ts { } } - function getStringLiteralTypeForNode(node: StringLiteral | LiteralTypeNode, typeChecker: TypeChecker): LiteralType { - const searchNode = node.parent.kind === SyntaxKind.LiteralType ? node.parent : node; - const type = typeChecker.getTypeAtLocation(searchNode); - if (type && type.flags & TypeFlags.StringLiteral) { - return type; - } - return undefined; - } - function getRenameInfo(fileName: string, position: number): RenameInfo { synchronizeHostData(); - - const sourceFile = getValidSourceFile(fileName); - const typeChecker = program.getTypeChecker(); - const defaultLibFileName = host.getDefaultLibFileName(host.getCompilationSettings()); - const canonicalDefaultLibName = getCanonicalFileName(ts.normalizePath(defaultLibFileName)); - - const node = getTouchingWord(sourceFile, position, /*includeJsDocComment*/ true); - - if (node) { - if (node.kind === SyntaxKind.Identifier || - node.kind === SyntaxKind.StringLiteral || - isLiteralNameOfPropertyDeclarationOrIndexAccess(node) || - isThis(node)) { - const symbol = typeChecker.getSymbolAtLocation(node); - - // Only allow a symbol to be renamed if it actually has at least one declaration. - if (symbol) { - const declarations = symbol.getDeclarations(); - if (declarations && declarations.length > 0) { - // Disallow rename for elements that are defined in the standard TypeScript library. - if (forEach(declarations, isDefinedInLibraryFile)) { - return getRenameInfoError(getLocaleSpecificMessage(Diagnostics.You_cannot_rename_elements_that_are_defined_in_the_standard_TypeScript_library)); - } - - const displayName = stripQuotes(getDeclaredName(typeChecker, symbol, node)); - const kind = getSymbolKind(symbol, node); - if (kind) { - return { - canRename: true, - kind, - displayName, - localizedErrorMessage: undefined, - fullDisplayName: typeChecker.getFullyQualifiedName(symbol), - kindModifiers: getSymbolModifiers(symbol), - triggerSpan: createTriggerSpanForNode(node, sourceFile) - }; - } - } - } - else if (node.kind === SyntaxKind.StringLiteral) { - const type = getStringLiteralTypeForNode(node, typeChecker); - if (type) { - if (isDefinedInLibraryFile(node)) { - return getRenameInfoError(getLocaleSpecificMessage(Diagnostics.You_cannot_rename_elements_that_are_defined_in_the_standard_TypeScript_library)); - } - else { - const displayName = stripQuotes(type.text); - return { - canRename: true, - kind: ScriptElementKind.variableElement, - displayName, - localizedErrorMessage: undefined, - fullDisplayName: displayName, - kindModifiers: ScriptElementKindModifier.none, - triggerSpan: createTriggerSpanForNode(node, sourceFile) - }; - } - } - } - } - } - - return getRenameInfoError(getLocaleSpecificMessage(Diagnostics.You_cannot_rename_this_element)); - - function getRenameInfoError(localizedErrorMessage: string): RenameInfo { - return { - canRename: false, - localizedErrorMessage: localizedErrorMessage, - displayName: undefined, - fullDisplayName: undefined, - kind: undefined, - kindModifiers: undefined, - triggerSpan: undefined - }; - } - - function isDefinedInLibraryFile(declaration: Node) { - if (defaultLibFileName) { - const sourceFile = declaration.getSourceFile(); - const canonicalName = getCanonicalFileName(ts.normalizePath(sourceFile.fileName)); - if (canonicalName === canonicalDefaultLibName) { - return true; - } - } - return false; - } - - function createTriggerSpanForNode(node: Node, sourceFile: SourceFile) { - let start = node.getStart(sourceFile); - let width = node.getWidth(sourceFile); - if (node.kind === SyntaxKind.StringLiteral) { - // Exclude the quotes - start += 1; - width -= 2; - } - return createTextSpan(start, width); - } + return Rename.getRenameInfo(program.getTypeChecker(), defaultLibFileName, getCanonicalFileName, getValidSourceFile(fileName), position); } return { @@ -8429,11 +1785,12 @@ namespace ts { getEncodedSemanticClassifications, getCompletionsAtPosition, getCompletionEntryDetails, + getCompletionEntrySymbol, getSignatureHelpItems, getQuickInfoAtPosition, getDefinitionAtPosition, - getTypeDefinitionAtPosition, getImplementationAtPosition, + getTypeDefinitionAtPosition, getReferencesAtPosition, findReferences, getOccurrencesAtPosition, @@ -8459,15 +1816,6 @@ namespace ts { }; } - function forEachDescendantOfKind(node: Node, kind: SyntaxKind, action: (node: Node) => void) { - forEachChild(node, child => { - if (child.kind === kind) { - action(child); - } - forEachDescendantOfKind(child, kind, action); - }); - } - /* @internal */ export function getNameTable(sourceFile: SourceFile): Map { if (!sourceFile.nameTable) { @@ -8520,468 +1868,6 @@ namespace ts { (node.parent).argumentExpression === node; } - /// Classifier - export function createClassifier(): Classifier { - const scanner = createScanner(ScriptTarget.Latest, /*skipTrivia*/ false); - - /// We do not have a full parser support to know when we should parse a regex or not - /// If we consider every slash token to be a regex, we could be missing cases like "1/2/3", where - /// we have a series of divide operator. this list allows us to be more accurate by ruling out - /// locations where a regexp cannot exist. - const noRegexTable: boolean[] = []; - noRegexTable[SyntaxKind.Identifier] = true; - noRegexTable[SyntaxKind.StringLiteral] = true; - noRegexTable[SyntaxKind.NumericLiteral] = true; - noRegexTable[SyntaxKind.RegularExpressionLiteral] = true; - noRegexTable[SyntaxKind.ThisKeyword] = true; - noRegexTable[SyntaxKind.PlusPlusToken] = true; - noRegexTable[SyntaxKind.MinusMinusToken] = true; - noRegexTable[SyntaxKind.CloseParenToken] = true; - noRegexTable[SyntaxKind.CloseBracketToken] = true; - noRegexTable[SyntaxKind.CloseBraceToken] = true; - noRegexTable[SyntaxKind.TrueKeyword] = true; - noRegexTable[SyntaxKind.FalseKeyword] = true; - - // Just a stack of TemplateHeads and OpenCurlyBraces, used to perform rudimentary (inexact) - // classification on template strings. Because of the context free nature of templates, - // the only precise way to classify a template portion would be by propagating the stack across - // lines, just as we do with the end-of-line state. However, this is a burden for implementers, - // and the behavior is entirely subsumed by the syntactic classifier anyway, so we instead - // flatten any nesting when the template stack is non-empty and encode it in the end-of-line state. - // Situations in which this fails are - // 1) When template strings are nested across different lines: - // `hello ${ `world - // ` }` - // - // Where on the second line, you will get the closing of a template, - // a closing curly, and a new template. - // - // 2) When substitution expressions have curly braces and the curly brace falls on the next line: - // `hello ${ () => { - // return "world" } } ` - // - // Where on the second line, you will get the 'return' keyword, - // a string literal, and a template end consisting of '} } `'. - const templateStack: SyntaxKind[] = []; - - /** Returns true if 'keyword2' can legally follow 'keyword1' in any language construct. */ - function canFollow(keyword1: SyntaxKind, keyword2: SyntaxKind) { - if (isAccessibilityModifier(keyword1)) { - if (keyword2 === SyntaxKind.GetKeyword || - keyword2 === SyntaxKind.SetKeyword || - keyword2 === SyntaxKind.ConstructorKeyword || - keyword2 === SyntaxKind.StaticKeyword) { - - // Allow things like "public get", "public constructor" and "public static". - // These are all legal. - return true; - } - - // Any other keyword following "public" is actually an identifier an not a real - // keyword. - return false; - } - - // Assume any other keyword combination is legal. This can be refined in the future - // if there are more cases we want the classifier to be better at. - return true; - } - - function convertClassifications(classifications: Classifications, text: string): ClassificationResult { - const entries: ClassificationInfo[] = []; - const dense = classifications.spans; - let lastEnd = 0; - - for (let i = 0, n = dense.length; i < n; i += 3) { - const start = dense[i]; - const length = dense[i + 1]; - const type = dense[i + 2]; - - // Make a whitespace entry between the last item and this one. - if (lastEnd >= 0) { - const whitespaceLength = start - lastEnd; - if (whitespaceLength > 0) { - entries.push({ length: whitespaceLength, classification: TokenClass.Whitespace }); - } - } - - entries.push({ length, classification: convertClassification(type) }); - lastEnd = start + length; - } - - const whitespaceLength = text.length - lastEnd; - if (whitespaceLength > 0) { - entries.push({ length: whitespaceLength, classification: TokenClass.Whitespace }); - } - - return { entries, finalLexState: classifications.endOfLineState }; - } - - function convertClassification(type: ClassificationType): TokenClass { - switch (type) { - case ClassificationType.comment: return TokenClass.Comment; - case ClassificationType.keyword: return TokenClass.Keyword; - case ClassificationType.numericLiteral: return TokenClass.NumberLiteral; - case ClassificationType.operator: return TokenClass.Operator; - case ClassificationType.stringLiteral: return TokenClass.StringLiteral; - case ClassificationType.whiteSpace: return TokenClass.Whitespace; - case ClassificationType.punctuation: return TokenClass.Punctuation; - case ClassificationType.identifier: - case ClassificationType.className: - case ClassificationType.enumName: - case ClassificationType.interfaceName: - case ClassificationType.moduleName: - case ClassificationType.typeParameterName: - case ClassificationType.typeAliasName: - case ClassificationType.text: - case ClassificationType.parameterName: - default: - return TokenClass.Identifier; - } - } - - function getClassificationsForLine(text: string, lexState: EndOfLineState, syntacticClassifierAbsent: boolean): ClassificationResult { - return convertClassifications(getEncodedLexicalClassifications(text, lexState, syntacticClassifierAbsent), text); - } - - // If there is a syntactic classifier ('syntacticClassifierAbsent' is false), - // we will be more conservative in order to avoid conflicting with the syntactic classifier. - function getEncodedLexicalClassifications(text: string, lexState: EndOfLineState, syntacticClassifierAbsent: boolean): Classifications { - let offset = 0; - let token = SyntaxKind.Unknown; - let lastNonTriviaToken = SyntaxKind.Unknown; - - // Empty out the template stack for reuse. - while (templateStack.length > 0) { - templateStack.pop(); - } - - // If we're in a string literal, then prepend: "\ - // (and a newline). That way when we lex we'll think we're still in a string literal. - // - // If we're in a multiline comment, then prepend: /* - // (and a newline). That way when we lex we'll think we're still in a multiline comment. - switch (lexState) { - case EndOfLineState.InDoubleQuoteStringLiteral: - text = "\"\\\n" + text; - offset = 3; - break; - case EndOfLineState.InSingleQuoteStringLiteral: - text = "'\\\n" + text; - offset = 3; - break; - case EndOfLineState.InMultiLineCommentTrivia: - text = "/*\n" + text; - offset = 3; - break; - case EndOfLineState.InTemplateHeadOrNoSubstitutionTemplate: - text = "`\n" + text; - offset = 2; - break; - case EndOfLineState.InTemplateMiddleOrTail: - text = "}\n" + text; - offset = 2; - // fallthrough - case EndOfLineState.InTemplateSubstitutionPosition: - templateStack.push(SyntaxKind.TemplateHead); - break; - } - - scanner.setText(text); - - const result: Classifications = { - endOfLineState: EndOfLineState.None, - spans: [] - }; - - // We can run into an unfortunate interaction between the lexical and syntactic classifier - // when the user is typing something generic. Consider the case where the user types: - // - // Foo tokens. It's a weak heuristic, but should - // work well enough in practice. - let angleBracketStack = 0; - - do { - token = scanner.scan(); - - if (!isTrivia(token)) { - if ((token === SyntaxKind.SlashToken || token === SyntaxKind.SlashEqualsToken) && !noRegexTable[lastNonTriviaToken]) { - if (scanner.reScanSlashToken() === SyntaxKind.RegularExpressionLiteral) { - token = SyntaxKind.RegularExpressionLiteral; - } - } - else if (lastNonTriviaToken === SyntaxKind.DotToken && isKeyword(token)) { - token = SyntaxKind.Identifier; - } - else if (isKeyword(lastNonTriviaToken) && isKeyword(token) && !canFollow(lastNonTriviaToken, token)) { - // We have two keywords in a row. Only treat the second as a keyword if - // it's a sequence that could legally occur in the language. Otherwise - // treat it as an identifier. This way, if someone writes "private var" - // we recognize that 'var' is actually an identifier here. - token = SyntaxKind.Identifier; - } - else if (lastNonTriviaToken === SyntaxKind.Identifier && - token === SyntaxKind.LessThanToken) { - // Could be the start of something generic. Keep track of that by bumping - // up the current count of generic contexts we may be in. - angleBracketStack++; - } - else if (token === SyntaxKind.GreaterThanToken && angleBracketStack > 0) { - // If we think we're currently in something generic, then mark that that - // generic entity is complete. - angleBracketStack--; - } - else if (token === SyntaxKind.AnyKeyword || - token === SyntaxKind.StringKeyword || - token === SyntaxKind.NumberKeyword || - token === SyntaxKind.BooleanKeyword || - token === SyntaxKind.SymbolKeyword) { - if (angleBracketStack > 0 && !syntacticClassifierAbsent) { - // If it looks like we're could be in something generic, don't classify this - // as a keyword. We may just get overwritten by the syntactic classifier, - // causing a noisy experience for the user. - token = SyntaxKind.Identifier; - } - } - else if (token === SyntaxKind.TemplateHead) { - templateStack.push(token); - } - else if (token === SyntaxKind.OpenBraceToken) { - // If we don't have anything on the template stack, - // then we aren't trying to keep track of a previously scanned template head. - if (templateStack.length > 0) { - templateStack.push(token); - } - } - else if (token === SyntaxKind.CloseBraceToken) { - // If we don't have anything on the template stack, - // then we aren't trying to keep track of a previously scanned template head. - if (templateStack.length > 0) { - const lastTemplateStackToken = lastOrUndefined(templateStack); - - if (lastTemplateStackToken === SyntaxKind.TemplateHead) { - token = scanner.reScanTemplateToken(); - - // Only pop on a TemplateTail; a TemplateMiddle indicates there is more for us. - if (token === SyntaxKind.TemplateTail) { - templateStack.pop(); - } - else { - Debug.assert(token === SyntaxKind.TemplateMiddle, "Should have been a template middle. Was " + token); - } - } - else { - Debug.assert(lastTemplateStackToken === SyntaxKind.OpenBraceToken, "Should have been an open brace. Was: " + token); - templateStack.pop(); - } - } - } - - lastNonTriviaToken = token; - } - - processToken(); - } - while (token !== SyntaxKind.EndOfFileToken); - - return result; - - function processToken(): void { - const start = scanner.getTokenPos(); - const end = scanner.getTextPos(); - - addResult(start, end, classFromKind(token)); - - if (end >= text.length) { - if (token === SyntaxKind.StringLiteral) { - // Check to see if we finished up on a multiline string literal. - const tokenText = scanner.getTokenText(); - if (scanner.isUnterminated()) { - const lastCharIndex = tokenText.length - 1; - - let numBackslashes = 0; - while (tokenText.charCodeAt(lastCharIndex - numBackslashes) === CharacterCodes.backslash) { - numBackslashes++; - } - - // If we have an odd number of backslashes, then the multiline string is unclosed - if (numBackslashes & 1) { - const quoteChar = tokenText.charCodeAt(0); - result.endOfLineState = quoteChar === CharacterCodes.doubleQuote - ? EndOfLineState.InDoubleQuoteStringLiteral - : EndOfLineState.InSingleQuoteStringLiteral; - } - } - } - else if (token === SyntaxKind.MultiLineCommentTrivia) { - // Check to see if the multiline comment was unclosed. - if (scanner.isUnterminated()) { - result.endOfLineState = EndOfLineState.InMultiLineCommentTrivia; - } - } - else if (isTemplateLiteralKind(token)) { - if (scanner.isUnterminated()) { - if (token === SyntaxKind.TemplateTail) { - result.endOfLineState = EndOfLineState.InTemplateMiddleOrTail; - } - else if (token === SyntaxKind.NoSubstitutionTemplateLiteral) { - result.endOfLineState = EndOfLineState.InTemplateHeadOrNoSubstitutionTemplate; - } - else { - Debug.fail("Only 'NoSubstitutionTemplateLiteral's and 'TemplateTail's can be unterminated; got SyntaxKind #" + token); - } - } - } - else if (templateStack.length > 0 && lastOrUndefined(templateStack) === SyntaxKind.TemplateHead) { - result.endOfLineState = EndOfLineState.InTemplateSubstitutionPosition; - } - } - } - - function addResult(start: number, end: number, classification: ClassificationType): void { - if (classification === ClassificationType.whiteSpace) { - // Don't bother with whitespace classifications. They're not needed. - return; - } - - if (start === 0 && offset > 0) { - // We're classifying the first token, and this was a case where we prepended - // text. We should consider the start of this token to be at the start of - // the original text. - start += offset; - } - - // All our tokens are in relation to the augmented text. Move them back to be - // relative to the original text. - start -= offset; - end -= offset; - const length = end - start; - - if (length > 0) { - result.spans.push(start); - result.spans.push(length); - result.spans.push(classification); - } - } - } - - function isBinaryExpressionOperatorToken(token: SyntaxKind): boolean { - switch (token) { - case SyntaxKind.AsteriskToken: - case SyntaxKind.SlashToken: - case SyntaxKind.PercentToken: - case SyntaxKind.PlusToken: - case SyntaxKind.MinusToken: - case SyntaxKind.LessThanLessThanToken: - case SyntaxKind.GreaterThanGreaterThanToken: - case SyntaxKind.GreaterThanGreaterThanGreaterThanToken: - case SyntaxKind.LessThanToken: - case SyntaxKind.GreaterThanToken: - case SyntaxKind.LessThanEqualsToken: - case SyntaxKind.GreaterThanEqualsToken: - case SyntaxKind.InstanceOfKeyword: - case SyntaxKind.InKeyword: - case SyntaxKind.AsKeyword: - case SyntaxKind.EqualsEqualsToken: - case SyntaxKind.ExclamationEqualsToken: - case SyntaxKind.EqualsEqualsEqualsToken: - case SyntaxKind.ExclamationEqualsEqualsToken: - case SyntaxKind.AmpersandToken: - case SyntaxKind.CaretToken: - case SyntaxKind.BarToken: - case SyntaxKind.AmpersandAmpersandToken: - case SyntaxKind.BarBarToken: - case SyntaxKind.BarEqualsToken: - case SyntaxKind.AmpersandEqualsToken: - case SyntaxKind.CaretEqualsToken: - case SyntaxKind.LessThanLessThanEqualsToken: - case SyntaxKind.GreaterThanGreaterThanEqualsToken: - case SyntaxKind.GreaterThanGreaterThanGreaterThanEqualsToken: - case SyntaxKind.PlusEqualsToken: - case SyntaxKind.MinusEqualsToken: - case SyntaxKind.AsteriskEqualsToken: - case SyntaxKind.SlashEqualsToken: - case SyntaxKind.PercentEqualsToken: - case SyntaxKind.EqualsToken: - case SyntaxKind.CommaToken: - return true; - default: - return false; - } - } - - function isPrefixUnaryExpressionOperatorToken(token: SyntaxKind): boolean { - switch (token) { - case SyntaxKind.PlusToken: - case SyntaxKind.MinusToken: - case SyntaxKind.TildeToken: - case SyntaxKind.ExclamationToken: - case SyntaxKind.PlusPlusToken: - case SyntaxKind.MinusMinusToken: - return true; - default: - return false; - } - } - - function isKeyword(token: SyntaxKind): boolean { - return token >= SyntaxKind.FirstKeyword && token <= SyntaxKind.LastKeyword; - } - - function classFromKind(token: SyntaxKind): ClassificationType { - if (isKeyword(token)) { - return ClassificationType.keyword; - } - else if (isBinaryExpressionOperatorToken(token) || isPrefixUnaryExpressionOperatorToken(token)) { - return ClassificationType.operator; - } - else if (token >= SyntaxKind.FirstPunctuation && token <= SyntaxKind.LastPunctuation) { - return ClassificationType.punctuation; - } - - switch (token) { - case SyntaxKind.NumericLiteral: - return ClassificationType.numericLiteral; - case SyntaxKind.StringLiteral: - return ClassificationType.stringLiteral; - case SyntaxKind.RegularExpressionLiteral: - return ClassificationType.regularExpressionLiteral; - case SyntaxKind.ConflictMarkerTrivia: - case SyntaxKind.MultiLineCommentTrivia: - case SyntaxKind.SingleLineCommentTrivia: - return ClassificationType.comment; - case SyntaxKind.WhitespaceTrivia: - case SyntaxKind.NewLineTrivia: - return ClassificationType.whiteSpace; - case SyntaxKind.Identifier: - default: - if (isTemplateLiteralKind(token)) { - return ClassificationType.stringLiteral; - } - return ClassificationType.identifier; - } - } - - return { - getClassificationsForLine, - getEncodedLexicalClassifications - }; - } - /// getDefaultLibraryFilePath declare const __dirname: string; @@ -9000,15 +1886,7 @@ namespace ts { } function initializeServices() { - objectAllocator = { - getNodeConstructor: () => NodeObject, - getTokenConstructor: () => TokenObject, - getIdentifierConstructor: () => IdentifierObject, - getSourceFileConstructor: () => SourceFileObject, - getSymbolConstructor: () => SymbolObject, - getTypeConstructor: () => TypeObject, - getSignatureConstructor: () => SignatureObject, - }; + objectAllocator = getServicesObjectAllocator(); } initializeServices(); diff --git a/src/services/shims.ts b/src/services/shims.ts index deab2addc87..260c80127b5 100644 --- a/src/services/shims.ts +++ b/src/services/shims.ts @@ -215,7 +215,7 @@ namespace ts { * Returns a JSON-encoded value of the type: * { name: string; kind: string; kindModifiers: string; containerName: string; containerKind: string; matchKind: string; fileName: string; textSpan: { start: number; length: number}; } [] = []; */ - getNavigateToItems(searchValue: string, maxResultCount?: number): string; + getNavigateToItems(searchValue: string, maxResultCount?: number, fileName?: string): string; /** * Returns a JSON-encoded value of the type: @@ -949,10 +949,10 @@ namespace ts { /// NAVIGATE TO /** Return a list of symbols that are interesting to navigate to */ - public getNavigateToItems(searchValue: string, maxResultCount?: number): string { + public getNavigateToItems(searchValue: string, maxResultCount?: number, fileName?: string): string { return this.forwardJSONCall( - `getNavigateToItems('${searchValue}', ${maxResultCount})`, - () => this.languageService.getNavigateToItems(searchValue, maxResultCount) + `getNavigateToItems('${searchValue}', ${maxResultCount}, ${fileName})`, + () => this.languageService.getNavigateToItems(searchValue, maxResultCount, fileName) ); } diff --git a/src/services/symbolDisplay.ts b/src/services/symbolDisplay.ts new file mode 100644 index 00000000000..8b4d986df53 --- /dev/null +++ b/src/services/symbolDisplay.ts @@ -0,0 +1,523 @@ +/* @internal */ +namespace ts.SymbolDisplay { + // TODO(drosen): use contextual SemanticMeaning. + export function getSymbolKind(typeChecker: TypeChecker, symbol: Symbol, location: Node): string { + const flags = symbol.getFlags(); + + if (flags & SymbolFlags.Class) return getDeclarationOfKind(symbol, SyntaxKind.ClassExpression) ? + ScriptElementKind.localClassElement : ScriptElementKind.classElement; + if (flags & SymbolFlags.Enum) return ScriptElementKind.enumElement; + if (flags & SymbolFlags.TypeAlias) return ScriptElementKind.typeElement; + if (flags & SymbolFlags.Interface) return ScriptElementKind.interfaceElement; + if (flags & SymbolFlags.TypeParameter) return ScriptElementKind.typeParameterElement; + + const result = getSymbolKindOfConstructorPropertyMethodAccessorFunctionOrVar(typeChecker, symbol, flags, location); + if (result === ScriptElementKind.unknown) { + if (flags & SymbolFlags.TypeParameter) return ScriptElementKind.typeParameterElement; + if (flags & SymbolFlags.EnumMember) return ScriptElementKind.variableElement; + if (flags & SymbolFlags.Alias) return ScriptElementKind.alias; + if (flags & SymbolFlags.Module) return ScriptElementKind.moduleElement; + } + + return result; + } + + function getSymbolKindOfConstructorPropertyMethodAccessorFunctionOrVar(typeChecker: TypeChecker, symbol: Symbol, flags: SymbolFlags, location: Node) { + if (typeChecker.isUndefinedSymbol(symbol)) { + return ScriptElementKind.variableElement; + } + if (typeChecker.isArgumentsSymbol(symbol)) { + return ScriptElementKind.localVariableElement; + } + if (location.kind === SyntaxKind.ThisKeyword && isExpression(location)) { + return ScriptElementKind.parameterElement; + } + if (flags & SymbolFlags.Variable) { + if (isFirstDeclarationOfSymbolParameter(symbol)) { + return ScriptElementKind.parameterElement; + } + else if (symbol.valueDeclaration && isConst(symbol.valueDeclaration)) { + return ScriptElementKind.constElement; + } + else if (forEach(symbol.declarations, isLet)) { + return ScriptElementKind.letElement; + } + return isLocalVariableOrFunction(symbol) ? ScriptElementKind.localVariableElement : ScriptElementKind.variableElement; + } + if (flags & SymbolFlags.Function) return isLocalVariableOrFunction(symbol) ? ScriptElementKind.localFunctionElement : ScriptElementKind.functionElement; + if (flags & SymbolFlags.GetAccessor) return ScriptElementKind.memberGetAccessorElement; + if (flags & SymbolFlags.SetAccessor) return ScriptElementKind.memberSetAccessorElement; + if (flags & SymbolFlags.Method) return ScriptElementKind.memberFunctionElement; + if (flags & SymbolFlags.Constructor) return ScriptElementKind.constructorImplementationElement; + + if (flags & SymbolFlags.Property) { + if (flags & SymbolFlags.SyntheticProperty) { + // If union property is result of union of non method (property/accessors/variables), it is labeled as property + const unionPropertyKind = forEach(typeChecker.getRootSymbols(symbol), rootSymbol => { + const rootSymbolFlags = rootSymbol.getFlags(); + if (rootSymbolFlags & (SymbolFlags.PropertyOrAccessor | SymbolFlags.Variable)) { + return ScriptElementKind.memberVariableElement; + } + Debug.assert(!!(rootSymbolFlags & SymbolFlags.Method)); + }); + if (!unionPropertyKind) { + // If this was union of all methods, + // make sure it has call signatures before we can label it as method + const typeOfUnionProperty = typeChecker.getTypeOfSymbolAtLocation(symbol, location); + if (typeOfUnionProperty.getCallSignatures().length) { + return ScriptElementKind.memberFunctionElement; + } + return ScriptElementKind.memberVariableElement; + } + return unionPropertyKind; + } + return ScriptElementKind.memberVariableElement; + } + + return ScriptElementKind.unknown; + } + + export function getSymbolModifiers(symbol: Symbol): string { + return symbol && symbol.declarations && symbol.declarations.length > 0 + ? getNodeModifiers(symbol.declarations[0]) + : ScriptElementKindModifier.none; + } + + // TODO(drosen): Currently completion entry details passes the SemanticMeaning.All instead of using semanticMeaning of location + export function getSymbolDisplayPartsDocumentationAndSymbolKind(typeChecker: TypeChecker, symbol: Symbol, sourceFile: SourceFile, enclosingDeclaration: Node, + location: Node, semanticMeaning = getMeaningFromLocation(location)) { + + const displayParts: SymbolDisplayPart[] = []; + let documentation: SymbolDisplayPart[]; + const symbolFlags = symbol.flags; + let symbolKind = getSymbolKindOfConstructorPropertyMethodAccessorFunctionOrVar(typeChecker, symbol, symbolFlags, location); + let hasAddedSymbolInfo: boolean; + const isThisExpression = location.kind === SyntaxKind.ThisKeyword && isExpression(location); + let type: Type; + + // Class at constructor site need to be shown as constructor apart from property,method, vars + if (symbolKind !== ScriptElementKind.unknown || symbolFlags & SymbolFlags.Class || symbolFlags & SymbolFlags.Alias) { + // If it is accessor they are allowed only if location is at name of the accessor + if (symbolKind === ScriptElementKind.memberGetAccessorElement || symbolKind === ScriptElementKind.memberSetAccessorElement) { + symbolKind = ScriptElementKind.memberVariableElement; + } + + let signature: Signature; + type = isThisExpression ? typeChecker.getTypeAtLocation(location) : typeChecker.getTypeOfSymbolAtLocation(symbol, location); + if (type) { + if (location.parent && location.parent.kind === SyntaxKind.PropertyAccessExpression) { + const right = (location.parent).name; + // Either the location is on the right of a property access, or on the left and the right is missing + if (right === location || (right && right.getFullWidth() === 0)) { + location = location.parent; + } + } + + // try get the call/construct signature from the type if it matches + let callExpression: CallExpression; + if (location.kind === SyntaxKind.CallExpression || location.kind === SyntaxKind.NewExpression) { + callExpression = location; + } + else if (isCallExpressionTarget(location) || isNewExpressionTarget(location)) { + callExpression = location.parent; + } + + if (callExpression) { + const candidateSignatures: Signature[] = []; + signature = typeChecker.getResolvedSignature(callExpression, candidateSignatures); + if (!signature && candidateSignatures.length) { + // Use the first candidate: + signature = candidateSignatures[0]; + } + + const useConstructSignatures = callExpression.kind === SyntaxKind.NewExpression || callExpression.expression.kind === SyntaxKind.SuperKeyword; + const allSignatures = useConstructSignatures ? type.getConstructSignatures() : type.getCallSignatures(); + + if (!contains(allSignatures, signature.target) && !contains(allSignatures, signature)) { + // Get the first signature if there is one -- allSignatures may contain + // either the original signature or its target, so check for either + signature = allSignatures.length ? allSignatures[0] : undefined; + } + + if (signature) { + if (useConstructSignatures && (symbolFlags & SymbolFlags.Class)) { + // Constructor + symbolKind = ScriptElementKind.constructorImplementationElement; + addPrefixForAnyFunctionOrVar(type.symbol, symbolKind); + } + else if (symbolFlags & SymbolFlags.Alias) { + symbolKind = ScriptElementKind.alias; + pushTypePart(symbolKind); + displayParts.push(spacePart()); + if (useConstructSignatures) { + displayParts.push(keywordPart(SyntaxKind.NewKeyword)); + displayParts.push(spacePart()); + } + addFullSymbolName(symbol); + } + else { + addPrefixForAnyFunctionOrVar(symbol, symbolKind); + } + + switch (symbolKind) { + case ScriptElementKind.memberVariableElement: + case ScriptElementKind.variableElement: + case ScriptElementKind.constElement: + case ScriptElementKind.letElement: + case ScriptElementKind.parameterElement: + case ScriptElementKind.localVariableElement: + // If it is call or construct signature of lambda's write type name + displayParts.push(punctuationPart(SyntaxKind.ColonToken)); + displayParts.push(spacePart()); + if (useConstructSignatures) { + displayParts.push(keywordPart(SyntaxKind.NewKeyword)); + displayParts.push(spacePart()); + } + if (!(type.flags & TypeFlags.Anonymous) && type.symbol) { + addRange(displayParts, symbolToDisplayParts(typeChecker, type.symbol, enclosingDeclaration, /*meaning*/ undefined, SymbolFormatFlags.WriteTypeParametersOrArguments)); + } + addSignatureDisplayParts(signature, allSignatures, TypeFormatFlags.WriteArrowStyleSignature); + break; + + default: + // Just signature + addSignatureDisplayParts(signature, allSignatures); + } + hasAddedSymbolInfo = true; + } + } + else if ((isNameOfFunctionDeclaration(location) && !(symbol.flags & SymbolFlags.Accessor)) || // name of function declaration + (location.kind === SyntaxKind.ConstructorKeyword && location.parent.kind === SyntaxKind.Constructor)) { // At constructor keyword of constructor declaration + // get the signature from the declaration and write it + const functionDeclaration = location.parent; + const allSignatures = functionDeclaration.kind === SyntaxKind.Constructor ? type.getNonNullableType().getConstructSignatures() : type.getNonNullableType().getCallSignatures(); + if (!typeChecker.isImplementationOfOverload(functionDeclaration)) { + signature = typeChecker.getSignatureFromDeclaration(functionDeclaration); + } + else { + signature = allSignatures[0]; + } + + if (functionDeclaration.kind === SyntaxKind.Constructor) { + // show (constructor) Type(...) signature + symbolKind = ScriptElementKind.constructorImplementationElement; + addPrefixForAnyFunctionOrVar(type.symbol, symbolKind); + } + else { + // (function/method) symbol(..signature) + addPrefixForAnyFunctionOrVar(functionDeclaration.kind === SyntaxKind.CallSignature && + !(type.symbol.flags & SymbolFlags.TypeLiteral || type.symbol.flags & SymbolFlags.ObjectLiteral) ? type.symbol : symbol, symbolKind); + } + + addSignatureDisplayParts(signature, allSignatures); + hasAddedSymbolInfo = true; + } + } + } + if (symbolFlags & SymbolFlags.Class && !hasAddedSymbolInfo && !isThisExpression) { + if (getDeclarationOfKind(symbol, SyntaxKind.ClassExpression)) { + // Special case for class expressions because we would like to indicate that + // the class name is local to the class body (similar to function expression) + // (local class) class + pushTypePart(ScriptElementKind.localClassElement); + } + else { + // Class declaration has name which is not local. + displayParts.push(keywordPart(SyntaxKind.ClassKeyword)); + } + displayParts.push(spacePart()); + addFullSymbolName(symbol); + writeTypeParametersOfSymbol(symbol, sourceFile); + } + if ((symbolFlags & SymbolFlags.Interface) && (semanticMeaning & SemanticMeaning.Type)) { + addNewLineIfDisplayPartsExist(); + displayParts.push(keywordPart(SyntaxKind.InterfaceKeyword)); + displayParts.push(spacePart()); + addFullSymbolName(symbol); + writeTypeParametersOfSymbol(symbol, sourceFile); + } + if (symbolFlags & SymbolFlags.TypeAlias) { + addNewLineIfDisplayPartsExist(); + displayParts.push(keywordPart(SyntaxKind.TypeKeyword)); + displayParts.push(spacePart()); + addFullSymbolName(symbol); + writeTypeParametersOfSymbol(symbol, sourceFile); + displayParts.push(spacePart()); + displayParts.push(operatorPart(SyntaxKind.EqualsToken)); + displayParts.push(spacePart()); + addRange(displayParts, typeToDisplayParts(typeChecker, typeChecker.getDeclaredTypeOfSymbol(symbol), enclosingDeclaration, TypeFormatFlags.InTypeAlias)); + } + if (symbolFlags & SymbolFlags.Enum) { + addNewLineIfDisplayPartsExist(); + if (forEach(symbol.declarations, isConstEnumDeclaration)) { + displayParts.push(keywordPart(SyntaxKind.ConstKeyword)); + displayParts.push(spacePart()); + } + displayParts.push(keywordPart(SyntaxKind.EnumKeyword)); + displayParts.push(spacePart()); + addFullSymbolName(symbol); + } + if (symbolFlags & SymbolFlags.Module) { + addNewLineIfDisplayPartsExist(); + const declaration = getDeclarationOfKind(symbol, SyntaxKind.ModuleDeclaration); + const isNamespace = declaration && declaration.name && declaration.name.kind === SyntaxKind.Identifier; + displayParts.push(keywordPart(isNamespace ? SyntaxKind.NamespaceKeyword : SyntaxKind.ModuleKeyword)); + displayParts.push(spacePart()); + addFullSymbolName(symbol); + } + if ((symbolFlags & SymbolFlags.TypeParameter) && (semanticMeaning & SemanticMeaning.Type)) { + addNewLineIfDisplayPartsExist(); + displayParts.push(punctuationPart(SyntaxKind.OpenParenToken)); + displayParts.push(textPart("type parameter")); + displayParts.push(punctuationPart(SyntaxKind.CloseParenToken)); + displayParts.push(spacePart()); + addFullSymbolName(symbol); + displayParts.push(spacePart()); + displayParts.push(keywordPart(SyntaxKind.InKeyword)); + displayParts.push(spacePart()); + if (symbol.parent) { + // Class/Interface type parameter + addFullSymbolName(symbol.parent, enclosingDeclaration); + writeTypeParametersOfSymbol(symbol.parent, enclosingDeclaration); + } + else { + // Method/function type parameter + let declaration = getDeclarationOfKind(symbol, SyntaxKind.TypeParameter); + Debug.assert(declaration !== undefined); + declaration = declaration.parent; + + if (declaration) { + if (isFunctionLikeKind(declaration.kind)) { + const signature = typeChecker.getSignatureFromDeclaration(declaration); + if (declaration.kind === SyntaxKind.ConstructSignature) { + displayParts.push(keywordPart(SyntaxKind.NewKeyword)); + displayParts.push(spacePart()); + } + else if (declaration.kind !== SyntaxKind.CallSignature && (declaration).name) { + addFullSymbolName(declaration.symbol); + } + addRange(displayParts, signatureToDisplayParts(typeChecker, signature, sourceFile, TypeFormatFlags.WriteTypeArgumentsOfSignature)); + } + else { + // Type alias type parameter + // For example + // type list = T[]; // Both T will go through same code path + displayParts.push(keywordPart(SyntaxKind.TypeKeyword)); + displayParts.push(spacePart()); + addFullSymbolName(declaration.symbol); + writeTypeParametersOfSymbol(declaration.symbol, sourceFile); + } + } + } + } + if (symbolFlags & SymbolFlags.EnumMember) { + addPrefixForAnyFunctionOrVar(symbol, "enum member"); + const declaration = symbol.declarations[0]; + if (declaration.kind === SyntaxKind.EnumMember) { + const constantValue = typeChecker.getConstantValue(declaration); + if (constantValue !== undefined) { + displayParts.push(spacePart()); + displayParts.push(operatorPart(SyntaxKind.EqualsToken)); + displayParts.push(spacePart()); + displayParts.push(displayPart(constantValue.toString(), SymbolDisplayPartKind.numericLiteral)); + } + } + } + if (symbolFlags & SymbolFlags.Alias) { + addNewLineIfDisplayPartsExist(); + if (symbol.declarations[0].kind === SyntaxKind.NamespaceExportDeclaration) { + displayParts.push(keywordPart(SyntaxKind.ExportKeyword)); + displayParts.push(spacePart()); + displayParts.push(keywordPart(SyntaxKind.NamespaceKeyword)); + } + else { + displayParts.push(keywordPart(SyntaxKind.ImportKeyword)); + } + displayParts.push(spacePart()); + addFullSymbolName(symbol); + ts.forEach(symbol.declarations, declaration => { + if (declaration.kind === SyntaxKind.ImportEqualsDeclaration) { + const importEqualsDeclaration = declaration; + if (isExternalModuleImportEqualsDeclaration(importEqualsDeclaration)) { + displayParts.push(spacePart()); + displayParts.push(operatorPart(SyntaxKind.EqualsToken)); + displayParts.push(spacePart()); + displayParts.push(keywordPart(SyntaxKind.RequireKeyword)); + displayParts.push(punctuationPart(SyntaxKind.OpenParenToken)); + displayParts.push(displayPart(getTextOfNode(getExternalModuleImportEqualsDeclarationExpression(importEqualsDeclaration)), SymbolDisplayPartKind.stringLiteral)); + displayParts.push(punctuationPart(SyntaxKind.CloseParenToken)); + } + else { + const internalAliasSymbol = typeChecker.getSymbolAtLocation(importEqualsDeclaration.moduleReference); + if (internalAliasSymbol) { + displayParts.push(spacePart()); + displayParts.push(operatorPart(SyntaxKind.EqualsToken)); + displayParts.push(spacePart()); + addFullSymbolName(internalAliasSymbol, enclosingDeclaration); + } + } + return true; + } + }); + } + if (!hasAddedSymbolInfo) { + if (symbolKind !== ScriptElementKind.unknown) { + if (type) { + if (isThisExpression) { + addNewLineIfDisplayPartsExist(); + displayParts.push(keywordPart(SyntaxKind.ThisKeyword)); + } + else { + addPrefixForAnyFunctionOrVar(symbol, symbolKind); + } + + // For properties, variables and local vars: show the type + if (symbolKind === ScriptElementKind.memberVariableElement || + symbolFlags & SymbolFlags.Variable || + symbolKind === ScriptElementKind.localVariableElement || + isThisExpression) { + displayParts.push(punctuationPart(SyntaxKind.ColonToken)); + displayParts.push(spacePart()); + // If the type is type parameter, format it specially + if (type.symbol && type.symbol.flags & SymbolFlags.TypeParameter) { + const typeParameterParts = mapToDisplayParts(writer => { + typeChecker.getSymbolDisplayBuilder().buildTypeParameterDisplay(type, writer, enclosingDeclaration); + }); + addRange(displayParts, typeParameterParts); + } + else { + addRange(displayParts, typeToDisplayParts(typeChecker, type, enclosingDeclaration)); + } + } + else if (symbolFlags & SymbolFlags.Function || + symbolFlags & SymbolFlags.Method || + symbolFlags & SymbolFlags.Constructor || + symbolFlags & SymbolFlags.Signature || + symbolFlags & SymbolFlags.Accessor || + symbolKind === ScriptElementKind.memberFunctionElement) { + const allSignatures = type.getNonNullableType().getCallSignatures(); + addSignatureDisplayParts(allSignatures[0], allSignatures); + } + } + } + else { + symbolKind = getSymbolKind(typeChecker, symbol, location); + } + } + + if (!documentation) { + documentation = symbol.getDocumentationComment(); + if (documentation.length === 0 && symbol.flags & SymbolFlags.Property) { + // For some special property access expressions like `experts.foo = foo` or `module.exports.foo = foo` + // there documentation comments might be attached to the right hand side symbol of their declarations. + // The pattern of such special property access is that the parent symbol is the symbol of the file. + if (symbol.parent && forEach(symbol.parent.declarations, declaration => declaration.kind === SyntaxKind.SourceFile)) { + for (const declaration of symbol.declarations) { + if (!declaration.parent || declaration.parent.kind !== SyntaxKind.BinaryExpression) { + continue; + } + + const rhsSymbol = typeChecker.getSymbolAtLocation((declaration.parent).right); + if (!rhsSymbol) { + continue; + } + + documentation = rhsSymbol.getDocumentationComment(); + if (documentation.length > 0) { + break; + } + } + } + } + } + + return { displayParts, documentation, symbolKind }; + + function addNewLineIfDisplayPartsExist() { + if (displayParts.length) { + displayParts.push(lineBreakPart()); + } + } + + function addFullSymbolName(symbol: Symbol, enclosingDeclaration?: Node) { + const fullSymbolDisplayParts = symbolToDisplayParts(typeChecker, symbol, enclosingDeclaration || sourceFile, /*meaning*/ undefined, + SymbolFormatFlags.WriteTypeParametersOrArguments | SymbolFormatFlags.UseOnlyExternalAliasing); + addRange(displayParts, fullSymbolDisplayParts); + } + + function addPrefixForAnyFunctionOrVar(symbol: Symbol, symbolKind: string) { + addNewLineIfDisplayPartsExist(); + if (symbolKind) { + pushTypePart(symbolKind); + displayParts.push(spacePart()); + addFullSymbolName(symbol); + } + } + + function pushTypePart(symbolKind: string) { + switch (symbolKind) { + case ScriptElementKind.variableElement: + case ScriptElementKind.functionElement: + case ScriptElementKind.letElement: + case ScriptElementKind.constElement: + case ScriptElementKind.constructorImplementationElement: + displayParts.push(textOrKeywordPart(symbolKind)); + return; + default: + displayParts.push(punctuationPart(SyntaxKind.OpenParenToken)); + displayParts.push(textOrKeywordPart(symbolKind)); + displayParts.push(punctuationPart(SyntaxKind.CloseParenToken)); + return; + } + } + + function addSignatureDisplayParts(signature: Signature, allSignatures: Signature[], flags?: TypeFormatFlags) { + addRange(displayParts, signatureToDisplayParts(typeChecker, signature, enclosingDeclaration, flags | TypeFormatFlags.WriteTypeArgumentsOfSignature)); + if (allSignatures.length > 1) { + displayParts.push(spacePart()); + displayParts.push(punctuationPart(SyntaxKind.OpenParenToken)); + displayParts.push(operatorPart(SyntaxKind.PlusToken)); + displayParts.push(displayPart((allSignatures.length - 1).toString(), SymbolDisplayPartKind.numericLiteral)); + displayParts.push(spacePart()); + displayParts.push(textPart(allSignatures.length === 2 ? "overload" : "overloads")); + displayParts.push(punctuationPart(SyntaxKind.CloseParenToken)); + } + documentation = signature.getDocumentationComment(); + } + + function writeTypeParametersOfSymbol(symbol: Symbol, enclosingDeclaration: Node) { + const typeParameterParts = mapToDisplayParts(writer => { + typeChecker.getSymbolDisplayBuilder().buildTypeParameterDisplayFromSymbol(symbol, writer, enclosingDeclaration); + }); + addRange(displayParts, typeParameterParts); + } + } + + function isLocalVariableOrFunction(symbol: Symbol) { + if (symbol.parent) { + return false; // This is exported symbol + } + + return ts.forEach(symbol.declarations, declaration => { + // Function expressions are local + if (declaration.kind === SyntaxKind.FunctionExpression) { + return true; + } + + if (declaration.kind !== SyntaxKind.VariableDeclaration && declaration.kind !== SyntaxKind.FunctionDeclaration) { + return false; + } + + // If the parent is not sourceFile or module block it is local variable + for (let parent = declaration.parent; !isFunctionBlock(parent); parent = parent.parent) { + // Reached source file or module block + if (parent.kind === SyntaxKind.SourceFile || parent.kind === SyntaxKind.ModuleBlock) { + return false; + } + } + + // parent is in function block + return true; + }); + } +} diff --git a/src/services/transpile.ts b/src/services/transpile.ts new file mode 100644 index 00000000000..303ca0d4173 --- /dev/null +++ b/src/services/transpile.ts @@ -0,0 +1,154 @@ +namespace ts { + export interface TranspileOptions { + compilerOptions?: CompilerOptions; + fileName?: string; + reportDiagnostics?: boolean; + moduleName?: string; + renamedDependencies?: MapLike; + } + + export interface TranspileOutput { + outputText: string; + diagnostics?: Diagnostic[]; + sourceMapText?: string; + } + + /* + * This function will compile source text from 'input' argument using specified compiler options. + * If not options are provided - it will use a set of default compiler options. + * Extra compiler options that will unconditionally be used by this function are: + * - isolatedModules = true + * - allowNonTsExtensions = true + * - noLib = true + * - noResolve = true + */ + export function transpileModule(input: string, transpileOptions: TranspileOptions): TranspileOutput { + const diagnostics: Diagnostic[] = []; + + const options: CompilerOptions = transpileOptions.compilerOptions ? fixupCompilerOptions(transpileOptions.compilerOptions, diagnostics) : getDefaultCompilerOptions(); + + options.isolatedModules = true; + + // transpileModule does not write anything to disk so there is no need to verify that there are no conflicts between input and output paths. + options.suppressOutputPathCheck = true; + + // Filename can be non-ts file. + options.allowNonTsExtensions = true; + + // We are not returning a sourceFile for lib file when asked by the program, + // so pass --noLib to avoid reporting a file not found error. + options.noLib = true; + + // Clear out other settings that would not be used in transpiling this module + options.lib = undefined; + options.types = undefined; + options.noEmit = undefined; + options.noEmitOnError = undefined; + options.paths = undefined; + options.rootDirs = undefined; + options.declaration = undefined; + options.declarationDir = undefined; + options.out = undefined; + options.outFile = undefined; + + // We are not doing a full typecheck, we are not resolving the whole context, + // so pass --noResolve to avoid reporting missing file errors. + options.noResolve = true; + + // if jsx is specified then treat file as .tsx + const inputFileName = transpileOptions.fileName || (options.jsx ? "module.tsx" : "module.ts"); + const sourceFile = createSourceFile(inputFileName, input, options.target); + if (transpileOptions.moduleName) { + sourceFile.moduleName = transpileOptions.moduleName; + } + + if (transpileOptions.renamedDependencies) { + sourceFile.renamedDependencies = createMap(transpileOptions.renamedDependencies); + } + + const newLine = getNewLineCharacter(options); + + // Output + let outputText: string; + let sourceMapText: string; + + // Create a compilerHost object to allow the compiler to read and write files + const compilerHost: CompilerHost = { + getSourceFile: (fileName, target) => fileName === normalizePath(inputFileName) ? sourceFile : undefined, + writeFile: (name, text, writeByteOrderMark) => { + if (fileExtensionIs(name, ".map")) { + Debug.assert(sourceMapText === undefined, `Unexpected multiple source map outputs for the file '${name}'`); + sourceMapText = text; + } + else { + Debug.assert(outputText === undefined, `Unexpected multiple outputs for the file: '${name}'`); + outputText = text; + } + }, + getDefaultLibFileName: () => "lib.d.ts", + useCaseSensitiveFileNames: () => false, + getCanonicalFileName: fileName => fileName, + getCurrentDirectory: () => "", + getNewLine: () => newLine, + fileExists: (fileName): boolean => fileName === inputFileName, + readFile: (fileName): string => "", + directoryExists: directoryExists => true, + getDirectories: (path: string) => [] + }; + + const program = createProgram([inputFileName], options, compilerHost); + + if (transpileOptions.reportDiagnostics) { + addRange(/*to*/ diagnostics, /*from*/ program.getSyntacticDiagnostics(sourceFile)); + addRange(/*to*/ diagnostics, /*from*/ program.getOptionsDiagnostics()); + } + // Emit + program.emit(); + + Debug.assert(outputText !== undefined, "Output generation failed"); + + return { outputText, diagnostics, sourceMapText }; + } + + /* + * This is a shortcut function for transpileModule - it accepts transpileOptions as parameters and returns only outputText part of the result. + */ + export function transpile(input: string, compilerOptions?: CompilerOptions, fileName?: string, diagnostics?: Diagnostic[], moduleName?: string): string { + const output = transpileModule(input, { compilerOptions, fileName, reportDiagnostics: !!diagnostics, moduleName }); + // addRange correctly handles cases when wither 'from' or 'to' argument is missing + addRange(diagnostics, output.diagnostics); + return output.outputText; + } + + let commandLineOptionsStringToEnum: CommandLineOptionOfCustomType[]; + + /** JS users may pass in string values for enum compiler options (such as ModuleKind), so convert. */ + function fixupCompilerOptions(options: CompilerOptions, diagnostics: Diagnostic[]): CompilerOptions { + // Lazily create this value to fix module loading errors. + commandLineOptionsStringToEnum = commandLineOptionsStringToEnum || filter(optionDeclarations, o => + typeof o.type === "object" && !forEachProperty(o.type, v => typeof v !== "number")); + + options = clone(options); + + for (const opt of commandLineOptionsStringToEnum) { + if (!hasProperty(options, opt.name)) { + continue; + } + + const value = options[opt.name]; + // Value should be a key of opt.type + if (typeof value === "string") { + // If value is not a string, this will fail + options[opt.name] = parseCustomTypeOption(opt, value, diagnostics); + } + else { + if (!forEachProperty(opt.type, v => v === value)) { + // Supplied value isn't a valid enum value. + diagnostics.push(createCompilerDiagnosticForInvalidCustomType(opt)); + } + } + } + + return options; + } +} diff --git a/src/services/tsconfig.json b/src/services/tsconfig.json index e3856dc3251..58312c6f38f 100644 --- a/src/services/tsconfig.json +++ b/src/services/tsconfig.json @@ -40,17 +40,29 @@ "../compiler/program.ts", "../compiler/commandLineParser.ts", "../compiler/diagnosticInformationMap.generated.ts", + "types.ts", + "utilities.ts", "breakpoints.ts", + "classifier.ts", + "completions.ts", + "documentHighlights.ts", + "documentRegistry.ts", + "findAllReferences.ts", + "goToDefinition.ts", + "goToImplementation.ts", + "jsDoc.ts", + "jsTyping.ts", "navigateTo.ts", "navigationBar.ts", "outliningElementsCollector.ts", "patternMatcher.ts", + "preProcess.ts", + "rename.ts", "services.ts", + "transpile.ts", "shims.ts", "signatureHelp.ts", - "types.ts", - "utilities.ts", - "jsTyping.ts", + "symbolDisplay.ts", "formatting/formatting.ts", "formatting/formattingContext.ts", "formatting/formattingRequestKind.ts", diff --git a/src/services/types.ts b/src/services/types.ts index 2b377432bd4..7bd325482e6 100644 --- a/src/services/types.ts +++ b/src/services/types.ts @@ -194,6 +194,7 @@ namespace ts { getCompletionsAtPosition(fileName: string, position: number): CompletionInfo; getCompletionEntryDetails(fileName: string, position: number, entryName: string): CompletionEntryDetails; + getCompletionEntrySymbol(fileName: string, position: number, entryName: string): Symbol; getQuickInfoAtPosition(fileName: string, position: number): QuickInfo; @@ -217,7 +218,7 @@ namespace ts { /** @deprecated */ getOccurrencesAtPosition(fileName: string, position: number): ReferenceEntry[]; - getNavigateToItems(searchValue: string, maxResultCount?: number): NavigateToItem[]; + getNavigateToItems(searchValue: string, maxResultCount?: number, fileName?: string): NavigateToItem[]; getNavigationBarItems(fileName: string): NavigationBarItem[]; getOutliningSpans(fileName: string): OutliningSpan[]; @@ -358,6 +359,7 @@ namespace ts { InsertSpaceAfterOpeningAndBeforeClosingNonemptyBraces?: boolean; InsertSpaceAfterOpeningAndBeforeClosingTemplateStringBraces: boolean; InsertSpaceAfterOpeningAndBeforeClosingJsxExpressionBraces?: boolean; + InsertSpaceAfterTypeAssertion?: boolean; PlaceOpenBraceOnNewLineForFunctions: boolean; PlaceOpenBraceOnNewLineForControlBlocks: boolean; [s: string]: boolean | number | string | undefined; @@ -581,99 +583,6 @@ namespace ts { getEncodedLexicalClassifications(text: string, endOfLineState: EndOfLineState, syntacticClassifierAbsent: boolean): Classifications; } - /** - * The document registry represents a store of SourceFile objects that can be shared between - * multiple LanguageService instances. A LanguageService instance holds on the SourceFile (AST) - * of files in the context. - * SourceFile objects account for most of the memory usage by the language service. Sharing - * the same DocumentRegistry instance between different instances of LanguageService allow - * for more efficient memory utilization since all projects will share at least the library - * file (lib.d.ts). - * - * A more advanced use of the document registry is to serialize sourceFile objects to disk - * and re-hydrate them when needed. - * - * To create a default DocumentRegistry, use createDocumentRegistry to create one, and pass it - * to all subsequent createLanguageService calls. - */ - export interface DocumentRegistry { - /** - * Request a stored SourceFile with a given fileName and compilationSettings. - * The first call to acquire will call createLanguageServiceSourceFile to generate - * the SourceFile if was not found in the registry. - * - * @param fileName The name of the file requested - * @param compilationSettings Some compilation settings like target affects the - * shape of a the resulting SourceFile. This allows the DocumentRegistry to store - * multiple copies of the same file for different compilation settings. - * @parm scriptSnapshot Text of the file. Only used if the file was not found - * in the registry and a new one was created. - * @parm version Current version of the file. Only used if the file was not found - * in the registry and a new one was created. - */ - acquireDocument( - fileName: string, - compilationSettings: CompilerOptions, - scriptSnapshot: IScriptSnapshot, - version: string, - scriptKind?: ScriptKind): SourceFile; - - acquireDocumentWithKey( - fileName: string, - path: Path, - compilationSettings: CompilerOptions, - key: DocumentRegistryBucketKey, - scriptSnapshot: IScriptSnapshot, - version: string, - scriptKind?: ScriptKind): SourceFile; - - /** - * Request an updated version of an already existing SourceFile with a given fileName - * and compilationSettings. The update will in-turn call updateLanguageServiceSourceFile - * to get an updated SourceFile. - * - * @param fileName The name of the file requested - * @param compilationSettings Some compilation settings like target affects the - * shape of a the resulting SourceFile. This allows the DocumentRegistry to store - * multiple copies of the same file for different compilation settings. - * @param scriptSnapshot Text of the file. - * @param version Current version of the file. - */ - updateDocument( - fileName: string, - compilationSettings: CompilerOptions, - scriptSnapshot: IScriptSnapshot, - version: string, - scriptKind?: ScriptKind): SourceFile; - - updateDocumentWithKey( - fileName: string, - path: Path, - compilationSettings: CompilerOptions, - key: DocumentRegistryBucketKey, - scriptSnapshot: IScriptSnapshot, - version: string, - scriptKind?: ScriptKind): SourceFile; - - getKeyForCompilationSettings(settings: CompilerOptions): DocumentRegistryBucketKey; - /** - * Informs the DocumentRegistry that a file is not needed any longer. - * - * Note: It is not allowed to call release on a SourceFile that was not acquired from - * this registry originally. - * - * @param fileName The name of the file to be released - * @param compilationSettings The compilation settings used to acquire the file - */ - releaseDocument(fileName: string, compilationSettings: CompilerOptions): void; - - releaseDocumentWithKey(path: Path, key: DocumentRegistryBucketKey): void; - - reportStats(): string; - } - - export type DocumentRegistryBucketKey = string & { __bucketKey: any }; - // TODO: move these to enums export namespace ScriptElementKind { export const unknown = ""; diff --git a/src/services/utilities.ts b/src/services/utilities.ts index 593664c4128..ba419e4fec0 100644 --- a/src/services/utilities.ts +++ b/src/services/utilities.ts @@ -1,6 +1,387 @@ // These utilities are common to multiple language service features. /* @internal */ namespace ts { + export const scanner: Scanner = createScanner(ScriptTarget.Latest, /*skipTrivia*/ true); + export const emptyArray: any[] = []; + + export const enum SemanticMeaning { + None = 0x0, + Value = 0x1, + Type = 0x2, + Namespace = 0x4, + All = Value | Type | Namespace + } + + export function getMeaningFromDeclaration(node: Node): SemanticMeaning { + switch (node.kind) { + case SyntaxKind.Parameter: + case SyntaxKind.VariableDeclaration: + case SyntaxKind.BindingElement: + case SyntaxKind.PropertyDeclaration: + case SyntaxKind.PropertySignature: + case SyntaxKind.PropertyAssignment: + case SyntaxKind.ShorthandPropertyAssignment: + case SyntaxKind.EnumMember: + case SyntaxKind.MethodDeclaration: + case SyntaxKind.MethodSignature: + case SyntaxKind.Constructor: + case SyntaxKind.GetAccessor: + case SyntaxKind.SetAccessor: + case SyntaxKind.FunctionDeclaration: + case SyntaxKind.FunctionExpression: + case SyntaxKind.ArrowFunction: + case SyntaxKind.CatchClause: + return SemanticMeaning.Value; + + case SyntaxKind.TypeParameter: + case SyntaxKind.InterfaceDeclaration: + case SyntaxKind.TypeAliasDeclaration: + case SyntaxKind.TypeLiteral: + return SemanticMeaning.Type; + + case SyntaxKind.ClassDeclaration: + case SyntaxKind.EnumDeclaration: + return SemanticMeaning.Value | SemanticMeaning.Type; + + case SyntaxKind.ModuleDeclaration: + if (isAmbientModule(node)) { + return SemanticMeaning.Namespace | SemanticMeaning.Value; + } + else if (getModuleInstanceState(node) === ModuleInstanceState.Instantiated) { + return SemanticMeaning.Namespace | SemanticMeaning.Value; + } + else { + return SemanticMeaning.Namespace; + } + + case SyntaxKind.NamedImports: + case SyntaxKind.ImportSpecifier: + case SyntaxKind.ImportEqualsDeclaration: + case SyntaxKind.ImportDeclaration: + case SyntaxKind.ExportAssignment: + case SyntaxKind.ExportDeclaration: + return SemanticMeaning.Value | SemanticMeaning.Type | SemanticMeaning.Namespace; + + // An external module can be a Value + case SyntaxKind.SourceFile: + return SemanticMeaning.Namespace | SemanticMeaning.Value; + } + + return SemanticMeaning.Value | SemanticMeaning.Type | SemanticMeaning.Namespace; + } + + export function getMeaningFromLocation(node: Node): SemanticMeaning { + if (node.parent.kind === SyntaxKind.ExportAssignment) { + return SemanticMeaning.Value | SemanticMeaning.Type | SemanticMeaning.Namespace; + } + else if (isInRightSideOfImport(node)) { + return getMeaningFromRightHandSideOfImportEquals(node); + } + else if (isDeclarationName(node)) { + return getMeaningFromDeclaration(node.parent); + } + else if (isTypeReference(node)) { + return SemanticMeaning.Type; + } + else if (isNamespaceReference(node)) { + return SemanticMeaning.Namespace; + } + else { + return SemanticMeaning.Value; + } + } + + function getMeaningFromRightHandSideOfImportEquals(node: Node) { + Debug.assert(node.kind === SyntaxKind.Identifier); + + // import a = |b|; // Namespace + // import a = |b.c|; // Value, type, namespace + // import a = |b.c|.d; // Namespace + + if (node.parent.kind === SyntaxKind.QualifiedName && + (node.parent).right === node && + node.parent.parent.kind === SyntaxKind.ImportEqualsDeclaration) { + return SemanticMeaning.Value | SemanticMeaning.Type | SemanticMeaning.Namespace; + } + return SemanticMeaning.Namespace; + } + + function isInRightSideOfImport(node: Node) { + while (node.parent.kind === SyntaxKind.QualifiedName) { + node = node.parent; + } + return isInternalModuleImportEqualsDeclaration(node.parent) && (node.parent).moduleReference === node; + } + + function isNamespaceReference(node: Node): boolean { + return isQualifiedNameNamespaceReference(node) || isPropertyAccessNamespaceReference(node); + } + + function isQualifiedNameNamespaceReference(node: Node): boolean { + let root = node; + let isLastClause = true; + if (root.parent.kind === SyntaxKind.QualifiedName) { + while (root.parent && root.parent.kind === SyntaxKind.QualifiedName) { + root = root.parent; + } + + isLastClause = (root).right === node; + } + + return root.parent.kind === SyntaxKind.TypeReference && !isLastClause; + } + + function isPropertyAccessNamespaceReference(node: Node): boolean { + let root = node; + let isLastClause = true; + if (root.parent.kind === SyntaxKind.PropertyAccessExpression) { + while (root.parent && root.parent.kind === SyntaxKind.PropertyAccessExpression) { + root = root.parent; + } + + isLastClause = (root).name === node; + } + + if (!isLastClause && root.parent.kind === SyntaxKind.ExpressionWithTypeArguments && root.parent.parent.kind === SyntaxKind.HeritageClause) { + const decl = root.parent.parent.parent; + return (decl.kind === SyntaxKind.ClassDeclaration && (root.parent.parent).token === SyntaxKind.ImplementsKeyword) || + (decl.kind === SyntaxKind.InterfaceDeclaration && (root.parent.parent).token === SyntaxKind.ExtendsKeyword); + } + + return false; + } + + function isTypeReference(node: Node): boolean { + if (isRightSideOfQualifiedNameOrPropertyAccess(node)) { + node = node.parent; + } + + return node.parent.kind === SyntaxKind.TypeReference || + (node.parent.kind === SyntaxKind.ExpressionWithTypeArguments && !isExpressionWithTypeArgumentsInClassExtendsClause(node.parent)) || + (node.kind === SyntaxKind.ThisKeyword && !isPartOfExpression(node)) || + node.kind === SyntaxKind.ThisType; + } + + export function isCallExpressionTarget(node: Node): boolean { + return isCallOrNewExpressionTarget(node, SyntaxKind.CallExpression); + } + + export function isNewExpressionTarget(node: Node): boolean { + return isCallOrNewExpressionTarget(node, SyntaxKind.NewExpression); + } + + function isCallOrNewExpressionTarget(node: Node, kind: SyntaxKind) { + const target = climbPastPropertyAccess(node); + return target && target.parent && target.parent.kind === kind && (target.parent).expression === target; + } + + export function climbPastPropertyAccess(node: Node) { + return isRightSideOfPropertyAccess(node) ? node.parent : node; + } + + export function getTargetLabel(referenceNode: Node, labelName: string): Identifier { + while (referenceNode) { + if (referenceNode.kind === SyntaxKind.LabeledStatement && (referenceNode).label.text === labelName) { + return (referenceNode).label; + } + referenceNode = referenceNode.parent; + } + return undefined; + } + + export function isJumpStatementTarget(node: Node): boolean { + return node.kind === SyntaxKind.Identifier && + (node.parent.kind === SyntaxKind.BreakStatement || node.parent.kind === SyntaxKind.ContinueStatement) && + (node.parent).label === node; + } + + function isLabelOfLabeledStatement(node: Node): boolean { + return node.kind === SyntaxKind.Identifier && + node.parent.kind === SyntaxKind.LabeledStatement && + (node.parent).label === node; + } + + export function isLabelName(node: Node): boolean { + return isLabelOfLabeledStatement(node) || isJumpStatementTarget(node); + } + + export function isRightSideOfQualifiedName(node: Node) { + return node.parent.kind === SyntaxKind.QualifiedName && (node.parent).right === node; + } + + export function isRightSideOfPropertyAccess(node: Node) { + return node && node.parent && node.parent.kind === SyntaxKind.PropertyAccessExpression && (node.parent).name === node; + } + + export function isNameOfModuleDeclaration(node: Node) { + return node.parent.kind === SyntaxKind.ModuleDeclaration && (node.parent).name === node; + } + + export function isNameOfFunctionDeclaration(node: Node): boolean { + return node.kind === SyntaxKind.Identifier && + isFunctionLike(node.parent) && (node.parent).name === node; + } + + export function isLiteralNameOfPropertyDeclarationOrIndexAccess(node: Node): boolean { + if (node.kind === SyntaxKind.StringLiteral || node.kind === SyntaxKind.NumericLiteral) { + switch (node.parent.kind) { + case SyntaxKind.PropertyDeclaration: + case SyntaxKind.PropertySignature: + case SyntaxKind.PropertyAssignment: + case SyntaxKind.EnumMember: + case SyntaxKind.MethodDeclaration: + case SyntaxKind.MethodSignature: + case SyntaxKind.GetAccessor: + case SyntaxKind.SetAccessor: + case SyntaxKind.ModuleDeclaration: + return (node.parent).name === node; + case SyntaxKind.ElementAccessExpression: + return (node.parent).argumentExpression === node; + case SyntaxKind.ComputedPropertyName: + return true; + } + } + + return false; + } + + export function isExpressionOfExternalModuleImportEqualsDeclaration(node: Node) { + return isExternalModuleImportEqualsDeclaration(node.parent.parent) && + getExternalModuleImportEqualsDeclarationExpression(node.parent.parent) === node; + } + + /** Returns true if the position is within a comment */ + export function isInsideComment(sourceFile: SourceFile, token: Node, position: number): boolean { + // The position has to be: 1. in the leading trivia (before token.getStart()), and 2. within a comment + return position <= token.getStart(sourceFile) && + (isInsideCommentRange(getTrailingCommentRanges(sourceFile.text, token.getFullStart())) || + isInsideCommentRange(getLeadingCommentRanges(sourceFile.text, token.getFullStart()))); + + function isInsideCommentRange(comments: CommentRange[]): boolean { + return forEach(comments, comment => { + // either we are 1. completely inside the comment, or 2. at the end of the comment + if (comment.pos < position && position < comment.end) { + return true; + } + else if (position === comment.end) { + const text = sourceFile.text; + const width = comment.end - comment.pos; + // is single line comment or just /* + if (width <= 2 || text.charCodeAt(comment.pos + 1) === CharacterCodes.slash) { + return true; + } + else { + // is unterminated multi-line comment + return !(text.charCodeAt(comment.end - 1) === CharacterCodes.slash && + text.charCodeAt(comment.end - 2) === CharacterCodes.asterisk); + } + } + return false; + }); + } + } + + export function getContainerNode(node: Node): Declaration { + while (true) { + node = node.parent; + if (!node) { + return undefined; + } + switch (node.kind) { + case SyntaxKind.SourceFile: + case SyntaxKind.MethodDeclaration: + case SyntaxKind.MethodSignature: + case SyntaxKind.FunctionDeclaration: + case SyntaxKind.FunctionExpression: + case SyntaxKind.GetAccessor: + case SyntaxKind.SetAccessor: + case SyntaxKind.ClassDeclaration: + case SyntaxKind.InterfaceDeclaration: + case SyntaxKind.EnumDeclaration: + case SyntaxKind.ModuleDeclaration: + return node; + } + } + } + + export function getNodeKind(node: Node): string { + switch (node.kind) { + case SyntaxKind.SourceFile: + return isExternalModule(node) ? ScriptElementKind.moduleElement : ScriptElementKind.scriptElement; + case SyntaxKind.ModuleDeclaration: + return ScriptElementKind.moduleElement; + case SyntaxKind.ClassDeclaration: + case SyntaxKind.ClassExpression: + return ScriptElementKind.classElement; + case SyntaxKind.InterfaceDeclaration: return ScriptElementKind.interfaceElement; + case SyntaxKind.TypeAliasDeclaration: return ScriptElementKind.typeElement; + case SyntaxKind.EnumDeclaration: return ScriptElementKind.enumElement; + case SyntaxKind.VariableDeclaration: + return getKindOfVariableDeclaration(node); + case SyntaxKind.BindingElement: + return getKindOfVariableDeclaration(getRootDeclaration(node)); + case SyntaxKind.ArrowFunction: + case SyntaxKind.FunctionDeclaration: + case SyntaxKind.FunctionExpression: + return ScriptElementKind.functionElement; + case SyntaxKind.GetAccessor: return ScriptElementKind.memberGetAccessorElement; + case SyntaxKind.SetAccessor: return ScriptElementKind.memberSetAccessorElement; + case SyntaxKind.MethodDeclaration: + case SyntaxKind.MethodSignature: + return ScriptElementKind.memberFunctionElement; + case SyntaxKind.PropertyDeclaration: + case SyntaxKind.PropertySignature: + return ScriptElementKind.memberVariableElement; + case SyntaxKind.IndexSignature: return ScriptElementKind.indexSignatureElement; + case SyntaxKind.ConstructSignature: return ScriptElementKind.constructSignatureElement; + case SyntaxKind.CallSignature: return ScriptElementKind.callSignatureElement; + case SyntaxKind.Constructor: return ScriptElementKind.constructorImplementationElement; + case SyntaxKind.TypeParameter: return ScriptElementKind.typeParameterElement; + case SyntaxKind.EnumMember: return ScriptElementKind.enumMemberElement; + case SyntaxKind.Parameter: return hasModifier(node, ModifierFlags.ParameterPropertyModifier) ? ScriptElementKind.memberVariableElement : ScriptElementKind.parameterElement; + case SyntaxKind.ImportEqualsDeclaration: + case SyntaxKind.ImportSpecifier: + case SyntaxKind.ImportClause: + case SyntaxKind.ExportSpecifier: + case SyntaxKind.NamespaceImport: + return ScriptElementKind.alias; + case SyntaxKind.JSDocTypedefTag: + return ScriptElementKind.typeElement; + default: + return ScriptElementKind.unknown; + } + + function getKindOfVariableDeclaration(v: VariableDeclaration): string { + return isConst(v) + ? ScriptElementKind.constElement + : isLet(v) + ? ScriptElementKind.letElement + : ScriptElementKind.variableElement; + } + } + + export function getStringLiteralTypeForNode(node: StringLiteral | LiteralTypeNode, typeChecker: TypeChecker): LiteralType { + const searchNode = node.parent.kind === SyntaxKind.LiteralType ? node.parent : node; + const type = typeChecker.getTypeAtLocation(searchNode); + if (type && type.flags & TypeFlags.StringLiteral) { + return type; + } + return undefined; + } + + export function isThis(node: Node): boolean { + switch (node.kind) { + case SyntaxKind.ThisKeyword: + // case SyntaxKind.ThisType: TODO: GH#9267 + return true; + case SyntaxKind.Identifier: + // 'this' as a parameter + return (node as Identifier).originalKeywordKind === SyntaxKind.ThisKeyword && node.parent.kind === SyntaxKind.Parameter; + default: + return false; + } + } + // Matches the beginning of a triple slash directive const tripleSlashDirectivePrefixRegex = /^\/\/\/\s*A.Point : typeof A.Point >A : typeof A >Point : typeof A.Point ->0 : number ->0 : number +>0 : 0 +>0 : 0 diff --git a/tests/baselines/reference/AmbientModuleAndNonAmbientClassWithSameNameAndCommonRoot.types b/tests/baselines/reference/AmbientModuleAndNonAmbientClassWithSameNameAndCommonRoot.types index cd57c0c503d..83359d5ae27 100644 --- a/tests/baselines/reference/AmbientModuleAndNonAmbientClassWithSameNameAndCommonRoot.types +++ b/tests/baselines/reference/AmbientModuleAndNonAmbientClassWithSameNameAndCommonRoot.types @@ -50,6 +50,6 @@ var p = new A.Point(0, 0); // unexpected error here, bug 840000 >A.Point : typeof A.Point >A : typeof A >Point : typeof A.Point ->0 : number ->0 : number +>0 : 0 +>0 : 0 diff --git a/tests/baselines/reference/AmbientModuleAndNonAmbientFunctionWithTheSameNameAndCommonRoot.types b/tests/baselines/reference/AmbientModuleAndNonAmbientFunctionWithTheSameNameAndCommonRoot.types index 035f2a50c37..f8525c4e426 100644 --- a/tests/baselines/reference/AmbientModuleAndNonAmbientFunctionWithTheSameNameAndCommonRoot.types +++ b/tests/baselines/reference/AmbientModuleAndNonAmbientFunctionWithTheSameNameAndCommonRoot.types @@ -15,9 +15,9 @@ function Point() { return { x: 0, y: 0 }; >{ x: 0, y: 0 } : { x: number; y: number; } >x : number ->0 : number +>0 : 0 >y : number ->0 : number +>0 : 0 } === tests/cases/conformance/internalModules/DeclarationMerging/test.ts === diff --git a/tests/baselines/reference/ClassAndModuleThatMergeWithStaticFunctionAndNonExportedFunctionThatShareAName.types b/tests/baselines/reference/ClassAndModuleThatMergeWithStaticFunctionAndNonExportedFunctionThatShareAName.types index 9d943ab354c..b0685c4f858 100644 --- a/tests/baselines/reference/ClassAndModuleThatMergeWithStaticFunctionAndNonExportedFunctionThatShareAName.types +++ b/tests/baselines/reference/ClassAndModuleThatMergeWithStaticFunctionAndNonExportedFunctionThatShareAName.types @@ -11,9 +11,9 @@ class Point { >Point : Point >{ x: 0, y: 0 } : { x: number; y: number; } >x : number ->0 : number +>0 : 0 >y : number ->0 : number +>0 : 0 } module Point { @@ -21,7 +21,7 @@ module Point { function Origin() { return ""; }// not an error, since not exported >Origin : () => string ->"" : string +>"" : "" } @@ -40,9 +40,9 @@ module A { >Point : Point >{ x: 0, y: 0 } : { x: number; y: number; } >x : number ->0 : number +>0 : 0 >y : number ->0 : number +>0 : 0 } export module Point { @@ -50,6 +50,6 @@ module A { function Origin() { return ""; }// not an error since not exported >Origin : () => string ->"" : string +>"" : "" } } diff --git a/tests/baselines/reference/ClassAndModuleThatMergeWithStaticVariableAndNonExportedVarThatShareAName.types b/tests/baselines/reference/ClassAndModuleThatMergeWithStaticVariableAndNonExportedVarThatShareAName.types index 8f8ffc8839f..7aa32879b7c 100644 --- a/tests/baselines/reference/ClassAndModuleThatMergeWithStaticVariableAndNonExportedVarThatShareAName.types +++ b/tests/baselines/reference/ClassAndModuleThatMergeWithStaticVariableAndNonExportedVarThatShareAName.types @@ -11,9 +11,9 @@ class Point { >Point : Point >{ x: 0, y: 0 } : { x: number; y: number; } >x : number ->0 : number +>0 : 0 >y : number ->0 : number +>0 : 0 } module Point { @@ -21,7 +21,7 @@ module Point { var Origin = ""; // not an error, since not exported >Origin : string ->"" : string +>"" : "" } @@ -40,9 +40,9 @@ module A { >Point : Point >{ x: 0, y: 0 } : { x: number; y: number; } >x : number ->0 : number +>0 : 0 >y : number ->0 : number +>0 : 0 } export module Point { @@ -50,6 +50,6 @@ module A { var Origin = ""; // not an error since not exported >Origin : string ->"" : string +>"" : "" } } diff --git a/tests/baselines/reference/ClassDeclarationWithInvalidConstOnPropertyDeclaration2.types b/tests/baselines/reference/ClassDeclarationWithInvalidConstOnPropertyDeclaration2.types index 47139729995..5e6077a0933 100644 --- a/tests/baselines/reference/ClassDeclarationWithInvalidConstOnPropertyDeclaration2.types +++ b/tests/baselines/reference/ClassDeclarationWithInvalidConstOnPropertyDeclaration2.types @@ -7,5 +7,5 @@ class C { x = 10; >x : number ->10 : number +>10 : 10 } diff --git a/tests/baselines/reference/ES3For-ofTypeCheck2.types b/tests/baselines/reference/ES3For-ofTypeCheck2.types index 81230c9cea4..dd586109498 100644 --- a/tests/baselines/reference/ES3For-ofTypeCheck2.types +++ b/tests/baselines/reference/ES3For-ofTypeCheck2.types @@ -2,5 +2,5 @@ for (var v of [true]) { } >v : boolean >[true] : boolean[] ->true : boolean +>true : true diff --git a/tests/baselines/reference/ES5For-of10.types b/tests/baselines/reference/ES5For-of10.types index d31f8972038..2813e614e54 100644 --- a/tests/baselines/reference/ES5For-of10.types +++ b/tests/baselines/reference/ES5For-of10.types @@ -5,7 +5,7 @@ function foo() { return { x: 0 }; >{ x: 0 } : { x: number; } >x : number ->0 : number +>0 : 0 } for (foo().x of []) { >foo().x : number diff --git a/tests/baselines/reference/ES5For-of13.types b/tests/baselines/reference/ES5For-of13.types index 46125af551e..150517378d8 100644 --- a/tests/baselines/reference/ES5For-of13.types +++ b/tests/baselines/reference/ES5For-of13.types @@ -2,9 +2,9 @@ for (let v of ['a', 'b', 'c']) { >v : string >['a', 'b', 'c'] : string[] ->'a' : string ->'b' : string ->'c' : string +>'a' : "a" +>'b' : "b" +>'c' : "c" var x = v; >x : string diff --git a/tests/baselines/reference/ES5For-of24.types b/tests/baselines/reference/ES5For-of24.types index c0c4666fbf5..aa9aad228e5 100644 --- a/tests/baselines/reference/ES5For-of24.types +++ b/tests/baselines/reference/ES5For-of24.types @@ -2,9 +2,9 @@ var a = [1, 2, 3]; >a : number[] >[1, 2, 3] : number[] ->1 : number ->2 : number ->3 : number +>1 : 1 +>2 : 2 +>3 : 3 for (var v of a) { >v : number @@ -12,5 +12,5 @@ for (var v of a) { let a = 0; >a : number ->0 : number +>0 : 0 } diff --git a/tests/baselines/reference/ES5For-of25.types b/tests/baselines/reference/ES5For-of25.types index 4650e3244d3..0d304512bf3 100644 --- a/tests/baselines/reference/ES5For-of25.types +++ b/tests/baselines/reference/ES5For-of25.types @@ -2,9 +2,9 @@ var a = [1, 2, 3]; >a : number[] >[1, 2, 3] : number[] ->1 : number ->2 : number ->3 : number +>1 : 1 +>2 : 2 +>3 : 3 for (var v of a) { >v : number diff --git a/tests/baselines/reference/ES5For-of3.types b/tests/baselines/reference/ES5For-of3.types index 65267fe3f70..29825c5c32d 100644 --- a/tests/baselines/reference/ES5For-of3.types +++ b/tests/baselines/reference/ES5For-of3.types @@ -2,9 +2,9 @@ for (var v of ['a', 'b', 'c']) >v : string >['a', 'b', 'c'] : string[] ->'a' : string ->'b' : string ->'c' : string +>'a' : "a" +>'b' : "b" +>'c' : "c" var x = v; >x : string diff --git a/tests/baselines/reference/ES5For-of30.errors.txt b/tests/baselines/reference/ES5For-of30.errors.txt index e99b8284bf3..284dd372e5a 100644 --- a/tests/baselines/reference/ES5For-of30.errors.txt +++ b/tests/baselines/reference/ES5For-of30.errors.txt @@ -1,6 +1,6 @@ tests/cases/conformance/statements/for-ofStatements/ES5For-of30.ts(3,6): error TS2461: Type 'string | number' is not an array type. -tests/cases/conformance/statements/for-ofStatements/ES5For-of30.ts(3,7): error TS2322: Type 'number' is not assignable to type 'string'. -tests/cases/conformance/statements/for-ofStatements/ES5For-of30.ts(3,14): error TS2322: Type 'string' is not assignable to type 'number'. +tests/cases/conformance/statements/for-ofStatements/ES5For-of30.ts(3,7): error TS2322: Type '1' is not assignable to type 'string'. +tests/cases/conformance/statements/for-ofStatements/ES5For-of30.ts(3,14): error TS2322: Type '""' is not assignable to type 'number'. ==== tests/cases/conformance/statements/for-ofStatements/ES5For-of30.ts (3 errors) ==== @@ -10,9 +10,9 @@ tests/cases/conformance/statements/for-ofStatements/ES5For-of30.ts(3,14): error ~~~~~~~~~~~~~~~ !!! error TS2461: Type 'string | number' is not an array type. ~ -!!! error TS2322: Type 'number' is not assignable to type 'string'. +!!! error TS2322: Type '1' is not assignable to type 'string'. ~ -!!! error TS2322: Type 'string' is not assignable to type 'number'. +!!! error TS2322: Type '""' is not assignable to type 'number'. a; b; } \ No newline at end of file diff --git a/tests/baselines/reference/ES5For-of9.types b/tests/baselines/reference/ES5For-of9.types index ec41df704c6..6df6e295d75 100644 --- a/tests/baselines/reference/ES5For-of9.types +++ b/tests/baselines/reference/ES5For-of9.types @@ -5,7 +5,7 @@ function foo() { return { x: 0 }; >{ x: 0 } : { x: number; } >x : number ->0 : number +>0 : 0 } for (foo().x of []) { >foo().x : number diff --git a/tests/baselines/reference/ES5For-ofTypeCheck1.types b/tests/baselines/reference/ES5For-ofTypeCheck1.types index 395900d683b..6faba8c23aa 100644 --- a/tests/baselines/reference/ES5For-ofTypeCheck1.types +++ b/tests/baselines/reference/ES5For-ofTypeCheck1.types @@ -1,5 +1,5 @@ === tests/cases/conformance/statements/for-ofStatements/ES5For-ofTypeCheck1.ts === for (var v of "") { } >v : string ->"" : string +>"" : "" diff --git a/tests/baselines/reference/ES5For-ofTypeCheck12.errors.txt b/tests/baselines/reference/ES5For-ofTypeCheck12.errors.txt index 67af1f4f401..5310d588619 100644 --- a/tests/baselines/reference/ES5For-ofTypeCheck12.errors.txt +++ b/tests/baselines/reference/ES5For-ofTypeCheck12.errors.txt @@ -1,7 +1,7 @@ -tests/cases/conformance/statements/for-ofStatements/ES5For-ofTypeCheck12.ts(1,17): error TS2495: Type 'number' is not an array type or a string type. +tests/cases/conformance/statements/for-ofStatements/ES5For-ofTypeCheck12.ts(1,17): error TS2495: Type '0' is not an array type or a string type. ==== tests/cases/conformance/statements/for-ofStatements/ES5For-ofTypeCheck12.ts (1 errors) ==== for (const v of 0) { } ~ -!!! error TS2495: Type 'number' is not an array type or a string type. \ No newline at end of file +!!! error TS2495: Type '0' is not an array type or a string type. \ No newline at end of file diff --git a/tests/baselines/reference/ES5For-ofTypeCheck2.types b/tests/baselines/reference/ES5For-ofTypeCheck2.types index d28a2803216..f6c9b7c8ba4 100644 --- a/tests/baselines/reference/ES5For-ofTypeCheck2.types +++ b/tests/baselines/reference/ES5For-ofTypeCheck2.types @@ -2,5 +2,5 @@ for (var v of [true]) { } >v : boolean >[true] : boolean[] ->true : boolean +>true : true diff --git a/tests/baselines/reference/ES5For-ofTypeCheck3.types b/tests/baselines/reference/ES5For-ofTypeCheck3.types index a62dcc94f98..d46cdd0172d 100644 --- a/tests/baselines/reference/ES5For-ofTypeCheck3.types +++ b/tests/baselines/reference/ES5For-ofTypeCheck3.types @@ -2,8 +2,8 @@ var tuple: [string, number] = ["", 0]; >tuple : [string, number] >["", 0] : [string, number] ->"" : string ->0 : number +>"" : "" +>0 : 0 for (var v of tuple) { } >v : string | number diff --git a/tests/baselines/reference/ES5for-of32.types b/tests/baselines/reference/ES5for-of32.types index 034d7a3b1ea..188500c4859 100644 --- a/tests/baselines/reference/ES5for-of32.types +++ b/tests/baselines/reference/ES5for-of32.types @@ -3,13 +3,13 @@ var array = [1,2,3]; >array : number[] >[1,2,3] : number[] ->1 : number ->2 : number ->3 : number +>1 : 1 +>2 : 2 +>3 : 3 var sum = 0; >sum : number ->0 : number +>0 : 0 for (let num of array) { >num : number @@ -24,9 +24,9 @@ for (let num of array) { >array = [4,5,6] : number[] >array : number[] >[4,5,6] : number[] ->4 : number ->5 : number ->6 : number +>4 : 4 +>5 : 5 +>6 : 6 } sum += num; diff --git a/tests/baselines/reference/EnumAndModuleWithSameNameAndCommonRoot.types b/tests/baselines/reference/EnumAndModuleWithSameNameAndCommonRoot.types index 205335c7eb6..d2328929938 100644 --- a/tests/baselines/reference/EnumAndModuleWithSameNameAndCommonRoot.types +++ b/tests/baselines/reference/EnumAndModuleWithSameNameAndCommonRoot.types @@ -3,8 +3,8 @@ enum enumdule { >enumdule : enumdule Red, Blue ->Red : enumdule ->Blue : enumdule +>Red : enumdule.Red +>Blue : enumdule.Blue } module enumdule { @@ -25,9 +25,9 @@ var x: enumdule; var x = enumdule.Red; >x : enumdule ->enumdule.Red : enumdule +>enumdule.Red : enumdule.Red >enumdule : typeof enumdule ->Red : enumdule +>Red : enumdule.Red var y: { x: number; y: number }; >y : { x: number; y: number; } @@ -40,6 +40,6 @@ var y = new enumdule.Point(0, 0); >enumdule.Point : typeof enumdule.Point >enumdule : typeof enumdule >Point : typeof enumdule.Point ->0 : number ->0 : number +>0 : 0 +>0 : 0 diff --git a/tests/baselines/reference/ExportClassWhichExtendsInterfaceWithInaccessibleType.types b/tests/baselines/reference/ExportClassWhichExtendsInterfaceWithInaccessibleType.types index e47b38a0b61..04d0259f04e 100644 --- a/tests/baselines/reference/ExportClassWhichExtendsInterfaceWithInaccessibleType.types +++ b/tests/baselines/reference/ExportClassWhichExtendsInterfaceWithInaccessibleType.types @@ -31,7 +31,7 @@ module A { >Point : Point return 1; ->1 : number +>1 : 1 } } } diff --git a/tests/baselines/reference/ExportClassWithAccessibleTypesInTypeParameterConstraintsClassHeritageListMemberTypeAnnotations.types b/tests/baselines/reference/ExportClassWithAccessibleTypesInTypeParameterConstraintsClassHeritageListMemberTypeAnnotations.types index a5cefcc521e..e832f36e862 100644 --- a/tests/baselines/reference/ExportClassWithAccessibleTypesInTypeParameterConstraintsClassHeritageListMemberTypeAnnotations.types +++ b/tests/baselines/reference/ExportClassWithAccessibleTypesInTypeParameterConstraintsClassHeritageListMemberTypeAnnotations.types @@ -17,9 +17,9 @@ module A { >Point : Point >{ x: 0, y: 0 } : { x: number; y: number; } >x : number ->0 : number +>0 : 0 >y : number ->0 : number +>0 : 0 export class Point3d extends Point { >Point3d : Point3d @@ -34,11 +34,11 @@ module A { >Point3d : Point3d >{ x: 0, y: 0, z: 0 } : { x: number; y: number; z: number; } >x : number ->0 : number +>0 : 0 >y : number ->0 : number +>0 : 0 >z : number ->0 : number +>0 : 0 export class Line{ >Line : Line diff --git a/tests/baselines/reference/ExportClassWithInaccessibleTypeInTypeParameterConstraint.types b/tests/baselines/reference/ExportClassWithInaccessibleTypeInTypeParameterConstraint.types index ba174d9bbba..1a97175a833 100644 --- a/tests/baselines/reference/ExportClassWithInaccessibleTypeInTypeParameterConstraint.types +++ b/tests/baselines/reference/ExportClassWithInaccessibleTypeInTypeParameterConstraint.types @@ -17,9 +17,9 @@ module A { >Point : Point >{ x: 0, y: 0 } : { x: number; y: number; } >x : number ->0 : number +>0 : 0 >y : number ->0 : number +>0 : 0 export class Point3d extends Point { >Point3d : Point3d @@ -34,11 +34,11 @@ module A { >Point3d : Point3d >{ x: 0, y: 0, z: 0 } : { x: number; y: number; z: number; } >x : number ->0 : number +>0 : 0 >y : number ->0 : number +>0 : 0 >z : number ->0 : number +>0 : 0 export class Line{ >Line : Line diff --git a/tests/baselines/reference/ExportFunctionWithAccessibleTypesInParameterAndReturnTypeAnnotation.types b/tests/baselines/reference/ExportFunctionWithAccessibleTypesInParameterAndReturnTypeAnnotation.types index 60a6e122a78..957c9ce0207 100644 --- a/tests/baselines/reference/ExportFunctionWithAccessibleTypesInParameterAndReturnTypeAnnotation.types +++ b/tests/baselines/reference/ExportFunctionWithAccessibleTypesInParameterAndReturnTypeAnnotation.types @@ -33,9 +33,9 @@ module A { >Line : typeof Line >{ x: 0, y: 0 } : { x: number; y: number; } >x : number ->0 : number +>0 : 0 >y : number ->0 : number +>0 : 0 >p : Point } } diff --git a/tests/baselines/reference/ExportFunctionWithInaccessibleTypesInParameterTypeAnnotation.types b/tests/baselines/reference/ExportFunctionWithInaccessibleTypesInParameterTypeAnnotation.types index ba862ad77cf..079b39650d0 100644 --- a/tests/baselines/reference/ExportFunctionWithInaccessibleTypesInParameterTypeAnnotation.types +++ b/tests/baselines/reference/ExportFunctionWithInaccessibleTypesInParameterTypeAnnotation.types @@ -33,9 +33,9 @@ module A { >Line : typeof Line >{ x: 0, y: 0 } : { x: number; y: number; } >x : number ->0 : number +>0 : 0 >y : number ->0 : number +>0 : 0 >p : Point } } diff --git a/tests/baselines/reference/ExportFunctionWithInaccessibleTypesInReturnTypeAnnotation.types b/tests/baselines/reference/ExportFunctionWithInaccessibleTypesInReturnTypeAnnotation.types index ef72f80ffde..6fcbb786a68 100644 --- a/tests/baselines/reference/ExportFunctionWithInaccessibleTypesInReturnTypeAnnotation.types +++ b/tests/baselines/reference/ExportFunctionWithInaccessibleTypesInReturnTypeAnnotation.types @@ -33,9 +33,9 @@ module A { >Line : typeof Line >{ x: 0, y: 0 } : { x: number; y: number; } >x : number ->0 : number +>0 : 0 >y : number ->0 : number +>0 : 0 >p : Point } } diff --git a/tests/baselines/reference/ExportInterfaceWithAccessibleTypesInTypeParameterConstraintsClassHeritageListMemberTypeAnnotations.types b/tests/baselines/reference/ExportInterfaceWithAccessibleTypesInTypeParameterConstraintsClassHeritageListMemberTypeAnnotations.types index b4a331b9140..c7c78424064 100644 --- a/tests/baselines/reference/ExportInterfaceWithAccessibleTypesInTypeParameterConstraintsClassHeritageListMemberTypeAnnotations.types +++ b/tests/baselines/reference/ExportInterfaceWithAccessibleTypesInTypeParameterConstraintsClassHeritageListMemberTypeAnnotations.types @@ -17,9 +17,9 @@ module A { >Point : Point >{ x: 0, y: 0 } : { x: number; y: number; } >x : number ->0 : number +>0 : 0 >y : number ->0 : number +>0 : 0 export interface Point3d extends Point { >Point3d : Point3d @@ -34,11 +34,11 @@ module A { >Point3d : Point3d >{ x: 0, y: 0, z: 0 } : { x: number; y: number; z: number; } >x : number ->0 : number +>0 : 0 >y : number ->0 : number +>0 : 0 >z : number ->0 : number +>0 : 0 export interface Line{ >Line : Line diff --git a/tests/baselines/reference/ExportInterfaceWithInaccessibleTypeInTypeParameterConstraint.types b/tests/baselines/reference/ExportInterfaceWithInaccessibleTypeInTypeParameterConstraint.types index 366e21b6472..8d07e4a44dd 100644 --- a/tests/baselines/reference/ExportInterfaceWithInaccessibleTypeInTypeParameterConstraint.types +++ b/tests/baselines/reference/ExportInterfaceWithInaccessibleTypeInTypeParameterConstraint.types @@ -17,9 +17,9 @@ module A { >Point : Point >{ x: 0, y: 0 } : { x: number; y: number; } >x : number ->0 : number +>0 : 0 >y : number ->0 : number +>0 : 0 export interface Point3d extends Point { >Point3d : Point3d @@ -34,11 +34,11 @@ module A { >Point3d : Point3d >{ x: 0, y: 0, z: 0 } : { x: number; y: number; z: number; } >x : number ->0 : number +>0 : 0 >y : number ->0 : number +>0 : 0 >z : number ->0 : number +>0 : 0 export interface Line{ >Line : Line diff --git a/tests/baselines/reference/ExportModuleWithAccessibleTypesOnItsExportedMembers.types b/tests/baselines/reference/ExportModuleWithAccessibleTypesOnItsExportedMembers.types index cd8526242fa..a3ee7c55a4c 100644 --- a/tests/baselines/reference/ExportModuleWithAccessibleTypesOnItsExportedMembers.types +++ b/tests/baselines/reference/ExportModuleWithAccessibleTypesOnItsExportedMembers.types @@ -18,8 +18,8 @@ module A { >Point : Point >new Point(0, 0) : Point >Point : typeof Point ->0 : number ->0 : number +>0 : 0 +>0 : 0 export class Line { >Line : Line @@ -42,9 +42,9 @@ module A { >Line : typeof Line >{ x: 0, y: 0 } : { x: number; y: number; } >x : number ->0 : number +>0 : 0 >y : number ->0 : number +>0 : 0 >p : Point } } diff --git a/tests/baselines/reference/ExportObjectLiteralAndObjectTypeLiteralWithAccessibleTypesInMemberTypeAnnotations.types b/tests/baselines/reference/ExportObjectLiteralAndObjectTypeLiteralWithAccessibleTypesInMemberTypeAnnotations.types index e08a4345a95..0ce1b82d67e 100644 --- a/tests/baselines/reference/ExportObjectLiteralAndObjectTypeLiteralWithAccessibleTypesInMemberTypeAnnotations.types +++ b/tests/baselines/reference/ExportObjectLiteralAndObjectTypeLiteralWithAccessibleTypesInMemberTypeAnnotations.types @@ -15,9 +15,9 @@ module A { >Point : Point >{ x: 0, y: 0 } : { x: number; y: number; } >x : number ->0 : number +>0 : 0 >y : number ->0 : number +>0 : 0 export var Unity = { start: new Point(0, 0), end: new Point(1, 0) }; >Unity : { start: Point; end: Point; } @@ -25,12 +25,12 @@ module A { >start : Point >new Point(0, 0) : Point >Point : typeof Point ->0 : number ->0 : number +>0 : 0 +>0 : 0 >end : Point >new Point(1, 0) : Point >Point : typeof Point ->1 : number ->0 : number +>1 : 1 +>0 : 0 } diff --git a/tests/baselines/reference/ExportVariableWithAccessibleTypeInTypeAnnotation.types b/tests/baselines/reference/ExportVariableWithAccessibleTypeInTypeAnnotation.types index faf86ea6982..91504be2c70 100644 --- a/tests/baselines/reference/ExportVariableWithAccessibleTypeInTypeAnnotation.types +++ b/tests/baselines/reference/ExportVariableWithAccessibleTypeInTypeAnnotation.types @@ -18,8 +18,8 @@ module A { >Point : Point >{ x: 0, y: 0 } : { x: number; y: number; } >x : number ->0 : number +>0 : 0 >y : number ->0 : number +>0 : 0 } diff --git a/tests/baselines/reference/ExportVariableWithInaccessibleTypeInTypeAnnotation.types b/tests/baselines/reference/ExportVariableWithInaccessibleTypeInTypeAnnotation.types index 4ce1912d441..39bc5fa8af0 100644 --- a/tests/baselines/reference/ExportVariableWithInaccessibleTypeInTypeAnnotation.types +++ b/tests/baselines/reference/ExportVariableWithInaccessibleTypeInTypeAnnotation.types @@ -18,9 +18,9 @@ module A { >Point : Point >{ x: 0, y: 0 } : { x: number; y: number; } >x : number ->0 : number +>0 : 0 >y : number ->0 : number +>0 : 0 interface Point3d extends Point { >Point3d : Point3d @@ -36,10 +36,10 @@ module A { >Point3d : Point3d >{ x: 0, y: 0, z: 0 } : { x: number; y: number; z: number; } >x : number ->0 : number +>0 : 0 >y : number ->0 : number +>0 : 0 >z : number ->0 : number +>0 : 0 } diff --git a/tests/baselines/reference/FunctionAndModuleWithSameNameAndDifferentCommonRoot.types b/tests/baselines/reference/FunctionAndModuleWithSameNameAndDifferentCommonRoot.types index fe976cd0a3b..f070f422a52 100644 --- a/tests/baselines/reference/FunctionAndModuleWithSameNameAndDifferentCommonRoot.types +++ b/tests/baselines/reference/FunctionAndModuleWithSameNameAndDifferentCommonRoot.types @@ -8,9 +8,9 @@ module A { return { x: 0, y: 0 }; >{ x: 0, y: 0 } : { x: number; y: number; } >x : number ->0 : number +>0 : 0 >y : number ->0 : number +>0 : 0 } } @@ -25,9 +25,9 @@ module B { >Origin : { x: number; y: number; } >{ x: 0, y: 0 } : { x: number; y: number; } >x : number ->0 : number +>0 : 0 >y : number ->0 : number +>0 : 0 } } diff --git a/tests/baselines/reference/ModuleAndEnumWithSameNameAndCommonRoot.types b/tests/baselines/reference/ModuleAndEnumWithSameNameAndCommonRoot.types index 343b69954b0..f728c41b6a1 100644 --- a/tests/baselines/reference/ModuleAndEnumWithSameNameAndCommonRoot.types +++ b/tests/baselines/reference/ModuleAndEnumWithSameNameAndCommonRoot.types @@ -15,8 +15,8 @@ enum enumdule { >enumdule : enumdule Red, Blue ->Red : enumdule ->Blue : enumdule +>Red : enumdule.Red +>Blue : enumdule.Blue } var x: enumdule; @@ -25,9 +25,9 @@ var x: enumdule; var x = enumdule.Red; >x : enumdule ->enumdule.Red : enumdule +>enumdule.Red : enumdule.Red >enumdule : typeof enumdule ->Red : enumdule +>Red : enumdule.Red var y: { x: number; y: number }; >y : { x: number; y: number; } @@ -40,6 +40,6 @@ var y = new enumdule.Point(0, 0); >enumdule.Point : typeof enumdule.Point >enumdule : typeof enumdule >Point : typeof enumdule.Point ->0 : number ->0 : number +>0 : 0 +>0 : 0 diff --git a/tests/baselines/reference/TwoInternalModulesThatMergeEachWithExportedAndNonExportedLocalVarsOfTheSameName.types b/tests/baselines/reference/TwoInternalModulesThatMergeEachWithExportedAndNonExportedLocalVarsOfTheSameName.types index af3c0776b56..25a627030c4 100644 --- a/tests/baselines/reference/TwoInternalModulesThatMergeEachWithExportedAndNonExportedLocalVarsOfTheSameName.types +++ b/tests/baselines/reference/TwoInternalModulesThatMergeEachWithExportedAndNonExportedLocalVarsOfTheSameName.types @@ -39,9 +39,9 @@ module A { >Point : Point >{ x: 0, y: 0 } : { x: number; y: number; } >x : number ->0 : number +>0 : 0 >y : number ->0 : number +>0 : 0 } === tests/cases/conformance/internalModules/DeclarationMerging/part2.ts === @@ -51,7 +51,7 @@ module A { // not a collision, since we don't export var Origin: string = "0,0"; >Origin : string ->"0,0" : string +>"0,0" : "0,0" export module Utils { >Utils : typeof Utils @@ -123,8 +123,8 @@ var p = new A.Utils.Plane(o, { x: 1, y: 1 }); >o : { x: number; y: number; } >{ x: 1, y: 1 } : { x: number; y: number; } >x : number ->1 : number +>1 : 1 >y : number ->1 : number +>1 : 1 diff --git a/tests/baselines/reference/TwoInternalModulesWithTheSameNameAndDifferentCommonRoot.types b/tests/baselines/reference/TwoInternalModulesWithTheSameNameAndDifferentCommonRoot.types index e005522ddfc..2d654a580ea 100644 --- a/tests/baselines/reference/TwoInternalModulesWithTheSameNameAndDifferentCommonRoot.types +++ b/tests/baselines/reference/TwoInternalModulesWithTheSameNameAndDifferentCommonRoot.types @@ -55,9 +55,9 @@ module otherRoot { >Point : Root.A.Point >{ x: 0, y: 0 } : { x: number; y: number; } >x : number ->0 : number +>0 : 0 >y : number ->0 : number +>0 : 0 export module Utils { >Utils : typeof Utils diff --git a/tests/baselines/reference/TwoInternalModulesWithTheSameNameAndSameCommonRoot.types b/tests/baselines/reference/TwoInternalModulesWithTheSameNameAndSameCommonRoot.types index e2dd1f400f4..11cb6e95d28 100644 --- a/tests/baselines/reference/TwoInternalModulesWithTheSameNameAndSameCommonRoot.types +++ b/tests/baselines/reference/TwoInternalModulesWithTheSameNameAndSameCommonRoot.types @@ -45,9 +45,9 @@ module A { >Point : Point >{ x: 0, y: 0 } : { x: number; y: number; } >x : number ->0 : number +>0 : 0 >y : number ->0 : number +>0 : 0 export module Utils { >Utils : typeof Utils @@ -119,8 +119,8 @@ var p = new A.Utils.Plane(o, { x: 1, y: 1 }); >o : { x: number; y: number; } >{ x: 1, y: 1 } : { x: number; y: number; } >x : number ->1 : number +>1 : 1 >y : number ->1 : number +>1 : 1 diff --git a/tests/baselines/reference/TypeGuardWithEnumUnion.types b/tests/baselines/reference/TypeGuardWithEnumUnion.types index dee8feae27d..d33411c4c7c 100644 --- a/tests/baselines/reference/TypeGuardWithEnumUnion.types +++ b/tests/baselines/reference/TypeGuardWithEnumUnion.types @@ -1,9 +1,9 @@ === tests/cases/conformance/expressions/typeGuards/TypeGuardWithEnumUnion.ts === enum Color { R, G, B } >Color : Color ->R : Color ->G : Color ->B : Color +>R : Color.R +>G : Color.G +>B : Color.B function f1(x: Color | string) { >f1 : (x: string | Color) => void diff --git a/tests/baselines/reference/VariableDeclaration10_es6.types b/tests/baselines/reference/VariableDeclaration10_es6.types index 717de7ed0ff..29056b88ce1 100644 --- a/tests/baselines/reference/VariableDeclaration10_es6.types +++ b/tests/baselines/reference/VariableDeclaration10_es6.types @@ -1,5 +1,5 @@ === tests/cases/conformance/es6/variableDeclarations/VariableDeclaration10_es6.ts === let a: number = 1 >a : number ->1 : number +>1 : 1 diff --git a/tests/baselines/reference/VariableDeclaration3_es6.types b/tests/baselines/reference/VariableDeclaration3_es6.types index 1b5bbdb4ea7..5f92a06df11 100644 --- a/tests/baselines/reference/VariableDeclaration3_es6.types +++ b/tests/baselines/reference/VariableDeclaration3_es6.types @@ -1,5 +1,5 @@ === tests/cases/conformance/es6/variableDeclarations/VariableDeclaration3_es6.ts === const a = 1 ->a : number ->1 : number +>a : 1 +>1 : 1 diff --git a/tests/baselines/reference/VariableDeclaration5_es6.types b/tests/baselines/reference/VariableDeclaration5_es6.types index 0dce532be51..c0ed35a43e3 100644 --- a/tests/baselines/reference/VariableDeclaration5_es6.types +++ b/tests/baselines/reference/VariableDeclaration5_es6.types @@ -1,5 +1,5 @@ === tests/cases/conformance/es6/variableDeclarations/VariableDeclaration5_es6.ts === const a: number = 1 >a : number ->1 : number +>1 : 1 diff --git a/tests/baselines/reference/VariableDeclaration8_es6.types b/tests/baselines/reference/VariableDeclaration8_es6.types index 24a3cd85383..e31fddbc09f 100644 --- a/tests/baselines/reference/VariableDeclaration8_es6.types +++ b/tests/baselines/reference/VariableDeclaration8_es6.types @@ -1,5 +1,5 @@ === tests/cases/conformance/es6/variableDeclarations/VariableDeclaration8_es6.ts === let a = 1 >a : number ->1 : number +>1 : 1 diff --git a/tests/baselines/reference/abstractIdentifierNameStrict.types b/tests/baselines/reference/abstractIdentifierNameStrict.types index 7c79ce58a37..de6b1f458ac 100644 --- a/tests/baselines/reference/abstractIdentifierNameStrict.types +++ b/tests/baselines/reference/abstractIdentifierNameStrict.types @@ -1,15 +1,15 @@ === tests/cases/compiler/abstractIdentifierNameStrict.ts === var abstract = true; >abstract : boolean ->true : boolean +>true : true function foo() { >foo : () => void "use strict"; ->"use strict" : string +>"use strict" : "use strict" var abstract = true; >abstract : boolean ->true : boolean +>true : true } diff --git a/tests/baselines/reference/abstractProperty.types b/tests/baselines/reference/abstractProperty.types index b6aff9356cd..aa0d1c6917a 100644 --- a/tests/baselines/reference/abstractProperty.types +++ b/tests/baselines/reference/abstractProperty.types @@ -40,7 +40,7 @@ class C extends B { get prop() { return "foo"; } >prop : string ->"foo" : string +>"foo" : "foo" set prop(v) { } >prop : string @@ -48,11 +48,11 @@ class C extends B { raw = "edge"; >raw : string ->"edge" : string +>"edge" : "edge" readonly ro = "readonly please"; ->ro : string ->"readonly please" : string +>ro : "readonly please" +>"readonly please" : "readonly please" readonlyProp: string; // don't have to give a value, in fact >readonlyProp : string diff --git a/tests/baselines/reference/accessOverriddenBaseClassMember1.types b/tests/baselines/reference/accessOverriddenBaseClassMember1.types index f444544ea48..f0dad0ccafc 100644 --- a/tests/baselines/reference/accessOverriddenBaseClassMember1.types +++ b/tests/baselines/reference/accessOverriddenBaseClassMember1.types @@ -13,11 +13,11 @@ class Point { >"x=" + this.x + " y=" + this.y : string >"x=" + this.x + " y=" : string >"x=" + this.x : string ->"x=" : string +>"x=" : "x=" >this.x : number >this : this >x : number ->" y=" : string +>" y=" : " y=" >this.y : number >this : this >y : number @@ -48,7 +48,7 @@ class ColoredPoint extends Point { >super.toString : () => string >super : Point >toString : () => string ->" color=" : string +>" color=" : " color=" >this.color : string >this : this >color : string diff --git a/tests/baselines/reference/accessorWithES5.types b/tests/baselines/reference/accessorWithES5.types index 29471548918..4d23f61c0eb 100644 --- a/tests/baselines/reference/accessorWithES5.types +++ b/tests/baselines/reference/accessorWithES5.types @@ -7,7 +7,7 @@ class C { >x : number return 1; ->1 : number +>1 : 1 } } @@ -26,7 +26,7 @@ var x = { get a() { return 1 } >a : number ->1 : number +>1 : 1 } var y = { diff --git a/tests/baselines/reference/accessors_spec_section-4.5_error-cases.errors.txt b/tests/baselines/reference/accessors_spec_section-4.5_error-cases.errors.txt index 981cb525625..5393eee87d4 100644 --- a/tests/baselines/reference/accessors_spec_section-4.5_error-cases.errors.txt +++ b/tests/baselines/reference/accessors_spec_section-4.5_error-cases.errors.txt @@ -1,14 +1,14 @@ tests/cases/compiler/accessors_spec_section-4.5_error-cases.ts(2,16): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. tests/cases/compiler/accessors_spec_section-4.5_error-cases.ts(3,16): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. -tests/cases/compiler/accessors_spec_section-4.5_error-cases.ts(3,55): error TS2322: Type 'string' is not assignable to type 'number'. +tests/cases/compiler/accessors_spec_section-4.5_error-cases.ts(3,55): error TS2322: Type '""' is not assignable to type 'number'. tests/cases/compiler/accessors_spec_section-4.5_error-cases.ts(5,16): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. -tests/cases/compiler/accessors_spec_section-4.5_error-cases.ts(5,54): error TS2322: Type 'string' is not assignable to type 'number'. +tests/cases/compiler/accessors_spec_section-4.5_error-cases.ts(5,54): error TS2322: Type '""' is not assignable to type 'number'. tests/cases/compiler/accessors_spec_section-4.5_error-cases.ts(6,16): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. tests/cases/compiler/accessors_spec_section-4.5_error-cases.ts(8,16): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. tests/cases/compiler/accessors_spec_section-4.5_error-cases.ts(9,16): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. -tests/cases/compiler/accessors_spec_section-4.5_error-cases.ts(9,52): error TS2322: Type 'number' is not assignable to type 'string'. +tests/cases/compiler/accessors_spec_section-4.5_error-cases.ts(9,52): error TS2322: Type '0' is not assignable to type 'string'. tests/cases/compiler/accessors_spec_section-4.5_error-cases.ts(11,16): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. -tests/cases/compiler/accessors_spec_section-4.5_error-cases.ts(11,51): error TS2322: Type 'number' is not assignable to type 'string'. +tests/cases/compiler/accessors_spec_section-4.5_error-cases.ts(11,51): error TS2322: Type '0' is not assignable to type 'string'. tests/cases/compiler/accessors_spec_section-4.5_error-cases.ts(12,16): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. @@ -21,13 +21,13 @@ tests/cases/compiler/accessors_spec_section-4.5_error-cases.ts(12,16): error TS1 ~~~~~~~~~~~~~~~~~~~~~~~~~~~ !!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. ~~ -!!! error TS2322: Type 'string' is not assignable to type 'number'. +!!! error TS2322: Type '""' is not assignable to type 'number'. public get AnnotatedSetter_SetterLast() { return ""; } ~~~~~~~~~~~~~~~~~~~~~~~~~~ !!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. ~~ -!!! error TS2322: Type 'string' is not assignable to type 'number'. +!!! error TS2322: Type '""' is not assignable to type 'number'. public set AnnotatedSetter_SetterLast(a: number) { } ~~~~~~~~~~~~~~~~~~~~~~~~~~ !!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. @@ -39,13 +39,13 @@ tests/cases/compiler/accessors_spec_section-4.5_error-cases.ts(12,16): error TS1 ~~~~~~~~~~~~~~~~~~~~~~~~~~~ !!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. ~~~~ -!!! error TS2322: Type 'number' is not assignable to type 'string'. +!!! error TS2322: Type '0' is not assignable to type 'string'. public set AnnotatedGetter_GetterLast(aStr) { aStr = 0; } ~~~~~~~~~~~~~~~~~~~~~~~~~~ !!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. ~~~~ -!!! error TS2322: Type 'number' is not assignable to type 'string'. +!!! error TS2322: Type '0' is not assignable to type 'string'. public get AnnotatedGetter_GetterLast(): string { return ""; } ~~~~~~~~~~~~~~~~~~~~~~~~~~ !!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. diff --git a/tests/baselines/reference/addMoreCallSignaturesToBaseSignature2.types b/tests/baselines/reference/addMoreCallSignaturesToBaseSignature2.types index 98bd1910241..2618f7b3cc7 100644 --- a/tests/baselines/reference/addMoreCallSignaturesToBaseSignature2.types +++ b/tests/baselines/reference/addMoreCallSignaturesToBaseSignature2.types @@ -22,5 +22,5 @@ var kitty = a(1); >kitty : string >a(1) : string >a : Bar ->1 : number +>1 : 1 diff --git a/tests/baselines/reference/additionOperatorWithAnyAndEveryType.types b/tests/baselines/reference/additionOperatorWithAnyAndEveryType.types index 9f1a9f03898..0994360ca10 100644 --- a/tests/baselines/reference/additionOperatorWithAnyAndEveryType.types +++ b/tests/baselines/reference/additionOperatorWithAnyAndEveryType.types @@ -13,9 +13,9 @@ class C { } enum E { a, b, c } >E : E ->a : E ->b : E ->c : E +>a : E.a +>b : E.b +>c : E.c module M { export var a } >M : typeof M @@ -130,9 +130,9 @@ var r15 = a + E.a; >r15 : any >a + E.a : any >a : any ->E.a : E +>E.a : E.a >E : typeof E ->a : E +>a : E.a var r16 = a + M; >r16 : any @@ -144,13 +144,13 @@ var r17 = a + ''; >r17 : string >a + '' : string >a : any ->'' : string +>'' : "" var r18 = a + 123; >r18 : any >a + 123 : any >a : any ->123 : number +>123 : 123 var r19 = a + { a: '' }; >r19 : any @@ -158,7 +158,7 @@ var r19 = a + { a: '' }; >a : any >{ a: '' } : { a: string; } >a : string ->'' : string +>'' : "" var r20 = a + ((a: string) => { return a }); >r20 : any diff --git a/tests/baselines/reference/additionOperatorWithInvalidOperands.errors.txt b/tests/baselines/reference/additionOperatorWithInvalidOperands.errors.txt index bd71b64b501..124120cef2c 100644 --- a/tests/baselines/reference/additionOperatorWithInvalidOperands.errors.txt +++ b/tests/baselines/reference/additionOperatorWithInvalidOperands.errors.txt @@ -6,17 +6,17 @@ tests/cases/conformance/expressions/binaryOperators/additionOperator/additionOpe tests/cases/conformance/expressions/binaryOperators/additionOperator/additionOperatorWithInvalidOperands.ts(25,10): error TS2365: Operator '+' cannot be applied to types 'Object' and 'boolean'. tests/cases/conformance/expressions/binaryOperators/additionOperator/additionOperatorWithInvalidOperands.ts(26,10): error TS2365: Operator '+' cannot be applied to types 'Object' and 'number'. tests/cases/conformance/expressions/binaryOperators/additionOperator/additionOperatorWithInvalidOperands.ts(27,10): error TS2365: Operator '+' cannot be applied to types 'Object' and 'Object'. -tests/cases/conformance/expressions/binaryOperators/additionOperator/additionOperatorWithInvalidOperands.ts(30,11): error TS2365: Operator '+' cannot be applied to types 'boolean' and 'boolean'. -tests/cases/conformance/expressions/binaryOperators/additionOperator/additionOperatorWithInvalidOperands.ts(31,11): error TS2365: Operator '+' cannot be applied to types 'boolean' and 'boolean'. -tests/cases/conformance/expressions/binaryOperators/additionOperator/additionOperatorWithInvalidOperands.ts(32,11): error TS2365: Operator '+' cannot be applied to types 'boolean' and 'number'. +tests/cases/conformance/expressions/binaryOperators/additionOperator/additionOperatorWithInvalidOperands.ts(30,11): error TS2365: Operator '+' cannot be applied to types 'boolean' and 'true'. +tests/cases/conformance/expressions/binaryOperators/additionOperator/additionOperatorWithInvalidOperands.ts(31,11): error TS2365: Operator '+' cannot be applied to types 'true' and 'false'. +tests/cases/conformance/expressions/binaryOperators/additionOperator/additionOperatorWithInvalidOperands.ts(32,11): error TS2365: Operator '+' cannot be applied to types 'true' and '123'. tests/cases/conformance/expressions/binaryOperators/additionOperator/additionOperatorWithInvalidOperands.ts(33,11): error TS2365: Operator '+' cannot be applied to types '{}' and '{}'. tests/cases/conformance/expressions/binaryOperators/additionOperator/additionOperatorWithInvalidOperands.ts(34,11): error TS2365: Operator '+' cannot be applied to types 'number' and 'Number'. tests/cases/conformance/expressions/binaryOperators/additionOperator/additionOperatorWithInvalidOperands.ts(35,11): error TS2365: Operator '+' cannot be applied to types 'number' and '() => void'. tests/cases/conformance/expressions/binaryOperators/additionOperator/additionOperatorWithInvalidOperands.ts(36,11): error TS2365: Operator '+' cannot be applied to types 'number' and 'void'. tests/cases/conformance/expressions/binaryOperators/additionOperator/additionOperatorWithInvalidOperands.ts(37,11): error TS2365: Operator '+' cannot be applied to types 'number' and 'typeof C'. -tests/cases/conformance/expressions/binaryOperators/additionOperator/additionOperatorWithInvalidOperands.ts(38,11): error TS2365: Operator '+' cannot be applied to types 'E' and 'C'. -tests/cases/conformance/expressions/binaryOperators/additionOperator/additionOperatorWithInvalidOperands.ts(39,11): error TS2365: Operator '+' cannot be applied to types 'E' and 'void'. -tests/cases/conformance/expressions/binaryOperators/additionOperator/additionOperatorWithInvalidOperands.ts(40,11): error TS2365: Operator '+' cannot be applied to types 'E' and 'typeof M'. +tests/cases/conformance/expressions/binaryOperators/additionOperator/additionOperatorWithInvalidOperands.ts(38,11): error TS2365: Operator '+' cannot be applied to types 'E.a' and 'C'. +tests/cases/conformance/expressions/binaryOperators/additionOperator/additionOperatorWithInvalidOperands.ts(39,11): error TS2365: Operator '+' cannot be applied to types 'E.a' and 'void'. +tests/cases/conformance/expressions/binaryOperators/additionOperator/additionOperatorWithInvalidOperands.ts(40,11): error TS2365: Operator '+' cannot be applied to types 'E.a' and 'typeof M'. ==== tests/cases/conformance/expressions/binaryOperators/additionOperator/additionOperatorWithInvalidOperands.ts (19 errors) ==== @@ -67,13 +67,13 @@ tests/cases/conformance/expressions/binaryOperators/additionOperator/additionOpe // other cases var r10 = a + true; ~~~~~~~~ -!!! error TS2365: Operator '+' cannot be applied to types 'boolean' and 'boolean'. +!!! error TS2365: Operator '+' cannot be applied to types 'boolean' and 'true'. var r11 = true + false; ~~~~~~~~~~~~ -!!! error TS2365: Operator '+' cannot be applied to types 'boolean' and 'boolean'. +!!! error TS2365: Operator '+' cannot be applied to types 'true' and 'false'. var r12 = true + 123; ~~~~~~~~~~ -!!! error TS2365: Operator '+' cannot be applied to types 'boolean' and 'number'. +!!! error TS2365: Operator '+' cannot be applied to types 'true' and '123'. var r13 = {} + {}; ~~~~~~~ !!! error TS2365: Operator '+' cannot be applied to types '{}' and '{}'. @@ -91,10 +91,10 @@ tests/cases/conformance/expressions/binaryOperators/additionOperator/additionOpe !!! error TS2365: Operator '+' cannot be applied to types 'number' and 'typeof C'. var r18 = E.a + new C(); ~~~~~~~~~~~~~ -!!! error TS2365: Operator '+' cannot be applied to types 'E' and 'C'. +!!! error TS2365: Operator '+' cannot be applied to types 'E.a' and 'C'. var r19 = E.a + C.foo(); ~~~~~~~~~~~~~ -!!! error TS2365: Operator '+' cannot be applied to types 'E' and 'void'. +!!! error TS2365: Operator '+' cannot be applied to types 'E.a' and 'void'. var r20 = E.a + M; ~~~~~~~ -!!! error TS2365: Operator '+' cannot be applied to types 'E' and 'typeof M'. \ No newline at end of file +!!! error TS2365: Operator '+' cannot be applied to types 'E.a' and 'typeof M'. \ No newline at end of file diff --git a/tests/baselines/reference/additionOperatorWithNullValueAndInvalidOperator.errors.txt b/tests/baselines/reference/additionOperatorWithNullValueAndInvalidOperator.errors.txt index 566fb241bf8..d18a9a13d8c 100644 --- a/tests/baselines/reference/additionOperatorWithNullValueAndInvalidOperator.errors.txt +++ b/tests/baselines/reference/additionOperatorWithNullValueAndInvalidOperator.errors.txt @@ -5,7 +5,7 @@ tests/cases/conformance/expressions/binaryOperators/additionOperator/additionOpe tests/cases/conformance/expressions/binaryOperators/additionOperator/additionOperatorWithNullValueAndInvalidOperator.ts(15,10): error TS2365: Operator '+' cannot be applied to types 'Object' and 'Object'. tests/cases/conformance/expressions/binaryOperators/additionOperator/additionOperatorWithNullValueAndInvalidOperator.ts(16,10): error TS2365: Operator '+' cannot be applied to types 'void' and 'void'. tests/cases/conformance/expressions/binaryOperators/additionOperator/additionOperatorWithNullValueAndInvalidOperator.ts(19,10): error TS2365: Operator '+' cannot be applied to types 'Number' and 'Number'. -tests/cases/conformance/expressions/binaryOperators/additionOperator/additionOperatorWithNullValueAndInvalidOperator.ts(20,10): error TS2365: Operator '+' cannot be applied to types 'boolean' and 'boolean'. +tests/cases/conformance/expressions/binaryOperators/additionOperator/additionOperatorWithNullValueAndInvalidOperator.ts(20,10): error TS2365: Operator '+' cannot be applied to types 'true' and 'true'. tests/cases/conformance/expressions/binaryOperators/additionOperator/additionOperatorWithNullValueAndInvalidOperator.ts(21,10): error TS2365: Operator '+' cannot be applied to types '{ a: string; }' and '{ a: string; }'. tests/cases/conformance/expressions/binaryOperators/additionOperator/additionOperatorWithNullValueAndInvalidOperator.ts(22,11): error TS2365: Operator '+' cannot be applied to types 'void' and 'void'. tests/cases/conformance/expressions/binaryOperators/additionOperator/additionOperatorWithNullValueAndInvalidOperator.ts(23,11): error TS2365: Operator '+' cannot be applied to types '() => void' and '() => void'. @@ -47,7 +47,7 @@ tests/cases/conformance/expressions/binaryOperators/additionOperator/additionOpe !!! error TS2365: Operator '+' cannot be applied to types 'Number' and 'Number'. var r8 = null + true; ~~~~~~~~~~~ -!!! error TS2365: Operator '+' cannot be applied to types 'boolean' and 'boolean'. +!!! error TS2365: Operator '+' cannot be applied to types 'true' and 'true'. var r9 = null + { a: '' }; ~~~~~~~~~~~~~~~~ !!! error TS2365: Operator '+' cannot be applied to types '{ a: string; }' and '{ a: string; }'. diff --git a/tests/baselines/reference/additionOperatorWithNullValueAndValidOperator.types b/tests/baselines/reference/additionOperatorWithNullValueAndValidOperator.types index f4ea168ee0d..d0feec523b0 100644 --- a/tests/baselines/reference/additionOperatorWithNullValueAndValidOperator.types +++ b/tests/baselines/reference/additionOperatorWithNullValueAndValidOperator.types @@ -3,9 +3,9 @@ enum E { a, b, c } >E : E ->a : E ->b : E ->c : E +>a : E.a +>b : E.b +>c : E.c var a: any; >a : any @@ -44,7 +44,7 @@ var r4 = null + 1; >r4 : number >null + 1 : number >null : null ->1 : number +>1 : 1 var r5 = null + c; >r5 : number @@ -56,17 +56,17 @@ var r6 = null + E.a; >r6 : number >null + E.a : number >null : null ->E.a : E +>E.a : E.a >E : typeof E ->a : E +>a : E.a var r7 = null + E['a']; >r7 : number >null + E['a'] : number >null : null ->E['a'] : E +>E['a'] : E.a >E : typeof E ->'a' : string +>'a' : "a" var r8 = b + null; >r8 : number @@ -77,7 +77,7 @@ var r8 = b + null; var r9 = 1 + null; >r9 : number >1 + null : number ->1 : number +>1 : 1 >null : null var r10 = c + null @@ -89,17 +89,17 @@ var r10 = c + null var r11 = E.a + null; >r11 : number >E.a + null : number ->E.a : E +>E.a : E.a >E : typeof E ->a : E +>a : E.a >null : null var r12 = E['a'] + null; >r12 : number >E['a'] + null : number ->E['a'] : E +>E['a'] : E.a >E : typeof E ->'a' : string +>'a' : "a" >null : null // null + string @@ -113,7 +113,7 @@ var r14 = null + ''; >r14 : string >null + '' : string >null : null ->'' : string +>'' : "" var r15 = d + null; >r15 : string @@ -124,6 +124,6 @@ var r15 = d + null; var r16 = '' + null; >r16 : string >'' + null : string ->'' : string +>'' : "" >null : null diff --git a/tests/baselines/reference/additionOperatorWithNumberAndEnum.types b/tests/baselines/reference/additionOperatorWithNumberAndEnum.types index 2b1c2794065..c952fca9064 100644 --- a/tests/baselines/reference/additionOperatorWithNumberAndEnum.types +++ b/tests/baselines/reference/additionOperatorWithNumberAndEnum.types @@ -1,13 +1,13 @@ === tests/cases/conformance/expressions/binaryOperators/additionOperator/additionOperatorWithNumberAndEnum.ts === enum E { a, b } >E : E ->a : E ->b : E +>a : E.a +>b : E.b enum F { c, d } >F : F ->c : F ->d : F +>c : F.c +>d : F.d var a: number; >a : number @@ -48,46 +48,46 @@ var r4 = b + b; var r5 = 0 + a; >r5 : number >0 + a : number ->0 : number +>0 : 0 >a : number var r6 = E.a + 0; >r6 : number >E.a + 0 : number ->E.a : E +>E.a : E.a >E : typeof E ->a : E ->0 : number +>a : E.a +>0 : 0 var r7 = E.a + E.b; >r7 : number >E.a + E.b : number ->E.a : E +>E.a : E.a >E : typeof E ->a : E ->E.b : E +>a : E.a +>E.b : E.b >E : typeof E ->b : E +>b : E.b var r8 = E['a'] + E['b']; >r8 : number >E['a'] + E['b'] : number ->E['a'] : E +>E['a'] : E.a >E : typeof E ->'a' : string ->E['b'] : E +>'a' : "a" +>E['b'] : E.b >E : typeof E ->'b' : string +>'b' : "b" var r9 = E['a'] + F['c']; >r9 : number >E['a'] + F['c'] : number ->E['a'] : E +>E['a'] : E.a >E : typeof E ->'a' : string ->F['c'] : F +>'a' : "a" +>F['c'] : F.c >F : typeof F ->'c' : string +>'c' : "c" var r10 = a + c; >r10 : number diff --git a/tests/baselines/reference/additionOperatorWithStringAndEveryType.types b/tests/baselines/reference/additionOperatorWithStringAndEveryType.types index 5413f5f5bdf..d938da263b7 100644 --- a/tests/baselines/reference/additionOperatorWithStringAndEveryType.types +++ b/tests/baselines/reference/additionOperatorWithStringAndEveryType.types @@ -1,9 +1,9 @@ === tests/cases/conformance/expressions/binaryOperators/additionOperator/additionOperatorWithStringAndEveryType.ts === enum E { a, b, c } >E : E ->a : E ->b : E ->c : E +>a : E.a +>b : E.b +>c : E.c var a: any; >a : any @@ -129,21 +129,21 @@ var r16 = x + E.a; >r16 : string >x + E.a : string >x : string ->E.a : E +>E.a : E.a >E : typeof E ->a : E +>a : E.a var r17 = x + ''; >r17 : string >x + '' : string >x : string ->'' : string +>'' : "" var r18 = x + 0; >r18 : string >x + 0 : string >x : string ->0 : number +>0 : 0 var r19 = x + { a: '' }; >r19 : string @@ -151,7 +151,7 @@ var r19 = x + { a: '' }; >x : string >{ a: '' } : { a: string; } >a : string ->'' : string +>'' : "" var r20 = x + []; >r20 : string diff --git a/tests/baselines/reference/additionOperatorWithUndefinedValueAndInvalidOperands.errors.txt b/tests/baselines/reference/additionOperatorWithUndefinedValueAndInvalidOperands.errors.txt index 36233e9e9fe..d61f101a544 100644 --- a/tests/baselines/reference/additionOperatorWithUndefinedValueAndInvalidOperands.errors.txt +++ b/tests/baselines/reference/additionOperatorWithUndefinedValueAndInvalidOperands.errors.txt @@ -5,7 +5,7 @@ tests/cases/conformance/expressions/binaryOperators/additionOperator/additionOpe tests/cases/conformance/expressions/binaryOperators/additionOperator/additionOperatorWithUndefinedValueAndInvalidOperands.ts(15,10): error TS2365: Operator '+' cannot be applied to types 'Object' and 'Object'. tests/cases/conformance/expressions/binaryOperators/additionOperator/additionOperatorWithUndefinedValueAndInvalidOperands.ts(16,10): error TS2365: Operator '+' cannot be applied to types 'void' and 'void'. tests/cases/conformance/expressions/binaryOperators/additionOperator/additionOperatorWithUndefinedValueAndInvalidOperands.ts(19,10): error TS2365: Operator '+' cannot be applied to types 'Number' and 'Number'. -tests/cases/conformance/expressions/binaryOperators/additionOperator/additionOperatorWithUndefinedValueAndInvalidOperands.ts(20,10): error TS2365: Operator '+' cannot be applied to types 'boolean' and 'boolean'. +tests/cases/conformance/expressions/binaryOperators/additionOperator/additionOperatorWithUndefinedValueAndInvalidOperands.ts(20,10): error TS2365: Operator '+' cannot be applied to types 'true' and 'true'. tests/cases/conformance/expressions/binaryOperators/additionOperator/additionOperatorWithUndefinedValueAndInvalidOperands.ts(21,10): error TS2365: Operator '+' cannot be applied to types '{ a: string; }' and '{ a: string; }'. tests/cases/conformance/expressions/binaryOperators/additionOperator/additionOperatorWithUndefinedValueAndInvalidOperands.ts(22,11): error TS2365: Operator '+' cannot be applied to types 'void' and 'void'. tests/cases/conformance/expressions/binaryOperators/additionOperator/additionOperatorWithUndefinedValueAndInvalidOperands.ts(23,11): error TS2365: Operator '+' cannot be applied to types '() => void' and '() => void'. @@ -47,7 +47,7 @@ tests/cases/conformance/expressions/binaryOperators/additionOperator/additionOpe !!! error TS2365: Operator '+' cannot be applied to types 'Number' and 'Number'. var r8 = undefined + true; ~~~~~~~~~~~~~~~~ -!!! error TS2365: Operator '+' cannot be applied to types 'boolean' and 'boolean'. +!!! error TS2365: Operator '+' cannot be applied to types 'true' and 'true'. var r9 = undefined + { a: '' }; ~~~~~~~~~~~~~~~~~~~~~ !!! error TS2365: Operator '+' cannot be applied to types '{ a: string; }' and '{ a: string; }'. diff --git a/tests/baselines/reference/additionOperatorWithUndefinedValueAndValidOperator.types b/tests/baselines/reference/additionOperatorWithUndefinedValueAndValidOperator.types index 16f0a4dfa84..46ba3a147e6 100644 --- a/tests/baselines/reference/additionOperatorWithUndefinedValueAndValidOperator.types +++ b/tests/baselines/reference/additionOperatorWithUndefinedValueAndValidOperator.types @@ -3,9 +3,9 @@ enum E { a, b, c } >E : E ->a : E ->b : E ->c : E +>a : E.a +>b : E.b +>c : E.c var a: any; >a : any @@ -44,7 +44,7 @@ var r4 = undefined + 1; >r4 : number >undefined + 1 : number >undefined : undefined ->1 : number +>1 : 1 var r5 = undefined + c; >r5 : number @@ -56,17 +56,17 @@ var r6 = undefined + E.a; >r6 : number >undefined + E.a : number >undefined : undefined ->E.a : E +>E.a : E.a >E : typeof E ->a : E +>a : E.a var r7 = undefined + E['a']; >r7 : number >undefined + E['a'] : number >undefined : undefined ->E['a'] : E +>E['a'] : E.a >E : typeof E ->'a' : string +>'a' : "a" var r8 = b + undefined; >r8 : number @@ -77,7 +77,7 @@ var r8 = b + undefined; var r9 = 1 + undefined; >r9 : number >1 + undefined : number ->1 : number +>1 : 1 >undefined : undefined var r10 = c + undefined @@ -89,17 +89,17 @@ var r10 = c + undefined var r11 = E.a + undefined; >r11 : number >E.a + undefined : number ->E.a : E +>E.a : E.a >E : typeof E ->a : E +>a : E.a >undefined : undefined var r12 = E['a'] + undefined; >r12 : number >E['a'] + undefined : number ->E['a'] : E +>E['a'] : E.a >E : typeof E ->'a' : string +>'a' : "a" >undefined : undefined // undefined + string @@ -113,7 +113,7 @@ var r14 = undefined + ''; >r14 : string >undefined + '' : string >undefined : undefined ->'' : string +>'' : "" var r15 = d + undefined; >r15 : string @@ -124,6 +124,6 @@ var r15 = d + undefined; var r16 = '' + undefined; >r16 : string >'' + undefined : string ->'' : string +>'' : "" >undefined : undefined diff --git a/tests/baselines/reference/aliasAssignments.errors.txt b/tests/baselines/reference/aliasAssignments.errors.txt index 18ea36c5d00..463f74e4c49 100644 --- a/tests/baselines/reference/aliasAssignments.errors.txt +++ b/tests/baselines/reference/aliasAssignments.errors.txt @@ -1,4 +1,4 @@ -tests/cases/compiler/aliasAssignments_1.ts(3,1): error TS2322: Type 'number' is not assignable to type 'typeof "tests/cases/compiler/aliasAssignments_moduleA"'. +tests/cases/compiler/aliasAssignments_1.ts(3,1): error TS2322: Type '1' is not assignable to type 'typeof "tests/cases/compiler/aliasAssignments_moduleA"'. tests/cases/compiler/aliasAssignments_1.ts(5,1): error TS2322: Type 'typeof "tests/cases/compiler/aliasAssignments_moduleA"' is not assignable to type 'number'. @@ -7,7 +7,7 @@ tests/cases/compiler/aliasAssignments_1.ts(5,1): error TS2322: Type 'typeof "tes var x = moduleA; x = 1; // Should be error ~ -!!! error TS2322: Type 'number' is not assignable to type 'typeof "tests/cases/compiler/aliasAssignments_moduleA"'. +!!! error TS2322: Type '1' is not assignable to type 'typeof "tests/cases/compiler/aliasAssignments_moduleA"'. var y = 1; y = moduleA; // should be error ~ diff --git a/tests/baselines/reference/aliasBug.errors.txt b/tests/baselines/reference/aliasBug.errors.txt index 398b093aa88..0c8dd7d034f 100644 --- a/tests/baselines/reference/aliasBug.errors.txt +++ b/tests/baselines/reference/aliasBug.errors.txt @@ -1,4 +1,4 @@ -tests/cases/compiler/aliasBug.ts(17,15): error TS2305: Module 'foo.bar.baz' has no exported member 'bar'. +tests/cases/compiler/aliasBug.ts(17,15): error TS2694: Namespace 'foo.bar.baz' has no exported member 'bar'. ==== tests/cases/compiler/aliasBug.ts (1 errors) ==== @@ -20,7 +20,7 @@ tests/cases/compiler/aliasBug.ts(17,15): error TS2305: Module 'foo.bar.baz' has var p2: foo.Provide; var p3:booz.bar; ~~~ -!!! error TS2305: Module 'foo.bar.baz' has no exported member 'bar'. +!!! error TS2694: Namespace 'foo.bar.baz' has no exported member 'bar'. var p22 = new provide.Provide(); } \ No newline at end of file diff --git a/tests/baselines/reference/aliasErrors.errors.txt b/tests/baselines/reference/aliasErrors.errors.txt index c74649618ba..42b84993ba2 100644 --- a/tests/baselines/reference/aliasErrors.errors.txt +++ b/tests/baselines/reference/aliasErrors.errors.txt @@ -4,7 +4,7 @@ tests/cases/compiler/aliasErrors.ts(13,12): error TS1003: Identifier expected. tests/cases/compiler/aliasErrors.ts(14,12): error TS1003: Identifier expected. tests/cases/compiler/aliasErrors.ts(15,12): error TS1003: Identifier expected. tests/cases/compiler/aliasErrors.ts(16,12): error TS2503: Cannot find namespace 'undefined'. -tests/cases/compiler/aliasErrors.ts(26,15): error TS2305: Module 'foo.bar.baz' has no exported member 'bar'. +tests/cases/compiler/aliasErrors.ts(26,15): error TS2694: Namespace 'foo.bar.baz' has no exported member 'bar'. ==== tests/cases/compiler/aliasErrors.ts (7 errors) ==== @@ -47,7 +47,7 @@ tests/cases/compiler/aliasErrors.ts(26,15): error TS2305: Module 'foo.bar.baz' h var p2: foo.Provide; var p3:booz.bar; ~~~ -!!! error TS2305: Module 'foo.bar.baz' has no exported member 'bar'. +!!! error TS2694: Namespace 'foo.bar.baz' has no exported member 'bar'. var p22 = new provide.Provide(); } diff --git a/tests/baselines/reference/ambientDeclarations.types b/tests/baselines/reference/ambientDeclarations.types index f44d49cfc57..a571eb9fa7b 100644 --- a/tests/baselines/reference/ambientDeclarations.types +++ b/tests/baselines/reference/ambientDeclarations.types @@ -103,14 +103,14 @@ declare enum E2 { a = 1, >a : E2 ->1 : number +>1 : 1 b, >b : E2 c = 2, >c : E2 ->2 : number +>2 : 2 d >d : E2 diff --git a/tests/baselines/reference/ambientEnumDeclaration1.types b/tests/baselines/reference/ambientEnumDeclaration1.types index 3ef30e458da..370d6cd22ae 100644 --- a/tests/baselines/reference/ambientEnumDeclaration1.types +++ b/tests/baselines/reference/ambientEnumDeclaration1.types @@ -6,13 +6,13 @@ declare enum E { a = 10, >a : E ->10 : number +>10 : 10 b = 10 + 1, >b : E >10 + 1 : number ->10 : number ->1 : number +>10 : 10 +>1 : 1 c = b, >c : E @@ -23,13 +23,13 @@ declare enum E { >(c) + 1 : number >(c) : E >c : E ->1 : number +>1 : 1 e = 10 << 2 * 8, >e : E >10 << 2 * 8 : number ->10 : number +>10 : 10 >2 * 8 : number ->2 : number ->8 : number +>2 : 2 +>8 : 8 } diff --git a/tests/baselines/reference/ambientEnumElementInitializer1.types b/tests/baselines/reference/ambientEnumElementInitializer1.types index 97db9f199d3..11ef7449504 100644 --- a/tests/baselines/reference/ambientEnumElementInitializer1.types +++ b/tests/baselines/reference/ambientEnumElementInitializer1.types @@ -4,5 +4,5 @@ declare enum E { e = 3 >e : E ->3 : number +>3 : 3 } diff --git a/tests/baselines/reference/ambientEnumElementInitializer2.types b/tests/baselines/reference/ambientEnumElementInitializer2.types index 7217bc8e6fd..47d85bf3c84 100644 --- a/tests/baselines/reference/ambientEnumElementInitializer2.types +++ b/tests/baselines/reference/ambientEnumElementInitializer2.types @@ -4,6 +4,6 @@ declare enum E { e = -3 // Negative >e : E ->-3 : number ->3 : number +>-3 : -3 +>3 : 3 } diff --git a/tests/baselines/reference/ambientEnumElementInitializer3.types b/tests/baselines/reference/ambientEnumElementInitializer3.types index f3d3b8f3ae2..3c099d00ede 100644 --- a/tests/baselines/reference/ambientEnumElementInitializer3.types +++ b/tests/baselines/reference/ambientEnumElementInitializer3.types @@ -4,5 +4,5 @@ declare enum E { e = 3.3 // Decimal >e : E ->3.3 : number +>3.3 : 3.3 } diff --git a/tests/baselines/reference/ambientEnumElementInitializer4.types b/tests/baselines/reference/ambientEnumElementInitializer4.types index b85649d654d..3bef657f5bb 100644 --- a/tests/baselines/reference/ambientEnumElementInitializer4.types +++ b/tests/baselines/reference/ambientEnumElementInitializer4.types @@ -4,5 +4,5 @@ declare enum E { e = 0xA >e : E ->0xA : number +>0xA : 10 } diff --git a/tests/baselines/reference/ambientEnumElementInitializer5.types b/tests/baselines/reference/ambientEnumElementInitializer5.types index 1c5ea0ecdd3..b3020a6d777 100644 --- a/tests/baselines/reference/ambientEnumElementInitializer5.types +++ b/tests/baselines/reference/ambientEnumElementInitializer5.types @@ -4,6 +4,6 @@ declare enum E { e = -0xA >e : E ->-0xA : number ->0xA : number +>-0xA : -10 +>0xA : 10 } diff --git a/tests/baselines/reference/ambientEnumElementInitializer6.types b/tests/baselines/reference/ambientEnumElementInitializer6.types index 015d3f4e146..f093d0e2dfe 100644 --- a/tests/baselines/reference/ambientEnumElementInitializer6.types +++ b/tests/baselines/reference/ambientEnumElementInitializer6.types @@ -7,6 +7,6 @@ declare module M { e = 3 >e : E ->3 : number +>3 : 3 } } diff --git a/tests/baselines/reference/ambientModules.types b/tests/baselines/reference/ambientModules.types index 15e6d51b457..5a0a8c663ab 100644 --- a/tests/baselines/reference/ambientModules.types +++ b/tests/baselines/reference/ambientModules.types @@ -5,11 +5,11 @@ declare module Foo.Bar { export var foo; }; >foo : any Foo.Bar.foo = 5; ->Foo.Bar.foo = 5 : number +>Foo.Bar.foo = 5 : 5 >Foo.Bar.foo : any >Foo.Bar : typeof Foo.Bar >Foo : typeof Foo >Bar : typeof Foo.Bar >foo : any ->5 : number +>5 : 5 diff --git a/tests/baselines/reference/ambientShorthand_reExport.js b/tests/baselines/reference/ambientShorthand_reExport.js index d0433e5d478..bdfc0ee0821 100644 --- a/tests/baselines/reference/ambientShorthand_reExport.js +++ b/tests/baselines/reference/ambientShorthand_reExport.js @@ -22,6 +22,10 @@ var jquery_1 = require("jquery"); exports.x = jquery_1.x; //// [reExportAll.js] "use strict"; +function __export(m) { + for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p]; +} +__export(require("jquery")); //// [reExportUser.js] "use strict"; var reExportX_1 = require("./reExportX"); diff --git a/tests/baselines/reference/ambiguousCallsWhereReturnTypesAgree.types b/tests/baselines/reference/ambiguousCallsWhereReturnTypesAgree.types index 65f26f25770..b3153722ee3 100644 --- a/tests/baselines/reference/ambiguousCallsWhereReturnTypesAgree.types +++ b/tests/baselines/reference/ambiguousCallsWhereReturnTypesAgree.types @@ -53,7 +53,7 @@ class TestClass2 { >x : any return 0; ->0 : number +>0 : 0 } public foo(x: string): number; diff --git a/tests/baselines/reference/amdImportAsPrimaryExpression.types b/tests/baselines/reference/amdImportAsPrimaryExpression.types index 8f6e509419f..acfe27369f5 100644 --- a/tests/baselines/reference/amdImportAsPrimaryExpression.types +++ b/tests/baselines/reference/amdImportAsPrimaryExpression.types @@ -19,8 +19,8 @@ export enum E1 { >E1 : E1 A,B,C ->A : E1 ->B : E1 ->C : E1 +>A : E1.A +>B : E1.B +>C : E1.C } diff --git a/tests/baselines/reference/amdImportNotAsPrimaryExpression.types b/tests/baselines/reference/amdImportNotAsPrimaryExpression.types index 5d90a8dadc2..32e45936f33 100644 --- a/tests/baselines/reference/amdImportNotAsPrimaryExpression.types +++ b/tests/baselines/reference/amdImportNotAsPrimaryExpression.types @@ -28,7 +28,7 @@ var y: typeof foo.C1.s1 = false; >foo : typeof foo >C1 : typeof foo.C1 >s1 : boolean ->false : boolean +>false : false var z: foo.M1.I2; >z : f.I2 @@ -49,11 +49,11 @@ export class C1 { m1 = 42; >m1 : number ->42 : number +>42 : 42 static s1 = true; >s1 : boolean ->true : boolean +>true : true } export interface I1 { @@ -81,8 +81,8 @@ export enum E1 { >E1 : E1 A,B,C ->A : E1 ->B : E1 ->C : E1 +>A : E1.A +>B : E1.B +>C : E1.C } diff --git a/tests/baselines/reference/amdModuleName1.types b/tests/baselines/reference/amdModuleName1.types index c0db9c8b1b5..f7384ddf057 100644 --- a/tests/baselines/reference/amdModuleName1.types +++ b/tests/baselines/reference/amdModuleName1.types @@ -8,11 +8,11 @@ class Foo { constructor() { this.x = 5; ->this.x = 5 : number +>this.x = 5 : 5 >this.x : number >this : this >x : number ->5 : number +>5 : 5 } } export = Foo; diff --git a/tests/baselines/reference/anonterface.types b/tests/baselines/reference/anonterface.types index b152ce79a1d..a6c244b2885 100644 --- a/tests/baselines/reference/anonterface.types +++ b/tests/baselines/reference/anonterface.types @@ -34,9 +34,9 @@ c.m(function(n) { return "hello: "+n; },18); >function(n) { return "hello: "+n; } : (n: number) => string >n : number >"hello: "+n : string ->"hello: " : string +>"hello: " : "hello: " >n : number ->18 : number +>18 : 18 diff --git a/tests/baselines/reference/anyAsFunctionCall.types b/tests/baselines/reference/anyAsFunctionCall.types index 340ccac463f..42d0f9fc950 100644 --- a/tests/baselines/reference/anyAsFunctionCall.types +++ b/tests/baselines/reference/anyAsFunctionCall.types @@ -14,7 +14,7 @@ var b = x('hello'); >b : any >x('hello') : any >x : any ->'hello' : string +>'hello' : "hello" var c = x(x); >c : any diff --git a/tests/baselines/reference/anyAsReturnTypeForNewOnCall.types b/tests/baselines/reference/anyAsReturnTypeForNewOnCall.types index bd0d9a9a092..2ae57579835 100644 --- a/tests/baselines/reference/anyAsReturnTypeForNewOnCall.types +++ b/tests/baselines/reference/anyAsReturnTypeForNewOnCall.types @@ -24,8 +24,8 @@ var o = new Point(3, 4); >o : any >new Point(3, 4) : any >Point : (x: any, y: any) => void ->3 : number ->4 : number +>3 : 3 +>4 : 4 var xx = o.x; >xx : any diff --git a/tests/baselines/reference/anyAssignabilityInInheritance.types b/tests/baselines/reference/anyAssignabilityInInheritance.types index b8575e8edb2..925dd5d593e 100644 --- a/tests/baselines/reference/anyAssignabilityInInheritance.types +++ b/tests/baselines/reference/anyAssignabilityInInheritance.types @@ -246,7 +246,7 @@ module f { export var bar = 1; >bar : number ->1 : number +>1 : 1 } declare function foo15(x: typeof f): typeof f; >foo15 : { (x: typeof f): typeof f; (x: any): any; } @@ -273,7 +273,7 @@ module CC { export var bar = 1; >bar : number ->1 : number +>1 : 1 } declare function foo16(x: CC): CC; >foo16 : { (x: CC): CC; (x: any): any; } diff --git a/tests/baselines/reference/anyAssignableToEveryType2.types b/tests/baselines/reference/anyAssignableToEveryType2.types index b3f54211601..564b634cde3 100644 --- a/tests/baselines/reference/anyAssignableToEveryType2.types +++ b/tests/baselines/reference/anyAssignableToEveryType2.types @@ -187,7 +187,7 @@ module f { export var bar = 1; >bar : number ->1 : number +>1 : 1 } interface I15 { >I15 : I15 @@ -210,7 +210,7 @@ module c { export var bar = 1; >bar : number ->1 : number +>1 : 1 } interface I16 { >I16 : I16 diff --git a/tests/baselines/reference/anyPlusAny1.types b/tests/baselines/reference/anyPlusAny1.types index 406d432f06e..f6ca9c4996e 100644 --- a/tests/baselines/reference/anyPlusAny1.types +++ b/tests/baselines/reference/anyPlusAny1.types @@ -3,11 +3,11 @@ var x; >x : any x.name = "hello"; ->x.name = "hello" : string +>x.name = "hello" : "hello" >x.name : any >x : any >name : any ->"hello" : string +>"hello" : "hello" var z = x + x; >z : any diff --git a/tests/baselines/reference/anyPropertyAccess.types b/tests/baselines/reference/anyPropertyAccess.types index 13eec6b53b2..9b9e5ab84ac 100644 --- a/tests/baselines/reference/anyPropertyAccess.types +++ b/tests/baselines/reference/anyPropertyAccess.types @@ -12,14 +12,14 @@ var b = x['foo']; >b : any >x['foo'] : any >x : any ->'foo' : string +>'foo' : "foo" var c = x['fn'](); >c : any >x['fn']() : any >x['fn'] : any >x : any ->'fn' : string +>'fn' : "fn" var d = x.bar.baz; >d : any @@ -34,7 +34,7 @@ var e = x[0].foo; >x[0].foo : any >x[0] : any >x : any ->0 : number +>0 : 0 >foo : any var f = x['0'].bar; @@ -42,6 +42,6 @@ var f = x['0'].bar; >x['0'].bar : any >x['0'] : any >x : any ->'0' : string +>'0' : "0" >bar : any diff --git a/tests/baselines/reference/argsInScope.types b/tests/baselines/reference/argsInScope.types index 745ae249359..dacc66be912 100644 --- a/tests/baselines/reference/argsInScope.types +++ b/tests/baselines/reference/argsInScope.types @@ -10,7 +10,7 @@ class C { for (var i = 0; i < arguments.length; i++) { >i : number ->0 : number +>0 : 0 >i < arguments.length : boolean >i : number >arguments.length : number @@ -34,7 +34,7 @@ c.P(1,2,3); >c.P : (ii: number, j: number, k: number) => void >c : C >P : (ii: number, j: number, k: number) => void ->1 : number ->2 : number ->3 : number +>1 : 1 +>2 : 2 +>3 : 3 diff --git a/tests/baselines/reference/arguments.types b/tests/baselines/reference/arguments.types index 4699d463b34..97a23822b7a 100644 --- a/tests/baselines/reference/arguments.types +++ b/tests/baselines/reference/arguments.types @@ -6,5 +6,5 @@ function f() { >x : any >arguments[12] : any >arguments : IArguments ->12 : number +>12 : 12 } diff --git a/tests/baselines/reference/argumentsBindsToFunctionScopeArgumentList.errors.txt b/tests/baselines/reference/argumentsBindsToFunctionScopeArgumentList.errors.txt index 89ef8ded91c..c19f00fa1da 100644 --- a/tests/baselines/reference/argumentsBindsToFunctionScopeArgumentList.errors.txt +++ b/tests/baselines/reference/argumentsBindsToFunctionScopeArgumentList.errors.txt @@ -1,4 +1,4 @@ -tests/cases/compiler/argumentsBindsToFunctionScopeArgumentList.ts(3,5): error TS2322: Type 'number' is not assignable to type 'IArguments'. +tests/cases/compiler/argumentsBindsToFunctionScopeArgumentList.ts(3,5): error TS2322: Type '10' is not assignable to type 'IArguments'. ==== tests/cases/compiler/argumentsBindsToFunctionScopeArgumentList.ts (1 errors) ==== @@ -6,5 +6,5 @@ tests/cases/compiler/argumentsBindsToFunctionScopeArgumentList.ts(3,5): error TS function foo(a) { arguments = 10; /// This shouldnt be of type number and result in error. ~~~~~~~~~ -!!! error TS2322: Type 'number' is not assignable to type 'IArguments'. +!!! error TS2322: Type '10' is not assignable to type 'IArguments'. } \ No newline at end of file diff --git a/tests/baselines/reference/arithAssignTyping.errors.txt b/tests/baselines/reference/arithAssignTyping.errors.txt index c4cd84639a6..10f34e94012 100644 --- a/tests/baselines/reference/arithAssignTyping.errors.txt +++ b/tests/baselines/reference/arithAssignTyping.errors.txt @@ -1,5 +1,5 @@ tests/cases/compiler/arithAssignTyping.ts(3,1): error TS2364: Invalid left-hand side of assignment expression. -tests/cases/compiler/arithAssignTyping.ts(4,1): error TS2365: Operator '+=' cannot be applied to types 'typeof f' and 'number'. +tests/cases/compiler/arithAssignTyping.ts(4,1): error TS2365: Operator '+=' cannot be applied to types 'typeof f' and '1'. tests/cases/compiler/arithAssignTyping.ts(5,1): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. tests/cases/compiler/arithAssignTyping.ts(6,1): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. tests/cases/compiler/arithAssignTyping.ts(7,1): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. @@ -20,7 +20,7 @@ tests/cases/compiler/arithAssignTyping.ts(14,1): error TS2362: The left-hand sid !!! error TS2364: Invalid left-hand side of assignment expression. f += 1; // error ~~~~~~ -!!! error TS2365: Operator '+=' cannot be applied to types 'typeof f' and 'number'. +!!! error TS2365: Operator '+=' cannot be applied to types 'typeof f' and '1'. f -= 1; // error ~ !!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. diff --git a/tests/baselines/reference/arithmeticOperatorWithAnyAndNumber.types b/tests/baselines/reference/arithmeticOperatorWithAnyAndNumber.types index 8845a52760d..eeaf6a0ab38 100644 --- a/tests/baselines/reference/arithmeticOperatorWithAnyAndNumber.types +++ b/tests/baselines/reference/arithmeticOperatorWithAnyAndNumber.types @@ -22,30 +22,30 @@ var ra3 = a * 0; >ra3 : number >a * 0 : number >a : any ->0 : number +>0 : 0 var ra4 = 0 * a; >ra4 : number >0 * a : number ->0 : number +>0 : 0 >a : any var ra5 = 0 * 0; >ra5 : number >0 * 0 : number ->0 : number ->0 : number +>0 : 0 +>0 : 0 var ra6 = b * 0; >ra6 : number >b * 0 : number >b : number ->0 : number +>0 : 0 var ra7 = 0 * b; >ra7 : number >0 * b : number ->0 : number +>0 : 0 >b : number var ra8 = b * b; @@ -71,30 +71,30 @@ var rb3 = a / 0; >rb3 : number >a / 0 : number >a : any ->0 : number +>0 : 0 var rb4 = 0 / a; >rb4 : number >0 / a : number ->0 : number +>0 : 0 >a : any var rb5 = 0 / 0; >rb5 : number >0 / 0 : number ->0 : number ->0 : number +>0 : 0 +>0 : 0 var rb6 = b / 0; >rb6 : number >b / 0 : number >b : number ->0 : number +>0 : 0 var rb7 = 0 / b; >rb7 : number >0 / b : number ->0 : number +>0 : 0 >b : number var rb8 = b / b; @@ -120,30 +120,30 @@ var rc3 = a % 0; >rc3 : number >a % 0 : number >a : any ->0 : number +>0 : 0 var rc4 = 0 % a; >rc4 : number >0 % a : number ->0 : number +>0 : 0 >a : any var rc5 = 0 % 0; >rc5 : number >0 % 0 : number ->0 : number ->0 : number +>0 : 0 +>0 : 0 var rc6 = b % 0; >rc6 : number >b % 0 : number >b : number ->0 : number +>0 : 0 var rc7 = 0 % b; >rc7 : number >0 % b : number ->0 : number +>0 : 0 >b : number var rc8 = b % b; @@ -169,30 +169,30 @@ var rd3 = a - 0; >rd3 : number >a - 0 : number >a : any ->0 : number +>0 : 0 var rd4 = 0 - a; >rd4 : number >0 - a : number ->0 : number +>0 : 0 >a : any var rd5 = 0 - 0; >rd5 : number >0 - 0 : number ->0 : number ->0 : number +>0 : 0 +>0 : 0 var rd6 = b - 0; >rd6 : number >b - 0 : number >b : number ->0 : number +>0 : 0 var rd7 = 0 - b; >rd7 : number >0 - b : number ->0 : number +>0 : 0 >b : number var rd8 = b - b; @@ -218,30 +218,30 @@ var re3 = a << 0; >re3 : number >a << 0 : number >a : any ->0 : number +>0 : 0 var re4 = 0 << a; >re4 : number >0 << a : number ->0 : number +>0 : 0 >a : any var re5 = 0 << 0; >re5 : number >0 << 0 : number ->0 : number ->0 : number +>0 : 0 +>0 : 0 var re6 = b << 0; >re6 : number >b << 0 : number >b : number ->0 : number +>0 : 0 var re7 = 0 << b; >re7 : number >0 << b : number ->0 : number +>0 : 0 >b : number var re8 = b << b; @@ -267,30 +267,30 @@ var rf3 = a >> 0; >rf3 : number >a >> 0 : number >a : any ->0 : number +>0 : 0 var rf4 = 0 >> a; >rf4 : number >0 >> a : number ->0 : number +>0 : 0 >a : any var rf5 = 0 >> 0; >rf5 : number >0 >> 0 : number ->0 : number ->0 : number +>0 : 0 +>0 : 0 var rf6 = b >> 0; >rf6 : number >b >> 0 : number >b : number ->0 : number +>0 : 0 var rf7 = 0 >> b; >rf7 : number >0 >> b : number ->0 : number +>0 : 0 >b : number var rf8 = b >> b; @@ -316,30 +316,30 @@ var rg3 = a >>> 0; >rg3 : number >a >>> 0 : number >a : any ->0 : number +>0 : 0 var rg4 = 0 >>> a; >rg4 : number >0 >>> a : number ->0 : number +>0 : 0 >a : any var rg5 = 0 >>> 0; >rg5 : number >0 >>> 0 : number ->0 : number ->0 : number +>0 : 0 +>0 : 0 var rg6 = b >>> 0; >rg6 : number >b >>> 0 : number >b : number ->0 : number +>0 : 0 var rg7 = 0 >>> b; >rg7 : number >0 >>> b : number ->0 : number +>0 : 0 >b : number var rg8 = b >>> b; @@ -365,30 +365,30 @@ var rh3 = a & 0; >rh3 : number >a & 0 : number >a : any ->0 : number +>0 : 0 var rh4 = 0 & a; >rh4 : number >0 & a : number ->0 : number +>0 : 0 >a : any var rh5 = 0 & 0; >rh5 : number >0 & 0 : number ->0 : number ->0 : number +>0 : 0 +>0 : 0 var rh6 = b & 0; >rh6 : number >b & 0 : number >b : number ->0 : number +>0 : 0 var rh7 = 0 & b; >rh7 : number >0 & b : number ->0 : number +>0 : 0 >b : number var rh8 = b & b; @@ -414,30 +414,30 @@ var ri3 = a ^ 0; >ri3 : number >a ^ 0 : number >a : any ->0 : number +>0 : 0 var ri4 = 0 ^ a; >ri4 : number >0 ^ a : number ->0 : number +>0 : 0 >a : any var ri5 = 0 ^ 0; >ri5 : number >0 ^ 0 : number ->0 : number ->0 : number +>0 : 0 +>0 : 0 var ri6 = b ^ 0; >ri6 : number >b ^ 0 : number >b : number ->0 : number +>0 : 0 var ri7 = 0 ^ b; >ri7 : number >0 ^ b : number ->0 : number +>0 : 0 >b : number var ri8 = b ^ b; @@ -463,30 +463,30 @@ var rj3 = a | 0; >rj3 : number >a | 0 : number >a : any ->0 : number +>0 : 0 var rj4 = 0 | a; >rj4 : number >0 | a : number ->0 : number +>0 : 0 >a : any var rj5 = 0 | 0; >rj5 : number >0 | 0 : number ->0 : number ->0 : number +>0 : 0 +>0 : 0 var rj6 = b | 0; >rj6 : number >b | 0 : number >b : number ->0 : number +>0 : 0 var rj7 = 0 | b; >rj7 : number >0 | b : number ->0 : number +>0 : 0 >b : number var rj8 = b | b; diff --git a/tests/baselines/reference/arithmeticOperatorWithEnum.types b/tests/baselines/reference/arithmeticOperatorWithEnum.types index 3aca5c31798..0f2fbe48feb 100644 --- a/tests/baselines/reference/arithmeticOperatorWithEnum.types +++ b/tests/baselines/reference/arithmeticOperatorWithEnum.types @@ -5,10 +5,10 @@ enum E { >E : E a, ->a : E +>a : E.a b ->b : E +>b : E.b } var a: any; @@ -55,60 +55,60 @@ var ra5 = b * c; var ra6 = E.a * a; >ra6 : number >E.a * a : number ->E.a : E +>E.a : E.a >E : typeof E ->a : E +>a : E.a >a : any var ra7 = E.a * b; >ra7 : number >E.a * b : number ->E.a : E +>E.a : E.a >E : typeof E ->a : E +>a : E.a >b : number var ra8 = E.a * E.b; >ra8 : number >E.a * E.b : number ->E.a : E +>E.a : E.a >E : typeof E ->a : E ->E.b : E +>a : E.a +>E.b : E.b >E : typeof E ->b : E +>b : E.b var ra9 = E.a * 1; >ra9 : number >E.a * 1 : number ->E.a : E +>E.a : E.a >E : typeof E ->a : E ->1 : number +>a : E.a +>1 : 1 var ra10 = a * E.b; >ra10 : number >a * E.b : number >a : any ->E.b : E +>E.b : E.b >E : typeof E ->b : E +>b : E.b var ra11 = b * E.b; >ra11 : number >b * E.b : number >b : number ->E.b : E +>E.b : E.b >E : typeof E ->b : E +>b : E.b var ra12 = 1 * E.b; >ra12 : number >1 * E.b : number ->1 : number ->E.b : E +>1 : 1 +>E.b : E.b >E : typeof E ->b : E +>b : E.b // operator / var rb1 = c / a; @@ -144,60 +144,60 @@ var rb5 = b / c; var rb6 = E.a / a; >rb6 : number >E.a / a : number ->E.a : E +>E.a : E.a >E : typeof E ->a : E +>a : E.a >a : any var rb7 = E.a / b; >rb7 : number >E.a / b : number ->E.a : E +>E.a : E.a >E : typeof E ->a : E +>a : E.a >b : number var rb8 = E.a / E.b; >rb8 : number >E.a / E.b : number ->E.a : E +>E.a : E.a >E : typeof E ->a : E ->E.b : E +>a : E.a +>E.b : E.b >E : typeof E ->b : E +>b : E.b var rb9 = E.a / 1; >rb9 : number >E.a / 1 : number ->E.a : E +>E.a : E.a >E : typeof E ->a : E ->1 : number +>a : E.a +>1 : 1 var rb10 = a / E.b; >rb10 : number >a / E.b : number >a : any ->E.b : E +>E.b : E.b >E : typeof E ->b : E +>b : E.b var rb11 = b / E.b; >rb11 : number >b / E.b : number >b : number ->E.b : E +>E.b : E.b >E : typeof E ->b : E +>b : E.b var rb12 = 1 / E.b; >rb12 : number >1 / E.b : number ->1 : number ->E.b : E +>1 : 1 +>E.b : E.b >E : typeof E ->b : E +>b : E.b // operator % var rc1 = c % a; @@ -233,60 +233,60 @@ var rc5 = b % c; var rc6 = E.a % a; >rc6 : number >E.a % a : number ->E.a : E +>E.a : E.a >E : typeof E ->a : E +>a : E.a >a : any var rc7 = E.a % b; >rc7 : number >E.a % b : number ->E.a : E +>E.a : E.a >E : typeof E ->a : E +>a : E.a >b : number var rc8 = E.a % E.b; >rc8 : number >E.a % E.b : number ->E.a : E +>E.a : E.a >E : typeof E ->a : E ->E.b : E +>a : E.a +>E.b : E.b >E : typeof E ->b : E +>b : E.b var rc9 = E.a % 1; >rc9 : number >E.a % 1 : number ->E.a : E +>E.a : E.a >E : typeof E ->a : E ->1 : number +>a : E.a +>1 : 1 var rc10 = a % E.b; >rc10 : number >a % E.b : number >a : any ->E.b : E +>E.b : E.b >E : typeof E ->b : E +>b : E.b var rc11 = b % E.b; >rc11 : number >b % E.b : number >b : number ->E.b : E +>E.b : E.b >E : typeof E ->b : E +>b : E.b var rc12 = 1 % E.b; >rc12 : number >1 % E.b : number ->1 : number ->E.b : E +>1 : 1 +>E.b : E.b >E : typeof E ->b : E +>b : E.b // operator - var rd1 = c - a; @@ -322,60 +322,60 @@ var rd5 = b - c; var rd6 = E.a - a; >rd6 : number >E.a - a : number ->E.a : E +>E.a : E.a >E : typeof E ->a : E +>a : E.a >a : any var rd7 = E.a - b; >rd7 : number >E.a - b : number ->E.a : E +>E.a : E.a >E : typeof E ->a : E +>a : E.a >b : number var rd8 = E.a - E.b; >rd8 : number >E.a - E.b : number ->E.a : E +>E.a : E.a >E : typeof E ->a : E ->E.b : E +>a : E.a +>E.b : E.b >E : typeof E ->b : E +>b : E.b var rd9 = E.a - 1; >rd9 : number >E.a - 1 : number ->E.a : E +>E.a : E.a >E : typeof E ->a : E ->1 : number +>a : E.a +>1 : 1 var rd10 = a - E.b; >rd10 : number >a - E.b : number >a : any ->E.b : E +>E.b : E.b >E : typeof E ->b : E +>b : E.b var rd11 = b - E.b; >rd11 : number >b - E.b : number >b : number ->E.b : E +>E.b : E.b >E : typeof E ->b : E +>b : E.b var rd12 = 1 - E.b; >rd12 : number >1 - E.b : number ->1 : number ->E.b : E +>1 : 1 +>E.b : E.b >E : typeof E ->b : E +>b : E.b // operator << var re1 = c << a; @@ -411,60 +411,60 @@ var re5 = b << c; var re6 = E.a << a; >re6 : number >E.a << a : number ->E.a : E +>E.a : E.a >E : typeof E ->a : E +>a : E.a >a : any var re7 = E.a << b; >re7 : number >E.a << b : number ->E.a : E +>E.a : E.a >E : typeof E ->a : E +>a : E.a >b : number var re8 = E.a << E.b; >re8 : number >E.a << E.b : number ->E.a : E +>E.a : E.a >E : typeof E ->a : E ->E.b : E +>a : E.a +>E.b : E.b >E : typeof E ->b : E +>b : E.b var re9 = E.a << 1; >re9 : number >E.a << 1 : number ->E.a : E +>E.a : E.a >E : typeof E ->a : E ->1 : number +>a : E.a +>1 : 1 var re10 = a << E.b; >re10 : number >a << E.b : number >a : any ->E.b : E +>E.b : E.b >E : typeof E ->b : E +>b : E.b var re11 = b << E.b; >re11 : number >b << E.b : number >b : number ->E.b : E +>E.b : E.b >E : typeof E ->b : E +>b : E.b var re12 = 1 << E.b; >re12 : number >1 << E.b : number ->1 : number ->E.b : E +>1 : 1 +>E.b : E.b >E : typeof E ->b : E +>b : E.b // operator >> var rf1 = c >> a; @@ -500,60 +500,60 @@ var rf5 = b >> c; var rf6 = E.a >> a; >rf6 : number >E.a >> a : number ->E.a : E +>E.a : E.a >E : typeof E ->a : E +>a : E.a >a : any var rf7 = E.a >> b; >rf7 : number >E.a >> b : number ->E.a : E +>E.a : E.a >E : typeof E ->a : E +>a : E.a >b : number var rf8 = E.a >> E.b; >rf8 : number >E.a >> E.b : number ->E.a : E +>E.a : E.a >E : typeof E ->a : E ->E.b : E +>a : E.a +>E.b : E.b >E : typeof E ->b : E +>b : E.b var rf9 = E.a >> 1; >rf9 : number >E.a >> 1 : number ->E.a : E +>E.a : E.a >E : typeof E ->a : E ->1 : number +>a : E.a +>1 : 1 var rf10 = a >> E.b; >rf10 : number >a >> E.b : number >a : any ->E.b : E +>E.b : E.b >E : typeof E ->b : E +>b : E.b var rf11 = b >> E.b; >rf11 : number >b >> E.b : number >b : number ->E.b : E +>E.b : E.b >E : typeof E ->b : E +>b : E.b var rf12 = 1 >> E.b; >rf12 : number >1 >> E.b : number ->1 : number ->E.b : E +>1 : 1 +>E.b : E.b >E : typeof E ->b : E +>b : E.b // operator >>> var rg1 = c >>> a; @@ -589,60 +589,60 @@ var rg5 = b >>> c; var rg6 = E.a >>> a; >rg6 : number >E.a >>> a : number ->E.a : E +>E.a : E.a >E : typeof E ->a : E +>a : E.a >a : any var rg7 = E.a >>> b; >rg7 : number >E.a >>> b : number ->E.a : E +>E.a : E.a >E : typeof E ->a : E +>a : E.a >b : number var rg8 = E.a >>> E.b; >rg8 : number >E.a >>> E.b : number ->E.a : E +>E.a : E.a >E : typeof E ->a : E ->E.b : E +>a : E.a +>E.b : E.b >E : typeof E ->b : E +>b : E.b var rg9 = E.a >>> 1; >rg9 : number >E.a >>> 1 : number ->E.a : E +>E.a : E.a >E : typeof E ->a : E ->1 : number +>a : E.a +>1 : 1 var rg10 = a >>> E.b; >rg10 : number >a >>> E.b : number >a : any ->E.b : E +>E.b : E.b >E : typeof E ->b : E +>b : E.b var rg11 = b >>> E.b; >rg11 : number >b >>> E.b : number >b : number ->E.b : E +>E.b : E.b >E : typeof E ->b : E +>b : E.b var rg12 = 1 >>> E.b; >rg12 : number >1 >>> E.b : number ->1 : number ->E.b : E +>1 : 1 +>E.b : E.b >E : typeof E ->b : E +>b : E.b // operator & var rh1 = c & a; @@ -678,60 +678,60 @@ var rh5 = b & c; var rh6 = E.a & a; >rh6 : number >E.a & a : number ->E.a : E +>E.a : E.a >E : typeof E ->a : E +>a : E.a >a : any var rh7 = E.a & b; >rh7 : number >E.a & b : number ->E.a : E +>E.a : E.a >E : typeof E ->a : E +>a : E.a >b : number var rh8 = E.a & E.b; >rh8 : number >E.a & E.b : number ->E.a : E +>E.a : E.a >E : typeof E ->a : E ->E.b : E +>a : E.a +>E.b : E.b >E : typeof E ->b : E +>b : E.b var rh9 = E.a & 1; >rh9 : number >E.a & 1 : number ->E.a : E +>E.a : E.a >E : typeof E ->a : E ->1 : number +>a : E.a +>1 : 1 var rh10 = a & E.b; >rh10 : number >a & E.b : number >a : any ->E.b : E +>E.b : E.b >E : typeof E ->b : E +>b : E.b var rh11 = b & E.b; >rh11 : number >b & E.b : number >b : number ->E.b : E +>E.b : E.b >E : typeof E ->b : E +>b : E.b var rh12 = 1 & E.b; >rh12 : number >1 & E.b : number ->1 : number ->E.b : E +>1 : 1 +>E.b : E.b >E : typeof E ->b : E +>b : E.b // operator ^ var ri1 = c ^ a; @@ -767,60 +767,60 @@ var ri5 = b ^ c; var ri6 = E.a ^ a; >ri6 : number >E.a ^ a : number ->E.a : E +>E.a : E.a >E : typeof E ->a : E +>a : E.a >a : any var ri7 = E.a ^ b; >ri7 : number >E.a ^ b : number ->E.a : E +>E.a : E.a >E : typeof E ->a : E +>a : E.a >b : number var ri8 = E.a ^ E.b; >ri8 : number >E.a ^ E.b : number ->E.a : E +>E.a : E.a >E : typeof E ->a : E ->E.b : E +>a : E.a +>E.b : E.b >E : typeof E ->b : E +>b : E.b var ri9 = E.a ^ 1; >ri9 : number >E.a ^ 1 : number ->E.a : E +>E.a : E.a >E : typeof E ->a : E ->1 : number +>a : E.a +>1 : 1 var ri10 = a ^ E.b; >ri10 : number >a ^ E.b : number >a : any ->E.b : E +>E.b : E.b >E : typeof E ->b : E +>b : E.b var ri11 = b ^ E.b; >ri11 : number >b ^ E.b : number >b : number ->E.b : E +>E.b : E.b >E : typeof E ->b : E +>b : E.b var ri12 = 1 ^ E.b; >ri12 : number >1 ^ E.b : number ->1 : number ->E.b : E +>1 : 1 +>E.b : E.b >E : typeof E ->b : E +>b : E.b // operator | var rj1 = c | a; @@ -856,58 +856,58 @@ var rj5 = b | c; var rj6 = E.a | a; >rj6 : number >E.a | a : number ->E.a : E +>E.a : E.a >E : typeof E ->a : E +>a : E.a >a : any var rj7 = E.a | b; >rj7 : number >E.a | b : number ->E.a : E +>E.a : E.a >E : typeof E ->a : E +>a : E.a >b : number var rj8 = E.a | E.b; >rj8 : number >E.a | E.b : number ->E.a : E +>E.a : E.a >E : typeof E ->a : E ->E.b : E +>a : E.a +>E.b : E.b >E : typeof E ->b : E +>b : E.b var rj9 = E.a | 1; >rj9 : number >E.a | 1 : number ->E.a : E +>E.a : E.a >E : typeof E ->a : E ->1 : number +>a : E.a +>1 : 1 var rj10 = a | E.b; >rj10 : number >a | E.b : number >a : any ->E.b : E +>E.b : E.b >E : typeof E ->b : E +>b : E.b var rj11 = b | E.b; >rj11 : number >b | E.b : number >b : number ->E.b : E +>E.b : E.b >E : typeof E ->b : E +>b : E.b var rj12 = 1 | E.b; >rj12 : number >1 | E.b : number ->1 : number ->E.b : E +>1 : 1 +>E.b : E.b >E : typeof E ->b : E +>b : E.b diff --git a/tests/baselines/reference/arithmeticOperatorWithEnumUnion.types b/tests/baselines/reference/arithmeticOperatorWithEnumUnion.types index cb9bf3d45b0..379bd6f34b3 100644 --- a/tests/baselines/reference/arithmeticOperatorWithEnumUnion.types +++ b/tests/baselines/reference/arithmeticOperatorWithEnumUnion.types @@ -5,19 +5,19 @@ enum E { >E : E a, ->a : E +>a : E.a b ->b : E +>b : E.b } enum F { >F : F c, ->c : F +>c : F.c d ->d : F +>d : F.d } var a: any; @@ -65,60 +65,60 @@ var ra5 = b * c; var ra6 = E.a * a; >ra6 : number >E.a * a : number ->E.a : E +>E.a : E.a >E : typeof E ->a : E +>a : E.a >a : any var ra7 = E.a * b; >ra7 : number >E.a * b : number ->E.a : E +>E.a : E.a >E : typeof E ->a : E +>a : E.a >b : number var ra8 = E.a * E.b; >ra8 : number >E.a * E.b : number ->E.a : E +>E.a : E.a >E : typeof E ->a : E ->E.b : E +>a : E.a +>E.b : E.b >E : typeof E ->b : E +>b : E.b var ra9 = E.a * 1; >ra9 : number >E.a * 1 : number ->E.a : E +>E.a : E.a >E : typeof E ->a : E ->1 : number +>a : E.a +>1 : 1 var ra10 = a * E.b; >ra10 : number >a * E.b : number >a : any ->E.b : E +>E.b : E.b >E : typeof E ->b : E +>b : E.b var ra11 = b * E.b; >ra11 : number >b * E.b : number >b : number ->E.b : E +>E.b : E.b >E : typeof E ->b : E +>b : E.b var ra12 = 1 * E.b; >ra12 : number >1 * E.b : number ->1 : number ->E.b : E +>1 : 1 +>E.b : E.b >E : typeof E ->b : E +>b : E.b // operator / var rb1 = c / a; @@ -154,60 +154,60 @@ var rb5 = b / c; var rb6 = E.a / a; >rb6 : number >E.a / a : number ->E.a : E +>E.a : E.a >E : typeof E ->a : E +>a : E.a >a : any var rb7 = E.a / b; >rb7 : number >E.a / b : number ->E.a : E +>E.a : E.a >E : typeof E ->a : E +>a : E.a >b : number var rb8 = E.a / E.b; >rb8 : number >E.a / E.b : number ->E.a : E +>E.a : E.a >E : typeof E ->a : E ->E.b : E +>a : E.a +>E.b : E.b >E : typeof E ->b : E +>b : E.b var rb9 = E.a / 1; >rb9 : number >E.a / 1 : number ->E.a : E +>E.a : E.a >E : typeof E ->a : E ->1 : number +>a : E.a +>1 : 1 var rb10 = a / E.b; >rb10 : number >a / E.b : number >a : any ->E.b : E +>E.b : E.b >E : typeof E ->b : E +>b : E.b var rb11 = b / E.b; >rb11 : number >b / E.b : number >b : number ->E.b : E +>E.b : E.b >E : typeof E ->b : E +>b : E.b var rb12 = 1 / E.b; >rb12 : number >1 / E.b : number ->1 : number ->E.b : E +>1 : 1 +>E.b : E.b >E : typeof E ->b : E +>b : E.b // operator % var rc1 = c % a; @@ -243,60 +243,60 @@ var rc5 = b % c; var rc6 = E.a % a; >rc6 : number >E.a % a : number ->E.a : E +>E.a : E.a >E : typeof E ->a : E +>a : E.a >a : any var rc7 = E.a % b; >rc7 : number >E.a % b : number ->E.a : E +>E.a : E.a >E : typeof E ->a : E +>a : E.a >b : number var rc8 = E.a % E.b; >rc8 : number >E.a % E.b : number ->E.a : E +>E.a : E.a >E : typeof E ->a : E ->E.b : E +>a : E.a +>E.b : E.b >E : typeof E ->b : E +>b : E.b var rc9 = E.a % 1; >rc9 : number >E.a % 1 : number ->E.a : E +>E.a : E.a >E : typeof E ->a : E ->1 : number +>a : E.a +>1 : 1 var rc10 = a % E.b; >rc10 : number >a % E.b : number >a : any ->E.b : E +>E.b : E.b >E : typeof E ->b : E +>b : E.b var rc11 = b % E.b; >rc11 : number >b % E.b : number >b : number ->E.b : E +>E.b : E.b >E : typeof E ->b : E +>b : E.b var rc12 = 1 % E.b; >rc12 : number >1 % E.b : number ->1 : number ->E.b : E +>1 : 1 +>E.b : E.b >E : typeof E ->b : E +>b : E.b // operator - var rd1 = c - a; @@ -332,60 +332,60 @@ var rd5 = b - c; var rd6 = E.a - a; >rd6 : number >E.a - a : number ->E.a : E +>E.a : E.a >E : typeof E ->a : E +>a : E.a >a : any var rd7 = E.a - b; >rd7 : number >E.a - b : number ->E.a : E +>E.a : E.a >E : typeof E ->a : E +>a : E.a >b : number var rd8 = E.a - E.b; >rd8 : number >E.a - E.b : number ->E.a : E +>E.a : E.a >E : typeof E ->a : E ->E.b : E +>a : E.a +>E.b : E.b >E : typeof E ->b : E +>b : E.b var rd9 = E.a - 1; >rd9 : number >E.a - 1 : number ->E.a : E +>E.a : E.a >E : typeof E ->a : E ->1 : number +>a : E.a +>1 : 1 var rd10 = a - E.b; >rd10 : number >a - E.b : number >a : any ->E.b : E +>E.b : E.b >E : typeof E ->b : E +>b : E.b var rd11 = b - E.b; >rd11 : number >b - E.b : number >b : number ->E.b : E +>E.b : E.b >E : typeof E ->b : E +>b : E.b var rd12 = 1 - E.b; >rd12 : number >1 - E.b : number ->1 : number ->E.b : E +>1 : 1 +>E.b : E.b >E : typeof E ->b : E +>b : E.b // operator << var re1 = c << a; @@ -421,60 +421,60 @@ var re5 = b << c; var re6 = E.a << a; >re6 : number >E.a << a : number ->E.a : E +>E.a : E.a >E : typeof E ->a : E +>a : E.a >a : any var re7 = E.a << b; >re7 : number >E.a << b : number ->E.a : E +>E.a : E.a >E : typeof E ->a : E +>a : E.a >b : number var re8 = E.a << E.b; >re8 : number >E.a << E.b : number ->E.a : E +>E.a : E.a >E : typeof E ->a : E ->E.b : E +>a : E.a +>E.b : E.b >E : typeof E ->b : E +>b : E.b var re9 = E.a << 1; >re9 : number >E.a << 1 : number ->E.a : E +>E.a : E.a >E : typeof E ->a : E ->1 : number +>a : E.a +>1 : 1 var re10 = a << E.b; >re10 : number >a << E.b : number >a : any ->E.b : E +>E.b : E.b >E : typeof E ->b : E +>b : E.b var re11 = b << E.b; >re11 : number >b << E.b : number >b : number ->E.b : E +>E.b : E.b >E : typeof E ->b : E +>b : E.b var re12 = 1 << E.b; >re12 : number >1 << E.b : number ->1 : number ->E.b : E +>1 : 1 +>E.b : E.b >E : typeof E ->b : E +>b : E.b // operator >> var rf1 = c >> a; @@ -510,60 +510,60 @@ var rf5 = b >> c; var rf6 = E.a >> a; >rf6 : number >E.a >> a : number ->E.a : E +>E.a : E.a >E : typeof E ->a : E +>a : E.a >a : any var rf7 = E.a >> b; >rf7 : number >E.a >> b : number ->E.a : E +>E.a : E.a >E : typeof E ->a : E +>a : E.a >b : number var rf8 = E.a >> E.b; >rf8 : number >E.a >> E.b : number ->E.a : E +>E.a : E.a >E : typeof E ->a : E ->E.b : E +>a : E.a +>E.b : E.b >E : typeof E ->b : E +>b : E.b var rf9 = E.a >> 1; >rf9 : number >E.a >> 1 : number ->E.a : E +>E.a : E.a >E : typeof E ->a : E ->1 : number +>a : E.a +>1 : 1 var rf10 = a >> E.b; >rf10 : number >a >> E.b : number >a : any ->E.b : E +>E.b : E.b >E : typeof E ->b : E +>b : E.b var rf11 = b >> E.b; >rf11 : number >b >> E.b : number >b : number ->E.b : E +>E.b : E.b >E : typeof E ->b : E +>b : E.b var rf12 = 1 >> E.b; >rf12 : number >1 >> E.b : number ->1 : number ->E.b : E +>1 : 1 +>E.b : E.b >E : typeof E ->b : E +>b : E.b // operator >>> var rg1 = c >>> a; @@ -599,60 +599,60 @@ var rg5 = b >>> c; var rg6 = E.a >>> a; >rg6 : number >E.a >>> a : number ->E.a : E +>E.a : E.a >E : typeof E ->a : E +>a : E.a >a : any var rg7 = E.a >>> b; >rg7 : number >E.a >>> b : number ->E.a : E +>E.a : E.a >E : typeof E ->a : E +>a : E.a >b : number var rg8 = E.a >>> E.b; >rg8 : number >E.a >>> E.b : number ->E.a : E +>E.a : E.a >E : typeof E ->a : E ->E.b : E +>a : E.a +>E.b : E.b >E : typeof E ->b : E +>b : E.b var rg9 = E.a >>> 1; >rg9 : number >E.a >>> 1 : number ->E.a : E +>E.a : E.a >E : typeof E ->a : E ->1 : number +>a : E.a +>1 : 1 var rg10 = a >>> E.b; >rg10 : number >a >>> E.b : number >a : any ->E.b : E +>E.b : E.b >E : typeof E ->b : E +>b : E.b var rg11 = b >>> E.b; >rg11 : number >b >>> E.b : number >b : number ->E.b : E +>E.b : E.b >E : typeof E ->b : E +>b : E.b var rg12 = 1 >>> E.b; >rg12 : number >1 >>> E.b : number ->1 : number ->E.b : E +>1 : 1 +>E.b : E.b >E : typeof E ->b : E +>b : E.b // operator & var rh1 = c & a; @@ -688,60 +688,60 @@ var rh5 = b & c; var rh6 = E.a & a; >rh6 : number >E.a & a : number ->E.a : E +>E.a : E.a >E : typeof E ->a : E +>a : E.a >a : any var rh7 = E.a & b; >rh7 : number >E.a & b : number ->E.a : E +>E.a : E.a >E : typeof E ->a : E +>a : E.a >b : number var rh8 = E.a & E.b; >rh8 : number >E.a & E.b : number ->E.a : E +>E.a : E.a >E : typeof E ->a : E ->E.b : E +>a : E.a +>E.b : E.b >E : typeof E ->b : E +>b : E.b var rh9 = E.a & 1; >rh9 : number >E.a & 1 : number ->E.a : E +>E.a : E.a >E : typeof E ->a : E ->1 : number +>a : E.a +>1 : 1 var rh10 = a & E.b; >rh10 : number >a & E.b : number >a : any ->E.b : E +>E.b : E.b >E : typeof E ->b : E +>b : E.b var rh11 = b & E.b; >rh11 : number >b & E.b : number >b : number ->E.b : E +>E.b : E.b >E : typeof E ->b : E +>b : E.b var rh12 = 1 & E.b; >rh12 : number >1 & E.b : number ->1 : number ->E.b : E +>1 : 1 +>E.b : E.b >E : typeof E ->b : E +>b : E.b // operator ^ var ri1 = c ^ a; @@ -777,60 +777,60 @@ var ri5 = b ^ c; var ri6 = E.a ^ a; >ri6 : number >E.a ^ a : number ->E.a : E +>E.a : E.a >E : typeof E ->a : E +>a : E.a >a : any var ri7 = E.a ^ b; >ri7 : number >E.a ^ b : number ->E.a : E +>E.a : E.a >E : typeof E ->a : E +>a : E.a >b : number var ri8 = E.a ^ E.b; >ri8 : number >E.a ^ E.b : number ->E.a : E +>E.a : E.a >E : typeof E ->a : E ->E.b : E +>a : E.a +>E.b : E.b >E : typeof E ->b : E +>b : E.b var ri9 = E.a ^ 1; >ri9 : number >E.a ^ 1 : number ->E.a : E +>E.a : E.a >E : typeof E ->a : E ->1 : number +>a : E.a +>1 : 1 var ri10 = a ^ E.b; >ri10 : number >a ^ E.b : number >a : any ->E.b : E +>E.b : E.b >E : typeof E ->b : E +>b : E.b var ri11 = b ^ E.b; >ri11 : number >b ^ E.b : number >b : number ->E.b : E +>E.b : E.b >E : typeof E ->b : E +>b : E.b var ri12 = 1 ^ E.b; >ri12 : number >1 ^ E.b : number ->1 : number ->E.b : E +>1 : 1 +>E.b : E.b >E : typeof E ->b : E +>b : E.b // operator | var rj1 = c | a; @@ -866,58 +866,58 @@ var rj5 = b | c; var rj6 = E.a | a; >rj6 : number >E.a | a : number ->E.a : E +>E.a : E.a >E : typeof E ->a : E +>a : E.a >a : any var rj7 = E.a | b; >rj7 : number >E.a | b : number ->E.a : E +>E.a : E.a >E : typeof E ->a : E +>a : E.a >b : number var rj8 = E.a | E.b; >rj8 : number >E.a | E.b : number ->E.a : E +>E.a : E.a >E : typeof E ->a : E ->E.b : E +>a : E.a +>E.b : E.b >E : typeof E ->b : E +>b : E.b var rj9 = E.a | 1; >rj9 : number >E.a | 1 : number ->E.a : E +>E.a : E.a >E : typeof E ->a : E ->1 : number +>a : E.a +>1 : 1 var rj10 = a | E.b; >rj10 : number >a | E.b : number >a : any ->E.b : E +>E.b : E.b >E : typeof E ->b : E +>b : E.b var rj11 = b | E.b; >rj11 : number >b | E.b : number >b : number ->E.b : E +>E.b : E.b >E : typeof E ->b : E +>b : E.b var rj12 = 1 | E.b; >rj12 : number >1 | E.b : number ->1 : number ->E.b : E +>1 : 1 +>E.b : E.b >E : typeof E ->b : E +>b : E.b diff --git a/tests/baselines/reference/arithmeticOperatorWithNullValueAndValidOperands.types b/tests/baselines/reference/arithmeticOperatorWithNullValueAndValidOperands.types index 521fb4d7313..78e2a5945f0 100644 --- a/tests/baselines/reference/arithmeticOperatorWithNullValueAndValidOperands.types +++ b/tests/baselines/reference/arithmeticOperatorWithNullValueAndValidOperands.types @@ -6,10 +6,10 @@ enum E { >E : E a, ->a : E +>a : E.a b ->b : E +>b : E.b } var a: any; @@ -35,15 +35,15 @@ var ra3 = null * 1; >ra3 : number >null * 1 : number >null : null ->1 : number +>1 : 1 var ra4 = null * E.a; >ra4 : number >null * E.a : number >null : null ->E.a : E +>E.a : E.a >E : typeof E ->a : E +>a : E.a var ra5 = a * null; >ra5 : number @@ -60,15 +60,15 @@ var ra6 = b * null; var ra7 = 0 * null; >ra7 : number >0 * null : number ->0 : number +>0 : 0 >null : null var ra8 = E.b * null; >ra8 : number >E.b * null : number ->E.b : E +>E.b : E.b >E : typeof E ->b : E +>b : E.b >null : null // operator / @@ -88,15 +88,15 @@ var rb3 = null / 1; >rb3 : number >null / 1 : number >null : null ->1 : number +>1 : 1 var rb4 = null / E.a; >rb4 : number >null / E.a : number >null : null ->E.a : E +>E.a : E.a >E : typeof E ->a : E +>a : E.a var rb5 = a / null; >rb5 : number @@ -113,15 +113,15 @@ var rb6 = b / null; var rb7 = 0 / null; >rb7 : number >0 / null : number ->0 : number +>0 : 0 >null : null var rb8 = E.b / null; >rb8 : number >E.b / null : number ->E.b : E +>E.b : E.b >E : typeof E ->b : E +>b : E.b >null : null // operator % @@ -141,15 +141,15 @@ var rc3 = null % 1; >rc3 : number >null % 1 : number >null : null ->1 : number +>1 : 1 var rc4 = null % E.a; >rc4 : number >null % E.a : number >null : null ->E.a : E +>E.a : E.a >E : typeof E ->a : E +>a : E.a var rc5 = a % null; >rc5 : number @@ -166,15 +166,15 @@ var rc6 = b % null; var rc7 = 0 % null; >rc7 : number >0 % null : number ->0 : number +>0 : 0 >null : null var rc8 = E.b % null; >rc8 : number >E.b % null : number ->E.b : E +>E.b : E.b >E : typeof E ->b : E +>b : E.b >null : null // operator - @@ -194,15 +194,15 @@ var rd3 = null - 1; >rd3 : number >null - 1 : number >null : null ->1 : number +>1 : 1 var rd4 = null - E.a; >rd4 : number >null - E.a : number >null : null ->E.a : E +>E.a : E.a >E : typeof E ->a : E +>a : E.a var rd5 = a - null; >rd5 : number @@ -219,15 +219,15 @@ var rd6 = b - null; var rd7 = 0 - null; >rd7 : number >0 - null : number ->0 : number +>0 : 0 >null : null var rd8 = E.b - null; >rd8 : number >E.b - null : number ->E.b : E +>E.b : E.b >E : typeof E ->b : E +>b : E.b >null : null // operator << @@ -247,15 +247,15 @@ var re3 = null << 1; >re3 : number >null << 1 : number >null : null ->1 : number +>1 : 1 var re4 = null << E.a; >re4 : number >null << E.a : number >null : null ->E.a : E +>E.a : E.a >E : typeof E ->a : E +>a : E.a var re5 = a << null; >re5 : number @@ -272,15 +272,15 @@ var re6 = b << null; var re7 = 0 << null; >re7 : number >0 << null : number ->0 : number +>0 : 0 >null : null var re8 = E.b << null; >re8 : number >E.b << null : number ->E.b : E +>E.b : E.b >E : typeof E ->b : E +>b : E.b >null : null // operator >> @@ -300,15 +300,15 @@ var rf3 = null >> 1; >rf3 : number >null >> 1 : number >null : null ->1 : number +>1 : 1 var rf4 = null >> E.a; >rf4 : number >null >> E.a : number >null : null ->E.a : E +>E.a : E.a >E : typeof E ->a : E +>a : E.a var rf5 = a >> null; >rf5 : number @@ -325,15 +325,15 @@ var rf6 = b >> null; var rf7 = 0 >> null; >rf7 : number >0 >> null : number ->0 : number +>0 : 0 >null : null var rf8 = E.b >> null; >rf8 : number >E.b >> null : number ->E.b : E +>E.b : E.b >E : typeof E ->b : E +>b : E.b >null : null // operator >>> @@ -353,15 +353,15 @@ var rg3 = null >>> 1; >rg3 : number >null >>> 1 : number >null : null ->1 : number +>1 : 1 var rg4 = null >>> E.a; >rg4 : number >null >>> E.a : number >null : null ->E.a : E +>E.a : E.a >E : typeof E ->a : E +>a : E.a var rg5 = a >>> null; >rg5 : number @@ -378,15 +378,15 @@ var rg6 = b >>> null; var rg7 = 0 >>> null; >rg7 : number >0 >>> null : number ->0 : number +>0 : 0 >null : null var rg8 = E.b >>> null; >rg8 : number >E.b >>> null : number ->E.b : E +>E.b : E.b >E : typeof E ->b : E +>b : E.b >null : null // operator & @@ -406,15 +406,15 @@ var rh3 = null & 1; >rh3 : number >null & 1 : number >null : null ->1 : number +>1 : 1 var rh4 = null & E.a; >rh4 : number >null & E.a : number >null : null ->E.a : E +>E.a : E.a >E : typeof E ->a : E +>a : E.a var rh5 = a & null; >rh5 : number @@ -431,15 +431,15 @@ var rh6 = b & null; var rh7 = 0 & null; >rh7 : number >0 & null : number ->0 : number +>0 : 0 >null : null var rh8 = E.b & null; >rh8 : number >E.b & null : number ->E.b : E +>E.b : E.b >E : typeof E ->b : E +>b : E.b >null : null // operator ^ @@ -459,15 +459,15 @@ var ri3 = null ^ 1; >ri3 : number >null ^ 1 : number >null : null ->1 : number +>1 : 1 var ri4 = null ^ E.a; >ri4 : number >null ^ E.a : number >null : null ->E.a : E +>E.a : E.a >E : typeof E ->a : E +>a : E.a var ri5 = a ^ null; >ri5 : number @@ -484,15 +484,15 @@ var ri6 = b ^ null; var ri7 = 0 ^ null; >ri7 : number >0 ^ null : number ->0 : number +>0 : 0 >null : null var ri8 = E.b ^ null; >ri8 : number >E.b ^ null : number ->E.b : E +>E.b : E.b >E : typeof E ->b : E +>b : E.b >null : null // operator | @@ -512,15 +512,15 @@ var rj3 = null | 1; >rj3 : number >null | 1 : number >null : null ->1 : number +>1 : 1 var rj4 = null | E.a; >rj4 : number >null | E.a : number >null : null ->E.a : E +>E.a : E.a >E : typeof E ->a : E +>a : E.a var rj5 = a | null; >rj5 : number @@ -537,14 +537,14 @@ var rj6 = b | null; var rj7 = 0 | null; >rj7 : number >0 | null : number ->0 : number +>0 : 0 >null : null var rj8 = E.b | null; >rj8 : number >E.b | null : number ->E.b : E +>E.b : E.b >E : typeof E ->b : E +>b : E.b >null : null diff --git a/tests/baselines/reference/arithmeticOperatorWithUndefinedValueAndValidOperands.types b/tests/baselines/reference/arithmeticOperatorWithUndefinedValueAndValidOperands.types index 77dbe1c1441..2a714a35210 100644 --- a/tests/baselines/reference/arithmeticOperatorWithUndefinedValueAndValidOperands.types +++ b/tests/baselines/reference/arithmeticOperatorWithUndefinedValueAndValidOperands.types @@ -6,10 +6,10 @@ enum E { >E : E a, ->a : E +>a : E.a b ->b : E +>b : E.b } var a: any; @@ -35,15 +35,15 @@ var ra3 = undefined * 1; >ra3 : number >undefined * 1 : number >undefined : undefined ->1 : number +>1 : 1 var ra4 = undefined * E.a; >ra4 : number >undefined * E.a : number >undefined : undefined ->E.a : E +>E.a : E.a >E : typeof E ->a : E +>a : E.a var ra5 = a * undefined; >ra5 : number @@ -60,15 +60,15 @@ var ra6 = b * undefined; var ra7 = 0 * undefined; >ra7 : number >0 * undefined : number ->0 : number +>0 : 0 >undefined : undefined var ra8 = E.b * undefined; >ra8 : number >E.b * undefined : number ->E.b : E +>E.b : E.b >E : typeof E ->b : E +>b : E.b >undefined : undefined // operator / @@ -88,15 +88,15 @@ var rb3 = undefined / 1; >rb3 : number >undefined / 1 : number >undefined : undefined ->1 : number +>1 : 1 var rb4 = undefined / E.a; >rb4 : number >undefined / E.a : number >undefined : undefined ->E.a : E +>E.a : E.a >E : typeof E ->a : E +>a : E.a var rb5 = a / undefined; >rb5 : number @@ -113,15 +113,15 @@ var rb6 = b / undefined; var rb7 = 0 / undefined; >rb7 : number >0 / undefined : number ->0 : number +>0 : 0 >undefined : undefined var rb8 = E.b / undefined; >rb8 : number >E.b / undefined : number ->E.b : E +>E.b : E.b >E : typeof E ->b : E +>b : E.b >undefined : undefined // operator % @@ -141,15 +141,15 @@ var rc3 = undefined % 1; >rc3 : number >undefined % 1 : number >undefined : undefined ->1 : number +>1 : 1 var rc4 = undefined % E.a; >rc4 : number >undefined % E.a : number >undefined : undefined ->E.a : E +>E.a : E.a >E : typeof E ->a : E +>a : E.a var rc5 = a % undefined; >rc5 : number @@ -166,15 +166,15 @@ var rc6 = b % undefined; var rc7 = 0 % undefined; >rc7 : number >0 % undefined : number ->0 : number +>0 : 0 >undefined : undefined var rc8 = E.b % undefined; >rc8 : number >E.b % undefined : number ->E.b : E +>E.b : E.b >E : typeof E ->b : E +>b : E.b >undefined : undefined // operator - @@ -194,15 +194,15 @@ var rd3 = undefined - 1; >rd3 : number >undefined - 1 : number >undefined : undefined ->1 : number +>1 : 1 var rd4 = undefined - E.a; >rd4 : number >undefined - E.a : number >undefined : undefined ->E.a : E +>E.a : E.a >E : typeof E ->a : E +>a : E.a var rd5 = a - undefined; >rd5 : number @@ -219,15 +219,15 @@ var rd6 = b - undefined; var rd7 = 0 - undefined; >rd7 : number >0 - undefined : number ->0 : number +>0 : 0 >undefined : undefined var rd8 = E.b - undefined; >rd8 : number >E.b - undefined : number ->E.b : E +>E.b : E.b >E : typeof E ->b : E +>b : E.b >undefined : undefined // operator << @@ -247,15 +247,15 @@ var re3 = undefined << 1; >re3 : number >undefined << 1 : number >undefined : undefined ->1 : number +>1 : 1 var re4 = undefined << E.a; >re4 : number >undefined << E.a : number >undefined : undefined ->E.a : E +>E.a : E.a >E : typeof E ->a : E +>a : E.a var re5 = a << undefined; >re5 : number @@ -272,15 +272,15 @@ var re6 = b << undefined; var re7 = 0 << undefined; >re7 : number >0 << undefined : number ->0 : number +>0 : 0 >undefined : undefined var re8 = E.b << undefined; >re8 : number >E.b << undefined : number ->E.b : E +>E.b : E.b >E : typeof E ->b : E +>b : E.b >undefined : undefined // operator >> @@ -300,15 +300,15 @@ var rf3 = undefined >> 1; >rf3 : number >undefined >> 1 : number >undefined : undefined ->1 : number +>1 : 1 var rf4 = undefined >> E.a; >rf4 : number >undefined >> E.a : number >undefined : undefined ->E.a : E +>E.a : E.a >E : typeof E ->a : E +>a : E.a var rf5 = a >> undefined; >rf5 : number @@ -325,15 +325,15 @@ var rf6 = b >> undefined; var rf7 = 0 >> undefined; >rf7 : number >0 >> undefined : number ->0 : number +>0 : 0 >undefined : undefined var rf8 = E.b >> undefined; >rf8 : number >E.b >> undefined : number ->E.b : E +>E.b : E.b >E : typeof E ->b : E +>b : E.b >undefined : undefined // operator >>> @@ -353,15 +353,15 @@ var rg3 = undefined >>> 1; >rg3 : number >undefined >>> 1 : number >undefined : undefined ->1 : number +>1 : 1 var rg4 = undefined >>> E.a; >rg4 : number >undefined >>> E.a : number >undefined : undefined ->E.a : E +>E.a : E.a >E : typeof E ->a : E +>a : E.a var rg5 = a >>> undefined; >rg5 : number @@ -378,15 +378,15 @@ var rg6 = b >>> undefined; var rg7 = 0 >>> undefined; >rg7 : number >0 >>> undefined : number ->0 : number +>0 : 0 >undefined : undefined var rg8 = E.b >>> undefined; >rg8 : number >E.b >>> undefined : number ->E.b : E +>E.b : E.b >E : typeof E ->b : E +>b : E.b >undefined : undefined // operator & @@ -406,15 +406,15 @@ var rh3 = undefined & 1; >rh3 : number >undefined & 1 : number >undefined : undefined ->1 : number +>1 : 1 var rh4 = undefined & E.a; >rh4 : number >undefined & E.a : number >undefined : undefined ->E.a : E +>E.a : E.a >E : typeof E ->a : E +>a : E.a var rh5 = a & undefined; >rh5 : number @@ -431,15 +431,15 @@ var rh6 = b & undefined; var rh7 = 0 & undefined; >rh7 : number >0 & undefined : number ->0 : number +>0 : 0 >undefined : undefined var rh8 = E.b & undefined; >rh8 : number >E.b & undefined : number ->E.b : E +>E.b : E.b >E : typeof E ->b : E +>b : E.b >undefined : undefined // operator ^ @@ -459,15 +459,15 @@ var ri3 = undefined ^ 1; >ri3 : number >undefined ^ 1 : number >undefined : undefined ->1 : number +>1 : 1 var ri4 = undefined ^ E.a; >ri4 : number >undefined ^ E.a : number >undefined : undefined ->E.a : E +>E.a : E.a >E : typeof E ->a : E +>a : E.a var ri5 = a ^ undefined; >ri5 : number @@ -484,15 +484,15 @@ var ri6 = b ^ undefined; var ri7 = 0 ^ undefined; >ri7 : number >0 ^ undefined : number ->0 : number +>0 : 0 >undefined : undefined var ri8 = E.b ^ undefined; >ri8 : number >E.b ^ undefined : number ->E.b : E +>E.b : E.b >E : typeof E ->b : E +>b : E.b >undefined : undefined // operator | @@ -512,15 +512,15 @@ var rj3 = undefined | 1; >rj3 : number >undefined | 1 : number >undefined : undefined ->1 : number +>1 : 1 var rj4 = undefined | E.a; >rj4 : number >undefined | E.a : number >undefined : undefined ->E.a : E +>E.a : E.a >E : typeof E ->a : E +>a : E.a var rj5 = a | undefined; >rj5 : number @@ -537,14 +537,14 @@ var rj6 = b | undefined; var rj7 = 0 | undefined; >rj7 : number >0 | undefined : number ->0 : number +>0 : 0 >undefined : undefined var rj8 = E.b | undefined; >rj8 : number >E.b | undefined : number ->E.b : E +>E.b : E.b >E : typeof E ->b : E +>b : E.b >undefined : undefined diff --git a/tests/baselines/reference/arrayAugment.types b/tests/baselines/reference/arrayAugment.types index 042b7265ec8..6d4e5a70a51 100644 --- a/tests/baselines/reference/arrayAugment.types +++ b/tests/baselines/reference/arrayAugment.types @@ -12,7 +12,7 @@ interface Array { var x = ['']; >x : string[] >[''] : string[] ->'' : string +>'' : "" var y = x.split(4); >y : string[][] @@ -20,7 +20,7 @@ var y = x.split(4); >x.split : (parts: number) => string[][] >x : string[] >split : (parts: number) => string[][] ->4 : number +>4 : 4 var y: string[][]; // Expect no error here >y : string[][] diff --git a/tests/baselines/reference/arrayBestCommonTypes.types b/tests/baselines/reference/arrayBestCommonTypes.types index 2e87dc2ca15..864b1adfacb 100644 --- a/tests/baselines/reference/arrayBestCommonTypes.types +++ b/tests/baselines/reference/arrayBestCommonTypes.types @@ -40,7 +40,7 @@ module EmptyTypes { >voidIfAny : { (x: boolean, y?: boolean): number; (x: string, y?: boolean): number; (x: number, y?: boolean): number; } >x : any >y : boolean ->false : boolean +>false : false >null : null public x() { @@ -55,9 +55,9 @@ module EmptyTypes { >voidIfAny : { (x: boolean, y?: boolean): number; (x: string, y?: boolean): number; (x: number, y?: boolean): number; } >[4, 2][0] : number >[4, 2] : number[] ->4 : number ->2 : number ->0 : number +>4 : 4 +>2 : 2 +>0 : 0 (this.voidIfAny([4, 2, undefined][0])); >(this.voidIfAny([4, 2, undefined][0])) : number @@ -68,10 +68,10 @@ module EmptyTypes { >voidIfAny : { (x: boolean, y?: boolean): number; (x: string, y?: boolean): number; (x: number, y?: boolean): number; } >[4, 2, undefined][0] : number >[4, 2, undefined] : number[] ->4 : number ->2 : number +>4 : 4 +>2 : 2 >undefined : undefined ->0 : number +>0 : 0 (this.voidIfAny([undefined, 2, 4][0])); >(this.voidIfAny([undefined, 2, 4][0])) : number @@ -83,9 +83,9 @@ module EmptyTypes { >[undefined, 2, 4][0] : number >[undefined, 2, 4] : number[] >undefined : undefined ->2 : number ->4 : number ->0 : number +>2 : 2 +>4 : 4 +>0 : 0 (this.voidIfAny([null, 2, 4][0])); >(this.voidIfAny([null, 2, 4][0])) : number @@ -97,9 +97,9 @@ module EmptyTypes { >[null, 2, 4][0] : number >[null, 2, 4] : number[] >null : null ->2 : number ->4 : number ->0 : number +>2 : 2 +>4 : 4 +>0 : 0 (this.voidIfAny([2, 4, null][0])); >(this.voidIfAny([2, 4, null][0])) : number @@ -110,10 +110,10 @@ module EmptyTypes { >voidIfAny : { (x: boolean, y?: boolean): number; (x: string, y?: boolean): number; (x: number, y?: boolean): number; } >[2, 4, null][0] : number >[2, 4, null] : number[] ->2 : number ->4 : number +>2 : 2 +>4 : 4 >null : null ->0 : number +>0 : 0 (this.voidIfAny([undefined, 4, null][0])); >(this.voidIfAny([undefined, 4, null][0])) : number @@ -125,9 +125,9 @@ module EmptyTypes { >[undefined, 4, null][0] : number >[undefined, 4, null] : number[] >undefined : undefined ->4 : number +>4 : 4 >null : null ->0 : number +>0 : 0 (this.voidIfAny(['', "q"][0])); >(this.voidIfAny(['', "q"][0])) : number @@ -138,9 +138,9 @@ module EmptyTypes { >voidIfAny : { (x: boolean, y?: boolean): number; (x: string, y?: boolean): number; (x: number, y?: boolean): number; } >['', "q"][0] : string >['', "q"] : string[] ->'' : string ->"q" : string ->0 : number +>'' : "" +>"q" : "q" +>0 : 0 (this.voidIfAny(['', "q", undefined][0])); >(this.voidIfAny(['', "q", undefined][0])) : number @@ -151,10 +151,10 @@ module EmptyTypes { >voidIfAny : { (x: boolean, y?: boolean): number; (x: string, y?: boolean): number; (x: number, y?: boolean): number; } >['', "q", undefined][0] : string >['', "q", undefined] : string[] ->'' : string ->"q" : string +>'' : "" +>"q" : "q" >undefined : undefined ->0 : number +>0 : 0 (this.voidIfAny([undefined, "q", ''][0])); >(this.voidIfAny([undefined, "q", ''][0])) : number @@ -166,9 +166,9 @@ module EmptyTypes { >[undefined, "q", ''][0] : string >[undefined, "q", ''] : string[] >undefined : undefined ->"q" : string ->'' : string ->0 : number +>"q" : "q" +>'' : "" +>0 : 0 (this.voidIfAny([null, "q", ''][0])); >(this.voidIfAny([null, "q", ''][0])) : number @@ -180,9 +180,9 @@ module EmptyTypes { >[null, "q", ''][0] : string >[null, "q", ''] : string[] >null : null ->"q" : string ->'' : string ->0 : number +>"q" : "q" +>'' : "" +>0 : 0 (this.voidIfAny(["q", '', null][0])); >(this.voidIfAny(["q", '', null][0])) : number @@ -193,10 +193,10 @@ module EmptyTypes { >voidIfAny : { (x: boolean, y?: boolean): number; (x: string, y?: boolean): number; (x: number, y?: boolean): number; } >["q", '', null][0] : string >["q", '', null] : string[] ->"q" : string ->'' : string +>"q" : "q" +>'' : "" >null : null ->0 : number +>0 : 0 (this.voidIfAny([undefined, '', null][0])); >(this.voidIfAny([undefined, '', null][0])) : number @@ -208,9 +208,9 @@ module EmptyTypes { >[undefined, '', null][0] : string >[undefined, '', null] : string[] >undefined : undefined ->'' : string +>'' : "" >null : null ->0 : number +>0 : 0 (this.voidIfAny([[3, 4], [null]][0][0])); >(this.voidIfAny([[3, 4], [null]][0][0])) : number @@ -223,12 +223,12 @@ module EmptyTypes { >[[3, 4], [null]][0] : number[] >[[3, 4], [null]] : number[][] >[3, 4] : number[] ->3 : number ->4 : number +>3 : 3 +>4 : 4 >[null] : null[] >null : null ->0 : number ->0 : number +>0 : 0 +>0 : 0 var t1: { x: number; y: base; }[] = [{ x: 7, y: new derived() }, { x: 5, y: new base() }]; @@ -239,13 +239,13 @@ module EmptyTypes { >[{ x: 7, y: new derived() }, { x: 5, y: new base() }] : { x: number; y: derived; }[] >{ x: 7, y: new derived() } : { x: number; y: derived; } >x : number ->7 : number +>7 : 7 >y : derived >new derived() : derived >derived : typeof derived >{ x: 5, y: new base() } : { x: number; y: base; } >x : number ->5 : number +>5 : 5 >y : base >new base() : base >base : typeof base @@ -255,16 +255,16 @@ module EmptyTypes { >x : boolean >y : base >base : base ->[{ x: true, y: new derived() }, { x: false, y: new base() }] : { x: boolean; y: derived; }[] ->{ x: true, y: new derived() } : { x: boolean; y: derived; } +>[{ x: true, y: new derived() }, { x: false, y: new base() }] : ({ x: true; y: derived; } | { x: false; y: base; })[] +>{ x: true, y: new derived() } : { x: true; y: derived; } >x : boolean ->true : boolean +>true : true >y : derived >new derived() : derived >derived : typeof derived ->{ x: false, y: new base() } : { x: boolean; y: base; } +>{ x: false, y: new base() } : { x: false; y: base; } >x : boolean ->false : boolean +>false : false >y : base >new base() : base >base : typeof base @@ -283,7 +283,7 @@ module EmptyTypes { >base : typeof base >{ x: '', y: new derived() } : { x: string; y: derived; } >x : string ->'' : string +>'' : "" >y : derived >new derived() : derived >derived : typeof derived @@ -298,19 +298,19 @@ module EmptyTypes { >[{ x: 0, y: 'a' }, { x: 'a', y: 'a' }, { x: anyObj, y: 'a' }] : { x: any; y: string; }[] >{ x: 0, y: 'a' } : { x: number; y: string; } >x : number ->0 : number +>0 : 0 >y : string ->'a' : string +>'a' : "a" >{ x: 'a', y: 'a' } : { x: string; y: string; } >x : string ->'a' : string +>'a' : "a" >y : string ->'a' : string +>'a' : "a" >{ x: anyObj, y: 'a' } : { x: any; y: string; } >x : any >anyObj : any >y : string ->'a' : string +>'a' : "a" var a2 = [{ x: anyObj, y: 'a' }, { x: 0, y: 'a' }, { x: 'a', y: 'a' }]; >a2 : { x: any; y: string; }[] @@ -319,36 +319,36 @@ module EmptyTypes { >x : any >anyObj : any >y : string ->'a' : string +>'a' : "a" >{ x: 0, y: 'a' } : { x: number; y: string; } >x : number ->0 : number +>0 : 0 >y : string ->'a' : string +>'a' : "a" >{ x: 'a', y: 'a' } : { x: string; y: string; } >x : string ->'a' : string +>'a' : "a" >y : string ->'a' : string +>'a' : "a" var a3 = [{ x: 0, y: 'a' }, { x: anyObj, y: 'a' }, { x: 'a', y: 'a' }]; >a3 : { x: any; y: string; }[] >[{ x: 0, y: 'a' }, { x: anyObj, y: 'a' }, { x: 'a', y: 'a' }] : { x: any; y: string; }[] >{ x: 0, y: 'a' } : { x: number; y: string; } >x : number ->0 : number +>0 : 0 >y : string ->'a' : string +>'a' : "a" >{ x: anyObj, y: 'a' } : { x: any; y: string; } >x : any >anyObj : any >y : string ->'a' : string +>'a' : "a" >{ x: 'a', y: 'a' } : { x: string; y: string; } >x : string ->'a' : string +>'a' : "a" >y : string ->'a' : string +>'a' : "a" var ifaceObj: iface = null; >ifaceObj : iface @@ -443,7 +443,7 @@ module NonEmptyTypes { >voidIfAny : { (x: boolean, y?: boolean): number; (x: string, y?: boolean): number; (x: number, y?: boolean): number; } >x : any >y : boolean ->false : boolean +>false : false >null : null public x() { @@ -458,9 +458,9 @@ module NonEmptyTypes { >voidIfAny : { (x: boolean, y?: boolean): number; (x: string, y?: boolean): number; (x: number, y?: boolean): number; } >[4, 2][0] : number >[4, 2] : number[] ->4 : number ->2 : number ->0 : number +>4 : 4 +>2 : 2 +>0 : 0 (this.voidIfAny([4, 2, undefined][0])); >(this.voidIfAny([4, 2, undefined][0])) : number @@ -471,10 +471,10 @@ module NonEmptyTypes { >voidIfAny : { (x: boolean, y?: boolean): number; (x: string, y?: boolean): number; (x: number, y?: boolean): number; } >[4, 2, undefined][0] : number >[4, 2, undefined] : number[] ->4 : number ->2 : number +>4 : 4 +>2 : 2 >undefined : undefined ->0 : number +>0 : 0 (this.voidIfAny([undefined, 2, 4][0])); >(this.voidIfAny([undefined, 2, 4][0])) : number @@ -486,9 +486,9 @@ module NonEmptyTypes { >[undefined, 2, 4][0] : number >[undefined, 2, 4] : number[] >undefined : undefined ->2 : number ->4 : number ->0 : number +>2 : 2 +>4 : 4 +>0 : 0 (this.voidIfAny([null, 2, 4][0])); >(this.voidIfAny([null, 2, 4][0])) : number @@ -500,9 +500,9 @@ module NonEmptyTypes { >[null, 2, 4][0] : number >[null, 2, 4] : number[] >null : null ->2 : number ->4 : number ->0 : number +>2 : 2 +>4 : 4 +>0 : 0 (this.voidIfAny([2, 4, null][0])); >(this.voidIfAny([2, 4, null][0])) : number @@ -513,10 +513,10 @@ module NonEmptyTypes { >voidIfAny : { (x: boolean, y?: boolean): number; (x: string, y?: boolean): number; (x: number, y?: boolean): number; } >[2, 4, null][0] : number >[2, 4, null] : number[] ->2 : number ->4 : number +>2 : 2 +>4 : 4 >null : null ->0 : number +>0 : 0 (this.voidIfAny([undefined, 4, null][0])); >(this.voidIfAny([undefined, 4, null][0])) : number @@ -528,9 +528,9 @@ module NonEmptyTypes { >[undefined, 4, null][0] : number >[undefined, 4, null] : number[] >undefined : undefined ->4 : number +>4 : 4 >null : null ->0 : number +>0 : 0 (this.voidIfAny(['', "q"][0])); >(this.voidIfAny(['', "q"][0])) : number @@ -541,9 +541,9 @@ module NonEmptyTypes { >voidIfAny : { (x: boolean, y?: boolean): number; (x: string, y?: boolean): number; (x: number, y?: boolean): number; } >['', "q"][0] : string >['', "q"] : string[] ->'' : string ->"q" : string ->0 : number +>'' : "" +>"q" : "q" +>0 : 0 (this.voidIfAny(['', "q", undefined][0])); >(this.voidIfAny(['', "q", undefined][0])) : number @@ -554,10 +554,10 @@ module NonEmptyTypes { >voidIfAny : { (x: boolean, y?: boolean): number; (x: string, y?: boolean): number; (x: number, y?: boolean): number; } >['', "q", undefined][0] : string >['', "q", undefined] : string[] ->'' : string ->"q" : string +>'' : "" +>"q" : "q" >undefined : undefined ->0 : number +>0 : 0 (this.voidIfAny([undefined, "q", ''][0])); >(this.voidIfAny([undefined, "q", ''][0])) : number @@ -569,9 +569,9 @@ module NonEmptyTypes { >[undefined, "q", ''][0] : string >[undefined, "q", ''] : string[] >undefined : undefined ->"q" : string ->'' : string ->0 : number +>"q" : "q" +>'' : "" +>0 : 0 (this.voidIfAny([null, "q", ''][0])); >(this.voidIfAny([null, "q", ''][0])) : number @@ -583,9 +583,9 @@ module NonEmptyTypes { >[null, "q", ''][0] : string >[null, "q", ''] : string[] >null : null ->"q" : string ->'' : string ->0 : number +>"q" : "q" +>'' : "" +>0 : 0 (this.voidIfAny(["q", '', null][0])); >(this.voidIfAny(["q", '', null][0])) : number @@ -596,10 +596,10 @@ module NonEmptyTypes { >voidIfAny : { (x: boolean, y?: boolean): number; (x: string, y?: boolean): number; (x: number, y?: boolean): number; } >["q", '', null][0] : string >["q", '', null] : string[] ->"q" : string ->'' : string +>"q" : "q" +>'' : "" >null : null ->0 : number +>0 : 0 (this.voidIfAny([undefined, '', null][0])); >(this.voidIfAny([undefined, '', null][0])) : number @@ -611,9 +611,9 @@ module NonEmptyTypes { >[undefined, '', null][0] : string >[undefined, '', null] : string[] >undefined : undefined ->'' : string +>'' : "" >null : null ->0 : number +>0 : 0 (this.voidIfAny([[3, 4], [null]][0][0])); >(this.voidIfAny([[3, 4], [null]][0][0])) : number @@ -626,12 +626,12 @@ module NonEmptyTypes { >[[3, 4], [null]][0] : number[] >[[3, 4], [null]] : number[][] >[3, 4] : number[] ->3 : number ->4 : number +>3 : 3 +>4 : 4 >[null] : null[] >null : null ->0 : number ->0 : number +>0 : 0 +>0 : 0 var t1: { x: number; y: base; }[] = [{ x: 7, y: new derived() }, { x: 5, y: new base() }]; @@ -642,13 +642,13 @@ module NonEmptyTypes { >[{ x: 7, y: new derived() }, { x: 5, y: new base() }] : { x: number; y: base; }[] >{ x: 7, y: new derived() } : { x: number; y: derived; } >x : number ->7 : number +>7 : 7 >y : derived >new derived() : derived >derived : typeof derived >{ x: 5, y: new base() } : { x: number; y: base; } >x : number ->5 : number +>5 : 5 >y : base >new base() : base >base : typeof base @@ -658,16 +658,16 @@ module NonEmptyTypes { >x : boolean >y : base >base : base ->[{ x: true, y: new derived() }, { x: false, y: new base() }] : { x: boolean; y: base; }[] ->{ x: true, y: new derived() } : { x: boolean; y: derived; } +>[{ x: true, y: new derived() }, { x: false, y: new base() }] : ({ x: true; y: derived; } | { x: false; y: base; })[] +>{ x: true, y: new derived() } : { x: true; y: derived; } >x : boolean ->true : boolean +>true : true >y : derived >new derived() : derived >derived : typeof derived ->{ x: false, y: new base() } : { x: boolean; y: base; } +>{ x: false, y: new base() } : { x: false; y: base; } >x : boolean ->false : boolean +>false : false >y : base >new base() : base >base : typeof base @@ -686,7 +686,7 @@ module NonEmptyTypes { >base : typeof base >{ x: '', y: new derived() } : { x: string; y: derived; } >x : string ->'' : string +>'' : "" >y : derived >new derived() : derived >derived : typeof derived @@ -701,19 +701,19 @@ module NonEmptyTypes { >[{ x: 0, y: 'a' }, { x: 'a', y: 'a' }, { x: anyObj, y: 'a' }] : { x: any; y: string; }[] >{ x: 0, y: 'a' } : { x: number; y: string; } >x : number ->0 : number +>0 : 0 >y : string ->'a' : string +>'a' : "a" >{ x: 'a', y: 'a' } : { x: string; y: string; } >x : string ->'a' : string +>'a' : "a" >y : string ->'a' : string +>'a' : "a" >{ x: anyObj, y: 'a' } : { x: any; y: string; } >x : any >anyObj : any >y : string ->'a' : string +>'a' : "a" var a2 = [{ x: anyObj, y: 'a' }, { x: 0, y: 'a' }, { x: 'a', y: 'a' }]; >a2 : { x: any; y: string; }[] @@ -722,36 +722,36 @@ module NonEmptyTypes { >x : any >anyObj : any >y : string ->'a' : string +>'a' : "a" >{ x: 0, y: 'a' } : { x: number; y: string; } >x : number ->0 : number +>0 : 0 >y : string ->'a' : string +>'a' : "a" >{ x: 'a', y: 'a' } : { x: string; y: string; } >x : string ->'a' : string +>'a' : "a" >y : string ->'a' : string +>'a' : "a" var a3 = [{ x: 0, y: 'a' }, { x: anyObj, y: 'a' }, { x: 'a', y: 'a' }]; >a3 : { x: any; y: string; }[] >[{ x: 0, y: 'a' }, { x: anyObj, y: 'a' }, { x: 'a', y: 'a' }] : { x: any; y: string; }[] >{ x: 0, y: 'a' } : { x: number; y: string; } >x : number ->0 : number +>0 : 0 >y : string ->'a' : string +>'a' : "a" >{ x: anyObj, y: 'a' } : { x: any; y: string; } >x : any >anyObj : any >y : string ->'a' : string +>'a' : "a" >{ x: 'a', y: 'a' } : { x: string; y: string; } >x : string ->'a' : string +>'a' : "a" >y : string ->'a' : string +>'a' : "a" var ifaceObj: iface = null; >ifaceObj : iface diff --git a/tests/baselines/reference/arrayBindingPatternOmittedExpressions.types b/tests/baselines/reference/arrayBindingPatternOmittedExpressions.types index 77db8cc250d..38649f2b02d 100644 --- a/tests/baselines/reference/arrayBindingPatternOmittedExpressions.types +++ b/tests/baselines/reference/arrayBindingPatternOmittedExpressions.types @@ -43,12 +43,12 @@ function f([, a, , b, , , , s, , , ] = results) { >a : string >s[1] : string >s : string ->1 : number +>1 : 1 b = s[2]; >b = s[2] : string >b : string >s[2] : string >s : string ->2 : number +>2 : 2 } diff --git a/tests/baselines/reference/arrayConcat2.types b/tests/baselines/reference/arrayConcat2.types index 27fe754c485..7687c5ed8fe 100644 --- a/tests/baselines/reference/arrayConcat2.types +++ b/tests/baselines/reference/arrayConcat2.types @@ -8,15 +8,15 @@ a.concat("hello", 'world'); >a.concat : { (...items: string[][]): string[]; (...items: (string | string[])[]): string[]; } >a : string[] >concat : { (...items: string[][]): string[]; (...items: (string | string[])[]): string[]; } ->"hello" : string ->'world' : string +>"hello" : "hello" +>'world' : "world" a.concat('Hello'); >a.concat('Hello') : string[] >a.concat : { (...items: string[][]): string[]; (...items: (string | string[])[]): string[]; } >a : string[] >concat : { (...items: string[][]): string[]; (...items: (string | string[])[]): string[]; } ->'Hello' : string +>'Hello' : "Hello" var b = new Array(); >b : string[] @@ -28,5 +28,5 @@ b.concat('hello'); >b.concat : { (...items: string[][]): string[]; (...items: (string | string[])[]): string[]; } >b : string[] >concat : { (...items: string[][]): string[]; (...items: (string | string[])[]): string[]; } ->'hello' : string +>'hello' : "hello" diff --git a/tests/baselines/reference/arrayConcatMap.types b/tests/baselines/reference/arrayConcatMap.types index 647406ef1c3..89289e58d4e 100644 --- a/tests/baselines/reference/arrayConcatMap.types +++ b/tests/baselines/reference/arrayConcatMap.types @@ -10,11 +10,11 @@ var x = [].concat([{ a: 1 }], [{ a: 2 }]) >[{ a: 1 }] : { a: number; }[] >{ a: 1 } : { a: number; } >a : number ->1 : number +>1 : 1 >[{ a: 2 }] : { a: number; }[] >{ a: 2 } : { a: number; } >a : number ->2 : number +>2 : 2 .map(b => b.a); >map : (callbackfn: (value: any, index: number, array: any[]) => U, thisArg?: any) => U[] diff --git a/tests/baselines/reference/arrayConstructors1.types b/tests/baselines/reference/arrayConstructors1.types index 89807cd0348..c5a49e56f90 100644 --- a/tests/baselines/reference/arrayConstructors1.types +++ b/tests/baselines/reference/arrayConstructors1.types @@ -7,23 +7,23 @@ x = new Array(1); >x : string[] >new Array(1) : any[] >Array : ArrayConstructor ->1 : number +>1 : 1 x = new Array('hi', 'bye'); >x = new Array('hi', 'bye') : string[] >x : string[] >new Array('hi', 'bye') : string[] >Array : ArrayConstructor ->'hi' : string ->'bye' : string +>'hi' : "hi" +>'bye' : "bye" x = new Array('hi', 'bye'); >x = new Array('hi', 'bye') : string[] >x : string[] >new Array('hi', 'bye') : string[] >Array : ArrayConstructor ->'hi' : string ->'bye' : string +>'hi' : "hi" +>'bye' : "bye" var y: number[]; >y : number[] @@ -33,21 +33,21 @@ y = new Array(1); >y : number[] >new Array(1) : any[] >Array : ArrayConstructor ->1 : number +>1 : 1 y = new Array(1,2); >y = new Array(1,2) : number[] >y : number[] >new Array(1,2) : number[] >Array : ArrayConstructor ->1 : number ->2 : number +>1 : 1 +>2 : 2 y = new Array(1, 2); >y = new Array(1, 2) : number[] >y : number[] >new Array(1, 2) : number[] >Array : ArrayConstructor ->1 : number ->2 : number +>1 : 1 +>2 : 2 diff --git a/tests/baselines/reference/arrayFilter.types b/tests/baselines/reference/arrayFilter.types index f3d6d421744..43ef4161a06 100644 --- a/tests/baselines/reference/arrayFilter.types +++ b/tests/baselines/reference/arrayFilter.types @@ -6,7 +6,7 @@ var foo = [ { name: 'bar' }, >{ name: 'bar' } : { name: string; } >name : string ->'bar' : string +>'bar' : "bar" { name: null }, >{ name: null } : { name: null; } @@ -16,7 +16,7 @@ var foo = [ { name: 'baz' } >{ name: 'baz' } : { name: string; } >name : string ->'baz' : string +>'baz' : "baz" ] diff --git a/tests/baselines/reference/arrayLiteral.types b/tests/baselines/reference/arrayLiteral.types index a7b915de79d..c36cc93c68e 100644 --- a/tests/baselines/reference/arrayLiteral.types +++ b/tests/baselines/reference/arrayLiteral.types @@ -9,18 +9,18 @@ var x = new Array(1); >x : any[] >new Array(1) : any[] >Array : ArrayConstructor ->1 : number +>1 : 1 var y = [1]; >y : number[] >[1] : number[] ->1 : number +>1 : 1 var y = [1, 2]; >y : number[] >[1, 2] : number[] ->1 : number ->2 : number +>1 : 1 +>2 : 2 var y = new Array(); >y : number[] @@ -35,18 +35,18 @@ var x2: number[] = new Array(1); >x2 : number[] >new Array(1) : any[] >Array : ArrayConstructor ->1 : number +>1 : 1 var y2: number[] = [1]; >y2 : number[] >[1] : number[] ->1 : number +>1 : 1 var y2: number[] = [1, 2]; >y2 : number[] >[1, 2] : number[] ->1 : number ->2 : number +>1 : 1 +>2 : 2 var y2: number[] = new Array(); >y2 : number[] diff --git a/tests/baselines/reference/arrayLiteral1.types b/tests/baselines/reference/arrayLiteral1.types index eb83fa87035..e0ee33c1ef4 100644 --- a/tests/baselines/reference/arrayLiteral1.types +++ b/tests/baselines/reference/arrayLiteral1.types @@ -2,6 +2,6 @@ var v30 = [1, 2]; >v30 : number[] >[1, 2] : number[] ->1 : number ->2 : number +>1 : 1 +>2 : 2 diff --git a/tests/baselines/reference/arrayLiteral2.types b/tests/baselines/reference/arrayLiteral2.types index 1c3c81117d9..5bbc2f4fce8 100644 --- a/tests/baselines/reference/arrayLiteral2.types +++ b/tests/baselines/reference/arrayLiteral2.types @@ -2,7 +2,7 @@ var v30 = [1, 2], v31; >v30 : number[] >[1, 2] : number[] ->1 : number ->2 : number +>1 : 1 +>2 : 2 >v31 : any diff --git a/tests/baselines/reference/arrayLiteralComments.types b/tests/baselines/reference/arrayLiteralComments.types index e1863516792..80199c0f808 100644 --- a/tests/baselines/reference/arrayLiteralComments.types +++ b/tests/baselines/reference/arrayLiteralComments.types @@ -9,28 +9,28 @@ var testArrayWithFunc = [ let x = 1; >x : number ->1 : number +>1 : 1 }, // String comment '1', ->'1' : string +>'1' : "1" // Numeric comment 2, ->2 : number +>2 : 2 // Object comment { a: 1 }, >{ a: 1 } : { a: number; } >a : number ->1 : number +>1 : 1 // Array comment [1, 2, 3] >[1, 2, 3] : number[] ->1 : number ->2 : number ->3 : number +>1 : 1 +>2 : 2 +>3 : 3 ] diff --git a/tests/baselines/reference/arrayLiteralContextualType.types b/tests/baselines/reference/arrayLiteralContextualType.types index 0513908929e..f9d65aa2dff 100644 --- a/tests/baselines/reference/arrayLiteralContextualType.types +++ b/tests/baselines/reference/arrayLiteralContextualType.types @@ -11,11 +11,11 @@ class Giraffe { name = "Giraffe"; >name : string ->"Giraffe" : string +>"Giraffe" : "Giraffe" neckLength = "3m"; >neckLength : string ->"3m" : string +>"3m" : "3m" } class Elephant { @@ -23,11 +23,11 @@ class Elephant { name = "Elephant"; >name : string ->"Elephant" : string +>"Elephant" : "Elephant" trunkDiameter = "20cm"; >trunkDiameter : string ->"20cm" : string +>"20cm" : "20cm" } function foo(animals: IAnimal[]) { } diff --git a/tests/baselines/reference/arrayLiteralInNonVarArgParameter.types b/tests/baselines/reference/arrayLiteralInNonVarArgParameter.types index fcbaa22bc6a..4b46e0bf29f 100644 --- a/tests/baselines/reference/arrayLiteralInNonVarArgParameter.types +++ b/tests/baselines/reference/arrayLiteralInNonVarArgParameter.types @@ -8,6 +8,6 @@ panic([], 'one', 'two'); >panic([], 'one', 'two') : void >panic : (val: string[], ...opt: string[]) => void >[] : undefined[] ->'one' : string ->'two' : string +>'one' : "one" +>'two' : "two" diff --git a/tests/baselines/reference/arrayLiteralSpread.types b/tests/baselines/reference/arrayLiteralSpread.types index 7b9a34c0abe..fd6ae243265 100644 --- a/tests/baselines/reference/arrayLiteralSpread.types +++ b/tests/baselines/reference/arrayLiteralSpread.types @@ -5,9 +5,9 @@ function f0() { var a = [1, 2, 3]; >a : number[] >[1, 2, 3] : number[] ->1 : number ->2 : number ->3 : number +>1 : 1 +>2 : 2 +>3 : 3 var a1 = [...a]; >a1 : number[] @@ -18,15 +18,15 @@ function f0() { var a2 = [1, ...a]; >a2 : number[] >[1, ...a] : number[] ->1 : number +>1 : 1 >...a : number >a : number[] var a3 = [1, 2, ...a]; >a3 : number[] >[1, 2, ...a] : number[] ->1 : number ->2 : number +>1 : 1 +>2 : 2 >...a : number >a : number[] @@ -35,33 +35,33 @@ function f0() { >[...a, 1] : number[] >...a : number >a : number[] ->1 : number +>1 : 1 var a5 = [...a, 1, 2]; >a5 : number[] >[...a, 1, 2] : number[] >...a : number >a : number[] ->1 : number ->2 : number +>1 : 1 +>2 : 2 var a6 = [1, 2, ...a, 1, 2]; >a6 : number[] >[1, 2, ...a, 1, 2] : number[] ->1 : number ->2 : number +>1 : 1 +>2 : 2 >...a : number >a : number[] ->1 : number ->2 : number +>1 : 1 +>2 : 2 var a7 = [1, ...a, 2, ...a]; >a7 : number[] >[1, ...a, 2, ...a] : number[] ->1 : number +>1 : 1 >...a : number >a : number[] ->2 : number +>2 : 2 >...a : number >a : number[] @@ -82,17 +82,17 @@ function f1() { var a = [1, 2, 3]; >a : number[] >[1, 2, 3] : number[] ->1 : number ->2 : number ->3 : number +>1 : 1 +>2 : 2 +>3 : 3 var b = ["hello", ...a, true]; >b : (string | number | boolean)[] >["hello", ...a, true] : (string | number | boolean)[] ->"hello" : string +>"hello" : "hello" >...a : number >a : number[] ->true : boolean +>true : true var b: (string | number | boolean)[]; >b : (string | number | boolean)[] @@ -128,6 +128,6 @@ function f2() { >[...[5]] : number[] >...[5] : number >[5] : number[] ->5 : number +>5 : 5 } diff --git a/tests/baselines/reference/arrayLiteralWithMultipleBestCommonTypes.types b/tests/baselines/reference/arrayLiteralWithMultipleBestCommonTypes.types index aad515b62ee..43cbb87e843 100644 --- a/tests/baselines/reference/arrayLiteralWithMultipleBestCommonTypes.types +++ b/tests/baselines/reference/arrayLiteralWithMultipleBestCommonTypes.types @@ -41,21 +41,21 @@ var ds = [(x: Object) => 1, (x: string) => 2]; // { (x:Object) => number }[] >(x: Object) => 1 : (x: Object) => number >x : Object >Object : Object ->1 : number +>1 : 1 >(x: string) => 2 : (x: string) => number >x : string ->2 : number +>2 : 2 var es = [(x: string) => 2, (x: Object) => 1]; // { (x:string) => number }[] >es : ((x: string) => number)[] >[(x: string) => 2, (x: Object) => 1] : ((x: string) => number)[] >(x: string) => 2 : (x: string) => number >x : string ->2 : number +>2 : 2 >(x: Object) => 1 : (x: Object) => number >x : Object >Object : Object ->1 : number +>1 : 1 var fs = [(a: { x: number; y?: number }) => 1, (b: { x: number; z?: number }) => 2]; // (a: { x: number; y?: number }) => number[] >fs : (((a: { x: number; y?: number; }) => number) | ((b: { x: number; z?: number; }) => number))[] @@ -64,12 +64,12 @@ var fs = [(a: { x: number; y?: number }) => 1, (b: { x: number; z?: number }) => >a : { x: number; y?: number; } >x : number >y : number ->1 : number +>1 : 1 >(b: { x: number; z?: number }) => 2 : (b: { x: number; z?: number; }) => number >b : { x: number; z?: number; } >x : number >z : number ->2 : number +>2 : 2 var gs = [(b: { x: number; z?: number }) => 2, (a: { x: number; y?: number }) => 1]; // (b: { x: number; z?: number }) => number[] >gs : (((b: { x: number; z?: number; }) => number) | ((a: { x: number; y?: number; }) => number))[] @@ -78,10 +78,10 @@ var gs = [(b: { x: number; z?: number }) => 2, (a: { x: number; y?: number }) => >b : { x: number; z?: number; } >x : number >z : number ->2 : number +>2 : 2 >(a: { x: number; y?: number }) => 1 : (a: { x: number; y?: number; }) => number >a : { x: number; y?: number; } >x : number >y : number ->1 : number +>1 : 1 diff --git a/tests/baselines/reference/arrayLiterals2ES5.types b/tests/baselines/reference/arrayLiterals2ES5.types index 6eae997f465..c3256db925e 100644 --- a/tests/baselines/reference/arrayLiterals2ES5.types +++ b/tests/baselines/reference/arrayLiterals2ES5.types @@ -13,15 +13,15 @@ var a0 = [,, 2, 3, 4] >[,, 2, 3, 4] : number[] > : undefined > : undefined ->2 : number ->3 : number ->4 : number +>2 : 2 +>3 : 3 +>4 : 4 var a1 = ["hello", "world"] >a1 : string[] >["hello", "world"] : string[] ->"hello" : string ->"world" : string +>"hello" : "hello" +>"world" : "world" var a2 = [, , , ...a0, "hello"]; >a2 : (string | number)[] @@ -31,7 +31,7 @@ var a2 = [, , , ...a0, "hello"]; > : undefined >...a0 : number >a0 : number[] ->"hello" : string +>"hello" : "hello" var a3 = [,, ...a0] >a3 : number[] @@ -45,7 +45,7 @@ var a4 = [() => 1, ]; >a4 : (() => number)[] >[() => 1, ] : (() => number)[] >() => 1 : () => number ->1 : number +>1 : 1 var a5 = [...a0, , ] >a5 : number[] @@ -74,12 +74,12 @@ var b1: [number[], string[]] = [[1, 2, 3], ["hello", "string"]]; >b1 : [number[], string[]] >[[1, 2, 3], ["hello", "string"]] : [number[], string[]] >[1, 2, 3] : number[] ->1 : number ->2 : number ->3 : number +>1 : 1 +>2 : 2 +>3 : 3 >["hello", "string"] : string[] ->"hello" : string ->"string" : string +>"hello" : "hello" +>"string" : "string" // The resulting type an array literal expression is determined as follows: // - If the array literal contains no spread elements and is an array assignment pattern in a destructuring assignment (section 4.17.1), @@ -89,16 +89,16 @@ var [c0, c1] = [1, 2]; // tuple type [number, number] >c0 : number >c1 : number >[1, 2] : [number, number] ->1 : number ->2 : number +>1 : 1 +>2 : 2 var [c2, c3] = [1, 2, true]; // tuple type [number, number, boolean] >c2 : number >c3 : number >[1, 2, true] : [number, number, boolean] ->1 : number ->2 : number ->true : boolean +>1 : 1 +>2 : 2 +>true : true // The resulting type an array literal expression is determined as follows: // - the resulting type is an array type with an element type that is the union of the types of the @@ -106,27 +106,27 @@ var [c2, c3] = [1, 2, true]; // tuple type [number, number, boolean] var temp = ["s", "t", "r"]; >temp : string[] >["s", "t", "r"] : string[] ->"s" : string ->"t" : string ->"r" : string +>"s" : "s" +>"t" : "t" +>"r" : "r" var temp1 = [1, 2, 3]; >temp1 : number[] >[1, 2, 3] : number[] ->1 : number ->2 : number ->3 : number +>1 : 1 +>2 : 2 +>3 : 3 var temp2: [number[], string[]] = [[1, 2, 3], ["hello", "string"]]; >temp2 : [number[], string[]] >[[1, 2, 3], ["hello", "string"]] : [number[], string[]] >[1, 2, 3] : number[] ->1 : number ->2 : number ->3 : number +>1 : 1 +>2 : 2 +>3 : 3 >["hello", "string"] : string[] ->"hello" : string ->"string" : string +>"hello" : "hello" +>"string" : "string" var temp3 = [undefined, null, undefined]; >temp3 : any[] @@ -153,8 +153,8 @@ interface myArray2 extends Array { } var d0 = [1, true, ...temp,]; // has type (string|number|boolean)[] >d0 : (string | number | boolean)[] >[1, true, ...temp,] : (string | number | boolean)[] ->1 : number ->true : boolean +>1 : 1 +>true : true >...temp : string >temp : string[] @@ -221,5 +221,5 @@ var d9 = [[...temp1], ...["hello"]]; >temp1 : number[] >...["hello"] : string >["hello"] : string[] ->"hello" : string +>"hello" : "hello" diff --git a/tests/baselines/reference/arrayLiterals2ES6.types b/tests/baselines/reference/arrayLiterals2ES6.types index f05b0ca9282..57f3f44f62d 100644 --- a/tests/baselines/reference/arrayLiterals2ES6.types +++ b/tests/baselines/reference/arrayLiterals2ES6.types @@ -13,15 +13,15 @@ var a0 = [, , 2, 3, 4] >[, , 2, 3, 4] : number[] > : undefined > : undefined ->2 : number ->3 : number ->4 : number +>2 : 2 +>3 : 3 +>4 : 4 var a1 = ["hello", "world"] >a1 : string[] >["hello", "world"] : string[] ->"hello" : string ->"world" : string +>"hello" : "hello" +>"world" : "world" var a2 = [, , , ...a0, "hello"]; >a2 : (string | number)[] @@ -31,7 +31,7 @@ var a2 = [, , , ...a0, "hello"]; > : undefined >...a0 : number >a0 : number[] ->"hello" : string +>"hello" : "hello" var a3 = [, , ...a0] >a3 : number[] @@ -45,7 +45,7 @@ var a4 = [() => 1, ]; >a4 : (() => number)[] >[() => 1, ] : (() => number)[] >() => 1 : () => number ->1 : number +>1 : 1 var a5 = [...a0, , ] >a5 : number[] @@ -74,12 +74,12 @@ var b1: [number[], string[]] = [[1, 2, 3], ["hello", "string"]]; >b1 : [number[], string[]] >[[1, 2, 3], ["hello", "string"]] : [number[], string[]] >[1, 2, 3] : number[] ->1 : number ->2 : number ->3 : number +>1 : 1 +>2 : 2 +>3 : 3 >["hello", "string"] : string[] ->"hello" : string ->"string" : string +>"hello" : "hello" +>"string" : "string" // The resulting type an array literal expression is determined as follows: // - If the array literal contains no spread elements and is an array assignment pattern in a destructuring assignment (section 4.17.1), @@ -89,16 +89,16 @@ var [c0, c1] = [1, 2]; // tuple type [number, number] >c0 : number >c1 : number >[1, 2] : [number, number] ->1 : number ->2 : number +>1 : 1 +>2 : 2 var [c2, c3] = [1, 2, true]; // tuple type [number, number, boolean] >c2 : number >c3 : number >[1, 2, true] : [number, number, boolean] ->1 : number ->2 : number ->true : boolean +>1 : 1 +>2 : 2 +>true : true // The resulting type an array literal expression is determined as follows: // - the resulting type is an array type with an element type that is the union of the types of the @@ -106,27 +106,27 @@ var [c2, c3] = [1, 2, true]; // tuple type [number, number, boolean] var temp = ["s", "t", "r"]; >temp : string[] >["s", "t", "r"] : string[] ->"s" : string ->"t" : string ->"r" : string +>"s" : "s" +>"t" : "t" +>"r" : "r" var temp1 = [1, 2, 3]; >temp1 : number[] >[1, 2, 3] : number[] ->1 : number ->2 : number ->3 : number +>1 : 1 +>2 : 2 +>3 : 3 var temp2: [number[], string[]] = [[1, 2, 3], ["hello", "string"]]; >temp2 : [number[], string[]] >[[1, 2, 3], ["hello", "string"]] : [number[], string[]] >[1, 2, 3] : number[] ->1 : number ->2 : number ->3 : number +>1 : 1 +>2 : 2 +>3 : 3 >["hello", "string"] : string[] ->"hello" : string ->"string" : string +>"hello" : "hello" +>"string" : "string" interface myArray extends Array { } >myArray : myArray @@ -142,8 +142,8 @@ interface myArray2 extends Array { } var d0 = [1, true, ...temp, ]; // has type (string|number|boolean)[] >d0 : (string | number | boolean)[] >[1, true, ...temp, ] : (string | number | boolean)[] ->1 : number ->true : boolean +>1 : 1 +>true : true >...temp : string >temp : string[] @@ -208,5 +208,5 @@ var d9 = [[...temp1], ...["hello"]]; >temp1 : number[] >...["hello"] : string >["hello"] : string[] ->"hello" : string +>"hello" : "hello" diff --git a/tests/baselines/reference/arrayLiterals3.errors.txt b/tests/baselines/reference/arrayLiterals3.errors.txt index 1f0dd30c09c..3ebf4174f51 100644 --- a/tests/baselines/reference/arrayLiterals3.errors.txt +++ b/tests/baselines/reference/arrayLiterals3.errors.txt @@ -1,7 +1,7 @@ tests/cases/conformance/expressions/arrayLiterals/arrayLiterals3.ts(10,5): error TS2322: Type 'undefined[]' is not assignable to type '[any, any, any]'. Property '0' is missing in type 'undefined[]'. -tests/cases/conformance/expressions/arrayLiterals/arrayLiterals3.ts(11,5): error TS2322: Type '[string, number, boolean]' is not assignable to type '[boolean, string, number]'. - Type 'string' is not assignable to type 'boolean'. +tests/cases/conformance/expressions/arrayLiterals/arrayLiterals3.ts(11,5): error TS2322: Type '["string", number, boolean]' is not assignable to type '[boolean, string, number]'. + Type '"string"' is not assignable to type 'boolean'. tests/cases/conformance/expressions/arrayLiterals/arrayLiterals3.ts(17,5): error TS2322: Type '[number, number, string, boolean]' is not assignable to type '[number, number]'. Types of property 'pop' are incompatible. Type '() => string | number | boolean' is not assignable to type '() => number'. @@ -36,8 +36,8 @@ tests/cases/conformance/expressions/arrayLiterals/arrayLiterals3.ts(34,5): error !!! error TS2322: Property '0' is missing in type 'undefined[]'. var a1: [boolean, string, number] = ["string", 1, true]; // Error ~~ -!!! error TS2322: Type '[string, number, boolean]' is not assignable to type '[boolean, string, number]'. -!!! error TS2322: Type 'string' is not assignable to type 'boolean'. +!!! error TS2322: Type '["string", number, boolean]' is not assignable to type '[boolean, string, number]'. +!!! error TS2322: Type '"string"' is not assignable to type 'boolean'. // The resulting type an array literal expression is determined as follows: // - If the array literal contains no spread elements and is an array assignment pattern in a destructuring assignment (section 4.17.1), diff --git a/tests/baselines/reference/arrayOfFunctionTypes3.types b/tests/baselines/reference/arrayOfFunctionTypes3.types index 0ed92991ed0..124542f5814 100644 --- a/tests/baselines/reference/arrayOfFunctionTypes3.types +++ b/tests/baselines/reference/arrayOfFunctionTypes3.types @@ -5,7 +5,7 @@ var x = [() => 1, () => { }]; >x : (() => void)[] >[() => 1, () => { }] : (() => void)[] >() => 1 : () => number ->1 : number +>1 : 1 >() => { } : () => void var r2 = x[0](); @@ -13,7 +13,7 @@ var r2 = x[0](); >x[0]() : void >x[0] : () => void >x : (() => void)[] ->0 : number +>0 : 0 class C { >C : C @@ -32,7 +32,7 @@ var r3 = new y[0](); >new y[0]() : C >y[0] : typeof C >y : typeof C[] ->0 : number +>0 : 0 var a: { (x: number): number; (x: string): string; }; >a : { (x: number): number; (x: string): string; } @@ -60,19 +60,19 @@ var r4 = z[0]; >r4 : { (x: number): number; (x: any): any; } >z[0] : { (x: number): number; (x: any): any; } >z : { (x: number): number; (x: any): any; }[] ->0 : number +>0 : 0 var r5 = r4(''); // any not string >r5 : any >r4('') : any >r4 : { (x: number): number; (x: any): any; } ->'' : string +>'' : "" var r5b = r4(1); >r5b : number >r4(1) : number >r4 : { (x: number): number; (x: any): any; } ->1 : number +>1 : 1 var a2: { (x: T): number; (x: string): string;}; >a2 : { (x: T): number; (x: string): string; } @@ -106,11 +106,11 @@ var r6 = z2[0]; >r6 : { (x: number): number; (x: T): any; } >z2[0] : { (x: number): number; (x: T): any; } >z2 : { (x: number): number; (x: T): any; }[] ->0 : number +>0 : 0 var r7 = r6(''); // any not string >r7 : any >r6('') : any >r6 : { (x: number): number; (x: T): any; } ->'' : string +>'' : "" diff --git a/tests/baselines/reference/arrayconcat.types b/tests/baselines/reference/arrayconcat.types index 45615cd63b8..27724c63ab1 100644 --- a/tests/baselines/reference/arrayconcat.types +++ b/tests/baselines/reference/arrayconcat.types @@ -46,7 +46,7 @@ class parser { >this : this >options : IOptions[] >sort : (compareFn?: (a: IOptions, b: IOptions) => number) => 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) => number +>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) => 0 | 1 | -1 >a : IOptions >b : IOptions @@ -74,7 +74,7 @@ class parser { >bName : string return 1; ->1 : number +>1 : 1 } else if (aName < bName) { >aName < bName : boolean @@ -82,12 +82,12 @@ class parser { >bName : string return -1; ->-1 : number ->1 : number +>-1 : -1 +>1 : 1 } else { return 0; ->0 : number +>0 : 0 } }); } diff --git a/tests/baselines/reference/arrowFunctionExpressions.types b/tests/baselines/reference/arrowFunctionExpressions.types index 41344c61cc4..aad43240daa 100644 --- a/tests/baselines/reference/arrowFunctionExpressions.types +++ b/tests/baselines/reference/arrowFunctionExpressions.types @@ -21,13 +21,13 @@ var b = j => { return 0; } >b : (j: any) => number >j => { return 0; } : (j: any) => number >j : any ->0 : number +>0 : 0 var b = (j) => { return 0; } >b : (j: any) => number >(j) => { return 0; } : (j: any) => number >j : any ->0 : number +>0 : 0 // Identifier => AssignmentExpression is equivalent to(Identifier) => AssignmentExpression var c: number; @@ -80,7 +80,7 @@ var p5 = ([a = 1]) => { }; >p5 : ([a]: [number]) => void >([a = 1]) => { } : ([a]: [number]) => void >a : number ->1 : number +>1 : 1 var p6 = ({ a }) => { }; >p6 : ({a}: { a: any; }) => void @@ -97,17 +97,17 @@ var p8 = ({ a = 1 }) => { }; >p8 : ({a}: { a?: number; }) => void >({ a = 1 }) => { } : ({a}: { a?: number; }) => void >a : number ->1 : number +>1 : 1 var p9 = ({ a: { b = 1 } = { b: 1 } }) => { }; >p9 : ({a: {b}}: { a?: { b?: number; }; }) => void >({ a: { b = 1 } = { b: 1 } }) => { } : ({a: {b}}: { a?: { b?: number; }; }) => void >a : any >b : number ->1 : number +>1 : 1 >{ b: 1 } : { b?: number; } >b : number ->1 : number +>1 : 1 var p10 = ([{ value, done }]) => { }; >p10 : ([{value, done}]: [{ value: any; done: any; }]) => void @@ -126,7 +126,7 @@ class MyClass { >n : any >n + 1 : any >n : any ->1 : number +>1 : 1 p = (n) => n && this; >p : (n: any) => this @@ -145,7 +145,7 @@ class MyClass { >n : any >n + 1 : any >n : any ->1 : number +>1 : 1 var p = (n) => n && this; >p : (n: any) => this @@ -177,8 +177,8 @@ var e = arrrr()(3)()(4); >arrrr()(3) : () => (n: number) => number >arrrr() : (m: number) => () => (n: number) => number >arrrr : () => (m: number) => () => (n: number) => number ->3 : number ->4 : number +>3 : 3 +>4 : 4 var e: number; >e : number @@ -203,8 +203,8 @@ function someFn() { >arr(3)(4) : number >arr(3) : (p: number) => number >arr : (n: number) => (p: number) => number ->3 : number ->4 : number +>3 : 3 +>4 : 4 >toExponential : (fractionDigits?: number) => string } @@ -217,7 +217,7 @@ function someOtherFn() { >(n: number) => '' + n : (n: number) => string >n : number >'' + n : string ->'' : string +>'' : "" >n : number arr(4).charAt(0); @@ -225,9 +225,9 @@ function someOtherFn() { >arr(4).charAt : (pos: number) => string >arr(4) : string >arr : (n: number) => string ->4 : number +>4 : 4 >charAt : (pos: number) => string ->0 : number +>0 : 0 } // Arrow function used in nested function in function @@ -270,14 +270,14 @@ var f = (n: string) => { return fn(4); >fn(4) : () => string >fn : (x: number) => () => string ->4 : number +>4 : 4 } var g = f('')(); >g : string >f('')() : string >f('') : () => string >f : (n: string) => () => string ->'' : string +>'' : "" var g: string; >g : string @@ -314,7 +314,7 @@ var h = someOuterFn()('')()(); >someOuterFn()('') : () => () => number >someOuterFn() : (n: string) => () => () => number >someOuterFn : () => (n: string) => () => () => number ->'' : string +>'' : "" h.toExponential(); >h.toExponential() : string @@ -348,7 +348,7 @@ function tryCatchFn() { >() => this + '' : () => string >this + '' : string >this : any ->'' : string +>'' : "" } } diff --git a/tests/baselines/reference/arrowFunctionInExpressionStatement1.types b/tests/baselines/reference/arrowFunctionInExpressionStatement1.types index a38a868f85b..c2954cd7bec 100644 --- a/tests/baselines/reference/arrowFunctionInExpressionStatement1.types +++ b/tests/baselines/reference/arrowFunctionInExpressionStatement1.types @@ -1,5 +1,5 @@ === tests/cases/compiler/arrowFunctionInExpressionStatement1.ts === () => 0; >() => 0 : () => number ->0 : number +>0 : 0 diff --git a/tests/baselines/reference/arrowFunctionInExpressionStatement2.types b/tests/baselines/reference/arrowFunctionInExpressionStatement2.types index bfbd11e8c08..04db38ac581 100644 --- a/tests/baselines/reference/arrowFunctionInExpressionStatement2.types +++ b/tests/baselines/reference/arrowFunctionInExpressionStatement2.types @@ -4,5 +4,5 @@ module M { () => 0; >() => 0 : () => number ->0 : number +>0 : 0 } diff --git a/tests/baselines/reference/arrowFunctionWithObjectLiteralBody5.types b/tests/baselines/reference/arrowFunctionWithObjectLiteralBody5.types index 0093ace2d9c..8a006d7f1d4 100644 --- a/tests/baselines/reference/arrowFunctionWithObjectLiteralBody5.types +++ b/tests/baselines/reference/arrowFunctionWithObjectLiteralBody5.types @@ -6,9 +6,9 @@ var a = () => { name: "foo", message: "bar" }; >Error : Error >{ name: "foo", message: "bar" } : { name: string; message: string; } >name : string ->"foo" : string +>"foo" : "foo" >message : string ->"bar" : string +>"bar" : "bar" var b = () => ({ name: "foo", message: "bar" }); >b : () => Error @@ -18,9 +18,9 @@ var b = () => ({ name: "foo", message: "bar" }); >Error : Error >{ name: "foo", message: "bar" } : { name: string; message: string; } >name : string ->"foo" : string +>"foo" : "foo" >message : string ->"bar" : string +>"bar" : "bar" var c = () => ({ name: "foo", message: "bar" }); >c : () => { name: string; message: string; } @@ -28,9 +28,9 @@ var c = () => ({ name: "foo", message: "bar" }); >({ name: "foo", message: "bar" }) : { name: string; message: string; } >{ name: "foo", message: "bar" } : { name: string; message: string; } >name : string ->"foo" : string +>"foo" : "foo" >message : string ->"bar" : string +>"bar" : "bar" var d = () => ((({ name: "foo", message: "bar" }))); >d : () => Error @@ -42,7 +42,7 @@ var d = () => ((({ name: "foo", message: "bar" }))); >({ name: "foo", message: "bar" }) : { name: string; message: string; } >{ name: "foo", message: "bar" } : { name: string; message: string; } >name : string ->"foo" : string +>"foo" : "foo" >message : string ->"bar" : string +>"bar" : "bar" diff --git a/tests/baselines/reference/arrowFunctionWithObjectLiteralBody6.types b/tests/baselines/reference/arrowFunctionWithObjectLiteralBody6.types index 31d2a63fec0..615f19aaf6b 100644 --- a/tests/baselines/reference/arrowFunctionWithObjectLiteralBody6.types +++ b/tests/baselines/reference/arrowFunctionWithObjectLiteralBody6.types @@ -6,9 +6,9 @@ var a = () => { name: "foo", message: "bar" }; >Error : Error >{ name: "foo", message: "bar" } : { name: string; message: string; } >name : string ->"foo" : string +>"foo" : "foo" >message : string ->"bar" : string +>"bar" : "bar" var b = () => ({ name: "foo", message: "bar" }); >b : () => Error @@ -18,9 +18,9 @@ var b = () => ({ name: "foo", message: "bar" }); >Error : Error >{ name: "foo", message: "bar" } : { name: string; message: string; } >name : string ->"foo" : string +>"foo" : "foo" >message : string ->"bar" : string +>"bar" : "bar" var c = () => ({ name: "foo", message: "bar" }); >c : () => { name: string; message: string; } @@ -28,9 +28,9 @@ var c = () => ({ name: "foo", message: "bar" }); >({ name: "foo", message: "bar" }) : { name: string; message: string; } >{ name: "foo", message: "bar" } : { name: string; message: string; } >name : string ->"foo" : string +>"foo" : "foo" >message : string ->"bar" : string +>"bar" : "bar" var d = () => ((({ name: "foo", message: "bar" }))); >d : () => Error @@ -42,7 +42,7 @@ var d = () => ((({ name: "foo", message: "bar" }))); >({ name: "foo", message: "bar" }) : { name: string; message: string; } >{ name: "foo", message: "bar" } : { name: string; message: string; } >name : string ->"foo" : string +>"foo" : "foo" >message : string ->"bar" : string +>"bar" : "bar" diff --git a/tests/baselines/reference/asOpEmitParens.types b/tests/baselines/reference/asOpEmitParens.types index b87d7f4d91f..3204a6e5cac 100644 --- a/tests/baselines/reference/asOpEmitParens.types +++ b/tests/baselines/reference/asOpEmitParens.types @@ -9,8 +9,8 @@ declare var x; >x + 1 as number : number >x + 1 : any >x : any ->1 : number ->3 : number +>1 : 1 +>3 : 3 // Should still emit as x.y (x as any).y; diff --git a/tests/baselines/reference/asOperator1.types b/tests/baselines/reference/asOperator1.types index 3f69871ea09..cf4a0b770be 100644 --- a/tests/baselines/reference/asOperator1.types +++ b/tests/baselines/reference/asOperator1.types @@ -1,7 +1,7 @@ === tests/cases/conformance/expressions/asOperator/asOperator1.ts === var as = 43; >as : number ->43 : number +>43 : 43 var x = undefined as number; >x : number @@ -26,10 +26,10 @@ var z = Date as any as string; var j = 32 as number|string; >j : string | number >32 as number|string : string | number ->32 : number +>32 : 32 j = ''; ->j = '' : string +>j = '' : "" >j : string | number ->'' : string +>'' : "" diff --git a/tests/baselines/reference/asOperator3.types b/tests/baselines/reference/asOperator3.types index 507dfd8b572..a888d70892b 100644 --- a/tests/baselines/reference/asOperator3.types +++ b/tests/baselines/reference/asOperator3.types @@ -8,30 +8,30 @@ var a = `${123 + 456 as number}`; >`${123 + 456 as number}` : string >123 + 456 as number : number >123 + 456 : number ->123 : number ->456 : number +>123 : 123 +>456 : 456 var b = `leading ${123 + 456 as number}`; >b : string >`leading ${123 + 456 as number}` : string >123 + 456 as number : number >123 + 456 : number ->123 : number ->456 : number +>123 : 123 +>456 : 456 var c = `${123 + 456 as number} trailing`; >c : string >`${123 + 456 as number} trailing` : string >123 + 456 as number : number >123 + 456 : number ->123 : number ->456 : number +>123 : 123 +>456 : 456 var d = `Hello ${123} World` as string; >d : string >`Hello ${123} World` as string : string >`Hello ${123} World` : string ->123 : number +>123 : 123 var e = `Hello` as string; >e : string @@ -42,9 +42,9 @@ var f = 1 + `${1} end of string` as string; >f : string >1 + `${1} end of string` as string : string >1 + `${1} end of string` : string ->1 : number +>1 : 1 >`${1} end of string` : string ->1 : number +>1 : 1 var g = tag `Hello ${123} World` as string; >g : string @@ -52,7 +52,7 @@ var g = tag `Hello ${123} World` as string; >tag `Hello ${123} World` : any >tag : (...x: any[]) => any >`Hello ${123} World` : string ->123 : number +>123 : 123 var h = tag `Hello` as string; >h : string diff --git a/tests/baselines/reference/asOperatorASI.types b/tests/baselines/reference/asOperatorASI.types index 61c2d115cf4..e5e1de88c29 100644 --- a/tests/baselines/reference/asOperatorASI.types +++ b/tests/baselines/reference/asOperatorASI.types @@ -9,7 +9,7 @@ declare function as(...args: any[]); // Example 1 var x = 10 >x : number ->10 : number +>10 : 10 as `Hello world`; // should not error >as `Hello world` : any @@ -19,7 +19,7 @@ as `Hello world`; // should not error // Example 2 var y = 20 >y : number ->20 : number +>20 : 20 as(Foo); // should emit >as(Foo) : any diff --git a/tests/baselines/reference/asiArith.types b/tests/baselines/reference/asiArith.types index 13394d2f1c2..b2c7410a403 100644 --- a/tests/baselines/reference/asiArith.types +++ b/tests/baselines/reference/asiArith.types @@ -1,11 +1,11 @@ === tests/cases/compiler/asiArith.ts === var x = 1; >x : number ->1 : number +>1 : 1 var y = 1; >y : number ->1 : number +>1 : 1 var z = >z : number @@ -28,11 +28,11 @@ y var a = 1; >a : number ->1 : number +>1 : 1 var b = 1; >b : number ->1 : number +>1 : 1 var c = >c : number diff --git a/tests/baselines/reference/asiBreak.types b/tests/baselines/reference/asiBreak.types index af3d6a040d5..7e7a8efb71f 100644 --- a/tests/baselines/reference/asiBreak.types +++ b/tests/baselines/reference/asiBreak.types @@ -1,4 +1,4 @@ === tests/cases/compiler/asiBreak.ts === while (true) break ->true : boolean +>true : true diff --git a/tests/baselines/reference/asiContinue.types b/tests/baselines/reference/asiContinue.types index e2eb5ba107d..0de6786fee1 100644 --- a/tests/baselines/reference/asiContinue.types +++ b/tests/baselines/reference/asiContinue.types @@ -1,4 +1,4 @@ === tests/cases/compiler/asiContinue.ts === while (true) continue ->true : boolean +>true : true diff --git a/tests/baselines/reference/asiInES6Classes.types b/tests/baselines/reference/asiInES6Classes.types index 41940a0f477..6a93269497c 100644 --- a/tests/baselines/reference/asiInES6Classes.types +++ b/tests/baselines/reference/asiInES6Classes.types @@ -10,7 +10,7 @@ class Foo { done: false >done : boolean ->false : boolean +>false : false } @@ -20,7 +20,7 @@ class Foo { >bar : () => number return 3; ->3 : number +>3 : 3 } diff --git a/tests/baselines/reference/asiPreventsParsingAsAmbientExternalModule01.types b/tests/baselines/reference/asiPreventsParsingAsAmbientExternalModule01.types index 3e6aade9a21..744687429ce 100644 --- a/tests/baselines/reference/asiPreventsParsingAsAmbientExternalModule01.types +++ b/tests/baselines/reference/asiPreventsParsingAsAmbientExternalModule01.types @@ -13,6 +13,6 @@ module // this is the identifier 'module' >module : string "my external module" // this is just a string ->"my external module" : string +>"my external module" : "my external module" { } // this is a block body diff --git a/tests/baselines/reference/asiPreventsParsingAsAmbientExternalModule02.types b/tests/baselines/reference/asiPreventsParsingAsAmbientExternalModule02.types index 67671853993..ae82f5f68a4 100644 --- a/tests/baselines/reference/asiPreventsParsingAsAmbientExternalModule02.types +++ b/tests/baselines/reference/asiPreventsParsingAsAmbientExternalModule02.types @@ -16,7 +16,7 @@ module container { >module : string "my external module" // this is just a string ->"my external module" : string +>"my external module" : "my external module" { } // this is a block body } diff --git a/tests/baselines/reference/asiPreventsParsingAsNamespace04.types b/tests/baselines/reference/asiPreventsParsingAsNamespace04.types index 3fa2a448cf9..7cab2a7be36 100644 --- a/tests/baselines/reference/asiPreventsParsingAsNamespace04.types +++ b/tests/baselines/reference/asiPreventsParsingAsNamespace04.types @@ -2,7 +2,7 @@ let module = 10; >module : number ->10 : number +>10 : 10 module in {} >module in {} : boolean diff --git a/tests/baselines/reference/asiPreventsParsingAsNamespace05.types b/tests/baselines/reference/asiPreventsParsingAsNamespace05.types index 515147c1096..e1492c8c582 100644 --- a/tests/baselines/reference/asiPreventsParsingAsNamespace05.types +++ b/tests/baselines/reference/asiPreventsParsingAsNamespace05.types @@ -2,7 +2,7 @@ let namespace = 10; >namespace : number ->10 : number +>10 : 10 namespace a.b { >a : typeof a @@ -10,7 +10,7 @@ namespace a.b { export let c = 20; >c : number ->20 : number +>20 : 20 } namespace diff --git a/tests/baselines/reference/assign1.types b/tests/baselines/reference/assign1.types index d600c4055af..51d9c72c54e 100644 --- a/tests/baselines/reference/assign1.types +++ b/tests/baselines/reference/assign1.types @@ -17,8 +17,8 @@ module M { >I : I >{salt:2,pepper:0} : { salt: number; pepper: number; } >salt : number ->2 : number +>2 : 2 >pepper : number ->0 : number +>0 : 0 } diff --git a/tests/baselines/reference/assignEveryTypeToAny.types b/tests/baselines/reference/assignEveryTypeToAny.types index dfff671a875..cfc24e1da65 100644 --- a/tests/baselines/reference/assignEveryTypeToAny.types +++ b/tests/baselines/reference/assignEveryTypeToAny.types @@ -5,13 +5,13 @@ var x: any; >x : any x = 1; ->x = 1 : number +>x = 1 : 1 >x : any ->1 : number +>1 : 1 var a = 2; >a : number ->2 : number +>2 : 2 x = a; >x = a : number @@ -19,27 +19,27 @@ x = a; >a : number x = true; ->x = true : boolean +>x = true : true >x : any ->true : boolean +>true : true var b = true; >b : boolean ->true : boolean +>true : true x = b; ->x = b : boolean +>x = b : true >x : any ->b : boolean +>b : true x = ""; ->x = "" : string +>x = "" : "" >x : any ->"" : string +>"" : "" var c = ""; >c : string ->"" : string +>"" : "" x = c; >x = c : string @@ -142,7 +142,7 @@ x = { f() { return 1; } } >x : any >{ f() { return 1; } } : { f(): number; } >f : () => number ->1 : number +>1 : 1 x = { f(x: T) { return x; } } >x = { f(x: T) { return x; } } : { f(x: T): T; } diff --git a/tests/baselines/reference/assignToFn.errors.txt b/tests/baselines/reference/assignToFn.errors.txt index 7f2c7855a35..42a1a129a23 100644 --- a/tests/baselines/reference/assignToFn.errors.txt +++ b/tests/baselines/reference/assignToFn.errors.txt @@ -1,4 +1,4 @@ -tests/cases/compiler/assignToFn.ts(8,5): error TS2322: Type 'string' is not assignable to type '(n: number) => boolean'. +tests/cases/compiler/assignToFn.ts(8,5): error TS2322: Type '"hello"' is not assignable to type '(n: number) => boolean'. ==== tests/cases/compiler/assignToFn.ts (1 errors) ==== @@ -11,6 +11,6 @@ tests/cases/compiler/assignToFn.ts(8,5): error TS2322: Type 'string' is not assi x.f="hello"; ~~~ -!!! error TS2322: Type 'string' is not assignable to type '(n: number) => boolean'. +!!! error TS2322: Type '"hello"' is not assignable to type '(n: number) => boolean'. } \ No newline at end of file diff --git a/tests/baselines/reference/assignmentCompat1.errors.txt b/tests/baselines/reference/assignmentCompat1.errors.txt index 0936c532ab3..e9fc3bd2f7f 100644 --- a/tests/baselines/reference/assignmentCompat1.errors.txt +++ b/tests/baselines/reference/assignmentCompat1.errors.txt @@ -2,8 +2,8 @@ tests/cases/compiler/assignmentCompat1.ts(4,1): error TS2322: Type '{ [index: st Property 'one' is missing in type '{ [index: string]: any; }'. tests/cases/compiler/assignmentCompat1.ts(6,1): error TS2322: Type '{ [index: number]: any; }' is not assignable to type '{ one: number; }'. Property 'one' is missing in type '{ [index: number]: any; }'. -tests/cases/compiler/assignmentCompat1.ts(8,1): error TS2322: Type 'string' is not assignable to type '{ [index: string]: any; }'. -tests/cases/compiler/assignmentCompat1.ts(10,1): error TS2322: Type 'boolean' is not assignable to type '{ [index: number]: any; }'. +tests/cases/compiler/assignmentCompat1.ts(8,1): error TS2322: Type '"foo"' is not assignable to type '{ [index: string]: any; }'. +tests/cases/compiler/assignmentCompat1.ts(10,1): error TS2322: Type 'false' is not assignable to type '{ [index: number]: any; }'. ==== tests/cases/compiler/assignmentCompat1.ts (4 errors) ==== @@ -22,10 +22,10 @@ tests/cases/compiler/assignmentCompat1.ts(10,1): error TS2322: Type 'boolean' is z = x; // Ok because index signature type is any y = "foo"; // Error ~ -!!! error TS2322: Type 'string' is not assignable to type '{ [index: string]: any; }'. +!!! error TS2322: Type '"foo"' is not assignable to type '{ [index: string]: any; }'. z = "foo"; // OK, string has numeric indexer z = false; // Error ~ -!!! error TS2322: Type 'boolean' is not assignable to type '{ [index: number]: any; }'. +!!! error TS2322: Type 'false' is not assignable to type '{ [index: number]: any; }'. \ No newline at end of file diff --git a/tests/baselines/reference/assignmentCompatForEnums.types b/tests/baselines/reference/assignmentCompatForEnums.types index e8b48bd02bd..dde41372e11 100644 --- a/tests/baselines/reference/assignmentCompatForEnums.types +++ b/tests/baselines/reference/assignmentCompatForEnums.types @@ -1,8 +1,8 @@ === tests/cases/compiler/assignmentCompatForEnums.ts === enum TokenType { One, Two }; >TokenType : TokenType ->One : TokenType ->Two : TokenType +>One : TokenType.One +>Two : TokenType.Two var list = {}; >list : {} @@ -27,7 +27,7 @@ function foo() { >TokenType : TokenType >list['one'] : any >list : {} ->'one' : string +>'one' : "one" } diff --git a/tests/baselines/reference/assignmentCompatWithObjectMembers.types b/tests/baselines/reference/assignmentCompatWithObjectMembers.types index f56b0b1dc74..ced87c605c9 100644 --- a/tests/baselines/reference/assignmentCompatWithObjectMembers.types +++ b/tests/baselines/reference/assignmentCompatWithObjectMembers.types @@ -49,13 +49,13 @@ module SimpleTypes { >a2 : { foo: string; } >{ foo: '' } : { foo: string; } >foo : string ->'' : string +>'' : "" var b2 = { foo: '' }; >b2 : { foo: string; } >{ foo: '' } : { foo: string; } >foo : string ->'' : string +>'' : "" s = t; >s = t : T diff --git a/tests/baselines/reference/assignmentCompatWithObjectMembers2.types b/tests/baselines/reference/assignmentCompatWithObjectMembers2.types index 560644f860e..76316afd3cc 100644 --- a/tests/baselines/reference/assignmentCompatWithObjectMembers2.types +++ b/tests/baselines/reference/assignmentCompatWithObjectMembers2.types @@ -50,13 +50,13 @@ var a2 = { foo: '' }; >a2 : { foo: string; } >{ foo: '' } : { foo: string; } >foo : string ->'' : string +>'' : "" var b2 = { foo: '' }; >b2 : { foo: string; } >{ foo: '' } : { foo: string; } >foo : string ->'' : string +>'' : "" s = t; >s = t : T diff --git a/tests/baselines/reference/assignmentCompatWithObjectMembers3.types b/tests/baselines/reference/assignmentCompatWithObjectMembers3.types index 3046c2f609d..88eadd4c36a 100644 --- a/tests/baselines/reference/assignmentCompatWithObjectMembers3.types +++ b/tests/baselines/reference/assignmentCompatWithObjectMembers3.types @@ -53,14 +53,14 @@ var a2: S2 = { foo: '' }; >S2 : S2 >{ foo: '' } : { foo: string; } >foo : string ->'' : string +>'' : "" var b2: T2 = { foo: '' }; >b2 : T2 >T2 : T2 >{ foo: '' } : { foo: string; } >foo : string ->'' : string +>'' : "" s = t; >s = t : T diff --git a/tests/baselines/reference/assignmentCompatWithObjectMembersNumericNames.types b/tests/baselines/reference/assignmentCompatWithObjectMembersNumericNames.types index 440ef006e0a..0c44316d324 100644 --- a/tests/baselines/reference/assignmentCompatWithObjectMembersNumericNames.types +++ b/tests/baselines/reference/assignmentCompatWithObjectMembersNumericNames.types @@ -43,12 +43,12 @@ var b: { 1.0: string; baz?: string } var a2 = { 1.0: '' }; >a2 : { 1.0: string; } >{ 1.0: '' } : { 1.0: string; } ->'' : string +>'' : "" var b2 = { 1: '' }; >b2 : { 1: string; } >{ 1: '' } : { 1: string; } ->'' : string +>'' : "" s = t; >s = t : T diff --git a/tests/baselines/reference/assignmentCompatability1.types b/tests/baselines/reference/assignmentCompatability1.types index 66174a4036e..6f47a6e5244 100644 --- a/tests/baselines/reference/assignmentCompatability1.types +++ b/tests/baselines/reference/assignmentCompatability1.types @@ -14,7 +14,7 @@ module __test1__ { >interfaceWithPublicAndOptional : interfaceWithPublicAndOptional >{ one: 1 } : { one: number; } >one : number ->1 : number +>1 : 1 export var __val__obj4 = obj4; >__val__obj4 : interfaceWithPublicAndOptional diff --git a/tests/baselines/reference/assignmentCompatability10.types b/tests/baselines/reference/assignmentCompatability10.types index f4c2bba451d..9784acfdabc 100644 --- a/tests/baselines/reference/assignmentCompatability10.types +++ b/tests/baselines/reference/assignmentCompatability10.types @@ -14,7 +14,7 @@ module __test1__ { >interfaceWithPublicAndOptional : interfaceWithPublicAndOptional >{ one: 1 } : { one: number; } >one : number ->1 : number +>1 : 1 export var __val__obj4 = obj4; >__val__obj4 : interfaceWithPublicAndOptional @@ -34,7 +34,7 @@ module __test2__ { >x4 : classWithPublicAndOptional >new classWithPublicAndOptional(1) : classWithPublicAndOptional >classWithPublicAndOptional : typeof classWithPublicAndOptional ->1 : number +>1 : 1 export var __val__x4 = x4; >__val__x4 : classWithPublicAndOptional diff --git a/tests/baselines/reference/assignmentCompatability2.types b/tests/baselines/reference/assignmentCompatability2.types index f46a81cf51f..58fb86b5c7f 100644 --- a/tests/baselines/reference/assignmentCompatability2.types +++ b/tests/baselines/reference/assignmentCompatability2.types @@ -14,7 +14,7 @@ module __test1__ { >interfaceWithPublicAndOptional : interfaceWithPublicAndOptional >{ one: 1 } : { one: number; } >one : number ->1 : number +>1 : 1 export var __val__obj4 = obj4; >__val__obj4 : interfaceWithPublicAndOptional diff --git a/tests/baselines/reference/assignmentCompatability3.types b/tests/baselines/reference/assignmentCompatability3.types index 67e553235ed..4525500cfec 100644 --- a/tests/baselines/reference/assignmentCompatability3.types +++ b/tests/baselines/reference/assignmentCompatability3.types @@ -14,7 +14,7 @@ module __test1__ { >interfaceWithPublicAndOptional : interfaceWithPublicAndOptional >{ one: 1 } : { one: number; } >one : number ->1 : number +>1 : 1 export var __val__obj4 = obj4; >__val__obj4 : interfaceWithPublicAndOptional @@ -27,7 +27,7 @@ module __test2__ { >obj : { one: number; } >{one: 1} : { one: number; } >one : number ->1 : number +>1 : 1 export var __val__obj = obj; >__val__obj : { one: number; } diff --git a/tests/baselines/reference/assignmentCompatability36.types b/tests/baselines/reference/assignmentCompatability36.types index b67be38e2b4..59ccc04195f 100644 --- a/tests/baselines/reference/assignmentCompatability36.types +++ b/tests/baselines/reference/assignmentCompatability36.types @@ -14,7 +14,7 @@ module __test1__ { >interfaceWithPublicAndOptional : interfaceWithPublicAndOptional >{ one: 1 } : { one: number; } >one : number ->1 : number +>1 : 1 export var __val__obj4 = obj4; >__val__obj4 : interfaceWithPublicAndOptional diff --git a/tests/baselines/reference/assignmentCompatability4.types b/tests/baselines/reference/assignmentCompatability4.types index 0cafbaa4dd7..bc5e805875c 100644 --- a/tests/baselines/reference/assignmentCompatability4.types +++ b/tests/baselines/reference/assignmentCompatability4.types @@ -14,7 +14,7 @@ module __test1__ { >interfaceWithPublicAndOptional : interfaceWithPublicAndOptional >{ one: 1 } : { one: number; } >one : number ->1 : number +>1 : 1 export var __val__obj4 = obj4; >__val__obj4 : interfaceWithPublicAndOptional diff --git a/tests/baselines/reference/assignmentCompatability5.types b/tests/baselines/reference/assignmentCompatability5.types index 8f8dbb0f649..755ce16ec69 100644 --- a/tests/baselines/reference/assignmentCompatability5.types +++ b/tests/baselines/reference/assignmentCompatability5.types @@ -14,7 +14,7 @@ module __test1__ { >interfaceWithPublicAndOptional : interfaceWithPublicAndOptional >{ one: 1 } : { one: number; } >one : number ->1 : number +>1 : 1 export var __val__obj4 = obj4; >__val__obj4 : interfaceWithPublicAndOptional @@ -32,7 +32,7 @@ module __test2__ { >interfaceOne : interfaceOne >{ one: 1 } : { one: number; } >one : number ->1 : number +>1 : 1 export var __val__obj1 = obj1; >__val__obj1 : interfaceOne diff --git a/tests/baselines/reference/assignmentCompatability6.types b/tests/baselines/reference/assignmentCompatability6.types index 1191ff8bc26..d437d5a7469 100644 --- a/tests/baselines/reference/assignmentCompatability6.types +++ b/tests/baselines/reference/assignmentCompatability6.types @@ -14,7 +14,7 @@ module __test1__ { >interfaceWithPublicAndOptional : interfaceWithPublicAndOptional >{ one: 1 } : { one: number; } >one : number ->1 : number +>1 : 1 export var __val__obj4 = obj4; >__val__obj4 : interfaceWithPublicAndOptional diff --git a/tests/baselines/reference/assignmentCompatability7.types b/tests/baselines/reference/assignmentCompatability7.types index 77b67514473..3dad9966d83 100644 --- a/tests/baselines/reference/assignmentCompatability7.types +++ b/tests/baselines/reference/assignmentCompatability7.types @@ -14,7 +14,7 @@ module __test1__ { >interfaceWithPublicAndOptional : interfaceWithPublicAndOptional >{ one: 1 } : { one: number; } >one : number ->1 : number +>1 : 1 export var __val__obj4 = obj4; >__val__obj4 : interfaceWithPublicAndOptional @@ -35,7 +35,7 @@ module __test2__ { >interfaceWithPublicAndOptional : interfaceWithPublicAndOptional >{ one: 1 } : { one: number; } >one : number ->1 : number +>1 : 1 export var __val__obj4 = obj4; >__val__obj4 : interfaceWithPublicAndOptional diff --git a/tests/baselines/reference/assignmentCompatability8.types b/tests/baselines/reference/assignmentCompatability8.types index 554f9b3caed..d4cc5ebc33e 100644 --- a/tests/baselines/reference/assignmentCompatability8.types +++ b/tests/baselines/reference/assignmentCompatability8.types @@ -14,7 +14,7 @@ module __test1__ { >interfaceWithPublicAndOptional : interfaceWithPublicAndOptional >{ one: 1 } : { one: number; } >one : number ->1 : number +>1 : 1 export var __val__obj4 = obj4; >__val__obj4 : interfaceWithPublicAndOptional @@ -31,7 +31,7 @@ module __test2__ { >x1 : classWithPublic >new classWithPublic(1) : classWithPublic >classWithPublic : typeof classWithPublic ->1 : number +>1 : 1 export var __val__x1 = x1; >__val__x1 : classWithPublic diff --git a/tests/baselines/reference/assignmentCompatability9.types b/tests/baselines/reference/assignmentCompatability9.types index d8fe3a764a4..671697f35f7 100644 --- a/tests/baselines/reference/assignmentCompatability9.types +++ b/tests/baselines/reference/assignmentCompatability9.types @@ -14,7 +14,7 @@ module __test1__ { >interfaceWithPublicAndOptional : interfaceWithPublicAndOptional >{ one: 1 } : { one: number; } >one : number ->1 : number +>1 : 1 export var __val__obj4 = obj4; >__val__obj4 : interfaceWithPublicAndOptional diff --git a/tests/baselines/reference/assignmentCompatability_checking-apply-member-off-of-function-interface.errors.txt b/tests/baselines/reference/assignmentCompatability_checking-apply-member-off-of-function-interface.errors.txt index 33a2269f747..e9adcba03b7 100644 --- a/tests/baselines/reference/assignmentCompatability_checking-apply-member-off-of-function-interface.errors.txt +++ b/tests/baselines/reference/assignmentCompatability_checking-apply-member-off-of-function-interface.errors.txt @@ -1,12 +1,12 @@ -tests/cases/compiler/assignmentCompatability_checking-apply-member-off-of-function-interface.ts(10,1): error TS2322: Type 'string' is not assignable to type 'Applicable'. +tests/cases/compiler/assignmentCompatability_checking-apply-member-off-of-function-interface.ts(10,1): error TS2322: Type '""' is not assignable to type 'Applicable'. tests/cases/compiler/assignmentCompatability_checking-apply-member-off-of-function-interface.ts(11,1): error TS2322: Type 'string[]' is not assignable to type 'Applicable'. Property 'apply' is missing in type 'string[]'. -tests/cases/compiler/assignmentCompatability_checking-apply-member-off-of-function-interface.ts(12,1): error TS2322: Type 'number' is not assignable to type 'Applicable'. +tests/cases/compiler/assignmentCompatability_checking-apply-member-off-of-function-interface.ts(12,1): error TS2322: Type '4' is not assignable to type 'Applicable'. tests/cases/compiler/assignmentCompatability_checking-apply-member-off-of-function-interface.ts(13,1): error TS2322: Type '{}' is not assignable to type 'Applicable'. Property 'apply' is missing in type '{}'. -tests/cases/compiler/assignmentCompatability_checking-apply-member-off-of-function-interface.ts(22,4): error TS2345: Argument of type 'string' is not assignable to parameter of type 'Applicable'. +tests/cases/compiler/assignmentCompatability_checking-apply-member-off-of-function-interface.ts(22,4): error TS2345: Argument of type '""' is not assignable to parameter of type 'Applicable'. tests/cases/compiler/assignmentCompatability_checking-apply-member-off-of-function-interface.ts(23,4): error TS2345: Argument of type 'string[]' is not assignable to parameter of type 'Applicable'. -tests/cases/compiler/assignmentCompatability_checking-apply-member-off-of-function-interface.ts(24,4): error TS2345: Argument of type 'number' is not assignable to parameter of type 'Applicable'. +tests/cases/compiler/assignmentCompatability_checking-apply-member-off-of-function-interface.ts(24,4): error TS2345: Argument of type '4' is not assignable to parameter of type 'Applicable'. tests/cases/compiler/assignmentCompatability_checking-apply-member-off-of-function-interface.ts(25,4): error TS2345: Argument of type '{}' is not assignable to parameter of type 'Applicable'. Property 'apply' is missing in type '{}'. @@ -23,14 +23,14 @@ tests/cases/compiler/assignmentCompatability_checking-apply-member-off-of-functi // Should fail x = ''; ~ -!!! error TS2322: Type 'string' is not assignable to type 'Applicable'. +!!! error TS2322: Type '""' is not assignable to type 'Applicable'. x = ['']; ~ !!! error TS2322: Type 'string[]' is not assignable to type 'Applicable'. !!! error TS2322: Property 'apply' is missing in type 'string[]'. x = 4; ~ -!!! error TS2322: Type 'number' is not assignable to type 'Applicable'. +!!! error TS2322: Type '4' is not assignable to type 'Applicable'. x = {}; ~ !!! error TS2322: Type '{}' is not assignable to type 'Applicable'. @@ -45,13 +45,13 @@ tests/cases/compiler/assignmentCompatability_checking-apply-member-off-of-functi // Should Fail fn(''); ~~ -!!! error TS2345: Argument of type 'string' is not assignable to parameter of type 'Applicable'. +!!! error TS2345: Argument of type '""' is not assignable to parameter of type 'Applicable'. fn(['']); ~~~~ !!! error TS2345: Argument of type 'string[]' is not assignable to parameter of type 'Applicable'. fn(4); ~ -!!! error TS2345: Argument of type 'number' is not assignable to parameter of type 'Applicable'. +!!! error TS2345: Argument of type '4' is not assignable to parameter of type 'Applicable'. fn({}); ~~ !!! error TS2345: Argument of type '{}' is not assignable to parameter of type 'Applicable'. diff --git a/tests/baselines/reference/assignmentCompatability_checking-call-member-off-of-function-interface.errors.txt b/tests/baselines/reference/assignmentCompatability_checking-call-member-off-of-function-interface.errors.txt index 1651e5082ee..17556302178 100644 --- a/tests/baselines/reference/assignmentCompatability_checking-call-member-off-of-function-interface.errors.txt +++ b/tests/baselines/reference/assignmentCompatability_checking-call-member-off-of-function-interface.errors.txt @@ -1,12 +1,12 @@ -tests/cases/compiler/assignmentCompatability_checking-call-member-off-of-function-interface.ts(10,1): error TS2322: Type 'string' is not assignable to type 'Callable'. +tests/cases/compiler/assignmentCompatability_checking-call-member-off-of-function-interface.ts(10,1): error TS2322: Type '""' is not assignable to type 'Callable'. tests/cases/compiler/assignmentCompatability_checking-call-member-off-of-function-interface.ts(11,1): error TS2322: Type 'string[]' is not assignable to type 'Callable'. Property 'call' is missing in type 'string[]'. -tests/cases/compiler/assignmentCompatability_checking-call-member-off-of-function-interface.ts(12,1): error TS2322: Type 'number' is not assignable to type 'Callable'. +tests/cases/compiler/assignmentCompatability_checking-call-member-off-of-function-interface.ts(12,1): error TS2322: Type '4' is not assignable to type 'Callable'. tests/cases/compiler/assignmentCompatability_checking-call-member-off-of-function-interface.ts(13,1): error TS2322: Type '{}' is not assignable to type 'Callable'. Property 'call' is missing in type '{}'. -tests/cases/compiler/assignmentCompatability_checking-call-member-off-of-function-interface.ts(22,4): error TS2345: Argument of type 'string' is not assignable to parameter of type 'Callable'. +tests/cases/compiler/assignmentCompatability_checking-call-member-off-of-function-interface.ts(22,4): error TS2345: Argument of type '""' is not assignable to parameter of type 'Callable'. tests/cases/compiler/assignmentCompatability_checking-call-member-off-of-function-interface.ts(23,4): error TS2345: Argument of type 'string[]' is not assignable to parameter of type 'Callable'. -tests/cases/compiler/assignmentCompatability_checking-call-member-off-of-function-interface.ts(24,4): error TS2345: Argument of type 'number' is not assignable to parameter of type 'Callable'. +tests/cases/compiler/assignmentCompatability_checking-call-member-off-of-function-interface.ts(24,4): error TS2345: Argument of type '4' is not assignable to parameter of type 'Callable'. tests/cases/compiler/assignmentCompatability_checking-call-member-off-of-function-interface.ts(25,4): error TS2345: Argument of type '{}' is not assignable to parameter of type 'Callable'. Property 'call' is missing in type '{}'. @@ -23,14 +23,14 @@ tests/cases/compiler/assignmentCompatability_checking-call-member-off-of-functio // Should fail x = ''; ~ -!!! error TS2322: Type 'string' is not assignable to type 'Callable'. +!!! error TS2322: Type '""' is not assignable to type 'Callable'. x = ['']; ~ !!! error TS2322: Type 'string[]' is not assignable to type 'Callable'. !!! error TS2322: Property 'call' is missing in type 'string[]'. x = 4; ~ -!!! error TS2322: Type 'number' is not assignable to type 'Callable'. +!!! error TS2322: Type '4' is not assignable to type 'Callable'. x = {}; ~ !!! error TS2322: Type '{}' is not assignable to type 'Callable'. @@ -45,13 +45,13 @@ tests/cases/compiler/assignmentCompatability_checking-call-member-off-of-functio // Should Fail fn(''); ~~ -!!! error TS2345: Argument of type 'string' is not assignable to parameter of type 'Callable'. +!!! error TS2345: Argument of type '""' is not assignable to parameter of type 'Callable'. fn(['']); ~~~~ !!! error TS2345: Argument of type 'string[]' is not assignable to parameter of type 'Callable'. fn(4); ~ -!!! error TS2345: Argument of type 'number' is not assignable to parameter of type 'Callable'. +!!! error TS2345: Argument of type '4' is not assignable to parameter of type 'Callable'. fn({}); ~~ !!! error TS2345: Argument of type '{}' is not assignable to parameter of type 'Callable'. diff --git a/tests/baselines/reference/assignmentLHSIsReference.types b/tests/baselines/reference/assignmentLHSIsReference.types index 47204740165..dfb3b236c0a 100644 --- a/tests/baselines/reference/assignmentLHSIsReference.types +++ b/tests/baselines/reference/assignmentLHSIsReference.types @@ -37,7 +37,7 @@ x3['a'] = value; >x3['a'] = value : any >x3['a'] : string >x3 : { a: string; } ->'a' : string +>'a' : "a" >value : any // parentheses, the contained expression is reference @@ -71,6 +71,6 @@ function fn2(x4: number) { >(x3['a']) : string >x3['a'] : string >x3 : { a: string; } ->'a' : string +>'a' : "a" >value : any diff --git a/tests/baselines/reference/assignmentNonObjectTypeConstraints.types b/tests/baselines/reference/assignmentNonObjectTypeConstraints.types index e2c3176940d..2037d058aff 100644 --- a/tests/baselines/reference/assignmentNonObjectTypeConstraints.types +++ b/tests/baselines/reference/assignmentNonObjectTypeConstraints.types @@ -1,9 +1,9 @@ === tests/cases/compiler/assignmentNonObjectTypeConstraints.ts === const enum E { A, B, C } >E : E ->A : E ->B : E ->C : E +>A : E.A +>B : E.B +>C : E.C function foo(x: T) { >foo : (x: T) => void diff --git a/tests/baselines/reference/assignmentStricterConstraints.types b/tests/baselines/reference/assignmentStricterConstraints.types index 3a72d92f51c..c1a7c86c744 100644 --- a/tests/baselines/reference/assignmentStricterConstraints.types +++ b/tests/baselines/reference/assignmentStricterConstraints.types @@ -34,6 +34,6 @@ g = f g(1, "") >g(1, "") : void >g : (x: T, y: S) => void ->1 : number ->"" : string +>1 : 1 +>"" : "" diff --git a/tests/baselines/reference/assignmentToParenthesizedExpression1.errors.txt b/tests/baselines/reference/assignmentToParenthesizedExpression1.errors.txt index 0b1b1e04de8..0a411828bf9 100644 --- a/tests/baselines/reference/assignmentToParenthesizedExpression1.errors.txt +++ b/tests/baselines/reference/assignmentToParenthesizedExpression1.errors.txt @@ -1,8 +1,11 @@ tests/cases/compiler/assignmentToParenthesizedExpression1.ts(2,1): error TS2364: Invalid left-hand side of assignment expression. +tests/cases/compiler/assignmentToParenthesizedExpression1.ts(2,2): error TS2695: Left side of comma operator is unused and has no side effects. -==== tests/cases/compiler/assignmentToParenthesizedExpression1.ts (1 errors) ==== +==== tests/cases/compiler/assignmentToParenthesizedExpression1.ts (2 errors) ==== var x; (1, x)=0; ~~~~~~ -!!! error TS2364: Invalid left-hand side of assignment expression. \ No newline at end of file +!!! error TS2364: Invalid left-hand side of assignment expression. + ~ +!!! error TS2695: Left side of comma operator is unused and has no side effects. \ No newline at end of file diff --git a/tests/baselines/reference/assignmentToParenthesizedIdentifiers.errors.txt b/tests/baselines/reference/assignmentToParenthesizedIdentifiers.errors.txt index a50ffdf72d7..b929704880e 100644 --- a/tests/baselines/reference/assignmentToParenthesizedIdentifiers.errors.txt +++ b/tests/baselines/reference/assignmentToParenthesizedIdentifiers.errors.txt @@ -1,8 +1,8 @@ -tests/cases/conformance/expressions/valuesAndReferences/assignmentToParenthesizedIdentifiers.ts(4,1): error TS2322: Type 'string' is not assignable to type 'number'. -tests/cases/conformance/expressions/valuesAndReferences/assignmentToParenthesizedIdentifiers.ts(5,1): error TS2322: Type 'string' is not assignable to type 'number'. -tests/cases/conformance/expressions/valuesAndReferences/assignmentToParenthesizedIdentifiers.ts(13,1): error TS2322: Type 'string' is not assignable to type 'number'. -tests/cases/conformance/expressions/valuesAndReferences/assignmentToParenthesizedIdentifiers.ts(14,1): error TS2322: Type 'string' is not assignable to type 'number'. -tests/cases/conformance/expressions/valuesAndReferences/assignmentToParenthesizedIdentifiers.ts(15,1): error TS2322: Type 'string' is not assignable to type 'number'. +tests/cases/conformance/expressions/valuesAndReferences/assignmentToParenthesizedIdentifiers.ts(4,1): error TS2322: Type '""' is not assignable to type 'number'. +tests/cases/conformance/expressions/valuesAndReferences/assignmentToParenthesizedIdentifiers.ts(5,1): error TS2322: Type '""' is not assignable to type 'number'. +tests/cases/conformance/expressions/valuesAndReferences/assignmentToParenthesizedIdentifiers.ts(13,1): error TS2322: Type '""' is not assignable to type 'number'. +tests/cases/conformance/expressions/valuesAndReferences/assignmentToParenthesizedIdentifiers.ts(14,1): error TS2322: Type '""' is not assignable to type 'number'. +tests/cases/conformance/expressions/valuesAndReferences/assignmentToParenthesizedIdentifiers.ts(15,1): error TS2322: Type '""' is not assignable to type 'number'. tests/cases/conformance/expressions/valuesAndReferences/assignmentToParenthesizedIdentifiers.ts(17,1): error TS2364: Invalid left-hand side of assignment expression. tests/cases/conformance/expressions/valuesAndReferences/assignmentToParenthesizedIdentifiers.ts(18,1): error TS2364: Invalid left-hand side of assignment expression. tests/cases/conformance/expressions/valuesAndReferences/assignmentToParenthesizedIdentifiers.ts(25,5): error TS2364: Invalid left-hand side of assignment expression. @@ -17,13 +17,13 @@ tests/cases/conformance/expressions/valuesAndReferences/assignmentToParenthesize Type 'string' is not assignable to type 'number'. tests/cases/conformance/expressions/valuesAndReferences/assignmentToParenthesizedIdentifiers.ts(37,1): error TS2364: Invalid left-hand side of assignment expression. tests/cases/conformance/expressions/valuesAndReferences/assignmentToParenthesizedIdentifiers.ts(38,1): error TS2364: Invalid left-hand side of assignment expression. -tests/cases/conformance/expressions/valuesAndReferences/assignmentToParenthesizedIdentifiers.ts(43,5): error TS2322: Type 'string' is not assignable to type 'number'. -tests/cases/conformance/expressions/valuesAndReferences/assignmentToParenthesizedIdentifiers.ts(44,5): error TS2322: Type 'string' is not assignable to type 'number'. -tests/cases/conformance/expressions/valuesAndReferences/assignmentToParenthesizedIdentifiers.ts(48,5): error TS2322: Type 'string' is not assignable to type 'number'. -tests/cases/conformance/expressions/valuesAndReferences/assignmentToParenthesizedIdentifiers.ts(49,5): error TS2322: Type 'string' is not assignable to type 'number'. -tests/cases/conformance/expressions/valuesAndReferences/assignmentToParenthesizedIdentifiers.ts(54,5): error TS2322: Type 'string' is not assignable to type 'number'. -tests/cases/conformance/expressions/valuesAndReferences/assignmentToParenthesizedIdentifiers.ts(55,5): error TS2322: Type 'string' is not assignable to type 'number'. -tests/cases/conformance/expressions/valuesAndReferences/assignmentToParenthesizedIdentifiers.ts(56,5): error TS2322: Type 'string' is not assignable to type 'number'. +tests/cases/conformance/expressions/valuesAndReferences/assignmentToParenthesizedIdentifiers.ts(43,5): error TS2322: Type '""' is not assignable to type 'number'. +tests/cases/conformance/expressions/valuesAndReferences/assignmentToParenthesizedIdentifiers.ts(44,5): error TS2322: Type '""' is not assignable to type 'number'. +tests/cases/conformance/expressions/valuesAndReferences/assignmentToParenthesizedIdentifiers.ts(48,5): error TS2322: Type '""' is not assignable to type 'number'. +tests/cases/conformance/expressions/valuesAndReferences/assignmentToParenthesizedIdentifiers.ts(49,5): error TS2322: Type '""' is not assignable to type 'number'. +tests/cases/conformance/expressions/valuesAndReferences/assignmentToParenthesizedIdentifiers.ts(54,5): error TS2322: Type '""' is not assignable to type 'number'. +tests/cases/conformance/expressions/valuesAndReferences/assignmentToParenthesizedIdentifiers.ts(55,5): error TS2322: Type '""' is not assignable to type 'number'. +tests/cases/conformance/expressions/valuesAndReferences/assignmentToParenthesizedIdentifiers.ts(56,5): error TS2322: Type '""' is not assignable to type 'number'. tests/cases/conformance/expressions/valuesAndReferences/assignmentToParenthesizedIdentifiers.ts(62,1): error TS2364: Invalid left-hand side of assignment expression. tests/cases/conformance/expressions/valuesAndReferences/assignmentToParenthesizedIdentifiers.ts(63,1): error TS2364: Invalid left-hand side of assignment expression. tests/cases/conformance/expressions/valuesAndReferences/assignmentToParenthesizedIdentifiers.ts(69,1): error TS2364: Invalid left-hand side of assignment expression. @@ -36,10 +36,10 @@ tests/cases/conformance/expressions/valuesAndReferences/assignmentToParenthesize (x) = 3; // OK x = ''; // Error ~ -!!! error TS2322: Type 'string' is not assignable to type 'number'. +!!! error TS2322: Type '""' is not assignable to type 'number'. (x) = ''; // Error ~~~ -!!! error TS2322: Type 'string' is not assignable to type 'number'. +!!! error TS2322: Type '""' is not assignable to type 'number'. module M { export var y: number; @@ -49,13 +49,13 @@ tests/cases/conformance/expressions/valuesAndReferences/assignmentToParenthesize (M.y) = 3; // OK M.y = ''; // Error ~~~ -!!! error TS2322: Type 'string' is not assignable to type 'number'. +!!! error TS2322: Type '""' is not assignable to type 'number'. (M).y = ''; // Error ~~~~~ -!!! error TS2322: Type 'string' is not assignable to type 'number'. +!!! error TS2322: Type '""' is not assignable to type 'number'. (M.y) = ''; // Error ~~~~~ -!!! error TS2322: Type 'string' is not assignable to type 'number'. +!!! error TS2322: Type '""' is not assignable to type 'number'. M = { y: 3 }; // Error ~ @@ -107,32 +107,32 @@ tests/cases/conformance/expressions/valuesAndReferences/assignmentToParenthesize (x) = 3; // OK x = ''; // Error ~ -!!! error TS2322: Type 'string' is not assignable to type 'number'. +!!! error TS2322: Type '""' is not assignable to type 'number'. (x) = ''; // Error ~~~ -!!! error TS2322: Type 'string' is not assignable to type 'number'. +!!! error TS2322: Type '""' is not assignable to type 'number'. (y).t = 3; // OK (y.t) = 3; // OK (y).t = ''; // Error ~~~~~ -!!! error TS2322: Type 'string' is not assignable to type 'number'. +!!! error TS2322: Type '""' is not assignable to type 'number'. (y.t) = ''; // Error ~~~~~ -!!! error TS2322: Type 'string' is not assignable to type 'number'. +!!! error TS2322: Type '""' is not assignable to type 'number'. y['t'] = 3; // OK (y)['t'] = 3; // OK (y['t']) = 3; // OK y['t'] = ''; // Error ~~~~~~ -!!! error TS2322: Type 'string' is not assignable to type 'number'. +!!! error TS2322: Type '""' is not assignable to type 'number'. (y)['t'] = ''; // Error ~~~~~~~~ -!!! error TS2322: Type 'string' is not assignable to type 'number'. +!!! error TS2322: Type '""' is not assignable to type 'number'. (y['t']) = ''; // Error ~~~~~~~~ -!!! error TS2322: Type 'string' is not assignable to type 'number'. +!!! error TS2322: Type '""' is not assignable to type 'number'. } enum E { diff --git a/tests/baselines/reference/assignmentTypeNarrowing.types b/tests/baselines/reference/assignmentTypeNarrowing.types index be99a31501d..8c5fea315ce 100644 --- a/tests/baselines/reference/assignmentTypeNarrowing.types +++ b/tests/baselines/reference/assignmentTypeNarrowing.types @@ -4,71 +4,71 @@ let x: string | number | boolean | RegExp; >RegExp : RegExp x = ""; ->x = "" : string +>x = "" : "" >x : string | number | boolean | RegExp ->"" : string +>"" : "" x; // string >x : string [x] = [true]; ->[x] = [true] : [boolean] +>[x] = [true] : [true] >[x] : [string | number | boolean | RegExp] >x : string | number | boolean | RegExp ->[true] : [boolean] ->true : boolean +>[true] : [true] +>true : true x; // boolean ->x : boolean +>x : true [x = ""] = [1]; >[x = ""] = [1] : [number] >[x = ""] : [string] ->x = "" : string +>x = "" : "" >x : string | number | boolean | RegExp ->"" : string +>"" : "" >[1] : [number] ->1 : number +>1 : 1 x; // string | number >x : string | number ({x} = {x: true}); ->({x} = {x: true}) : { x: boolean; } ->{x} = {x: true} : { x: boolean; } +>({x} = {x: true}) : { x: true; } +>{x} = {x: true} : { x: true; } >{x} : { x: string | number | boolean | RegExp; } >x : string | number | boolean | RegExp ->{x: true} : { x: boolean; } +>{x: true} : { x: true; } >x : boolean ->true : boolean +>true : true x; // boolean ->x : boolean +>x : true ({y: x} = {y: 1}); ->({y: x} = {y: 1}) : { y: number; } ->{y: x} = {y: 1} : { y: number; } +>({y: x} = {y: 1}) : { y: 1; } +>{y: x} = {y: 1} : { y: 1; } >{y: x} : { y: string | number | boolean | RegExp; } >y : string | number | boolean | RegExp >x : string | number | boolean | RegExp ->{y: 1} : { y: number; } +>{y: 1} : { y: 1; } >y : number ->1 : number +>1 : 1 x; // number >x : number ({x = ""} = {x: true}); ->({x = ""} = {x: true}) : { x?: boolean; } ->{x = ""} = {x: true} : { x?: boolean; } +>({x = ""} = {x: true}) : { x?: true; } +>{x = ""} = {x: true} : { x?: true; } >{x = ""} : { x?: string | number | boolean | RegExp; } >x : string | number | boolean | RegExp ->{x: true} : { x?: boolean; } +>{x: true} : { x?: true; } >x : boolean ->true : boolean +>true : true x; // string | boolean ->x : string | boolean +>x : string | true ({y: x = /a/} = {y: 1}); >({y: x = /a/} = {y: 1}) : { y?: number; } @@ -80,7 +80,7 @@ x; // string | boolean >/a/ : RegExp >{y: 1} : { y?: number; } >y : number ->1 : number +>1 : 1 x; // number | RegExp >x : number | RegExp diff --git a/tests/baselines/reference/assignments.errors.txt b/tests/baselines/reference/assignments.errors.txt index 05bc4ce1794..2e637a6c720 100644 --- a/tests/baselines/reference/assignments.errors.txt +++ b/tests/baselines/reference/assignments.errors.txt @@ -3,7 +3,7 @@ tests/cases/conformance/expressions/valuesAndReferences/assignments.ts(14,1): er tests/cases/conformance/expressions/valuesAndReferences/assignments.ts(17,1): error TS2364: Invalid left-hand side of assignment expression. tests/cases/conformance/expressions/valuesAndReferences/assignments.ts(18,1): error TS2450: Left-hand side of assignment expression cannot be a constant or a read-only property. tests/cases/conformance/expressions/valuesAndReferences/assignments.ts(21,1): error TS2364: Invalid left-hand side of assignment expression. -tests/cases/conformance/expressions/valuesAndReferences/assignments.ts(31,1): error TS2304: Cannot find name 'I'. +tests/cases/conformance/expressions/valuesAndReferences/assignments.ts(31,1): error TS2693: 'I' only refers to a type, but is being used as a value here. ==== tests/cases/conformance/expressions/valuesAndReferences/assignments.ts (6 errors) ==== @@ -49,4 +49,4 @@ tests/cases/conformance/expressions/valuesAndReferences/assignments.ts(31,1): er interface I { } I = null; // Error ~ -!!! error TS2304: Cannot find name 'I'. \ No newline at end of file +!!! error TS2693: 'I' only refers to a type, but is being used as a value here. \ No newline at end of file diff --git a/tests/baselines/reference/asyncAwaitIsolatedModules_es5.js b/tests/baselines/reference/asyncAwaitIsolatedModules_es5.js index 95416f3aaa2..7eb2157c026 100644 --- a/tests/baselines/reference/asyncAwaitIsolatedModules_es5.js +++ b/tests/baselines/reference/asyncAwaitIsolatedModules_es5.js @@ -50,41 +50,31 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge }); }; var __generator = (this && this.__generator) || function (thisArg, body) { - var _ = { label: 0, sent: function() { if (sent[0] === 1) throw sent[1]; return sent[1]; }, trys: [], stack: [] }, sent, f; + var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t; + return { next: verb(0), "throw": verb(1), "return": verb(2) }; + function verb(n) { return function (v) { return step([n, v]); }; } function step(op) { if (f) throw new TypeError("Generator is already executing."); - while (1) { - if (_.done) switch (op[0]) { - case 0: return { value: void 0, done: true }; - case 1: case 6: throw op[1]; - case 2: return { value: op[1], done: true }; + while (_) try { + if (f = 1, y && (t = y[op[0] & 2 ? "return" : op[0] ? "throw" : "next"]) && !(t = t.call(y, op[1])).done) return t; + if (y = 0, t) op = [0, t.value]; + switch (op[0]) { + case 0: case 1: t = op; break; + case 4: _.label++; return { value: op[1], done: false }; + case 5: _.label++; y = op[1]; op = [0]; continue; + case 7: op = _.ops.pop(); _.trys.pop(); continue; + default: + if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } + if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } + if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } + if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } + if (t[2]) _.ops.pop(); + _.trys.pop(); continue; } - try { - switch (f = 1, op[0]) { - case 0: case 1: sent = op; break; - case 4: return _.label++, { value: op[1], done: false }; - case 7: op = _.stack.pop(), _.trys.pop(); continue; - default: - var r = _.trys.length > 0 && _.trys[_.trys.length - 1]; - if (!r && (op[0] === 6 || op[0] === 2)) { _.done = 1; continue; } - if (op[0] === 3 && (!r || (op[1] > r[0] && op[1] < r[3]))) { _.label = op[1]; break; } - if (op[0] === 6 && _.label < r[1]) { _.label = r[1], sent = op; break; } - if (r && _.label < r[2]) { _.label = r[2], _.stack.push(op); break; } - if (r[2]) { _.stack.pop(); } - _.trys.pop(); - continue; - } - op = body.call(thisArg, _); - } - catch (e) { op = [6, e]; } - finally { f = 0, sent = void 0; } - } + op = body.call(thisArg, _); + } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } + if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; } - return { - next: function (v) { return step([0, v]); }, - "throw": function (v) { return step([1, v]); }, - "return": function (v) { return step([2, v]); } - }; }; var _this = this; function f0() { diff --git a/tests/baselines/reference/asyncAwaitWithCapturedBlockScopeVar.js b/tests/baselines/reference/asyncAwaitWithCapturedBlockScopeVar.js new file mode 100644 index 00000000000..49566904ae1 --- /dev/null +++ b/tests/baselines/reference/asyncAwaitWithCapturedBlockScopeVar.js @@ -0,0 +1,182 @@ +//// [asyncAwaitWithCapturedBlockScopeVar.ts] +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 { + let ar = []; + for (let i = 0; i < 1; i++) { + await 1; + ar.push(() => i); + return 1; + } +} + + +//// [asyncAwaitWithCapturedBlockScopeVar.js] +function fn1() { + return __awaiter(this, void 0, void 0, function () { + var ar, _loop_1, i; + return __generator(this, function (_a) { + switch (_a.label) { + case 0: + ar = []; + _loop_1 = function (i) { + return __generator(this, function (_a) { + switch (_a.label) { + case 0: return [4 /*yield*/, 1]; + case 1: + _a.sent(); + ar.push(function () { return i; }); + return [2 /*return*/]; + } + }); + }; + i = 0; + _a.label = 1; + case 1: + if (!(i < 1)) + return [3 /*break*/, 4]; + return [5 /*yield**/, _loop_1(i)]; + case 2: + _a.sent(); + _a.label = 3; + case 3: + i++; + return [3 /*break*/, 1]; + case 4: return [2 /*return*/]; + } + }); + }); +} +function fn2() { + return __awaiter(this, void 0, void 0, function () { + var ar, _loop_2, i, state_1; + return __generator(this, function (_a) { + switch (_a.label) { + case 0: + ar = []; + _loop_2 = function (i) { + return __generator(this, function (_a) { + switch (_a.label) { + case 0: return [4 /*yield*/, 1]; + case 1: + _a.sent(); + ar.push(function () { return i; }); + return [2 /*return*/, "break"]; + } + }); + }; + i = 0; + _a.label = 1; + case 1: + if (!(i < 1)) + return [3 /*break*/, 4]; + return [5 /*yield**/, _loop_2(i)]; + case 2: + state_1 = _a.sent(); + if (state_1 === "break") + return [3 /*break*/, 4]; + _a.label = 3; + case 3: + i++; + return [3 /*break*/, 1]; + case 4: return [2 /*return*/]; + } + }); + }); +} +function fn3() { + return __awaiter(this, void 0, void 0, function () { + var ar, _loop_3, i; + return __generator(this, function (_a) { + switch (_a.label) { + case 0: + ar = []; + _loop_3 = function (i) { + return __generator(this, function (_a) { + switch (_a.label) { + case 0: return [4 /*yield*/, 1]; + case 1: + _a.sent(); + ar.push(function () { return i; }); + return [2 /*return*/, "continue"]; + } + }); + }; + i = 0; + _a.label = 1; + case 1: + if (!(i < 1)) + return [3 /*break*/, 4]; + return [5 /*yield**/, _loop_3(i)]; + case 2: + _a.sent(); + _a.label = 3; + case 3: + i++; + return [3 /*break*/, 1]; + case 4: return [2 /*return*/]; + } + }); + }); +} +function fn4() { + return __awaiter(this, void 0, void 0, function () { + var ar, _loop_4, i, state_2; + return __generator(this, function (_a) { + switch (_a.label) { + case 0: + ar = []; + _loop_4 = function (i) { + return __generator(this, function (_a) { + switch (_a.label) { + case 0: return [4 /*yield*/, 1]; + case 1: + _a.sent(); + ar.push(function () { return i; }); + return [2 /*return*/, { value: 1 }]; + } + }); + }; + i = 0; + _a.label = 1; + case 1: + if (!(i < 1)) + return [3 /*break*/, 4]; + return [5 /*yield**/, _loop_4(i)]; + case 2: + state_2 = _a.sent(); + if (typeof state_2 === "object") + return [2 /*return*/, state_2.value]; + _a.label = 3; + case 3: + i++; + return [3 /*break*/, 1]; + case 4: return [2 /*return*/]; + } + }); + }); +} diff --git a/tests/baselines/reference/asyncAwaitWithCapturedBlockScopeVar.symbols b/tests/baselines/reference/asyncAwaitWithCapturedBlockScopeVar.symbols new file mode 100644 index 00000000000..12a60509f4f --- /dev/null +++ b/tests/baselines/reference/asyncAwaitWithCapturedBlockScopeVar.symbols @@ -0,0 +1,88 @@ +=== tests/cases/compiler/asyncAwaitWithCapturedBlockScopeVar.ts === +async function fn1() { +>fn1 : Symbol(fn1, Decl(asyncAwaitWithCapturedBlockScopeVar.ts, 0, 0)) + + let ar = []; +>ar : Symbol(ar, Decl(asyncAwaitWithCapturedBlockScopeVar.ts, 1, 7)) + + for (let i = 0; i < 1; i++) { +>i : Symbol(i, Decl(asyncAwaitWithCapturedBlockScopeVar.ts, 2, 12)) +>i : Symbol(i, Decl(asyncAwaitWithCapturedBlockScopeVar.ts, 2, 12)) +>i : Symbol(i, Decl(asyncAwaitWithCapturedBlockScopeVar.ts, 2, 12)) + + await 1; + ar.push(() => i); +>ar.push : Symbol(Array.push, Decl(lib.es5.d.ts, --, --)) +>ar : Symbol(ar, Decl(asyncAwaitWithCapturedBlockScopeVar.ts, 1, 7)) +>push : Symbol(Array.push, Decl(lib.es5.d.ts, --, --)) +>i : Symbol(i, Decl(asyncAwaitWithCapturedBlockScopeVar.ts, 2, 12)) + } +} + +async function fn2() { +>fn2 : Symbol(fn2, Decl(asyncAwaitWithCapturedBlockScopeVar.ts, 6, 1)) + + let ar = []; +>ar : Symbol(ar, Decl(asyncAwaitWithCapturedBlockScopeVar.ts, 9, 7)) + + for (let i = 0; i < 1; i++) { +>i : Symbol(i, Decl(asyncAwaitWithCapturedBlockScopeVar.ts, 10, 12)) +>i : Symbol(i, Decl(asyncAwaitWithCapturedBlockScopeVar.ts, 10, 12)) +>i : Symbol(i, Decl(asyncAwaitWithCapturedBlockScopeVar.ts, 10, 12)) + + await 1; + ar.push(() => i); +>ar.push : Symbol(Array.push, Decl(lib.es5.d.ts, --, --)) +>ar : Symbol(ar, Decl(asyncAwaitWithCapturedBlockScopeVar.ts, 9, 7)) +>push : Symbol(Array.push, Decl(lib.es5.d.ts, --, --)) +>i : Symbol(i, Decl(asyncAwaitWithCapturedBlockScopeVar.ts, 10, 12)) + + break; + } +} + +async function fn3() { +>fn3 : Symbol(fn3, Decl(asyncAwaitWithCapturedBlockScopeVar.ts, 15, 1)) + + let ar = []; +>ar : Symbol(ar, Decl(asyncAwaitWithCapturedBlockScopeVar.ts, 18, 7)) + + for (let i = 0; i < 1; i++) { +>i : Symbol(i, Decl(asyncAwaitWithCapturedBlockScopeVar.ts, 19, 12)) +>i : Symbol(i, Decl(asyncAwaitWithCapturedBlockScopeVar.ts, 19, 12)) +>i : Symbol(i, Decl(asyncAwaitWithCapturedBlockScopeVar.ts, 19, 12)) + + await 1; + ar.push(() => i); +>ar.push : Symbol(Array.push, Decl(lib.es5.d.ts, --, --)) +>ar : Symbol(ar, Decl(asyncAwaitWithCapturedBlockScopeVar.ts, 18, 7)) +>push : Symbol(Array.push, Decl(lib.es5.d.ts, --, --)) +>i : Symbol(i, Decl(asyncAwaitWithCapturedBlockScopeVar.ts, 19, 12)) + + continue; + } +} + +async function fn4(): Promise { +>fn4 : Symbol(fn4, Decl(asyncAwaitWithCapturedBlockScopeVar.ts, 24, 1)) +>Promise : Symbol(Promise, Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --)) + + let ar = []; +>ar : Symbol(ar, Decl(asyncAwaitWithCapturedBlockScopeVar.ts, 27, 7)) + + for (let i = 0; i < 1; i++) { +>i : Symbol(i, Decl(asyncAwaitWithCapturedBlockScopeVar.ts, 28, 12)) +>i : Symbol(i, Decl(asyncAwaitWithCapturedBlockScopeVar.ts, 28, 12)) +>i : Symbol(i, Decl(asyncAwaitWithCapturedBlockScopeVar.ts, 28, 12)) + + await 1; + ar.push(() => i); +>ar.push : Symbol(Array.push, Decl(lib.es5.d.ts, --, --)) +>ar : Symbol(ar, Decl(asyncAwaitWithCapturedBlockScopeVar.ts, 27, 7)) +>push : Symbol(Array.push, Decl(lib.es5.d.ts, --, --)) +>i : Symbol(i, Decl(asyncAwaitWithCapturedBlockScopeVar.ts, 28, 12)) + + return 1; + } +} + diff --git a/tests/baselines/reference/asyncAwaitWithCapturedBlockScopeVar.types b/tests/baselines/reference/asyncAwaitWithCapturedBlockScopeVar.types new file mode 100644 index 00000000000..424959ddb22 --- /dev/null +++ b/tests/baselines/reference/asyncAwaitWithCapturedBlockScopeVar.types @@ -0,0 +1,129 @@ +=== tests/cases/compiler/asyncAwaitWithCapturedBlockScopeVar.ts === +async function fn1() { +>fn1 : () => Promise + + let ar = []; +>ar : any[] +>[] : undefined[] + + for (let i = 0; i < 1; i++) { +>i : number +>0 : 0 +>i < 1 : boolean +>i : number +>1 : 1 +>i++ : number +>i : number + + await 1; +>await 1 : 1 +>1 : 1 + + ar.push(() => i); +>ar.push(() => i) : number +>ar.push : (...items: any[]) => number +>ar : any[] +>push : (...items: any[]) => number +>() => i : () => number +>i : number + } +} + +async function fn2() { +>fn2 : () => Promise + + let ar = []; +>ar : any[] +>[] : undefined[] + + for (let i = 0; i < 1; i++) { +>i : number +>0 : 0 +>i < 1 : boolean +>i : number +>1 : 1 +>i++ : number +>i : number + + await 1; +>await 1 : 1 +>1 : 1 + + ar.push(() => i); +>ar.push(() => i) : number +>ar.push : (...items: any[]) => number +>ar : any[] +>push : (...items: any[]) => number +>() => i : () => number +>i : number + + break; + } +} + +async function fn3() { +>fn3 : () => Promise + + let ar = []; +>ar : any[] +>[] : undefined[] + + for (let i = 0; i < 1; i++) { +>i : number +>0 : 0 +>i < 1 : boolean +>i : number +>1 : 1 +>i++ : number +>i : number + + await 1; +>await 1 : 1 +>1 : 1 + + ar.push(() => i); +>ar.push(() => i) : number +>ar.push : (...items: any[]) => number +>ar : any[] +>push : (...items: any[]) => number +>() => i : () => number +>i : number + + continue; + } +} + +async function fn4(): Promise { +>fn4 : () => Promise +>Promise : Promise + + let ar = []; +>ar : any[] +>[] : undefined[] + + for (let i = 0; i < 1; i++) { +>i : number +>0 : 0 +>i < 1 : boolean +>i : number +>1 : 1 +>i++ : number +>i : number + + await 1; +>await 1 : 1 +>1 : 1 + + ar.push(() => i); +>ar.push(() => i) : number +>ar.push : (...items: any[]) => number +>ar : any[] +>push : (...items: any[]) => number +>() => i : () => number +>i : number + + return 1; +>1 : 1 + } +} + diff --git a/tests/baselines/reference/asyncAwait_es5.js b/tests/baselines/reference/asyncAwait_es5.js index e148de70ad2..67f7d000351 100644 --- a/tests/baselines/reference/asyncAwait_es5.js +++ b/tests/baselines/reference/asyncAwait_es5.js @@ -49,41 +49,31 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge }); }; var __generator = (this && this.__generator) || function (thisArg, body) { - var _ = { label: 0, sent: function() { if (sent[0] === 1) throw sent[1]; return sent[1]; }, trys: [], stack: [] }, sent, f; + var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t; + return { next: verb(0), "throw": verb(1), "return": verb(2) }; + function verb(n) { return function (v) { return step([n, v]); }; } function step(op) { if (f) throw new TypeError("Generator is already executing."); - while (1) { - if (_.done) switch (op[0]) { - case 0: return { value: void 0, done: true }; - case 1: case 6: throw op[1]; - case 2: return { value: op[1], done: true }; + while (_) try { + if (f = 1, y && (t = y[op[0] & 2 ? "return" : op[0] ? "throw" : "next"]) && !(t = t.call(y, op[1])).done) return t; + if (y = 0, t) op = [0, t.value]; + switch (op[0]) { + case 0: case 1: t = op; break; + case 4: _.label++; return { value: op[1], done: false }; + case 5: _.label++; y = op[1]; op = [0]; continue; + case 7: op = _.ops.pop(); _.trys.pop(); continue; + default: + if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } + if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } + if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } + if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } + if (t[2]) _.ops.pop(); + _.trys.pop(); continue; } - try { - switch (f = 1, op[0]) { - case 0: case 1: sent = op; break; - case 4: return _.label++, { value: op[1], done: false }; - case 7: op = _.stack.pop(), _.trys.pop(); continue; - default: - var r = _.trys.length > 0 && _.trys[_.trys.length - 1]; - if (!r && (op[0] === 6 || op[0] === 2)) { _.done = 1; continue; } - if (op[0] === 3 && (!r || (op[1] > r[0] && op[1] < r[3]))) { _.label = op[1]; break; } - if (op[0] === 6 && _.label < r[1]) { _.label = r[1], sent = op; break; } - if (r && _.label < r[2]) { _.label = r[2], _.stack.push(op); break; } - if (r[2]) { _.stack.pop(); } - _.trys.pop(); - continue; - } - op = body.call(thisArg, _); - } - catch (e) { op = [6, e]; } - finally { f = 0, sent = void 0; } - } + op = body.call(thisArg, _); + } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } + if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; } - return { - next: function (v) { return step([0, v]); }, - "throw": function (v) { return step([1, v]); }, - "return": function (v) { return step([2, v]); } - }; }; var _this = this; function f0() { diff --git a/tests/baselines/reference/asyncFunctionDeclaration15_es5.errors.txt b/tests/baselines/reference/asyncFunctionDeclaration15_es5.errors.txt index 62c64f2cd54..3ea03927aa9 100644 --- a/tests/baselines/reference/asyncFunctionDeclaration15_es5.errors.txt +++ b/tests/baselines/reference/asyncFunctionDeclaration15_es5.errors.txt @@ -6,7 +6,7 @@ tests/cases/conformance/async/es5/functionDeclarations/asyncFunctionDeclaration1 tests/cases/conformance/async/es5/functionDeclarations/asyncFunctionDeclaration15_es5.ts(10,23): error TS1055: Type 'typeof Thenable' is not a valid async function return type. Type 'Thenable' is not assignable to type 'PromiseLike'. Types of property 'then' are incompatible. - Type '() => void' is not assignable to type '{ (onfulfilled?: (value: any) => TResult | PromiseLike, onrejected?: (reason: any) => TResult | PromiseLike): PromiseLike; (onfulfilled?: (value: any) => TResult | PromiseLike, onrejected?: (reason: any) => void): PromiseLike; }'. + Type '() => void' is not assignable to type '{ (onfulfilled?: (value: any) => any, onrejected?: (reason: any) => any): PromiseLike; (onfulfilled: (value: any) => any, onrejected: (reason: any) => TResult | PromiseLike): PromiseLike; (onfulfilled: (value: any) => TResult | PromiseLike, onrejected?: (reason: any) => TResult | PromiseLike): PromiseLike; (onfulfilled: (value: any) => TResult1 | PromiseLike, onrejected: (reason: any) => TResult2 | PromiseLike): PromiseLike; }'. Type 'void' is not assignable to type 'PromiseLike'. tests/cases/conformance/async/es5/functionDeclarations/asyncFunctionDeclaration15_es5.ts(17,16): error TS1059: Return expression in async function does not have a valid callable 'then' member. tests/cases/conformance/async/es5/functionDeclarations/asyncFunctionDeclaration15_es5.ts(23,25): error TS1058: Operand for 'await' does not have a valid callable 'then' member. @@ -37,7 +37,7 @@ tests/cases/conformance/async/es5/functionDeclarations/asyncFunctionDeclaration1 !!! error TS1055: Type 'typeof Thenable' is not a valid async function return type. !!! error TS1055: Type 'Thenable' is not assignable to type 'PromiseLike'. !!! error TS1055: Types of property 'then' are incompatible. -!!! error TS1055: Type '() => void' is not assignable to type '{ (onfulfilled?: (value: any) => TResult | PromiseLike, onrejected?: (reason: any) => TResult | PromiseLike): PromiseLike; (onfulfilled?: (value: any) => TResult | PromiseLike, onrejected?: (reason: any) => void): PromiseLike; }'. +!!! error TS1055: Type '() => void' is not assignable to type '{ (onfulfilled?: (value: any) => any, onrejected?: (reason: any) => any): PromiseLike; (onfulfilled: (value: any) => any, onrejected: (reason: any) => TResult | PromiseLike): PromiseLike; (onfulfilled: (value: any) => TResult | PromiseLike, onrejected?: (reason: any) => TResult | PromiseLike): PromiseLike; (onfulfilled: (value: any) => TResult1 | PromiseLike, onrejected: (reason: any) => TResult2 | PromiseLike): PromiseLike; }'. !!! error TS1055: Type 'void' is not assignable to type 'PromiseLike'. async function fn7() { return; } // valid: Promise async function fn8() { return 1; } // valid: Promise diff --git a/tests/baselines/reference/asyncFunctionNoReturnType.js b/tests/baselines/reference/asyncFunctionNoReturnType.js index a3635b85a09..fc7b0b52f1c 100644 --- a/tests/baselines/reference/asyncFunctionNoReturnType.js +++ b/tests/baselines/reference/asyncFunctionNoReturnType.js @@ -15,41 +15,31 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge }); }; var __generator = (this && this.__generator) || function (thisArg, body) { - var _ = { label: 0, sent: function() { if (sent[0] === 1) throw sent[1]; return sent[1]; }, trys: [], stack: [] }, sent, f; + var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t; + return { next: verb(0), "throw": verb(1), "return": verb(2) }; + function verb(n) { return function (v) { return step([n, v]); }; } function step(op) { if (f) throw new TypeError("Generator is already executing."); - while (1) { - if (_.done) switch (op[0]) { - case 0: return { value: void 0, done: true }; - case 1: case 6: throw op[1]; - case 2: return { value: op[1], done: true }; + while (_) try { + if (f = 1, y && (t = y[op[0] & 2 ? "return" : op[0] ? "throw" : "next"]) && !(t = t.call(y, op[1])).done) return t; + if (y = 0, t) op = [0, t.value]; + switch (op[0]) { + case 0: case 1: t = op; break; + case 4: _.label++; return { value: op[1], done: false }; + case 5: _.label++; y = op[1]; op = [0]; continue; + case 7: op = _.ops.pop(); _.trys.pop(); continue; + default: + if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } + if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } + if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } + if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } + if (t[2]) _.ops.pop(); + _.trys.pop(); continue; } - try { - switch (f = 1, op[0]) { - case 0: case 1: sent = op; break; - case 4: return _.label++, { value: op[1], done: false }; - case 7: op = _.stack.pop(), _.trys.pop(); continue; - default: - var r = _.trys.length > 0 && _.trys[_.trys.length - 1]; - if (!r && (op[0] === 6 || op[0] === 2)) { _.done = 1; continue; } - if (op[0] === 3 && (!r || (op[1] > r[0] && op[1] < r[3]))) { _.label = op[1]; break; } - if (op[0] === 6 && _.label < r[1]) { _.label = r[1], sent = op; break; } - if (r && _.label < r[2]) { _.label = r[2], _.stack.push(op); break; } - if (r[2]) { _.stack.pop(); } - _.trys.pop(); - continue; - } - op = body.call(thisArg, _); - } - catch (e) { op = [6, e]; } - finally { f = 0, sent = void 0; } - } + op = body.call(thisArg, _); + } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } + if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; } - return { - next: function (v) { return step([0, v]); }, - "throw": function (v) { return step([1, v]); }, - "return": function (v) { return step([2, v]); } - }; }; var _this = this; (function () { return __awaiter(_this, void 0, void 0, function () { diff --git a/tests/baselines/reference/asyncFunctionReturnType.types b/tests/baselines/reference/asyncFunctionReturnType.types index c6289ab012d..db9f8e42d52 100644 --- a/tests/baselines/reference/asyncFunctionReturnType.types +++ b/tests/baselines/reference/asyncFunctionReturnType.types @@ -5,8 +5,8 @@ async function fAsync() { // Without explicit type annotation, this is just an array. return [1, true]; >[1, true] : (number | boolean)[] ->1 : number ->true : boolean +>1 : 1 +>true : true } async function fAsyncExplicit(): Promise<[number, boolean]> { @@ -15,8 +15,8 @@ async function fAsyncExplicit(): Promise<[number, boolean]> { // This is contextually typed as a tuple. return [1, true]; ->[1, true] : [number, boolean] ->1 : number ->true : boolean +>[1, true] : [number, true] +>1 : 1 +>true : true } diff --git a/tests/baselines/reference/asyncImportedPromise_es5.js b/tests/baselines/reference/asyncImportedPromise_es5.js index 54d1b0fdac8..0e6e8d51501 100644 --- a/tests/baselines/reference/asyncImportedPromise_es5.js +++ b/tests/baselines/reference/asyncImportedPromise_es5.js @@ -35,41 +35,31 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge }); }; var __generator = (this && this.__generator) || function (thisArg, body) { - var _ = { label: 0, sent: function() { if (sent[0] === 1) throw sent[1]; return sent[1]; }, trys: [], stack: [] }, sent, f; + var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t; + return { next: verb(0), "throw": verb(1), "return": verb(2) }; + function verb(n) { return function (v) { return step([n, v]); }; } function step(op) { if (f) throw new TypeError("Generator is already executing."); - while (1) { - if (_.done) switch (op[0]) { - case 0: return { value: void 0, done: true }; - case 1: case 6: throw op[1]; - case 2: return { value: op[1], done: true }; + while (_) try { + if (f = 1, y && (t = y[op[0] & 2 ? "return" : op[0] ? "throw" : "next"]) && !(t = t.call(y, op[1])).done) return t; + if (y = 0, t) op = [0, t.value]; + switch (op[0]) { + case 0: case 1: t = op; break; + case 4: _.label++; return { value: op[1], done: false }; + case 5: _.label++; y = op[1]; op = [0]; continue; + case 7: op = _.ops.pop(); _.trys.pop(); continue; + default: + if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } + if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } + if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } + if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } + if (t[2]) _.ops.pop(); + _.trys.pop(); continue; } - try { - switch (f = 1, op[0]) { - case 0: case 1: sent = op; break; - case 4: return _.label++, { value: op[1], done: false }; - case 7: op = _.stack.pop(), _.trys.pop(); continue; - default: - var r = _.trys.length > 0 && _.trys[_.trys.length - 1]; - if (!r && (op[0] === 6 || op[0] === 2)) { _.done = 1; continue; } - if (op[0] === 3 && (!r || (op[1] > r[0] && op[1] < r[3]))) { _.label = op[1]; break; } - if (op[0] === 6 && _.label < r[1]) { _.label = r[1], sent = op; break; } - if (r && _.label < r[2]) { _.label = r[2], _.stack.push(op); break; } - if (r[2]) { _.stack.pop(); } - _.trys.pop(); - continue; - } - op = body.call(thisArg, _); - } - catch (e) { op = [6, e]; } - finally { f = 0, sent = void 0; } - } + op = body.call(thisArg, _); + } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } + if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; } - return { - next: function (v) { return step([0, v]); }, - "throw": function (v) { return step([1, v]); }, - "return": function (v) { return step([2, v]); } - }; }; var task_1 = require("./task"); var Test = (function () { diff --git a/tests/baselines/reference/asyncMethodWithSuper_es5.types b/tests/baselines/reference/asyncMethodWithSuper_es5.types index 4d14528409c..4622d83a679 100644 --- a/tests/baselines/reference/asyncMethodWithSuper_es5.types +++ b/tests/baselines/reference/asyncMethodWithSuper_es5.types @@ -27,7 +27,7 @@ class B extends A { >super["x"]() : void >super["x"] : () => void >super : A ->"x" : string +>"x" : "x" // property access (read) const a = super.x; @@ -41,7 +41,7 @@ class B extends A { >b : () => void >super["x"] : () => void >super : A ->"x" : string +>"x" : "x" } // async method with assignment/destructuring on 'super' requires a binding @@ -64,7 +64,7 @@ class B extends A { >super["x"]() : void >super["x"] : () => void >super : A ->"x" : string +>"x" : "x" // property access (read) const a = super.x; @@ -78,7 +78,7 @@ class B extends A { >b : () => void >super["x"] : () => void >super : A ->"x" : string +>"x" : "x" // property access (assign) super.x = f; @@ -93,7 +93,7 @@ class B extends A { >super["x"] = f : () => void >super["x"] : () => void >super : A ->"x" : string +>"x" : "x" >f : () => void // destructuring assign with property access @@ -116,7 +116,7 @@ class B extends A { >f : () => void >super["x"] : () => void >super : A ->"x" : string +>"x" : "x" >{ f } : { f: () => void; } >f : () => void } diff --git a/tests/baselines/reference/asyncMethodWithSuper_es6.types b/tests/baselines/reference/asyncMethodWithSuper_es6.types index 04c5b5a9baf..030c9fe4e6a 100644 --- a/tests/baselines/reference/asyncMethodWithSuper_es6.types +++ b/tests/baselines/reference/asyncMethodWithSuper_es6.types @@ -27,7 +27,7 @@ class B extends A { >super["x"]() : void >super["x"] : () => void >super : A ->"x" : string +>"x" : "x" // property access (read) const a = super.x; @@ -41,7 +41,7 @@ class B extends A { >b : () => void >super["x"] : () => void >super : A ->"x" : string +>"x" : "x" } // async method with assignment/destructuring on 'super' requires a binding @@ -64,7 +64,7 @@ class B extends A { >super["x"]() : void >super["x"] : () => void >super : A ->"x" : string +>"x" : "x" // property access (read) const a = super.x; @@ -78,7 +78,7 @@ class B extends A { >b : () => void >super["x"] : () => void >super : A ->"x" : string +>"x" : "x" // property access (assign) super.x = f; @@ -93,7 +93,7 @@ class B extends A { >super["x"] = f : () => void >super["x"] : () => void >super : A ->"x" : string +>"x" : "x" >f : () => void // destructuring assign with property access @@ -116,7 +116,7 @@ class B extends A { >f : () => void >super["x"] : () => void >super : A ->"x" : string +>"x" : "x" >{ f } : { f: () => void; } >f : () => void } diff --git a/tests/baselines/reference/asyncMultiFile_es5.js b/tests/baselines/reference/asyncMultiFile_es5.js index 197127c5f10..cfc3cb235b0 100644 --- a/tests/baselines/reference/asyncMultiFile_es5.js +++ b/tests/baselines/reference/asyncMultiFile_es5.js @@ -15,41 +15,31 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge }); }; var __generator = (this && this.__generator) || function (thisArg, body) { - var _ = { label: 0, sent: function() { if (sent[0] === 1) throw sent[1]; return sent[1]; }, trys: [], stack: [] }, sent, f; + var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t; + return { next: verb(0), "throw": verb(1), "return": verb(2) }; + function verb(n) { return function (v) { return step([n, v]); }; } function step(op) { if (f) throw new TypeError("Generator is already executing."); - while (1) { - if (_.done) switch (op[0]) { - case 0: return { value: void 0, done: true }; - case 1: case 6: throw op[1]; - case 2: return { value: op[1], done: true }; + while (_) try { + if (f = 1, y && (t = y[op[0] & 2 ? "return" : op[0] ? "throw" : "next"]) && !(t = t.call(y, op[1])).done) return t; + if (y = 0, t) op = [0, t.value]; + switch (op[0]) { + case 0: case 1: t = op; break; + case 4: _.label++; return { value: op[1], done: false }; + case 5: _.label++; y = op[1]; op = [0]; continue; + case 7: op = _.ops.pop(); _.trys.pop(); continue; + default: + if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } + if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } + if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } + if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } + if (t[2]) _.ops.pop(); + _.trys.pop(); continue; } - try { - switch (f = 1, op[0]) { - case 0: case 1: sent = op; break; - case 4: return _.label++, { value: op[1], done: false }; - case 7: op = _.stack.pop(), _.trys.pop(); continue; - default: - var r = _.trys.length > 0 && _.trys[_.trys.length - 1]; - if (!r && (op[0] === 6 || op[0] === 2)) { _.done = 1; continue; } - if (op[0] === 3 && (!r || (op[1] > r[0] && op[1] < r[3]))) { _.label = op[1]; break; } - if (op[0] === 6 && _.label < r[1]) { _.label = r[1], sent = op; break; } - if (r && _.label < r[2]) { _.label = r[2], _.stack.push(op); break; } - if (r[2]) { _.stack.pop(); } - _.trys.pop(); - continue; - } - op = body.call(thisArg, _); - } - catch (e) { op = [6, e]; } - finally { f = 0, sent = void 0; } - } + op = body.call(thisArg, _); + } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } + if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; } - return { - next: function (v) { return step([0, v]); }, - "throw": function (v) { return step([1, v]); }, - "return": function (v) { return step([2, v]); } - }; }; function f() { return __awaiter(this, void 0, void 0, function () { return __generator(this, function (_a) { diff --git a/tests/baselines/reference/asyncUseStrict_es5.types b/tests/baselines/reference/asyncUseStrict_es5.types index c7eafb3433c..a8744a60559 100644 --- a/tests/baselines/reference/asyncUseStrict_es5.types +++ b/tests/baselines/reference/asyncUseStrict_es5.types @@ -11,7 +11,7 @@ async function func(): Promise { >Promise : Promise "use strict"; ->"use strict" : string +>"use strict" : "use strict" var b = await p || a; >b : boolean diff --git a/tests/baselines/reference/asyncUseStrict_es6.types b/tests/baselines/reference/asyncUseStrict_es6.types index 7e6fd872081..e92da865316 100644 --- a/tests/baselines/reference/asyncUseStrict_es6.types +++ b/tests/baselines/reference/asyncUseStrict_es6.types @@ -11,7 +11,7 @@ async function func(): Promise { >Promise : Promise "use strict"; ->"use strict" : string +>"use strict" : "use strict" var b = await p || a; >b : boolean diff --git a/tests/baselines/reference/augmentExportEquals3.symbols b/tests/baselines/reference/augmentExportEquals3.symbols index c7338867021..485f977321f 100644 --- a/tests/baselines/reference/augmentExportEquals3.symbols +++ b/tests/baselines/reference/augmentExportEquals3.symbols @@ -1,10 +1,10 @@ === tests/cases/compiler/file1.ts === function foo() {} ->foo : Symbol(, Decl(file1.ts, 0, 0), Decl(file1.ts, 1, 17), Decl(file2.ts, 1, 8)) +>foo : Symbol(foo, Decl(file1.ts, 0, 0), Decl(file1.ts, 1, 17), Decl(file2.ts, 1, 8)) namespace foo { ->foo : Symbol(, Decl(file1.ts, 0, 0), Decl(file1.ts, 1, 17), Decl(file2.ts, 1, 8)) +>foo : Symbol(foo, Decl(file1.ts, 0, 0), Decl(file1.ts, 1, 17), Decl(file2.ts, 1, 8)) export var v = 1; >v : Symbol(v, Decl(file1.ts, 3, 14)) diff --git a/tests/baselines/reference/augmentExportEquals3.types b/tests/baselines/reference/augmentExportEquals3.types index 4df7bbc60fa..f900d59735e 100644 --- a/tests/baselines/reference/augmentExportEquals3.types +++ b/tests/baselines/reference/augmentExportEquals3.types @@ -1,14 +1,14 @@ === tests/cases/compiler/file1.ts === function foo() {} ->foo : typeof +>foo : typeof foo namespace foo { ->foo : typeof +>foo : typeof foo export var v = 1; >v : number ->1 : number +>1 : 1 } export = foo; >foo : typeof foo @@ -18,11 +18,11 @@ import x = require("./file1"); >x : typeof x x.b = 1; ->x.b = 1 : number +>x.b = 1 : 1 >x.b : number >x : typeof x >b : number ->1 : number +>1 : 1 // OK - './file1' is a namespace declare module "./file1" { diff --git a/tests/baselines/reference/augmentExportEquals3_1.symbols b/tests/baselines/reference/augmentExportEquals3_1.symbols index 09827aaa094..ad3505c2835 100644 --- a/tests/baselines/reference/augmentExportEquals3_1.symbols +++ b/tests/baselines/reference/augmentExportEquals3_1.symbols @@ -1,10 +1,10 @@ === tests/cases/compiler/file1.d.ts === declare module "file1" { function foo(): void; ->foo : Symbol(, Decl(file1.d.ts, 0, 24), Decl(file1.d.ts, 1, 25), Decl(file2.ts, 2, 8)) +>foo : Symbol(foo, Decl(file1.d.ts, 0, 24), Decl(file1.d.ts, 1, 25), Decl(file2.ts, 2, 8)) namespace foo { ->foo : Symbol(, Decl(file1.d.ts, 0, 24), Decl(file1.d.ts, 1, 25), Decl(file2.ts, 2, 8)) +>foo : Symbol(foo, Decl(file1.d.ts, 0, 24), Decl(file1.d.ts, 1, 25), Decl(file2.ts, 2, 8)) export var v: number; >v : Symbol(v, Decl(file1.d.ts, 3, 18)) diff --git a/tests/baselines/reference/augmentExportEquals3_1.types b/tests/baselines/reference/augmentExportEquals3_1.types index 8a70a6ec0a6..2457e91530a 100644 --- a/tests/baselines/reference/augmentExportEquals3_1.types +++ b/tests/baselines/reference/augmentExportEquals3_1.types @@ -1,10 +1,10 @@ === tests/cases/compiler/file1.d.ts === declare module "file1" { function foo(): void; ->foo : typeof +>foo : typeof foo namespace foo { ->foo : typeof +>foo : typeof foo export var v: number; >v : number @@ -20,11 +20,11 @@ import x = require("file1"); >x : typeof x x.b = 1; ->x.b = 1 : number +>x.b = 1 : 1 >x.b : number >x : typeof x >b : number ->1 : number +>1 : 1 // OK - './file1' is a namespace declare module "file1" { diff --git a/tests/baselines/reference/augmentExportEquals4.symbols b/tests/baselines/reference/augmentExportEquals4.symbols index 94941693bae..7394e8c6b28 100644 --- a/tests/baselines/reference/augmentExportEquals4.symbols +++ b/tests/baselines/reference/augmentExportEquals4.symbols @@ -1,10 +1,10 @@ === tests/cases/compiler/file1.ts === class foo {} ->foo : Symbol(, Decl(file1.ts, 0, 0), Decl(file1.ts, 1, 12), Decl(file2.ts, 1, 8)) +>foo : Symbol(foo, Decl(file1.ts, 0, 0), Decl(file1.ts, 1, 12), Decl(file2.ts, 1, 8)) namespace foo { ->foo : Symbol(, Decl(file1.ts, 0, 0), Decl(file1.ts, 1, 12), Decl(file2.ts, 1, 8)) +>foo : Symbol(foo, Decl(file1.ts, 0, 0), Decl(file1.ts, 1, 12), Decl(file2.ts, 1, 8)) export var v = 1; >v : Symbol(v, Decl(file1.ts, 3, 14)) diff --git a/tests/baselines/reference/augmentExportEquals4.types b/tests/baselines/reference/augmentExportEquals4.types index 3d25ae2decb..c7ffe8bd774 100644 --- a/tests/baselines/reference/augmentExportEquals4.types +++ b/tests/baselines/reference/augmentExportEquals4.types @@ -1,14 +1,14 @@ === tests/cases/compiler/file1.ts === class foo {} ->foo : +>foo : foo namespace foo { ->foo : typeof +>foo : typeof foo export var v = 1; >v : number ->1 : number +>1 : 1 } export = foo; >foo : foo @@ -18,11 +18,11 @@ import x = require("./file1"); >x : typeof x x.b = 1; ->x.b = 1 : number +>x.b = 1 : 1 >x.b : number >x : typeof x >b : number ->1 : number +>1 : 1 // OK - './file1' is a namespace declare module "./file1" { diff --git a/tests/baselines/reference/augmentExportEquals4_1.symbols b/tests/baselines/reference/augmentExportEquals4_1.symbols index 5c4aadbdf83..9954f71bfbc 100644 --- a/tests/baselines/reference/augmentExportEquals4_1.symbols +++ b/tests/baselines/reference/augmentExportEquals4_1.symbols @@ -2,10 +2,10 @@ declare module "file1" { class foo {} ->foo : Symbol(, Decl(file1.d.ts, 1, 24), Decl(file1.d.ts, 2, 16), Decl(file2.ts, 2, 8)) +>foo : Symbol(foo, Decl(file1.d.ts, 1, 24), Decl(file1.d.ts, 2, 16), Decl(file2.ts, 2, 8)) namespace foo { ->foo : Symbol(, Decl(file1.d.ts, 1, 24), Decl(file1.d.ts, 2, 16), Decl(file2.ts, 2, 8)) +>foo : Symbol(foo, Decl(file1.d.ts, 1, 24), Decl(file1.d.ts, 2, 16), Decl(file2.ts, 2, 8)) export var v: number; >v : Symbol(v, Decl(file1.d.ts, 4, 18)) diff --git a/tests/baselines/reference/augmentExportEquals4_1.types b/tests/baselines/reference/augmentExportEquals4_1.types index 9f219286000..60a7c2d77bb 100644 --- a/tests/baselines/reference/augmentExportEquals4_1.types +++ b/tests/baselines/reference/augmentExportEquals4_1.types @@ -2,10 +2,10 @@ declare module "file1" { class foo {} ->foo : +>foo : foo namespace foo { ->foo : typeof +>foo : typeof foo export var v: number; >v : number @@ -21,11 +21,11 @@ import x = require("file1"); >x : typeof x x.b = 1; ->x.b = 1 : number +>x.b = 1 : 1 >x.b : number >x : typeof x >b : number ->1 : number +>1 : 1 // OK - './file1' is a namespace declare module "file1" { diff --git a/tests/baselines/reference/augmentExportEquals5.symbols b/tests/baselines/reference/augmentExportEquals5.symbols index 37fa00bd8cc..09da5f32d72 100644 --- a/tests/baselines/reference/augmentExportEquals5.symbols +++ b/tests/baselines/reference/augmentExportEquals5.symbols @@ -16,12 +16,12 @@ declare module Express { declare module "express" { function e(): e.Express; ->e : Symbol(, Decl(express.d.ts, 8, 26), Decl(express.d.ts, 9, 28), Decl(augmentation.ts, 1, 29)) +>e : Symbol(e, Decl(express.d.ts, 8, 26), Decl(express.d.ts, 9, 28), Decl(augmentation.ts, 1, 29)) >e : Symbol(e, Decl(express.d.ts, 8, 26), Decl(express.d.ts, 9, 28)) >Express : Symbol(Express, Decl(express.d.ts, 54, 9)) namespace e { ->e : Symbol(, Decl(express.d.ts, 8, 26), Decl(express.d.ts, 9, 28), Decl(augmentation.ts, 1, 29)) +>e : Symbol(e, Decl(express.d.ts, 8, 26), Decl(express.d.ts, 9, 28), Decl(augmentation.ts, 1, 29)) interface IRoute { >IRoute : Symbol(IRoute, Decl(express.d.ts, 10, 17)) diff --git a/tests/baselines/reference/augmentExportEquals5.types b/tests/baselines/reference/augmentExportEquals5.types index 42b79674dfd..7d4d765e5ee 100644 --- a/tests/baselines/reference/augmentExportEquals5.types +++ b/tests/baselines/reference/augmentExportEquals5.types @@ -16,12 +16,12 @@ declare module Express { declare module "express" { function e(): e.Express; ->e : typeof +>e : typeof e >e : any >Express : Express namespace e { ->e : typeof +>e : typeof e interface IRoute { >IRoute : IRoute diff --git a/tests/baselines/reference/augmentExportEquals6.symbols b/tests/baselines/reference/augmentExportEquals6.symbols index 4af820f24d7..9ccf8685af7 100644 --- a/tests/baselines/reference/augmentExportEquals6.symbols +++ b/tests/baselines/reference/augmentExportEquals6.symbols @@ -1,10 +1,10 @@ === tests/cases/compiler/file1.ts === class foo {} ->foo : Symbol(, Decl(file1.ts, 0, 0), Decl(file1.ts, 1, 12), Decl(file2.ts, 1, 10)) +>foo : Symbol(foo, Decl(file1.ts, 0, 0), Decl(file1.ts, 1, 12), Decl(file2.ts, 1, 10)) namespace foo { ->foo : Symbol(, Decl(file1.ts, 0, 0), Decl(file1.ts, 1, 12), Decl(file2.ts, 1, 10)) +>foo : Symbol(foo, Decl(file1.ts, 0, 0), Decl(file1.ts, 1, 12), Decl(file2.ts, 1, 10)) export class A {} >A : Symbol(A, Decl(file1.ts, 2, 15), Decl(file2.ts, 4, 26)) diff --git a/tests/baselines/reference/augmentExportEquals6.types b/tests/baselines/reference/augmentExportEquals6.types index 1a2b2b22ccb..e2342e96dfb 100644 --- a/tests/baselines/reference/augmentExportEquals6.types +++ b/tests/baselines/reference/augmentExportEquals6.types @@ -1,10 +1,10 @@ === tests/cases/compiler/file1.ts === class foo {} ->foo : +>foo : foo namespace foo { ->foo : typeof +>foo : typeof foo export class A {} >A : A @@ -21,13 +21,13 @@ import x = require("./file1"); >x : typeof x x.B.b = 1; ->x.B.b = 1 : number +>x.B.b = 1 : 1 >x.B.b : number >x.B : typeof x.B >x : typeof x >B : typeof x.B >b : number ->1 : number +>1 : 1 // OK - './file1' is a namespace declare module "./file1" { diff --git a/tests/baselines/reference/augmentExportEquals6_1.symbols b/tests/baselines/reference/augmentExportEquals6_1.symbols index 3db6702448e..c66f01e2d14 100644 --- a/tests/baselines/reference/augmentExportEquals6_1.symbols +++ b/tests/baselines/reference/augmentExportEquals6_1.symbols @@ -2,10 +2,10 @@ declare module "file1" { class foo {} ->foo : Symbol(, Decl(file1.d.ts, 1, 24), Decl(file1.d.ts, 2, 16), Decl(file2.ts, 1, 28)) +>foo : Symbol(foo, Decl(file1.d.ts, 1, 24), Decl(file1.d.ts, 2, 16), Decl(file2.ts, 1, 28)) namespace foo { ->foo : Symbol(, Decl(file1.d.ts, 1, 24), Decl(file1.d.ts, 2, 16), Decl(file2.ts, 1, 28)) +>foo : Symbol(foo, Decl(file1.d.ts, 1, 24), Decl(file1.d.ts, 2, 16), Decl(file2.ts, 1, 28)) class A {} >A : Symbol(A, Decl(file1.d.ts, 3, 19), Decl(file2.ts, 4, 24)) diff --git a/tests/baselines/reference/augmentExportEquals6_1.types b/tests/baselines/reference/augmentExportEquals6_1.types index a9cc78056c8..9d6042ee659 100644 --- a/tests/baselines/reference/augmentExportEquals6_1.types +++ b/tests/baselines/reference/augmentExportEquals6_1.types @@ -2,10 +2,10 @@ declare module "file1" { class foo {} ->foo : +>foo : foo namespace foo { ->foo : typeof +>foo : typeof foo class A {} >A : A diff --git a/tests/baselines/reference/augmentedTypeBracketAccessIndexSignature.types b/tests/baselines/reference/augmentedTypeBracketAccessIndexSignature.types index 898da985aad..a0951c324f2 100644 --- a/tests/baselines/reference/augmentedTypeBracketAccessIndexSignature.types +++ b/tests/baselines/reference/augmentedTypeBracketAccessIndexSignature.types @@ -27,12 +27,12 @@ var a = {}[0]; // Should be Foo >a : any >{}[0] : any >{} : {} ->0 : number +>0 : 0 var b = (() => { })[0]; // Should be Bar >b : any >(() => { })[0] : any >(() => { }) : () => void >() => { } : () => void ->0 : number +>0 : 0 diff --git a/tests/baselines/reference/augmentedTypeBracketNamedPropertyAccess.types b/tests/baselines/reference/augmentedTypeBracketNamedPropertyAccess.types index c47c98ebc9c..d8388fc81a8 100644 --- a/tests/baselines/reference/augmentedTypeBracketNamedPropertyAccess.types +++ b/tests/baselines/reference/augmentedTypeBracketNamedPropertyAccess.types @@ -23,23 +23,23 @@ var r1 = o['data']; // Should be number >r1 : number >o['data'] : number >o : {} ->'data' : string +>'data' : "data" var r2 = o['functionData']; // Should be any (no property found) >r2 : any >o['functionData'] : any >o : {} ->'functionData' : string +>'functionData' : "functionData" var r3 = f['functionData']; // Should be string >r3 : string >f['functionData'] : string >f : () => void ->'functionData' : string +>'functionData' : "functionData" var r4 = f['data']; // Should be number >r4 : number >f['data'] : number >f : () => void ->'data' : string +>'data' : "data" diff --git a/tests/baselines/reference/augmentedTypesClass3.types b/tests/baselines/reference/augmentedTypesClass3.types index bed118b5978..64e403d2661 100644 --- a/tests/baselines/reference/augmentedTypesClass3.types +++ b/tests/baselines/reference/augmentedTypesClass3.types @@ -14,7 +14,7 @@ class c5a { public foo() { } } module c5a { var y = 2; } // should be ok >c5a : typeof c5a >y : number ->2 : number +>2 : 2 class c5b { public foo() { } } >c5b : c5b @@ -23,7 +23,7 @@ class c5b { public foo() { } } module c5b { export var y = 2; } // should be ok >c5b : typeof c5b >y : number ->2 : number +>2 : 2 //// class then import class c5c { public foo() { } } diff --git a/tests/baselines/reference/augmentedTypesExternalModule1.types b/tests/baselines/reference/augmentedTypesExternalModule1.types index e652ecb08e1..2d3f8394d82 100644 --- a/tests/baselines/reference/augmentedTypesExternalModule1.types +++ b/tests/baselines/reference/augmentedTypesExternalModule1.types @@ -1,7 +1,7 @@ === tests/cases/compiler/augmentedTypesExternalModule1.ts === export var a = 1; >a : number ->1 : number +>1 : 1 class c5 { public foo() { } } >c5 : c5 diff --git a/tests/baselines/reference/augmentedTypesModules3b.types b/tests/baselines/reference/augmentedTypesModules3b.types index 38134c7c1c2..0d1ebe2bb42 100644 --- a/tests/baselines/reference/augmentedTypesModules3b.types +++ b/tests/baselines/reference/augmentedTypesModules3b.types @@ -6,7 +6,7 @@ class m3b { foo() { } } module m3b { var y = 2; } >m3b : typeof m3b >y : number ->2 : number +>2 : 2 class m3c { foo() { } } >m3c : m3c @@ -15,7 +15,7 @@ class m3c { foo() { } } module m3c { export var y = 2; } >m3c : typeof m3c >y : number ->2 : number +>2 : 2 declare class m3d { foo(): void } >m3d : m3d @@ -24,12 +24,12 @@ declare class m3d { foo(): void } module m3d { export var y = 2; } >m3d : typeof m3d >y : number ->2 : number +>2 : 2 module m3e { export var y = 2; } >m3e : typeof m3e >y : number ->2 : number +>2 : 2 declare class m3e { foo(): void } >m3e : m3e diff --git a/tests/baselines/reference/augmentedTypesModules4.types b/tests/baselines/reference/augmentedTypesModules4.types index 15d7c28e1d6..7e47abc41e8 100644 --- a/tests/baselines/reference/augmentedTypesModules4.types +++ b/tests/baselines/reference/augmentedTypesModules4.types @@ -10,7 +10,7 @@ enum m4 { } module m4a { var y = 2; } >m4a : typeof m4a >y : number ->2 : number +>2 : 2 enum m4a { One } >m4a : m4a @@ -19,7 +19,7 @@ enum m4a { One } module m4b { export var y = 2; } >m4b : typeof m4b >y : number ->2 : number +>2 : 2 enum m4b { One } >m4b : m4b @@ -48,7 +48,7 @@ enum m4d { One } module m5 { export var y = 2; } >m5 : typeof m5 >y : number ->2 : number +>2 : 2 module m5 { export interface I { foo(): void } } // should already be reasonably well covered >m5 : typeof m5 diff --git a/tests/baselines/reference/autonumberingInEnums.types b/tests/baselines/reference/autonumberingInEnums.types index 35d5a1505a5..8e3606dd8b3 100644 --- a/tests/baselines/reference/autonumberingInEnums.types +++ b/tests/baselines/reference/autonumberingInEnums.types @@ -3,13 +3,13 @@ enum Foo { >Foo : Foo a = 1 ->a : Foo ->1 : number +>a : Foo.a +>1 : 1 } enum Foo { >Foo : Foo b // should work fine ->b : Foo +>b : Foo.b } diff --git a/tests/baselines/reference/avoid.types b/tests/baselines/reference/avoid.types index 25fe27a2ea0..a4ecdb6f2c6 100644 --- a/tests/baselines/reference/avoid.types +++ b/tests/baselines/reference/avoid.types @@ -4,7 +4,7 @@ function f() { var x=1; >x : number ->1 : number +>1 : 1 } var y=f(); // error void fn diff --git a/tests/baselines/reference/await_unaryExpression_es6.types b/tests/baselines/reference/await_unaryExpression_es6.types index 2a4b7354d3e..14b4fbf89ac 100644 --- a/tests/baselines/reference/await_unaryExpression_es6.types +++ b/tests/baselines/reference/await_unaryExpression_es6.types @@ -5,8 +5,8 @@ async function bar() { !await 42; // OK >!await 42 : boolean ->await 42 : number ->42 : number +>await 42 : 42 +>42 : 42 } async function bar1() { @@ -14,8 +14,8 @@ async function bar1() { +await 42; // OK >+await 42 : number ->await 42 : number ->42 : number +>await 42 : 42 +>42 : 42 } async function bar3() { @@ -23,8 +23,8 @@ async function bar3() { -await 42; // OK >-await 42 : number ->await 42 : number ->42 : number +>await 42 : 42 +>42 : 42 } async function bar4() { @@ -32,6 +32,6 @@ async function bar4() { ~await 42; // OK >~await 42 : number ->await 42 : number ->42 : number +>await 42 : 42 +>42 : 42 } diff --git a/tests/baselines/reference/await_unaryExpression_es6_1.types b/tests/baselines/reference/await_unaryExpression_es6_1.types index a5c3740b677..15544420189 100644 --- a/tests/baselines/reference/await_unaryExpression_es6_1.types +++ b/tests/baselines/reference/await_unaryExpression_es6_1.types @@ -5,8 +5,8 @@ async function bar() { !await 42; // OK >!await 42 : boolean ->await 42 : number ->42 : number +>await 42 : 42 +>42 : 42 } async function bar1() { @@ -14,8 +14,8 @@ async function bar1() { delete await 42; // OK >delete await 42 : boolean ->await 42 : number ->42 : number +>await 42 : 42 +>42 : 42 } async function bar2() { @@ -23,8 +23,8 @@ async function bar2() { delete await 42; // OK >delete await 42 : boolean ->await 42 : number ->42 : number +>await 42 : 42 +>42 : 42 } async function bar3() { @@ -32,8 +32,8 @@ async function bar3() { void await 42; >void await 42 : undefined ->await 42 : number ->42 : number +>await 42 : 42 +>42 : 42 } async function bar4() { @@ -41,6 +41,6 @@ async function bar4() { +await 42; >+await 42 : number ->await 42 : number ->42 : number +>await 42 : 42 +>42 : 42 } diff --git a/tests/baselines/reference/await_unaryExpression_es6_2.types b/tests/baselines/reference/await_unaryExpression_es6_2.types index b438f063add..6142eec825b 100644 --- a/tests/baselines/reference/await_unaryExpression_es6_2.types +++ b/tests/baselines/reference/await_unaryExpression_es6_2.types @@ -5,8 +5,8 @@ async function bar1() { delete await 42; >delete await 42 : boolean ->await 42 : number ->42 : number +>await 42 : 42 +>42 : 42 } async function bar2() { @@ -14,8 +14,8 @@ async function bar2() { delete await 42; >delete await 42 : boolean ->await 42 : number ->42 : number +>await 42 : 42 +>42 : 42 } async function bar3() { @@ -23,6 +23,6 @@ async function bar3() { void await 42; >void await 42 : undefined ->await 42 : number ->42 : number +>await 42 : 42 +>42 : 42 } diff --git a/tests/baselines/reference/baseCheck.errors.txt b/tests/baselines/reference/baseCheck.errors.txt index c31ba95476a..1f267f55301 100644 --- a/tests/baselines/reference/baseCheck.errors.txt +++ b/tests/baselines/reference/baseCheck.errors.txt @@ -2,7 +2,7 @@ tests/cases/compiler/baseCheck.ts(9,18): error TS2304: Cannot find name 'loc'. tests/cases/compiler/baseCheck.ts(17,53): error TS2346: Supplied parameters do not match any signature of call target. tests/cases/compiler/baseCheck.ts(17,59): error TS17009: 'super' must be called before accessing 'this' in the constructor of a derived class. tests/cases/compiler/baseCheck.ts(18,62): error TS17009: 'super' must be called before accessing 'this' in the constructor of a derived class. -tests/cases/compiler/baseCheck.ts(19,59): error TS2345: Argument of type 'string' is not assignable to parameter of type 'number'. +tests/cases/compiler/baseCheck.ts(19,59): error TS2345: Argument of type '"hello"' is not assignable to parameter of type 'number'. tests/cases/compiler/baseCheck.ts(19,68): error TS17009: 'super' must be called before accessing 'this' in the constructor of a derived class. tests/cases/compiler/baseCheck.ts(22,9): error TS2304: Cannot find name 'x'. tests/cases/compiler/baseCheck.ts(23,7): error TS2304: Cannot find name 'x'. @@ -38,7 +38,7 @@ tests/cases/compiler/baseCheck.ts(26,9): error TS2304: Cannot find name 'x'. !!! error TS17009: 'super' must be called before accessing 'this' in the constructor of a derived class. class F extends C { constructor(public z: number) { super("hello", this.z) } } // first param type ~~~~~~~ -!!! error TS2345: Argument of type 'string' is not assignable to parameter of type 'number'. +!!! error TS2345: Argument of type '"hello"' is not assignable to parameter of type 'number'. ~~~~ !!! error TS17009: 'super' must be called before accessing 'this' in the constructor of a derived class. diff --git a/tests/baselines/reference/baseIndexSignatureResolution.types b/tests/baselines/reference/baseIndexSignatureResolution.types index 90d143155fb..17fb5cf85de 100644 --- a/tests/baselines/reference/baseIndexSignatureResolution.types +++ b/tests/baselines/reference/baseIndexSignatureResolution.types @@ -37,7 +37,7 @@ var y: Derived = x[0]; >Derived : Derived >x[0] : Derived >x : FooOf ->0 : number +>0 : 0 /* // Note - the equivalent for normal interface methods works fine: diff --git a/tests/baselines/reference/bestChoiceType.types b/tests/baselines/reference/bestChoiceType.types index f88cf64e5a2..b1b4d419756 100644 --- a/tests/baselines/reference/bestChoiceType.types +++ b/tests/baselines/reference/bestChoiceType.types @@ -9,7 +9,7 @@ >''.match(/ /) || [] : RegExpMatchArray >''.match(/ /) : RegExpMatchArray | null >''.match : { (regexp: string): RegExpMatchArray | null; (regexp: RegExp): RegExpMatchArray | null; } ->'' : string +>'' : "" >match : { (regexp: string): RegExpMatchArray | null; (regexp: RegExp): RegExpMatchArray | null; } >/ / : RegExp >[] : never[] @@ -30,7 +30,7 @@ function f1() { >x : RegExpMatchArray | null >''.match(/ /) : RegExpMatchArray | null >''.match : { (regexp: string): RegExpMatchArray | null; (regexp: RegExp): RegExpMatchArray | null; } ->'' : string +>'' : "" >match : { (regexp: string): RegExpMatchArray | null; (regexp: RegExp): RegExpMatchArray | null; } >/ / : RegExp @@ -61,7 +61,7 @@ function f2() { >x : RegExpMatchArray | null >''.match(/ /) : RegExpMatchArray | null >''.match : { (regexp: string): RegExpMatchArray | null; (regexp: RegExp): RegExpMatchArray | null; } ->'' : string +>'' : "" >match : { (regexp: string): RegExpMatchArray | null; (regexp: RegExp): RegExpMatchArray | null; } >/ / : RegExp diff --git a/tests/baselines/reference/bestCommonTypeOfConditionalExpressions.types b/tests/baselines/reference/bestCommonTypeOfConditionalExpressions.types index 2a5ee6a2fe2..f3ea48e637b 100644 --- a/tests/baselines/reference/bestCommonTypeOfConditionalExpressions.types +++ b/tests/baselines/reference/bestCommonTypeOfConditionalExpressions.types @@ -40,36 +40,36 @@ var derived2: Derived2; var r = true ? 1 : 2; >r : number ->true ? 1 : 2 : number ->true : boolean ->1 : number ->2 : number +>true ? 1 : 2 : 1 | 2 +>true : true +>1 : 1 +>2 : 2 var r3 = true ? 1 : {}; >r3 : {} >true ? 1 : {} : {} ->true : boolean ->1 : number +>true : true +>1 : 1 >{} : {} var r4 = true ? a : b; // typeof a >r4 : { x: number; y?: number; } | { x: number; z?: number; } >true ? a : b : { x: number; y?: number; } | { x: number; z?: number; } ->true : boolean +>true : true >a : { x: number; y?: number; } >b : { x: number; z?: number; } var r5 = true ? b : a; // typeof b >r5 : { x: number; y?: number; } | { x: number; z?: number; } >true ? b : a : { x: number; y?: number; } | { x: number; z?: number; } ->true : boolean +>true : true >b : { x: number; z?: number; } >a : { x: number; y?: number; } var r6 = true ? (x: number) => { } : (x: Object) => { }; // returns number => void >r6 : (x: number) => void >true ? (x: number) => { } : (x: Object) => { } : (x: number) => void ->true : boolean +>true : true >(x: number) => { } : (x: number) => void >x : number >(x: Object) => { } : (x: Object) => void @@ -81,7 +81,7 @@ var r7: (x: Object) => void = true ? (x: number) => { } : (x: Object) => { }; >x : Object >Object : Object >true ? (x: number) => { } : (x: Object) => { } : (x: number) => void ->true : boolean +>true : true >(x: number) => { } : (x: number) => void >x : number >(x: Object) => { } : (x: Object) => void @@ -91,7 +91,7 @@ var r7: (x: Object) => void = true ? (x: number) => { } : (x: Object) => { }; var r8 = true ? (x: Object) => { } : (x: number) => { }; // returns Object => void >r8 : (x: Object) => void >true ? (x: Object) => { } : (x: number) => { } : (x: Object) => void ->true : boolean +>true : true >(x: Object) => { } : (x: Object) => void >x : Object >Object : Object @@ -102,14 +102,14 @@ var r10: Base = true ? derived : derived2; // no error since we use the contextu >r10 : Base >Base : Base >true ? derived : derived2 : Derived | Derived2 ->true : boolean +>true : true >derived : Derived >derived2 : Derived2 var r11 = true ? base : derived2; >r11 : Base >true ? base : derived2 : Base ->true : boolean +>true : true >base : Base >derived2 : Derived2 @@ -125,7 +125,7 @@ function foo5(t: T, u: U): Object { return true ? t : u; // BCT is Object >true ? t : u : T | U ->true : boolean +>true : true >t : T >u : U } diff --git a/tests/baselines/reference/bestCommonTypeOfConditionalExpressions2.types b/tests/baselines/reference/bestCommonTypeOfConditionalExpressions2.types index 833bddd0e7c..ad09c274c9b 100644 --- a/tests/baselines/reference/bestCommonTypeOfConditionalExpressions2.types +++ b/tests/baselines/reference/bestCommonTypeOfConditionalExpressions2.types @@ -30,15 +30,15 @@ var derived2: Derived2; var r2 = true ? 1 : ''; >r2 : string | number ->true ? 1 : '' : string | number ->true : boolean ->1 : number ->'' : string +>true ? 1 : '' : "" | 1 +>true : true +>1 : 1 +>'' : "" var r9 = true ? derived : derived2; >r9 : Derived | Derived2 >true ? derived : derived2 : Derived | Derived2 ->true : boolean +>true : true >derived : Derived >derived2 : Derived2 @@ -53,7 +53,7 @@ function foo(t: T, u: U) { return true ? t : u; >true ? t : u : T | U ->true : boolean +>true : true >t : T >u : U } @@ -70,7 +70,7 @@ function foo2(t: T, u: U) { // Error for referencing own type pa return true ? t : u; // Ok because BCT(T, U) = U >true ? t : u : U ->true : boolean +>true : true >t : T >u : U } @@ -89,7 +89,7 @@ function foo3(t: T, u: U) { return true ? t : u; >true ? t : u : U ->true : boolean +>true : true >t : T >u : U } diff --git a/tests/baselines/reference/bestCommonTypeOfTuple.types b/tests/baselines/reference/bestCommonTypeOfTuple.types index 6aa84f37eba..82c96ecb86c 100644 --- a/tests/baselines/reference/bestCommonTypeOfTuple.types +++ b/tests/baselines/reference/bestCommonTypeOfTuple.types @@ -2,17 +2,17 @@ function f1(x: number): string { return "foo"; } >f1 : (x: number) => string >x : number ->"foo" : string +>"foo" : "foo" function f2(x: number): number { return 10; } >f2 : (x: number) => number >x : number ->10 : number +>10 : 10 function f3(x: number): boolean { return true; } >f3 : (x: number) => boolean >x : number ->true : boolean +>true : true enum E1 { one } >E1 : E1 @@ -64,7 +64,7 @@ t3 = [5, undefined]; >t3 = [5, undefined] : [number, undefined] >t3 : [number, any] >[5, undefined] : [number, undefined] ->5 : number +>5 : 5 >undefined : undefined t4 = [E1.one, E2.two, 20]; @@ -77,29 +77,29 @@ t4 = [E1.one, E2.two, 20]; >E2.two : E2 >E2 : typeof E2 >two : E2 ->20 : number +>20 : 20 var e1 = t1[2]; // {} >e1 : ((x: number) => string) | ((x: number) => number) >t1[2] : ((x: number) => string) | ((x: number) => number) >t1 : [(x: number) => string, (x: number) => number] ->2 : number +>2 : 2 var e2 = t2[2]; // {} >e2 : E1 | E2 >t2[2] : E1 | E2 >t2 : [E1, E2] ->2 : number +>2 : 2 var e3 = t3[2]; // any >e3 : any >t3[2] : any >t3 : [number, any] ->2 : number +>2 : 2 var e4 = t4[3]; // number >e4 : number | E1 | E2 >t4[3] : number | E1 | E2 >t4 : [E1, E2, number] ->3 : number +>3 : 3 diff --git a/tests/baselines/reference/bestCommonTypeOfTuple2.types b/tests/baselines/reference/bestCommonTypeOfTuple2.types index 864d3030d88..b64da59d5b0 100644 --- a/tests/baselines/reference/bestCommonTypeOfTuple2.types +++ b/tests/baselines/reference/bestCommonTypeOfTuple2.types @@ -30,14 +30,14 @@ class C1 implements base1 { i = "foo"; c } >C1 : C1 >base1 : base1 >i : string ->"foo" : string +>"foo" : "foo" >c : any class D1 extends C1 { i = "bar"; d } >D1 : D1 >C1 : C1 >i : string ->"bar" : string +>"bar" : "bar" >d : any var t1: [C, base]; @@ -69,29 +69,29 @@ var e11 = t1[4]; // base >e11 : base | C >t1[4] : base | C >t1 : [C, base] ->4 : number +>4 : 4 var e21 = t2[4]; // {} >e21 : C | D >t2[4] : C | D >t2 : [C, D] ->4 : number +>4 : 4 var e31 = t3[4]; // C1 >e31 : C1 | D1 >t3[4] : C1 | D1 >t3 : [C1, D1] ->4 : number +>4 : 4 var e41 = t4[2]; // base1 >e41 : base1 | C1 >t4[2] : base1 | C1 >t4 : [base1, C1] ->2 : number +>2 : 2 var e51 = t5[2]; // {} >e51 : F | C1 >t5[2] : F | C1 >t5 : [C1, F] ->2 : number +>2 : 2 diff --git a/tests/baselines/reference/bestCommonTypeReturnStatement.types b/tests/baselines/reference/bestCommonTypeReturnStatement.types index 31f72ab93b4..b327e707350 100644 --- a/tests/baselines/reference/bestCommonTypeReturnStatement.types +++ b/tests/baselines/reference/bestCommonTypeReturnStatement.types @@ -15,10 +15,10 @@ interface IPromise { } function f() { ->f : () => IPromise +>f : () => IPromise if (true) return b(); ->true : boolean +>true : true >b() : IPromise >b : () => IPromise diff --git a/tests/baselines/reference/binaryArithmatic1.types b/tests/baselines/reference/binaryArithmatic1.types index 43f4f26de60..3d24fe4b44e 100644 --- a/tests/baselines/reference/binaryArithmatic1.types +++ b/tests/baselines/reference/binaryArithmatic1.types @@ -2,6 +2,6 @@ var v = 4 | null; >v : number >4 | null : number ->4 : number +>4 : 4 >null : null diff --git a/tests/baselines/reference/binaryArithmatic2.types b/tests/baselines/reference/binaryArithmatic2.types index 77cbce5b1e3..1ce8776384c 100644 --- a/tests/baselines/reference/binaryArithmatic2.types +++ b/tests/baselines/reference/binaryArithmatic2.types @@ -2,6 +2,6 @@ var v = 4 | undefined; >v : number >4 | undefined : number ->4 : number +>4 : 4 >undefined : undefined diff --git a/tests/baselines/reference/binaryIntegerLiteral.types b/tests/baselines/reference/binaryIntegerLiteral.types index 4ff3c3c28a3..5cee371fdbe 100644 --- a/tests/baselines/reference/binaryIntegerLiteral.types +++ b/tests/baselines/reference/binaryIntegerLiteral.types @@ -1,26 +1,26 @@ === tests/cases/conformance/es6/binaryAndOctalIntegerLiteral/binaryIntegerLiteral.ts === var bin1 = 0b11010; >bin1 : number ->0b11010 : number +>0b11010 : 26 var bin2 = 0B11010; >bin2 : number ->0B11010 : number +>0B11010 : 26 var bin3 = 0B11111111111111111111111111111111111111111111111101001010100000010111110001111111111; >bin3 : number ->0B11111111111111111111111111111111111111111111111101001010100000010111110001111111111 : number +>0B11111111111111111111111111111111111111111111111101001010100000010111110001111111111 : 9.671406556917009e+24 var bin4 = 0B111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111101001010100000010111110001111111111; >bin4 : number ->0B111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111101001010100000010111110001111111111 : number +>0B111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111101001010100000010111110001111111111 : Infinity var obj1 = { >obj1 : { 0b11010: string; a: number; bin1: number; b: number; 0B111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111101001010100000010111110001111111111: boolean; } >{ 0b11010: "Hello", a: bin1, bin1, b: 0b11010, 0B111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111101001010100000010111110001111111111: true,} : { 0b11010: string; a: number; bin1: number; b: number; 0B111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111101001010100000010111110001111111111: boolean; } 0b11010: "Hello", ->"Hello" : string +>"Hello" : "Hello" a: bin1, >a : number @@ -31,10 +31,10 @@ var obj1 = { b: 0b11010, >b : number ->0b11010 : number +>0b11010 : 26 0B111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111101001010100000010111110001111111111: true, ->true : boolean +>true : true } var obj2 = { @@ -42,7 +42,7 @@ var obj2 = { >{ 0B11010: "World", a: bin2, bin2, b: 0B11010, 0B11111111111111111111111111111111111111111111111101001010100000010111110001111111111: false,} : { 0B11010: string; a: number; bin2: number; b: number; 0B11111111111111111111111111111111111111111111111101001010100000010111110001111111111: boolean; } 0B11010: "World", ->"World" : string +>"World" : "World" a: bin2, >a : number @@ -53,100 +53,100 @@ var obj2 = { b: 0B11010, >b : number ->0B11010 : number +>0B11010 : 26 0B11111111111111111111111111111111111111111111111101001010100000010111110001111111111: false, ->false : boolean +>false : false } obj1[0b11010]; // string >obj1[0b11010] : string >obj1 : { 0b11010: string; a: number; bin1: number; b: number; 0B111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111101001010100000010111110001111111111: boolean; } ->0b11010 : number +>0b11010 : 26 obj1[26]; // string >obj1[26] : string >obj1 : { 0b11010: string; a: number; bin1: number; b: number; 0B111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111101001010100000010111110001111111111: boolean; } ->26 : number +>26 : 26 obj1["26"]; // string >obj1["26"] : string >obj1 : { 0b11010: string; a: number; bin1: number; b: number; 0B111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111101001010100000010111110001111111111: boolean; } ->"26" : string +>"26" : "26" obj1["0b11010"]; // any >obj1["0b11010"] : any >obj1 : { 0b11010: string; a: number; bin1: number; b: number; 0B111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111101001010100000010111110001111111111: boolean; } ->"0b11010" : string +>"0b11010" : "0b11010" obj1["a"]; // number >obj1["a"] : number >obj1 : { 0b11010: string; a: number; bin1: number; b: number; 0B111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111101001010100000010111110001111111111: boolean; } ->"a" : string +>"a" : "a" obj1["b"]; // number >obj1["b"] : number >obj1 : { 0b11010: string; a: number; bin1: number; b: number; 0B111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111101001010100000010111110001111111111: boolean; } ->"b" : string +>"b" : "b" obj1["bin1"]; // number >obj1["bin1"] : number >obj1 : { 0b11010: string; a: number; bin1: number; b: number; 0B111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111101001010100000010111110001111111111: boolean; } ->"bin1" : string +>"bin1" : "bin1" obj1["Infinity"]; // boolean >obj1["Infinity"] : boolean >obj1 : { 0b11010: string; a: number; bin1: number; b: number; 0B111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111101001010100000010111110001111111111: boolean; } ->"Infinity" : string +>"Infinity" : "Infinity" obj2[0B11010]; // string >obj2[0B11010] : string >obj2 : { 0B11010: string; a: number; bin2: number; b: number; 0B11111111111111111111111111111111111111111111111101001010100000010111110001111111111: boolean; } ->0B11010 : number +>0B11010 : 26 obj2[26]; // string >obj2[26] : string >obj2 : { 0B11010: string; a: number; bin2: number; b: number; 0B11111111111111111111111111111111111111111111111101001010100000010111110001111111111: boolean; } ->26 : number +>26 : 26 obj2["26"]; // string >obj2["26"] : string >obj2 : { 0B11010: string; a: number; bin2: number; b: number; 0B11111111111111111111111111111111111111111111111101001010100000010111110001111111111: boolean; } ->"26" : string +>"26" : "26" obj2["0B11010"]; // any >obj2["0B11010"] : any >obj2 : { 0B11010: string; a: number; bin2: number; b: number; 0B11111111111111111111111111111111111111111111111101001010100000010111110001111111111: boolean; } ->"0B11010" : string +>"0B11010" : "0B11010" obj2["a"]; // number >obj2["a"] : number >obj2 : { 0B11010: string; a: number; bin2: number; b: number; 0B11111111111111111111111111111111111111111111111101001010100000010111110001111111111: boolean; } ->"a" : string +>"a" : "a" obj2["b"]; // number >obj2["b"] : number >obj2 : { 0B11010: string; a: number; bin2: number; b: number; 0B11111111111111111111111111111111111111111111111101001010100000010111110001111111111: boolean; } ->"b" : string +>"b" : "b" obj2["bin2"]; // number >obj2["bin2"] : number >obj2 : { 0B11010: string; a: number; bin2: number; b: number; 0B11111111111111111111111111111111111111111111111101001010100000010111110001111111111: boolean; } ->"bin2" : string +>"bin2" : "bin2" obj2[9.671406556917009e+24]; // boolean >obj2[9.671406556917009e+24] : boolean >obj2 : { 0B11010: string; a: number; bin2: number; b: number; 0B11111111111111111111111111111111111111111111111101001010100000010111110001111111111: boolean; } ->9.671406556917009e+24 : number +>9.671406556917009e+24 : 9.671406556917009e+24 obj2["9.671406556917009e+24"]; // boolean >obj2["9.671406556917009e+24"] : boolean >obj2 : { 0B11010: string; a: number; bin2: number; b: number; 0B11111111111111111111111111111111111111111111111101001010100000010111110001111111111: boolean; } ->"9.671406556917009e+24" : string +>"9.671406556917009e+24" : "9.671406556917009e+24" obj2["Infinity"]; // any >obj2["Infinity"] : any >obj2 : { 0B11010: string; a: number; bin2: number; b: number; 0B11111111111111111111111111111111111111111111111101001010100000010111110001111111111: boolean; } ->"Infinity" : string +>"Infinity" : "Infinity" diff --git a/tests/baselines/reference/binaryIntegerLiteralES6.types b/tests/baselines/reference/binaryIntegerLiteralES6.types index 47bfe6f548d..ab28010283b 100644 --- a/tests/baselines/reference/binaryIntegerLiteralES6.types +++ b/tests/baselines/reference/binaryIntegerLiteralES6.types @@ -1,26 +1,26 @@ === tests/cases/conformance/es6/binaryAndOctalIntegerLiteral/binaryIntegerLiteralES6.ts === var bin1 = 0b11010; >bin1 : number ->0b11010 : number +>0b11010 : 26 var bin2 = 0B11010; >bin2 : number ->0B11010 : number +>0B11010 : 26 var bin3 = 0B11111111111111111111111111111111111111111111111101001010100000010111110001111111111; >bin3 : number ->0B11111111111111111111111111111111111111111111111101001010100000010111110001111111111 : number +>0B11111111111111111111111111111111111111111111111101001010100000010111110001111111111 : 9.671406556917009e+24 var bin4 = 0B111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111101001010100000010111110001111111111; >bin4 : number ->0B111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111101001010100000010111110001111111111 : number +>0B111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111101001010100000010111110001111111111 : Infinity var obj1 = { >obj1 : { 0b11010: string; a: number; bin1: number; b: number; 0B111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111101001010100000010111110001111111111: boolean; } >{ 0b11010: "Hello", a: bin1, bin1, b: 0b11010, 0B111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111101001010100000010111110001111111111: true,} : { 0b11010: string; a: number; bin1: number; b: number; 0B111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111101001010100000010111110001111111111: boolean; } 0b11010: "Hello", ->"Hello" : string +>"Hello" : "Hello" a: bin1, >a : number @@ -31,10 +31,10 @@ var obj1 = { b: 0b11010, >b : number ->0b11010 : number +>0b11010 : 26 0B111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111101001010100000010111110001111111111: true, ->true : boolean +>true : true } var obj2 = { @@ -42,7 +42,7 @@ var obj2 = { >{ 0B11010: "World", a: bin2, bin2, b: 0B11010, 0B11111111111111111111111111111111111111111111111101001010100000010111110001111111111: false,} : { 0B11010: string; a: number; bin2: number; b: number; 0B11111111111111111111111111111111111111111111111101001010100000010111110001111111111: boolean; } 0B11010: "World", ->"World" : string +>"World" : "World" a: bin2, >a : number @@ -53,101 +53,101 @@ var obj2 = { b: 0B11010, >b : number ->0B11010 : number +>0B11010 : 26 0B11111111111111111111111111111111111111111111111101001010100000010111110001111111111: false, ->false : boolean +>false : false } obj1[0b11010]; // string >obj1[0b11010] : string >obj1 : { 0b11010: string; a: number; bin1: number; b: number; 0B111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111101001010100000010111110001111111111: boolean; } ->0b11010 : number +>0b11010 : 26 obj1[26]; // string >obj1[26] : string >obj1 : { 0b11010: string; a: number; bin1: number; b: number; 0B111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111101001010100000010111110001111111111: boolean; } ->26 : number +>26 : 26 obj1["26"]; // string >obj1["26"] : string >obj1 : { 0b11010: string; a: number; bin1: number; b: number; 0B111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111101001010100000010111110001111111111: boolean; } ->"26" : string +>"26" : "26" obj1["0b11010"]; // any >obj1["0b11010"] : any >obj1 : { 0b11010: string; a: number; bin1: number; b: number; 0B111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111101001010100000010111110001111111111: boolean; } ->"0b11010" : string +>"0b11010" : "0b11010" obj1["a"]; // number >obj1["a"] : number >obj1 : { 0b11010: string; a: number; bin1: number; b: number; 0B111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111101001010100000010111110001111111111: boolean; } ->"a" : string +>"a" : "a" obj1["b"]; // number >obj1["b"] : number >obj1 : { 0b11010: string; a: number; bin1: number; b: number; 0B111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111101001010100000010111110001111111111: boolean; } ->"b" : string +>"b" : "b" obj1["bin1"]; // number >obj1["bin1"] : number >obj1 : { 0b11010: string; a: number; bin1: number; b: number; 0B111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111101001010100000010111110001111111111: boolean; } ->"bin1" : string +>"bin1" : "bin1" obj1["Infinity"]; // boolean >obj1["Infinity"] : boolean >obj1 : { 0b11010: string; a: number; bin1: number; b: number; 0B111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111101001010100000010111110001111111111: boolean; } ->"Infinity" : string +>"Infinity" : "Infinity" obj2[0B11010]; // string >obj2[0B11010] : string >obj2 : { 0B11010: string; a: number; bin2: number; b: number; 0B11111111111111111111111111111111111111111111111101001010100000010111110001111111111: boolean; } ->0B11010 : number +>0B11010 : 26 obj2[26]; // string >obj2[26] : string >obj2 : { 0B11010: string; a: number; bin2: number; b: number; 0B11111111111111111111111111111111111111111111111101001010100000010111110001111111111: boolean; } ->26 : number +>26 : 26 obj2["26"]; // string >obj2["26"] : string >obj2 : { 0B11010: string; a: number; bin2: number; b: number; 0B11111111111111111111111111111111111111111111111101001010100000010111110001111111111: boolean; } ->"26" : string +>"26" : "26" obj2["0B11010"]; // any >obj2["0B11010"] : any >obj2 : { 0B11010: string; a: number; bin2: number; b: number; 0B11111111111111111111111111111111111111111111111101001010100000010111110001111111111: boolean; } ->"0B11010" : string +>"0B11010" : "0B11010" obj2["a"]; // number >obj2["a"] : number >obj2 : { 0B11010: string; a: number; bin2: number; b: number; 0B11111111111111111111111111111111111111111111111101001010100000010111110001111111111: boolean; } ->"a" : string +>"a" : "a" obj2["b"]; // number >obj2["b"] : number >obj2 : { 0B11010: string; a: number; bin2: number; b: number; 0B11111111111111111111111111111111111111111111111101001010100000010111110001111111111: boolean; } ->"b" : string +>"b" : "b" obj2["bin2"]; // number >obj2["bin2"] : number >obj2 : { 0B11010: string; a: number; bin2: number; b: number; 0B11111111111111111111111111111111111111111111111101001010100000010111110001111111111: boolean; } ->"bin2" : string +>"bin2" : "bin2" obj2[9.671406556917009e+24]; // boolean >obj2[9.671406556917009e+24] : boolean >obj2 : { 0B11010: string; a: number; bin2: number; b: number; 0B11111111111111111111111111111111111111111111111101001010100000010111110001111111111: boolean; } ->9.671406556917009e+24 : number +>9.671406556917009e+24 : 9.671406556917009e+24 obj2["9.671406556917009e+24"]; // boolean >obj2["9.671406556917009e+24"] : boolean >obj2 : { 0B11010: string; a: number; bin2: number; b: number; 0B11111111111111111111111111111111111111111111111101001010100000010111110001111111111: boolean; } ->"9.671406556917009e+24" : string +>"9.671406556917009e+24" : "9.671406556917009e+24" obj2["Infinity"]; // any >obj2["Infinity"] : any >obj2 : { 0B11010: string; a: number; bin2: number; b: number; 0B11111111111111111111111111111111111111111111111101001010100000010111110001111111111: boolean; } ->"Infinity" : string +>"Infinity" : "Infinity" diff --git a/tests/baselines/reference/binopAssignmentShouldHaveType.types b/tests/baselines/reference/binopAssignmentShouldHaveType.types index d09138bbb88..7adfb46792e 100644 --- a/tests/baselines/reference/binopAssignmentShouldHaveType.types +++ b/tests/baselines/reference/binopAssignmentShouldHaveType.types @@ -3,7 +3,7 @@ declare var console; >console : any "use strict"; ->"use strict" : string +>"use strict" : "use strict" module Test { >Test : typeof Test @@ -15,7 +15,7 @@ module Test { >getName : () => string return "name"; ->"name" : string +>"name" : "name" } bug() { >bug : () => void @@ -35,7 +35,7 @@ module Test { >this : this >getName : () => string >length : number ->0 : number +>0 : 0 console.log(name); >console.log(name) : any diff --git a/tests/baselines/reference/bitwiseNotOperatorWithAnyOtherType.errors.txt b/tests/baselines/reference/bitwiseNotOperatorWithAnyOtherType.errors.txt index fe91cc8a339..66d4cbb628e 100644 --- a/tests/baselines/reference/bitwiseNotOperatorWithAnyOtherType.errors.txt +++ b/tests/baselines/reference/bitwiseNotOperatorWithAnyOtherType.errors.txt @@ -1,9 +1,10 @@ -tests/cases/conformance/expressions/unaryOperators/bitwiseNotOperator/bitwiseNotOperatorWithAnyOtherType.ts(46,26): error TS2365: Operator '+' cannot be applied to types 'undefined' and 'undefined'. -tests/cases/conformance/expressions/unaryOperators/bitwiseNotOperator/bitwiseNotOperatorWithAnyOtherType.ts(47,26): error TS2365: Operator '+' cannot be applied to types 'null' and 'null'. -tests/cases/conformance/expressions/unaryOperators/bitwiseNotOperator/bitwiseNotOperatorWithAnyOtherType.ts(48,26): error TS2365: Operator '+' cannot be applied to types 'undefined' and 'undefined'. +tests/cases/conformance/expressions/unaryOperators/bitwiseNotOperator/bitwiseNotOperatorWithAnyOtherType.ts(47,26): error TS2365: Operator '+' cannot be applied to types 'undefined' and 'undefined'. +tests/cases/conformance/expressions/unaryOperators/bitwiseNotOperator/bitwiseNotOperatorWithAnyOtherType.ts(48,26): error TS2365: Operator '+' cannot be applied to types 'null' and 'null'. +tests/cases/conformance/expressions/unaryOperators/bitwiseNotOperator/bitwiseNotOperatorWithAnyOtherType.ts(49,26): error TS2365: Operator '+' cannot be applied to types 'undefined' and 'undefined'. ==== tests/cases/conformance/expressions/unaryOperators/bitwiseNotOperator/bitwiseNotOperatorWithAnyOtherType.ts (3 errors) ==== + // ~ operator on any type var ANY: any; diff --git a/tests/baselines/reference/bitwiseNotOperatorWithAnyOtherType.js b/tests/baselines/reference/bitwiseNotOperatorWithAnyOtherType.js index 0236bd736ee..860dbc68a53 100644 --- a/tests/baselines/reference/bitwiseNotOperatorWithAnyOtherType.js +++ b/tests/baselines/reference/bitwiseNotOperatorWithAnyOtherType.js @@ -1,4 +1,5 @@ //// [bitwiseNotOperatorWithAnyOtherType.ts] + // ~ operator on any type var ANY: any; diff --git a/tests/baselines/reference/bitwiseNotOperatorWithBooleanType.js b/tests/baselines/reference/bitwiseNotOperatorWithBooleanType.js index b35a5e4ba12..cd0e967b66f 100644 --- a/tests/baselines/reference/bitwiseNotOperatorWithBooleanType.js +++ b/tests/baselines/reference/bitwiseNotOperatorWithBooleanType.js @@ -1,4 +1,5 @@ //// [bitwiseNotOperatorWithBooleanType.ts] + // ~ operator on boolean type var BOOLEAN: boolean; diff --git a/tests/baselines/reference/bitwiseNotOperatorWithBooleanType.symbols b/tests/baselines/reference/bitwiseNotOperatorWithBooleanType.symbols index d52e73ba600..ad30b16dd08 100644 --- a/tests/baselines/reference/bitwiseNotOperatorWithBooleanType.symbols +++ b/tests/baselines/reference/bitwiseNotOperatorWithBooleanType.symbols @@ -1,89 +1,90 @@ === tests/cases/conformance/expressions/unaryOperators/bitwiseNotOperator/bitwiseNotOperatorWithBooleanType.ts === + // ~ operator on boolean type var BOOLEAN: boolean; ->BOOLEAN : Symbol(BOOLEAN, Decl(bitwiseNotOperatorWithBooleanType.ts, 1, 3)) +>BOOLEAN : Symbol(BOOLEAN, Decl(bitwiseNotOperatorWithBooleanType.ts, 2, 3)) function foo(): boolean { return true; } ->foo : Symbol(foo, Decl(bitwiseNotOperatorWithBooleanType.ts, 1, 21)) +>foo : Symbol(foo, Decl(bitwiseNotOperatorWithBooleanType.ts, 2, 21)) class A { ->A : Symbol(A, Decl(bitwiseNotOperatorWithBooleanType.ts, 3, 40)) +>A : Symbol(A, Decl(bitwiseNotOperatorWithBooleanType.ts, 4, 40)) public a: boolean; ->a : Symbol(A.a, Decl(bitwiseNotOperatorWithBooleanType.ts, 5, 9)) +>a : Symbol(A.a, Decl(bitwiseNotOperatorWithBooleanType.ts, 6, 9)) static foo() { return false; } ->foo : Symbol(A.foo, Decl(bitwiseNotOperatorWithBooleanType.ts, 6, 22)) +>foo : Symbol(A.foo, Decl(bitwiseNotOperatorWithBooleanType.ts, 7, 22)) } module M { ->M : Symbol(M, Decl(bitwiseNotOperatorWithBooleanType.ts, 8, 1)) +>M : Symbol(M, Decl(bitwiseNotOperatorWithBooleanType.ts, 9, 1)) export var n: boolean; ->n : Symbol(n, Decl(bitwiseNotOperatorWithBooleanType.ts, 10, 14)) +>n : Symbol(n, Decl(bitwiseNotOperatorWithBooleanType.ts, 11, 14)) } var objA = new A(); ->objA : Symbol(objA, Decl(bitwiseNotOperatorWithBooleanType.ts, 13, 3)) ->A : Symbol(A, Decl(bitwiseNotOperatorWithBooleanType.ts, 3, 40)) +>objA : Symbol(objA, Decl(bitwiseNotOperatorWithBooleanType.ts, 14, 3)) +>A : Symbol(A, Decl(bitwiseNotOperatorWithBooleanType.ts, 4, 40)) // boolean type var var ResultIsNumber1 = ~BOOLEAN; ->ResultIsNumber1 : Symbol(ResultIsNumber1, Decl(bitwiseNotOperatorWithBooleanType.ts, 16, 3)) ->BOOLEAN : Symbol(BOOLEAN, Decl(bitwiseNotOperatorWithBooleanType.ts, 1, 3)) +>ResultIsNumber1 : Symbol(ResultIsNumber1, Decl(bitwiseNotOperatorWithBooleanType.ts, 17, 3)) +>BOOLEAN : Symbol(BOOLEAN, Decl(bitwiseNotOperatorWithBooleanType.ts, 2, 3)) // boolean type literal var ResultIsNumber2 = ~true; ->ResultIsNumber2 : Symbol(ResultIsNumber2, Decl(bitwiseNotOperatorWithBooleanType.ts, 19, 3)) +>ResultIsNumber2 : Symbol(ResultIsNumber2, Decl(bitwiseNotOperatorWithBooleanType.ts, 20, 3)) var ResultIsNumber3 = ~{ x: true, y: false }; ->ResultIsNumber3 : Symbol(ResultIsNumber3, Decl(bitwiseNotOperatorWithBooleanType.ts, 20, 3)) ->x : Symbol(x, Decl(bitwiseNotOperatorWithBooleanType.ts, 20, 24)) ->y : Symbol(y, Decl(bitwiseNotOperatorWithBooleanType.ts, 20, 33)) +>ResultIsNumber3 : Symbol(ResultIsNumber3, Decl(bitwiseNotOperatorWithBooleanType.ts, 21, 3)) +>x : Symbol(x, Decl(bitwiseNotOperatorWithBooleanType.ts, 21, 24)) +>y : Symbol(y, Decl(bitwiseNotOperatorWithBooleanType.ts, 21, 33)) // boolean type expressions var ResultIsNumber4 = ~objA.a; ->ResultIsNumber4 : Symbol(ResultIsNumber4, Decl(bitwiseNotOperatorWithBooleanType.ts, 23, 3)) ->objA.a : Symbol(A.a, Decl(bitwiseNotOperatorWithBooleanType.ts, 5, 9)) ->objA : Symbol(objA, Decl(bitwiseNotOperatorWithBooleanType.ts, 13, 3)) ->a : Symbol(A.a, Decl(bitwiseNotOperatorWithBooleanType.ts, 5, 9)) +>ResultIsNumber4 : Symbol(ResultIsNumber4, Decl(bitwiseNotOperatorWithBooleanType.ts, 24, 3)) +>objA.a : Symbol(A.a, Decl(bitwiseNotOperatorWithBooleanType.ts, 6, 9)) +>objA : Symbol(objA, Decl(bitwiseNotOperatorWithBooleanType.ts, 14, 3)) +>a : Symbol(A.a, Decl(bitwiseNotOperatorWithBooleanType.ts, 6, 9)) var ResultIsNumber5 = ~M.n; ->ResultIsNumber5 : Symbol(ResultIsNumber5, Decl(bitwiseNotOperatorWithBooleanType.ts, 24, 3)) ->M.n : Symbol(M.n, Decl(bitwiseNotOperatorWithBooleanType.ts, 10, 14)) ->M : Symbol(M, Decl(bitwiseNotOperatorWithBooleanType.ts, 8, 1)) ->n : Symbol(M.n, Decl(bitwiseNotOperatorWithBooleanType.ts, 10, 14)) +>ResultIsNumber5 : Symbol(ResultIsNumber5, Decl(bitwiseNotOperatorWithBooleanType.ts, 25, 3)) +>M.n : Symbol(M.n, Decl(bitwiseNotOperatorWithBooleanType.ts, 11, 14)) +>M : Symbol(M, Decl(bitwiseNotOperatorWithBooleanType.ts, 9, 1)) +>n : Symbol(M.n, Decl(bitwiseNotOperatorWithBooleanType.ts, 11, 14)) var ResultIsNumber6 = ~foo(); ->ResultIsNumber6 : Symbol(ResultIsNumber6, Decl(bitwiseNotOperatorWithBooleanType.ts, 25, 3)) ->foo : Symbol(foo, Decl(bitwiseNotOperatorWithBooleanType.ts, 1, 21)) +>ResultIsNumber6 : Symbol(ResultIsNumber6, Decl(bitwiseNotOperatorWithBooleanType.ts, 26, 3)) +>foo : Symbol(foo, Decl(bitwiseNotOperatorWithBooleanType.ts, 2, 21)) var ResultIsNumber7 = ~A.foo(); ->ResultIsNumber7 : Symbol(ResultIsNumber7, Decl(bitwiseNotOperatorWithBooleanType.ts, 26, 3)) ->A.foo : Symbol(A.foo, Decl(bitwiseNotOperatorWithBooleanType.ts, 6, 22)) ->A : Symbol(A, Decl(bitwiseNotOperatorWithBooleanType.ts, 3, 40)) ->foo : Symbol(A.foo, Decl(bitwiseNotOperatorWithBooleanType.ts, 6, 22)) +>ResultIsNumber7 : Symbol(ResultIsNumber7, Decl(bitwiseNotOperatorWithBooleanType.ts, 27, 3)) +>A.foo : Symbol(A.foo, Decl(bitwiseNotOperatorWithBooleanType.ts, 7, 22)) +>A : Symbol(A, Decl(bitwiseNotOperatorWithBooleanType.ts, 4, 40)) +>foo : Symbol(A.foo, Decl(bitwiseNotOperatorWithBooleanType.ts, 7, 22)) // multiple ~ operators var ResultIsNumber8 = ~~BOOLEAN; ->ResultIsNumber8 : Symbol(ResultIsNumber8, Decl(bitwiseNotOperatorWithBooleanType.ts, 29, 3)) ->BOOLEAN : Symbol(BOOLEAN, Decl(bitwiseNotOperatorWithBooleanType.ts, 1, 3)) +>ResultIsNumber8 : Symbol(ResultIsNumber8, Decl(bitwiseNotOperatorWithBooleanType.ts, 30, 3)) +>BOOLEAN : Symbol(BOOLEAN, Decl(bitwiseNotOperatorWithBooleanType.ts, 2, 3)) // miss assignment operators ~true; ~BOOLEAN; ->BOOLEAN : Symbol(BOOLEAN, Decl(bitwiseNotOperatorWithBooleanType.ts, 1, 3)) +>BOOLEAN : Symbol(BOOLEAN, Decl(bitwiseNotOperatorWithBooleanType.ts, 2, 3)) ~foo(); ->foo : Symbol(foo, Decl(bitwiseNotOperatorWithBooleanType.ts, 1, 21)) +>foo : Symbol(foo, Decl(bitwiseNotOperatorWithBooleanType.ts, 2, 21)) ~true, false; ~objA.a; ->objA.a : Symbol(A.a, Decl(bitwiseNotOperatorWithBooleanType.ts, 5, 9)) ->objA : Symbol(objA, Decl(bitwiseNotOperatorWithBooleanType.ts, 13, 3)) ->a : Symbol(A.a, Decl(bitwiseNotOperatorWithBooleanType.ts, 5, 9)) +>objA.a : Symbol(A.a, Decl(bitwiseNotOperatorWithBooleanType.ts, 6, 9)) +>objA : Symbol(objA, Decl(bitwiseNotOperatorWithBooleanType.ts, 14, 3)) +>a : Symbol(A.a, Decl(bitwiseNotOperatorWithBooleanType.ts, 6, 9)) ~M.n; ->M.n : Symbol(M.n, Decl(bitwiseNotOperatorWithBooleanType.ts, 10, 14)) ->M : Symbol(M, Decl(bitwiseNotOperatorWithBooleanType.ts, 8, 1)) ->n : Symbol(M.n, Decl(bitwiseNotOperatorWithBooleanType.ts, 10, 14)) +>M.n : Symbol(M.n, Decl(bitwiseNotOperatorWithBooleanType.ts, 11, 14)) +>M : Symbol(M, Decl(bitwiseNotOperatorWithBooleanType.ts, 9, 1)) +>n : Symbol(M.n, Decl(bitwiseNotOperatorWithBooleanType.ts, 11, 14)) diff --git a/tests/baselines/reference/bitwiseNotOperatorWithBooleanType.types b/tests/baselines/reference/bitwiseNotOperatorWithBooleanType.types index 234c01e2241..ccdc6a7bf0c 100644 --- a/tests/baselines/reference/bitwiseNotOperatorWithBooleanType.types +++ b/tests/baselines/reference/bitwiseNotOperatorWithBooleanType.types @@ -1,11 +1,12 @@ === tests/cases/conformance/expressions/unaryOperators/bitwiseNotOperator/bitwiseNotOperatorWithBooleanType.ts === + // ~ operator on boolean type var BOOLEAN: boolean; >BOOLEAN : boolean function foo(): boolean { return true; } >foo : () => boolean ->true : boolean +>true : true class A { >A : A @@ -15,7 +16,7 @@ class A { static foo() { return false; } >foo : () => boolean ->false : boolean +>false : false } module M { >M : typeof M @@ -39,16 +40,16 @@ var ResultIsNumber1 = ~BOOLEAN; var ResultIsNumber2 = ~true; >ResultIsNumber2 : number >~true : number ->true : boolean +>true : true var ResultIsNumber3 = ~{ x: true, y: false }; >ResultIsNumber3 : number >~{ x: true, y: false } : number >{ x: true, y: false } : { x: boolean; y: boolean; } >x : boolean ->true : boolean +>true : true >y : boolean ->false : boolean +>false : false // boolean type expressions var ResultIsNumber4 = ~objA.a; @@ -89,7 +90,7 @@ var ResultIsNumber8 = ~~BOOLEAN; // miss assignment operators ~true; >~true : number ->true : boolean +>true : true ~BOOLEAN; >~BOOLEAN : number @@ -101,10 +102,10 @@ var ResultIsNumber8 = ~~BOOLEAN; >foo : () => boolean ~true, false; ->~true, false : boolean +>~true, false : false >~true : number ->true : boolean ->false : boolean +>true : true +>false : false ~objA.a; >~objA.a : number diff --git a/tests/baselines/reference/bitwiseNotOperatorWithEnumType.js b/tests/baselines/reference/bitwiseNotOperatorWithEnumType.js index 0bcf2fa3956..a270fc98c51 100644 --- a/tests/baselines/reference/bitwiseNotOperatorWithEnumType.js +++ b/tests/baselines/reference/bitwiseNotOperatorWithEnumType.js @@ -1,4 +1,5 @@ //// [bitwiseNotOperatorWithEnumType.ts] + // ~ operator on enum type enum ENUM1 { A, B, "" }; diff --git a/tests/baselines/reference/bitwiseNotOperatorWithEnumType.symbols b/tests/baselines/reference/bitwiseNotOperatorWithEnumType.symbols index 24783a153ae..6bd0aa8ad55 100644 --- a/tests/baselines/reference/bitwiseNotOperatorWithEnumType.symbols +++ b/tests/baselines/reference/bitwiseNotOperatorWithEnumType.symbols @@ -1,38 +1,39 @@ === tests/cases/conformance/expressions/unaryOperators/bitwiseNotOperator/bitwiseNotOperatorWithEnumType.ts === + // ~ operator on enum type enum ENUM1 { A, B, "" }; >ENUM1 : Symbol(ENUM1, Decl(bitwiseNotOperatorWithEnumType.ts, 0, 0)) ->A : Symbol(ENUM1.A, Decl(bitwiseNotOperatorWithEnumType.ts, 2, 12)) ->B : Symbol(ENUM1.B, Decl(bitwiseNotOperatorWithEnumType.ts, 2, 15)) +>A : Symbol(ENUM1.A, Decl(bitwiseNotOperatorWithEnumType.ts, 3, 12)) +>B : Symbol(ENUM1.B, Decl(bitwiseNotOperatorWithEnumType.ts, 3, 15)) // enum type var var ResultIsNumber1 = ~ENUM1; ->ResultIsNumber1 : Symbol(ResultIsNumber1, Decl(bitwiseNotOperatorWithEnumType.ts, 5, 3)) +>ResultIsNumber1 : Symbol(ResultIsNumber1, Decl(bitwiseNotOperatorWithEnumType.ts, 6, 3)) >ENUM1 : Symbol(ENUM1, Decl(bitwiseNotOperatorWithEnumType.ts, 0, 0)) // enum type expressions var ResultIsNumber2 = ~ENUM1["A"]; ->ResultIsNumber2 : Symbol(ResultIsNumber2, Decl(bitwiseNotOperatorWithEnumType.ts, 8, 3)) +>ResultIsNumber2 : Symbol(ResultIsNumber2, Decl(bitwiseNotOperatorWithEnumType.ts, 9, 3)) >ENUM1 : Symbol(ENUM1, Decl(bitwiseNotOperatorWithEnumType.ts, 0, 0)) ->"A" : Symbol(ENUM1.A, Decl(bitwiseNotOperatorWithEnumType.ts, 2, 12)) +>"A" : Symbol(ENUM1.A, Decl(bitwiseNotOperatorWithEnumType.ts, 3, 12)) var ResultIsNumber3 = ~(ENUM1.A + ENUM1["B"]); ->ResultIsNumber3 : Symbol(ResultIsNumber3, Decl(bitwiseNotOperatorWithEnumType.ts, 9, 3)) ->ENUM1.A : Symbol(ENUM1.A, Decl(bitwiseNotOperatorWithEnumType.ts, 2, 12)) +>ResultIsNumber3 : Symbol(ResultIsNumber3, Decl(bitwiseNotOperatorWithEnumType.ts, 10, 3)) +>ENUM1.A : Symbol(ENUM1.A, Decl(bitwiseNotOperatorWithEnumType.ts, 3, 12)) >ENUM1 : Symbol(ENUM1, Decl(bitwiseNotOperatorWithEnumType.ts, 0, 0)) ->A : Symbol(ENUM1.A, Decl(bitwiseNotOperatorWithEnumType.ts, 2, 12)) +>A : Symbol(ENUM1.A, Decl(bitwiseNotOperatorWithEnumType.ts, 3, 12)) >ENUM1 : Symbol(ENUM1, Decl(bitwiseNotOperatorWithEnumType.ts, 0, 0)) ->"B" : Symbol(ENUM1.B, Decl(bitwiseNotOperatorWithEnumType.ts, 2, 15)) +>"B" : Symbol(ENUM1.B, Decl(bitwiseNotOperatorWithEnumType.ts, 3, 15)) // multiple ~ operators var ResultIsNumber4 = ~~~(ENUM1["A"] + ENUM1.B); ->ResultIsNumber4 : Symbol(ResultIsNumber4, Decl(bitwiseNotOperatorWithEnumType.ts, 12, 3)) +>ResultIsNumber4 : Symbol(ResultIsNumber4, Decl(bitwiseNotOperatorWithEnumType.ts, 13, 3)) >ENUM1 : Symbol(ENUM1, Decl(bitwiseNotOperatorWithEnumType.ts, 0, 0)) ->"A" : Symbol(ENUM1.A, Decl(bitwiseNotOperatorWithEnumType.ts, 2, 12)) ->ENUM1.B : Symbol(ENUM1.B, Decl(bitwiseNotOperatorWithEnumType.ts, 2, 15)) +>"A" : Symbol(ENUM1.A, Decl(bitwiseNotOperatorWithEnumType.ts, 3, 12)) +>ENUM1.B : Symbol(ENUM1.B, Decl(bitwiseNotOperatorWithEnumType.ts, 3, 15)) >ENUM1 : Symbol(ENUM1, Decl(bitwiseNotOperatorWithEnumType.ts, 0, 0)) ->B : Symbol(ENUM1.B, Decl(bitwiseNotOperatorWithEnumType.ts, 2, 15)) +>B : Symbol(ENUM1.B, Decl(bitwiseNotOperatorWithEnumType.ts, 3, 15)) // miss assignment operators ~ENUM1; @@ -40,12 +41,12 @@ var ResultIsNumber4 = ~~~(ENUM1["A"] + ENUM1.B); ~ENUM1["A"]; >ENUM1 : Symbol(ENUM1, Decl(bitwiseNotOperatorWithEnumType.ts, 0, 0)) ->"A" : Symbol(ENUM1.A, Decl(bitwiseNotOperatorWithEnumType.ts, 2, 12)) +>"A" : Symbol(ENUM1.A, Decl(bitwiseNotOperatorWithEnumType.ts, 3, 12)) ~ENUM1.A, ~ENUM1["B"]; ->ENUM1.A : Symbol(ENUM1.A, Decl(bitwiseNotOperatorWithEnumType.ts, 2, 12)) +>ENUM1.A : Symbol(ENUM1.A, Decl(bitwiseNotOperatorWithEnumType.ts, 3, 12)) >ENUM1 : Symbol(ENUM1, Decl(bitwiseNotOperatorWithEnumType.ts, 0, 0)) ->A : Symbol(ENUM1.A, Decl(bitwiseNotOperatorWithEnumType.ts, 2, 12)) +>A : Symbol(ENUM1.A, Decl(bitwiseNotOperatorWithEnumType.ts, 3, 12)) >ENUM1 : Symbol(ENUM1, Decl(bitwiseNotOperatorWithEnumType.ts, 0, 0)) ->"B" : Symbol(ENUM1.B, Decl(bitwiseNotOperatorWithEnumType.ts, 2, 15)) +>"B" : Symbol(ENUM1.B, Decl(bitwiseNotOperatorWithEnumType.ts, 3, 15)) diff --git a/tests/baselines/reference/bitwiseNotOperatorWithEnumType.types b/tests/baselines/reference/bitwiseNotOperatorWithEnumType.types index bb8be9b3f54..53d44f584ea 100644 --- a/tests/baselines/reference/bitwiseNotOperatorWithEnumType.types +++ b/tests/baselines/reference/bitwiseNotOperatorWithEnumType.types @@ -1,10 +1,11 @@ === tests/cases/conformance/expressions/unaryOperators/bitwiseNotOperator/bitwiseNotOperatorWithEnumType.ts === + // ~ operator on enum type enum ENUM1 { A, B, "" }; >ENUM1 : ENUM1 ->A : ENUM1 ->B : ENUM1 +>A : ENUM1.A +>B : ENUM1.B // enum type var var ResultIsNumber1 = ~ENUM1; @@ -16,21 +17,21 @@ var ResultIsNumber1 = ~ENUM1; var ResultIsNumber2 = ~ENUM1["A"]; >ResultIsNumber2 : number >~ENUM1["A"] : number ->ENUM1["A"] : ENUM1 +>ENUM1["A"] : ENUM1.A >ENUM1 : typeof ENUM1 ->"A" : string +>"A" : "A" var ResultIsNumber3 = ~(ENUM1.A + ENUM1["B"]); >ResultIsNumber3 : number >~(ENUM1.A + ENUM1["B"]) : number >(ENUM1.A + ENUM1["B"]) : number >ENUM1.A + ENUM1["B"] : number ->ENUM1.A : ENUM1 +>ENUM1.A : ENUM1.A >ENUM1 : typeof ENUM1 ->A : ENUM1 ->ENUM1["B"] : ENUM1 +>A : ENUM1.A +>ENUM1["B"] : ENUM1.B >ENUM1 : typeof ENUM1 ->"B" : string +>"B" : "B" // multiple ~ operators var ResultIsNumber4 = ~~~(ENUM1["A"] + ENUM1.B); @@ -40,12 +41,12 @@ var ResultIsNumber4 = ~~~(ENUM1["A"] + ENUM1.B); >~(ENUM1["A"] + ENUM1.B) : number >(ENUM1["A"] + ENUM1.B) : number >ENUM1["A"] + ENUM1.B : number ->ENUM1["A"] : ENUM1 +>ENUM1["A"] : ENUM1.A >ENUM1 : typeof ENUM1 ->"A" : string ->ENUM1.B : ENUM1 +>"A" : "A" +>ENUM1.B : ENUM1.B >ENUM1 : typeof ENUM1 ->B : ENUM1 +>B : ENUM1.B // miss assignment operators ~ENUM1; @@ -54,18 +55,18 @@ var ResultIsNumber4 = ~~~(ENUM1["A"] + ENUM1.B); ~ENUM1["A"]; >~ENUM1["A"] : number ->ENUM1["A"] : ENUM1 +>ENUM1["A"] : ENUM1.A >ENUM1 : typeof ENUM1 ->"A" : string +>"A" : "A" ~ENUM1.A, ~ENUM1["B"]; >~ENUM1.A, ~ENUM1["B"] : number >~ENUM1.A : number ->ENUM1.A : ENUM1 +>ENUM1.A : ENUM1.A >ENUM1 : typeof ENUM1 ->A : ENUM1 +>A : ENUM1.A >~ENUM1["B"] : number ->ENUM1["B"] : ENUM1 +>ENUM1["B"] : ENUM1.B >ENUM1 : typeof ENUM1 ->"B" : string +>"B" : "B" diff --git a/tests/baselines/reference/bitwiseNotOperatorWithNumberType.js b/tests/baselines/reference/bitwiseNotOperatorWithNumberType.js index aab04be6dfc..b6660f677c7 100644 --- a/tests/baselines/reference/bitwiseNotOperatorWithNumberType.js +++ b/tests/baselines/reference/bitwiseNotOperatorWithNumberType.js @@ -1,4 +1,5 @@ //// [bitwiseNotOperatorWithNumberType.ts] + // ~ operator on number type var NUMBER: number; var NUMBER1: number[] = [1, 2]; diff --git a/tests/baselines/reference/bitwiseNotOperatorWithNumberType.symbols b/tests/baselines/reference/bitwiseNotOperatorWithNumberType.symbols index f7dd03d78c3..8ce159b9171 100644 --- a/tests/baselines/reference/bitwiseNotOperatorWithNumberType.symbols +++ b/tests/baselines/reference/bitwiseNotOperatorWithNumberType.symbols @@ -1,126 +1,127 @@ === tests/cases/conformance/expressions/unaryOperators/bitwiseNotOperator/bitwiseNotOperatorWithNumberType.ts === + // ~ operator on number type var NUMBER: number; ->NUMBER : Symbol(NUMBER, Decl(bitwiseNotOperatorWithNumberType.ts, 1, 3)) +>NUMBER : Symbol(NUMBER, Decl(bitwiseNotOperatorWithNumberType.ts, 2, 3)) var NUMBER1: number[] = [1, 2]; ->NUMBER1 : Symbol(NUMBER1, Decl(bitwiseNotOperatorWithNumberType.ts, 2, 3)) +>NUMBER1 : Symbol(NUMBER1, Decl(bitwiseNotOperatorWithNumberType.ts, 3, 3)) function foo(): number { return 1; } ->foo : Symbol(foo, Decl(bitwiseNotOperatorWithNumberType.ts, 2, 31)) +>foo : Symbol(foo, Decl(bitwiseNotOperatorWithNumberType.ts, 3, 31)) class A { ->A : Symbol(A, Decl(bitwiseNotOperatorWithNumberType.ts, 4, 36)) +>A : Symbol(A, Decl(bitwiseNotOperatorWithNumberType.ts, 5, 36)) public a: number; ->a : Symbol(A.a, Decl(bitwiseNotOperatorWithNumberType.ts, 6, 9)) +>a : Symbol(A.a, Decl(bitwiseNotOperatorWithNumberType.ts, 7, 9)) static foo() { return 1; } ->foo : Symbol(A.foo, Decl(bitwiseNotOperatorWithNumberType.ts, 7, 21)) +>foo : Symbol(A.foo, Decl(bitwiseNotOperatorWithNumberType.ts, 8, 21)) } module M { ->M : Symbol(M, Decl(bitwiseNotOperatorWithNumberType.ts, 9, 1)) +>M : Symbol(M, Decl(bitwiseNotOperatorWithNumberType.ts, 10, 1)) export var n: number; ->n : Symbol(n, Decl(bitwiseNotOperatorWithNumberType.ts, 11, 14)) +>n : Symbol(n, Decl(bitwiseNotOperatorWithNumberType.ts, 12, 14)) } var objA = new A(); ->objA : Symbol(objA, Decl(bitwiseNotOperatorWithNumberType.ts, 14, 3)) ->A : Symbol(A, Decl(bitwiseNotOperatorWithNumberType.ts, 4, 36)) +>objA : Symbol(objA, Decl(bitwiseNotOperatorWithNumberType.ts, 15, 3)) +>A : Symbol(A, Decl(bitwiseNotOperatorWithNumberType.ts, 5, 36)) // number type var var ResultIsNumber1 = ~NUMBER; ->ResultIsNumber1 : Symbol(ResultIsNumber1, Decl(bitwiseNotOperatorWithNumberType.ts, 17, 3)) ->NUMBER : Symbol(NUMBER, Decl(bitwiseNotOperatorWithNumberType.ts, 1, 3)) +>ResultIsNumber1 : Symbol(ResultIsNumber1, Decl(bitwiseNotOperatorWithNumberType.ts, 18, 3)) +>NUMBER : Symbol(NUMBER, Decl(bitwiseNotOperatorWithNumberType.ts, 2, 3)) var ResultIsNumber2 = ~NUMBER1; ->ResultIsNumber2 : Symbol(ResultIsNumber2, Decl(bitwiseNotOperatorWithNumberType.ts, 18, 3)) ->NUMBER1 : Symbol(NUMBER1, Decl(bitwiseNotOperatorWithNumberType.ts, 2, 3)) +>ResultIsNumber2 : Symbol(ResultIsNumber2, Decl(bitwiseNotOperatorWithNumberType.ts, 19, 3)) +>NUMBER1 : Symbol(NUMBER1, Decl(bitwiseNotOperatorWithNumberType.ts, 3, 3)) // number type literal var ResultIsNumber3 = ~1; ->ResultIsNumber3 : Symbol(ResultIsNumber3, Decl(bitwiseNotOperatorWithNumberType.ts, 21, 3)) +>ResultIsNumber3 : Symbol(ResultIsNumber3, Decl(bitwiseNotOperatorWithNumberType.ts, 22, 3)) var ResultIsNumber4 = ~{ x: 1, y: 2}; ->ResultIsNumber4 : Symbol(ResultIsNumber4, Decl(bitwiseNotOperatorWithNumberType.ts, 22, 3)) ->x : Symbol(x, Decl(bitwiseNotOperatorWithNumberType.ts, 22, 24)) ->y : Symbol(y, Decl(bitwiseNotOperatorWithNumberType.ts, 22, 30)) - -var ResultIsNumber5 = ~{ x: 1, y: (n: number) => { return n; } }; ->ResultIsNumber5 : Symbol(ResultIsNumber5, Decl(bitwiseNotOperatorWithNumberType.ts, 23, 3)) +>ResultIsNumber4 : Symbol(ResultIsNumber4, Decl(bitwiseNotOperatorWithNumberType.ts, 23, 3)) >x : Symbol(x, Decl(bitwiseNotOperatorWithNumberType.ts, 23, 24)) >y : Symbol(y, Decl(bitwiseNotOperatorWithNumberType.ts, 23, 30)) ->n : Symbol(n, Decl(bitwiseNotOperatorWithNumberType.ts, 23, 35)) ->n : Symbol(n, Decl(bitwiseNotOperatorWithNumberType.ts, 23, 35)) + +var ResultIsNumber5 = ~{ x: 1, y: (n: number) => { return n; } }; +>ResultIsNumber5 : Symbol(ResultIsNumber5, Decl(bitwiseNotOperatorWithNumberType.ts, 24, 3)) +>x : Symbol(x, Decl(bitwiseNotOperatorWithNumberType.ts, 24, 24)) +>y : Symbol(y, Decl(bitwiseNotOperatorWithNumberType.ts, 24, 30)) +>n : Symbol(n, Decl(bitwiseNotOperatorWithNumberType.ts, 24, 35)) +>n : Symbol(n, Decl(bitwiseNotOperatorWithNumberType.ts, 24, 35)) // number type expressions var ResultIsNumber6 = ~objA.a; ->ResultIsNumber6 : Symbol(ResultIsNumber6, Decl(bitwiseNotOperatorWithNumberType.ts, 26, 3)) ->objA.a : Symbol(A.a, Decl(bitwiseNotOperatorWithNumberType.ts, 6, 9)) ->objA : Symbol(objA, Decl(bitwiseNotOperatorWithNumberType.ts, 14, 3)) ->a : Symbol(A.a, Decl(bitwiseNotOperatorWithNumberType.ts, 6, 9)) +>ResultIsNumber6 : Symbol(ResultIsNumber6, Decl(bitwiseNotOperatorWithNumberType.ts, 27, 3)) +>objA.a : Symbol(A.a, Decl(bitwiseNotOperatorWithNumberType.ts, 7, 9)) +>objA : Symbol(objA, Decl(bitwiseNotOperatorWithNumberType.ts, 15, 3)) +>a : Symbol(A.a, Decl(bitwiseNotOperatorWithNumberType.ts, 7, 9)) var ResultIsNumber7 = ~M.n; ->ResultIsNumber7 : Symbol(ResultIsNumber7, Decl(bitwiseNotOperatorWithNumberType.ts, 27, 3)) ->M.n : Symbol(M.n, Decl(bitwiseNotOperatorWithNumberType.ts, 11, 14)) ->M : Symbol(M, Decl(bitwiseNotOperatorWithNumberType.ts, 9, 1)) ->n : Symbol(M.n, Decl(bitwiseNotOperatorWithNumberType.ts, 11, 14)) +>ResultIsNumber7 : Symbol(ResultIsNumber7, Decl(bitwiseNotOperatorWithNumberType.ts, 28, 3)) +>M.n : Symbol(M.n, Decl(bitwiseNotOperatorWithNumberType.ts, 12, 14)) +>M : Symbol(M, Decl(bitwiseNotOperatorWithNumberType.ts, 10, 1)) +>n : Symbol(M.n, Decl(bitwiseNotOperatorWithNumberType.ts, 12, 14)) var ResultIsNumber8 = ~NUMBER1[0]; ->ResultIsNumber8 : Symbol(ResultIsNumber8, Decl(bitwiseNotOperatorWithNumberType.ts, 28, 3)) ->NUMBER1 : Symbol(NUMBER1, Decl(bitwiseNotOperatorWithNumberType.ts, 2, 3)) +>ResultIsNumber8 : Symbol(ResultIsNumber8, Decl(bitwiseNotOperatorWithNumberType.ts, 29, 3)) +>NUMBER1 : Symbol(NUMBER1, Decl(bitwiseNotOperatorWithNumberType.ts, 3, 3)) var ResultIsNumber9 = ~foo(); ->ResultIsNumber9 : Symbol(ResultIsNumber9, Decl(bitwiseNotOperatorWithNumberType.ts, 29, 3)) ->foo : Symbol(foo, Decl(bitwiseNotOperatorWithNumberType.ts, 2, 31)) +>ResultIsNumber9 : Symbol(ResultIsNumber9, Decl(bitwiseNotOperatorWithNumberType.ts, 30, 3)) +>foo : Symbol(foo, Decl(bitwiseNotOperatorWithNumberType.ts, 3, 31)) var ResultIsNumber10 = ~A.foo(); ->ResultIsNumber10 : Symbol(ResultIsNumber10, Decl(bitwiseNotOperatorWithNumberType.ts, 30, 3)) ->A.foo : Symbol(A.foo, Decl(bitwiseNotOperatorWithNumberType.ts, 7, 21)) ->A : Symbol(A, Decl(bitwiseNotOperatorWithNumberType.ts, 4, 36)) ->foo : Symbol(A.foo, Decl(bitwiseNotOperatorWithNumberType.ts, 7, 21)) +>ResultIsNumber10 : Symbol(ResultIsNumber10, Decl(bitwiseNotOperatorWithNumberType.ts, 31, 3)) +>A.foo : Symbol(A.foo, Decl(bitwiseNotOperatorWithNumberType.ts, 8, 21)) +>A : Symbol(A, Decl(bitwiseNotOperatorWithNumberType.ts, 5, 36)) +>foo : Symbol(A.foo, Decl(bitwiseNotOperatorWithNumberType.ts, 8, 21)) var ResultIsNumber11 = ~(NUMBER + NUMBER); ->ResultIsNumber11 : Symbol(ResultIsNumber11, Decl(bitwiseNotOperatorWithNumberType.ts, 31, 3)) ->NUMBER : Symbol(NUMBER, Decl(bitwiseNotOperatorWithNumberType.ts, 1, 3)) ->NUMBER : Symbol(NUMBER, Decl(bitwiseNotOperatorWithNumberType.ts, 1, 3)) +>ResultIsNumber11 : Symbol(ResultIsNumber11, Decl(bitwiseNotOperatorWithNumberType.ts, 32, 3)) +>NUMBER : Symbol(NUMBER, Decl(bitwiseNotOperatorWithNumberType.ts, 2, 3)) +>NUMBER : Symbol(NUMBER, Decl(bitwiseNotOperatorWithNumberType.ts, 2, 3)) // multiple ~ operators var ResultIsNumber12 = ~~NUMBER; ->ResultIsNumber12 : Symbol(ResultIsNumber12, Decl(bitwiseNotOperatorWithNumberType.ts, 34, 3)) ->NUMBER : Symbol(NUMBER, Decl(bitwiseNotOperatorWithNumberType.ts, 1, 3)) +>ResultIsNumber12 : Symbol(ResultIsNumber12, Decl(bitwiseNotOperatorWithNumberType.ts, 35, 3)) +>NUMBER : Symbol(NUMBER, Decl(bitwiseNotOperatorWithNumberType.ts, 2, 3)) var ResultIsNumber13 = ~~~(NUMBER + NUMBER); ->ResultIsNumber13 : Symbol(ResultIsNumber13, Decl(bitwiseNotOperatorWithNumberType.ts, 35, 3)) ->NUMBER : Symbol(NUMBER, Decl(bitwiseNotOperatorWithNumberType.ts, 1, 3)) ->NUMBER : Symbol(NUMBER, Decl(bitwiseNotOperatorWithNumberType.ts, 1, 3)) +>ResultIsNumber13 : Symbol(ResultIsNumber13, Decl(bitwiseNotOperatorWithNumberType.ts, 36, 3)) +>NUMBER : Symbol(NUMBER, Decl(bitwiseNotOperatorWithNumberType.ts, 2, 3)) +>NUMBER : Symbol(NUMBER, Decl(bitwiseNotOperatorWithNumberType.ts, 2, 3)) // miss assignment operators ~NUMBER; ->NUMBER : Symbol(NUMBER, Decl(bitwiseNotOperatorWithNumberType.ts, 1, 3)) +>NUMBER : Symbol(NUMBER, Decl(bitwiseNotOperatorWithNumberType.ts, 2, 3)) ~NUMBER1; ->NUMBER1 : Symbol(NUMBER1, Decl(bitwiseNotOperatorWithNumberType.ts, 2, 3)) +>NUMBER1 : Symbol(NUMBER1, Decl(bitwiseNotOperatorWithNumberType.ts, 3, 3)) ~foo(); ->foo : Symbol(foo, Decl(bitwiseNotOperatorWithNumberType.ts, 2, 31)) +>foo : Symbol(foo, Decl(bitwiseNotOperatorWithNumberType.ts, 3, 31)) ~objA.a; ->objA.a : Symbol(A.a, Decl(bitwiseNotOperatorWithNumberType.ts, 6, 9)) ->objA : Symbol(objA, Decl(bitwiseNotOperatorWithNumberType.ts, 14, 3)) ->a : Symbol(A.a, Decl(bitwiseNotOperatorWithNumberType.ts, 6, 9)) +>objA.a : Symbol(A.a, Decl(bitwiseNotOperatorWithNumberType.ts, 7, 9)) +>objA : Symbol(objA, Decl(bitwiseNotOperatorWithNumberType.ts, 15, 3)) +>a : Symbol(A.a, Decl(bitwiseNotOperatorWithNumberType.ts, 7, 9)) ~M.n; ->M.n : Symbol(M.n, Decl(bitwiseNotOperatorWithNumberType.ts, 11, 14)) ->M : Symbol(M, Decl(bitwiseNotOperatorWithNumberType.ts, 9, 1)) ->n : Symbol(M.n, Decl(bitwiseNotOperatorWithNumberType.ts, 11, 14)) +>M.n : Symbol(M.n, Decl(bitwiseNotOperatorWithNumberType.ts, 12, 14)) +>M : Symbol(M, Decl(bitwiseNotOperatorWithNumberType.ts, 10, 1)) +>n : Symbol(M.n, Decl(bitwiseNotOperatorWithNumberType.ts, 12, 14)) ~objA.a, M.n; ->objA.a : Symbol(A.a, Decl(bitwiseNotOperatorWithNumberType.ts, 6, 9)) ->objA : Symbol(objA, Decl(bitwiseNotOperatorWithNumberType.ts, 14, 3)) ->a : Symbol(A.a, Decl(bitwiseNotOperatorWithNumberType.ts, 6, 9)) ->M.n : Symbol(M.n, Decl(bitwiseNotOperatorWithNumberType.ts, 11, 14)) ->M : Symbol(M, Decl(bitwiseNotOperatorWithNumberType.ts, 9, 1)) ->n : Symbol(M.n, Decl(bitwiseNotOperatorWithNumberType.ts, 11, 14)) +>objA.a : Symbol(A.a, Decl(bitwiseNotOperatorWithNumberType.ts, 7, 9)) +>objA : Symbol(objA, Decl(bitwiseNotOperatorWithNumberType.ts, 15, 3)) +>a : Symbol(A.a, Decl(bitwiseNotOperatorWithNumberType.ts, 7, 9)) +>M.n : Symbol(M.n, Decl(bitwiseNotOperatorWithNumberType.ts, 12, 14)) +>M : Symbol(M, Decl(bitwiseNotOperatorWithNumberType.ts, 10, 1)) +>n : Symbol(M.n, Decl(bitwiseNotOperatorWithNumberType.ts, 12, 14)) diff --git a/tests/baselines/reference/bitwiseNotOperatorWithNumberType.types b/tests/baselines/reference/bitwiseNotOperatorWithNumberType.types index 228bd43e593..880ef82b953 100644 --- a/tests/baselines/reference/bitwiseNotOperatorWithNumberType.types +++ b/tests/baselines/reference/bitwiseNotOperatorWithNumberType.types @@ -1,4 +1,5 @@ === tests/cases/conformance/expressions/unaryOperators/bitwiseNotOperator/bitwiseNotOperatorWithNumberType.ts === + // ~ operator on number type var NUMBER: number; >NUMBER : number @@ -6,12 +7,12 @@ var NUMBER: number; var NUMBER1: number[] = [1, 2]; >NUMBER1 : number[] >[1, 2] : number[] ->1 : number ->2 : number +>1 : 1 +>2 : 2 function foo(): number { return 1; } >foo : () => number ->1 : number +>1 : 1 class A { >A : A @@ -21,7 +22,7 @@ class A { static foo() { return 1; } >foo : () => number ->1 : number +>1 : 1 } module M { >M : typeof M @@ -50,23 +51,23 @@ var ResultIsNumber2 = ~NUMBER1; var ResultIsNumber3 = ~1; >ResultIsNumber3 : number >~1 : number ->1 : number +>1 : 1 var ResultIsNumber4 = ~{ x: 1, y: 2}; >ResultIsNumber4 : number >~{ x: 1, y: 2} : number >{ x: 1, y: 2} : { x: number; y: number; } >x : number ->1 : number +>1 : 1 >y : number ->2 : number +>2 : 2 var ResultIsNumber5 = ~{ x: 1, y: (n: number) => { return n; } }; >ResultIsNumber5 : number >~{ x: 1, y: (n: number) => { return n; } } : number >{ x: 1, y: (n: number) => { return n; } } : { x: number; y: (n: number) => number; } >x : number ->1 : number +>1 : 1 >y : (n: number) => number >(n: number) => { return n; } : (n: number) => number >n : number @@ -92,7 +93,7 @@ var ResultIsNumber8 = ~NUMBER1[0]; >~NUMBER1[0] : number >NUMBER1[0] : number >NUMBER1 : number[] ->0 : number +>0 : 0 var ResultIsNumber9 = ~foo(); >ResultIsNumber9 : number diff --git a/tests/baselines/reference/bitwiseNotOperatorWithStringType.js b/tests/baselines/reference/bitwiseNotOperatorWithStringType.js index 366af5ecea8..b1c3b41f286 100644 --- a/tests/baselines/reference/bitwiseNotOperatorWithStringType.js +++ b/tests/baselines/reference/bitwiseNotOperatorWithStringType.js @@ -1,4 +1,5 @@ //// [bitwiseNotOperatorWithStringType.ts] + // ~ operator on string type var STRING: string; var STRING1: string[] = ["", "abc"]; diff --git a/tests/baselines/reference/bitwiseNotOperatorWithStringType.symbols b/tests/baselines/reference/bitwiseNotOperatorWithStringType.symbols index f535acc199b..06f848c7450 100644 --- a/tests/baselines/reference/bitwiseNotOperatorWithStringType.symbols +++ b/tests/baselines/reference/bitwiseNotOperatorWithStringType.symbols @@ -1,122 +1,123 @@ === tests/cases/conformance/expressions/unaryOperators/bitwiseNotOperator/bitwiseNotOperatorWithStringType.ts === + // ~ operator on string type var STRING: string; ->STRING : Symbol(STRING, Decl(bitwiseNotOperatorWithStringType.ts, 1, 3)) +>STRING : Symbol(STRING, Decl(bitwiseNotOperatorWithStringType.ts, 2, 3)) var STRING1: string[] = ["", "abc"]; ->STRING1 : Symbol(STRING1, Decl(bitwiseNotOperatorWithStringType.ts, 2, 3)) +>STRING1 : Symbol(STRING1, Decl(bitwiseNotOperatorWithStringType.ts, 3, 3)) function foo(): string { return "abc"; } ->foo : Symbol(foo, Decl(bitwiseNotOperatorWithStringType.ts, 2, 36)) +>foo : Symbol(foo, Decl(bitwiseNotOperatorWithStringType.ts, 3, 36)) class A { ->A : Symbol(A, Decl(bitwiseNotOperatorWithStringType.ts, 4, 40)) +>A : Symbol(A, Decl(bitwiseNotOperatorWithStringType.ts, 5, 40)) public a: string; ->a : Symbol(A.a, Decl(bitwiseNotOperatorWithStringType.ts, 6, 9)) +>a : Symbol(A.a, Decl(bitwiseNotOperatorWithStringType.ts, 7, 9)) static foo() { return ""; } ->foo : Symbol(A.foo, Decl(bitwiseNotOperatorWithStringType.ts, 7, 21)) +>foo : Symbol(A.foo, Decl(bitwiseNotOperatorWithStringType.ts, 8, 21)) } module M { ->M : Symbol(M, Decl(bitwiseNotOperatorWithStringType.ts, 9, 1)) +>M : Symbol(M, Decl(bitwiseNotOperatorWithStringType.ts, 10, 1)) export var n: string; ->n : Symbol(n, Decl(bitwiseNotOperatorWithStringType.ts, 11, 14)) +>n : Symbol(n, Decl(bitwiseNotOperatorWithStringType.ts, 12, 14)) } var objA = new A(); ->objA : Symbol(objA, Decl(bitwiseNotOperatorWithStringType.ts, 14, 3)) ->A : Symbol(A, Decl(bitwiseNotOperatorWithStringType.ts, 4, 40)) +>objA : Symbol(objA, Decl(bitwiseNotOperatorWithStringType.ts, 15, 3)) +>A : Symbol(A, Decl(bitwiseNotOperatorWithStringType.ts, 5, 40)) // string type var var ResultIsNumber1 = ~STRING; ->ResultIsNumber1 : Symbol(ResultIsNumber1, Decl(bitwiseNotOperatorWithStringType.ts, 17, 3)) ->STRING : Symbol(STRING, Decl(bitwiseNotOperatorWithStringType.ts, 1, 3)) +>ResultIsNumber1 : Symbol(ResultIsNumber1, Decl(bitwiseNotOperatorWithStringType.ts, 18, 3)) +>STRING : Symbol(STRING, Decl(bitwiseNotOperatorWithStringType.ts, 2, 3)) var ResultIsNumber2 = ~STRING1; ->ResultIsNumber2 : Symbol(ResultIsNumber2, Decl(bitwiseNotOperatorWithStringType.ts, 18, 3)) ->STRING1 : Symbol(STRING1, Decl(bitwiseNotOperatorWithStringType.ts, 2, 3)) +>ResultIsNumber2 : Symbol(ResultIsNumber2, Decl(bitwiseNotOperatorWithStringType.ts, 19, 3)) +>STRING1 : Symbol(STRING1, Decl(bitwiseNotOperatorWithStringType.ts, 3, 3)) // string type literal var ResultIsNumber3 = ~""; ->ResultIsNumber3 : Symbol(ResultIsNumber3, Decl(bitwiseNotOperatorWithStringType.ts, 21, 3)) +>ResultIsNumber3 : Symbol(ResultIsNumber3, Decl(bitwiseNotOperatorWithStringType.ts, 22, 3)) var ResultIsNumber4 = ~{ x: "", y: "" }; ->ResultIsNumber4 : Symbol(ResultIsNumber4, Decl(bitwiseNotOperatorWithStringType.ts, 22, 3)) ->x : Symbol(x, Decl(bitwiseNotOperatorWithStringType.ts, 22, 24)) ->y : Symbol(y, Decl(bitwiseNotOperatorWithStringType.ts, 22, 31)) - -var ResultIsNumber5 = ~{ x: "", y: (s: string) => { return s; } }; ->ResultIsNumber5 : Symbol(ResultIsNumber5, Decl(bitwiseNotOperatorWithStringType.ts, 23, 3)) +>ResultIsNumber4 : Symbol(ResultIsNumber4, Decl(bitwiseNotOperatorWithStringType.ts, 23, 3)) >x : Symbol(x, Decl(bitwiseNotOperatorWithStringType.ts, 23, 24)) >y : Symbol(y, Decl(bitwiseNotOperatorWithStringType.ts, 23, 31)) ->s : Symbol(s, Decl(bitwiseNotOperatorWithStringType.ts, 23, 36)) ->s : Symbol(s, Decl(bitwiseNotOperatorWithStringType.ts, 23, 36)) + +var ResultIsNumber5 = ~{ x: "", y: (s: string) => { return s; } }; +>ResultIsNumber5 : Symbol(ResultIsNumber5, Decl(bitwiseNotOperatorWithStringType.ts, 24, 3)) +>x : Symbol(x, Decl(bitwiseNotOperatorWithStringType.ts, 24, 24)) +>y : Symbol(y, Decl(bitwiseNotOperatorWithStringType.ts, 24, 31)) +>s : Symbol(s, Decl(bitwiseNotOperatorWithStringType.ts, 24, 36)) +>s : Symbol(s, Decl(bitwiseNotOperatorWithStringType.ts, 24, 36)) // string type expressions var ResultIsNumber6 = ~objA.a; ->ResultIsNumber6 : Symbol(ResultIsNumber6, Decl(bitwiseNotOperatorWithStringType.ts, 26, 3)) ->objA.a : Symbol(A.a, Decl(bitwiseNotOperatorWithStringType.ts, 6, 9)) ->objA : Symbol(objA, Decl(bitwiseNotOperatorWithStringType.ts, 14, 3)) ->a : Symbol(A.a, Decl(bitwiseNotOperatorWithStringType.ts, 6, 9)) +>ResultIsNumber6 : Symbol(ResultIsNumber6, Decl(bitwiseNotOperatorWithStringType.ts, 27, 3)) +>objA.a : Symbol(A.a, Decl(bitwiseNotOperatorWithStringType.ts, 7, 9)) +>objA : Symbol(objA, Decl(bitwiseNotOperatorWithStringType.ts, 15, 3)) +>a : Symbol(A.a, Decl(bitwiseNotOperatorWithStringType.ts, 7, 9)) var ResultIsNumber7 = ~M.n; ->ResultIsNumber7 : Symbol(ResultIsNumber7, Decl(bitwiseNotOperatorWithStringType.ts, 27, 3)) ->M.n : Symbol(M.n, Decl(bitwiseNotOperatorWithStringType.ts, 11, 14)) ->M : Symbol(M, Decl(bitwiseNotOperatorWithStringType.ts, 9, 1)) ->n : Symbol(M.n, Decl(bitwiseNotOperatorWithStringType.ts, 11, 14)) +>ResultIsNumber7 : Symbol(ResultIsNumber7, Decl(bitwiseNotOperatorWithStringType.ts, 28, 3)) +>M.n : Symbol(M.n, Decl(bitwiseNotOperatorWithStringType.ts, 12, 14)) +>M : Symbol(M, Decl(bitwiseNotOperatorWithStringType.ts, 10, 1)) +>n : Symbol(M.n, Decl(bitwiseNotOperatorWithStringType.ts, 12, 14)) var ResultIsNumber8 = ~STRING1[0]; ->ResultIsNumber8 : Symbol(ResultIsNumber8, Decl(bitwiseNotOperatorWithStringType.ts, 28, 3)) ->STRING1 : Symbol(STRING1, Decl(bitwiseNotOperatorWithStringType.ts, 2, 3)) +>ResultIsNumber8 : Symbol(ResultIsNumber8, Decl(bitwiseNotOperatorWithStringType.ts, 29, 3)) +>STRING1 : Symbol(STRING1, Decl(bitwiseNotOperatorWithStringType.ts, 3, 3)) var ResultIsNumber9 = ~foo(); ->ResultIsNumber9 : Symbol(ResultIsNumber9, Decl(bitwiseNotOperatorWithStringType.ts, 29, 3)) ->foo : Symbol(foo, Decl(bitwiseNotOperatorWithStringType.ts, 2, 36)) +>ResultIsNumber9 : Symbol(ResultIsNumber9, Decl(bitwiseNotOperatorWithStringType.ts, 30, 3)) +>foo : Symbol(foo, Decl(bitwiseNotOperatorWithStringType.ts, 3, 36)) var ResultIsNumber10 = ~A.foo(); ->ResultIsNumber10 : Symbol(ResultIsNumber10, Decl(bitwiseNotOperatorWithStringType.ts, 30, 3)) ->A.foo : Symbol(A.foo, Decl(bitwiseNotOperatorWithStringType.ts, 7, 21)) ->A : Symbol(A, Decl(bitwiseNotOperatorWithStringType.ts, 4, 40)) ->foo : Symbol(A.foo, Decl(bitwiseNotOperatorWithStringType.ts, 7, 21)) +>ResultIsNumber10 : Symbol(ResultIsNumber10, Decl(bitwiseNotOperatorWithStringType.ts, 31, 3)) +>A.foo : Symbol(A.foo, Decl(bitwiseNotOperatorWithStringType.ts, 8, 21)) +>A : Symbol(A, Decl(bitwiseNotOperatorWithStringType.ts, 5, 40)) +>foo : Symbol(A.foo, Decl(bitwiseNotOperatorWithStringType.ts, 8, 21)) var ResultIsNumber11 = ~(STRING + STRING); ->ResultIsNumber11 : Symbol(ResultIsNumber11, Decl(bitwiseNotOperatorWithStringType.ts, 31, 3)) ->STRING : Symbol(STRING, Decl(bitwiseNotOperatorWithStringType.ts, 1, 3)) ->STRING : Symbol(STRING, Decl(bitwiseNotOperatorWithStringType.ts, 1, 3)) +>ResultIsNumber11 : Symbol(ResultIsNumber11, Decl(bitwiseNotOperatorWithStringType.ts, 32, 3)) +>STRING : Symbol(STRING, Decl(bitwiseNotOperatorWithStringType.ts, 2, 3)) +>STRING : Symbol(STRING, Decl(bitwiseNotOperatorWithStringType.ts, 2, 3)) var ResultIsNumber12 = ~STRING.charAt(0); ->ResultIsNumber12 : Symbol(ResultIsNumber12, Decl(bitwiseNotOperatorWithStringType.ts, 32, 3)) +>ResultIsNumber12 : Symbol(ResultIsNumber12, Decl(bitwiseNotOperatorWithStringType.ts, 33, 3)) >STRING.charAt : Symbol(String.charAt, Decl(lib.d.ts, --, --)) ->STRING : Symbol(STRING, Decl(bitwiseNotOperatorWithStringType.ts, 1, 3)) +>STRING : Symbol(STRING, Decl(bitwiseNotOperatorWithStringType.ts, 2, 3)) >charAt : Symbol(String.charAt, Decl(lib.d.ts, --, --)) // multiple ~ operators var ResultIsNumber13 = ~~STRING; ->ResultIsNumber13 : Symbol(ResultIsNumber13, Decl(bitwiseNotOperatorWithStringType.ts, 35, 3)) ->STRING : Symbol(STRING, Decl(bitwiseNotOperatorWithStringType.ts, 1, 3)) +>ResultIsNumber13 : Symbol(ResultIsNumber13, Decl(bitwiseNotOperatorWithStringType.ts, 36, 3)) +>STRING : Symbol(STRING, Decl(bitwiseNotOperatorWithStringType.ts, 2, 3)) var ResultIsNumber14 = ~~~(STRING + STRING); ->ResultIsNumber14 : Symbol(ResultIsNumber14, Decl(bitwiseNotOperatorWithStringType.ts, 36, 3)) ->STRING : Symbol(STRING, Decl(bitwiseNotOperatorWithStringType.ts, 1, 3)) ->STRING : Symbol(STRING, Decl(bitwiseNotOperatorWithStringType.ts, 1, 3)) +>ResultIsNumber14 : Symbol(ResultIsNumber14, Decl(bitwiseNotOperatorWithStringType.ts, 37, 3)) +>STRING : Symbol(STRING, Decl(bitwiseNotOperatorWithStringType.ts, 2, 3)) +>STRING : Symbol(STRING, Decl(bitwiseNotOperatorWithStringType.ts, 2, 3)) //miss assignment operators ~STRING; ->STRING : Symbol(STRING, Decl(bitwiseNotOperatorWithStringType.ts, 1, 3)) +>STRING : Symbol(STRING, Decl(bitwiseNotOperatorWithStringType.ts, 2, 3)) ~STRING1; ->STRING1 : Symbol(STRING1, Decl(bitwiseNotOperatorWithStringType.ts, 2, 3)) +>STRING1 : Symbol(STRING1, Decl(bitwiseNotOperatorWithStringType.ts, 3, 3)) ~foo(); ->foo : Symbol(foo, Decl(bitwiseNotOperatorWithStringType.ts, 2, 36)) +>foo : Symbol(foo, Decl(bitwiseNotOperatorWithStringType.ts, 3, 36)) ~objA.a,M.n; ->objA.a : Symbol(A.a, Decl(bitwiseNotOperatorWithStringType.ts, 6, 9)) ->objA : Symbol(objA, Decl(bitwiseNotOperatorWithStringType.ts, 14, 3)) ->a : Symbol(A.a, Decl(bitwiseNotOperatorWithStringType.ts, 6, 9)) ->M.n : Symbol(M.n, Decl(bitwiseNotOperatorWithStringType.ts, 11, 14)) ->M : Symbol(M, Decl(bitwiseNotOperatorWithStringType.ts, 9, 1)) ->n : Symbol(M.n, Decl(bitwiseNotOperatorWithStringType.ts, 11, 14)) +>objA.a : Symbol(A.a, Decl(bitwiseNotOperatorWithStringType.ts, 7, 9)) +>objA : Symbol(objA, Decl(bitwiseNotOperatorWithStringType.ts, 15, 3)) +>a : Symbol(A.a, Decl(bitwiseNotOperatorWithStringType.ts, 7, 9)) +>M.n : Symbol(M.n, Decl(bitwiseNotOperatorWithStringType.ts, 12, 14)) +>M : Symbol(M, Decl(bitwiseNotOperatorWithStringType.ts, 10, 1)) +>n : Symbol(M.n, Decl(bitwiseNotOperatorWithStringType.ts, 12, 14)) diff --git a/tests/baselines/reference/bitwiseNotOperatorWithStringType.types b/tests/baselines/reference/bitwiseNotOperatorWithStringType.types index 4f1ca481a1f..17a7fc8b6ec 100644 --- a/tests/baselines/reference/bitwiseNotOperatorWithStringType.types +++ b/tests/baselines/reference/bitwiseNotOperatorWithStringType.types @@ -1,4 +1,5 @@ === tests/cases/conformance/expressions/unaryOperators/bitwiseNotOperator/bitwiseNotOperatorWithStringType.ts === + // ~ operator on string type var STRING: string; >STRING : string @@ -6,12 +7,12 @@ var STRING: string; var STRING1: string[] = ["", "abc"]; >STRING1 : string[] >["", "abc"] : string[] ->"" : string ->"abc" : string +>"" : "" +>"abc" : "abc" function foo(): string { return "abc"; } >foo : () => string ->"abc" : string +>"abc" : "abc" class A { >A : A @@ -21,7 +22,7 @@ class A { static foo() { return ""; } >foo : () => string ->"" : string +>"" : "" } module M { >M : typeof M @@ -50,23 +51,23 @@ var ResultIsNumber2 = ~STRING1; var ResultIsNumber3 = ~""; >ResultIsNumber3 : number >~"" : number ->"" : string +>"" : "" var ResultIsNumber4 = ~{ x: "", y: "" }; >ResultIsNumber4 : number >~{ x: "", y: "" } : number >{ x: "", y: "" } : { x: string; y: string; } >x : string ->"" : string +>"" : "" >y : string ->"" : string +>"" : "" var ResultIsNumber5 = ~{ x: "", y: (s: string) => { return s; } }; >ResultIsNumber5 : number >~{ x: "", y: (s: string) => { return s; } } : number >{ x: "", y: (s: string) => { return s; } } : { x: string; y: (s: string) => string; } >x : string ->"" : string +>"" : "" >y : (s: string) => string >(s: string) => { return s; } : (s: string) => string >s : string @@ -92,7 +93,7 @@ var ResultIsNumber8 = ~STRING1[0]; >~STRING1[0] : number >STRING1[0] : string >STRING1 : string[] ->0 : number +>0 : 0 var ResultIsNumber9 = ~foo(); >ResultIsNumber9 : number @@ -123,7 +124,7 @@ var ResultIsNumber12 = ~STRING.charAt(0); >STRING.charAt : (pos: number) => string >STRING : string >charAt : (pos: number) => string ->0 : number +>0 : 0 // multiple ~ operators var ResultIsNumber13 = ~~STRING; diff --git a/tests/baselines/reference/blockScopedBindingsReassignedInLoop1.types b/tests/baselines/reference/blockScopedBindingsReassignedInLoop1.types index 7ced53508e6..4824b641841 100644 --- a/tests/baselines/reference/blockScopedBindingsReassignedInLoop1.types +++ b/tests/baselines/reference/blockScopedBindingsReassignedInLoop1.types @@ -9,14 +9,14 @@ declare function use(n: number): void; >function () { 'use strict' for (let i = 0; i < 9; ++i) { (() => use(++i))(); }} : () => void 'use strict' ->'use strict' : string +>'use strict' : "use strict" for (let i = 0; i < 9; ++i) { >i : number ->0 : number +>0 : 0 >i < 9 : boolean >i : number ->9 : number +>9 : 9 >++i : number >i : number diff --git a/tests/baselines/reference/blockScopedBindingsReassignedInLoop2.types b/tests/baselines/reference/blockScopedBindingsReassignedInLoop2.types index 477d36982f4..d1ae4ee20f4 100644 --- a/tests/baselines/reference/blockScopedBindingsReassignedInLoop2.types +++ b/tests/baselines/reference/blockScopedBindingsReassignedInLoop2.types @@ -1,9 +1,9 @@ === tests/cases/compiler/blockScopedBindingsReassignedInLoop2.ts === for (let x = 1, y = 2; x < y; ++x, --y) { >x : number ->1 : number +>1 : 1 >y : number ->2 : number +>2 : 2 >x < y : boolean >x : number >y : number @@ -31,17 +31,17 @@ for (let x = 1, y = 2; x < y; ++x, --y) { } else { y = 5; ->y = 5 : number +>y = 5 : 5 >y : number ->5 : number +>5 : 5 } } for (let x = 1, y = 2; x < y; ++x, --y) { >x : number ->1 : number +>1 : 1 >y : number ->2 : number +>2 : 2 >x < y : boolean >x : number >y : number @@ -69,9 +69,9 @@ for (let x = 1, y = 2; x < y; ++x, --y) { } else { y = 5; ->y = 5 : number +>y = 5 : 5 >y : number ->5 : number +>5 : 5 } } @@ -80,9 +80,9 @@ loop: for (let x = 1, y = 2; x < y; ++x, --y) { >x : number ->1 : number +>1 : 1 >y : number ->2 : number +>2 : 2 >x < y : boolean >x : number >y : number @@ -111,9 +111,9 @@ for (let x = 1, y = 2; x < y; ++x, --y) { } else { y = 5; ->y = 5 : number +>y = 5 : 5 >y : number ->5 : number +>5 : 5 } } @@ -122,9 +122,9 @@ loop: for (let x = 1, y = 2; x < y; ++x, --y) { >x : number ->1 : number +>1 : 1 >y : number ->2 : number +>2 : 2 >x < y : boolean >x : number >y : number @@ -153,8 +153,8 @@ for (let x = 1, y = 2; x < y; ++x, --y) { } else { y = 5; ->y = 5 : number +>y = 5 : 5 >y : number ->5 : number +>5 : 5 } } diff --git a/tests/baselines/reference/blockScopedBindingsReassignedInLoop3.types b/tests/baselines/reference/blockScopedBindingsReassignedInLoop3.types index ee69f9a5a9f..3dab1458b67 100644 --- a/tests/baselines/reference/blockScopedBindingsReassignedInLoop3.types +++ b/tests/baselines/reference/blockScopedBindingsReassignedInLoop3.types @@ -2,9 +2,9 @@ for (let x = 1, y = 2; x < y; ++x, --y) { >x : number ->1 : number +>1 : 1 >y : number ->2 : number +>2 : 2 >x < y : boolean >x : number >y : number @@ -33,10 +33,10 @@ for (let x = 1, y = 2; x < y; ++x, --y) { else { for (let a = 1; a < 5; --a) { >a : number ->1 : number +>1 : 1 >a < 5 : boolean >a : number ->5 : number +>5 : 5 >--a : number >a : number @@ -63,18 +63,18 @@ for (let x = 1, y = 2; x < y; ++x, --y) { } y = 5; ->y = 5 : number +>y = 5 : 5 >y : number ->5 : number +>5 : 5 } } for (let x = 1, y = 2; x < y; ++x, --y) { >x : number ->1 : number +>1 : 1 >y : number ->2 : number +>2 : 2 >x < y : boolean >x : number >y : number @@ -103,10 +103,10 @@ for (let x = 1, y = 2; x < y; ++x, --y) { else { for (let a = 1; a < 5; --a) { >a : number ->1 : number +>1 : 1 >a < 5 : boolean >a : number ->5 : number +>5 : 5 >--a : number >a : number @@ -133,9 +133,9 @@ for (let x = 1, y = 2; x < y; ++x, --y) { } y = 5; ->y = 5 : number +>y = 5 : 5 >y : number ->5 : number +>5 : 5 } } @@ -144,9 +144,9 @@ loop2: for (let x = 1, y = 2; x < y; ++x, --y) { >x : number ->1 : number +>1 : 1 >y : number ->2 : number +>2 : 2 >x < y : boolean >x : number >y : number @@ -179,10 +179,10 @@ for (let x = 1, y = 2; x < y; ++x, --y) { for (let a = 1; a < 5; --a) { >a : number ->1 : number +>1 : 1 >a < 5 : boolean >a : number ->5 : number +>5 : 5 >--a : number >a : number @@ -213,9 +213,9 @@ for (let x = 1, y = 2; x < y; ++x, --y) { } y = 5; ->y = 5 : number +>y = 5 : 5 >y : number ->5 : number +>5 : 5 } } @@ -224,9 +224,9 @@ loop2: for (let x = 1, y = 2; x < y; ++x, --y) { >x : number ->1 : number +>1 : 1 >y : number ->2 : number +>2 : 2 >x < y : boolean >x : number >y : number @@ -259,10 +259,10 @@ for (let x = 1, y = 2; x < y; ++x, --y) { for (let a = 1; a < 5; --a) { >a : number ->1 : number +>1 : 1 >a < 5 : boolean >a : number ->5 : number +>5 : 5 >--a : number >a : number @@ -293,9 +293,9 @@ for (let x = 1, y = 2; x < y; ++x, --y) { } y = 5; ->y = 5 : number +>y = 5 : 5 >y : number ->5 : number +>5 : 5 } } diff --git a/tests/baselines/reference/blockScopedBindingsReassignedInLoop4.types b/tests/baselines/reference/blockScopedBindingsReassignedInLoop4.types index c3576bbccd2..fb0367e8782 100644 --- a/tests/baselines/reference/blockScopedBindingsReassignedInLoop4.types +++ b/tests/baselines/reference/blockScopedBindingsReassignedInLoop4.types @@ -4,9 +4,9 @@ function f1() { for (let x = 1, y = 2; x < y; ++x, --y) { >x : number ->1 : number +>1 : 1 >y : number ->2 : number +>2 : 2 >x < y : boolean >x : number >y : number @@ -31,13 +31,13 @@ function f1() { >1 : 1 return 1; ->1 : number +>1 : 1 } else { y = 5; ->y = 5 : number +>y = 5 : 5 >y : number ->5 : number +>5 : 5 } } } diff --git a/tests/baselines/reference/blockScopedBindingsReassignedInLoop5.types b/tests/baselines/reference/blockScopedBindingsReassignedInLoop5.types index 47a0fd52891..73d13e76afd 100644 --- a/tests/baselines/reference/blockScopedBindingsReassignedInLoop5.types +++ b/tests/baselines/reference/blockScopedBindingsReassignedInLoop5.types @@ -1,9 +1,9 @@ === tests/cases/compiler/blockScopedBindingsReassignedInLoop5.ts === for (let x = 1, y = 2; x < y; ++x, --y) { >x : number ->1 : number +>1 : 1 >y : number ->2 : number +>2 : 2 >x < y : boolean >x : number >y : number @@ -30,8 +30,8 @@ for (let x = 1, y = 2; x < y; ++x, --y) { break; else y = 5; ->y = 5 : number +>y = 5 : 5 >y : number ->5 : number +>5 : 5 } diff --git a/tests/baselines/reference/blockScopedBindingsReassignedInLoop6.types b/tests/baselines/reference/blockScopedBindingsReassignedInLoop6.types index c4287869ec0..8936ded6239 100644 --- a/tests/baselines/reference/blockScopedBindingsReassignedInLoop6.types +++ b/tests/baselines/reference/blockScopedBindingsReassignedInLoop6.types @@ -6,8 +6,8 @@ function f1() { >x : number >y : number >[1, 2] : [number, number] ->1 : number ->2 : number +>1 : 1 +>2 : 2 >x < y : boolean >x : number >y : number @@ -38,9 +38,9 @@ function f1() { >2 : 2 y = 5; ->y = 5 : number +>y = 5 : 5 >y : number ->5 : number +>5 : 5 else return; @@ -59,11 +59,11 @@ function f2() { >[{a: 1, b: {c: 2}}] : [{ a: number; b: { c: number; }; }] >{a: 1, b: {c: 2}} : { a: number; b: { c: number; }; } >a : number ->1 : number +>1 : 1 >b : { c: number; } >{c: 2} : { c: number; } >c : number ->2 : number +>2 : 2 >x < y : boolean >x : number >y : number @@ -94,9 +94,9 @@ function f2() { >2 : 2 y = 5; ->y = 5 : number +>y = 5 : 5 >y : number ->5 : number +>5 : 5 else return; diff --git a/tests/baselines/reference/blockScopedFunctionDeclarationES5.types b/tests/baselines/reference/blockScopedFunctionDeclarationES5.types index b3c4d9b7d73..8dfdd11da43 100644 --- a/tests/baselines/reference/blockScopedFunctionDeclarationES5.types +++ b/tests/baselines/reference/blockScopedFunctionDeclarationES5.types @@ -1,6 +1,6 @@ === tests/cases/compiler/blockScopedFunctionDeclarationES5.ts === if (true) { ->true : boolean +>true : true function foo() { } >foo : () => void diff --git a/tests/baselines/reference/blockScopedFunctionDeclarationES6.types b/tests/baselines/reference/blockScopedFunctionDeclarationES6.types index 7ab74feb0ed..8f87507a5ac 100644 --- a/tests/baselines/reference/blockScopedFunctionDeclarationES6.types +++ b/tests/baselines/reference/blockScopedFunctionDeclarationES6.types @@ -1,6 +1,6 @@ === tests/cases/compiler/blockScopedFunctionDeclarationES6.ts === if (true) { ->true : boolean +>true : true function foo() { } >foo : () => void diff --git a/tests/baselines/reference/bluebirdStaticThis.errors.txt b/tests/baselines/reference/bluebirdStaticThis.errors.txt index 6e78a90db4b..1c22a12c341 100644 --- a/tests/baselines/reference/bluebirdStaticThis.errors.txt +++ b/tests/baselines/reference/bluebirdStaticThis.errors.txt @@ -1,10 +1,10 @@ tests/cases/compiler/bluebirdStaticThis.ts(5,15): error TS2420: Class 'Promise' incorrectly implements interface 'Thenable'. Property 'then' is missing in type 'Promise'. -tests/cases/compiler/bluebirdStaticThis.ts(22,51): error TS2305: Module 'Promise' has no exported member 'Resolver'. -tests/cases/compiler/bluebirdStaticThis.ts(57,109): error TS2305: Module 'Promise' has no exported member 'Inspection'. -tests/cases/compiler/bluebirdStaticThis.ts(58,91): error TS2305: Module 'Promise' has no exported member 'Inspection'. -tests/cases/compiler/bluebirdStaticThis.ts(59,91): error TS2305: Module 'Promise' has no exported member 'Inspection'. -tests/cases/compiler/bluebirdStaticThis.ts(60,73): error TS2305: Module 'Promise' has no exported member 'Inspection'. +tests/cases/compiler/bluebirdStaticThis.ts(22,51): error TS2694: Namespace 'Promise' has no exported member 'Resolver'. +tests/cases/compiler/bluebirdStaticThis.ts(57,109): error TS2694: Namespace 'Promise' has no exported member 'Inspection'. +tests/cases/compiler/bluebirdStaticThis.ts(58,91): error TS2694: Namespace 'Promise' has no exported member 'Inspection'. +tests/cases/compiler/bluebirdStaticThis.ts(59,91): error TS2694: Namespace 'Promise' has no exported member 'Inspection'. +tests/cases/compiler/bluebirdStaticThis.ts(60,73): error TS2694: Namespace 'Promise' has no exported member 'Inspection'. ==== tests/cases/compiler/bluebirdStaticThis.ts (6 errors) ==== @@ -34,7 +34,7 @@ tests/cases/compiler/bluebirdStaticThis.ts(60,73): error TS2305: Module 'Promise static defer(dit: typeof Promise): Promise.Resolver; ~~~~~~~~ -!!! error TS2305: Module 'Promise' has no exported member 'Resolver'. +!!! error TS2694: Namespace 'Promise' has no exported member 'Resolver'. static cast(dit: typeof Promise, value: Promise.Thenable): Promise; static cast(dit: typeof Promise, value: R): Promise; @@ -71,16 +71,16 @@ tests/cases/compiler/bluebirdStaticThis.ts(60,73): error TS2305: Module 'Promise static settle(dit: typeof Promise, values: Promise.Thenable[]>): Promise[]>; ~~~~~~~~~~ -!!! error TS2305: Module 'Promise' has no exported member 'Inspection'. +!!! error TS2694: Namespace 'Promise' has no exported member 'Inspection'. static settle(dit: typeof Promise, values: Promise.Thenable): Promise[]>; ~~~~~~~~~~ -!!! error TS2305: Module 'Promise' has no exported member 'Inspection'. +!!! error TS2694: Namespace 'Promise' has no exported member 'Inspection'. static settle(dit: typeof Promise, values: Promise.Thenable[]): Promise[]>; ~~~~~~~~~~ -!!! error TS2305: Module 'Promise' has no exported member 'Inspection'. +!!! error TS2694: Namespace 'Promise' has no exported member 'Inspection'. static settle(dit: typeof Promise, values: R[]): Promise[]>; ~~~~~~~~~~ -!!! error TS2305: Module 'Promise' has no exported member 'Inspection'. +!!! error TS2694: Namespace 'Promise' has no exported member 'Inspection'. static any(dit: typeof Promise, values: Promise.Thenable[]>): Promise; static any(dit: typeof Promise, values: Promise.Thenable): Promise; diff --git a/tests/baselines/reference/bom-utf16be.types b/tests/baselines/reference/bom-utf16be.types index 1787d102245..e13c45ede2f 100644 --- a/tests/baselines/reference/bom-utf16be.types +++ b/tests/baselines/reference/bom-utf16be.types @@ -1,5 +1,5 @@ === tests/cases/compiler/bom-utf16be.ts === var x=10; >x : number ->10 : number +>10 : 10 diff --git a/tests/baselines/reference/bom-utf16le.types b/tests/baselines/reference/bom-utf16le.types index 865c94eb82d..bb2038bb23d 100644 --- a/tests/baselines/reference/bom-utf16le.types +++ b/tests/baselines/reference/bom-utf16le.types @@ -1,5 +1,5 @@ === tests/cases/compiler/bom-utf16le.ts === var x=10; >x : number ->10 : number +>10 : 10 diff --git a/tests/baselines/reference/bom-utf8.types b/tests/baselines/reference/bom-utf8.types index d96d0132383..0f2b45b8ea9 100644 --- a/tests/baselines/reference/bom-utf8.types +++ b/tests/baselines/reference/bom-utf8.types @@ -1,5 +1,5 @@ === tests/cases/compiler/bom-utf8.ts === var x=10; >x : number ->10 : number +>10 : 10 diff --git a/tests/baselines/reference/booleanAssignment.errors.txt b/tests/baselines/reference/booleanAssignment.errors.txt index 15b506d3df4..fc25fd4007f 100644 --- a/tests/baselines/reference/booleanAssignment.errors.txt +++ b/tests/baselines/reference/booleanAssignment.errors.txt @@ -1,5 +1,5 @@ -tests/cases/compiler/booleanAssignment.ts(2,1): error TS2322: Type 'number' is not assignable to type 'Boolean'. -tests/cases/compiler/booleanAssignment.ts(3,1): error TS2322: Type 'string' is not assignable to type 'Boolean'. +tests/cases/compiler/booleanAssignment.ts(2,1): error TS2322: Type '1' is not assignable to type 'Boolean'. +tests/cases/compiler/booleanAssignment.ts(3,1): error TS2322: Type '"a"' is not assignable to type 'Boolean'. tests/cases/compiler/booleanAssignment.ts(4,1): error TS2322: Type '{}' is not assignable to type 'Boolean'. Types of property 'valueOf' are incompatible. Type '() => Object' is not assignable to type '() => boolean'. @@ -10,10 +10,10 @@ tests/cases/compiler/booleanAssignment.ts(4,1): error TS2322: Type '{}' is not a var b = new Boolean(); b = 1; // Error ~ -!!! error TS2322: Type 'number' is not assignable to type 'Boolean'. +!!! error TS2322: Type '1' is not assignable to type 'Boolean'. b = "a"; // Error ~ -!!! error TS2322: Type 'string' is not assignable to type 'Boolean'. +!!! error TS2322: Type '"a"' is not assignable to type 'Boolean'. b = {}; // Error ~ !!! error TS2322: Type '{}' is not assignable to type 'Boolean'. diff --git a/tests/baselines/reference/booleanLiteralTypes1.types b/tests/baselines/reference/booleanLiteralTypes1.types index 704eba4055b..3ea7000e3be 100644 --- a/tests/baselines/reference/booleanLiteralTypes1.types +++ b/tests/baselines/reference/booleanLiteralTypes1.types @@ -84,13 +84,13 @@ function f4(t: true, f: false) { >false : false var x1 = t && f; ->x1 : false +>x1 : boolean >t && f : false >t : true >f : false var x2 = f && t; ->x2 : false +>x2 : boolean >f && t : false >f : false >t : true @@ -102,7 +102,7 @@ function f4(t: true, f: false) { >f : false var x4 = f || t; ->x4 : true +>x4 : boolean >f || t : true >f : false >t : true @@ -113,7 +113,7 @@ function f4(t: true, f: false) { >t : true var x6 = !f; ->x6 : true +>x6 : boolean >!f : true >f : false } @@ -162,11 +162,11 @@ function assertNever(x: never): never { throw new Error("Unexpected value"); >new Error("Unexpected value") : Error >Error : ErrorConstructor ->"Unexpected value" : string +>"Unexpected value" : "Unexpected value" } function f10(x: true | false) { ->f10 : (x: boolean) => string +>f10 : (x: boolean) => "true" | "false" >x : boolean >true : true >false : false @@ -176,16 +176,16 @@ function f10(x: true | false) { case true: return "true"; >true : true ->"true" : string +>"true" : "true" case false: return "false"; >false : false ->"false" : string +>"false" : "false" } } function f11(x: true | false) { ->f11 : (x: boolean) => string +>f11 : (x: boolean) => "true" | "false" >x : boolean >true : true >false : false @@ -195,11 +195,11 @@ function f11(x: true | false) { case true: return "true"; >true : true ->"true" : string +>"true" : "true" case false: return "false"; >false : false ->"false" : string +>"false" : "false" } return assertNever(x); >assertNever(x) : never diff --git a/tests/baselines/reference/booleanLiteralTypes2.types b/tests/baselines/reference/booleanLiteralTypes2.types index 76cca9481d4..e5e4fba7f4f 100644 --- a/tests/baselines/reference/booleanLiteralTypes2.types +++ b/tests/baselines/reference/booleanLiteralTypes2.types @@ -85,36 +85,36 @@ function f4(t: true, f: false) { >false : false var x1 = t && f; ->x1 : false +>x1 : boolean >t && f : false >t : true >f : false var x2 = f && t; ->x2 : false +>x2 : boolean >f && t : false >f : false >t : true var x3 = t || f; ->x3 : true +>x3 : boolean >t || f : true >t : true >f : false var x4 = f || t; ->x4 : true +>x4 : boolean >f || t : true >f : false >t : true var x5 = !t; ->x5 : false +>x5 : boolean >!t : false >t : true var x6 = !f; ->x6 : true +>x6 : boolean >!f : true >f : false } @@ -163,11 +163,11 @@ function assertNever(x: never): never { throw new Error("Unexpected value"); >new Error("Unexpected value") : Error >Error : ErrorConstructor ->"Unexpected value" : string +>"Unexpected value" : "Unexpected value" } function f10(x: true | false) { ->f10 : (x: boolean) => string +>f10 : (x: boolean) => "true" | "false" >x : boolean >true : true >false : false @@ -177,16 +177,16 @@ function f10(x: true | false) { case true: return "true"; >true : true ->"true" : string +>"true" : "true" case false: return "false"; >false : false ->"false" : string +>"false" : "false" } } function f11(x: true | false) { ->f11 : (x: boolean) => string +>f11 : (x: boolean) => "true" | "false" >x : boolean >true : true >false : false @@ -196,11 +196,11 @@ function f11(x: true | false) { case true: return "true"; >true : true ->"true" : string +>"true" : "true" case false: return "false"; >false : false ->"false" : string +>"false" : "false" } return assertNever(x); >assertNever(x) : never diff --git a/tests/baselines/reference/booleanPropertyAccess.types b/tests/baselines/reference/booleanPropertyAccess.types index 2795b36cee5..a0b800b5574 100644 --- a/tests/baselines/reference/booleanPropertyAccess.types +++ b/tests/baselines/reference/booleanPropertyAccess.types @@ -1,19 +1,19 @@ === tests/cases/conformance/types/primitives/boolean/booleanPropertyAccess.ts === var x = true; >x : boolean ->true : boolean +>true : true var a = x.toString(); >a : string >x.toString() : string >x.toString : () => string ->x : boolean +>x : true >toString : () => string var b = x['toString'](); >b : string >x['toString']() : string >x['toString'] : () => string ->x : boolean ->'toString' : string +>x : true +>'toString' : "toString" diff --git a/tests/baselines/reference/breakInIterationOrSwitchStatement1.types b/tests/baselines/reference/breakInIterationOrSwitchStatement1.types index 545a20ecc55..fad31ae3c92 100644 --- a/tests/baselines/reference/breakInIterationOrSwitchStatement1.types +++ b/tests/baselines/reference/breakInIterationOrSwitchStatement1.types @@ -1,6 +1,6 @@ === tests/cases/compiler/breakInIterationOrSwitchStatement1.ts === while (true) { ->true : boolean +>true : true break; } diff --git a/tests/baselines/reference/breakInIterationOrSwitchStatement2.types b/tests/baselines/reference/breakInIterationOrSwitchStatement2.types index 5736be6c923..e954d459f73 100644 --- a/tests/baselines/reference/breakInIterationOrSwitchStatement2.types +++ b/tests/baselines/reference/breakInIterationOrSwitchStatement2.types @@ -3,5 +3,5 @@ do { break; } while (true); ->true : boolean +>true : true diff --git a/tests/baselines/reference/breakTarget2.types b/tests/baselines/reference/breakTarget2.types index 412203accd1..bf465eb568d 100644 --- a/tests/baselines/reference/breakTarget2.types +++ b/tests/baselines/reference/breakTarget2.types @@ -3,7 +3,7 @@ target: >target : any while (true) { ->true : boolean +>true : true break target; >target : any diff --git a/tests/baselines/reference/breakTarget3.types b/tests/baselines/reference/breakTarget3.types index e4b5f8a1c61..6e926768e12 100644 --- a/tests/baselines/reference/breakTarget3.types +++ b/tests/baselines/reference/breakTarget3.types @@ -7,7 +7,7 @@ target2: >target2 : any while (true) { ->true : boolean +>true : true break target1; >target1 : any diff --git a/tests/baselines/reference/breakTarget4.types b/tests/baselines/reference/breakTarget4.types index 8b6ccf600ad..80bee56f9c7 100644 --- a/tests/baselines/reference/breakTarget4.types +++ b/tests/baselines/reference/breakTarget4.types @@ -7,7 +7,7 @@ target2: >target2 : any while (true) { ->true : boolean +>true : true break target2; >target2 : any diff --git a/tests/baselines/reference/callExpressionWithTypeParameterConstrainedToOuterTypeParameter.types b/tests/baselines/reference/callExpressionWithTypeParameterConstrainedToOuterTypeParameter.types index 76b8a513702..69188eacd1a 100644 --- a/tests/baselines/reference/callExpressionWithTypeParameterConstrainedToOuterTypeParameter.types +++ b/tests/baselines/reference/callExpressionWithTypeParameterConstrainedToOuterTypeParameter.types @@ -15,7 +15,7 @@ var i: I; >I : I var y = i(""); // y should be string ->y : "" +>y : string >i("") : "" >i : I >"" : "" diff --git a/tests/baselines/reference/callGenericFunctionWithZeroTypeArguments.types b/tests/baselines/reference/callGenericFunctionWithZeroTypeArguments.types index e3bcb35805f..99fc2d955d1 100644 --- a/tests/baselines/reference/callGenericFunctionWithZeroTypeArguments.types +++ b/tests/baselines/reference/callGenericFunctionWithZeroTypeArguments.types @@ -11,9 +11,9 @@ function f(x: T): T { return null; } var r = f(1); >r : number ->f(1) : number +>f(1) : 1 >f : (x: T) => T ->1 : number +>1 : 1 var f2 = (x: T): T => { return null; } >f2 : (x: T) => T @@ -26,9 +26,9 @@ var f2 = (x: T): T => { return null; } var r2 = f2(1); >r2 : number ->f2(1) : number +>f2(1) : 1 >f2 : (x: T) => T ->1 : number +>1 : 1 var f3: { (x: T): T; } >f3 : (x: T) => T @@ -39,9 +39,9 @@ var f3: { (x: T): T; } var r3 = f3(1); >r3 : number ->f3(1) : number +>f3(1) : 1 >f3 : (x: T) => T ->1 : number +>1 : 1 class C { >C : C @@ -59,13 +59,13 @@ class C { } var r4 = (new C()).f(1); >r4 : number ->(new C()).f(1) : number +>(new C()).f(1) : 1 >(new C()).f : (x: T) => T >(new C()) : C >new C() : C >C : typeof C >f : (x: T) => T ->1 : number +>1 : 1 interface I { >I : I @@ -83,11 +83,11 @@ var i: I; var r5 = i.f(1); >r5 : number ->i.f(1) : number +>i.f(1) : 1 >i.f : (x: T) => T >i : I >f : (x: T) => T ->1 : number +>1 : 1 class C2 { >C2 : C2 @@ -111,7 +111,7 @@ var r6 = (new C2()).f(1); >new C2() : C2<{}> >C2 : typeof C2 >f : (x: {}) => {} ->1 : number +>1 : 1 interface I2 { >I2 : I2 @@ -133,5 +133,5 @@ var r7 = i2.f(1); >i2.f : (x: number) => number >i2 : I2 >f : (x: number) => number ->1 : number +>1 : 1 diff --git a/tests/baselines/reference/callOnInstance.errors.txt b/tests/baselines/reference/callOnInstance.errors.txt index 156bdfd512a..4f80088ab75 100644 --- a/tests/baselines/reference/callOnInstance.errors.txt +++ b/tests/baselines/reference/callOnInstance.errors.txt @@ -2,7 +2,7 @@ tests/cases/compiler/callOnInstance.ts(1,18): error TS2300: Duplicate identifier tests/cases/compiler/callOnInstance.ts(3,15): error TS2300: Duplicate identifier 'D'. tests/cases/compiler/callOnInstance.ts(7,19): error TS2346: Supplied parameters do not match any signature of call target. tests/cases/compiler/callOnInstance.ts(7,19): error TS2350: Only a void function can be called with the 'new' keyword. -tests/cases/compiler/callOnInstance.ts(10,1): error TS2349: Cannot invoke an expression whose type lacks a call signature. +tests/cases/compiler/callOnInstance.ts(10,1): error TS2349: Cannot invoke an expression whose type lacks a call signature. Type 'C' has no compatible call signatures. ==== tests/cases/compiler/callOnInstance.ts (5 errors) ==== @@ -25,4 +25,4 @@ tests/cases/compiler/callOnInstance.ts(10,1): error TS2349: Cannot invoke an exp declare class C { constructor(value: number); } (new C(1))(); // Error for calling an instance ~~~~~~~~~~~~ -!!! error TS2349: Cannot invoke an expression whose type lacks a call signature. \ No newline at end of file +!!! error TS2349: Cannot invoke an expression whose type lacks a call signature. Type 'C' has no compatible call signatures. \ No newline at end of file diff --git a/tests/baselines/reference/callSignatureWithOptionalParameterAndInitializer.errors.txt b/tests/baselines/reference/callSignatureWithOptionalParameterAndInitializer.errors.txt index 63a63309c31..0b542186c29 100644 --- a/tests/baselines/reference/callSignatureWithOptionalParameterAndInitializer.errors.txt +++ b/tests/baselines/reference/callSignatureWithOptionalParameterAndInitializer.errors.txt @@ -12,7 +12,7 @@ tests/cases/conformance/types/objectTypeLiteral/callSignatures/callSignatureWith tests/cases/conformance/types/objectTypeLiteral/callSignatures/callSignatureWithOptionalParameterAndInitializer.ts(35,9): error TS2371: A parameter initializer is only allowed in a function or constructor implementation. tests/cases/conformance/types/objectTypeLiteral/callSignatures/callSignatureWithOptionalParameterAndInitializer.ts(44,9): error TS1015: Parameter cannot have question mark and initializer. tests/cases/conformance/types/objectTypeLiteral/callSignatures/callSignatureWithOptionalParameterAndInitializer.ts(45,32): error TS1015: Parameter cannot have question mark and initializer. -tests/cases/conformance/types/objectTypeLiteral/callSignatures/callSignatureWithOptionalParameterAndInitializer.ts(45,32): error TS2322: Type 'string' is not assignable to type 'number'. +tests/cases/conformance/types/objectTypeLiteral/callSignatures/callSignatureWithOptionalParameterAndInitializer.ts(45,32): error TS2322: Type '""' is not assignable to type 'number'. tests/cases/conformance/types/objectTypeLiteral/callSignatures/callSignatureWithOptionalParameterAndInitializer.ts(46,9): error TS1015: Parameter cannot have question mark and initializer. @@ -91,7 +91,7 @@ tests/cases/conformance/types/objectTypeLiteral/callSignatures/callSignatureWith ~ !!! error TS1015: Parameter cannot have question mark and initializer. ~~~~~~~~~~~~~~~ -!!! error TS2322: Type 'string' is not assignable to type 'number'. +!!! error TS2322: Type '""' is not assignable to type 'number'. b: (x?: any = '') => { } ~ !!! error TS1015: Parameter cannot have question mark and initializer. diff --git a/tests/baselines/reference/callSignatureWithoutAnnotationsOrBody.types b/tests/baselines/reference/callSignatureWithoutAnnotationsOrBody.types index 062961ac093..9fe90ae83c3 100644 --- a/tests/baselines/reference/callSignatureWithoutAnnotationsOrBody.types +++ b/tests/baselines/reference/callSignatureWithoutAnnotationsOrBody.types @@ -9,7 +9,7 @@ var r = foo(1); // void since there's a body >r : void >foo(1) : void >foo : (x: any) => void ->1 : number +>1 : 1 interface I { >I : I diff --git a/tests/baselines/reference/callSignatureWithoutReturnTypeAnnotationInference.types b/tests/baselines/reference/callSignatureWithoutReturnTypeAnnotationInference.types index 689ac62c35b..0b515750aec 100644 --- a/tests/baselines/reference/callSignatureWithoutReturnTypeAnnotationInference.types +++ b/tests/baselines/reference/callSignatureWithoutReturnTypeAnnotationInference.types @@ -8,13 +8,13 @@ function foo(x) { >x : any return 1; ->1 : number +>1 : 1 } var r = foo(1); >r : number >foo(1) : number >foo : (x: any) => number ->1 : number +>1 : 1 function foo2(x) { >foo2 : (x: any) => number @@ -29,7 +29,7 @@ var r2 = foo2(1); >r2 : number >foo2(1) : number >foo2 : (x: any) => number ->1 : number +>1 : 1 function foo3() { >foo3 : () => any @@ -54,30 +54,30 @@ function foo4(x: T) { } var r4 = foo4(1); >r4 : number ->foo4(1) : number +>foo4(1) : 1 >foo4 : (x: T) => T ->1 : number +>1 : 1 function foo5(x) { ->foo5 : (x: any) => number +>foo5 : (x: any) => 1 | 2 >x : any if (true) { ->true : boolean +>true : true return 1; ->1 : number +>1 : 1 } else { return 2; ->2 : number +>2 : 2 } } var r5 = foo5(1); >r5 : number ->foo5(1) : number ->foo5 : (x: any) => number ->1 : number +>foo5(1) : 1 | 2 +>foo5 : (x: any) => 1 | 2 +>1 : 1 function foo6(x) { >foo6 : (x: any) => any[] @@ -100,7 +100,7 @@ var r6 = foo6(1); >r6 : any[] >foo6(1) : any[] >foo6 : (x: any) => any[] ->1 : number +>1 : 1 function foo7(x) { >foo7 : (x: any) => string @@ -114,7 +114,7 @@ var r7 = foo7(1); >r7 : string >foo7(1) : string >foo7 : (x: any) => string ->1 : number +>1 : 1 // object types function foo8(x: number) { @@ -130,7 +130,7 @@ var r8 = foo8(1); >r8 : { x: number; } >foo8(1) : { x: number; } >foo8 : (x: number) => { x: number; } ->1 : number +>1 : 1 interface I { >I : I @@ -153,7 +153,7 @@ var r9 = foo9(1); >r9 : I >foo9(1) : I >foo9 : (x: number) => I ->1 : number +>1 : 1 class C { >C : C @@ -176,14 +176,14 @@ var r10 = foo10(1); >r10 : C >foo10(1) : C >foo10 : (x: number) => C ->1 : number +>1 : 1 module M { >M : typeof M export var x = 1; >x : number ->1 : number +>1 : 1 export class C { foo: string } >C : C @@ -230,12 +230,12 @@ var r12 = foo12(); function m1() { return 1; } >m1 : typeof m1 ->1 : number +>1 : 1 module m1 { export var y = 2; } >m1 : typeof m1 >y : number ->2 : number +>2 : 2 function foo13() { >foo13 : () => typeof m1 @@ -262,7 +262,7 @@ module c1 { export var x = 1; >x : number ->1 : number +>1 : 1 } function foo14() { >foo14 : () => typeof c1 @@ -282,7 +282,7 @@ enum e1 { A } module e1 { export var y = 1; } >e1 : typeof e1 >y : number ->1 : number +>1 : 1 function foo15() { >foo15 : () => typeof e1 diff --git a/tests/baselines/reference/callSignaturesShouldBeResolvedBeforeSpecialization.errors.txt b/tests/baselines/reference/callSignaturesShouldBeResolvedBeforeSpecialization.errors.txt index 1c558910a8c..03219e806ef 100644 --- a/tests/baselines/reference/callSignaturesShouldBeResolvedBeforeSpecialization.errors.txt +++ b/tests/baselines/reference/callSignaturesShouldBeResolvedBeforeSpecialization.errors.txt @@ -1,4 +1,4 @@ -tests/cases/compiler/callSignaturesShouldBeResolvedBeforeSpecialization.ts(9,10): error TS2345: Argument of type 'boolean' is not assignable to parameter of type 'string'. +tests/cases/compiler/callSignaturesShouldBeResolvedBeforeSpecialization.ts(9,10): error TS2345: Argument of type 'true' is not assignable to parameter of type 'string'. ==== tests/cases/compiler/callSignaturesShouldBeResolvedBeforeSpecialization.ts (1 errors) ==== @@ -12,5 +12,5 @@ tests/cases/compiler/callSignaturesShouldBeResolvedBeforeSpecialization.ts(9,10) test("expects boolean instead of string"); // should not error - "test" should not expect a boolean test(true); // should error - string expected ~~~~ -!!! error TS2345: Argument of type 'boolean' is not assignable to parameter of type 'string'. +!!! error TS2345: Argument of type 'true' is not assignable to parameter of type 'string'. } \ No newline at end of file diff --git a/tests/baselines/reference/callSignaturesThatDifferOnlyByReturnType2.errors.txt b/tests/baselines/reference/callSignaturesThatDifferOnlyByReturnType2.errors.txt index 4ff65843eba..87999dec851 100644 --- a/tests/baselines/reference/callSignaturesThatDifferOnlyByReturnType2.errors.txt +++ b/tests/baselines/reference/callSignaturesThatDifferOnlyByReturnType2.errors.txt @@ -1,6 +1,6 @@ tests/cases/conformance/types/objectTypeLiteral/callSignatures/callSignaturesThatDifferOnlyByReturnType2.ts(8,11): error TS2320: Interface 'A' cannot simultaneously extend types 'I' and 'I'. Named property 'foo' of types 'I' and 'I' are not identical. -tests/cases/conformance/types/objectTypeLiteral/callSignatures/callSignaturesThatDifferOnlyByReturnType2.ts(13,16): error TS2345: Argument of type 'string' is not assignable to parameter of type 'number'. +tests/cases/conformance/types/objectTypeLiteral/callSignatures/callSignaturesThatDifferOnlyByReturnType2.ts(13,16): error TS2345: Argument of type '""' is not assignable to parameter of type 'number'. ==== tests/cases/conformance/types/objectTypeLiteral/callSignatures/callSignaturesThatDifferOnlyByReturnType2.ts (2 errors) ==== @@ -21,5 +21,5 @@ tests/cases/conformance/types/objectTypeLiteral/callSignatures/callSignaturesTha var r = x.foo(1); // no error var r2 = x.foo(''); // error ~~ -!!! error TS2345: Argument of type 'string' is not assignable to parameter of type 'number'. +!!! error TS2345: Argument of type '""' is not assignable to parameter of type 'number'. \ No newline at end of file diff --git a/tests/baselines/reference/callSignaturesWithOptionalParameters.types b/tests/baselines/reference/callSignaturesWithOptionalParameters.types index 4ade0e8afe4..e01eed3835a 100644 --- a/tests/baselines/reference/callSignaturesWithOptionalParameters.types +++ b/tests/baselines/reference/callSignaturesWithOptionalParameters.types @@ -20,7 +20,7 @@ var f2 = (x: number, y?: number) => { } foo(1); >foo(1) : void >foo : (x?: number) => void ->1 : number +>1 : 1 foo(); >foo() : void @@ -29,7 +29,7 @@ foo(); f(1); >f(1) : void >f : (x?: number) => void ->1 : number +>1 : 1 f(); >f() : void @@ -38,13 +38,13 @@ f(); f2(1); >f2(1) : void >f2 : (x: number, y?: number) => void ->1 : number +>1 : 1 f2(1, 2); >f2(1, 2) : void >f2 : (x: number, y?: number) => void ->1 : number ->2 : number +>1 : 1 +>2 : 2 class C { >C : C @@ -69,7 +69,7 @@ c.foo(1); >c.foo : (x?: number) => void >c : C >foo : (x?: number) => void ->1 : number +>1 : 1 interface I { >I : I @@ -94,22 +94,22 @@ i(); i(1); >i(1) : any >i : I ->1 : number +>1 : 1 i.foo(1); >i.foo(1) : any >i.foo : (x: number, y?: number) => any >i : I >foo : (x: number, y?: number) => any ->1 : number +>1 : 1 i.foo(1, 2); >i.foo(1, 2) : any >i.foo : (x: number, y?: number) => any >i : I >foo : (x: number, y?: number) => any ->1 : number ->2 : number +>1 : 1 +>2 : 2 var a: { >a : { (x?: number): any; foo(x?: number): any; } @@ -129,7 +129,7 @@ a(); a(1); >a(1) : any >a : { (x?: number): any; foo(x?: number): any; } ->1 : number +>1 : 1 a.foo(); >a.foo() : any @@ -142,7 +142,7 @@ a.foo(1); >a.foo : (x?: number) => any >a : { (x?: number): any; foo(x?: number): any; } >foo : (x?: number) => any ->1 : number +>1 : 1 var b = { >b : { foo(x?: number): void; a: (x: number, y?: number) => void; b: (x?: number) => void; } @@ -176,22 +176,22 @@ b.foo(1); >b.foo : (x?: number) => void >b : { foo(x?: number): void; a: (x: number, y?: number) => void; b: (x?: number) => void; } >foo : (x?: number) => void ->1 : number +>1 : 1 b.a(1); >b.a(1) : void >b.a : (x: number, y?: number) => void >b : { foo(x?: number): void; a: (x: number, y?: number) => void; b: (x?: number) => void; } >a : (x: number, y?: number) => void ->1 : number +>1 : 1 b.a(1, 2); >b.a(1, 2) : void >b.a : (x: number, y?: number) => void >b : { foo(x?: number): void; a: (x: number, y?: number) => void; b: (x?: number) => void; } >a : (x: number, y?: number) => void ->1 : number ->2 : number +>1 : 1 +>2 : 2 b.b(); >b.b() : void @@ -204,5 +204,5 @@ b.b(1); >b.b : (x?: number) => void >b : { foo(x?: number): void; a: (x: number, y?: number) => void; b: (x?: number) => void; } >b : (x?: number) => void ->1 : number +>1 : 1 diff --git a/tests/baselines/reference/callSignaturesWithOptionalParameters2.types b/tests/baselines/reference/callSignaturesWithOptionalParameters2.types index f726840752e..c800a62d096 100644 --- a/tests/baselines/reference/callSignaturesWithOptionalParameters2.types +++ b/tests/baselines/reference/callSignaturesWithOptionalParameters2.types @@ -12,7 +12,7 @@ function foo(x?: number) { } foo(1); >foo(1) : any >foo : (x?: number) => any ->1 : number +>1 : 1 foo(); >foo() : any @@ -35,13 +35,13 @@ function foo2(x: number, y?: number) { } foo2(1); >foo2(1) : any >foo2 : { (x: number): any; (x: number, y?: number): any; } ->1 : number +>1 : 1 foo2(1, 2); >foo2(1, 2) : any >foo2 : { (x: number): any; (x: number, y?: number): any; } ->1 : number ->2 : number +>1 : 1 +>2 : 2 class C { >C : C @@ -84,22 +84,22 @@ c.foo(1); >c.foo : (x?: number) => any >c : C >foo : (x?: number) => any ->1 : number +>1 : 1 c.foo2(1); >c.foo2(1) : any >c.foo2 : { (x: number): any; (x: number, y?: number): any; } >c : C >foo2 : { (x: number): any; (x: number, y?: number): any; } ->1 : number +>1 : 1 c.foo2(1, 2); >c.foo2(1, 2) : any >c.foo2 : { (x: number): any; (x: number, y?: number): any; } >c : C >foo2 : { (x: number): any; (x: number, y?: number): any; } ->1 : number ->2 : number +>1 : 1 +>2 : 2 interface I { >I : I @@ -134,37 +134,37 @@ i(); i(1); >i(1) : any >i : I ->1 : number +>1 : 1 i(1, 2); >i(1, 2) : any >i : I ->1 : number ->2 : number +>1 : 1 +>2 : 2 i.foo(1); >i.foo(1) : any >i.foo : { (x: number, y?: number): any; (x: number, y?: number, z?: number): any; } >i : I >foo : { (x: number, y?: number): any; (x: number, y?: number, z?: number): any; } ->1 : number +>1 : 1 i.foo(1, 2); >i.foo(1, 2) : any >i.foo : { (x: number, y?: number): any; (x: number, y?: number, z?: number): any; } >i : I >foo : { (x: number, y?: number): any; (x: number, y?: number, z?: number): any; } ->1 : number ->2 : number +>1 : 1 +>2 : 2 i.foo(1, 2, 3); >i.foo(1, 2, 3) : any >i.foo : { (x: number, y?: number): any; (x: number, y?: number, z?: number): any; } >i : I >foo : { (x: number, y?: number): any; (x: number, y?: number, z?: number): any; } ->1 : number ->2 : number ->3 : number +>1 : 1 +>2 : 2 +>3 : 3 var a: { >a : { (x?: number): any; (x?: number, y?: number): any; foo(x: number, y?: number): any; foo(x: number, y?: number, z?: number): any; } @@ -195,35 +195,35 @@ a(); a(1); >a(1) : any >a : { (x?: number): any; (x?: number, y?: number): any; foo(x: number, y?: number): any; foo(x: number, y?: number, z?: number): any; } ->1 : number +>1 : 1 a(1, 2); >a(1, 2) : any >a : { (x?: number): any; (x?: number, y?: number): any; foo(x: number, y?: number): any; foo(x: number, y?: number, z?: number): any; } ->1 : number ->2 : number +>1 : 1 +>2 : 2 a.foo(1); >a.foo(1) : any >a.foo : { (x: number, y?: number): any; (x: number, y?: number, z?: number): any; } >a : { (x?: number): any; (x?: number, y?: number): any; foo(x: number, y?: number): any; foo(x: number, y?: number, z?: number): any; } >foo : { (x: number, y?: number): any; (x: number, y?: number, z?: number): any; } ->1 : number +>1 : 1 a.foo(1, 2); >a.foo(1, 2) : any >a.foo : { (x: number, y?: number): any; (x: number, y?: number, z?: number): any; } >a : { (x?: number): any; (x?: number, y?: number): any; foo(x: number, y?: number): any; foo(x: number, y?: number, z?: number): any; } >foo : { (x: number, y?: number): any; (x: number, y?: number, z?: number): any; } ->1 : number ->2 : number +>1 : 1 +>2 : 2 a.foo(1, 2, 3); >a.foo(1, 2, 3) : any >a.foo : { (x: number, y?: number): any; (x: number, y?: number, z?: number): any; } >a : { (x?: number): any; (x?: number, y?: number): any; foo(x: number, y?: number): any; foo(x: number, y?: number, z?: number): any; } >foo : { (x: number, y?: number): any; (x: number, y?: number, z?: number): any; } ->1 : number ->2 : number ->3 : number +>1 : 1 +>2 : 2 +>3 : 3 diff --git a/tests/baselines/reference/callWithSpread.types b/tests/baselines/reference/callWithSpread.types index bc120dc4043..c9403f1bb69 100644 --- a/tests/baselines/reference/callWithSpread.types +++ b/tests/baselines/reference/callWithSpread.types @@ -33,43 +33,43 @@ var xa: X[]; foo(1, 2, "abc"); >foo(1, 2, "abc") : void >foo : (x: number, y: number, ...z: string[]) => void ->1 : number ->2 : number ->"abc" : string +>1 : 1 +>2 : 2 +>"abc" : "abc" foo(1, 2, ...a); >foo(1, 2, ...a) : void >foo : (x: number, y: number, ...z: string[]) => void ->1 : number ->2 : number +>1 : 1 +>2 : 2 >...a : string >a : string[] foo(1, 2, ...a, "abc"); >foo(1, 2, ...a, "abc") : void >foo : (x: number, y: number, ...z: string[]) => void ->1 : number ->2 : number +>1 : 1 +>2 : 2 >...a : string >a : string[] ->"abc" : string +>"abc" : "abc" obj.foo(1, 2, "abc"); >obj.foo(1, 2, "abc") : any >obj.foo : (x: number, y: number, ...z: string[]) => any >obj : X >foo : (x: number, y: number, ...z: string[]) => any ->1 : number ->2 : number ->"abc" : string +>1 : 1 +>2 : 2 +>"abc" : "abc" obj.foo(1, 2, ...a); >obj.foo(1, 2, ...a) : any >obj.foo : (x: number, y: number, ...z: string[]) => any >obj : X >foo : (x: number, y: number, ...z: string[]) => any ->1 : number ->2 : number +>1 : 1 +>2 : 2 >...a : string >a : string[] @@ -78,11 +78,11 @@ obj.foo(1, 2, ...a, "abc"); >obj.foo : (x: number, y: number, ...z: string[]) => any >obj : X >foo : (x: number, y: number, ...z: string[]) => any ->1 : number ->2 : number +>1 : 1 +>2 : 2 >...a : string >a : string[] ->"abc" : string +>"abc" : "abc" (obj.foo)(1, 2, "abc"); >(obj.foo)(1, 2, "abc") : any @@ -90,9 +90,9 @@ obj.foo(1, 2, ...a, "abc"); >obj.foo : (x: number, y: number, ...z: string[]) => any >obj : X >foo : (x: number, y: number, ...z: string[]) => any ->1 : number ->2 : number ->"abc" : string +>1 : 1 +>2 : 2 +>"abc" : "abc" (obj.foo)(1, 2, ...a); >(obj.foo)(1, 2, ...a) : any @@ -100,8 +100,8 @@ obj.foo(1, 2, ...a, "abc"); >obj.foo : (x: number, y: number, ...z: string[]) => any >obj : X >foo : (x: number, y: number, ...z: string[]) => any ->1 : number ->2 : number +>1 : 1 +>2 : 2 >...a : string >a : string[] @@ -111,32 +111,32 @@ obj.foo(1, 2, ...a, "abc"); >obj.foo : (x: number, y: number, ...z: string[]) => any >obj : X >foo : (x: number, y: number, ...z: string[]) => any ->1 : number ->2 : number +>1 : 1 +>2 : 2 >...a : string >a : string[] ->"abc" : string +>"abc" : "abc" xa[1].foo(1, 2, "abc"); >xa[1].foo(1, 2, "abc") : any >xa[1].foo : (x: number, y: number, ...z: string[]) => any >xa[1] : X >xa : X[] ->1 : number +>1 : 1 >foo : (x: number, y: number, ...z: string[]) => any ->1 : number ->2 : number ->"abc" : string +>1 : 1 +>2 : 2 +>"abc" : "abc" xa[1].foo(1, 2, ...a); >xa[1].foo(1, 2, ...a) : any >xa[1].foo : (x: number, y: number, ...z: string[]) => any >xa[1] : X >xa : X[] ->1 : number +>1 : 1 >foo : (x: number, y: number, ...z: string[]) => any ->1 : number ->2 : number +>1 : 1 +>2 : 2 >...a : string >a : string[] @@ -145,13 +145,13 @@ xa[1].foo(1, 2, ...a, "abc"); >xa[1].foo : (x: number, y: number, ...z: string[]) => any >xa[1] : X >xa : X[] ->1 : number +>1 : 1 >foo : (x: number, y: number, ...z: string[]) => any ->1 : number ->2 : number +>1 : 1 +>2 : 2 >...a : string >a : string[] ->"abc" : string +>"abc" : "abc" (xa[1].foo)(...[1, 2, "abc"]); >(xa[1].foo)(...[1, 2, "abc"]) : any @@ -161,13 +161,13 @@ xa[1].foo(1, 2, ...a, "abc"); >xa[1].foo : (x: number, y: number, ...z: string[]) => any >xa[1] : X >xa : X[] ->1 : number +>1 : 1 >foo : (x: number, y: number, ...z: string[]) => any >...[1, 2, "abc"] : string | number >[1, 2, "abc"] : (string | number)[] ->1 : number ->2 : number ->"abc" : string +>1 : 1 +>2 : 2 +>"abc" : "abc" class C { >C : C @@ -211,14 +211,14 @@ class D extends C { super(1, 2); >super(1, 2) : void >super : typeof C ->1 : number ->2 : number +>1 : 1 +>2 : 2 super(1, 2, ...a); >super(1, 2, ...a) : void >super : typeof C ->1 : number ->2 : number +>1 : 1 +>2 : 2 >...a : string >a : string[] } @@ -230,16 +230,16 @@ class D extends C { >super.foo : (x: number, y: number, ...z: string[]) => void >super : C >foo : (x: number, y: number, ...z: string[]) => void ->1 : number ->2 : number +>1 : 1 +>2 : 2 super.foo(1, 2, ...a); >super.foo(1, 2, ...a) : void >super.foo : (x: number, y: number, ...z: string[]) => void >super : C >foo : (x: number, y: number, ...z: string[]) => void ->1 : number ->2 : number +>1 : 1 +>2 : 2 >...a : string >a : string[] } diff --git a/tests/baselines/reference/callWithSpreadES6.types b/tests/baselines/reference/callWithSpreadES6.types index 99fe1330df9..b25b8dc02b5 100644 --- a/tests/baselines/reference/callWithSpreadES6.types +++ b/tests/baselines/reference/callWithSpreadES6.types @@ -34,43 +34,43 @@ var xa: X[]; foo(1, 2, "abc"); >foo(1, 2, "abc") : void >foo : (x: number, y: number, ...z: string[]) => void ->1 : number ->2 : number ->"abc" : string +>1 : 1 +>2 : 2 +>"abc" : "abc" foo(1, 2, ...a); >foo(1, 2, ...a) : void >foo : (x: number, y: number, ...z: string[]) => void ->1 : number ->2 : number +>1 : 1 +>2 : 2 >...a : string >a : string[] foo(1, 2, ...a, "abc"); >foo(1, 2, ...a, "abc") : void >foo : (x: number, y: number, ...z: string[]) => void ->1 : number ->2 : number +>1 : 1 +>2 : 2 >...a : string >a : string[] ->"abc" : string +>"abc" : "abc" obj.foo(1, 2, "abc"); >obj.foo(1, 2, "abc") : any >obj.foo : (x: number, y: number, ...z: string[]) => any >obj : X >foo : (x: number, y: number, ...z: string[]) => any ->1 : number ->2 : number ->"abc" : string +>1 : 1 +>2 : 2 +>"abc" : "abc" obj.foo(1, 2, ...a); >obj.foo(1, 2, ...a) : any >obj.foo : (x: number, y: number, ...z: string[]) => any >obj : X >foo : (x: number, y: number, ...z: string[]) => any ->1 : number ->2 : number +>1 : 1 +>2 : 2 >...a : string >a : string[] @@ -79,11 +79,11 @@ obj.foo(1, 2, ...a, "abc"); >obj.foo : (x: number, y: number, ...z: string[]) => any >obj : X >foo : (x: number, y: number, ...z: string[]) => any ->1 : number ->2 : number +>1 : 1 +>2 : 2 >...a : string >a : string[] ->"abc" : string +>"abc" : "abc" (obj.foo)(1, 2, "abc"); >(obj.foo)(1, 2, "abc") : any @@ -91,9 +91,9 @@ obj.foo(1, 2, ...a, "abc"); >obj.foo : (x: number, y: number, ...z: string[]) => any >obj : X >foo : (x: number, y: number, ...z: string[]) => any ->1 : number ->2 : number ->"abc" : string +>1 : 1 +>2 : 2 +>"abc" : "abc" (obj.foo)(1, 2, ...a); >(obj.foo)(1, 2, ...a) : any @@ -101,8 +101,8 @@ obj.foo(1, 2, ...a, "abc"); >obj.foo : (x: number, y: number, ...z: string[]) => any >obj : X >foo : (x: number, y: number, ...z: string[]) => any ->1 : number ->2 : number +>1 : 1 +>2 : 2 >...a : string >a : string[] @@ -112,32 +112,32 @@ obj.foo(1, 2, ...a, "abc"); >obj.foo : (x: number, y: number, ...z: string[]) => any >obj : X >foo : (x: number, y: number, ...z: string[]) => any ->1 : number ->2 : number +>1 : 1 +>2 : 2 >...a : string >a : string[] ->"abc" : string +>"abc" : "abc" xa[1].foo(1, 2, "abc"); >xa[1].foo(1, 2, "abc") : any >xa[1].foo : (x: number, y: number, ...z: string[]) => any >xa[1] : X >xa : X[] ->1 : number +>1 : 1 >foo : (x: number, y: number, ...z: string[]) => any ->1 : number ->2 : number ->"abc" : string +>1 : 1 +>2 : 2 +>"abc" : "abc" xa[1].foo(1, 2, ...a); >xa[1].foo(1, 2, ...a) : any >xa[1].foo : (x: number, y: number, ...z: string[]) => any >xa[1] : X >xa : X[] ->1 : number +>1 : 1 >foo : (x: number, y: number, ...z: string[]) => any ->1 : number ->2 : number +>1 : 1 +>2 : 2 >...a : string >a : string[] @@ -146,13 +146,13 @@ xa[1].foo(1, 2, ...a, "abc"); >xa[1].foo : (x: number, y: number, ...z: string[]) => any >xa[1] : X >xa : X[] ->1 : number +>1 : 1 >foo : (x: number, y: number, ...z: string[]) => any ->1 : number ->2 : number +>1 : 1 +>2 : 2 >...a : string >a : string[] ->"abc" : string +>"abc" : "abc" (xa[1].foo)(...[1, 2, "abc"]); >(xa[1].foo)(...[1, 2, "abc"]) : any @@ -162,13 +162,13 @@ xa[1].foo(1, 2, ...a, "abc"); >xa[1].foo : (x: number, y: number, ...z: string[]) => any >xa[1] : X >xa : X[] ->1 : number +>1 : 1 >foo : (x: number, y: number, ...z: string[]) => any >...[1, 2, "abc"] : string | number >[1, 2, "abc"] : (string | number)[] ->1 : number ->2 : number ->"abc" : string +>1 : 1 +>2 : 2 +>"abc" : "abc" class C { >C : C @@ -212,14 +212,14 @@ class D extends C { super(1, 2); >super(1, 2) : void >super : typeof C ->1 : number ->2 : number +>1 : 1 +>2 : 2 super(1, 2, ...a); >super(1, 2, ...a) : void >super : typeof C ->1 : number ->2 : number +>1 : 1 +>2 : 2 >...a : string >a : string[] } @@ -231,16 +231,16 @@ class D extends C { >super.foo : (x: number, y: number, ...z: string[]) => void >super : C >foo : (x: number, y: number, ...z: string[]) => void ->1 : number ->2 : number +>1 : 1 +>2 : 2 super.foo(1, 2, ...a); >super.foo(1, 2, ...a) : void >super.foo : (x: number, y: number, ...z: string[]) => void >super : C >foo : (x: number, y: number, ...z: string[]) => void ->1 : number ->2 : number +>1 : 1 +>2 : 2 >...a : string >a : string[] } diff --git a/tests/baselines/reference/capturedLetConstInLoop1.errors.txt b/tests/baselines/reference/capturedLetConstInLoop1.errors.txt new file mode 100644 index 00000000000..a10b380bcf9 --- /dev/null +++ b/tests/baselines/reference/capturedLetConstInLoop1.errors.txt @@ -0,0 +1,128 @@ +tests/cases/compiler/capturedLetConstInLoop1.ts(69,19): error TS2365: Operator '<' cannot be applied to types '0' and '1'. +tests/cases/compiler/capturedLetConstInLoop1.ts(86,19): error TS2365: Operator '<' cannot be applied to types '0' and '1'. +tests/cases/compiler/capturedLetConstInLoop1.ts(92,26): error TS2365: Operator '<' cannot be applied to types '0' and '1'. +tests/cases/compiler/capturedLetConstInLoop1.ts(109,19): error TS2365: Operator '<' cannot be applied to types '0' and '1'. + + +==== tests/cases/compiler/capturedLetConstInLoop1.ts (4 errors) ==== + //==== let + for (let x in {}) { + (function() { return x}); + (() => x); + } + + for (let x of []) { + (function() { return x}); + (() => x); + } + + for (let x = 0; x < 1; ++x) { + (function() { return x}); + (() => x); + } + + while (1 === 1) { + let x; + (function() { return x}); + (() => x); + } + + do { + let x; + (function() { return x}); + (() => x); + } while (1 === 1) + + for (let y = 0; y < 1; ++y) { + let x = 1; + (function() { return x}); + (() => x); + } + + for (let x = 0, y = 1; x < 1; ++x) { + (function() { return x + y}); + (() => x + y); + } + + while (1 === 1) { + let x, y; + (function() { return x + y}); + (() => x + y); + } + + do { + let x, y; + (function() { return x + y}); + (() => x + y); + } while (1 === 1) + + for (let y = 0; y < 1; ++y) { + let x = 1; + (function() { return x + y}); + (() => x + y); + } + + //=========const + for (const x in {}) { + (function() { return x}); + (() => x); + } + + for (const x of []) { + (function() { return x}); + (() => x); + } + + for (const x = 0; x < 1;) { + ~~~~~ +!!! error TS2365: Operator '<' cannot be applied to types '0' and '1'. + (function() { return x}); + (() => x); + } + + while (1 === 1) { + const x = 1; + (function() { return x}); + (() => x); + } + + do { + const x = 1; + (function() { return x}); + (() => x); + } while (1 === 1) + + for (const y = 0; y < 1;) { + ~~~~~ +!!! error TS2365: Operator '<' cannot be applied to types '0' and '1'. + const x = 1; + (function() { return x}); + (() => x); + } + + for (const x = 0, y = 1; x < 1;) { + ~~~~~ +!!! error TS2365: Operator '<' cannot be applied to types '0' and '1'. + (function() { return x + y}); + (() => x + y); + } + + while (1 === 1) { + const x = 1, y = 1; + (function() { return x + y}); + (() => x + y); + } + + do { + const x = 1, y = 1; + (function() { return x + y}); + (() => x + y); + } while (1 === 1) + + for (const y = 0; y < 1;) { + ~~~~~ +!!! error TS2365: Operator '<' cannot be applied to types '0' and '1'. + const x = 1; + (function() { return x + y}); + (() => x + y); + } \ No newline at end of file diff --git a/tests/baselines/reference/capturedLetConstInLoop10.types b/tests/baselines/reference/capturedLetConstInLoop10.types index e4bca4d906a..19f328f72bd 100644 --- a/tests/baselines/reference/capturedLetConstInLoop10.types +++ b/tests/baselines/reference/capturedLetConstInLoop10.types @@ -8,7 +8,7 @@ class A { for (let x of [0]) { >x : number >[0] : number[] ->0 : number +>0 : 0 let f = function() { return x; }; >f : () => number @@ -35,7 +35,7 @@ class A { for (let x of [1]) { >x : number >[1] : number[] ->1 : number +>1 : 1 let a = function() { return x; }; >a : () => number @@ -45,7 +45,7 @@ class A { for (let y of [1]) { >y : number >[1] : number[] ->1 : number +>1 : 1 let b = function() { return y; }; >b : () => number @@ -75,7 +75,7 @@ class A { for (let x of [1]) { >x : number >[1] : number[] ->1 : number +>1 : 1 let a = function() { return x; }; >a : () => number @@ -93,7 +93,7 @@ class A { for (let y of [1]) { >y : number >[1] : number[] ->1 : number +>1 : 1 let b = function() { return y; }; >b : () => number @@ -127,7 +127,7 @@ class B { for (let x of [0]) { >x : number >[0] : number[] ->0 : number +>0 : 0 let f = () => x; >f : () => number diff --git a/tests/baselines/reference/capturedLetConstInLoop10_ES6.types b/tests/baselines/reference/capturedLetConstInLoop10_ES6.types index 068c124582d..9807d60a1cd 100644 --- a/tests/baselines/reference/capturedLetConstInLoop10_ES6.types +++ b/tests/baselines/reference/capturedLetConstInLoop10_ES6.types @@ -8,7 +8,7 @@ class A { for (let x of [0]) { >x : number >[0] : number[] ->0 : number +>0 : 0 let f = function() { return x; }; >f : () => number @@ -35,7 +35,7 @@ class A { for (let x of [1]) { >x : number >[1] : number[] ->1 : number +>1 : 1 let a = function() { return x; }; >a : () => number @@ -45,7 +45,7 @@ class A { for (let y of [1]) { >y : number >[1] : number[] ->1 : number +>1 : 1 let b = function() { return y; }; >b : () => number @@ -75,7 +75,7 @@ class A { for (let x of [1]) { >x : number >[1] : number[] ->1 : number +>1 : 1 let a = function() { return x; }; >a : () => number @@ -93,7 +93,7 @@ class A { for (let y of [1]) { >y : number >[1] : number[] ->1 : number +>1 : 1 let b = function() { return y; }; >b : () => number @@ -127,7 +127,7 @@ class B { for (let x of [0]) { >x : number >[0] : number[] ->0 : number +>0 : 0 let f = () => x; >f : () => number diff --git a/tests/baselines/reference/capturedLetConstInLoop11.types b/tests/baselines/reference/capturedLetConstInLoop11.types index 09fad9f2023..e150744627d 100644 --- a/tests/baselines/reference/capturedLetConstInLoop11.types +++ b/tests/baselines/reference/capturedLetConstInLoop11.types @@ -2,7 +2,7 @@ for (;;) { let x = 1; >x : number ->1 : number +>1 : 1 () => x; >() => x : () => number @@ -14,16 +14,16 @@ function foo() { for (;;) { const a = 0; ->a : number ->0 : number +>a : 0 +>0 : 0 switch(a) { ->a : number +>a : 0 case 0: return () => a; >0 : 0 >() => a : () => number ->a : number +>a : 0 } } } diff --git a/tests/baselines/reference/capturedLetConstInLoop11_ES6.types b/tests/baselines/reference/capturedLetConstInLoop11_ES6.types index d6fd971202c..883be74b66d 100644 --- a/tests/baselines/reference/capturedLetConstInLoop11_ES6.types +++ b/tests/baselines/reference/capturedLetConstInLoop11_ES6.types @@ -2,7 +2,7 @@ for (;;) { let x = 1; >x : number ->1 : number +>1 : 1 () => x; >() => x : () => number @@ -14,16 +14,16 @@ function foo() { for (;;) { const a = 0; ->a : number ->0 : number +>a : 0 +>0 : 0 switch(a) { ->a : number +>a : 0 case 0: return () => a; >0 : 0 >() => a : () => number ->a : number +>a : 0 } } } diff --git a/tests/baselines/reference/capturedLetConstInLoop12.types b/tests/baselines/reference/capturedLetConstInLoop12.types index aee671b4d36..1e8877fe53a 100644 --- a/tests/baselines/reference/capturedLetConstInLoop12.types +++ b/tests/baselines/reference/capturedLetConstInLoop12.types @@ -5,14 +5,14 @@ >function() { "use strict"; for (let i = 0; i < 4; i++) { (() => [i] = [i + 1])(); }} : () => void "use strict"; ->"use strict" : string +>"use strict" : "use strict" for (let i = 0; i < 4; i++) { >i : number ->0 : number +>0 : 0 >i < 4 : boolean >i : number ->4 : number +>4 : 4 >i++ : number >i : number @@ -26,7 +26,7 @@ >[i + 1] : [number] >i + 1 : number >i : number ->1 : number +>1 : 1 } })(); @@ -36,14 +36,14 @@ >function() { "use strict"; for (let i = 0; i < 4; i++) { (() => ({a:i} = {a:i + 1}))(); }} : () => void "use strict"; ->"use strict" : string +>"use strict" : "use strict" for (let i = 0; i < 4; i++) { >i : number ->0 : number +>0 : 0 >i < 4 : boolean >i : number ->4 : number +>4 : 4 >i++ : number >i : number @@ -60,6 +60,6 @@ >a : number >i + 1 : number >i : number ->1 : number +>1 : 1 } })(); diff --git a/tests/baselines/reference/capturedLetConstInLoop1_ES6.errors.txt b/tests/baselines/reference/capturedLetConstInLoop1_ES6.errors.txt new file mode 100644 index 00000000000..24c5ddf17b6 --- /dev/null +++ b/tests/baselines/reference/capturedLetConstInLoop1_ES6.errors.txt @@ -0,0 +1,128 @@ +tests/cases/compiler/capturedLetConstInLoop1_ES6.ts(69,19): error TS2365: Operator '<' cannot be applied to types '0' and '1'. +tests/cases/compiler/capturedLetConstInLoop1_ES6.ts(86,19): error TS2365: Operator '<' cannot be applied to types '0' and '1'. +tests/cases/compiler/capturedLetConstInLoop1_ES6.ts(92,26): error TS2365: Operator '<' cannot be applied to types '0' and '1'. +tests/cases/compiler/capturedLetConstInLoop1_ES6.ts(109,19): error TS2365: Operator '<' cannot be applied to types '0' and '1'. + + +==== tests/cases/compiler/capturedLetConstInLoop1_ES6.ts (4 errors) ==== + //==== let + for (let x in {}) { + (function() { return x}); + (() => x); + } + + for (let x of []) { + (function() { return x}); + (() => x); + } + + for (let x = 0; x < 1; ++x) { + (function() { return x}); + (() => x); + } + + while (1 === 1) { + let x; + (function() { return x}); + (() => x); + } + + do { + let x; + (function() { return x}); + (() => x); + } while (1 === 1) + + for (let y = 0; y < 1; ++y) { + let x = 1; + (function() { return x}); + (() => x); + } + + for (let x = 0, y = 1; x < 1; ++x) { + (function() { return x + y}); + (() => x + y); + } + + while (1 === 1) { + let x, y; + (function() { return x + y}); + (() => x + y); + } + + do { + let x, y; + (function() { return x + y}); + (() => x + y); + } while (1 === 1) + + for (let y = 0; y < 1; ++y) { + let x = 1; + (function() { return x + y}); + (() => x + y); + } + + //=========const + for (const x in {}) { + (function() { return x}); + (() => x); + } + + for (const x of []) { + (function() { return x}); + (() => x); + } + + for (const x = 0; x < 1;) { + ~~~~~ +!!! error TS2365: Operator '<' cannot be applied to types '0' and '1'. + (function() { return x}); + (() => x); + } + + while (1 === 1) { + const x = 1; + (function() { return x}); + (() => x); + } + + do { + const x = 1; + (function() { return x}); + (() => x); + } while (1 === 1) + + for (const y = 0; y < 1;) { + ~~~~~ +!!! error TS2365: Operator '<' cannot be applied to types '0' and '1'. + const x = 1; + (function() { return x}); + (() => x); + } + + for (const x = 0, y = 1; x < 1;) { + ~~~~~ +!!! error TS2365: Operator '<' cannot be applied to types '0' and '1'. + (function() { return x + y}); + (() => x + y); + } + + while (1 === 1) { + const x = 1, y = 1; + (function() { return x + y}); + (() => x + y); + } + + do { + const x = 1, y = 1; + (function() { return x + y}); + (() => x + y); + } while (1 === 1) + + for (const y = 0; y < 1;) { + ~~~~~ +!!! error TS2365: Operator '<' cannot be applied to types '0' and '1'. + const x = 1; + (function() { return x + y}); + (() => x + y); + } \ No newline at end of file diff --git a/tests/baselines/reference/capturedLetConstInLoop2.errors.txt b/tests/baselines/reference/capturedLetConstInLoop2.errors.txt new file mode 100644 index 00000000000..9125a87ecfe --- /dev/null +++ b/tests/baselines/reference/capturedLetConstInLoop2.errors.txt @@ -0,0 +1,191 @@ +tests/cases/compiler/capturedLetConstInLoop2.ts(108,23): error TS2365: Operator '<' cannot be applied to types '0' and '1'. +tests/cases/compiler/capturedLetConstInLoop2.ts(133,23): error TS2365: Operator '<' cannot be applied to types '0' and '1'. +tests/cases/compiler/capturedLetConstInLoop2.ts(142,30): error TS2365: Operator '<' cannot be applied to types '0' and '1'. +tests/cases/compiler/capturedLetConstInLoop2.ts(170,23): error TS2365: Operator '<' cannot be applied to types '0' and '1'. + + +==== tests/cases/compiler/capturedLetConstInLoop2.ts (4 errors) ==== + + + // ========let + function foo0(x) { + for (let x of []) { + let a = arguments.length; + (function() { return x + a }); + (() => x + a); + } + } + + function foo0_1(x) { + for (let x in []) { + let a = arguments.length; + (function() { return x + a }); + (() => x + a); + } + } + + function foo1(x) { + for (let x = 0; x < 1; ++x) { + let a = arguments.length; + (function() { return x + a }); + (() => x + a); + } + } + + function foo2(x) { + while (1 === 1) { + let a = arguments.length; + (function() { return x + a }); + (() => x + a); + } + } + + function foo3(x) { + do { + let x; + let a = arguments.length; + (function() { return x + a }); + (() => x + a); + } while (1 === 1) + } + + function foo4(x) { + for (let y = 0; y < 1; ++y) { + let a = arguments.length; + let x = 1; + (function() { return x + a }); + (() => x + a); + } + } + + function foo5(x) { + for (let x = 0, y = 1; x < 1; ++x) { + let a = arguments.length; + (function() { return x + y + a }); + (() => x + y + a); + } + } + + + function foo6(x) { + while (1 === 1) { + let x, y; + let a = arguments.length; + (function() { return x + y + a }); + (() => x + y + a); + } + } + + function foo7(x) { + do { + let x, y; + let a = arguments.length; + (function() { return x + y + a }); + (() => x + y + a); + } while (1 === 1) + } + + + function foo8(x) { + for (let y = 0; y < 1; ++y) { + let x = 1; + let a = arguments.length; + (function() { return x + y + a }); + (() => x + y + a); + } + } + ///=======const + function foo0_c(x) { + for (const x of []) { + const a = arguments.length; + (function() { return x + a }); + (() => x + a); + } + } + + function foo0_1_c(x) { + for (const x in []) { + const a = arguments.length; + (function() { return x + a }); + (() => x + a); + } + } + + function foo1_c(x) { + for (const x = 0; x < 1;) { + ~~~~~ +!!! error TS2365: Operator '<' cannot be applied to types '0' and '1'. + const a = arguments.length; + (function() { return x + a }); + (() => x + a); + } + } + + function foo2_c(x) { + while (1 === 1) { + const a = arguments.length; + (function() { return x + a }); + (() => x + a); + } + } + + function foo3_c(x) { + do { + const x = 1; + const a = arguments.length; + (function() { return x + a }); + (() => x + a); + } while (1 === 1) + } + + function foo4_c(x) { + for (const y = 0; y < 1;) { + ~~~~~ +!!! error TS2365: Operator '<' cannot be applied to types '0' and '1'. + const a = arguments.length; + const x = 1; + (function() { return x + a }); + (() => x + a); + } + } + + function foo5_c(x) { + for (const x = 0, y = 1; x < 1;) { + ~~~~~ +!!! error TS2365: Operator '<' cannot be applied to types '0' and '1'. + const a = arguments.length; + (function() { return x + y + a }); + (() => x + y + a); + } + } + + + function foo6_c(x) { + while (1 === 1) { + const x = 1, y =1 ; + const a = arguments.length; + (function() { return x + y + a }); + (() => x + y + a); + } + } + + function foo7_c(x) { + do { + const x = 1, y = 1; + const a = arguments.length; + (function() { return x + y + a }); + (() => x + y + a); + } while (1 === 1) + } + + + function foo8_c(x) { + for (const y = 0; y < 1;) { + ~~~~~ +!!! error TS2365: Operator '<' cannot be applied to types '0' and '1'. + const x = 1; + const a = arguments.length; + (function() { return x + y + a }); + (() => x + y + a); + } + } \ No newline at end of file diff --git a/tests/baselines/reference/capturedLetConstInLoop2_ES6.errors.txt b/tests/baselines/reference/capturedLetConstInLoop2_ES6.errors.txt new file mode 100644 index 00000000000..d61bf3619c7 --- /dev/null +++ b/tests/baselines/reference/capturedLetConstInLoop2_ES6.errors.txt @@ -0,0 +1,190 @@ +tests/cases/compiler/capturedLetConstInLoop2_ES6.ts(107,23): error TS2365: Operator '<' cannot be applied to types '0' and '1'. +tests/cases/compiler/capturedLetConstInLoop2_ES6.ts(132,23): error TS2365: Operator '<' cannot be applied to types '0' and '1'. +tests/cases/compiler/capturedLetConstInLoop2_ES6.ts(141,30): error TS2365: Operator '<' cannot be applied to types '0' and '1'. +tests/cases/compiler/capturedLetConstInLoop2_ES6.ts(169,23): error TS2365: Operator '<' cannot be applied to types '0' and '1'. + + +==== tests/cases/compiler/capturedLetConstInLoop2_ES6.ts (4 errors) ==== + + // ========let + function foo0(x) { + for (let x of []) { + let a = arguments.length; + (function() { return x + a }); + (() => x + a); + } + } + + function foo0_1(x) { + for (let x in []) { + let a = arguments.length; + (function() { return x + a }); + (() => x + a); + } + } + + function foo1(x) { + for (let x = 0; x < 1; ++x) { + let a = arguments.length; + (function() { return x + a }); + (() => x + a); + } + } + + function foo2(x) { + while (1 === 1) { + let a = arguments.length; + (function() { return x + a }); + (() => x + a); + } + } + + function foo3(x) { + do { + let x; + let a = arguments.length; + (function() { return x + a }); + (() => x + a); + } while (1 === 1) + } + + function foo4(x) { + for (let y = 0; y < 1; ++y) { + let a = arguments.length; + let x = 1; + (function() { return x + a }); + (() => x + a); + } + } + + function foo5(x) { + for (let x = 0, y = 1; x < 1; ++x) { + let a = arguments.length; + (function() { return x + y + a }); + (() => x + y + a); + } + } + + + function foo6(x) { + while (1 === 1) { + let x, y; + let a = arguments.length; + (function() { return x + y + a }); + (() => x + y + a); + } + } + + function foo7(x) { + do { + let x, y; + let a = arguments.length; + (function() { return x + y + a }); + (() => x + y + a); + } while (1 === 1) + } + + + function foo8(x) { + for (let y = 0; y < 1; ++y) { + let x = 1; + let a = arguments.length; + (function() { return x + y + a }); + (() => x + y + a); + } + } + ///=======const + function foo0_c(x) { + for (const x of []) { + const a = arguments.length; + (function() { return x + a }); + (() => x + a); + } + } + + function foo0_1_c(x) { + for (const x in []) { + const a = arguments.length; + (function() { return x + a }); + (() => x + a); + } + } + + function foo1_c(x) { + for (const x = 0; x < 1;) { + ~~~~~ +!!! error TS2365: Operator '<' cannot be applied to types '0' and '1'. + const a = arguments.length; + (function() { return x + a }); + (() => x + a); + } + } + + function foo2_c(x) { + while (1 === 1) { + const a = arguments.length; + (function() { return x + a }); + (() => x + a); + } + } + + function foo3_c(x) { + do { + const x = 1; + const a = arguments.length; + (function() { return x + a }); + (() => x + a); + } while (1 === 1) + } + + function foo4_c(x) { + for (const y = 0; y < 1;) { + ~~~~~ +!!! error TS2365: Operator '<' cannot be applied to types '0' and '1'. + const a = arguments.length; + const x = 1; + (function() { return x + a }); + (() => x + a); + } + } + + function foo5_c(x) { + for (const x = 0, y = 1; x < 1;) { + ~~~~~ +!!! error TS2365: Operator '<' cannot be applied to types '0' and '1'. + const a = arguments.length; + (function() { return x + y + a }); + (() => x + y + a); + } + } + + + function foo6_c(x) { + while (1 === 1) { + const x = 1, y =1 ; + const a = arguments.length; + (function() { return x + y + a }); + (() => x + y + a); + } + } + + function foo7_c(x) { + do { + const x = 1, y = 1; + const a = arguments.length; + (function() { return x + y + a }); + (() => x + y + a); + } while (1 === 1) + } + + + function foo8_c(x) { + for (const y = 0; y < 1;) { + ~~~~~ +!!! error TS2365: Operator '<' cannot be applied to types '0' and '1'. + const x = 1; + const a = arguments.length; + (function() { return x + y + a }); + (() => x + y + a); + } + } \ No newline at end of file diff --git a/tests/baselines/reference/capturedLetConstInLoop3.errors.txt b/tests/baselines/reference/capturedLetConstInLoop3.errors.txt new file mode 100644 index 00000000000..ecc9dbcccc5 --- /dev/null +++ b/tests/baselines/reference/capturedLetConstInLoop3.errors.txt @@ -0,0 +1,232 @@ +tests/cases/compiler/capturedLetConstInLoop3.ts(132,23): error TS2365: Operator '<' cannot be applied to types '0' and '1'. +tests/cases/compiler/capturedLetConstInLoop3.ts(164,23): error TS2365: Operator '<' cannot be applied to types '0' and '1'. +tests/cases/compiler/capturedLetConstInLoop3.ts(175,30): error TS2365: Operator '<' cannot be applied to types '0' and '1'. +tests/cases/compiler/capturedLetConstInLoop3.ts(209,23): error TS2365: Operator '<' cannot be applied to types '0' and '1'. + + +==== tests/cases/compiler/capturedLetConstInLoop3.ts (4 errors) ==== + ///=========let + declare function use(a: any); + function foo0(x) { + for (let x of []) { + var v = x; + (function() { return x + v }); + (() => x + v); + } + + use(v); + } + + function foo0_1(x) { + for (let x in []) { + var v = x; + (function() { return x + v }); + (() => x + v); + } + + use(v); + } + + function foo1(x) { + for (let x = 0; x < 1; ++x) { + var v = x; + (function() { return x + v }); + (() => x + v); + } + + use(v); + } + + function foo2(x) { + while (1 === 1) { + let x = 1; + var v = x; + (function() { return x + v }); + (() => x + v); + } + + use(v); + } + + function foo3(x) { + do { + let x; + var v; + (function() { return x + v }); + (() => x + v); + } while (1 === 1); + + use(v); + } + + function foo4(x) { + for (let y = 0; y < 1; ++y) { + var v = y; + let x = 1; + (function() { return x + v }); + (() => x + v); + } + + use(v); + } + + function foo5(x) { + for (let x = 0, y = 1; x < 1; ++x) { + var v = x; + (function() { return x + y + v }); + (() => x + y + v); + } + + use(v); + } + + + function foo6(x) { + while (1 === 1) { + let x, y; + var v = x; + (function() { return x + y + v }); + (() => x + y + v); + } + + use(v) + } + + function foo7(x) { + do { + let x, y; + var v = x; + (function() { return x + y + v }); + (() => x + y + v); + } while (1 === 1); + + use(v); + } + + + function foo8(x) { + for (let y = 0; y < 1; ++y) { + let x = 1; + var v = x; + (function() { return x + y + v }); + (() => x + y + v); + } + + use(v); + } + //===const + function foo0_c(x) { + for (const x of []) { + var v = x; + (function() { return x + v }); + (() => x + v); + } + + use(v); + } + + function foo0_1_c(x) { + for (const x in []) { + var v = x; + (function() { return x + v }); + (() => x + v); + } + + use(v); + } + + function foo1_c(x) { + for (const x = 0; x < 1;) { + ~~~~~ +!!! error TS2365: Operator '<' cannot be applied to types '0' and '1'. + var v = x; + (function() { return x + v }); + (() => x + v); + } + + use(v); + } + + function foo2_c(x) { + while (1 === 1) { + const x = 1; + var v = x; + (function() { return x + v }); + (() => x + v); + } + + use(v); + } + + function foo3_c(x) { + do { + const x = 1; + var v; + (function() { return x + v }); + (() => x + v); + } while (1 === 1); + + use(v); + } + + function foo4_c(x) { + for (const y = 0; y < 1;) { + ~~~~~ +!!! error TS2365: Operator '<' cannot be applied to types '0' and '1'. + var v = y; + const x = 1; + (function() { return x + v }); + (() => x + v); + } + + use(v); + } + + function foo5_c(x) { + for (const x = 0, y = 1; x < 1;) { + ~~~~~ +!!! error TS2365: Operator '<' cannot be applied to types '0' and '1'. + var v = x; + (function() { return x + y + v }); + (() => x + y + v); + } + + use(v); + } + + + function foo6_c(x) { + while (1 === 1) { + const x = 1, y = 1; + var v = x; + (function() { return x + y + v }); + (() => x + y + v); + } + + use(v) + } + + function foo7_c(x) { + do { + const x = 1, y = 1; + var v = x; + (function() { return x + y + v }); + (() => x + y + v); + } while (1 === 1); + + use(v); + } + + + function foo8_c(x) { + for (const y = 0; y < 1;) { + ~~~~~ +!!! error TS2365: Operator '<' cannot be applied to types '0' and '1'. + const x = 1; + var v = x; + (function() { return x + y + v }); + (() => x + y + v); + } + + use(v); + } \ No newline at end of file diff --git a/tests/baselines/reference/capturedLetConstInLoop3_ES6.errors.txt b/tests/baselines/reference/capturedLetConstInLoop3_ES6.errors.txt new file mode 100644 index 00000000000..487c47e32a5 --- /dev/null +++ b/tests/baselines/reference/capturedLetConstInLoop3_ES6.errors.txt @@ -0,0 +1,233 @@ +tests/cases/compiler/capturedLetConstInLoop3_ES6.ts(133,23): error TS2365: Operator '<' cannot be applied to types '0' and '1'. +tests/cases/compiler/capturedLetConstInLoop3_ES6.ts(165,23): error TS2365: Operator '<' cannot be applied to types '0' and '1'. +tests/cases/compiler/capturedLetConstInLoop3_ES6.ts(176,30): error TS2365: Operator '<' cannot be applied to types '0' and '1'. +tests/cases/compiler/capturedLetConstInLoop3_ES6.ts(210,23): error TS2365: Operator '<' cannot be applied to types '0' and '1'. + + +==== tests/cases/compiler/capturedLetConstInLoop3_ES6.ts (4 errors) ==== + + ///=========let + declare function use(a: any); + function foo0(x) { + for (let x of []) { + var v = x; + (function() { return x + v }); + (() => x + v); + } + + use(v); + } + + function foo0_1(x) { + for (let x in []) { + var v = x; + (function() { return x + v }); + (() => x + v); + } + + use(v); + } + + function foo1(x) { + for (let x = 0; x < 1; ++x) { + var v = x; + (function() { return x + v }); + (() => x + v); + } + + use(v); + } + + function foo2(x) { + while (1 === 1) { + let x = 1; + var v = x; + (function() { return x + v }); + (() => x + v); + } + + use(v); + } + + function foo3(x) { + do { + let x; + var v; + (function() { return x + v }); + (() => x + v); + } while (1 === 1); + + use(v); + } + + function foo4(x) { + for (let y = 0; y < 1; ++y) { + var v = y; + let x = 1; + (function() { return x + v }); + (() => x + v); + } + + use(v); + } + + function foo5(x) { + for (let x = 0, y = 1; x < 1; ++x) { + var v = x; + (function() { return x + y + v }); + (() => x + y + v); + } + + use(v); + } + + + function foo6(x) { + while (1 === 1) { + let x, y; + var v = x; + (function() { return x + y + v }); + (() => x + y + v); + } + + use(v) + } + + function foo7(x) { + do { + let x, y; + var v = x; + (function() { return x + y + v }); + (() => x + y + v); + } while (1 === 1); + + use(v); + } + + + function foo8(x) { + for (let y = 0; y < 1; ++y) { + let x = 1; + var v = x; + (function() { return x + y + v }); + (() => x + y + v); + } + + use(v); + } + //===const + function foo0_c(x) { + for (const x of []) { + var v = x; + (function() { return x + v }); + (() => x + v); + } + + use(v); + } + + function foo0_1_c(x) { + for (const x in []) { + var v = x; + (function() { return x + v }); + (() => x + v); + } + + use(v); + } + + function foo1_c(x) { + for (const x = 0; x < 1;) { + ~~~~~ +!!! error TS2365: Operator '<' cannot be applied to types '0' and '1'. + var v = x; + (function() { return x + v }); + (() => x + v); + } + + use(v); + } + + function foo2_c(x) { + while (1 === 1) { + const x = 1; + var v = x; + (function() { return x + v }); + (() => x + v); + } + + use(v); + } + + function foo3_c(x) { + do { + const x = 1; + var v; + (function() { return x + v }); + (() => x + v); + } while (1 === 1); + + use(v); + } + + function foo4_c(x) { + for (const y = 0; y < 1;) { + ~~~~~ +!!! error TS2365: Operator '<' cannot be applied to types '0' and '1'. + var v = y; + const x = 1; + (function() { return x + v }); + (() => x + v); + } + + use(v); + } + + function foo5_c(x) { + for (const x = 0, y = 1; x < 1;) { + ~~~~~ +!!! error TS2365: Operator '<' cannot be applied to types '0' and '1'. + var v = x; + (function() { return x + y + v }); + (() => x + y + v); + } + + use(v); + } + + + function foo6_c(x) { + while (1 === 1) { + const x = 1, y = 1; + var v = x; + (function() { return x + y + v }); + (() => x + y + v); + } + + use(v) + } + + function foo7_c(x) { + do { + const x = 1, y = 1; + var v = x; + (function() { return x + y + v }); + (() => x + y + v); + } while (1 === 1); + + use(v); + } + + + function foo8_c(x) { + for (const y = 0; y < 1;) { + ~~~~~ +!!! error TS2365: Operator '<' cannot be applied to types '0' and '1'. + const x = 1; + var v = x; + (function() { return x + y + v }); + (() => x + y + v); + } + + use(v); + } \ No newline at end of file diff --git a/tests/baselines/reference/capturedLetConstInLoop4.errors.txt b/tests/baselines/reference/capturedLetConstInLoop4.errors.txt new file mode 100644 index 00000000000..000286537b8 --- /dev/null +++ b/tests/baselines/reference/capturedLetConstInLoop4.errors.txt @@ -0,0 +1,158 @@ +tests/cases/compiler/capturedLetConstInLoop4.ts(90,19): error TS2365: Operator '<' cannot be applied to types '0' and '1'. +tests/cases/compiler/capturedLetConstInLoop4.ts(110,19): error TS2365: Operator '<' cannot be applied to types '0' and '1'. +tests/cases/compiler/capturedLetConstInLoop4.ts(117,26): error TS2365: Operator '<' cannot be applied to types '0' and '1'. +tests/cases/compiler/capturedLetConstInLoop4.ts(137,19): error TS2365: Operator '<' cannot be applied to types '0' and '1'. + + +==== tests/cases/compiler/capturedLetConstInLoop4.ts (4 errors) ==== + + //======let + export function exportedFoo() { + return v0 + v00 + v1 + v2 + v3 + v4 + v5 + v6 + v7 + v8; + } + + for (let x of []) { + var v0 = x; + (function() { return x + v0}); + (() => x); + } + + for (let x in []) { + var v00 = x; + (function() { return x + v00}); + (() => x); + } + + for (let x = 0; x < 1; ++x) { + var v1 = x; + (function() { return x + v1}); + (() => x); + } + + while (1 === 1) { + let x; + var v2 = x; + (function() { return x + v2}); + (() => x); + } + + do { + let x; + var v3 = x; + (function() { return x + v3}); + (() => x); + } while (1 === 1) + + for (let y = 0; y < 1; ++y) { + let x = 1; + var v4 = x; + (function() { return x + v4}); + (() => x); + } + + for (let x = 0, y = 1; x < 1; ++x) { + var v5 = x; + (function() { return x + y + v5}); + (() => x + y); + } + + while (1 === 1) { + let x, y; + var v6 = x; + (function() { return x + y + v6}); + (() => x + y); + } + + do { + let x, y; + var v7 = x; + (function() { return x + y + v7}); + (() => x + y); + } while (1 === 1) + + for (let y = 0; y < 1; ++y) { + let x = 1; + var v8 = x; + (function() { return x + y + v8}); + (() => x + y); + } + + //======const + export function exportedFoo2() { + return v0_c + v00_c + v1_c + v2_c + v3_c + v4_c + v5_c + v6_c + v7_c + v8_c; + } + + for (const x of []) { + var v0_c = x; + (function() { return x + v0_c}); + (() => x); + } + + for (const x in []) { + var v00_c = x; + (function() { return x + v00}); + (() => x); + } + + for (const x = 0; x < 1;) { + ~~~~~ +!!! error TS2365: Operator '<' cannot be applied to types '0' and '1'. + var v1_c = x; + (function() { return x + v1_c}); + (() => x); + } + + while (1 === 1) { + const x =1; + var v2_c = x; + (function() { return x + v2_c}); + (() => x); + } + + do { + const x = 1; + var v3_c = x; + (function() { return x + v3_c}); + (() => x); + } while (1 === 1) + + for (const y = 0; y < 1;) { + ~~~~~ +!!! error TS2365: Operator '<' cannot be applied to types '0' and '1'. + const x = 1; + var v4_c = x; + (function() { return x + v4_c}); + (() => x); + } + + for (const x = 0, y = 1; x < 1;) { + ~~~~~ +!!! error TS2365: Operator '<' cannot be applied to types '0' and '1'. + var v5_c = x; + (function() { return x + y + v5_c}); + (() => x + y); + } + + while (1 === 1) { + const x = 1, y = 1; + var v6_c = x; + (function() { return x + y + v6_c}); + (() => x + y); + } + + do { + const x = 1, y = 1; + var v7_c = x; + (function() { return x + y + v7_c}); + (() => x + y); + } while (1 === 1) + + for (const y = 0; y < 1;) { + ~~~~~ +!!! error TS2365: Operator '<' cannot be applied to types '0' and '1'. + const x = 1; + var v8_c = x; + (function() { return x + y + v8_c}); + (() => x + y); + } + \ No newline at end of file diff --git a/tests/baselines/reference/capturedLetConstInLoop4_ES6.errors.txt b/tests/baselines/reference/capturedLetConstInLoop4_ES6.errors.txt new file mode 100644 index 00000000000..a83bb1d414f --- /dev/null +++ b/tests/baselines/reference/capturedLetConstInLoop4_ES6.errors.txt @@ -0,0 +1,158 @@ +tests/cases/compiler/capturedLetConstInLoop4_ES6.ts(90,19): error TS2365: Operator '<' cannot be applied to types '0' and '1'. +tests/cases/compiler/capturedLetConstInLoop4_ES6.ts(110,19): error TS2365: Operator '<' cannot be applied to types '0' and '1'. +tests/cases/compiler/capturedLetConstInLoop4_ES6.ts(117,26): error TS2365: Operator '<' cannot be applied to types '0' and '1'. +tests/cases/compiler/capturedLetConstInLoop4_ES6.ts(137,19): error TS2365: Operator '<' cannot be applied to types '0' and '1'. + + +==== tests/cases/compiler/capturedLetConstInLoop4_ES6.ts (4 errors) ==== + + //======let + export function exportedFoo() { + return v0 + v00 + v1 + v2 + v3 + v4 + v5 + v6 + v7 + v8; + } + + for (let x of []) { + var v0 = x; + (function() { return x + v0}); + (() => x); + } + + for (let x in []) { + var v00 = x; + (function() { return x + v00}); + (() => x); + } + + for (let x = 0; x < 1; ++x) { + var v1 = x; + (function() { return x + v1}); + (() => x); + } + + while (1 === 1) { + let x; + var v2 = x; + (function() { return x + v2}); + (() => x); + } + + do { + let x; + var v3 = x; + (function() { return x + v3}); + (() => x); + } while (1 === 1) + + for (let y = 0; y < 1; ++y) { + let x = 1; + var v4 = x; + (function() { return x + v4}); + (() => x); + } + + for (let x = 0, y = 1; x < 1; ++x) { + var v5 = x; + (function() { return x + y + v5}); + (() => x + y); + } + + while (1 === 1) { + let x, y; + var v6 = x; + (function() { return x + y + v6}); + (() => x + y); + } + + do { + let x, y; + var v7 = x; + (function() { return x + y + v7}); + (() => x + y); + } while (1 === 1) + + for (let y = 0; y < 1; ++y) { + let x = 1; + var v8 = x; + (function() { return x + y + v8}); + (() => x + y); + } + + //======const + export function exportedFoo2() { + return v0_c + v00_c + v1_c + v2_c + v3_c + v4_c + v5_c + v6_c + v7_c + v8_c; + } + + for (const x of []) { + var v0_c = x; + (function() { return x + v0_c}); + (() => x); + } + + for (const x in []) { + var v00_c = x; + (function() { return x + v00}); + (() => x); + } + + for (const x = 0; x < 1;) { + ~~~~~ +!!! error TS2365: Operator '<' cannot be applied to types '0' and '1'. + var v1_c = x; + (function() { return x + v1_c}); + (() => x); + } + + while (1 === 1) { + const x =1; + var v2_c = x; + (function() { return x + v2_c}); + (() => x); + } + + do { + const x = 1; + var v3_c = x; + (function() { return x + v3_c}); + (() => x); + } while (1 === 1) + + for (const y = 0; y < 1;) { + ~~~~~ +!!! error TS2365: Operator '<' cannot be applied to types '0' and '1'. + const x = 1; + var v4_c = x; + (function() { return x + v4_c}); + (() => x); + } + + for (const x = 0, y = 1; x < 1;) { + ~~~~~ +!!! error TS2365: Operator '<' cannot be applied to types '0' and '1'. + var v5_c = x; + (function() { return x + y + v5_c}); + (() => x + y); + } + + while (1 === 1) { + const x = 1, y = 1; + var v6_c = x; + (function() { return x + y + v6_c}); + (() => x + y); + } + + do { + const x = 1, y = 1; + var v7_c = x; + (function() { return x + y + v7_c}); + (() => x + y); + } while (1 === 1) + + for (const y = 0; y < 1;) { + ~~~~~ +!!! error TS2365: Operator '<' cannot be applied to types '0' and '1'. + const x = 1; + var v8_c = x; + (function() { return x + y + v8_c}); + (() => x + y); + } + \ No newline at end of file diff --git a/tests/baselines/reference/capturedLetConstInLoop5.errors.txt b/tests/baselines/reference/capturedLetConstInLoop5.errors.txt new file mode 100644 index 00000000000..b182d8347de --- /dev/null +++ b/tests/baselines/reference/capturedLetConstInLoop5.errors.txt @@ -0,0 +1,300 @@ +tests/cases/compiler/capturedLetConstInLoop5.ts(170,23): error TS2365: Operator '<' cannot be applied to types '0' and '1'. +tests/cases/compiler/capturedLetConstInLoop5.ts(174,13): error TS2365: Operator '==' cannot be applied to types '0' and '1'. +tests/cases/compiler/capturedLetConstInLoop5.ts(211,23): error TS2365: Operator '<' cannot be applied to types '0' and '1'. +tests/cases/compiler/capturedLetConstInLoop5.ts(225,30): error TS2365: Operator '<' cannot be applied to types '0' and '1'. +tests/cases/compiler/capturedLetConstInLoop5.ts(229,13): error TS2365: Operator '==' cannot be applied to types '0' and '1'. +tests/cases/compiler/capturedLetConstInLoop5.ts(268,23): error TS2365: Operator '<' cannot be applied to types '0' and '1'. + + +==== tests/cases/compiler/capturedLetConstInLoop5.ts (6 errors) ==== + declare function use(a: any); + + //====let + function foo0(x) { + for (let x of []) { + var v = x; + (function() { return x + v }); + (() => x + v); + if (x == 1) { + return; + } + } + + use(v); + } + + function foo00(x) { + for (let x in []) { + var v = x; + (function() { return x + v }); + (() => x + v); + if (x == "1") { + return; + } + } + + use(v); + } + + function foo1(x) { + for (let x = 0; x < 1; ++x) { + var v = x; + (function() { return x + v }); + (() => x + v); + if (x == 1) { + return; + } + } + + use(v); + } + + function foo2(x) { + while (1 === 1) { + let x = 1; + var v = x; + (function() { return x + v }); + (() => x + v); + if (x == 1) { + return; + } + } + + use(v); + } + + function foo3(x) { + do { + let x; + var v; + (function() { return x + v }); + (() => x + v); + if (x == 1) { + return; + } + } while (1 === 1) + + use(v); + } + + function foo4(x) { + for (let y = 0; y < 1; ++y) { + var v = y; + let x = 1; + (function() { return x + v }); + (() => x + v); + if (x == 1) { + return; + } + } + + use(v); + } + + function foo5(x) { + for (let x = 0, y = 1; x < 1; ++x) { + var v = x; + (function() { return x + y + v }); + (() => x + y + v); + if (x == 1) { + return; + } + } + + use(v); + } + + + function foo6(x) { + while (1 === 1) { + let x, y; + var v = x; + (function() { return x + y + v }); + (() => x + y + v); + if (x == 1) { + return; + } + }; + + use(v) + } + + function foo7(x) { + do { + let x, y; + var v = x; + (function() { return x + y + v }); + (() => x + y + v); + if (x == 1) { + return; + } + } while (1 === 1); + + use(v); + } + + + function foo8(x) { + for (let y = 0; y < 1; ++y) { + let x = 1; + var v = x; + (function() { return x + y + v }); + (() => x + y + v); + if (x == 1) { + return; + } + } + + use(v); + } + + //====const + function foo0_c(x) { + for (const x of []) { + var v = x; + (function() { return x + v }); + (() => x + v); + if (x == 1) { + return; + } + } + + use(v); + } + + function foo00_c(x) { + for (const x in []) { + var v = x; + (function() { return x + v }); + (() => x + v); + if (x == "1") { + return; + } + } + + use(v); + } + + function foo1_c(x) { + for (const x = 0; x < 1;) { + ~~~~~ +!!! error TS2365: Operator '<' cannot be applied to types '0' and '1'. + var v = x; + (function() { return x + v }); + (() => x + v); + if (x == 1) { + ~~~~~~ +!!! error TS2365: Operator '==' cannot be applied to types '0' and '1'. + return; + } + } + + use(v); + } + + function foo2_c(x) { + while (1 === 1) { + const x = 1; + var v = x; + (function() { return x + v }); + (() => x + v); + if (x == 1) { + return; + } + } + + use(v); + } + + function foo3_c(x) { + do { + const x = 1; + var v; + (function() { return x + v }); + (() => x + v); + if (x == 1) { + return; + } + } while (1 === 1) + + use(v); + } + + function foo4_c(x) { + for (const y = 0; y < 1;) { + ~~~~~ +!!! error TS2365: Operator '<' cannot be applied to types '0' and '1'. + var v = y; + let x = 1; + (function() { return x + v }); + (() => x + v); + if (x == 1) { + return; + } + } + + use(v); + } + + function foo5_c(x) { + for (const x = 0, y = 1; x < 1;) { + ~~~~~ +!!! error TS2365: Operator '<' cannot be applied to types '0' and '1'. + var v = x; + (function() { return x + y + v }); + (() => x + y + v); + if (x == 1) { + ~~~~~~ +!!! error TS2365: Operator '==' cannot be applied to types '0' and '1'. + return; + } + } + + use(v); + } + + + function foo6_c(x) { + while (1 === 1) { + const x = 1, y = 1; + var v = x; + (function() { return x + y + v }); + (() => x + y + v); + if (x == 1) { + return; + } + } + + use(v) + } + + function foo7_c(x) { + do { + const x = 1, y = 1; + var v = x; + (function() { return x + y + v }); + (() => x + y + v); + if (x == 1) { + return; + } + } while (1 === 1) + + use(v); + } + + + function foo8_c(x) { + for (const y = 0; y < 1;) { + ~~~~~ +!!! error TS2365: Operator '<' cannot be applied to types '0' and '1'. + const x = 1; + var v = x; + (function() { return x + y + v }); + (() => x + y + v); + if (x == 1) { + return; + } + } + + use(v); + } \ No newline at end of file diff --git a/tests/baselines/reference/capturedLetConstInLoop5_ES6.errors.txt b/tests/baselines/reference/capturedLetConstInLoop5_ES6.errors.txt new file mode 100644 index 00000000000..05eb0626e2d --- /dev/null +++ b/tests/baselines/reference/capturedLetConstInLoop5_ES6.errors.txt @@ -0,0 +1,301 @@ +tests/cases/compiler/capturedLetConstInLoop5_ES6.ts(171,23): error TS2365: Operator '<' cannot be applied to types '0' and '1'. +tests/cases/compiler/capturedLetConstInLoop5_ES6.ts(175,13): error TS2365: Operator '==' cannot be applied to types '0' and '1'. +tests/cases/compiler/capturedLetConstInLoop5_ES6.ts(212,23): error TS2365: Operator '<' cannot be applied to types '0' and '1'. +tests/cases/compiler/capturedLetConstInLoop5_ES6.ts(226,30): error TS2365: Operator '<' cannot be applied to types '0' and '1'. +tests/cases/compiler/capturedLetConstInLoop5_ES6.ts(230,13): error TS2365: Operator '==' cannot be applied to types '0' and '1'. +tests/cases/compiler/capturedLetConstInLoop5_ES6.ts(269,23): error TS2365: Operator '<' cannot be applied to types '0' and '1'. + + +==== tests/cases/compiler/capturedLetConstInLoop5_ES6.ts (6 errors) ==== + + declare function use(a: any); + + //====let + function foo0(x) { + for (let x of []) { + var v = x; + (function() { return x + v }); + (() => x + v); + if (x == 1) { + return; + } + } + + use(v); + } + + function foo00(x) { + for (let x in []) { + var v = x; + (function() { return x + v }); + (() => x + v); + if (x == "1") { + return; + } + } + + use(v); + } + + function foo1(x) { + for (let x = 0; x < 1; ++x) { + var v = x; + (function() { return x + v }); + (() => x + v); + if (x == 1) { + return; + } + } + + use(v); + } + + function foo2(x) { + while (1 === 1) { + let x = 1; + var v = x; + (function() { return x + v }); + (() => x + v); + if (x == 1) { + return; + } + } + + use(v); + } + + function foo3(x) { + do { + let x; + var v; + (function() { return x + v }); + (() => x + v); + if (x == 1) { + return; + } + } while (1 === 1) + + use(v); + } + + function foo4(x) { + for (let y = 0; y < 1; ++y) { + var v = y; + let x = 1; + (function() { return x + v }); + (() => x + v); + if (x == 1) { + return; + } + } + + use(v); + } + + function foo5(x) { + for (let x = 0, y = 1; x < 1; ++x) { + var v = x; + (function() { return x + y + v }); + (() => x + y + v); + if (x == 1) { + return; + } + } + + use(v); + } + + + function foo6(x) { + while (1 === 1) { + let x, y; + var v = x; + (function() { return x + y + v }); + (() => x + y + v); + if (x == 1) { + return; + } + }; + + use(v) + } + + function foo7(x) { + do { + let x, y; + var v = x; + (function() { return x + y + v }); + (() => x + y + v); + if (x == 1) { + return; + } + } while (1 === 1); + + use(v); + } + + + function foo8(x) { + for (let y = 0; y < 1; ++y) { + let x = 1; + var v = x; + (function() { return x + y + v }); + (() => x + y + v); + if (x == 1) { + return; + } + } + + use(v); + } + + //====const + function foo0_c(x) { + for (const x of []) { + var v = x; + (function() { return x + v }); + (() => x + v); + if (x == 1) { + return; + } + } + + use(v); + } + + function foo00_c(x) { + for (const x in []) { + var v = x; + (function() { return x + v }); + (() => x + v); + if (x == "1") { + return; + } + } + + use(v); + } + + function foo1_c(x) { + for (const x = 0; x < 1;) { + ~~~~~ +!!! error TS2365: Operator '<' cannot be applied to types '0' and '1'. + var v = x; + (function() { return x + v }); + (() => x + v); + if (x == 1) { + ~~~~~~ +!!! error TS2365: Operator '==' cannot be applied to types '0' and '1'. + return; + } + } + + use(v); + } + + function foo2_c(x) { + while (1 === 1) { + const x = 1; + var v = x; + (function() { return x + v }); + (() => x + v); + if (x == 1) { + return; + } + } + + use(v); + } + + function foo3_c(x) { + do { + const x = 1; + var v; + (function() { return x + v }); + (() => x + v); + if (x == 1) { + return; + } + } while (1 === 1) + + use(v); + } + + function foo4_c(x) { + for (const y = 0; y < 1;) { + ~~~~~ +!!! error TS2365: Operator '<' cannot be applied to types '0' and '1'. + var v = y; + let x = 1; + (function() { return x + v }); + (() => x + v); + if (x == 1) { + return; + } + } + + use(v); + } + + function foo5_c(x) { + for (const x = 0, y = 1; x < 1;) { + ~~~~~ +!!! error TS2365: Operator '<' cannot be applied to types '0' and '1'. + var v = x; + (function() { return x + y + v }); + (() => x + y + v); + if (x == 1) { + ~~~~~~ +!!! error TS2365: Operator '==' cannot be applied to types '0' and '1'. + return; + } + } + + use(v); + } + + + function foo6_c(x) { + while (1 === 1) { + const x = 1, y = 1; + var v = x; + (function() { return x + y + v }); + (() => x + y + v); + if (x == 1) { + return; + } + } + + use(v) + } + + function foo7_c(x) { + do { + const x = 1, y = 1; + var v = x; + (function() { return x + y + v }); + (() => x + y + v); + if (x == 1) { + return; + } + } while (1 === 1) + + use(v); + } + + + function foo8_c(x) { + for (const y = 0; y < 1;) { + ~~~~~ +!!! error TS2365: Operator '<' cannot be applied to types '0' and '1'. + const x = 1; + var v = x; + (function() { return x + y + v }); + (() => x + y + v); + if (x == 1) { + return; + } + } + + use(v); + } \ No newline at end of file diff --git a/tests/baselines/reference/capturedLetConstInLoop6.errors.txt b/tests/baselines/reference/capturedLetConstInLoop6.errors.txt new file mode 100644 index 00000000000..c332c5b7323 --- /dev/null +++ b/tests/baselines/reference/capturedLetConstInLoop6.errors.txt @@ -0,0 +1,265 @@ +tests/cases/compiler/capturedLetConstInLoop6.ts(144,19): error TS2365: Operator '<' cannot be applied to types '0' and '1'. +tests/cases/compiler/capturedLetConstInLoop6.ts(147,9): error TS2365: Operator '==' cannot be applied to types '0' and '1'. +tests/cases/compiler/capturedLetConstInLoop6.ts(150,9): error TS2365: Operator '==' cannot be applied to types '0' and '2'. +tests/cases/compiler/capturedLetConstInLoop6.ts(179,19): error TS2365: Operator '<' cannot be applied to types '0' and '1'. +tests/cases/compiler/capturedLetConstInLoop6.ts(191,26): error TS2365: Operator '<' cannot be applied to types '0' and '1'. +tests/cases/compiler/capturedLetConstInLoop6.ts(194,9): error TS2365: Operator '==' cannot be applied to types '0' and '1'. +tests/cases/compiler/capturedLetConstInLoop6.ts(197,9): error TS2365: Operator '==' cannot be applied to types '0' and '2'. +tests/cases/compiler/capturedLetConstInLoop6.ts(226,19): error TS2365: Operator '<' cannot be applied to types '0' and '1'. + + +==== tests/cases/compiler/capturedLetConstInLoop6.ts (8 errors) ==== + // ====let + for (let x of []) { + (function() { return x}); + (() => x); + if (x == 1) { + break; + } + if (x == 2) { + continue; + } + } + + for (let x in []) { + (function() { return x}); + (() => x); + if (x == "1") { + break; + } + if (x == "2") { + continue; + } + } + + + for (let x = 0; x < 1; ++x) { + (function() { return x}); + (() => x); + if (x == 1) { + break; + } + if (x == 2) { + continue; + } + } + + while (1 === 1) { + let x; + (function() { return x}); + (() => x); + if (x == 1) { + break; + } + if (x == 2) { + continue; + } + } + + do { + let x; + (function() { return x}); + (() => x); + if (x == 1) { + break; + } + if (x == 2) { + continue; + } + } while (1 === 1) + + for (let y = 0; y < 1; ++y) { + let x = 1; + (function() { return x}); + (() => x); + if (x == 1) { + break; + } + if (x == 2) { + continue; + } + } + + for (let x = 0, y = 1; x < 1; ++x) { + (function() { return x + y}); + (() => x + y); + if (x == 1) { + break; + } + if (x == 2) { + continue; + } + } + + while (1 === 1) { + let x, y; + (function() { return x + y}); + (() => x + y); + if (x == 1) { + break; + } + if (x == 2) { + continue; + } + } + + do { + let x, y; + (function() { return x + y}); + (() => x + y); + if (x == 1) { + break; + } + if (x == 2) { + continue; + } + } while (1 === 1) + + for (let y = 0; y < 1; ++y) { + let x = 1; + (function() { return x + y}); + (() => x + y); + if (x == 1) { + break; + } + if (x == 2) { + continue; + } + } + + // ====const + + for (const x of []) { + (function() { return x}); + (() => x); + if (x == 1) { + break; + } + if (x == 2) { + continue; + } + } + + for (const x in []) { + (function() { return x}); + (() => x); + if (x == "1") { + break; + } + if (x == "2") { + continue; + } + } + + + for (const x = 0; x < 1;) { + ~~~~~ +!!! error TS2365: Operator '<' cannot be applied to types '0' and '1'. + (function() { return x}); + (() => x); + if (x == 1) { + ~~~~~~ +!!! error TS2365: Operator '==' cannot be applied to types '0' and '1'. + break; + } + if (x == 2) { + ~~~~~~ +!!! error TS2365: Operator '==' cannot be applied to types '0' and '2'. + continue; + } + } + + while (1 === 1) { + const x = 1; + (function() { return x}); + (() => x); + if (x == 1) { + break; + } + if (x == 2) { + continue; + } + } + + do { + const x = 1; + (function() { return x}); + (() => x); + if (x == 1) { + break; + } + if (x == 2) { + continue; + } + } while (1 === 1) + + for (const y = 0; y < 1;) { + ~~~~~ +!!! error TS2365: Operator '<' cannot be applied to types '0' and '1'. + const x = 1; + (function() { return x}); + (() => x); + if (x == 1) { + break; + } + if (x == 2) { + continue; + } + } + + for (const x = 0, y = 1; x < 1;) { + ~~~~~ +!!! error TS2365: Operator '<' cannot be applied to types '0' and '1'. + (function() { return x + y}); + (() => x + y); + if (x == 1) { + ~~~~~~ +!!! error TS2365: Operator '==' cannot be applied to types '0' and '1'. + break; + } + if (x == 2) { + ~~~~~~ +!!! error TS2365: Operator '==' cannot be applied to types '0' and '2'. + continue; + } + } + + while (1 === 1) { + const x = 1, y = 1; + (function() { return x + y}); + (() => x + y); + if (x == 1) { + break; + } + if (x == 2) { + continue; + } + } + + do { + const x = 1, y = 1; + (function() { return x + y}); + (() => x + y); + if (x == 1) { + break; + } + if (x == 2) { + continue; + } + } while (1 === 1) + + for (const y = 0; y < 1;) { + ~~~~~ +!!! error TS2365: Operator '<' cannot be applied to types '0' and '1'. + const x = 1; + (function() { return x + y}); + (() => x + y); + if (x == 1) { + break; + } + if (x == 2) { + continue; + } + } + + \ No newline at end of file diff --git a/tests/baselines/reference/capturedLetConstInLoop6_ES6.errors.txt b/tests/baselines/reference/capturedLetConstInLoop6_ES6.errors.txt new file mode 100644 index 00000000000..18ecfe7c666 --- /dev/null +++ b/tests/baselines/reference/capturedLetConstInLoop6_ES6.errors.txt @@ -0,0 +1,265 @@ +tests/cases/compiler/capturedLetConstInLoop6_ES6.ts(144,19): error TS2365: Operator '<' cannot be applied to types '0' and '1'. +tests/cases/compiler/capturedLetConstInLoop6_ES6.ts(147,9): error TS2365: Operator '==' cannot be applied to types '0' and '1'. +tests/cases/compiler/capturedLetConstInLoop6_ES6.ts(150,9): error TS2365: Operator '==' cannot be applied to types '0' and '2'. +tests/cases/compiler/capturedLetConstInLoop6_ES6.ts(179,19): error TS2365: Operator '<' cannot be applied to types '0' and '1'. +tests/cases/compiler/capturedLetConstInLoop6_ES6.ts(191,26): error TS2365: Operator '<' cannot be applied to types '0' and '1'. +tests/cases/compiler/capturedLetConstInLoop6_ES6.ts(194,9): error TS2365: Operator '==' cannot be applied to types '0' and '1'. +tests/cases/compiler/capturedLetConstInLoop6_ES6.ts(197,9): error TS2365: Operator '==' cannot be applied to types '0' and '2'. +tests/cases/compiler/capturedLetConstInLoop6_ES6.ts(226,19): error TS2365: Operator '<' cannot be applied to types '0' and '1'. + + +==== tests/cases/compiler/capturedLetConstInLoop6_ES6.ts (8 errors) ==== + // ====let + for (let x of []) { + (function() { return x}); + (() => x); + if (x == 1) { + break; + } + if (x == 2) { + continue; + } + } + + for (let x in []) { + (function() { return x}); + (() => x); + if (x == "1") { + break; + } + if (x == "2") { + continue; + } + } + + + for (let x = 0; x < 1; ++x) { + (function() { return x}); + (() => x); + if (x == 1) { + break; + } + if (x == 2) { + continue; + } + } + + while (1 === 1) { + let x; + (function() { return x}); + (() => x); + if (x == 1) { + break; + } + if (x == 2) { + continue; + } + } + + do { + let x; + (function() { return x}); + (() => x); + if (x == 1) { + break; + } + if (x == 2) { + continue; + } + } while (1 === 1) + + for (let y = 0; y < 1; ++y) { + let x = 1; + (function() { return x}); + (() => x); + if (x == 1) { + break; + } + if (x == 2) { + continue; + } + } + + for (let x = 0, y = 1; x < 1; ++x) { + (function() { return x + y}); + (() => x + y); + if (x == 1) { + break; + } + if (x == 2) { + continue; + } + } + + while (1 === 1) { + let x, y; + (function() { return x + y}); + (() => x + y); + if (x == 1) { + break; + } + if (x == 2) { + continue; + } + } + + do { + let x, y; + (function() { return x + y}); + (() => x + y); + if (x == 1) { + break; + } + if (x == 2) { + continue; + } + } while (1 === 1) + + for (let y = 0; y < 1; ++y) { + let x = 1; + (function() { return x + y}); + (() => x + y); + if (x == 1) { + break; + } + if (x == 2) { + continue; + } + } + + // ====const + + for (const x of []) { + (function() { return x}); + (() => x); + if (x == 1) { + break; + } + if (x == 2) { + continue; + } + } + + for (const x in []) { + (function() { return x}); + (() => x); + if (x == "1") { + break; + } + if (x == "2") { + continue; + } + } + + + for (const x = 0; x < 1;) { + ~~~~~ +!!! error TS2365: Operator '<' cannot be applied to types '0' and '1'. + (function() { return x}); + (() => x); + if (x == 1) { + ~~~~~~ +!!! error TS2365: Operator '==' cannot be applied to types '0' and '1'. + break; + } + if (x == 2) { + ~~~~~~ +!!! error TS2365: Operator '==' cannot be applied to types '0' and '2'. + continue; + } + } + + while (1 === 1) { + const x = 1; + (function() { return x}); + (() => x); + if (x == 1) { + break; + } + if (x == 2) { + continue; + } + } + + do { + const x = 1; + (function() { return x}); + (() => x); + if (x == 1) { + break; + } + if (x == 2) { + continue; + } + } while (1 === 1) + + for (const y = 0; y < 1;) { + ~~~~~ +!!! error TS2365: Operator '<' cannot be applied to types '0' and '1'. + const x = 1; + (function() { return x}); + (() => x); + if (x == 1) { + break; + } + if (x == 2) { + continue; + } + } + + for (const x = 0, y = 1; x < 1;) { + ~~~~~ +!!! error TS2365: Operator '<' cannot be applied to types '0' and '1'. + (function() { return x + y}); + (() => x + y); + if (x == 1) { + ~~~~~~ +!!! error TS2365: Operator '==' cannot be applied to types '0' and '1'. + break; + } + if (x == 2) { + ~~~~~~ +!!! error TS2365: Operator '==' cannot be applied to types '0' and '2'. + continue; + } + } + + while (1 === 1) { + const x = 1, y = 1; + (function() { return x + y}); + (() => x + y); + if (x == 1) { + break; + } + if (x == 2) { + continue; + } + } + + do { + const x = 1, y = 1; + (function() { return x + y}); + (() => x + y); + if (x == 1) { + break; + } + if (x == 2) { + continue; + } + } while (1 === 1) + + for (const y = 0; y < 1;) { + ~~~~~ +!!! error TS2365: Operator '<' cannot be applied to types '0' and '1'. + const x = 1; + (function() { return x + y}); + (() => x + y); + if (x == 1) { + break; + } + if (x == 2) { + continue; + } + } + + \ No newline at end of file diff --git a/tests/baselines/reference/capturedLetConstInLoop7.errors.txt b/tests/baselines/reference/capturedLetConstInLoop7.errors.txt new file mode 100644 index 00000000000..29e6fbca6cd --- /dev/null +++ b/tests/baselines/reference/capturedLetConstInLoop7.errors.txt @@ -0,0 +1,414 @@ +tests/cases/compiler/capturedLetConstInLoop7.ts(227,19): error TS2365: Operator '<' cannot be applied to types '0' and '1'. +tests/cases/compiler/capturedLetConstInLoop7.ts(230,9): error TS2365: Operator '==' cannot be applied to types '0' and '1'. +tests/cases/compiler/capturedLetConstInLoop7.ts(233,9): error TS2365: Operator '==' cannot be applied to types '0' and '1'. +tests/cases/compiler/capturedLetConstInLoop7.ts(236,9): error TS2365: Operator '==' cannot be applied to types '0' and '2'. +tests/cases/compiler/capturedLetConstInLoop7.ts(239,9): error TS2365: Operator '==' cannot be applied to types '0' and '2'. +tests/cases/compiler/capturedLetConstInLoop7.ts(283,19): error TS2365: Operator '<' cannot be applied to types '0' and '1'. +tests/cases/compiler/capturedLetConstInLoop7.ts(302,26): error TS2365: Operator '<' cannot be applied to types '0' and '1'. +tests/cases/compiler/capturedLetConstInLoop7.ts(305,9): error TS2365: Operator '==' cannot be applied to types '0' and '1'. +tests/cases/compiler/capturedLetConstInLoop7.ts(308,9): error TS2365: Operator '==' cannot be applied to types '0' and '1'. +tests/cases/compiler/capturedLetConstInLoop7.ts(311,9): error TS2365: Operator '==' cannot be applied to types '0' and '2'. +tests/cases/compiler/capturedLetConstInLoop7.ts(314,9): error TS2365: Operator '==' cannot be applied to types '0' and '2'. +tests/cases/compiler/capturedLetConstInLoop7.ts(359,19): error TS2365: Operator '<' cannot be applied to types '0' and '1'. + + +==== tests/cases/compiler/capturedLetConstInLoop7.ts (12 errors) ==== + //===let + l0: + for (let x of []) { + (function() { return x}); + (() => x); + if (x == 1) { + break; + } + if (x == 1) { + break l0; + } + if (x == 2) { + continue; + } + if (x == 2) { + continue l0; + } + } + + l00: + for (let x in []) { + (function() { return x}); + (() => x); + if (x == "1") { + break; + } + if (x == "1") { + break l00; + } + if (x == "2") { + continue; + } + if (x == "2") { + continue l00; + } + } + + l1: + for (let x = 0; x < 1; ++x) { + (function() { return x}); + (() => x); + if (x == 1) { + break; + } + if (x == 1) { + break l1; + } + if (x == 2) { + continue; + } + if (x == 2) { + continue l1; + } + } + + l2: + while (1 === 1) { + let x; + (function() { return x}); + (() => x); + if (x == 1) { + break; + } + if (x == 1) { + break l2; + } + if (x == 2) { + continue; + } + if (x == 2) { + continue l2; + } + } + + l3: + do { + let x; + (function() { return x}); + (() => x); + if (x == 1) { + break; + } + if (x == 1) { + break l3; + } + if (x == 2) { + continue; + } + if (x == 2) { + continue l3; + } + } while (1 === 1) + + l4: + for (let y = 0; y < 1; ++y) { + let x = 1; + (function() { return x}); + (() => x); + if (x == 1) { + break; + } + if (x == 1) { + break l4; + } + if (x == 2) { + continue; + } + if (x == 2) { + continue l4; + } + } + + l5: + for (let x = 0, y = 1; x < 1; ++x) { + (function() { return x + y}); + (() => x + y); + if (x == 1) { + break; + } + if (x == 1) { + break l5; + } + if (x == 2) { + continue; + } + if (x == 2) { + continue l5; + } + } + + l6: + while (1 === 1) { + let x, y; + (function() { return x + y}); + (() => x + y); + if (x == 1) { + break; + } + if (x == 1) { + break l6; + } + if (x == 2) { + continue; + } + if (x == 2) { + continue l6; + } + + } + + l7: + do { + let x, y; + (function() { return x + y}); + (() => x + y); + if (x == 1) { + break; + } + if (x == 1) { + break l7; + } + if (x == 2) { + continue; + } + if (x == 2) { + continue l7; + } + } while (1 === 1) + + l8: + for (let y = 0; y < 1; ++y) { + let x = 1; + (function() { return x + y}); + (() => x + y); + if (x == 1) { + break; + } + if (x == 1) { + break l8; + } + if (x == 2) { + continue; + } + if (x == 2) { + continue l8; + } + } + + //===const + l0_c: + for (const x of []) { + (function() { return x}); + (() => x); + if (x == 1) { + break; + } + if (x == 1) { + break l0_c; + } + if (x == 2) { + continue; + } + if (x == 2) { + continue l0_c; + } + } + + l00_c: + for (const x in []) { + (function() { return x}); + (() => x); + if (x == "1") { + break; + } + if (x == "1") { + break l00_c; + } + if (x == "2") { + continue; + } + if (x == "2") { + continue l00_c; + } + } + + l1_c: + for (const x = 0; x < 1;) { + ~~~~~ +!!! error TS2365: Operator '<' cannot be applied to types '0' and '1'. + (function() { return x}); + (() => x); + if (x == 1) { + ~~~~~~ +!!! error TS2365: Operator '==' cannot be applied to types '0' and '1'. + break; + } + if (x == 1) { + ~~~~~~ +!!! error TS2365: Operator '==' cannot be applied to types '0' and '1'. + break l1_c; + } + if (x == 2) { + ~~~~~~ +!!! error TS2365: Operator '==' cannot be applied to types '0' and '2'. + continue; + } + if (x == 2) { + ~~~~~~ +!!! error TS2365: Operator '==' cannot be applied to types '0' and '2'. + continue l1_c; + } + } + + l2_c: + while (1 === 1) { + const x = 1; + (function() { return x}); + (() => x); + if (x == 1) { + break; + } + if (x == 1) { + break l2_c; + } + if (x == 2) { + continue; + } + if (x == 2) { + continue l2_c; + } + } + + l3_c: + do { + const x = 1; + (function() { return x}); + (() => x); + if (x == 1) { + break; + } + if (x == 1) { + break l3_c; + } + if (x == 2) { + continue; + } + if (x == 2) { + continue l3_c; + } + } while (1 === 1) + + l4_c: + for (const y = 0; y < 1;) { + ~~~~~ +!!! error TS2365: Operator '<' cannot be applied to types '0' and '1'. + const x = 1; + (function() { return x}); + (() => x); + if (x == 1) { + break; + } + if (x == 1) { + break l4_c; + } + if (x == 2) { + continue; + } + if (x == 2) { + continue l4_c; + } + } + + l5_c: + for (const x = 0, y = 1; x < 1;) { + ~~~~~ +!!! error TS2365: Operator '<' cannot be applied to types '0' and '1'. + (function() { return x + y}); + (() => x + y); + if (x == 1) { + ~~~~~~ +!!! error TS2365: Operator '==' cannot be applied to types '0' and '1'. + break; + } + if (x == 1) { + ~~~~~~ +!!! error TS2365: Operator '==' cannot be applied to types '0' and '1'. + break l5_c; + } + if (x == 2) { + ~~~~~~ +!!! error TS2365: Operator '==' cannot be applied to types '0' and '2'. + continue; + } + if (x == 2) { + ~~~~~~ +!!! error TS2365: Operator '==' cannot be applied to types '0' and '2'. + continue l5_c; + } + } + + l6_c: + while (1 === 1) { + const x = 1, y = 1; + (function() { return x + y}); + (() => x + y); + if (x == 1) { + break; + } + if (x == 1) { + break l6_c; + } + if (x == 2) { + continue; + } + if (x == 2) { + continue l6_c; + } + + } + + l7_c: + do { + const x = 1, y = 1; + (function() { return x + y}); + (() => x + y); + if (x == 1) { + break; + } + if (x == 1) { + break l7_c; + } + if (x == 2) { + continue; + } + if (x == 2) { + continue l7_c; + } + } while (1 === 1) + + l8_c: + for (const y = 0; y < 1;) { + ~~~~~ +!!! error TS2365: Operator '<' cannot be applied to types '0' and '1'. + const x = 1; + (function() { return x + y}); + (() => x + y); + if (x == 1) { + break; + } + if (x == 1) { + break l8_c; + } + if (x == 2) { + continue; + } + if (x == 2) { + continue l8_c; + } + } \ No newline at end of file diff --git a/tests/baselines/reference/capturedLetConstInLoop7_ES6.errors.txt b/tests/baselines/reference/capturedLetConstInLoop7_ES6.errors.txt new file mode 100644 index 00000000000..a2001dc09b3 --- /dev/null +++ b/tests/baselines/reference/capturedLetConstInLoop7_ES6.errors.txt @@ -0,0 +1,414 @@ +tests/cases/compiler/capturedLetConstInLoop7_ES6.ts(227,19): error TS2365: Operator '<' cannot be applied to types '0' and '1'. +tests/cases/compiler/capturedLetConstInLoop7_ES6.ts(230,9): error TS2365: Operator '==' cannot be applied to types '0' and '1'. +tests/cases/compiler/capturedLetConstInLoop7_ES6.ts(233,9): error TS2365: Operator '==' cannot be applied to types '0' and '1'. +tests/cases/compiler/capturedLetConstInLoop7_ES6.ts(236,9): error TS2365: Operator '==' cannot be applied to types '0' and '2'. +tests/cases/compiler/capturedLetConstInLoop7_ES6.ts(239,9): error TS2365: Operator '==' cannot be applied to types '0' and '2'. +tests/cases/compiler/capturedLetConstInLoop7_ES6.ts(283,19): error TS2365: Operator '<' cannot be applied to types '0' and '1'. +tests/cases/compiler/capturedLetConstInLoop7_ES6.ts(302,26): error TS2365: Operator '<' cannot be applied to types '0' and '1'. +tests/cases/compiler/capturedLetConstInLoop7_ES6.ts(305,9): error TS2365: Operator '==' cannot be applied to types '0' and '1'. +tests/cases/compiler/capturedLetConstInLoop7_ES6.ts(308,9): error TS2365: Operator '==' cannot be applied to types '0' and '1'. +tests/cases/compiler/capturedLetConstInLoop7_ES6.ts(311,9): error TS2365: Operator '==' cannot be applied to types '0' and '2'. +tests/cases/compiler/capturedLetConstInLoop7_ES6.ts(314,9): error TS2365: Operator '==' cannot be applied to types '0' and '2'. +tests/cases/compiler/capturedLetConstInLoop7_ES6.ts(359,19): error TS2365: Operator '<' cannot be applied to types '0' and '1'. + + +==== tests/cases/compiler/capturedLetConstInLoop7_ES6.ts (12 errors) ==== + //===let + l0: + for (let x of []) { + (function() { return x}); + (() => x); + if (x == 1) { + break; + } + if (x == 1) { + break l0; + } + if (x == 2) { + continue; + } + if (x == 2) { + continue l0; + } + } + + l00: + for (let x in []) { + (function() { return x}); + (() => x); + if (x == "1") { + break; + } + if (x == "1") { + break l00; + } + if (x == "2") { + continue; + } + if (x == "2") { + continue l00; + } + } + + l1: + for (let x = 0; x < 1; ++x) { + (function() { return x}); + (() => x); + if (x == 1) { + break; + } + if (x == 1) { + break l1; + } + if (x == 2) { + continue; + } + if (x == 2) { + continue l1; + } + } + + l2: + while (1 === 1) { + let x; + (function() { return x}); + (() => x); + if (x == 1) { + break; + } + if (x == 1) { + break l2; + } + if (x == 2) { + continue; + } + if (x == 2) { + continue l2; + } + } + + l3: + do { + let x; + (function() { return x}); + (() => x); + if (x == 1) { + break; + } + if (x == 1) { + break l3; + } + if (x == 2) { + continue; + } + if (x == 2) { + continue l3; + } + } while (1 === 1) + + l4: + for (let y = 0; y < 1; ++y) { + let x = 1; + (function() { return x}); + (() => x); + if (x == 1) { + break; + } + if (x == 1) { + break l4; + } + if (x == 2) { + continue; + } + if (x == 2) { + continue l4; + } + } + + l5: + for (let x = 0, y = 1; x < 1; ++x) { + (function() { return x + y}); + (() => x + y); + if (x == 1) { + break; + } + if (x == 1) { + break l5; + } + if (x == 2) { + continue; + } + if (x == 2) { + continue l5; + } + } + + l6: + while (1 === 1) { + let x, y; + (function() { return x + y}); + (() => x + y); + if (x == 1) { + break; + } + if (x == 1) { + break l6; + } + if (x == 2) { + continue; + } + if (x == 2) { + continue l6; + } + + } + + l7: + do { + let x, y; + (function() { return x + y}); + (() => x + y); + if (x == 1) { + break; + } + if (x == 1) { + break l7; + } + if (x == 2) { + continue; + } + if (x == 2) { + continue l7; + } + } while (1 === 1) + + l8: + for (let y = 0; y < 1; ++y) { + let x = 1; + (function() { return x + y}); + (() => x + y); + if (x == 1) { + break; + } + if (x == 1) { + break l8; + } + if (x == 2) { + continue; + } + if (x == 2) { + continue l8; + } + } + + //===const + l0_c: + for (const x of []) { + (function() { return x}); + (() => x); + if (x == 1) { + break; + } + if (x == 1) { + break l0_c; + } + if (x == 2) { + continue; + } + if (x == 2) { + continue l0_c; + } + } + + l00_c: + for (const x in []) { + (function() { return x}); + (() => x); + if (x == "1") { + break; + } + if (x == "1") { + break l00_c; + } + if (x == "2") { + continue; + } + if (x == "2") { + continue l00_c; + } + } + + l1_c: + for (const x = 0; x < 1;) { + ~~~~~ +!!! error TS2365: Operator '<' cannot be applied to types '0' and '1'. + (function() { return x}); + (() => x); + if (x == 1) { + ~~~~~~ +!!! error TS2365: Operator '==' cannot be applied to types '0' and '1'. + break; + } + if (x == 1) { + ~~~~~~ +!!! error TS2365: Operator '==' cannot be applied to types '0' and '1'. + break l1_c; + } + if (x == 2) { + ~~~~~~ +!!! error TS2365: Operator '==' cannot be applied to types '0' and '2'. + continue; + } + if (x == 2) { + ~~~~~~ +!!! error TS2365: Operator '==' cannot be applied to types '0' and '2'. + continue l1_c; + } + } + + l2_c: + while (1 === 1) { + const x = 1; + (function() { return x}); + (() => x); + if (x == 1) { + break; + } + if (x == 1) { + break l2_c; + } + if (x == 2) { + continue; + } + if (x == 2) { + continue l2_c; + } + } + + l3_c: + do { + const x = 1; + (function() { return x}); + (() => x); + if (x == 1) { + break; + } + if (x == 1) { + break l3_c; + } + if (x == 2) { + continue; + } + if (x == 2) { + continue l3_c; + } + } while (1 === 1) + + l4_c: + for (const y = 0; y < 1;) { + ~~~~~ +!!! error TS2365: Operator '<' cannot be applied to types '0' and '1'. + const x = 1; + (function() { return x}); + (() => x); + if (x == 1) { + break; + } + if (x == 1) { + break l4_c; + } + if (x == 2) { + continue; + } + if (x == 2) { + continue l4_c; + } + } + + l5_c: + for (const x = 0, y = 1; x < 1;) { + ~~~~~ +!!! error TS2365: Operator '<' cannot be applied to types '0' and '1'. + (function() { return x + y}); + (() => x + y); + if (x == 1) { + ~~~~~~ +!!! error TS2365: Operator '==' cannot be applied to types '0' and '1'. + break; + } + if (x == 1) { + ~~~~~~ +!!! error TS2365: Operator '==' cannot be applied to types '0' and '1'. + break l5_c; + } + if (x == 2) { + ~~~~~~ +!!! error TS2365: Operator '==' cannot be applied to types '0' and '2'. + continue; + } + if (x == 2) { + ~~~~~~ +!!! error TS2365: Operator '==' cannot be applied to types '0' and '2'. + continue l5_c; + } + } + + l6_c: + while (1 === 1) { + const x = 1, y = 1; + (function() { return x + y}); + (() => x + y); + if (x == 1) { + break; + } + if (x == 1) { + break l6_c; + } + if (x == 2) { + continue; + } + if (x == 2) { + continue l6_c; + } + + } + + l7_c: + do { + const x = 1, y = 1; + (function() { return x + y}); + (() => x + y); + if (x == 1) { + break; + } + if (x == 1) { + break l7_c; + } + if (x == 2) { + continue; + } + if (x == 2) { + continue l7_c; + } + } while (1 === 1) + + l8_c: + for (const y = 0; y < 1;) { + ~~~~~ +!!! error TS2365: Operator '<' cannot be applied to types '0' and '1'. + const x = 1; + (function() { return x + y}); + (() => x + y); + if (x == 1) { + break; + } + if (x == 1) { + break l8_c; + } + if (x == 2) { + continue; + } + if (x == 2) { + continue l8_c; + } + } \ No newline at end of file diff --git a/tests/baselines/reference/capturedLetConstInLoop8.errors.txt b/tests/baselines/reference/capturedLetConstInLoop8.errors.txt new file mode 100644 index 00000000000..c3743feaf90 --- /dev/null +++ b/tests/baselines/reference/capturedLetConstInLoop8.errors.txt @@ -0,0 +1,186 @@ +tests/cases/compiler/capturedLetConstInLoop8.ts(66,23): error TS2365: Operator '<' cannot be applied to types '0' and '1'. +tests/cases/compiler/capturedLetConstInLoop8.ts(68,27): error TS2365: Operator '<' cannot be applied to types '0' and '1'. +tests/cases/compiler/capturedLetConstInLoop8.ts(70,31): error TS2365: Operator '<' cannot be applied to types '0' and '1'. +tests/cases/compiler/capturedLetConstInLoop8.ts(73,21): error TS2365: Operator '==' cannot be applied to types '0' and '1'. +tests/cases/compiler/capturedLetConstInLoop8.ts(76,21): error TS2365: Operator '==' cannot be applied to types '0' and '1'. +tests/cases/compiler/capturedLetConstInLoop8.ts(79,21): error TS2365: Operator '==' cannot be applied to types '0' and '1'. +tests/cases/compiler/capturedLetConstInLoop8.ts(82,21): error TS2365: Operator '==' cannot be applied to types '0' and '1'. +tests/cases/compiler/capturedLetConstInLoop8.ts(86,21): error TS2365: Operator '==' cannot be applied to types '0' and '2'. +tests/cases/compiler/capturedLetConstInLoop8.ts(89,21): error TS2365: Operator '==' cannot be applied to types '0' and '2'. +tests/cases/compiler/capturedLetConstInLoop8.ts(92,21): error TS2365: Operator '==' cannot be applied to types '0' and '2'. +tests/cases/compiler/capturedLetConstInLoop8.ts(95,21): error TS2365: Operator '==' cannot be applied to types '0' and '2'. +tests/cases/compiler/capturedLetConstInLoop8.ts(98,21): error TS2365: Operator '==' cannot be applied to types '0' and '3'. +tests/cases/compiler/capturedLetConstInLoop8.ts(102,17): error TS2365: Operator '==' cannot be applied to types '0' and '1'. +tests/cases/compiler/capturedLetConstInLoop8.ts(105,17): error TS2365: Operator '==' cannot be applied to types '0' and '1'. +tests/cases/compiler/capturedLetConstInLoop8.ts(108,17): error TS2365: Operator '==' cannot be applied to types '0' and '2'. +tests/cases/compiler/capturedLetConstInLoop8.ts(111,17): error TS2365: Operator '==' cannot be applied to types '0' and '2'. +tests/cases/compiler/capturedLetConstInLoop8.ts(114,17): error TS2365: Operator '==' cannot be applied to types '0' and '2'. +tests/cases/compiler/capturedLetConstInLoop8.ts(117,17): error TS2365: Operator '==' cannot be applied to types '0' and '2'. +tests/cases/compiler/capturedLetConstInLoop8.ts(120,17): error TS2365: Operator '==' cannot be applied to types '0' and '3'. + + +==== tests/cases/compiler/capturedLetConstInLoop8.ts (19 errors) ==== + function foo() { + l0: + for (let z = 0; z < 1; ++z) { + l1: + for (let x = 0; x < 1; ++x) { + ll1: + for (let y = 0; y < 1; ++y) { + (function() { return x + y }); + (() => x + y); + if (y == 1) { + break; + } + if (y == 1) { + break l1; + } + if (y == 1) { + break ll1; + } + if (y == 1) { + continue l0; + } + + if (x == 2) { + continue; + } + if (x == 2) { + continue l1; + } + if (x == 2) { + continue ll1; + } + if (x == 2) { + return "123" + } + if (x == 3) { + return; + } + } + if (x == 1) { + break; + } + if (x == 1) { + break l1; + } + if (x == 2) { + continue; + } + if (x == 2) { + continue l1; + } + if (x == 2) { + continue l0; + } + if (x == 2) { + return "456"; + } + if (x == 3) { + return; + } + } + } + } + + function foo_c() { + l0: + for (const z = 0; z < 1;) { + ~~~~~ +!!! error TS2365: Operator '<' cannot be applied to types '0' and '1'. + l1: + for (const x = 0; x < 1;) { + ~~~~~ +!!! error TS2365: Operator '<' cannot be applied to types '0' and '1'. + ll1: + for (const y = 0; y < 1;) { + ~~~~~ +!!! error TS2365: Operator '<' cannot be applied to types '0' and '1'. + (function() { return x + y }); + (() => x + y); + if (y == 1) { + ~~~~~~ +!!! error TS2365: Operator '==' cannot be applied to types '0' and '1'. + break; + } + if (y == 1) { + ~~~~~~ +!!! error TS2365: Operator '==' cannot be applied to types '0' and '1'. + break l1; + } + if (y == 1) { + ~~~~~~ +!!! error TS2365: Operator '==' cannot be applied to types '0' and '1'. + break ll1; + } + if (y == 1) { + ~~~~~~ +!!! error TS2365: Operator '==' cannot be applied to types '0' and '1'. + continue l0; + } + + if (x == 2) { + ~~~~~~ +!!! error TS2365: Operator '==' cannot be applied to types '0' and '2'. + continue; + } + if (x == 2) { + ~~~~~~ +!!! error TS2365: Operator '==' cannot be applied to types '0' and '2'. + continue l1; + } + if (x == 2) { + ~~~~~~ +!!! error TS2365: Operator '==' cannot be applied to types '0' and '2'. + continue ll1; + } + if (x == 2) { + ~~~~~~ +!!! error TS2365: Operator '==' cannot be applied to types '0' and '2'. + return "123" + } + if (x == 3) { + ~~~~~~ +!!! error TS2365: Operator '==' cannot be applied to types '0' and '3'. + return; + } + } + if (x == 1) { + ~~~~~~ +!!! error TS2365: Operator '==' cannot be applied to types '0' and '1'. + break; + } + if (x == 1) { + ~~~~~~ +!!! error TS2365: Operator '==' cannot be applied to types '0' and '1'. + break l1; + } + if (x == 2) { + ~~~~~~ +!!! error TS2365: Operator '==' cannot be applied to types '0' and '2'. + continue; + } + if (x == 2) { + ~~~~~~ +!!! error TS2365: Operator '==' cannot be applied to types '0' and '2'. + continue l1; + } + if (x == 2) { + ~~~~~~ +!!! error TS2365: Operator '==' cannot be applied to types '0' and '2'. + continue l0; + } + if (x == 2) { + ~~~~~~ +!!! error TS2365: Operator '==' cannot be applied to types '0' and '2'. + return "456"; + } + if (x == 3) { + ~~~~~~ +!!! error TS2365: Operator '==' cannot be applied to types '0' and '3'. + return; + } + } + } + } + \ No newline at end of file diff --git a/tests/baselines/reference/capturedLetConstInLoop8_ES6.errors.txt b/tests/baselines/reference/capturedLetConstInLoop8_ES6.errors.txt new file mode 100644 index 00000000000..da6947884fa --- /dev/null +++ b/tests/baselines/reference/capturedLetConstInLoop8_ES6.errors.txt @@ -0,0 +1,186 @@ +tests/cases/compiler/capturedLetConstInLoop8_ES6.ts(66,23): error TS2365: Operator '<' cannot be applied to types '0' and '1'. +tests/cases/compiler/capturedLetConstInLoop8_ES6.ts(68,27): error TS2365: Operator '<' cannot be applied to types '0' and '1'. +tests/cases/compiler/capturedLetConstInLoop8_ES6.ts(70,31): error TS2365: Operator '<' cannot be applied to types '0' and '1'. +tests/cases/compiler/capturedLetConstInLoop8_ES6.ts(73,21): error TS2365: Operator '==' cannot be applied to types '0' and '1'. +tests/cases/compiler/capturedLetConstInLoop8_ES6.ts(76,21): error TS2365: Operator '==' cannot be applied to types '0' and '1'. +tests/cases/compiler/capturedLetConstInLoop8_ES6.ts(79,21): error TS2365: Operator '==' cannot be applied to types '0' and '1'. +tests/cases/compiler/capturedLetConstInLoop8_ES6.ts(82,21): error TS2365: Operator '==' cannot be applied to types '0' and '1'. +tests/cases/compiler/capturedLetConstInLoop8_ES6.ts(86,21): error TS2365: Operator '==' cannot be applied to types '0' and '2'. +tests/cases/compiler/capturedLetConstInLoop8_ES6.ts(89,21): error TS2365: Operator '==' cannot be applied to types '0' and '2'. +tests/cases/compiler/capturedLetConstInLoop8_ES6.ts(92,21): error TS2365: Operator '==' cannot be applied to types '0' and '2'. +tests/cases/compiler/capturedLetConstInLoop8_ES6.ts(95,21): error TS2365: Operator '==' cannot be applied to types '0' and '2'. +tests/cases/compiler/capturedLetConstInLoop8_ES6.ts(98,21): error TS2365: Operator '==' cannot be applied to types '0' and '3'. +tests/cases/compiler/capturedLetConstInLoop8_ES6.ts(102,17): error TS2365: Operator '==' cannot be applied to types '0' and '1'. +tests/cases/compiler/capturedLetConstInLoop8_ES6.ts(105,17): error TS2365: Operator '==' cannot be applied to types '0' and '1'. +tests/cases/compiler/capturedLetConstInLoop8_ES6.ts(108,17): error TS2365: Operator '==' cannot be applied to types '0' and '2'. +tests/cases/compiler/capturedLetConstInLoop8_ES6.ts(111,17): error TS2365: Operator '==' cannot be applied to types '0' and '2'. +tests/cases/compiler/capturedLetConstInLoop8_ES6.ts(114,17): error TS2365: Operator '==' cannot be applied to types '0' and '2'. +tests/cases/compiler/capturedLetConstInLoop8_ES6.ts(117,17): error TS2365: Operator '==' cannot be applied to types '0' and '2'. +tests/cases/compiler/capturedLetConstInLoop8_ES6.ts(120,17): error TS2365: Operator '==' cannot be applied to types '0' and '3'. + + +==== tests/cases/compiler/capturedLetConstInLoop8_ES6.ts (19 errors) ==== + function foo() { + l0: + for (let z = 0; z < 1; ++z) { + l1: + for (let x = 0; x < 1; ++x) { + ll1: + for (let y = 0; y < 1; ++y) { + (function() { return x + y }); + (() => x + y); + if (y == 1) { + break; + } + if (y == 1) { + break l1; + } + if (y == 1) { + break ll1; + } + if (y == 1) { + continue l0; + } + + if (x == 2) { + continue; + } + if (x == 2) { + continue l1; + } + if (x == 2) { + continue ll1; + } + if (x == 2) { + return "123" + } + if (x == 3) { + return; + } + } + if (x == 1) { + break; + } + if (x == 1) { + break l1; + } + if (x == 2) { + continue; + } + if (x == 2) { + continue l1; + } + if (x == 2) { + continue l0; + } + if (x == 2) { + return "456"; + } + if (x == 3) { + return; + } + } + } + } + + function foo_c() { + l0: + for (const z = 0; z < 1;) { + ~~~~~ +!!! error TS2365: Operator '<' cannot be applied to types '0' and '1'. + l1: + for (const x = 0; x < 1;) { + ~~~~~ +!!! error TS2365: Operator '<' cannot be applied to types '0' and '1'. + ll1: + for (const y = 0; y < 1;) { + ~~~~~ +!!! error TS2365: Operator '<' cannot be applied to types '0' and '1'. + (function() { return x + y }); + (() => x + y); + if (y == 1) { + ~~~~~~ +!!! error TS2365: Operator '==' cannot be applied to types '0' and '1'. + break; + } + if (y == 1) { + ~~~~~~ +!!! error TS2365: Operator '==' cannot be applied to types '0' and '1'. + break l1; + } + if (y == 1) { + ~~~~~~ +!!! error TS2365: Operator '==' cannot be applied to types '0' and '1'. + break ll1; + } + if (y == 1) { + ~~~~~~ +!!! error TS2365: Operator '==' cannot be applied to types '0' and '1'. + continue l0; + } + + if (x == 2) { + ~~~~~~ +!!! error TS2365: Operator '==' cannot be applied to types '0' and '2'. + continue; + } + if (x == 2) { + ~~~~~~ +!!! error TS2365: Operator '==' cannot be applied to types '0' and '2'. + continue l1; + } + if (x == 2) { + ~~~~~~ +!!! error TS2365: Operator '==' cannot be applied to types '0' and '2'. + continue ll1; + } + if (x == 2) { + ~~~~~~ +!!! error TS2365: Operator '==' cannot be applied to types '0' and '2'. + return "123" + } + if (x == 3) { + ~~~~~~ +!!! error TS2365: Operator '==' cannot be applied to types '0' and '3'. + return; + } + } + if (x == 1) { + ~~~~~~ +!!! error TS2365: Operator '==' cannot be applied to types '0' and '1'. + break; + } + if (x == 1) { + ~~~~~~ +!!! error TS2365: Operator '==' cannot be applied to types '0' and '1'. + break l1; + } + if (x == 2) { + ~~~~~~ +!!! error TS2365: Operator '==' cannot be applied to types '0' and '2'. + continue; + } + if (x == 2) { + ~~~~~~ +!!! error TS2365: Operator '==' cannot be applied to types '0' and '2'. + continue l1; + } + if (x == 2) { + ~~~~~~ +!!! error TS2365: Operator '==' cannot be applied to types '0' and '2'. + continue l0; + } + if (x == 2) { + ~~~~~~ +!!! error TS2365: Operator '==' cannot be applied to types '0' and '2'. + return "456"; + } + if (x == 3) { + ~~~~~~ +!!! error TS2365: Operator '==' cannot be applied to types '0' and '3'. + return; + } + } + } + } + \ No newline at end of file diff --git a/tests/baselines/reference/capturedLetConstInLoop9.types b/tests/baselines/reference/capturedLetConstInLoop9.types index 9f1bab20148..486697b8d84 100644 --- a/tests/baselines/reference/capturedLetConstInLoop9.types +++ b/tests/baselines/reference/capturedLetConstInLoop9.types @@ -1,10 +1,10 @@ === tests/cases/compiler/capturedLetConstInLoop9.ts === for (let x = 0; x < 1; ++x) { >x : number ->0 : number +>0 : 0 >x < 1 : boolean >x : number ->1 : number +>1 : 1 >++x : number >x : number @@ -78,7 +78,7 @@ for (let x = 0; x < 1; ++x) { return x + 1; >x + 1 : any >x : any ->1 : number +>1 : 1 } } } @@ -88,7 +88,7 @@ declare function use(a: any); >a : any function foo() { ->foo : () => number +>foo : () => 50 | 100 l0: >l0 : any @@ -125,9 +125,9 @@ function foo() { >[{x:1, y:2}] : [{ x: number; y: number; }] >{x:1, y:2} : { x: number; y: number; } >x : number ->1 : number +>1 : 1 >y : number ->2 : number +>2 : 2 if (b === 1) { >b === 1 : boolean @@ -160,7 +160,7 @@ function foo() { } return 50; ->50 : number +>50 : 50 } for (let b of []) { @@ -174,7 +174,7 @@ function foo() { >[{x1:1, y:arguments.length}] : [{ x1: number; y: number; }] >{x1:1, y:arguments.length} : { x1: number; y: number; } >x1 : number ->1 : number +>1 : 1 >y : number >arguments.length : number >arguments : IArguments @@ -202,7 +202,7 @@ function foo() { >b : any return 100; ->100 : number +>100 : 100 } @@ -307,10 +307,10 @@ class C { for (let i = 0; i < 100; i++) { >i : number ->0 : number +>0 : 0 >i < 100 : boolean >i : number ->100 : number +>100 : 100 >i++ : number >i : number diff --git a/tests/baselines/reference/capturedLetConstInLoop9_ES6.types b/tests/baselines/reference/capturedLetConstInLoop9_ES6.types index 8a4adafe340..be4457315ee 100644 --- a/tests/baselines/reference/capturedLetConstInLoop9_ES6.types +++ b/tests/baselines/reference/capturedLetConstInLoop9_ES6.types @@ -2,10 +2,10 @@ for (let x = 0; x < 1; ++x) { >x : number ->0 : number +>0 : 0 >x < 1 : boolean >x : number ->1 : number +>1 : 1 >++x : number >x : number @@ -79,7 +79,7 @@ for (let x = 0; x < 1; ++x) { return x + 1; >x + 1 : any >x : any ->1 : number +>1 : 1 } } } @@ -89,7 +89,7 @@ declare function use(a: any); >a : any function foo() { ->foo : () => number +>foo : () => 50 | 100 l0: >l0 : any @@ -126,9 +126,9 @@ function foo() { >[{x:1, y:2}] : [{ x: number; y: number; }] >{x:1, y:2} : { x: number; y: number; } >x : number ->1 : number +>1 : 1 >y : number ->2 : number +>2 : 2 if (b === 1) { >b === 1 : boolean @@ -161,7 +161,7 @@ function foo() { } return 50; ->50 : number +>50 : 50 } for (let b of []) { @@ -175,7 +175,7 @@ function foo() { >[{x1:1, y:arguments.length}] : [{ x1: number; y: number; }] >{x1:1, y:arguments.length} : { x1: number; y: number; } >x1 : number ->1 : number +>1 : 1 >y : number >arguments.length : number >arguments : IArguments @@ -202,7 +202,7 @@ function foo() { >b : any return 100; ->100 : number +>100 : 100 } @@ -307,10 +307,10 @@ class C { for (let i = 0; i < 100; i++) { >i : number ->0 : number +>0 : 0 >i < 100 : boolean >i : number ->100 : number +>100 : 100 >i++ : number >i : number diff --git a/tests/baselines/reference/capturedParametersInInitializers1.types b/tests/baselines/reference/capturedParametersInInitializers1.types index 493c608c145..9e5dee1b82e 100644 --- a/tests/baselines/reference/capturedParametersInInitializers1.types +++ b/tests/baselines/reference/capturedParametersInInitializers1.types @@ -7,7 +7,7 @@ function foo1(y = class {c = x}, x = 1) { >c : number >x : number >x : number ->1 : number +>1 : 1 new y().c; >new y().c : number @@ -24,7 +24,7 @@ function foo2(y = function(x: typeof z) {}, z = 1) { >x : number >z : number >z : number ->1 : number +>1 : 1 } @@ -41,6 +41,6 @@ function foo3(y = { x: a }, z = 1) { >z : number >a : any >z : number ->1 : number +>1 : 1 } diff --git a/tests/baselines/reference/castExpressionParentheses.types b/tests/baselines/reference/castExpressionParentheses.types index cdfbf4f7db2..dafe3377aea 100644 --- a/tests/baselines/reference/castExpressionParentheses.types +++ b/tests/baselines/reference/castExpressionParentheses.types @@ -9,49 +9,49 @@ declare var a; >{a:0} : any >{a:0} : { a: number; } >a : number ->0 : number +>0 : 0 ([1,3,]); >([1,3,]) : any >[1,3,] : any >[1,3,] : number[] ->1 : number ->3 : number +>1 : 1 +>3 : 3 ("string"); >("string") : any >"string" : any ->"string" : string +>"string" : "string" (23.0); >(23.0) : any >23.0 : any ->23.0 : number +>23.0 : 23 (1); >(1) : any >1 : any ->1 : number +>1 : 1 (1.); >(1.) : any >1. : any ->1. : number +>1. : 1 (1.0); >(1.0) : any >1.0 : any ->1.0 : number +>1.0 : 1 (12e+34); >(12e+34) : any >12e+34 : any ->12e+34 : number +>12e+34 : 1.2e+35 (0xff); >(0xff) : any >0xff : any ->0xff : number +>0xff : 255 (/regexp/g); >(/regexp/g) : any @@ -61,12 +61,12 @@ declare var a; (false); >(false) : any >false : any ->false : boolean +>false : false (true); >(true) : any >true : any ->true : boolean +>true : true (null); >(null) : any @@ -106,7 +106,7 @@ declare var a; >a[0] : any >a[0] : any >a : any ->0 : number +>0 : 0 (a.b["0"]); >(a.b["0"]) : any @@ -115,7 +115,7 @@ declare var a; >a.b : any >a : any >b : any ->"0" : string +>"0" : "0" (a()).x; >(a()).x : any @@ -133,42 +133,42 @@ declare var A; >(1).foo : any >(1) : any >1 : any ->1 : number +>1 : 1 >foo : any (1.).foo; >(1.).foo : any >(1.) : any >1. : any ->1. : number +>1. : 1 >foo : any (1.0).foo; >(1.0).foo : any >(1.0) : any >1.0 : any ->1.0 : number +>1.0 : 1 >foo : any (12e+34).foo; >(12e+34).foo : any >(12e+34) : any >12e+34 : any ->12e+34 : number +>12e+34 : 1.2e+35 >foo : any (0xff).foo; >(0xff).foo : any >(0xff) : any >0xff : any ->0xff : number +>0xff : 255 >foo : any ((1.0)); >((1.0)) : any >(1.0) : any ->(1.0) : number ->1.0 : number +>(1.0) : 1 +>1.0 : 1 (new A).foo; >(new A).foo : any diff --git a/tests/baselines/reference/castOfAwait.types b/tests/baselines/reference/castOfAwait.types index ad3597f6c01..30220ca2ab6 100644 --- a/tests/baselines/reference/castOfAwait.types +++ b/tests/baselines/reference/castOfAwait.types @@ -4,18 +4,18 @@ async function f() { await 0; > await 0 : number ->await 0 : number ->0 : number +>await 0 : 0 +>0 : 0 typeof await 0; >typeof await 0 : string ->await 0 : number ->0 : number +>await 0 : 0 +>0 : 0 void await 0; >void await 0 : undefined ->await 0 : number ->0 : number +>await 0 : 0 +>0 : 0 await void typeof void await 0; >await void typeof void await 0 : any @@ -24,12 +24,12 @@ async function f() { >typeof void await 0 : string > void await 0 : number >void await 0 : undefined ->await 0 : number ->0 : number +>await 0 : 0 +>0 : 0 await await 0; ->await await 0 : number ->await 0 : number ->0 : number +>await await 0 : 0 +>await 0 : 0 +>0 : 0 } diff --git a/tests/baselines/reference/castTest.types b/tests/baselines/reference/castTest.types index 35698219fd4..666b2ccf78e 100644 --- a/tests/baselines/reference/castTest.types +++ b/tests/baselines/reference/castTest.types @@ -2,7 +2,7 @@ var x : any = 0; >x : any ->0 : number +>0 : 0 var z = x; >z : number @@ -18,17 +18,17 @@ var y = x + z; var a = 0; >a : any >0 : any ->0 : number +>0 : 0 var b = true; >b : boolean >true : boolean ->true : boolean +>true : true var s = ""; >s : string >"" : string ->"" : string +>"" : "" var ar = null; >ar : any[] @@ -76,11 +76,11 @@ var p_cast = ({ x: 0, >x : number ->0 : number +>0 : 0 y: 0, >y : number ->0 : number +>0 : 0 add: function(dx, dy) { >add : (dx: number, dy: number) => Point diff --git a/tests/baselines/reference/chainedCallsWithTypeParameterConstrainedToOtherTypeParameter2.errors.txt b/tests/baselines/reference/chainedCallsWithTypeParameterConstrainedToOtherTypeParameter2.errors.txt index 8f5924586df..56f4cad5a47 100644 --- a/tests/baselines/reference/chainedCallsWithTypeParameterConstrainedToOtherTypeParameter2.errors.txt +++ b/tests/baselines/reference/chainedCallsWithTypeParameterConstrainedToOtherTypeParameter2.errors.txt @@ -2,9 +2,9 @@ tests/cases/compiler/chainedCallsWithTypeParameterConstrainedToOtherTypeParamete Type 'T' is not assignable to type 'S'. tests/cases/compiler/chainedCallsWithTypeParameterConstrainedToOtherTypeParameter2.ts(10,29): error TS2345: Argument of type '(ss: S) => T' is not assignable to parameter of type '(x: S) => S'. Type 'T' is not assignable to type 'S'. -tests/cases/compiler/chainedCallsWithTypeParameterConstrainedToOtherTypeParameter2.ts(32,9): error TS2322: Type 'string' is not assignable to type 'number'. -tests/cases/compiler/chainedCallsWithTypeParameterConstrainedToOtherTypeParameter2.ts(36,9): error TS2322: Type 'string' is not assignable to type 'number'. -tests/cases/compiler/chainedCallsWithTypeParameterConstrainedToOtherTypeParameter2.ts(37,9): error TS2322: Type 'string' is not assignable to type 'number'. +tests/cases/compiler/chainedCallsWithTypeParameterConstrainedToOtherTypeParameter2.ts(32,9): error TS2322: Type '""' is not assignable to type 'number'. +tests/cases/compiler/chainedCallsWithTypeParameterConstrainedToOtherTypeParameter2.ts(36,9): error TS2322: Type '""' is not assignable to type 'number'. +tests/cases/compiler/chainedCallsWithTypeParameterConstrainedToOtherTypeParameter2.ts(37,9): error TS2322: Type '""' is not assignable to type 'number'. ==== tests/cases/compiler/chainedCallsWithTypeParameterConstrainedToOtherTypeParameter2.ts (5 errors) ==== @@ -47,16 +47,16 @@ tests/cases/compiler/chainedCallsWithTypeParameterConstrainedToOtherTypeParamete // Should get an error that we are assigning a string to a number (new Chain2(i)).then(ii => t).then(tt => s).value.x = ""; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2322: Type 'string' is not assignable to type 'number'. +!!! error TS2322: Type '""' is not assignable to type 'number'. // Staying at T or S should keep the constraint. // Get an error when we assign a string to a number in both cases (new Chain2(i)).then(ii => t).then(tt => t).then(tt => t).then(tt => t).value.x = ""; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2322: Type 'string' is not assignable to type 'number'. +!!! error TS2322: Type '""' is not assignable to type 'number'. (new Chain2(i)).then(ii => s).then(ss => s).then(ss => s).then(ss => s).value.x = ""; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2322: Type 'string' is not assignable to type 'number'. +!!! error TS2322: Type '""' is not assignable to type 'number'. return null; } diff --git a/tests/baselines/reference/checkSuperCallBeforeThisAccessing1.types b/tests/baselines/reference/checkSuperCallBeforeThisAccessing1.types index d734b0c6ad0..85a1af6fbdc 100644 --- a/tests/baselines/reference/checkSuperCallBeforeThisAccessing1.types +++ b/tests/baselines/reference/checkSuperCallBeforeThisAccessing1.types @@ -18,11 +18,11 @@ class Derived extends Based { >this : this this.x = 10; ->this.x = 10 : number +>this.x = 10 : 10 >this.x : number >this : this >x : number ->10 : number +>10 : 10 var that = this; >that : this diff --git a/tests/baselines/reference/checkSuperCallBeforeThisAccessing3.types b/tests/baselines/reference/checkSuperCallBeforeThisAccessing3.types index c4e9e15ed8e..60179ec27bf 100644 --- a/tests/baselines/reference/checkSuperCallBeforeThisAccessing3.types +++ b/tests/baselines/reference/checkSuperCallBeforeThisAccessing3.types @@ -18,11 +18,11 @@ class Derived extends Based { constructor() { this.y = true; ->this.y = true : boolean +>this.y = true : true >this.y : boolean >this : this >y : boolean ->true : boolean +>true : true } } super(); @@ -30,11 +30,11 @@ class Derived extends Based { >super : typeof Based this.x = 10; ->this.x = 10 : number +>this.x = 10 : 10 >this.x : number >this : this >x : number ->10 : number +>10 : 10 var that = this; >that : this diff --git a/tests/baselines/reference/checkSuperCallBeforeThisAccessing4.types b/tests/baselines/reference/checkSuperCallBeforeThisAccessing4.types index f42a0ac8563..b2bf4824721 100644 --- a/tests/baselines/reference/checkSuperCallBeforeThisAccessing4.types +++ b/tests/baselines/reference/checkSuperCallBeforeThisAccessing4.types @@ -43,11 +43,11 @@ class Derived extends Based { >super : typeof Based this.x = 10; ->this.x = 10 : number +>this.x = 10 : 10 >this.x : number >this : this >x : number ->10 : number +>10 : 10 var that = this; >that : this diff --git a/tests/baselines/reference/circularObjectLiteralAccessors.types b/tests/baselines/reference/circularObjectLiteralAccessors.types index 1f01432db5a..e190ea5e6d3 100644 --- a/tests/baselines/reference/circularObjectLiteralAccessors.types +++ b/tests/baselines/reference/circularObjectLiteralAccessors.types @@ -33,6 +33,6 @@ const a = { }, foo: '' >foo : string ->'' : string +>'' : "" }; diff --git a/tests/baselines/reference/classAbstractAsIdentifier.types b/tests/baselines/reference/classAbstractAsIdentifier.types index e2894af804d..63f15dc4a4c 100644 --- a/tests/baselines/reference/classAbstractAsIdentifier.types +++ b/tests/baselines/reference/classAbstractAsIdentifier.types @@ -4,7 +4,7 @@ class abstract { foo() { return 1; } >foo : () => number ->1 : number +>1 : 1 } new abstract; diff --git a/tests/baselines/reference/classAbstractAssignabilityConstructorFunction.errors.txt b/tests/baselines/reference/classAbstractAssignabilityConstructorFunction.errors.txt index c6c242396d8..fbcc597409a 100644 --- a/tests/baselines/reference/classAbstractAssignabilityConstructorFunction.errors.txt +++ b/tests/baselines/reference/classAbstractAssignabilityConstructorFunction.errors.txt @@ -1,6 +1,6 @@ tests/cases/conformance/classes/classDeclarations/classAbstractKeyword/classAbstractAssignabilityConstructorFunction.ts(7,1): error TS2322: Type 'typeof A' is not assignable to type 'new () => A'. Cannot assign an abstract constructor type to a non-abstract constructor type. -tests/cases/conformance/classes/classDeclarations/classAbstractKeyword/classAbstractAssignabilityConstructorFunction.ts(8,1): error TS2322: Type 'string' is not assignable to type 'new () => A'. +tests/cases/conformance/classes/classDeclarations/classAbstractKeyword/classAbstractAssignabilityConstructorFunction.ts(8,1): error TS2322: Type '"asdf"' is not assignable to type 'new () => A'. ==== tests/cases/conformance/classes/classDeclarations/classAbstractKeyword/classAbstractAssignabilityConstructorFunction.ts (2 errors) ==== @@ -16,4 +16,4 @@ tests/cases/conformance/classes/classDeclarations/classAbstractKeyword/classAbst !!! error TS2322: Cannot assign an abstract constructor type to a non-abstract constructor type. AAA = "asdf"; ~~~ -!!! error TS2322: Type 'string' is not assignable to type 'new () => A'. \ No newline at end of file +!!! error TS2322: Type '"asdf"' is not assignable to type 'new () => A'. \ No newline at end of file diff --git a/tests/baselines/reference/classAppearsToHaveMembersOfObject.types b/tests/baselines/reference/classAppearsToHaveMembersOfObject.types index 65c37e7dfeb..9c87fa18ecd 100644 --- a/tests/baselines/reference/classAppearsToHaveMembersOfObject.types +++ b/tests/baselines/reference/classAppearsToHaveMembersOfObject.types @@ -20,7 +20,7 @@ var r2 = c.hasOwnProperty(''); >c.hasOwnProperty : (v: string) => boolean >c : C >hasOwnProperty : (v: string) => boolean ->'' : string +>'' : "" var o: Object = c; >o : Object diff --git a/tests/baselines/reference/classDeclarationMergedInModuleWithContinuation.types b/tests/baselines/reference/classDeclarationMergedInModuleWithContinuation.types index 11fcac506b6..728a201d79e 100644 --- a/tests/baselines/reference/classDeclarationMergedInModuleWithContinuation.types +++ b/tests/baselines/reference/classDeclarationMergedInModuleWithContinuation.types @@ -10,7 +10,7 @@ module M { export var v = 0; >v : number ->0 : number +>0 : 0 } } diff --git a/tests/baselines/reference/classDoesNotDependOnBaseTypes.types b/tests/baselines/reference/classDoesNotDependOnBaseTypes.types index 529be3c6635..5ac20c6e0fa 100644 --- a/tests/baselines/reference/classDoesNotDependOnBaseTypes.types +++ b/tests/baselines/reference/classDoesNotDependOnBaseTypes.types @@ -10,17 +10,17 @@ if (typeof x !== "string") { >"string" : "string" x[0] = ""; ->x[0] = "" : string +>x[0] = "" : "" >x[0] : StringTree >x : StringTreeCollection ->0 : number ->"" : string +>0 : 0 +>"" : "" x[0] = new StringTreeCollection; >x[0] = new StringTreeCollection : StringTreeCollection >x[0] : StringTree >x : StringTreeCollection ->0 : number +>0 : 0 >new StringTreeCollection : StringTreeCollection >StringTreeCollection : typeof StringTreeCollection } diff --git a/tests/baselines/reference/classExpression5.types b/tests/baselines/reference/classExpression5.types index 25c4b66b8f3..cf207c1cb0b 100644 --- a/tests/baselines/reference/classExpression5.types +++ b/tests/baselines/reference/classExpression5.types @@ -9,7 +9,7 @@ new class { >hi : () => string return "Hi!"; ->"Hi!" : string +>"Hi!" : "Hi!" } }().hi(); >hi : () => string diff --git a/tests/baselines/reference/classExpressionWithStaticProperties1.types b/tests/baselines/reference/classExpressionWithStaticProperties1.types index 168bb028474..2cdcd1581b1 100644 --- a/tests/baselines/reference/classExpressionWithStaticProperties1.types +++ b/tests/baselines/reference/classExpressionWithStaticProperties1.types @@ -6,11 +6,11 @@ var v = class C { static a = 1; >a : number ->1 : number +>1 : 1 static b = 2; >b : number ->2 : number +>2 : 2 static c = C.a + C.b; >c : number diff --git a/tests/baselines/reference/classExpressionWithStaticProperties2.types b/tests/baselines/reference/classExpressionWithStaticProperties2.types index 221b4794111..2db30ff3105 100644 --- a/tests/baselines/reference/classExpressionWithStaticProperties2.types +++ b/tests/baselines/reference/classExpressionWithStaticProperties2.types @@ -6,7 +6,7 @@ var v = class C { static a = 1; >a : number ->1 : number +>1 : 1 static b >b : any @@ -17,7 +17,7 @@ var v = class C { x: "hi" >x : string ->"hi" : string +>"hi" : "hi" } static d = C.c.x + " world"; >d : string @@ -27,6 +27,6 @@ var v = class C { >C : typeof C >c : { x: string; } >x : string ->" world" : string +>" world" : " world" }; diff --git a/tests/baselines/reference/classExpressionWithStaticProperties3.types b/tests/baselines/reference/classExpressionWithStaticProperties3.types index c6ff6d1b56b..b7f6102c8b7 100644 --- a/tests/baselines/reference/classExpressionWithStaticProperties3.types +++ b/tests/baselines/reference/classExpressionWithStaticProperties3.types @@ -10,10 +10,10 @@ const arr: {y(): number}[] = []; for (let i = 0; i < 3; i++) { >i : number ->0 : number +>0 : 0 >i < 3 : boolean >i : number ->3 : number +>3 : 3 >i++ : number >i : number @@ -36,7 +36,7 @@ for (let i = 0; i < 3; i++) { >C.x : number >C : typeof C >x : number ->2 : number +>2 : 2 }); } diff --git a/tests/baselines/reference/classExpressionWithStaticPropertiesES61.types b/tests/baselines/reference/classExpressionWithStaticPropertiesES61.types index 0ba6ada4131..62f29b64361 100644 --- a/tests/baselines/reference/classExpressionWithStaticPropertiesES61.types +++ b/tests/baselines/reference/classExpressionWithStaticPropertiesES61.types @@ -6,11 +6,11 @@ var v = class C { static a = 1; >a : number ->1 : number +>1 : 1 static b = 2; >b : number ->2 : number +>2 : 2 static c = C.a + 3; >c : number @@ -18,6 +18,6 @@ var v = class C { >C.a : number >C : typeof C >a : number ->3 : number +>3 : 3 }; diff --git a/tests/baselines/reference/classExpressionWithStaticPropertiesES62.types b/tests/baselines/reference/classExpressionWithStaticPropertiesES62.types index 97d6940a3fc..0c448d73ede 100644 --- a/tests/baselines/reference/classExpressionWithStaticPropertiesES62.types +++ b/tests/baselines/reference/classExpressionWithStaticPropertiesES62.types @@ -6,7 +6,7 @@ var v = class C { static a = 1; >a : number ->1 : number +>1 : 1 static b >b : any @@ -17,7 +17,7 @@ var v = class C { x: "hi" >x : string ->"hi" : string +>"hi" : "hi" } static d = C.c.x + " world"; >d : string @@ -27,6 +27,6 @@ var v = class C { >C : typeof C >c : { x: string; } >x : string ->" world" : string +>" world" : " world" }; diff --git a/tests/baselines/reference/classExpressionWithStaticPropertiesES63.types b/tests/baselines/reference/classExpressionWithStaticPropertiesES63.types index 92f14f3f65f..3bc780785aa 100644 --- a/tests/baselines/reference/classExpressionWithStaticPropertiesES63.types +++ b/tests/baselines/reference/classExpressionWithStaticPropertiesES63.types @@ -10,10 +10,10 @@ const arr: {y(): number}[] = []; for (let i = 0; i < 3; i++) { >i : number ->0 : number +>0 : 0 >i < 3 : boolean >i : number ->3 : number +>3 : 3 >i++ : number >i : number @@ -36,7 +36,7 @@ for (let i = 0; i < 3; i++) { >C.x : number >C : typeof C >x : number ->2 : number +>2 : 2 }); } diff --git a/tests/baselines/reference/classExpressionWithStaticPropertiesES64.types b/tests/baselines/reference/classExpressionWithStaticPropertiesES64.types index f48ec6fdde6..0f76461bb71 100644 --- a/tests/baselines/reference/classExpressionWithStaticPropertiesES64.types +++ b/tests/baselines/reference/classExpressionWithStaticPropertiesES64.types @@ -3,5 +3,5 @@ >(class { static x = 0; }) : typeof (Anonymous class) >class { static x = 0; } : typeof (Anonymous class) >x : number ->0 : number +>0 : 0 diff --git a/tests/baselines/reference/classExtendingClass.types b/tests/baselines/reference/classExtendingClass.types index f91493e97fd..3c03fb1837a 100644 --- a/tests/baselines/reference/classExtendingClass.types +++ b/tests/baselines/reference/classExtendingClass.types @@ -102,7 +102,7 @@ var r7 = d2.thing(''); >d2.thing : (x: string) => void >d2 : D2 >thing : (x: string) => void ->'' : string +>'' : "" var r8 = D2.other(1); >r8 : void @@ -110,5 +110,5 @@ var r8 = D2.other(1); >D2.other : (x: T) => void >D2 : typeof D2 >other : (x: T) => void ->1 : number +>1 : 1 diff --git a/tests/baselines/reference/classExtendingNonConstructor.errors.txt b/tests/baselines/reference/classExtendingNonConstructor.errors.txt index 17b3610d252..b2c5ce4955a 100644 --- a/tests/baselines/reference/classExtendingNonConstructor.errors.txt +++ b/tests/baselines/reference/classExtendingNonConstructor.errors.txt @@ -1,8 +1,8 @@ tests/cases/conformance/classes/classDeclarations/classExtendingNonConstructor.ts(7,18): error TS2507: Type 'undefined' is not a constructor function type. -tests/cases/conformance/classes/classDeclarations/classExtendingNonConstructor.ts(8,18): error TS2507: Type 'boolean' is not a constructor function type. -tests/cases/conformance/classes/classDeclarations/classExtendingNonConstructor.ts(9,18): error TS2507: Type 'boolean' is not a constructor function type. -tests/cases/conformance/classes/classDeclarations/classExtendingNonConstructor.ts(10,18): error TS2507: Type 'number' is not a constructor function type. -tests/cases/conformance/classes/classDeclarations/classExtendingNonConstructor.ts(11,18): error TS2507: Type 'string' is not a constructor function type. +tests/cases/conformance/classes/classDeclarations/classExtendingNonConstructor.ts(8,18): error TS2507: Type 'true' is not a constructor function type. +tests/cases/conformance/classes/classDeclarations/classExtendingNonConstructor.ts(9,18): error TS2507: Type 'false' is not a constructor function type. +tests/cases/conformance/classes/classDeclarations/classExtendingNonConstructor.ts(10,18): error TS2507: Type '42' is not a constructor function type. +tests/cases/conformance/classes/classDeclarations/classExtendingNonConstructor.ts(11,18): error TS2507: Type '"hello"' is not a constructor function type. tests/cases/conformance/classes/classDeclarations/classExtendingNonConstructor.ts(12,18): error TS2507: Type '{}' is not a constructor function type. tests/cases/conformance/classes/classDeclarations/classExtendingNonConstructor.ts(13,18): error TS2507: Type '() => void' is not a constructor function type. @@ -19,16 +19,16 @@ tests/cases/conformance/classes/classDeclarations/classExtendingNonConstructor.t !!! error TS2507: Type 'undefined' is not a constructor function type. class C2 extends true { } ~~~~ -!!! error TS2507: Type 'boolean' is not a constructor function type. +!!! error TS2507: Type 'true' is not a constructor function type. class C3 extends false { } ~~~~~ -!!! error TS2507: Type 'boolean' is not a constructor function type. +!!! error TS2507: Type 'false' is not a constructor function type. class C4 extends 42 { } ~~ -!!! error TS2507: Type 'number' is not a constructor function type. +!!! error TS2507: Type '42' is not a constructor function type. class C5 extends "hello" { } ~~~~~~~ -!!! error TS2507: Type 'string' is not a constructor function type. +!!! error TS2507: Type '"hello"' is not a constructor function type. class C6 extends x { } ~ !!! error TS2507: Type '{}' is not a constructor function type. diff --git a/tests/baselines/reference/classExtendsInterfaceInExpression.errors.txt b/tests/baselines/reference/classExtendsInterfaceInExpression.errors.txt index 64b160ea766..754f7a57f6a 100644 --- a/tests/baselines/reference/classExtendsInterfaceInExpression.errors.txt +++ b/tests/baselines/reference/classExtendsInterfaceInExpression.errors.txt @@ -1,4 +1,4 @@ -tests/cases/compiler/classExtendsInterfaceInExpression.ts(7,25): error TS2304: Cannot find name 'A'. +tests/cases/compiler/classExtendsInterfaceInExpression.ts(7,25): error TS2693: 'A' only refers to a type, but is being used as a value here. ==== tests/cases/compiler/classExtendsInterfaceInExpression.ts (1 errors) ==== @@ -10,5 +10,5 @@ tests/cases/compiler/classExtendsInterfaceInExpression.ts(7,25): error TS2304: C class C extends factory(A) {} ~ -!!! error TS2304: Cannot find name 'A'. +!!! error TS2693: 'A' only refers to a type, but is being used as a value here. \ No newline at end of file diff --git a/tests/baselines/reference/classImplementsClass3.types b/tests/baselines/reference/classImplementsClass3.types index 6f97a96a56e..266ff33e29b 100644 --- a/tests/baselines/reference/classImplementsClass3.types +++ b/tests/baselines/reference/classImplementsClass3.types @@ -2,7 +2,7 @@ class A { foo(): number { return 1; } } >A : A >foo : () => number ->1 : number +>1 : 1 class C implements A { >C : C @@ -12,7 +12,7 @@ class C implements A { >foo : () => number return 1; ->1 : number +>1 : 1 } } diff --git a/tests/baselines/reference/classMemberInitializerScoping.errors.txt b/tests/baselines/reference/classMemberInitializerScoping.errors.txt index dddc7a82a3f..d6625b3d1f8 100644 --- a/tests/baselines/reference/classMemberInitializerScoping.errors.txt +++ b/tests/baselines/reference/classMemberInitializerScoping.errors.txt @@ -1,5 +1,5 @@ tests/cases/compiler/classMemberInitializerScoping.ts(3,17): error TS2301: Initializer of instance member variable 'y' cannot reference identifier 'aaa' declared in the constructor. -tests/cases/compiler/classMemberInitializerScoping.ts(6,9): error TS2322: Type 'string' is not assignable to type 'number'. +tests/cases/compiler/classMemberInitializerScoping.ts(6,9): error TS2322: Type '""' is not assignable to type 'number'. ==== tests/cases/compiler/classMemberInitializerScoping.ts (2 errors) ==== @@ -12,7 +12,7 @@ tests/cases/compiler/classMemberInitializerScoping.ts(6,9): error TS2322: Type ' constructor(aaa) { this.y = ''; // was: error, cannot assign string to number ~~~~~~ -!!! error TS2322: Type 'string' is not assignable to type 'number'. +!!! error TS2322: Type '""' is not assignable to type 'number'. } } diff --git a/tests/baselines/reference/classStaticPropertyTypeGuard.types b/tests/baselines/reference/classStaticPropertyTypeGuard.types index f89854c919d..f9bf8b68062 100644 --- a/tests/baselines/reference/classStaticPropertyTypeGuard.types +++ b/tests/baselines/reference/classStaticPropertyTypeGuard.types @@ -22,10 +22,10 @@ class A { >_a : string } return A._a = 'helloworld'; ->A._a = 'helloworld' : string +>A._a = 'helloworld' : "helloworld" >A._a : string | undefined >A : typeof A >_a : string | undefined ->'helloworld' : string +>'helloworld' : "helloworld" } } diff --git a/tests/baselines/reference/classWithEmptyBody.types b/tests/baselines/reference/classWithEmptyBody.types index 1ac111796e8..acb038a72a2 100644 --- a/tests/baselines/reference/classWithEmptyBody.types +++ b/tests/baselines/reference/classWithEmptyBody.types @@ -12,16 +12,16 @@ var o: {} = c; >c : C c = 1; ->c = 1 : number +>c = 1 : 1 >c : C ->1 : number +>1 : 1 c = { foo: '' } >c = { foo: '' } : { foo: string; } >c : C >{ foo: '' } : { foo: string; } >foo : string ->'' : string +>'' : "" c = () => { } >c = () => { } : () => void @@ -33,7 +33,7 @@ class D { constructor() { return 1; ->1 : number +>1 : 1 } } @@ -46,16 +46,16 @@ var o: {} = d; >d : D d = 1; ->d = 1 : number +>d = 1 : 1 >d : D ->1 : number +>1 : 1 d = { foo: '' } >d = { foo: '' } : { foo: string; } >d : D >{ foo: '' } : { foo: string; } >foo : string ->'' : string +>'' : "" d = () => { } >d = () => { } : () => void diff --git a/tests/baselines/reference/classWithOnlyPublicMembersEquivalentToInterface.types b/tests/baselines/reference/classWithOnlyPublicMembersEquivalentToInterface.types index 94460dfdeaf..272ba94f7f2 100644 --- a/tests/baselines/reference/classWithOnlyPublicMembersEquivalentToInterface.types +++ b/tests/baselines/reference/classWithOnlyPublicMembersEquivalentToInterface.types @@ -14,7 +14,7 @@ class C { public get z() { return 1; } >z : number ->1 : number +>1 : 1 public set z(v) { } >z : number diff --git a/tests/baselines/reference/classWithOnlyPublicMembersEquivalentToInterface2.types b/tests/baselines/reference/classWithOnlyPublicMembersEquivalentToInterface2.types index b359713f292..22440da1768 100644 --- a/tests/baselines/reference/classWithOnlyPublicMembersEquivalentToInterface2.types +++ b/tests/baselines/reference/classWithOnlyPublicMembersEquivalentToInterface2.types @@ -14,7 +14,7 @@ class C { public get z() { return 1; } >z : number ->1 : number +>1 : 1 public set z(v) { } >z : number diff --git a/tests/baselines/reference/classWithProtectedProperty.types b/tests/baselines/reference/classWithProtectedProperty.types index 1f53ea2aad9..079c749c377 100644 --- a/tests/baselines/reference/classWithProtectedProperty.types +++ b/tests/baselines/reference/classWithProtectedProperty.types @@ -9,32 +9,32 @@ class C { protected a = ''; >a : string ->'' : string +>'' : "" protected b: string = ''; >b : string ->'' : string +>'' : "" protected c() { return '' } >c : () => string ->'' : string +>'' : "" protected d = () => ''; >d : () => string >() => '' : () => string ->'' : string +>'' : "" protected static e; >e : any protected static f() { return '' } >f : () => string ->'' : string +>'' : "" protected static g = () => ''; >g : () => string >() => '' : () => string ->'' : string +>'' : "" } class D extends C { diff --git a/tests/baselines/reference/classWithPublicProperty.types b/tests/baselines/reference/classWithPublicProperty.types index 09d3c0668d1..1ea0c2920e4 100644 --- a/tests/baselines/reference/classWithPublicProperty.types +++ b/tests/baselines/reference/classWithPublicProperty.types @@ -7,32 +7,32 @@ class C { public a = ''; >a : string ->'' : string +>'' : "" public b: string = ''; >b : string ->'' : string +>'' : "" public c() { return '' } >c : () => string ->'' : string +>'' : "" public d = () => ''; >d : () => string >() => '' : () => string ->'' : string +>'' : "" public static e; >e : any public static f() { return '' } >f : () => string ->'' : string +>'' : "" public static g = () => ''; >g : () => string >() => '' : () => string ->'' : string +>'' : "" } // all of these are valid diff --git a/tests/baselines/reference/classdecl.types b/tests/baselines/reference/classdecl.types index 63398736563..82b2bba8bfb 100644 --- a/tests/baselines/reference/classdecl.types +++ b/tests/baselines/reference/classdecl.types @@ -24,7 +24,7 @@ class a { >d : number return 30; ->30 : number +>30 : 30 } public set d(a: number) { >d : number @@ -37,9 +37,9 @@ class a { return { x: 30, y: 40 }; >{ x: 30, y: 40 } : { x: number; y: number; } >x : number ->30 : number +>30 : 30 >y : number ->40 : number +>40 : 40 } private static d2() { @@ -49,7 +49,7 @@ class a { >p3 : string return "string"; ->"string" : string +>"string" : "string" } private pv3; >pv3 : any diff --git a/tests/baselines/reference/cloduleAcrossModuleDefinitions.types b/tests/baselines/reference/cloduleAcrossModuleDefinitions.types index 53ef8392774..2e46dc73e17 100644 --- a/tests/baselines/reference/cloduleAcrossModuleDefinitions.types +++ b/tests/baselines/reference/cloduleAcrossModuleDefinitions.types @@ -21,7 +21,7 @@ module A { export var x = 1; >x : number ->1 : number +>1 : 1 } } diff --git a/tests/baselines/reference/cloduleTest1.types b/tests/baselines/reference/cloduleTest1.types index 67c1fd6120f..059329a3d8a 100644 --- a/tests/baselines/reference/cloduleTest1.types +++ b/tests/baselines/reference/cloduleTest1.types @@ -30,7 +30,7 @@ >$('.foo').addClass : (className: string) => $ >$('.foo') : $ >$ : typeof $ ->'.foo' : string +>'.foo' : ".foo" >addClass : (className: string) => $ ->'bar' : string +>'bar' : "bar" diff --git a/tests/baselines/reference/collisionCodeGenModuleWithConstructorChildren.types b/tests/baselines/reference/collisionCodeGenModuleWithConstructorChildren.types index 9c6fbac1539..e951a2dbcc6 100644 --- a/tests/baselines/reference/collisionCodeGenModuleWithConstructorChildren.types +++ b/tests/baselines/reference/collisionCodeGenModuleWithConstructorChildren.types @@ -4,7 +4,7 @@ module M { export var x = 3; >x : number ->3 : number +>3 : 3 class c { >c : c @@ -40,7 +40,7 @@ module M { constructor() { var M = 10; >M : number ->10 : number +>10 : 10 var p = x; >p : number diff --git a/tests/baselines/reference/collisionCodeGenModuleWithFunctionChildren.types b/tests/baselines/reference/collisionCodeGenModuleWithFunctionChildren.types index 5c99bc7b40b..6879c6bf3d8 100644 --- a/tests/baselines/reference/collisionCodeGenModuleWithFunctionChildren.types +++ b/tests/baselines/reference/collisionCodeGenModuleWithFunctionChildren.types @@ -4,7 +4,7 @@ module M { export var x = 3; >x : number ->3 : number +>3 : 3 function fn(M, p = x) { } >fn : (M: any, p?: number) => void diff --git a/tests/baselines/reference/collisionCodeGenModuleWithMemberVariable.types b/tests/baselines/reference/collisionCodeGenModuleWithMemberVariable.types index 651ba5344ad..959a45ab372 100644 --- a/tests/baselines/reference/collisionCodeGenModuleWithMemberVariable.types +++ b/tests/baselines/reference/collisionCodeGenModuleWithMemberVariable.types @@ -4,7 +4,7 @@ module m1 { export var m1 = 10; >m1 : number ->10 : number +>10 : 10 var b = m1; >b : number diff --git a/tests/baselines/reference/collisionCodeGenModuleWithMethodChildren.types b/tests/baselines/reference/collisionCodeGenModuleWithMethodChildren.types index e7c6d9021eb..77d813e1081 100644 --- a/tests/baselines/reference/collisionCodeGenModuleWithMethodChildren.types +++ b/tests/baselines/reference/collisionCodeGenModuleWithMethodChildren.types @@ -4,7 +4,7 @@ module M { export var x = 3; >x : number ->3 : number +>3 : 3 class c { >c : c diff --git a/tests/baselines/reference/collisionCodeGenModuleWithModuleChildren.types b/tests/baselines/reference/collisionCodeGenModuleWithModuleChildren.types index 4ffaf6dad04..ddf5faee5f0 100644 --- a/tests/baselines/reference/collisionCodeGenModuleWithModuleChildren.types +++ b/tests/baselines/reference/collisionCodeGenModuleWithModuleChildren.types @@ -4,14 +4,14 @@ module M { export var x = 3; >x : number ->3 : number +>3 : 3 module m1 { >m1 : typeof m1 var M = 10; >M : number ->10 : number +>10 : 10 var p = x; >p : number diff --git a/tests/baselines/reference/collisionCodeGenModuleWithModuleReopening.types b/tests/baselines/reference/collisionCodeGenModuleWithModuleReopening.types index b71eeb621d0..2f8c05f2357 100644 --- a/tests/baselines/reference/collisionCodeGenModuleWithModuleReopening.types +++ b/tests/baselines/reference/collisionCodeGenModuleWithModuleReopening.types @@ -44,7 +44,7 @@ module m2 { } export var b10 = 10; >b10 : number ->10 : number +>10 : 10 var x = new c1(); >x : c1 diff --git a/tests/baselines/reference/collisionExportsRequireAndAmbientClass.types b/tests/baselines/reference/collisionExportsRequireAndAmbientClass.types index 0db9958d533..cdee6af63a9 100644 --- a/tests/baselines/reference/collisionExportsRequireAndAmbientClass.types +++ b/tests/baselines/reference/collisionExportsRequireAndAmbientClass.types @@ -54,5 +54,5 @@ module m4 { } var a = 10; >a : number ->10 : number +>10 : 10 } diff --git a/tests/baselines/reference/collisionExportsRequireAndAmbientFunction.types b/tests/baselines/reference/collisionExportsRequireAndAmbientFunction.types index 76210f7dda0..98f2f71c20e 100644 --- a/tests/baselines/reference/collisionExportsRequireAndAmbientFunction.types +++ b/tests/baselines/reference/collisionExportsRequireAndAmbientFunction.types @@ -25,5 +25,5 @@ module m2 { var a = 10; >a : number ->10 : number +>10 : 10 } diff --git a/tests/baselines/reference/collisionExportsRequireAndAmbientFunctionInGlobalFile.types b/tests/baselines/reference/collisionExportsRequireAndAmbientFunctionInGlobalFile.types index 9804380fd7a..a2c3e1d8cd3 100644 --- a/tests/baselines/reference/collisionExportsRequireAndAmbientFunctionInGlobalFile.types +++ b/tests/baselines/reference/collisionExportsRequireAndAmbientFunctionInGlobalFile.types @@ -25,5 +25,5 @@ module m4 { var a = 10; >a : number ->10 : number +>10 : 10 } diff --git a/tests/baselines/reference/collisionExportsRequireAndAmbientModule.types b/tests/baselines/reference/collisionExportsRequireAndAmbientModule.types index 1c4c56de99c..fbf41e94837 100644 --- a/tests/baselines/reference/collisionExportsRequireAndAmbientModule.types +++ b/tests/baselines/reference/collisionExportsRequireAndAmbientModule.types @@ -84,7 +84,7 @@ module m2 { } var a = 10; >a : number ->10 : number +>10 : 10 } === tests/cases/compiler/collisionExportsRequireAndAmbientModule_globalFile.ts === @@ -158,6 +158,6 @@ module m4 { var a = 10; >a : number ->10 : number +>10 : 10 } diff --git a/tests/baselines/reference/collisionExportsRequireAndAmbientVar.types b/tests/baselines/reference/collisionExportsRequireAndAmbientVar.types index 90a9b8968e5..d88a7b5e04e 100644 --- a/tests/baselines/reference/collisionExportsRequireAndAmbientVar.types +++ b/tests/baselines/reference/collisionExportsRequireAndAmbientVar.types @@ -25,7 +25,7 @@ module m2 { var a = 10; >a : number ->10 : number +>10 : 10 } === tests/cases/compiler/collisionExportsRequireAndAmbientVar_globalFile.ts === @@ -55,5 +55,5 @@ module m4 { var a = 10; >a : number ->10 : number +>10 : 10 } diff --git a/tests/baselines/reference/collisionExportsRequireAndFunctionInGlobalFile.types b/tests/baselines/reference/collisionExportsRequireAndFunctionInGlobalFile.types index 3cc08359508..8d520ec186a 100644 --- a/tests/baselines/reference/collisionExportsRequireAndFunctionInGlobalFile.types +++ b/tests/baselines/reference/collisionExportsRequireAndFunctionInGlobalFile.types @@ -3,13 +3,13 @@ function exports() { >exports : () => number return 1; ->1 : number +>1 : 1 } function require() { >require : () => string return "require"; ->"require" : string +>"require" : "require" } module m3 { >m3 : typeof m3 @@ -18,13 +18,13 @@ module m3 { >exports : () => number return 1; ->1 : number +>1 : 1 } function require() { >require : () => string return "require"; ->"require" : string +>"require" : "require" } } module m4 { @@ -34,12 +34,12 @@ module m4 { >exports : () => number return 1; ->1 : number +>1 : 1 } export function require() { >require : () => string return "require"; ->"require" : string +>"require" : "require" } } diff --git a/tests/baselines/reference/collisionRestParameterArrowFunctions.types b/tests/baselines/reference/collisionRestParameterArrowFunctions.types index dcd52e5f766..8a2b5316419 100644 --- a/tests/baselines/reference/collisionRestParameterArrowFunctions.types +++ b/tests/baselines/reference/collisionRestParameterArrowFunctions.types @@ -7,7 +7,7 @@ var f1 = (_i: number, ...restParameters) => { //_i is error var _i = 10; // no error >_i : number ->10 : number +>10 : 10 } var f1NoError = (_i: number) => { // no error >f1NoError : (_i: number) => void @@ -16,7 +16,7 @@ var f1NoError = (_i: number) => { // no error var _i = 10; // no error >_i : number ->10 : number +>10 : 10 } var f2 = (...restParameters) => { @@ -26,7 +26,7 @@ var f2 = (...restParameters) => { var _i = 10; // No Error >_i : number ->10 : number +>10 : 10 } var f2NoError = () => { >f2NoError : () => void @@ -34,5 +34,5 @@ var f2NoError = () => { var _i = 10; // no error >_i : number ->10 : number +>10 : 10 } diff --git a/tests/baselines/reference/collisionRestParameterClassConstructor.types b/tests/baselines/reference/collisionRestParameterClassConstructor.types index f86d6d80d21..08f87481103 100644 --- a/tests/baselines/reference/collisionRestParameterClassConstructor.types +++ b/tests/baselines/reference/collisionRestParameterClassConstructor.types @@ -9,7 +9,7 @@ class c1 { var _i = 10; // no error >_i : number ->10 : number +>10 : 10 } } class c1NoError { @@ -20,7 +20,7 @@ class c1NoError { var _i = 10; // no error >_i : number ->10 : number +>10 : 10 } } @@ -32,7 +32,7 @@ class c2 { var _i = 10; // no error >_i : number ->10 : number +>10 : 10 } } class c2NoError { @@ -41,7 +41,7 @@ class c2NoError { constructor() { var _i = 10; // no error >_i : number ->10 : number +>10 : 10 } } @@ -54,7 +54,7 @@ class c3 { var _i = 10; // no error >_i : number ->10 : number +>10 : 10 } } class c3NoError { @@ -65,7 +65,7 @@ class c3NoError { var _i = 10; // no error >_i : number ->10 : number +>10 : 10 } } diff --git a/tests/baselines/reference/collisionRestParameterClassMethod.types b/tests/baselines/reference/collisionRestParameterClassMethod.types index bc6b09dd795..c5ab80d3bd1 100644 --- a/tests/baselines/reference/collisionRestParameterClassMethod.types +++ b/tests/baselines/reference/collisionRestParameterClassMethod.types @@ -9,7 +9,7 @@ class c1 { var _i = 10; // no error >_i : number ->10 : number +>10 : 10 } public fooNoError(_i: number) { // no error >fooNoError : (_i: number) => void @@ -17,7 +17,7 @@ class c1 { var _i = 10; // no error >_i : number ->10 : number +>10 : 10 } public f4(_i: number, ...rest); // no codegen no error >f4 : { (_i: number, ...rest: any[]): any; (_i: string, ...rest: any[]): any; } @@ -95,13 +95,13 @@ class c3 { var _i = 10; // no error >_i : number ->10 : number +>10 : 10 } public fooNoError() { >fooNoError : () => void var _i = 10; // no error >_i : number ->10 : number +>10 : 10 } } diff --git a/tests/baselines/reference/collisionRestParameterFunction.types b/tests/baselines/reference/collisionRestParameterFunction.types index d988f74c928..3de29038c25 100644 --- a/tests/baselines/reference/collisionRestParameterFunction.types +++ b/tests/baselines/reference/collisionRestParameterFunction.types @@ -7,7 +7,7 @@ function f1(_i: number, ...restParameters) { //_i is error var _i = 10; // no error >_i : number ->10 : number +>10 : 10 } function f1NoError(_i: number) { // no error >f1NoError : (_i: number) => void @@ -15,7 +15,7 @@ function f1NoError(_i: number) { // no error var _i = 10; // no error >_i : number ->10 : number +>10 : 10 } declare function f2(_i: number, ...restParameters); // no error - no code gen @@ -33,14 +33,14 @@ function f3(...restParameters) { var _i = 10; // no error >_i : number ->10 : number +>10 : 10 } function f3NoError() { >f3NoError : () => void var _i = 10; // no error >_i : number ->10 : number +>10 : 10 } function f4(_i: number, ...rest); // no codegen no error diff --git a/tests/baselines/reference/collisionRestParameterFunctionExpressions.types b/tests/baselines/reference/collisionRestParameterFunctionExpressions.types index f8ca0c18ed8..c0ee39e81f2 100644 --- a/tests/baselines/reference/collisionRestParameterFunctionExpressions.types +++ b/tests/baselines/reference/collisionRestParameterFunctionExpressions.types @@ -9,7 +9,7 @@ function foo() { var _i = 10; // no error >_i : number ->10 : number +>10 : 10 } function f1NoError(_i: number) { // no error >f1NoError : (_i: number) => void @@ -17,7 +17,7 @@ function foo() { var _i = 10; // no error >_i : number ->10 : number +>10 : 10 } function f3(...restParameters) { >f3 : (...restParameters: any[]) => void @@ -25,14 +25,14 @@ function foo() { var _i = 10; // no error >_i : number ->10 : number +>10 : 10 } function f3NoError() { >f3NoError : () => void var _i = 10; // no error >_i : number ->10 : number +>10 : 10 } function f4(_i: number, ...rest); // no codegen no error diff --git a/tests/baselines/reference/collisionRestParameterUnderscoreIUsage.types b/tests/baselines/reference/collisionRestParameterUnderscoreIUsage.types index fadc27dfa6c..8245f487915 100644 --- a/tests/baselines/reference/collisionRestParameterUnderscoreIUsage.types +++ b/tests/baselines/reference/collisionRestParameterUnderscoreIUsage.types @@ -6,7 +6,7 @@ declare var console: { log(msg?: string): void; }; var _i = "This is what I'd expect to see"; >_i : string ->"This is what I'd expect to see" : string +>"This is what I'd expect to see" : "This is what I'd expect to see" class Foo { >Foo : Foo diff --git a/tests/baselines/reference/commaOperator1.errors.txt b/tests/baselines/reference/commaOperator1.errors.txt new file mode 100644 index 00000000000..5090dd9496c --- /dev/null +++ b/tests/baselines/reference/commaOperator1.errors.txt @@ -0,0 +1,33 @@ +tests/cases/compiler/commaOperator1.ts(1,11): error TS2695: Left side of comma operator is unused and has no side effects. +tests/cases/compiler/commaOperator1.ts(1,11): error TS2695: Left side of comma operator is unused and has no side effects. +tests/cases/compiler/commaOperator1.ts(1,11): error TS2695: Left side of comma operator is unused and has no side effects. +tests/cases/compiler/commaOperator1.ts(1,12): error TS2695: Left side of comma operator is unused and has no side effects. +tests/cases/compiler/commaOperator1.ts(1,12): error TS2695: Left side of comma operator is unused and has no side effects. +tests/cases/compiler/commaOperator1.ts(1,29): error TS2695: Left side of comma operator is unused and has no side effects. +tests/cases/compiler/commaOperator1.ts(4,12): error TS2695: Left side of comma operator is unused and has no side effects. +tests/cases/compiler/commaOperator1.ts(4,12): error TS2695: Left side of comma operator is unused and has no side effects. + + +==== tests/cases/compiler/commaOperator1.ts (8 errors) ==== + var v1 = ((1, 2, 3), 4, 5, (6, 7)); + ~~~~~~~~~ +!!! error TS2695: Left side of comma operator is unused and has no side effects. + ~~~~~~~~~~~~ +!!! error TS2695: Left side of comma operator is unused and has no side effects. + ~~~~~~~~~~~~~~~ +!!! error TS2695: Left side of comma operator is unused and has no side effects. + ~ +!!! error TS2695: Left side of comma operator is unused and has no side effects. + ~~~~ +!!! error TS2695: Left side of comma operator is unused and has no side effects. + ~ +!!! error TS2695: Left side of comma operator is unused and has no side effects. + function f1() { + var a = 1; + return a, v1, a; + ~ +!!! error TS2695: Left side of comma operator is unused and has no side effects. + ~~~~~ +!!! error TS2695: Left side of comma operator is unused and has no side effects. + } + \ No newline at end of file diff --git a/tests/baselines/reference/commaOperator1.types b/tests/baselines/reference/commaOperator1.types index 8116fec8328..67011aba4b9 100644 --- a/tests/baselines/reference/commaOperator1.types +++ b/tests/baselines/reference/commaOperator1.types @@ -1,29 +1,29 @@ === tests/cases/compiler/commaOperator1.ts === var v1 = ((1, 2, 3), 4, 5, (6, 7)); >v1 : number ->((1, 2, 3), 4, 5, (6, 7)) : number ->(1, 2, 3), 4, 5, (6, 7) : number ->(1, 2, 3), 4, 5 : number ->(1, 2, 3), 4 : number ->(1, 2, 3) : number ->1, 2, 3 : number ->1, 2 : number ->1 : number ->2 : number ->3 : number ->4 : number ->5 : number ->(6, 7) : number ->6, 7 : number ->6 : number ->7 : number +>((1, 2, 3), 4, 5, (6, 7)) : 7 +>(1, 2, 3), 4, 5, (6, 7) : 7 +>(1, 2, 3), 4, 5 : 5 +>(1, 2, 3), 4 : 4 +>(1, 2, 3) : 3 +>1, 2, 3 : 3 +>1, 2 : 2 +>1 : 1 +>2 : 2 +>3 : 3 +>4 : 4 +>5 : 5 +>(6, 7) : 7 +>6, 7 : 7 +>6 : 6 +>7 : 7 function f1() { >f1 : () => number var a = 1; >a : number ->1 : number +>1 : 1 return a, v1, a; >a, v1, a : number diff --git a/tests/baselines/reference/commaOperatorInvalidAssignmentType.errors.txt b/tests/baselines/reference/commaOperatorInvalidAssignmentType.errors.txt index ecf7e5ed1dc..a22fbb1e1d0 100644 --- a/tests/baselines/reference/commaOperatorInvalidAssignmentType.errors.txt +++ b/tests/baselines/reference/commaOperatorInvalidAssignmentType.errors.txt @@ -1,12 +1,13 @@ -tests/cases/conformance/expressions/commaOperator/commaOperatorInvalidAssignmentType.ts(10,1): error TS2322: Type 'string' is not assignable to type 'boolean'. -tests/cases/conformance/expressions/commaOperator/commaOperatorInvalidAssignmentType.ts(11,1): error TS2322: Type 'number' is not assignable to type 'boolean'. -tests/cases/conformance/expressions/commaOperator/commaOperatorInvalidAssignmentType.ts(13,1): error TS2322: Type 'boolean' is not assignable to type 'number'. -tests/cases/conformance/expressions/commaOperator/commaOperatorInvalidAssignmentType.ts(14,1): error TS2322: Type 'string' is not assignable to type 'number'. -tests/cases/conformance/expressions/commaOperator/commaOperatorInvalidAssignmentType.ts(16,1): error TS2322: Type 'boolean' is not assignable to type 'string'. -tests/cases/conformance/expressions/commaOperator/commaOperatorInvalidAssignmentType.ts(17,1): error TS2322: Type 'number' is not assignable to type 'string'. +tests/cases/conformance/expressions/commaOperator/commaOperatorInvalidAssignmentType.ts(11,1): error TS2322: Type 'string' is not assignable to type 'boolean'. +tests/cases/conformance/expressions/commaOperator/commaOperatorInvalidAssignmentType.ts(12,1): error TS2322: Type 'number' is not assignable to type 'boolean'. +tests/cases/conformance/expressions/commaOperator/commaOperatorInvalidAssignmentType.ts(14,1): error TS2322: Type 'boolean' is not assignable to type 'number'. +tests/cases/conformance/expressions/commaOperator/commaOperatorInvalidAssignmentType.ts(15,1): error TS2322: Type 'string' is not assignable to type 'number'. +tests/cases/conformance/expressions/commaOperator/commaOperatorInvalidAssignmentType.ts(17,1): error TS2322: Type 'boolean' is not assignable to type 'string'. +tests/cases/conformance/expressions/commaOperator/commaOperatorInvalidAssignmentType.ts(18,1): error TS2322: Type 'number' is not assignable to type 'string'. ==== tests/cases/conformance/expressions/commaOperator/commaOperatorInvalidAssignmentType.ts (6 errors) ==== + var BOOLEAN: boolean; var NUMBER: number; var STRING: string; diff --git a/tests/baselines/reference/commaOperatorInvalidAssignmentType.js b/tests/baselines/reference/commaOperatorInvalidAssignmentType.js index 0d6b9389cfc..9a16d4bbc28 100644 --- a/tests/baselines/reference/commaOperatorInvalidAssignmentType.js +++ b/tests/baselines/reference/commaOperatorInvalidAssignmentType.js @@ -1,4 +1,5 @@ //// [commaOperatorInvalidAssignmentType.ts] + var BOOLEAN: boolean; var NUMBER: number; var STRING: string; diff --git a/tests/baselines/reference/commaOperatorLeftSideUnused.errors.txt b/tests/baselines/reference/commaOperatorLeftSideUnused.errors.txt new file mode 100644 index 00000000000..3701a4add33 --- /dev/null +++ b/tests/baselines/reference/commaOperatorLeftSideUnused.errors.txt @@ -0,0 +1,125 @@ +tests/cases/compiler/commaOperatorLeftSideUnused.ts(8,10): error TS2695: Left side of comma operator is unused and has no side effects. +tests/cases/compiler/commaOperatorLeftSideUnused.ts(16,19): error TS2695: Left side of comma operator is unused and has no side effects. +tests/cases/compiler/commaOperatorLeftSideUnused.ts(19,21): error TS2695: Left side of comma operator is unused and has no side effects. +tests/cases/compiler/commaOperatorLeftSideUnused.ts(22,7): error TS2695: Left side of comma operator is unused and has no side effects. +tests/cases/compiler/commaOperatorLeftSideUnused.ts(23,7): error TS2695: Left side of comma operator is unused and has no side effects. +tests/cases/compiler/commaOperatorLeftSideUnused.ts(24,7): error TS2695: Left side of comma operator is unused and has no side effects. +tests/cases/compiler/commaOperatorLeftSideUnused.ts(25,7): error TS2695: Left side of comma operator is unused and has no side effects. +tests/cases/compiler/commaOperatorLeftSideUnused.ts(26,7): error TS2695: Left side of comma operator is unused and has no side effects. +tests/cases/compiler/commaOperatorLeftSideUnused.ts(27,7): error TS2695: Left side of comma operator is unused and has no side effects. +tests/cases/compiler/commaOperatorLeftSideUnused.ts(28,7): error TS2695: Left side of comma operator is unused and has no side effects. +tests/cases/compiler/commaOperatorLeftSideUnused.ts(29,7): error TS2695: Left side of comma operator is unused and has no side effects. +tests/cases/compiler/commaOperatorLeftSideUnused.ts(30,7): error TS2695: Left side of comma operator is unused and has no side effects. +tests/cases/compiler/commaOperatorLeftSideUnused.ts(31,7): error TS2695: Left side of comma operator is unused and has no side effects. +tests/cases/compiler/commaOperatorLeftSideUnused.ts(32,7): error TS2695: Left side of comma operator is unused and has no side effects. +tests/cases/compiler/commaOperatorLeftSideUnused.ts(33,7): error TS2695: Left side of comma operator is unused and has no side effects. +tests/cases/compiler/commaOperatorLeftSideUnused.ts(34,7): error TS2695: Left side of comma operator is unused and has no side effects. +tests/cases/compiler/commaOperatorLeftSideUnused.ts(35,7): error TS2695: Left side of comma operator is unused and has no side effects. +tests/cases/compiler/commaOperatorLeftSideUnused.ts(36,7): error TS2695: Left side of comma operator is unused and has no side effects. +tests/cases/compiler/commaOperatorLeftSideUnused.ts(37,7): error TS2695: Left side of comma operator is unused and has no side effects. +tests/cases/compiler/commaOperatorLeftSideUnused.ts(38,7): error TS2695: Left side of comma operator is unused and has no side effects. +tests/cases/compiler/commaOperatorLeftSideUnused.ts(39,7): error TS2695: Left side of comma operator is unused and has no side effects. +tests/cases/compiler/commaOperatorLeftSideUnused.ts(40,7): error TS2695: Left side of comma operator is unused and has no side effects. +tests/cases/compiler/commaOperatorLeftSideUnused.ts(41,7): error TS2695: Left side of comma operator is unused and has no side effects. + + +==== tests/cases/compiler/commaOperatorLeftSideUnused.ts (23 errors) ==== + var xx: any; + var yy: any; + + function fn() { + let arr: any[] = []; + switch(arr.length) { + // Should error + case 0, 1: + ~ +!!! error TS2695: Left side of comma operator is unused and has no side effects. + return 'zero or one'; + default: + return 'more than one'; + } + } + + // Should error + let x = Math.pow((3, 5), 2); + ~ +!!! error TS2695: Left side of comma operator is unused and has no side effects. + + // Should error + let a = [(3 + 4), ((1 + 1, 8) * 4)]; + ~~~~~ +!!! error TS2695: Left side of comma operator is unused and has no side effects. + + // Error cases + xx = (1, 2); + ~ +!!! error TS2695: Left side of comma operator is unused and has no side effects. + xx = ('', xx); + ~~ +!!! error TS2695: Left side of comma operator is unused and has no side effects. + xx = (/323/, 5); + ~~~~~ +!!! error TS2695: Left side of comma operator is unused and has no side effects. + xx = (`wat`, 'ok'), + ~~~~~ +!!! error TS2695: Left side of comma operator is unused and has no side effects. + xx = (true, false); + ~~~~ +!!! error TS2695: Left side of comma operator is unused and has no side effects. + xx = (false, true); + ~~~~~ +!!! error TS2695: Left side of comma operator is unused and has no side effects. + xx = (null, xx); + ~~~~ +!!! error TS2695: Left side of comma operator is unused and has no side effects. + xx = (undefined, 10); + ~~~~~~~~~ +!!! error TS2695: Left side of comma operator is unused and has no side effects. + xx = (() => {}, 'no'); + ~~~~~~~~ +!!! error TS2695: Left side of comma operator is unused and has no side effects. + xx = (function() { }, 100); + ~~~~~~~~ +!!! error TS2695: Left side of comma operator is unused and has no side effects. + xx = ({}, {}); + ~~ +!!! error TS2695: Left side of comma operator is unused and has no side effects. + xx = (typeof xx, 'unused'); + ~~~~~~~~~ +!!! error TS2695: Left side of comma operator is unused and has no side effects. + xx = ([1, 2, x++], xx); + ~~~~~~~~~~~ +!!! error TS2695: Left side of comma operator is unused and has no side effects. + xx = (xx!, xx); + ~~~ +!!! error TS2695: Left side of comma operator is unused and has no side effects. + xx = (xx ? 3 : 4, 10); + ~~~~~~~~~~ +!!! error TS2695: Left side of comma operator is unused and has no side effects. + xx = (3 + 4, 10); + ~~~~~ +!!! error TS2695: Left side of comma operator is unused and has no side effects. + xx = (!xx, 10); + ~~~ +!!! error TS2695: Left side of comma operator is unused and has no side effects. + xx = (~xx, 10); + ~~~ +!!! error TS2695: Left side of comma operator is unused and has no side effects. + xx = (-xx, 10); + ~~~ +!!! error TS2695: Left side of comma operator is unused and has no side effects. + xx = (+xx, 10); + ~~~ +!!! error TS2695: Left side of comma operator is unused and has no side effects. + + // OK cases + xx = (xx ? x++ : 4, 10); + xx = (--xx, 3); + xx = (xx = 3, 1); + xx = ((xx = 3), 5); + xx = (xx+= 4, xx); + xx = ((xx+= 4), xx); + xx = (Math.pow(3, 2), 4); + xx = (void xx, 10); + xx = (xx as any, 100); + \ No newline at end of file diff --git a/tests/baselines/reference/commaOperatorLeftSideUnused.js b/tests/baselines/reference/commaOperatorLeftSideUnused.js new file mode 100644 index 00000000000..3ca4abfa8cd --- /dev/null +++ b/tests/baselines/reference/commaOperatorLeftSideUnused.js @@ -0,0 +1,103 @@ +//// [commaOperatorLeftSideUnused.ts] +var xx: any; +var yy: any; + +function fn() { + let arr: any[] = []; + switch(arr.length) { + // Should error + case 0, 1: + return 'zero or one'; + default: + return 'more than one'; + } +} + +// Should error +let x = Math.pow((3, 5), 2); + +// Should error +let a = [(3 + 4), ((1 + 1, 8) * 4)]; + +// Error cases +xx = (1, 2); +xx = ('', xx); +xx = (/323/, 5); +xx = (`wat`, 'ok'), +xx = (true, false); +xx = (false, true); +xx = (null, xx); +xx = (undefined, 10); +xx = (() => {}, 'no'); +xx = (function() { }, 100); +xx = ({}, {}); +xx = (typeof xx, 'unused'); +xx = ([1, 2, x++], xx); +xx = (xx!, xx); +xx = (xx ? 3 : 4, 10); +xx = (3 + 4, 10); +xx = (!xx, 10); +xx = (~xx, 10); +xx = (-xx, 10); +xx = (+xx, 10); + +// OK cases +xx = (xx ? x++ : 4, 10); +xx = (--xx, 3); +xx = (xx = 3, 1); +xx = ((xx = 3), 5); +xx = (xx+= 4, xx); +xx = ((xx+= 4), xx); +xx = (Math.pow(3, 2), 4); +xx = (void xx, 10); +xx = (xx as any, 100); + + +//// [commaOperatorLeftSideUnused.js] +var xx; +var yy; +function fn() { + var arr = []; + switch (arr.length) { + // Should error + case 0, 1: + return 'zero or one'; + default: + return 'more than one'; + } +} +// Should error +var x = Math.pow((3, 5), 2); +// Should error +var a = [(3 + 4), ((1 + 1, 8) * 4)]; +// Error cases +xx = (1, 2); +xx = ('', xx); +xx = (/323/, 5); +xx = ("wat", 'ok'), + xx = (true, false); +xx = (false, true); +xx = (null, xx); +xx = (undefined, 10); +xx = (function () { }, 'no'); +xx = (function () { }, 100); +xx = ({}, {}); +xx = (typeof xx, 'unused'); +xx = ([1, 2, x++], xx); +xx = (xx, xx); +xx = (xx ? 3 : 4, 10); +xx = (3 + 4, 10); +xx = (!xx, 10); +xx = (~xx, 10); +xx = (-xx, 10); +xx = (+xx, 10); +// OK cases +xx = (xx ? x++ : 4, 10); +xx = (--xx, 3); +xx = (xx = 3, 1); +xx = ((xx = 3), 5); +xx = (xx += 4, xx); +xx = ((xx += 4), xx); +xx = (Math.pow(3, 2), 4); +xx = (void xx, 10); +xx = (xx, 100); diff --git a/tests/baselines/reference/commaOperatorOtherInvalidOperation.errors.txt b/tests/baselines/reference/commaOperatorOtherInvalidOperation.errors.txt index 32e8464a195..a38fcd0741e 100644 --- a/tests/baselines/reference/commaOperatorOtherInvalidOperation.errors.txt +++ b/tests/baselines/reference/commaOperatorOtherInvalidOperation.errors.txt @@ -1,8 +1,9 @@ -tests/cases/conformance/expressions/commaOperator/commaOperatorOtherInvalidOperation.ts(6,5): error TS2322: Type 'string' is not assignable to type 'number'. -tests/cases/conformance/expressions/commaOperator/commaOperatorOtherInvalidOperation.ts(12,9): error TS2322: Type 'T2' is not assignable to type 'T1'. +tests/cases/conformance/expressions/commaOperator/commaOperatorOtherInvalidOperation.ts(7,5): error TS2322: Type 'string' is not assignable to type 'number'. +tests/cases/conformance/expressions/commaOperator/commaOperatorOtherInvalidOperation.ts(13,9): error TS2322: Type 'T2' is not assignable to type 'T1'. ==== tests/cases/conformance/expressions/commaOperator/commaOperatorOtherInvalidOperation.ts (2 errors) ==== + //Expect to have compiler errors //Comma operator in fuction arguments and return function foo(x: number, y: string) { diff --git a/tests/baselines/reference/commaOperatorOtherInvalidOperation.js b/tests/baselines/reference/commaOperatorOtherInvalidOperation.js index d14dec67709..996b08e2ca0 100644 --- a/tests/baselines/reference/commaOperatorOtherInvalidOperation.js +++ b/tests/baselines/reference/commaOperatorOtherInvalidOperation.js @@ -1,4 +1,5 @@ //// [commaOperatorOtherInvalidOperation.ts] + //Expect to have compiler errors //Comma operator in fuction arguments and return function foo(x: number, y: string) { diff --git a/tests/baselines/reference/commaOperatorOtherValidOperation.js b/tests/baselines/reference/commaOperatorOtherValidOperation.js index 383b7c5058e..3a08735a2ed 100644 --- a/tests/baselines/reference/commaOperatorOtherValidOperation.js +++ b/tests/baselines/reference/commaOperatorOtherValidOperation.js @@ -1,4 +1,5 @@ //// [commaOperatorOtherValidOperation.ts] + //Comma operator in for loop for (var i = 0, j = 10; i < j; i++, j--) { diff --git a/tests/baselines/reference/commaOperatorOtherValidOperation.symbols b/tests/baselines/reference/commaOperatorOtherValidOperation.symbols index da65d20fc30..b0ff23dc118 100644 --- a/tests/baselines/reference/commaOperatorOtherValidOperation.symbols +++ b/tests/baselines/reference/commaOperatorOtherValidOperation.symbols @@ -1,50 +1,51 @@ === tests/cases/conformance/expressions/commaOperator/commaOperatorOtherValidOperation.ts === + //Comma operator in for loop for (var i = 0, j = 10; i < j; i++, j--) ->i : Symbol(i, Decl(commaOperatorOtherValidOperation.ts, 1, 8)) ->j : Symbol(j, Decl(commaOperatorOtherValidOperation.ts, 1, 15)) ->i : Symbol(i, Decl(commaOperatorOtherValidOperation.ts, 1, 8)) ->j : Symbol(j, Decl(commaOperatorOtherValidOperation.ts, 1, 15)) ->i : Symbol(i, Decl(commaOperatorOtherValidOperation.ts, 1, 8)) ->j : Symbol(j, Decl(commaOperatorOtherValidOperation.ts, 1, 15)) +>i : Symbol(i, Decl(commaOperatorOtherValidOperation.ts, 2, 8)) +>j : Symbol(j, Decl(commaOperatorOtherValidOperation.ts, 2, 15)) +>i : Symbol(i, Decl(commaOperatorOtherValidOperation.ts, 2, 8)) +>j : Symbol(j, Decl(commaOperatorOtherValidOperation.ts, 2, 15)) +>i : Symbol(i, Decl(commaOperatorOtherValidOperation.ts, 2, 8)) +>j : Symbol(j, Decl(commaOperatorOtherValidOperation.ts, 2, 15)) { } //Comma operator in fuction arguments and return function foo(x: number, y: string) ->foo : Symbol(foo, Decl(commaOperatorOtherValidOperation.ts, 3, 1)) ->x : Symbol(x, Decl(commaOperatorOtherValidOperation.ts, 6, 13)) ->y : Symbol(y, Decl(commaOperatorOtherValidOperation.ts, 6, 23)) +>foo : Symbol(foo, Decl(commaOperatorOtherValidOperation.ts, 4, 1)) +>x : Symbol(x, Decl(commaOperatorOtherValidOperation.ts, 7, 13)) +>y : Symbol(y, Decl(commaOperatorOtherValidOperation.ts, 7, 23)) { return x, y; ->x : Symbol(x, Decl(commaOperatorOtherValidOperation.ts, 6, 13)) ->y : Symbol(y, Decl(commaOperatorOtherValidOperation.ts, 6, 23)) +>x : Symbol(x, Decl(commaOperatorOtherValidOperation.ts, 7, 13)) +>y : Symbol(y, Decl(commaOperatorOtherValidOperation.ts, 7, 23)) } var resultIsString = foo(1, "123"); ->resultIsString : Symbol(resultIsString, Decl(commaOperatorOtherValidOperation.ts, 10, 3)) ->foo : Symbol(foo, Decl(commaOperatorOtherValidOperation.ts, 3, 1)) +>resultIsString : Symbol(resultIsString, Decl(commaOperatorOtherValidOperation.ts, 11, 3)) +>foo : Symbol(foo, Decl(commaOperatorOtherValidOperation.ts, 4, 1)) //TypeParameters function foo1() ->foo1 : Symbol(foo1, Decl(commaOperatorOtherValidOperation.ts, 10, 35)) ->T1 : Symbol(T1, Decl(commaOperatorOtherValidOperation.ts, 13, 14)) ->T2 : Symbol(T2, Decl(commaOperatorOtherValidOperation.ts, 13, 17)) +>foo1 : Symbol(foo1, Decl(commaOperatorOtherValidOperation.ts, 11, 35)) +>T1 : Symbol(T1, Decl(commaOperatorOtherValidOperation.ts, 14, 14)) +>T2 : Symbol(T2, Decl(commaOperatorOtherValidOperation.ts, 14, 17)) { var x: T1; ->x : Symbol(x, Decl(commaOperatorOtherValidOperation.ts, 15, 7)) ->T1 : Symbol(T1, Decl(commaOperatorOtherValidOperation.ts, 13, 14)) +>x : Symbol(x, Decl(commaOperatorOtherValidOperation.ts, 16, 7)) +>T1 : Symbol(T1, Decl(commaOperatorOtherValidOperation.ts, 14, 14)) var y: T2; ->y : Symbol(y, Decl(commaOperatorOtherValidOperation.ts, 16, 7)) ->T2 : Symbol(T2, Decl(commaOperatorOtherValidOperation.ts, 13, 17)) +>y : Symbol(y, Decl(commaOperatorOtherValidOperation.ts, 17, 7)) +>T2 : Symbol(T2, Decl(commaOperatorOtherValidOperation.ts, 14, 17)) x, y; ->x : Symbol(x, Decl(commaOperatorOtherValidOperation.ts, 15, 7)) ->y : Symbol(y, Decl(commaOperatorOtherValidOperation.ts, 16, 7)) +>x : Symbol(x, Decl(commaOperatorOtherValidOperation.ts, 16, 7)) +>y : Symbol(y, Decl(commaOperatorOtherValidOperation.ts, 17, 7)) var resultIsT1 = (y, x); ->resultIsT1 : Symbol(resultIsT1, Decl(commaOperatorOtherValidOperation.ts, 18, 7)) ->y : Symbol(y, Decl(commaOperatorOtherValidOperation.ts, 16, 7)) ->x : Symbol(x, Decl(commaOperatorOtherValidOperation.ts, 15, 7)) +>resultIsT1 : Symbol(resultIsT1, Decl(commaOperatorOtherValidOperation.ts, 19, 7)) +>y : Symbol(y, Decl(commaOperatorOtherValidOperation.ts, 17, 7)) +>x : Symbol(x, Decl(commaOperatorOtherValidOperation.ts, 16, 7)) } diff --git a/tests/baselines/reference/commaOperatorOtherValidOperation.types b/tests/baselines/reference/commaOperatorOtherValidOperation.types index bc7bdd81157..2691a3384bd 100644 --- a/tests/baselines/reference/commaOperatorOtherValidOperation.types +++ b/tests/baselines/reference/commaOperatorOtherValidOperation.types @@ -1,10 +1,11 @@ === tests/cases/conformance/expressions/commaOperator/commaOperatorOtherValidOperation.ts === + //Comma operator in for loop for (var i = 0, j = 10; i < j; i++, j--) >i : number ->0 : number +>0 : 0 >j : number ->10 : number +>10 : 10 >i < j : boolean >i : number >j : number @@ -31,8 +32,8 @@ var resultIsString = foo(1, "123"); >resultIsString : string >foo(1, "123") : string >foo : (x: number, y: string) => string ->1 : number ->"123" : string +>1 : 1 +>"123" : "123" //TypeParameters function foo1() diff --git a/tests/baselines/reference/commaOperatorWithSecondOperandAnyType.js b/tests/baselines/reference/commaOperatorWithSecondOperandAnyType.js index 522bbbe4e19..d7b857f9f8f 100644 --- a/tests/baselines/reference/commaOperatorWithSecondOperandAnyType.js +++ b/tests/baselines/reference/commaOperatorWithSecondOperandAnyType.js @@ -1,4 +1,5 @@ //// [commaOperatorWithSecondOperandAnyType.ts] + var ANY: any; var BOOLEAN: boolean; var NUMBER: number; diff --git a/tests/baselines/reference/commaOperatorWithSecondOperandAnyType.symbols b/tests/baselines/reference/commaOperatorWithSecondOperandAnyType.symbols index ba9618a5ecf..ecd5a3932ba 100644 --- a/tests/baselines/reference/commaOperatorWithSecondOperandAnyType.symbols +++ b/tests/baselines/reference/commaOperatorWithSecondOperandAnyType.symbols @@ -1,77 +1,78 @@ === tests/cases/conformance/expressions/commaOperator/commaOperatorWithSecondOperandAnyType.ts === + var ANY: any; ->ANY : Symbol(ANY, Decl(commaOperatorWithSecondOperandAnyType.ts, 0, 3)) +>ANY : Symbol(ANY, Decl(commaOperatorWithSecondOperandAnyType.ts, 1, 3)) var BOOLEAN: boolean; ->BOOLEAN : Symbol(BOOLEAN, Decl(commaOperatorWithSecondOperandAnyType.ts, 1, 3)) +>BOOLEAN : Symbol(BOOLEAN, Decl(commaOperatorWithSecondOperandAnyType.ts, 2, 3)) var NUMBER: number; ->NUMBER : Symbol(NUMBER, Decl(commaOperatorWithSecondOperandAnyType.ts, 2, 3)) +>NUMBER : Symbol(NUMBER, Decl(commaOperatorWithSecondOperandAnyType.ts, 3, 3)) var STRING: string; ->STRING : Symbol(STRING, Decl(commaOperatorWithSecondOperandAnyType.ts, 3, 3)) +>STRING : Symbol(STRING, Decl(commaOperatorWithSecondOperandAnyType.ts, 4, 3)) var OBJECT: Object; ->OBJECT : Symbol(OBJECT, Decl(commaOperatorWithSecondOperandAnyType.ts, 4, 3)) +>OBJECT : Symbol(OBJECT, Decl(commaOperatorWithSecondOperandAnyType.ts, 5, 3)) >Object : Symbol(Object, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) //The second operand type is any ANY, ANY; ->ANY : Symbol(ANY, Decl(commaOperatorWithSecondOperandAnyType.ts, 0, 3)) ->ANY : Symbol(ANY, Decl(commaOperatorWithSecondOperandAnyType.ts, 0, 3)) +>ANY : Symbol(ANY, Decl(commaOperatorWithSecondOperandAnyType.ts, 1, 3)) +>ANY : Symbol(ANY, Decl(commaOperatorWithSecondOperandAnyType.ts, 1, 3)) BOOLEAN, ANY; ->BOOLEAN : Symbol(BOOLEAN, Decl(commaOperatorWithSecondOperandAnyType.ts, 1, 3)) ->ANY : Symbol(ANY, Decl(commaOperatorWithSecondOperandAnyType.ts, 0, 3)) +>BOOLEAN : Symbol(BOOLEAN, Decl(commaOperatorWithSecondOperandAnyType.ts, 2, 3)) +>ANY : Symbol(ANY, Decl(commaOperatorWithSecondOperandAnyType.ts, 1, 3)) NUMBER, ANY; ->NUMBER : Symbol(NUMBER, Decl(commaOperatorWithSecondOperandAnyType.ts, 2, 3)) ->ANY : Symbol(ANY, Decl(commaOperatorWithSecondOperandAnyType.ts, 0, 3)) +>NUMBER : Symbol(NUMBER, Decl(commaOperatorWithSecondOperandAnyType.ts, 3, 3)) +>ANY : Symbol(ANY, Decl(commaOperatorWithSecondOperandAnyType.ts, 1, 3)) STRING, ANY; ->STRING : Symbol(STRING, Decl(commaOperatorWithSecondOperandAnyType.ts, 3, 3)) ->ANY : Symbol(ANY, Decl(commaOperatorWithSecondOperandAnyType.ts, 0, 3)) +>STRING : Symbol(STRING, Decl(commaOperatorWithSecondOperandAnyType.ts, 4, 3)) +>ANY : Symbol(ANY, Decl(commaOperatorWithSecondOperandAnyType.ts, 1, 3)) OBJECT, ANY; ->OBJECT : Symbol(OBJECT, Decl(commaOperatorWithSecondOperandAnyType.ts, 4, 3)) ->ANY : Symbol(ANY, Decl(commaOperatorWithSecondOperandAnyType.ts, 0, 3)) +>OBJECT : Symbol(OBJECT, Decl(commaOperatorWithSecondOperandAnyType.ts, 5, 3)) +>ANY : Symbol(ANY, Decl(commaOperatorWithSecondOperandAnyType.ts, 1, 3)) //Return type is any var resultIsAny1 = (ANY, ANY); ->resultIsAny1 : Symbol(resultIsAny1, Decl(commaOperatorWithSecondOperandAnyType.ts, 14, 3)) ->ANY : Symbol(ANY, Decl(commaOperatorWithSecondOperandAnyType.ts, 0, 3)) ->ANY : Symbol(ANY, Decl(commaOperatorWithSecondOperandAnyType.ts, 0, 3)) +>resultIsAny1 : Symbol(resultIsAny1, Decl(commaOperatorWithSecondOperandAnyType.ts, 15, 3)) +>ANY : Symbol(ANY, Decl(commaOperatorWithSecondOperandAnyType.ts, 1, 3)) +>ANY : Symbol(ANY, Decl(commaOperatorWithSecondOperandAnyType.ts, 1, 3)) var resultIsAny2 = (BOOLEAN, ANY); ->resultIsAny2 : Symbol(resultIsAny2, Decl(commaOperatorWithSecondOperandAnyType.ts, 15, 3)) ->BOOLEAN : Symbol(BOOLEAN, Decl(commaOperatorWithSecondOperandAnyType.ts, 1, 3)) ->ANY : Symbol(ANY, Decl(commaOperatorWithSecondOperandAnyType.ts, 0, 3)) +>resultIsAny2 : Symbol(resultIsAny2, Decl(commaOperatorWithSecondOperandAnyType.ts, 16, 3)) +>BOOLEAN : Symbol(BOOLEAN, Decl(commaOperatorWithSecondOperandAnyType.ts, 2, 3)) +>ANY : Symbol(ANY, Decl(commaOperatorWithSecondOperandAnyType.ts, 1, 3)) var resultIsAny3 = (NUMBER, ANY); ->resultIsAny3 : Symbol(resultIsAny3, Decl(commaOperatorWithSecondOperandAnyType.ts, 16, 3)) ->NUMBER : Symbol(NUMBER, Decl(commaOperatorWithSecondOperandAnyType.ts, 2, 3)) ->ANY : Symbol(ANY, Decl(commaOperatorWithSecondOperandAnyType.ts, 0, 3)) +>resultIsAny3 : Symbol(resultIsAny3, Decl(commaOperatorWithSecondOperandAnyType.ts, 17, 3)) +>NUMBER : Symbol(NUMBER, Decl(commaOperatorWithSecondOperandAnyType.ts, 3, 3)) +>ANY : Symbol(ANY, Decl(commaOperatorWithSecondOperandAnyType.ts, 1, 3)) var resultIsAny4 = (STRING, ANY); ->resultIsAny4 : Symbol(resultIsAny4, Decl(commaOperatorWithSecondOperandAnyType.ts, 17, 3)) ->STRING : Symbol(STRING, Decl(commaOperatorWithSecondOperandAnyType.ts, 3, 3)) ->ANY : Symbol(ANY, Decl(commaOperatorWithSecondOperandAnyType.ts, 0, 3)) +>resultIsAny4 : Symbol(resultIsAny4, Decl(commaOperatorWithSecondOperandAnyType.ts, 18, 3)) +>STRING : Symbol(STRING, Decl(commaOperatorWithSecondOperandAnyType.ts, 4, 3)) +>ANY : Symbol(ANY, Decl(commaOperatorWithSecondOperandAnyType.ts, 1, 3)) var resultIsAny5 = (OBJECT, ANY); ->resultIsAny5 : Symbol(resultIsAny5, Decl(commaOperatorWithSecondOperandAnyType.ts, 18, 3)) ->OBJECT : Symbol(OBJECT, Decl(commaOperatorWithSecondOperandAnyType.ts, 4, 3)) ->ANY : Symbol(ANY, Decl(commaOperatorWithSecondOperandAnyType.ts, 0, 3)) +>resultIsAny5 : Symbol(resultIsAny5, Decl(commaOperatorWithSecondOperandAnyType.ts, 19, 3)) +>OBJECT : Symbol(OBJECT, Decl(commaOperatorWithSecondOperandAnyType.ts, 5, 3)) +>ANY : Symbol(ANY, Decl(commaOperatorWithSecondOperandAnyType.ts, 1, 3)) //Literal and expression var x: any; ->x : Symbol(x, Decl(commaOperatorWithSecondOperandAnyType.ts, 21, 3)) +>x : Symbol(x, Decl(commaOperatorWithSecondOperandAnyType.ts, 22, 3)) 1, ANY; ->ANY : Symbol(ANY, Decl(commaOperatorWithSecondOperandAnyType.ts, 0, 3)) +>ANY : Symbol(ANY, Decl(commaOperatorWithSecondOperandAnyType.ts, 1, 3)) ++NUMBER, ANY; ->NUMBER : Symbol(NUMBER, Decl(commaOperatorWithSecondOperandAnyType.ts, 2, 3)) ->ANY : Symbol(ANY, Decl(commaOperatorWithSecondOperandAnyType.ts, 0, 3)) +>NUMBER : Symbol(NUMBER, Decl(commaOperatorWithSecondOperandAnyType.ts, 3, 3)) +>ANY : Symbol(ANY, Decl(commaOperatorWithSecondOperandAnyType.ts, 1, 3)) "string", [null, 1]; "string".charAt(0), [null, 1]; @@ -79,36 +80,36 @@ var x: any; >charAt : Symbol(String.charAt, Decl(lib.d.ts, --, --)) true, x("any"); ->x : Symbol(x, Decl(commaOperatorWithSecondOperandAnyType.ts, 21, 3)) +>x : Symbol(x, Decl(commaOperatorWithSecondOperandAnyType.ts, 22, 3)) !BOOLEAN, x.doSomeThing(); ->BOOLEAN : Symbol(BOOLEAN, Decl(commaOperatorWithSecondOperandAnyType.ts, 1, 3)) ->x : Symbol(x, Decl(commaOperatorWithSecondOperandAnyType.ts, 21, 3)) +>BOOLEAN : Symbol(BOOLEAN, Decl(commaOperatorWithSecondOperandAnyType.ts, 2, 3)) +>x : Symbol(x, Decl(commaOperatorWithSecondOperandAnyType.ts, 22, 3)) var resultIsAny6 = (1, ANY); ->resultIsAny6 : Symbol(resultIsAny6, Decl(commaOperatorWithSecondOperandAnyType.ts, 30, 3)) ->ANY : Symbol(ANY, Decl(commaOperatorWithSecondOperandAnyType.ts, 0, 3)) +>resultIsAny6 : Symbol(resultIsAny6, Decl(commaOperatorWithSecondOperandAnyType.ts, 31, 3)) +>ANY : Symbol(ANY, Decl(commaOperatorWithSecondOperandAnyType.ts, 1, 3)) var resultIsAny7 = (++NUMBER, ANY); ->resultIsAny7 : Symbol(resultIsAny7, Decl(commaOperatorWithSecondOperandAnyType.ts, 31, 3)) ->NUMBER : Symbol(NUMBER, Decl(commaOperatorWithSecondOperandAnyType.ts, 2, 3)) ->ANY : Symbol(ANY, Decl(commaOperatorWithSecondOperandAnyType.ts, 0, 3)) +>resultIsAny7 : Symbol(resultIsAny7, Decl(commaOperatorWithSecondOperandAnyType.ts, 32, 3)) +>NUMBER : Symbol(NUMBER, Decl(commaOperatorWithSecondOperandAnyType.ts, 3, 3)) +>ANY : Symbol(ANY, Decl(commaOperatorWithSecondOperandAnyType.ts, 1, 3)) var resultIsAny8 = ("string", null); ->resultIsAny8 : Symbol(resultIsAny8, Decl(commaOperatorWithSecondOperandAnyType.ts, 32, 3)) +>resultIsAny8 : Symbol(resultIsAny8, Decl(commaOperatorWithSecondOperandAnyType.ts, 33, 3)) var resultIsAny9 = ("string".charAt(0), undefined); ->resultIsAny9 : Symbol(resultIsAny9, Decl(commaOperatorWithSecondOperandAnyType.ts, 33, 3)) +>resultIsAny9 : Symbol(resultIsAny9, Decl(commaOperatorWithSecondOperandAnyType.ts, 34, 3)) >"string".charAt : Symbol(String.charAt, Decl(lib.d.ts, --, --)) >charAt : Symbol(String.charAt, Decl(lib.d.ts, --, --)) >undefined : Symbol(undefined) var resultIsAny10 = (true, x("any")); ->resultIsAny10 : Symbol(resultIsAny10, Decl(commaOperatorWithSecondOperandAnyType.ts, 34, 3)) ->x : Symbol(x, Decl(commaOperatorWithSecondOperandAnyType.ts, 21, 3)) +>resultIsAny10 : Symbol(resultIsAny10, Decl(commaOperatorWithSecondOperandAnyType.ts, 35, 3)) +>x : Symbol(x, Decl(commaOperatorWithSecondOperandAnyType.ts, 22, 3)) var resultIsAny11 = (!BOOLEAN, x.doSomeThing()); ->resultIsAny11 : Symbol(resultIsAny11, Decl(commaOperatorWithSecondOperandAnyType.ts, 35, 3)) ->BOOLEAN : Symbol(BOOLEAN, Decl(commaOperatorWithSecondOperandAnyType.ts, 1, 3)) ->x : Symbol(x, Decl(commaOperatorWithSecondOperandAnyType.ts, 21, 3)) +>resultIsAny11 : Symbol(resultIsAny11, Decl(commaOperatorWithSecondOperandAnyType.ts, 36, 3)) +>BOOLEAN : Symbol(BOOLEAN, Decl(commaOperatorWithSecondOperandAnyType.ts, 2, 3)) +>x : Symbol(x, Decl(commaOperatorWithSecondOperandAnyType.ts, 22, 3)) diff --git a/tests/baselines/reference/commaOperatorWithSecondOperandAnyType.types b/tests/baselines/reference/commaOperatorWithSecondOperandAnyType.types index a8217c2d248..b3695b74eea 100644 --- a/tests/baselines/reference/commaOperatorWithSecondOperandAnyType.types +++ b/tests/baselines/reference/commaOperatorWithSecondOperandAnyType.types @@ -1,4 +1,5 @@ === tests/cases/conformance/expressions/commaOperator/commaOperatorWithSecondOperandAnyType.ts === + var ANY: any; >ANY : any @@ -83,7 +84,7 @@ var x: any; 1, ANY; >1, ANY : any ->1 : number +>1 : 1 >ANY : any ++NUMBER, ANY; @@ -94,28 +95,28 @@ var x: any; "string", [null, 1]; >"string", [null, 1] : number[] ->"string" : string +>"string" : "string" >[null, 1] : number[] >null : null ->1 : number +>1 : 1 "string".charAt(0), [null, 1]; >"string".charAt(0), [null, 1] : number[] >"string".charAt(0) : string >"string".charAt : (pos: number) => string ->"string" : string +>"string" : "string" >charAt : (pos: number) => string ->0 : number +>0 : 0 >[null, 1] : number[] >null : null ->1 : number +>1 : 1 true, x("any"); >true, x("any") : any ->true : boolean +>true : true >x("any") : any >x : any ->"any" : string +>"any" : "any" !BOOLEAN, x.doSomeThing(); >!BOOLEAN, x.doSomeThing() : any @@ -130,7 +131,7 @@ var resultIsAny6 = (1, ANY); >resultIsAny6 : any >(1, ANY) : any >1, ANY : any ->1 : number +>1 : 1 >ANY : any var resultIsAny7 = (++NUMBER, ANY); @@ -145,7 +146,7 @@ var resultIsAny8 = ("string", null); >resultIsAny8 : any >("string", null) : null >"string", null : null ->"string" : string +>"string" : "string" >null : null var resultIsAny9 = ("string".charAt(0), undefined); @@ -154,19 +155,19 @@ var resultIsAny9 = ("string".charAt(0), undefined); >"string".charAt(0), undefined : undefined >"string".charAt(0) : string >"string".charAt : (pos: number) => string ->"string" : string +>"string" : "string" >charAt : (pos: number) => string ->0 : number +>0 : 0 >undefined : undefined var resultIsAny10 = (true, x("any")); >resultIsAny10 : any >(true, x("any")) : any >true, x("any") : any ->true : boolean +>true : true >x("any") : any >x : any ->"any" : string +>"any" : "any" var resultIsAny11 = (!BOOLEAN, x.doSomeThing()); >resultIsAny11 : any diff --git a/tests/baselines/reference/commaOperatorWithSecondOperandBooleanType.js b/tests/baselines/reference/commaOperatorWithSecondOperandBooleanType.js index dfaba1a93ca..92996fe679d 100644 --- a/tests/baselines/reference/commaOperatorWithSecondOperandBooleanType.js +++ b/tests/baselines/reference/commaOperatorWithSecondOperandBooleanType.js @@ -1,4 +1,5 @@ //// [commaOperatorWithSecondOperandBooleanType.ts] + var ANY: any; var BOOLEAN: boolean; var NUMBER: number; diff --git a/tests/baselines/reference/commaOperatorWithSecondOperandBooleanType.symbols b/tests/baselines/reference/commaOperatorWithSecondOperandBooleanType.symbols index 9be885bf41c..2ea892ad16e 100644 --- a/tests/baselines/reference/commaOperatorWithSecondOperandBooleanType.symbols +++ b/tests/baselines/reference/commaOperatorWithSecondOperandBooleanType.symbols @@ -1,110 +1,111 @@ === tests/cases/conformance/expressions/commaOperator/commaOperatorWithSecondOperandBooleanType.ts === + var ANY: any; ->ANY : Symbol(ANY, Decl(commaOperatorWithSecondOperandBooleanType.ts, 0, 3)) +>ANY : Symbol(ANY, Decl(commaOperatorWithSecondOperandBooleanType.ts, 1, 3)) var BOOLEAN: boolean; ->BOOLEAN : Symbol(BOOLEAN, Decl(commaOperatorWithSecondOperandBooleanType.ts, 1, 3)) +>BOOLEAN : Symbol(BOOLEAN, Decl(commaOperatorWithSecondOperandBooleanType.ts, 2, 3)) var NUMBER: number; ->NUMBER : Symbol(NUMBER, Decl(commaOperatorWithSecondOperandBooleanType.ts, 2, 3)) +>NUMBER : Symbol(NUMBER, Decl(commaOperatorWithSecondOperandBooleanType.ts, 3, 3)) var STRING: string; ->STRING : Symbol(STRING, Decl(commaOperatorWithSecondOperandBooleanType.ts, 3, 3)) +>STRING : Symbol(STRING, Decl(commaOperatorWithSecondOperandBooleanType.ts, 4, 3)) var OBJECT: Object; ->OBJECT : Symbol(OBJECT, Decl(commaOperatorWithSecondOperandBooleanType.ts, 4, 3)) +>OBJECT : Symbol(OBJECT, Decl(commaOperatorWithSecondOperandBooleanType.ts, 5, 3)) >Object : Symbol(Object, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) //The second operand type is boolean ANY, BOOLEAN; ->ANY : Symbol(ANY, Decl(commaOperatorWithSecondOperandBooleanType.ts, 0, 3)) ->BOOLEAN : Symbol(BOOLEAN, Decl(commaOperatorWithSecondOperandBooleanType.ts, 1, 3)) +>ANY : Symbol(ANY, Decl(commaOperatorWithSecondOperandBooleanType.ts, 1, 3)) +>BOOLEAN : Symbol(BOOLEAN, Decl(commaOperatorWithSecondOperandBooleanType.ts, 2, 3)) BOOLEAN, BOOLEAN; ->BOOLEAN : Symbol(BOOLEAN, Decl(commaOperatorWithSecondOperandBooleanType.ts, 1, 3)) ->BOOLEAN : Symbol(BOOLEAN, Decl(commaOperatorWithSecondOperandBooleanType.ts, 1, 3)) +>BOOLEAN : Symbol(BOOLEAN, Decl(commaOperatorWithSecondOperandBooleanType.ts, 2, 3)) +>BOOLEAN : Symbol(BOOLEAN, Decl(commaOperatorWithSecondOperandBooleanType.ts, 2, 3)) NUMBER, BOOLEAN; ->NUMBER : Symbol(NUMBER, Decl(commaOperatorWithSecondOperandBooleanType.ts, 2, 3)) ->BOOLEAN : Symbol(BOOLEAN, Decl(commaOperatorWithSecondOperandBooleanType.ts, 1, 3)) +>NUMBER : Symbol(NUMBER, Decl(commaOperatorWithSecondOperandBooleanType.ts, 3, 3)) +>BOOLEAN : Symbol(BOOLEAN, Decl(commaOperatorWithSecondOperandBooleanType.ts, 2, 3)) STRING, BOOLEAN; ->STRING : Symbol(STRING, Decl(commaOperatorWithSecondOperandBooleanType.ts, 3, 3)) ->BOOLEAN : Symbol(BOOLEAN, Decl(commaOperatorWithSecondOperandBooleanType.ts, 1, 3)) +>STRING : Symbol(STRING, Decl(commaOperatorWithSecondOperandBooleanType.ts, 4, 3)) +>BOOLEAN : Symbol(BOOLEAN, Decl(commaOperatorWithSecondOperandBooleanType.ts, 2, 3)) OBJECT, BOOLEAN; ->OBJECT : Symbol(OBJECT, Decl(commaOperatorWithSecondOperandBooleanType.ts, 4, 3)) ->BOOLEAN : Symbol(BOOLEAN, Decl(commaOperatorWithSecondOperandBooleanType.ts, 1, 3)) +>OBJECT : Symbol(OBJECT, Decl(commaOperatorWithSecondOperandBooleanType.ts, 5, 3)) +>BOOLEAN : Symbol(BOOLEAN, Decl(commaOperatorWithSecondOperandBooleanType.ts, 2, 3)) //Return type is boolean var resultIsBoolean1 = (ANY, BOOLEAN); ->resultIsBoolean1 : Symbol(resultIsBoolean1, Decl(commaOperatorWithSecondOperandBooleanType.ts, 14, 3)) ->ANY : Symbol(ANY, Decl(commaOperatorWithSecondOperandBooleanType.ts, 0, 3)) ->BOOLEAN : Symbol(BOOLEAN, Decl(commaOperatorWithSecondOperandBooleanType.ts, 1, 3)) +>resultIsBoolean1 : Symbol(resultIsBoolean1, Decl(commaOperatorWithSecondOperandBooleanType.ts, 15, 3)) +>ANY : Symbol(ANY, Decl(commaOperatorWithSecondOperandBooleanType.ts, 1, 3)) +>BOOLEAN : Symbol(BOOLEAN, Decl(commaOperatorWithSecondOperandBooleanType.ts, 2, 3)) var resultIsBoolean2 = (BOOLEAN, BOOLEAN); ->resultIsBoolean2 : Symbol(resultIsBoolean2, Decl(commaOperatorWithSecondOperandBooleanType.ts, 15, 3)) ->BOOLEAN : Symbol(BOOLEAN, Decl(commaOperatorWithSecondOperandBooleanType.ts, 1, 3)) ->BOOLEAN : Symbol(BOOLEAN, Decl(commaOperatorWithSecondOperandBooleanType.ts, 1, 3)) +>resultIsBoolean2 : Symbol(resultIsBoolean2, Decl(commaOperatorWithSecondOperandBooleanType.ts, 16, 3)) +>BOOLEAN : Symbol(BOOLEAN, Decl(commaOperatorWithSecondOperandBooleanType.ts, 2, 3)) +>BOOLEAN : Symbol(BOOLEAN, Decl(commaOperatorWithSecondOperandBooleanType.ts, 2, 3)) var resultIsBoolean3 = (NUMBER, BOOLEAN); ->resultIsBoolean3 : Symbol(resultIsBoolean3, Decl(commaOperatorWithSecondOperandBooleanType.ts, 16, 3)) ->NUMBER : Symbol(NUMBER, Decl(commaOperatorWithSecondOperandBooleanType.ts, 2, 3)) ->BOOLEAN : Symbol(BOOLEAN, Decl(commaOperatorWithSecondOperandBooleanType.ts, 1, 3)) +>resultIsBoolean3 : Symbol(resultIsBoolean3, Decl(commaOperatorWithSecondOperandBooleanType.ts, 17, 3)) +>NUMBER : Symbol(NUMBER, Decl(commaOperatorWithSecondOperandBooleanType.ts, 3, 3)) +>BOOLEAN : Symbol(BOOLEAN, Decl(commaOperatorWithSecondOperandBooleanType.ts, 2, 3)) var resultIsBoolean4 = (STRING, BOOLEAN); ->resultIsBoolean4 : Symbol(resultIsBoolean4, Decl(commaOperatorWithSecondOperandBooleanType.ts, 17, 3)) ->STRING : Symbol(STRING, Decl(commaOperatorWithSecondOperandBooleanType.ts, 3, 3)) ->BOOLEAN : Symbol(BOOLEAN, Decl(commaOperatorWithSecondOperandBooleanType.ts, 1, 3)) +>resultIsBoolean4 : Symbol(resultIsBoolean4, Decl(commaOperatorWithSecondOperandBooleanType.ts, 18, 3)) +>STRING : Symbol(STRING, Decl(commaOperatorWithSecondOperandBooleanType.ts, 4, 3)) +>BOOLEAN : Symbol(BOOLEAN, Decl(commaOperatorWithSecondOperandBooleanType.ts, 2, 3)) var resultIsBoolean5 = (OBJECT, BOOLEAN); ->resultIsBoolean5 : Symbol(resultIsBoolean5, Decl(commaOperatorWithSecondOperandBooleanType.ts, 18, 3)) ->OBJECT : Symbol(OBJECT, Decl(commaOperatorWithSecondOperandBooleanType.ts, 4, 3)) ->BOOLEAN : Symbol(BOOLEAN, Decl(commaOperatorWithSecondOperandBooleanType.ts, 1, 3)) +>resultIsBoolean5 : Symbol(resultIsBoolean5, Decl(commaOperatorWithSecondOperandBooleanType.ts, 19, 3)) +>OBJECT : Symbol(OBJECT, Decl(commaOperatorWithSecondOperandBooleanType.ts, 5, 3)) +>BOOLEAN : Symbol(BOOLEAN, Decl(commaOperatorWithSecondOperandBooleanType.ts, 2, 3)) //Literal and expression null, BOOLEAN; ->BOOLEAN : Symbol(BOOLEAN, Decl(commaOperatorWithSecondOperandBooleanType.ts, 1, 3)) +>BOOLEAN : Symbol(BOOLEAN, Decl(commaOperatorWithSecondOperandBooleanType.ts, 2, 3)) ANY = undefined, BOOLEAN; ->ANY : Symbol(ANY, Decl(commaOperatorWithSecondOperandBooleanType.ts, 0, 3)) +>ANY : Symbol(ANY, Decl(commaOperatorWithSecondOperandBooleanType.ts, 1, 3)) >undefined : Symbol(undefined) ->BOOLEAN : Symbol(BOOLEAN, Decl(commaOperatorWithSecondOperandBooleanType.ts, 1, 3)) +>BOOLEAN : Symbol(BOOLEAN, Decl(commaOperatorWithSecondOperandBooleanType.ts, 2, 3)) 1, true; ++NUMBER, true; ->NUMBER : Symbol(NUMBER, Decl(commaOperatorWithSecondOperandBooleanType.ts, 2, 3)) +>NUMBER : Symbol(NUMBER, Decl(commaOperatorWithSecondOperandBooleanType.ts, 3, 3)) [1, 2, 3], !BOOLEAN; ->BOOLEAN : Symbol(BOOLEAN, Decl(commaOperatorWithSecondOperandBooleanType.ts, 1, 3)) +>BOOLEAN : Symbol(BOOLEAN, Decl(commaOperatorWithSecondOperandBooleanType.ts, 2, 3)) OBJECT = [1, 2, 3], BOOLEAN = false; ->OBJECT : Symbol(OBJECT, Decl(commaOperatorWithSecondOperandBooleanType.ts, 4, 3)) ->BOOLEAN : Symbol(BOOLEAN, Decl(commaOperatorWithSecondOperandBooleanType.ts, 1, 3)) +>OBJECT : Symbol(OBJECT, Decl(commaOperatorWithSecondOperandBooleanType.ts, 5, 3)) +>BOOLEAN : Symbol(BOOLEAN, Decl(commaOperatorWithSecondOperandBooleanType.ts, 2, 3)) var resultIsBoolean6 = (null, BOOLEAN); ->resultIsBoolean6 : Symbol(resultIsBoolean6, Decl(commaOperatorWithSecondOperandBooleanType.ts, 28, 3)) ->BOOLEAN : Symbol(BOOLEAN, Decl(commaOperatorWithSecondOperandBooleanType.ts, 1, 3)) +>resultIsBoolean6 : Symbol(resultIsBoolean6, Decl(commaOperatorWithSecondOperandBooleanType.ts, 29, 3)) +>BOOLEAN : Symbol(BOOLEAN, Decl(commaOperatorWithSecondOperandBooleanType.ts, 2, 3)) var resultIsBoolean7 = (ANY = undefined, BOOLEAN); ->resultIsBoolean7 : Symbol(resultIsBoolean7, Decl(commaOperatorWithSecondOperandBooleanType.ts, 29, 3)) ->ANY : Symbol(ANY, Decl(commaOperatorWithSecondOperandBooleanType.ts, 0, 3)) +>resultIsBoolean7 : Symbol(resultIsBoolean7, Decl(commaOperatorWithSecondOperandBooleanType.ts, 30, 3)) +>ANY : Symbol(ANY, Decl(commaOperatorWithSecondOperandBooleanType.ts, 1, 3)) >undefined : Symbol(undefined) ->BOOLEAN : Symbol(BOOLEAN, Decl(commaOperatorWithSecondOperandBooleanType.ts, 1, 3)) +>BOOLEAN : Symbol(BOOLEAN, Decl(commaOperatorWithSecondOperandBooleanType.ts, 2, 3)) var resultIsBoolean8 = (1, true); ->resultIsBoolean8 : Symbol(resultIsBoolean8, Decl(commaOperatorWithSecondOperandBooleanType.ts, 30, 3)) +>resultIsBoolean8 : Symbol(resultIsBoolean8, Decl(commaOperatorWithSecondOperandBooleanType.ts, 31, 3)) var resultIsBoolean9 = (++NUMBER, true); ->resultIsBoolean9 : Symbol(resultIsBoolean9, Decl(commaOperatorWithSecondOperandBooleanType.ts, 31, 3)) ->NUMBER : Symbol(NUMBER, Decl(commaOperatorWithSecondOperandBooleanType.ts, 2, 3)) +>resultIsBoolean9 : Symbol(resultIsBoolean9, Decl(commaOperatorWithSecondOperandBooleanType.ts, 32, 3)) +>NUMBER : Symbol(NUMBER, Decl(commaOperatorWithSecondOperandBooleanType.ts, 3, 3)) var resultIsBoolean10 = ([1, 2, 3], !BOOLEAN); ->resultIsBoolean10 : Symbol(resultIsBoolean10, Decl(commaOperatorWithSecondOperandBooleanType.ts, 32, 3)) ->BOOLEAN : Symbol(BOOLEAN, Decl(commaOperatorWithSecondOperandBooleanType.ts, 1, 3)) +>resultIsBoolean10 : Symbol(resultIsBoolean10, Decl(commaOperatorWithSecondOperandBooleanType.ts, 33, 3)) +>BOOLEAN : Symbol(BOOLEAN, Decl(commaOperatorWithSecondOperandBooleanType.ts, 2, 3)) var resultIsBoolean11 = (OBJECT = [1, 2, 3], BOOLEAN = false); ->resultIsBoolean11 : Symbol(resultIsBoolean11, Decl(commaOperatorWithSecondOperandBooleanType.ts, 33, 3)) ->OBJECT : Symbol(OBJECT, Decl(commaOperatorWithSecondOperandBooleanType.ts, 4, 3)) ->BOOLEAN : Symbol(BOOLEAN, Decl(commaOperatorWithSecondOperandBooleanType.ts, 1, 3)) +>resultIsBoolean11 : Symbol(resultIsBoolean11, Decl(commaOperatorWithSecondOperandBooleanType.ts, 34, 3)) +>OBJECT : Symbol(OBJECT, Decl(commaOperatorWithSecondOperandBooleanType.ts, 5, 3)) +>BOOLEAN : Symbol(BOOLEAN, Decl(commaOperatorWithSecondOperandBooleanType.ts, 2, 3)) diff --git a/tests/baselines/reference/commaOperatorWithSecondOperandBooleanType.types b/tests/baselines/reference/commaOperatorWithSecondOperandBooleanType.types index dba5285d880..64167f22e6c 100644 --- a/tests/baselines/reference/commaOperatorWithSecondOperandBooleanType.types +++ b/tests/baselines/reference/commaOperatorWithSecondOperandBooleanType.types @@ -1,4 +1,5 @@ === tests/cases/conformance/expressions/commaOperator/commaOperatorWithSecondOperandBooleanType.ts === + var ANY: any; >ANY : any @@ -91,90 +92,90 @@ ANY = undefined, BOOLEAN; >BOOLEAN : boolean 1, true; ->1, true : boolean ->1 : number ->true : boolean +>1, true : true +>1 : 1 +>true : true ++NUMBER, true; ->++NUMBER, true : boolean +>++NUMBER, true : true >++NUMBER : number >NUMBER : number ->true : boolean +>true : true [1, 2, 3], !BOOLEAN; >[1, 2, 3], !BOOLEAN : boolean >[1, 2, 3] : number[] ->1 : number ->2 : number ->3 : number +>1 : 1 +>2 : 2 +>3 : 3 >!BOOLEAN : boolean >BOOLEAN : boolean OBJECT = [1, 2, 3], BOOLEAN = false; ->OBJECT = [1, 2, 3], BOOLEAN = false : boolean +>OBJECT = [1, 2, 3], BOOLEAN = false : false >OBJECT = [1, 2, 3] : number[] >OBJECT : Object >[1, 2, 3] : number[] ->1 : number ->2 : number ->3 : number ->BOOLEAN = false : boolean +>1 : 1 +>2 : 2 +>3 : 3 +>BOOLEAN = false : false >BOOLEAN : boolean ->false : boolean +>false : false var resultIsBoolean6 = (null, BOOLEAN); >resultIsBoolean6 : boolean ->(null, BOOLEAN) : boolean ->null, BOOLEAN : boolean +>(null, BOOLEAN) : false +>null, BOOLEAN : false >null : null ->BOOLEAN : boolean +>BOOLEAN : false var resultIsBoolean7 = (ANY = undefined, BOOLEAN); >resultIsBoolean7 : boolean ->(ANY = undefined, BOOLEAN) : boolean ->ANY = undefined, BOOLEAN : boolean +>(ANY = undefined, BOOLEAN) : false +>ANY = undefined, BOOLEAN : false >ANY = undefined : undefined >ANY : any >undefined : undefined ->BOOLEAN : boolean +>BOOLEAN : false var resultIsBoolean8 = (1, true); >resultIsBoolean8 : boolean ->(1, true) : boolean ->1, true : boolean ->1 : number ->true : boolean +>(1, true) : true +>1, true : true +>1 : 1 +>true : true var resultIsBoolean9 = (++NUMBER, true); >resultIsBoolean9 : boolean ->(++NUMBER, true) : boolean ->++NUMBER, true : boolean +>(++NUMBER, true) : true +>++NUMBER, true : true >++NUMBER : number >NUMBER : number ->true : boolean +>true : true var resultIsBoolean10 = ([1, 2, 3], !BOOLEAN); >resultIsBoolean10 : boolean ->([1, 2, 3], !BOOLEAN) : boolean ->[1, 2, 3], !BOOLEAN : boolean +>([1, 2, 3], !BOOLEAN) : true +>[1, 2, 3], !BOOLEAN : true >[1, 2, 3] : number[] ->1 : number ->2 : number ->3 : number ->!BOOLEAN : boolean ->BOOLEAN : boolean +>1 : 1 +>2 : 2 +>3 : 3 +>!BOOLEAN : true +>BOOLEAN : false var resultIsBoolean11 = (OBJECT = [1, 2, 3], BOOLEAN = false); >resultIsBoolean11 : boolean ->(OBJECT = [1, 2, 3], BOOLEAN = false) : boolean ->OBJECT = [1, 2, 3], BOOLEAN = false : boolean +>(OBJECT = [1, 2, 3], BOOLEAN = false) : false +>OBJECT = [1, 2, 3], BOOLEAN = false : false >OBJECT = [1, 2, 3] : number[] >OBJECT : Object >[1, 2, 3] : number[] ->1 : number ->2 : number ->3 : number ->BOOLEAN = false : boolean +>1 : 1 +>2 : 2 +>3 : 3 +>BOOLEAN = false : false >BOOLEAN : boolean ->false : boolean +>false : false diff --git a/tests/baselines/reference/commaOperatorWithSecondOperandNumberType.js b/tests/baselines/reference/commaOperatorWithSecondOperandNumberType.js index b5b8887e749..45d38c9c9c5 100644 --- a/tests/baselines/reference/commaOperatorWithSecondOperandNumberType.js +++ b/tests/baselines/reference/commaOperatorWithSecondOperandNumberType.js @@ -1,4 +1,5 @@ //// [commaOperatorWithSecondOperandNumberType.ts] + var ANY: any; var BOOLEAN: boolean; var NUMBER: number; diff --git a/tests/baselines/reference/commaOperatorWithSecondOperandNumberType.symbols b/tests/baselines/reference/commaOperatorWithSecondOperandNumberType.symbols index bf5ff9437a3..3e6fdfd9ef8 100644 --- a/tests/baselines/reference/commaOperatorWithSecondOperandNumberType.symbols +++ b/tests/baselines/reference/commaOperatorWithSecondOperandNumberType.symbols @@ -1,114 +1,115 @@ === tests/cases/conformance/expressions/commaOperator/commaOperatorWithSecondOperandNumberType.ts === + var ANY: any; ->ANY : Symbol(ANY, Decl(commaOperatorWithSecondOperandNumberType.ts, 0, 3)) +>ANY : Symbol(ANY, Decl(commaOperatorWithSecondOperandNumberType.ts, 1, 3)) var BOOLEAN: boolean; ->BOOLEAN : Symbol(BOOLEAN, Decl(commaOperatorWithSecondOperandNumberType.ts, 1, 3)) +>BOOLEAN : Symbol(BOOLEAN, Decl(commaOperatorWithSecondOperandNumberType.ts, 2, 3)) var NUMBER: number; ->NUMBER : Symbol(NUMBER, Decl(commaOperatorWithSecondOperandNumberType.ts, 2, 3)) +>NUMBER : Symbol(NUMBER, Decl(commaOperatorWithSecondOperandNumberType.ts, 3, 3)) var STRING: string; ->STRING : Symbol(STRING, Decl(commaOperatorWithSecondOperandNumberType.ts, 3, 3)) +>STRING : Symbol(STRING, Decl(commaOperatorWithSecondOperandNumberType.ts, 4, 3)) var OBJECT: Object; ->OBJECT : Symbol(OBJECT, Decl(commaOperatorWithSecondOperandNumberType.ts, 4, 3)) +>OBJECT : Symbol(OBJECT, Decl(commaOperatorWithSecondOperandNumberType.ts, 5, 3)) >Object : Symbol(Object, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) //The second operand type is number ANY, NUMBER; ->ANY : Symbol(ANY, Decl(commaOperatorWithSecondOperandNumberType.ts, 0, 3)) ->NUMBER : Symbol(NUMBER, Decl(commaOperatorWithSecondOperandNumberType.ts, 2, 3)) +>ANY : Symbol(ANY, Decl(commaOperatorWithSecondOperandNumberType.ts, 1, 3)) +>NUMBER : Symbol(NUMBER, Decl(commaOperatorWithSecondOperandNumberType.ts, 3, 3)) BOOLEAN, NUMBER; ->BOOLEAN : Symbol(BOOLEAN, Decl(commaOperatorWithSecondOperandNumberType.ts, 1, 3)) ->NUMBER : Symbol(NUMBER, Decl(commaOperatorWithSecondOperandNumberType.ts, 2, 3)) +>BOOLEAN : Symbol(BOOLEAN, Decl(commaOperatorWithSecondOperandNumberType.ts, 2, 3)) +>NUMBER : Symbol(NUMBER, Decl(commaOperatorWithSecondOperandNumberType.ts, 3, 3)) NUMBER, NUMBER; ->NUMBER : Symbol(NUMBER, Decl(commaOperatorWithSecondOperandNumberType.ts, 2, 3)) ->NUMBER : Symbol(NUMBER, Decl(commaOperatorWithSecondOperandNumberType.ts, 2, 3)) +>NUMBER : Symbol(NUMBER, Decl(commaOperatorWithSecondOperandNumberType.ts, 3, 3)) +>NUMBER : Symbol(NUMBER, Decl(commaOperatorWithSecondOperandNumberType.ts, 3, 3)) STRING, NUMBER; ->STRING : Symbol(STRING, Decl(commaOperatorWithSecondOperandNumberType.ts, 3, 3)) ->NUMBER : Symbol(NUMBER, Decl(commaOperatorWithSecondOperandNumberType.ts, 2, 3)) +>STRING : Symbol(STRING, Decl(commaOperatorWithSecondOperandNumberType.ts, 4, 3)) +>NUMBER : Symbol(NUMBER, Decl(commaOperatorWithSecondOperandNumberType.ts, 3, 3)) OBJECT, NUMBER; ->OBJECT : Symbol(OBJECT, Decl(commaOperatorWithSecondOperandNumberType.ts, 4, 3)) ->NUMBER : Symbol(NUMBER, Decl(commaOperatorWithSecondOperandNumberType.ts, 2, 3)) +>OBJECT : Symbol(OBJECT, Decl(commaOperatorWithSecondOperandNumberType.ts, 5, 3)) +>NUMBER : Symbol(NUMBER, Decl(commaOperatorWithSecondOperandNumberType.ts, 3, 3)) //Return type is number var resultIsNumber1 = (ANY, NUMBER); ->resultIsNumber1 : Symbol(resultIsNumber1, Decl(commaOperatorWithSecondOperandNumberType.ts, 14, 3)) ->ANY : Symbol(ANY, Decl(commaOperatorWithSecondOperandNumberType.ts, 0, 3)) ->NUMBER : Symbol(NUMBER, Decl(commaOperatorWithSecondOperandNumberType.ts, 2, 3)) +>resultIsNumber1 : Symbol(resultIsNumber1, Decl(commaOperatorWithSecondOperandNumberType.ts, 15, 3)) +>ANY : Symbol(ANY, Decl(commaOperatorWithSecondOperandNumberType.ts, 1, 3)) +>NUMBER : Symbol(NUMBER, Decl(commaOperatorWithSecondOperandNumberType.ts, 3, 3)) var resultIsNumber2 = (BOOLEAN, NUMBER); ->resultIsNumber2 : Symbol(resultIsNumber2, Decl(commaOperatorWithSecondOperandNumberType.ts, 15, 3)) ->BOOLEAN : Symbol(BOOLEAN, Decl(commaOperatorWithSecondOperandNumberType.ts, 1, 3)) ->NUMBER : Symbol(NUMBER, Decl(commaOperatorWithSecondOperandNumberType.ts, 2, 3)) +>resultIsNumber2 : Symbol(resultIsNumber2, Decl(commaOperatorWithSecondOperandNumberType.ts, 16, 3)) +>BOOLEAN : Symbol(BOOLEAN, Decl(commaOperatorWithSecondOperandNumberType.ts, 2, 3)) +>NUMBER : Symbol(NUMBER, Decl(commaOperatorWithSecondOperandNumberType.ts, 3, 3)) var resultIsNumber3 = (NUMBER, NUMBER); ->resultIsNumber3 : Symbol(resultIsNumber3, Decl(commaOperatorWithSecondOperandNumberType.ts, 16, 3)) ->NUMBER : Symbol(NUMBER, Decl(commaOperatorWithSecondOperandNumberType.ts, 2, 3)) ->NUMBER : Symbol(NUMBER, Decl(commaOperatorWithSecondOperandNumberType.ts, 2, 3)) +>resultIsNumber3 : Symbol(resultIsNumber3, Decl(commaOperatorWithSecondOperandNumberType.ts, 17, 3)) +>NUMBER : Symbol(NUMBER, Decl(commaOperatorWithSecondOperandNumberType.ts, 3, 3)) +>NUMBER : Symbol(NUMBER, Decl(commaOperatorWithSecondOperandNumberType.ts, 3, 3)) var resultIsNumber4 = (STRING, NUMBER); ->resultIsNumber4 : Symbol(resultIsNumber4, Decl(commaOperatorWithSecondOperandNumberType.ts, 17, 3)) ->STRING : Symbol(STRING, Decl(commaOperatorWithSecondOperandNumberType.ts, 3, 3)) ->NUMBER : Symbol(NUMBER, Decl(commaOperatorWithSecondOperandNumberType.ts, 2, 3)) +>resultIsNumber4 : Symbol(resultIsNumber4, Decl(commaOperatorWithSecondOperandNumberType.ts, 18, 3)) +>STRING : Symbol(STRING, Decl(commaOperatorWithSecondOperandNumberType.ts, 4, 3)) +>NUMBER : Symbol(NUMBER, Decl(commaOperatorWithSecondOperandNumberType.ts, 3, 3)) var resultIsNumber5 = (OBJECT, NUMBER); ->resultIsNumber5 : Symbol(resultIsNumber5, Decl(commaOperatorWithSecondOperandNumberType.ts, 18, 3)) ->OBJECT : Symbol(OBJECT, Decl(commaOperatorWithSecondOperandNumberType.ts, 4, 3)) ->NUMBER : Symbol(NUMBER, Decl(commaOperatorWithSecondOperandNumberType.ts, 2, 3)) +>resultIsNumber5 : Symbol(resultIsNumber5, Decl(commaOperatorWithSecondOperandNumberType.ts, 19, 3)) +>OBJECT : Symbol(OBJECT, Decl(commaOperatorWithSecondOperandNumberType.ts, 5, 3)) +>NUMBER : Symbol(NUMBER, Decl(commaOperatorWithSecondOperandNumberType.ts, 3, 3)) //Literal and expression null, NUMBER; ->NUMBER : Symbol(NUMBER, Decl(commaOperatorWithSecondOperandNumberType.ts, 2, 3)) +>NUMBER : Symbol(NUMBER, Decl(commaOperatorWithSecondOperandNumberType.ts, 3, 3)) ANY = undefined, NUMBER; ->ANY : Symbol(ANY, Decl(commaOperatorWithSecondOperandNumberType.ts, 0, 3)) +>ANY : Symbol(ANY, Decl(commaOperatorWithSecondOperandNumberType.ts, 1, 3)) >undefined : Symbol(undefined) ->NUMBER : Symbol(NUMBER, Decl(commaOperatorWithSecondOperandNumberType.ts, 2, 3)) +>NUMBER : Symbol(NUMBER, Decl(commaOperatorWithSecondOperandNumberType.ts, 3, 3)) true, 1; BOOLEAN = false, 1; ->BOOLEAN : Symbol(BOOLEAN, Decl(commaOperatorWithSecondOperandNumberType.ts, 1, 3)) +>BOOLEAN : Symbol(BOOLEAN, Decl(commaOperatorWithSecondOperandNumberType.ts, 2, 3)) "", NUMBER = 1; ->NUMBER : Symbol(NUMBER, Decl(commaOperatorWithSecondOperandNumberType.ts, 2, 3)) +>NUMBER : Symbol(NUMBER, Decl(commaOperatorWithSecondOperandNumberType.ts, 3, 3)) STRING.trim(), NUMBER = 1; >STRING.trim : Symbol(String.trim, Decl(lib.d.ts, --, --)) ->STRING : Symbol(STRING, Decl(commaOperatorWithSecondOperandNumberType.ts, 3, 3)) +>STRING : Symbol(STRING, Decl(commaOperatorWithSecondOperandNumberType.ts, 4, 3)) >trim : Symbol(String.trim, Decl(lib.d.ts, --, --)) ->NUMBER : Symbol(NUMBER, Decl(commaOperatorWithSecondOperandNumberType.ts, 2, 3)) +>NUMBER : Symbol(NUMBER, Decl(commaOperatorWithSecondOperandNumberType.ts, 3, 3)) var resultIsNumber6 = (null, NUMBER); ->resultIsNumber6 : Symbol(resultIsNumber6, Decl(commaOperatorWithSecondOperandNumberType.ts, 28, 3)) ->NUMBER : Symbol(NUMBER, Decl(commaOperatorWithSecondOperandNumberType.ts, 2, 3)) +>resultIsNumber6 : Symbol(resultIsNumber6, Decl(commaOperatorWithSecondOperandNumberType.ts, 29, 3)) +>NUMBER : Symbol(NUMBER, Decl(commaOperatorWithSecondOperandNumberType.ts, 3, 3)) var resultIsNumber7 = (ANY = undefined, NUMBER); ->resultIsNumber7 : Symbol(resultIsNumber7, Decl(commaOperatorWithSecondOperandNumberType.ts, 29, 3)) ->ANY : Symbol(ANY, Decl(commaOperatorWithSecondOperandNumberType.ts, 0, 3)) +>resultIsNumber7 : Symbol(resultIsNumber7, Decl(commaOperatorWithSecondOperandNumberType.ts, 30, 3)) +>ANY : Symbol(ANY, Decl(commaOperatorWithSecondOperandNumberType.ts, 1, 3)) >undefined : Symbol(undefined) ->NUMBER : Symbol(NUMBER, Decl(commaOperatorWithSecondOperandNumberType.ts, 2, 3)) +>NUMBER : Symbol(NUMBER, Decl(commaOperatorWithSecondOperandNumberType.ts, 3, 3)) var resultIsNumber8 = (true, 1); ->resultIsNumber8 : Symbol(resultIsNumber8, Decl(commaOperatorWithSecondOperandNumberType.ts, 30, 3)) +>resultIsNumber8 : Symbol(resultIsNumber8, Decl(commaOperatorWithSecondOperandNumberType.ts, 31, 3)) var resultIsNumber9 = (BOOLEAN = false, 1); ->resultIsNumber9 : Symbol(resultIsNumber9, Decl(commaOperatorWithSecondOperandNumberType.ts, 31, 3)) ->BOOLEAN : Symbol(BOOLEAN, Decl(commaOperatorWithSecondOperandNumberType.ts, 1, 3)) +>resultIsNumber9 : Symbol(resultIsNumber9, Decl(commaOperatorWithSecondOperandNumberType.ts, 32, 3)) +>BOOLEAN : Symbol(BOOLEAN, Decl(commaOperatorWithSecondOperandNumberType.ts, 2, 3)) var resultIsNumber10 = ("", NUMBER = 1); ->resultIsNumber10 : Symbol(resultIsNumber10, Decl(commaOperatorWithSecondOperandNumberType.ts, 32, 3)) ->NUMBER : Symbol(NUMBER, Decl(commaOperatorWithSecondOperandNumberType.ts, 2, 3)) +>resultIsNumber10 : Symbol(resultIsNumber10, Decl(commaOperatorWithSecondOperandNumberType.ts, 33, 3)) +>NUMBER : Symbol(NUMBER, Decl(commaOperatorWithSecondOperandNumberType.ts, 3, 3)) var resultIsNumber11 = (STRING.trim(), NUMBER = 1); ->resultIsNumber11 : Symbol(resultIsNumber11, Decl(commaOperatorWithSecondOperandNumberType.ts, 33, 3)) +>resultIsNumber11 : Symbol(resultIsNumber11, Decl(commaOperatorWithSecondOperandNumberType.ts, 34, 3)) >STRING.trim : Symbol(String.trim, Decl(lib.d.ts, --, --)) ->STRING : Symbol(STRING, Decl(commaOperatorWithSecondOperandNumberType.ts, 3, 3)) +>STRING : Symbol(STRING, Decl(commaOperatorWithSecondOperandNumberType.ts, 4, 3)) >trim : Symbol(String.trim, Decl(lib.d.ts, --, --)) ->NUMBER : Symbol(NUMBER, Decl(commaOperatorWithSecondOperandNumberType.ts, 2, 3)) +>NUMBER : Symbol(NUMBER, Decl(commaOperatorWithSecondOperandNumberType.ts, 3, 3)) diff --git a/tests/baselines/reference/commaOperatorWithSecondOperandNumberType.types b/tests/baselines/reference/commaOperatorWithSecondOperandNumberType.types index 13aae51e0cb..8727665c59b 100644 --- a/tests/baselines/reference/commaOperatorWithSecondOperandNumberType.types +++ b/tests/baselines/reference/commaOperatorWithSecondOperandNumberType.types @@ -1,4 +1,5 @@ === tests/cases/conformance/expressions/commaOperator/commaOperatorWithSecondOperandNumberType.ts === + var ANY: any; >ANY : any @@ -91,33 +92,33 @@ ANY = undefined, NUMBER; >NUMBER : number true, 1; ->true, 1 : number ->true : boolean ->1 : number +>true, 1 : 1 +>true : true +>1 : 1 BOOLEAN = false, 1; ->BOOLEAN = false, 1 : number ->BOOLEAN = false : boolean +>BOOLEAN = false, 1 : 1 +>BOOLEAN = false : false >BOOLEAN : boolean ->false : boolean ->1 : number +>false : false +>1 : 1 "", NUMBER = 1; ->"", NUMBER = 1 : number ->"" : string ->NUMBER = 1 : number +>"", NUMBER = 1 : 1 +>"" : "" +>NUMBER = 1 : 1 >NUMBER : number ->1 : number +>1 : 1 STRING.trim(), NUMBER = 1; ->STRING.trim(), NUMBER = 1 : number +>STRING.trim(), NUMBER = 1 : 1 >STRING.trim() : string >STRING.trim : () => string >STRING : string >trim : () => string ->NUMBER = 1 : number +>NUMBER = 1 : 1 >NUMBER : number ->1 : number +>1 : 1 var resultIsNumber6 = (null, NUMBER); >resultIsNumber6 : number @@ -137,38 +138,38 @@ var resultIsNumber7 = (ANY = undefined, NUMBER); var resultIsNumber8 = (true, 1); >resultIsNumber8 : number ->(true, 1) : number ->true, 1 : number ->true : boolean ->1 : number +>(true, 1) : 1 +>true, 1 : 1 +>true : true +>1 : 1 var resultIsNumber9 = (BOOLEAN = false, 1); >resultIsNumber9 : number ->(BOOLEAN = false, 1) : number ->BOOLEAN = false, 1 : number ->BOOLEAN = false : boolean +>(BOOLEAN = false, 1) : 1 +>BOOLEAN = false, 1 : 1 +>BOOLEAN = false : false >BOOLEAN : boolean ->false : boolean ->1 : number +>false : false +>1 : 1 var resultIsNumber10 = ("", NUMBER = 1); >resultIsNumber10 : number ->("", NUMBER = 1) : number ->"", NUMBER = 1 : number ->"" : string ->NUMBER = 1 : number +>("", NUMBER = 1) : 1 +>"", NUMBER = 1 : 1 +>"" : "" +>NUMBER = 1 : 1 >NUMBER : number ->1 : number +>1 : 1 var resultIsNumber11 = (STRING.trim(), NUMBER = 1); >resultIsNumber11 : number ->(STRING.trim(), NUMBER = 1) : number ->STRING.trim(), NUMBER = 1 : number +>(STRING.trim(), NUMBER = 1) : 1 +>STRING.trim(), NUMBER = 1 : 1 >STRING.trim() : string >STRING.trim : () => string >STRING : string >trim : () => string ->NUMBER = 1 : number +>NUMBER = 1 : 1 >NUMBER : number ->1 : number +>1 : 1 diff --git a/tests/baselines/reference/commaOperatorWithSecondOperandObjectType.js b/tests/baselines/reference/commaOperatorWithSecondOperandObjectType.js index ef814863934..dd269d88217 100644 --- a/tests/baselines/reference/commaOperatorWithSecondOperandObjectType.js +++ b/tests/baselines/reference/commaOperatorWithSecondOperandObjectType.js @@ -1,4 +1,5 @@ //// [commaOperatorWithSecondOperandObjectType.ts] + var ANY: any; var BOOLEAN: boolean; var NUMBER: number; diff --git a/tests/baselines/reference/commaOperatorWithSecondOperandObjectType.symbols b/tests/baselines/reference/commaOperatorWithSecondOperandObjectType.symbols index 6df26708078..cfaab330b46 100644 --- a/tests/baselines/reference/commaOperatorWithSecondOperandObjectType.symbols +++ b/tests/baselines/reference/commaOperatorWithSecondOperandObjectType.symbols @@ -1,121 +1,122 @@ === tests/cases/conformance/expressions/commaOperator/commaOperatorWithSecondOperandObjectType.ts === + var ANY: any; ->ANY : Symbol(ANY, Decl(commaOperatorWithSecondOperandObjectType.ts, 0, 3)) +>ANY : Symbol(ANY, Decl(commaOperatorWithSecondOperandObjectType.ts, 1, 3)) var BOOLEAN: boolean; ->BOOLEAN : Symbol(BOOLEAN, Decl(commaOperatorWithSecondOperandObjectType.ts, 1, 3)) +>BOOLEAN : Symbol(BOOLEAN, Decl(commaOperatorWithSecondOperandObjectType.ts, 2, 3)) var NUMBER: number; ->NUMBER : Symbol(NUMBER, Decl(commaOperatorWithSecondOperandObjectType.ts, 2, 3)) +>NUMBER : Symbol(NUMBER, Decl(commaOperatorWithSecondOperandObjectType.ts, 3, 3)) var STRING: string; ->STRING : Symbol(STRING, Decl(commaOperatorWithSecondOperandObjectType.ts, 3, 3)) +>STRING : Symbol(STRING, Decl(commaOperatorWithSecondOperandObjectType.ts, 4, 3)) var OBJECT: Object; ->OBJECT : Symbol(OBJECT, Decl(commaOperatorWithSecondOperandObjectType.ts, 4, 3)) +>OBJECT : Symbol(OBJECT, Decl(commaOperatorWithSecondOperandObjectType.ts, 5, 3)) >Object : Symbol(Object, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) class CLASS { ->CLASS : Symbol(CLASS, Decl(commaOperatorWithSecondOperandObjectType.ts, 4, 19)) +>CLASS : Symbol(CLASS, Decl(commaOperatorWithSecondOperandObjectType.ts, 5, 19)) num: number; ->num : Symbol(CLASS.num, Decl(commaOperatorWithSecondOperandObjectType.ts, 6, 13)) +>num : Symbol(CLASS.num, Decl(commaOperatorWithSecondOperandObjectType.ts, 7, 13)) } //The second operand type is Object ANY, OBJECT; ->ANY : Symbol(ANY, Decl(commaOperatorWithSecondOperandObjectType.ts, 0, 3)) ->OBJECT : Symbol(OBJECT, Decl(commaOperatorWithSecondOperandObjectType.ts, 4, 3)) +>ANY : Symbol(ANY, Decl(commaOperatorWithSecondOperandObjectType.ts, 1, 3)) +>OBJECT : Symbol(OBJECT, Decl(commaOperatorWithSecondOperandObjectType.ts, 5, 3)) BOOLEAN, OBJECT; ->BOOLEAN : Symbol(BOOLEAN, Decl(commaOperatorWithSecondOperandObjectType.ts, 1, 3)) ->OBJECT : Symbol(OBJECT, Decl(commaOperatorWithSecondOperandObjectType.ts, 4, 3)) +>BOOLEAN : Symbol(BOOLEAN, Decl(commaOperatorWithSecondOperandObjectType.ts, 2, 3)) +>OBJECT : Symbol(OBJECT, Decl(commaOperatorWithSecondOperandObjectType.ts, 5, 3)) NUMBER, OBJECT; ->NUMBER : Symbol(NUMBER, Decl(commaOperatorWithSecondOperandObjectType.ts, 2, 3)) ->OBJECT : Symbol(OBJECT, Decl(commaOperatorWithSecondOperandObjectType.ts, 4, 3)) +>NUMBER : Symbol(NUMBER, Decl(commaOperatorWithSecondOperandObjectType.ts, 3, 3)) +>OBJECT : Symbol(OBJECT, Decl(commaOperatorWithSecondOperandObjectType.ts, 5, 3)) STRING, OBJECT; ->STRING : Symbol(STRING, Decl(commaOperatorWithSecondOperandObjectType.ts, 3, 3)) ->OBJECT : Symbol(OBJECT, Decl(commaOperatorWithSecondOperandObjectType.ts, 4, 3)) +>STRING : Symbol(STRING, Decl(commaOperatorWithSecondOperandObjectType.ts, 4, 3)) +>OBJECT : Symbol(OBJECT, Decl(commaOperatorWithSecondOperandObjectType.ts, 5, 3)) OBJECT, OBJECT; ->OBJECT : Symbol(OBJECT, Decl(commaOperatorWithSecondOperandObjectType.ts, 4, 3)) ->OBJECT : Symbol(OBJECT, Decl(commaOperatorWithSecondOperandObjectType.ts, 4, 3)) +>OBJECT : Symbol(OBJECT, Decl(commaOperatorWithSecondOperandObjectType.ts, 5, 3)) +>OBJECT : Symbol(OBJECT, Decl(commaOperatorWithSecondOperandObjectType.ts, 5, 3)) //Return type is Object var resultIsObject1 = (ANY, OBJECT); ->resultIsObject1 : Symbol(resultIsObject1, Decl(commaOperatorWithSecondOperandObjectType.ts, 18, 3)) ->ANY : Symbol(ANY, Decl(commaOperatorWithSecondOperandObjectType.ts, 0, 3)) ->OBJECT : Symbol(OBJECT, Decl(commaOperatorWithSecondOperandObjectType.ts, 4, 3)) +>resultIsObject1 : Symbol(resultIsObject1, Decl(commaOperatorWithSecondOperandObjectType.ts, 19, 3)) +>ANY : Symbol(ANY, Decl(commaOperatorWithSecondOperandObjectType.ts, 1, 3)) +>OBJECT : Symbol(OBJECT, Decl(commaOperatorWithSecondOperandObjectType.ts, 5, 3)) var resultIsObject2 = (BOOLEAN, OBJECT); ->resultIsObject2 : Symbol(resultIsObject2, Decl(commaOperatorWithSecondOperandObjectType.ts, 19, 3)) ->BOOLEAN : Symbol(BOOLEAN, Decl(commaOperatorWithSecondOperandObjectType.ts, 1, 3)) ->OBJECT : Symbol(OBJECT, Decl(commaOperatorWithSecondOperandObjectType.ts, 4, 3)) +>resultIsObject2 : Symbol(resultIsObject2, Decl(commaOperatorWithSecondOperandObjectType.ts, 20, 3)) +>BOOLEAN : Symbol(BOOLEAN, Decl(commaOperatorWithSecondOperandObjectType.ts, 2, 3)) +>OBJECT : Symbol(OBJECT, Decl(commaOperatorWithSecondOperandObjectType.ts, 5, 3)) var resultIsObject3 = (NUMBER, OBJECT); ->resultIsObject3 : Symbol(resultIsObject3, Decl(commaOperatorWithSecondOperandObjectType.ts, 20, 3)) ->NUMBER : Symbol(NUMBER, Decl(commaOperatorWithSecondOperandObjectType.ts, 2, 3)) ->OBJECT : Symbol(OBJECT, Decl(commaOperatorWithSecondOperandObjectType.ts, 4, 3)) +>resultIsObject3 : Symbol(resultIsObject3, Decl(commaOperatorWithSecondOperandObjectType.ts, 21, 3)) +>NUMBER : Symbol(NUMBER, Decl(commaOperatorWithSecondOperandObjectType.ts, 3, 3)) +>OBJECT : Symbol(OBJECT, Decl(commaOperatorWithSecondOperandObjectType.ts, 5, 3)) var resultIsObject4 = (STRING, OBJECT); ->resultIsObject4 : Symbol(resultIsObject4, Decl(commaOperatorWithSecondOperandObjectType.ts, 21, 3)) ->STRING : Symbol(STRING, Decl(commaOperatorWithSecondOperandObjectType.ts, 3, 3)) ->OBJECT : Symbol(OBJECT, Decl(commaOperatorWithSecondOperandObjectType.ts, 4, 3)) +>resultIsObject4 : Symbol(resultIsObject4, Decl(commaOperatorWithSecondOperandObjectType.ts, 22, 3)) +>STRING : Symbol(STRING, Decl(commaOperatorWithSecondOperandObjectType.ts, 4, 3)) +>OBJECT : Symbol(OBJECT, Decl(commaOperatorWithSecondOperandObjectType.ts, 5, 3)) var resultIsObject5 = (OBJECT, OBJECT); ->resultIsObject5 : Symbol(resultIsObject5, Decl(commaOperatorWithSecondOperandObjectType.ts, 22, 3)) ->OBJECT : Symbol(OBJECT, Decl(commaOperatorWithSecondOperandObjectType.ts, 4, 3)) ->OBJECT : Symbol(OBJECT, Decl(commaOperatorWithSecondOperandObjectType.ts, 4, 3)) +>resultIsObject5 : Symbol(resultIsObject5, Decl(commaOperatorWithSecondOperandObjectType.ts, 23, 3)) +>OBJECT : Symbol(OBJECT, Decl(commaOperatorWithSecondOperandObjectType.ts, 5, 3)) +>OBJECT : Symbol(OBJECT, Decl(commaOperatorWithSecondOperandObjectType.ts, 5, 3)) //Literal and expression null, OBJECT ->OBJECT : Symbol(OBJECT, Decl(commaOperatorWithSecondOperandObjectType.ts, 4, 3)) +>OBJECT : Symbol(OBJECT, Decl(commaOperatorWithSecondOperandObjectType.ts, 5, 3)) ANY = null, OBJECT ->ANY : Symbol(ANY, Decl(commaOperatorWithSecondOperandObjectType.ts, 0, 3)) ->OBJECT : Symbol(OBJECT, Decl(commaOperatorWithSecondOperandObjectType.ts, 4, 3)) +>ANY : Symbol(ANY, Decl(commaOperatorWithSecondOperandObjectType.ts, 1, 3)) +>OBJECT : Symbol(OBJECT, Decl(commaOperatorWithSecondOperandObjectType.ts, 5, 3)) true, {} !BOOLEAN, [] ->BOOLEAN : Symbol(BOOLEAN, Decl(commaOperatorWithSecondOperandObjectType.ts, 1, 3)) +>BOOLEAN : Symbol(BOOLEAN, Decl(commaOperatorWithSecondOperandObjectType.ts, 2, 3)) "string", new Date() >Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) STRING.toLowerCase(), new CLASS() >STRING.toLowerCase : Symbol(String.toLowerCase, Decl(lib.d.ts, --, --)) ->STRING : Symbol(STRING, Decl(commaOperatorWithSecondOperandObjectType.ts, 3, 3)) +>STRING : Symbol(STRING, Decl(commaOperatorWithSecondOperandObjectType.ts, 4, 3)) >toLowerCase : Symbol(String.toLowerCase, Decl(lib.d.ts, --, --)) ->CLASS : Symbol(CLASS, Decl(commaOperatorWithSecondOperandObjectType.ts, 4, 19)) +>CLASS : Symbol(CLASS, Decl(commaOperatorWithSecondOperandObjectType.ts, 5, 19)) var resultIsObject6 = (null, OBJECT); ->resultIsObject6 : Symbol(resultIsObject6, Decl(commaOperatorWithSecondOperandObjectType.ts, 32, 3)) ->OBJECT : Symbol(OBJECT, Decl(commaOperatorWithSecondOperandObjectType.ts, 4, 3)) +>resultIsObject6 : Symbol(resultIsObject6, Decl(commaOperatorWithSecondOperandObjectType.ts, 33, 3)) +>OBJECT : Symbol(OBJECT, Decl(commaOperatorWithSecondOperandObjectType.ts, 5, 3)) var resultIsObject7 = (ANY = null, OBJECT); ->resultIsObject7 : Symbol(resultIsObject7, Decl(commaOperatorWithSecondOperandObjectType.ts, 33, 3)) ->ANY : Symbol(ANY, Decl(commaOperatorWithSecondOperandObjectType.ts, 0, 3)) ->OBJECT : Symbol(OBJECT, Decl(commaOperatorWithSecondOperandObjectType.ts, 4, 3)) +>resultIsObject7 : Symbol(resultIsObject7, Decl(commaOperatorWithSecondOperandObjectType.ts, 34, 3)) +>ANY : Symbol(ANY, Decl(commaOperatorWithSecondOperandObjectType.ts, 1, 3)) +>OBJECT : Symbol(OBJECT, Decl(commaOperatorWithSecondOperandObjectType.ts, 5, 3)) var resultIsObject8 = (true, {}); ->resultIsObject8 : Symbol(resultIsObject8, Decl(commaOperatorWithSecondOperandObjectType.ts, 34, 3)) +>resultIsObject8 : Symbol(resultIsObject8, Decl(commaOperatorWithSecondOperandObjectType.ts, 35, 3)) var resultIsObject9 = (!BOOLEAN, { a: 1, b: "s" }); ->resultIsObject9 : Symbol(resultIsObject9, Decl(commaOperatorWithSecondOperandObjectType.ts, 35, 3)) ->BOOLEAN : Symbol(BOOLEAN, Decl(commaOperatorWithSecondOperandObjectType.ts, 1, 3)) ->a : Symbol(a, Decl(commaOperatorWithSecondOperandObjectType.ts, 35, 34)) ->b : Symbol(b, Decl(commaOperatorWithSecondOperandObjectType.ts, 35, 40)) +>resultIsObject9 : Symbol(resultIsObject9, Decl(commaOperatorWithSecondOperandObjectType.ts, 36, 3)) +>BOOLEAN : Symbol(BOOLEAN, Decl(commaOperatorWithSecondOperandObjectType.ts, 2, 3)) +>a : Symbol(a, Decl(commaOperatorWithSecondOperandObjectType.ts, 36, 34)) +>b : Symbol(b, Decl(commaOperatorWithSecondOperandObjectType.ts, 36, 40)) var resultIsObject10 = ("string", new Date()); ->resultIsObject10 : Symbol(resultIsObject10, Decl(commaOperatorWithSecondOperandObjectType.ts, 36, 3)) +>resultIsObject10 : Symbol(resultIsObject10, Decl(commaOperatorWithSecondOperandObjectType.ts, 37, 3)) >Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) var resultIsObject11 = (STRING.toLowerCase(), new CLASS()); ->resultIsObject11 : Symbol(resultIsObject11, Decl(commaOperatorWithSecondOperandObjectType.ts, 37, 3)) +>resultIsObject11 : Symbol(resultIsObject11, Decl(commaOperatorWithSecondOperandObjectType.ts, 38, 3)) >STRING.toLowerCase : Symbol(String.toLowerCase, Decl(lib.d.ts, --, --)) ->STRING : Symbol(STRING, Decl(commaOperatorWithSecondOperandObjectType.ts, 3, 3)) +>STRING : Symbol(STRING, Decl(commaOperatorWithSecondOperandObjectType.ts, 4, 3)) >toLowerCase : Symbol(String.toLowerCase, Decl(lib.d.ts, --, --)) ->CLASS : Symbol(CLASS, Decl(commaOperatorWithSecondOperandObjectType.ts, 4, 19)) +>CLASS : Symbol(CLASS, Decl(commaOperatorWithSecondOperandObjectType.ts, 5, 19)) diff --git a/tests/baselines/reference/commaOperatorWithSecondOperandObjectType.types b/tests/baselines/reference/commaOperatorWithSecondOperandObjectType.types index 9c948da9699..493d97d6454 100644 --- a/tests/baselines/reference/commaOperatorWithSecondOperandObjectType.types +++ b/tests/baselines/reference/commaOperatorWithSecondOperandObjectType.types @@ -1,4 +1,5 @@ === tests/cases/conformance/expressions/commaOperator/commaOperatorWithSecondOperandObjectType.ts === + var ANY: any; >ANY : any @@ -99,7 +100,7 @@ ANY = null, OBJECT true, {} >true, {} : {} ->true : boolean +>true : true >{} : {} !BOOLEAN, [] @@ -110,7 +111,7 @@ true, {} "string", new Date() >"string", new Date() : Date ->"string" : string +>"string" : "string" >new Date() : Date >Date : DateConstructor @@ -143,7 +144,7 @@ var resultIsObject8 = (true, {}); >resultIsObject8 : {} >(true, {}) : {} >true, {} : {} ->true : boolean +>true : true >{} : {} var resultIsObject9 = (!BOOLEAN, { a: 1, b: "s" }); @@ -154,15 +155,15 @@ var resultIsObject9 = (!BOOLEAN, { a: 1, b: "s" }); >BOOLEAN : boolean >{ a: 1, b: "s" } : { a: number; b: string; } >a : number ->1 : number +>1 : 1 >b : string ->"s" : string +>"s" : "s" var resultIsObject10 = ("string", new Date()); >resultIsObject10 : Date >("string", new Date()) : Date >"string", new Date() : Date ->"string" : string +>"string" : "string" >new Date() : Date >Date : DateConstructor diff --git a/tests/baselines/reference/commaOperatorWithSecondOperandStringType.js b/tests/baselines/reference/commaOperatorWithSecondOperandStringType.js index 412e9e83121..f3f19563817 100644 --- a/tests/baselines/reference/commaOperatorWithSecondOperandStringType.js +++ b/tests/baselines/reference/commaOperatorWithSecondOperandStringType.js @@ -1,4 +1,5 @@ //// [commaOperatorWithSecondOperandStringType.ts] + var ANY: any; var BOOLEAN: boolean; var NUMBER: number; diff --git a/tests/baselines/reference/commaOperatorWithSecondOperandStringType.symbols b/tests/baselines/reference/commaOperatorWithSecondOperandStringType.symbols index 2d9fc665a81..d4f5873f493 100644 --- a/tests/baselines/reference/commaOperatorWithSecondOperandStringType.symbols +++ b/tests/baselines/reference/commaOperatorWithSecondOperandStringType.symbols @@ -1,120 +1,121 @@ === tests/cases/conformance/expressions/commaOperator/commaOperatorWithSecondOperandStringType.ts === + var ANY: any; ->ANY : Symbol(ANY, Decl(commaOperatorWithSecondOperandStringType.ts, 0, 3)) +>ANY : Symbol(ANY, Decl(commaOperatorWithSecondOperandStringType.ts, 1, 3)) var BOOLEAN: boolean; ->BOOLEAN : Symbol(BOOLEAN, Decl(commaOperatorWithSecondOperandStringType.ts, 1, 3)) +>BOOLEAN : Symbol(BOOLEAN, Decl(commaOperatorWithSecondOperandStringType.ts, 2, 3)) var NUMBER: number; ->NUMBER : Symbol(NUMBER, Decl(commaOperatorWithSecondOperandStringType.ts, 2, 3)) +>NUMBER : Symbol(NUMBER, Decl(commaOperatorWithSecondOperandStringType.ts, 3, 3)) var STRING: string; ->STRING : Symbol(STRING, Decl(commaOperatorWithSecondOperandStringType.ts, 3, 3)) +>STRING : Symbol(STRING, Decl(commaOperatorWithSecondOperandStringType.ts, 4, 3)) var OBJECT: Object; ->OBJECT : Symbol(OBJECT, Decl(commaOperatorWithSecondOperandStringType.ts, 4, 3)) +>OBJECT : Symbol(OBJECT, Decl(commaOperatorWithSecondOperandStringType.ts, 5, 3)) >Object : Symbol(Object, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) var resultIsString: string; ->resultIsString : Symbol(resultIsString, Decl(commaOperatorWithSecondOperandStringType.ts, 6, 3)) +>resultIsString : Symbol(resultIsString, Decl(commaOperatorWithSecondOperandStringType.ts, 7, 3)) //The second operand is string ANY, STRING; ->ANY : Symbol(ANY, Decl(commaOperatorWithSecondOperandStringType.ts, 0, 3)) ->STRING : Symbol(STRING, Decl(commaOperatorWithSecondOperandStringType.ts, 3, 3)) +>ANY : Symbol(ANY, Decl(commaOperatorWithSecondOperandStringType.ts, 1, 3)) +>STRING : Symbol(STRING, Decl(commaOperatorWithSecondOperandStringType.ts, 4, 3)) BOOLEAN, STRING; ->BOOLEAN : Symbol(BOOLEAN, Decl(commaOperatorWithSecondOperandStringType.ts, 1, 3)) ->STRING : Symbol(STRING, Decl(commaOperatorWithSecondOperandStringType.ts, 3, 3)) +>BOOLEAN : Symbol(BOOLEAN, Decl(commaOperatorWithSecondOperandStringType.ts, 2, 3)) +>STRING : Symbol(STRING, Decl(commaOperatorWithSecondOperandStringType.ts, 4, 3)) NUMBER, STRING; ->NUMBER : Symbol(NUMBER, Decl(commaOperatorWithSecondOperandStringType.ts, 2, 3)) ->STRING : Symbol(STRING, Decl(commaOperatorWithSecondOperandStringType.ts, 3, 3)) +>NUMBER : Symbol(NUMBER, Decl(commaOperatorWithSecondOperandStringType.ts, 3, 3)) +>STRING : Symbol(STRING, Decl(commaOperatorWithSecondOperandStringType.ts, 4, 3)) STRING, STRING; ->STRING : Symbol(STRING, Decl(commaOperatorWithSecondOperandStringType.ts, 3, 3)) ->STRING : Symbol(STRING, Decl(commaOperatorWithSecondOperandStringType.ts, 3, 3)) +>STRING : Symbol(STRING, Decl(commaOperatorWithSecondOperandStringType.ts, 4, 3)) +>STRING : Symbol(STRING, Decl(commaOperatorWithSecondOperandStringType.ts, 4, 3)) OBJECT, STRING; ->OBJECT : Symbol(OBJECT, Decl(commaOperatorWithSecondOperandStringType.ts, 4, 3)) ->STRING : Symbol(STRING, Decl(commaOperatorWithSecondOperandStringType.ts, 3, 3)) +>OBJECT : Symbol(OBJECT, Decl(commaOperatorWithSecondOperandStringType.ts, 5, 3)) +>STRING : Symbol(STRING, Decl(commaOperatorWithSecondOperandStringType.ts, 4, 3)) //Return type is string var resultIsString1 = (ANY, STRING); ->resultIsString1 : Symbol(resultIsString1, Decl(commaOperatorWithSecondOperandStringType.ts, 16, 3)) ->ANY : Symbol(ANY, Decl(commaOperatorWithSecondOperandStringType.ts, 0, 3)) ->STRING : Symbol(STRING, Decl(commaOperatorWithSecondOperandStringType.ts, 3, 3)) +>resultIsString1 : Symbol(resultIsString1, Decl(commaOperatorWithSecondOperandStringType.ts, 17, 3)) +>ANY : Symbol(ANY, Decl(commaOperatorWithSecondOperandStringType.ts, 1, 3)) +>STRING : Symbol(STRING, Decl(commaOperatorWithSecondOperandStringType.ts, 4, 3)) var resultIsString2 = (BOOLEAN, STRING); ->resultIsString2 : Symbol(resultIsString2, Decl(commaOperatorWithSecondOperandStringType.ts, 17, 3)) ->BOOLEAN : Symbol(BOOLEAN, Decl(commaOperatorWithSecondOperandStringType.ts, 1, 3)) ->STRING : Symbol(STRING, Decl(commaOperatorWithSecondOperandStringType.ts, 3, 3)) +>resultIsString2 : Symbol(resultIsString2, Decl(commaOperatorWithSecondOperandStringType.ts, 18, 3)) +>BOOLEAN : Symbol(BOOLEAN, Decl(commaOperatorWithSecondOperandStringType.ts, 2, 3)) +>STRING : Symbol(STRING, Decl(commaOperatorWithSecondOperandStringType.ts, 4, 3)) var resultIsString3 = (NUMBER, STRING); ->resultIsString3 : Symbol(resultIsString3, Decl(commaOperatorWithSecondOperandStringType.ts, 18, 3)) ->NUMBER : Symbol(NUMBER, Decl(commaOperatorWithSecondOperandStringType.ts, 2, 3)) ->STRING : Symbol(STRING, Decl(commaOperatorWithSecondOperandStringType.ts, 3, 3)) +>resultIsString3 : Symbol(resultIsString3, Decl(commaOperatorWithSecondOperandStringType.ts, 19, 3)) +>NUMBER : Symbol(NUMBER, Decl(commaOperatorWithSecondOperandStringType.ts, 3, 3)) +>STRING : Symbol(STRING, Decl(commaOperatorWithSecondOperandStringType.ts, 4, 3)) var resultIsString4 = (STRING, STRING); ->resultIsString4 : Symbol(resultIsString4, Decl(commaOperatorWithSecondOperandStringType.ts, 19, 3)) ->STRING : Symbol(STRING, Decl(commaOperatorWithSecondOperandStringType.ts, 3, 3)) ->STRING : Symbol(STRING, Decl(commaOperatorWithSecondOperandStringType.ts, 3, 3)) +>resultIsString4 : Symbol(resultIsString4, Decl(commaOperatorWithSecondOperandStringType.ts, 20, 3)) +>STRING : Symbol(STRING, Decl(commaOperatorWithSecondOperandStringType.ts, 4, 3)) +>STRING : Symbol(STRING, Decl(commaOperatorWithSecondOperandStringType.ts, 4, 3)) var resultIsString5 = (OBJECT, STRING); ->resultIsString5 : Symbol(resultIsString5, Decl(commaOperatorWithSecondOperandStringType.ts, 20, 3)) ->OBJECT : Symbol(OBJECT, Decl(commaOperatorWithSecondOperandStringType.ts, 4, 3)) ->STRING : Symbol(STRING, Decl(commaOperatorWithSecondOperandStringType.ts, 3, 3)) +>resultIsString5 : Symbol(resultIsString5, Decl(commaOperatorWithSecondOperandStringType.ts, 21, 3)) +>OBJECT : Symbol(OBJECT, Decl(commaOperatorWithSecondOperandStringType.ts, 5, 3)) +>STRING : Symbol(STRING, Decl(commaOperatorWithSecondOperandStringType.ts, 4, 3)) //Literal and expression null, STRING; ->STRING : Symbol(STRING, Decl(commaOperatorWithSecondOperandStringType.ts, 3, 3)) +>STRING : Symbol(STRING, Decl(commaOperatorWithSecondOperandStringType.ts, 4, 3)) ANY = new Date(), STRING; ->ANY : Symbol(ANY, Decl(commaOperatorWithSecondOperandStringType.ts, 0, 3)) +>ANY : Symbol(ANY, Decl(commaOperatorWithSecondOperandStringType.ts, 1, 3)) >Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) ->STRING : Symbol(STRING, Decl(commaOperatorWithSecondOperandStringType.ts, 3, 3)) +>STRING : Symbol(STRING, Decl(commaOperatorWithSecondOperandStringType.ts, 4, 3)) true, ""; BOOLEAN == undefined, ""; ->BOOLEAN : Symbol(BOOLEAN, Decl(commaOperatorWithSecondOperandStringType.ts, 1, 3)) +>BOOLEAN : Symbol(BOOLEAN, Decl(commaOperatorWithSecondOperandStringType.ts, 2, 3)) >undefined : Symbol(undefined) ["a", "b"], NUMBER.toString(); >NUMBER.toString : Symbol(Number.toString, Decl(lib.d.ts, --, --)) ->NUMBER : Symbol(NUMBER, Decl(commaOperatorWithSecondOperandStringType.ts, 2, 3)) +>NUMBER : Symbol(NUMBER, Decl(commaOperatorWithSecondOperandStringType.ts, 3, 3)) >toString : Symbol(Number.toString, Decl(lib.d.ts, --, --)) OBJECT = new Object, STRING + "string"; ->OBJECT : Symbol(OBJECT, Decl(commaOperatorWithSecondOperandStringType.ts, 4, 3)) +>OBJECT : Symbol(OBJECT, Decl(commaOperatorWithSecondOperandStringType.ts, 5, 3)) >Object : Symbol(Object, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) ->STRING : Symbol(STRING, Decl(commaOperatorWithSecondOperandStringType.ts, 3, 3)) +>STRING : Symbol(STRING, Decl(commaOperatorWithSecondOperandStringType.ts, 4, 3)) var resultIsString6 = (null, STRING); ->resultIsString6 : Symbol(resultIsString6, Decl(commaOperatorWithSecondOperandStringType.ts, 30, 3)) ->STRING : Symbol(STRING, Decl(commaOperatorWithSecondOperandStringType.ts, 3, 3)) +>resultIsString6 : Symbol(resultIsString6, Decl(commaOperatorWithSecondOperandStringType.ts, 31, 3)) +>STRING : Symbol(STRING, Decl(commaOperatorWithSecondOperandStringType.ts, 4, 3)) var resultIsString7 = (ANY = new Date(), STRING); ->resultIsString7 : Symbol(resultIsString7, Decl(commaOperatorWithSecondOperandStringType.ts, 31, 3)) ->ANY : Symbol(ANY, Decl(commaOperatorWithSecondOperandStringType.ts, 0, 3)) +>resultIsString7 : Symbol(resultIsString7, Decl(commaOperatorWithSecondOperandStringType.ts, 32, 3)) +>ANY : Symbol(ANY, Decl(commaOperatorWithSecondOperandStringType.ts, 1, 3)) >Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) ->STRING : Symbol(STRING, Decl(commaOperatorWithSecondOperandStringType.ts, 3, 3)) +>STRING : Symbol(STRING, Decl(commaOperatorWithSecondOperandStringType.ts, 4, 3)) var resultIsString8 = (true, ""); ->resultIsString8 : Symbol(resultIsString8, Decl(commaOperatorWithSecondOperandStringType.ts, 32, 3)) +>resultIsString8 : Symbol(resultIsString8, Decl(commaOperatorWithSecondOperandStringType.ts, 33, 3)) var resultIsString9 = (BOOLEAN == undefined, ""); ->resultIsString9 : Symbol(resultIsString9, Decl(commaOperatorWithSecondOperandStringType.ts, 33, 3)) ->BOOLEAN : Symbol(BOOLEAN, Decl(commaOperatorWithSecondOperandStringType.ts, 1, 3)) +>resultIsString9 : Symbol(resultIsString9, Decl(commaOperatorWithSecondOperandStringType.ts, 34, 3)) +>BOOLEAN : Symbol(BOOLEAN, Decl(commaOperatorWithSecondOperandStringType.ts, 2, 3)) >undefined : Symbol(undefined) var resultIsString10 = (["a", "b"], NUMBER.toString()); ->resultIsString10 : Symbol(resultIsString10, Decl(commaOperatorWithSecondOperandStringType.ts, 34, 3)) +>resultIsString10 : Symbol(resultIsString10, Decl(commaOperatorWithSecondOperandStringType.ts, 35, 3)) >NUMBER.toString : Symbol(Number.toString, Decl(lib.d.ts, --, --)) ->NUMBER : Symbol(NUMBER, Decl(commaOperatorWithSecondOperandStringType.ts, 2, 3)) +>NUMBER : Symbol(NUMBER, Decl(commaOperatorWithSecondOperandStringType.ts, 3, 3)) >toString : Symbol(Number.toString, Decl(lib.d.ts, --, --)) var resultIsString11 = (new Object, STRING + "string"); ->resultIsString11 : Symbol(resultIsString11, Decl(commaOperatorWithSecondOperandStringType.ts, 35, 3)) +>resultIsString11 : Symbol(resultIsString11, Decl(commaOperatorWithSecondOperandStringType.ts, 36, 3)) >Object : Symbol(Object, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) ->STRING : Symbol(STRING, Decl(commaOperatorWithSecondOperandStringType.ts, 3, 3)) +>STRING : Symbol(STRING, Decl(commaOperatorWithSecondOperandStringType.ts, 4, 3)) diff --git a/tests/baselines/reference/commaOperatorWithSecondOperandStringType.types b/tests/baselines/reference/commaOperatorWithSecondOperandStringType.types index a28202876d2..af5b7d2cb06 100644 --- a/tests/baselines/reference/commaOperatorWithSecondOperandStringType.types +++ b/tests/baselines/reference/commaOperatorWithSecondOperandStringType.types @@ -1,4 +1,5 @@ === tests/cases/conformance/expressions/commaOperator/commaOperatorWithSecondOperandStringType.ts === + var ANY: any; >ANY : any @@ -95,22 +96,22 @@ ANY = new Date(), STRING; >STRING : string true, ""; ->true, "" : string ->true : boolean ->"" : string +>true, "" : "" +>true : true +>"" : "" BOOLEAN == undefined, ""; ->BOOLEAN == undefined, "" : string +>BOOLEAN == undefined, "" : "" >BOOLEAN == undefined : boolean >BOOLEAN : boolean >undefined : undefined ->"" : string +>"" : "" ["a", "b"], NUMBER.toString(); >["a", "b"], NUMBER.toString() : string >["a", "b"] : string[] ->"a" : string ->"b" : string +>"a" : "a" +>"b" : "b" >NUMBER.toString() : string >NUMBER.toString : (radix?: number) => string >NUMBER : number @@ -124,7 +125,7 @@ OBJECT = new Object, STRING + "string"; >Object : ObjectConstructor >STRING + "string" : string >STRING : string ->"string" : string +>"string" : "string" var resultIsString6 = (null, STRING); >resultIsString6 : string @@ -145,27 +146,27 @@ var resultIsString7 = (ANY = new Date(), STRING); var resultIsString8 = (true, ""); >resultIsString8 : string ->(true, "") : string ->true, "" : string ->true : boolean ->"" : string +>(true, "") : "" +>true, "" : "" +>true : true +>"" : "" var resultIsString9 = (BOOLEAN == undefined, ""); >resultIsString9 : string ->(BOOLEAN == undefined, "") : string ->BOOLEAN == undefined, "" : string +>(BOOLEAN == undefined, "") : "" +>BOOLEAN == undefined, "" : "" >BOOLEAN == undefined : boolean >BOOLEAN : boolean >undefined : undefined ->"" : string +>"" : "" var resultIsString10 = (["a", "b"], NUMBER.toString()); >resultIsString10 : string >(["a", "b"], NUMBER.toString()) : string >["a", "b"], NUMBER.toString() : string >["a", "b"] : string[] ->"a" : string ->"b" : string +>"a" : "a" +>"b" : "b" >NUMBER.toString() : string >NUMBER.toString : (radix?: number) => string >NUMBER : number @@ -179,5 +180,5 @@ var resultIsString11 = (new Object, STRING + "string"); >Object : ObjectConstructor >STRING + "string" : string >STRING : string ->"string" : string +>"string" : "string" diff --git a/tests/baselines/reference/commaOperatorWithoutOperand.errors.txt b/tests/baselines/reference/commaOperatorWithoutOperand.errors.txt index 7120a827042..4167e2d426c 100644 --- a/tests/baselines/reference/commaOperatorWithoutOperand.errors.txt +++ b/tests/baselines/reference/commaOperatorWithoutOperand.errors.txt @@ -1,18 +1,29 @@ +tests/cases/conformance/expressions/commaOperator/commaOperatorWithoutOperand.ts(9,2): error TS2695: Left side of comma operator is unused and has no side effects. tests/cases/conformance/expressions/commaOperator/commaOperatorWithoutOperand.ts(9,7): error TS1109: Expression expected. +tests/cases/conformance/expressions/commaOperator/commaOperatorWithoutOperand.ts(10,2): error TS2695: Left side of comma operator is unused and has no side effects. tests/cases/conformance/expressions/commaOperator/commaOperatorWithoutOperand.ts(10,11): error TS1109: Expression expected. +tests/cases/conformance/expressions/commaOperator/commaOperatorWithoutOperand.ts(11,2): error TS2695: Left side of comma operator is unused and has no side effects. tests/cases/conformance/expressions/commaOperator/commaOperatorWithoutOperand.ts(11,10): error TS1109: Expression expected. +tests/cases/conformance/expressions/commaOperator/commaOperatorWithoutOperand.ts(12,2): error TS2695: Left side of comma operator is unused and has no side effects. tests/cases/conformance/expressions/commaOperator/commaOperatorWithoutOperand.ts(12,10): error TS1109: Expression expected. +tests/cases/conformance/expressions/commaOperator/commaOperatorWithoutOperand.ts(13,2): error TS2695: Left side of comma operator is unused and has no side effects. tests/cases/conformance/expressions/commaOperator/commaOperatorWithoutOperand.ts(13,10): error TS1109: Expression expected. +tests/cases/conformance/expressions/commaOperator/commaOperatorWithoutOperand.ts(16,2): error TS2695: Left side of comma operator is unused and has no side effects. tests/cases/conformance/expressions/commaOperator/commaOperatorWithoutOperand.ts(16,2): error TS1109: Expression expected. +tests/cases/conformance/expressions/commaOperator/commaOperatorWithoutOperand.ts(17,2): error TS2695: Left side of comma operator is unused and has no side effects. tests/cases/conformance/expressions/commaOperator/commaOperatorWithoutOperand.ts(17,2): error TS1109: Expression expected. +tests/cases/conformance/expressions/commaOperator/commaOperatorWithoutOperand.ts(18,2): error TS2695: Left side of comma operator is unused and has no side effects. tests/cases/conformance/expressions/commaOperator/commaOperatorWithoutOperand.ts(18,2): error TS1109: Expression expected. +tests/cases/conformance/expressions/commaOperator/commaOperatorWithoutOperand.ts(19,2): error TS2695: Left side of comma operator is unused and has no side effects. tests/cases/conformance/expressions/commaOperator/commaOperatorWithoutOperand.ts(19,2): error TS1109: Expression expected. +tests/cases/conformance/expressions/commaOperator/commaOperatorWithoutOperand.ts(20,2): error TS2695: Left side of comma operator is unused and has no side effects. tests/cases/conformance/expressions/commaOperator/commaOperatorWithoutOperand.ts(20,2): error TS1109: Expression expected. +tests/cases/conformance/expressions/commaOperator/commaOperatorWithoutOperand.ts(23,2): error TS2695: Left side of comma operator is unused and has no side effects. tests/cases/conformance/expressions/commaOperator/commaOperatorWithoutOperand.ts(23,3): error TS1109: Expression expected. tests/cases/conformance/expressions/commaOperator/commaOperatorWithoutOperand.ts(23,5): error TS1109: Expression expected. -==== tests/cases/conformance/expressions/commaOperator/commaOperatorWithoutOperand.ts (12 errors) ==== +==== tests/cases/conformance/expressions/commaOperator/commaOperatorWithoutOperand.ts (23 errors) ==== var ANY: any; var BOOLEAN: boolean; var NUMBER: number; @@ -22,40 +33,62 @@ tests/cases/conformance/expressions/commaOperator/commaOperatorWithoutOperand.ts // Expect to have compiler errors // Missing the second operand (ANY, ); + ~~~ +!!! error TS2695: Left side of comma operator is unused and has no side effects. ~ !!! error TS1109: Expression expected. (BOOLEAN, ); + ~~~~~~~ +!!! error TS2695: Left side of comma operator is unused and has no side effects. ~ !!! error TS1109: Expression expected. (NUMBER, ); + ~~~~~~ +!!! error TS2695: Left side of comma operator is unused and has no side effects. ~ !!! error TS1109: Expression expected. (STRING, ); + ~~~~~~ +!!! error TS2695: Left side of comma operator is unused and has no side effects. ~ !!! error TS1109: Expression expected. (OBJECT, ); + ~~~~~~ +!!! error TS2695: Left side of comma operator is unused and has no side effects. ~ !!! error TS1109: Expression expected. // Missing the first operand (, ANY); + +!!! error TS2695: Left side of comma operator is unused and has no side effects. ~ !!! error TS1109: Expression expected. (, BOOLEAN); + +!!! error TS2695: Left side of comma operator is unused and has no side effects. ~ !!! error TS1109: Expression expected. (, NUMBER); + +!!! error TS2695: Left side of comma operator is unused and has no side effects. ~ !!! error TS1109: Expression expected. (, STRING); + +!!! error TS2695: Left side of comma operator is unused and has no side effects. ~ !!! error TS1109: Expression expected. (, OBJECT); + +!!! error TS2695: Left side of comma operator is unused and has no side effects. ~ !!! error TS1109: Expression expected. // Missing all operands ( , ); + +!!! error TS2695: Left side of comma operator is unused and has no side effects. ~ !!! error TS1109: Expression expected. ~ diff --git a/tests/baselines/reference/commaOperatorsMultipleOperators.js b/tests/baselines/reference/commaOperatorsMultipleOperators.js index 15d93c1f18c..5157eb2c8ff 100644 --- a/tests/baselines/reference/commaOperatorsMultipleOperators.js +++ b/tests/baselines/reference/commaOperatorsMultipleOperators.js @@ -1,4 +1,5 @@ //// [commaOperatorsMultipleOperators.ts] + var ANY: any; var BOOLEAN: boolean; var NUMBER: number; diff --git a/tests/baselines/reference/commaOperatorsMultipleOperators.symbols b/tests/baselines/reference/commaOperatorsMultipleOperators.symbols index 3a580bc49e9..bc1953709c2 100644 --- a/tests/baselines/reference/commaOperatorsMultipleOperators.symbols +++ b/tests/baselines/reference/commaOperatorsMultipleOperators.symbols @@ -1,94 +1,95 @@ === tests/cases/conformance/expressions/commaOperator/commaOperatorsMultipleOperators.ts === + var ANY: any; ->ANY : Symbol(ANY, Decl(commaOperatorsMultipleOperators.ts, 0, 3)) +>ANY : Symbol(ANY, Decl(commaOperatorsMultipleOperators.ts, 1, 3)) var BOOLEAN: boolean; ->BOOLEAN : Symbol(BOOLEAN, Decl(commaOperatorsMultipleOperators.ts, 1, 3)) +>BOOLEAN : Symbol(BOOLEAN, Decl(commaOperatorsMultipleOperators.ts, 2, 3)) var NUMBER: number; ->NUMBER : Symbol(NUMBER, Decl(commaOperatorsMultipleOperators.ts, 2, 3)) +>NUMBER : Symbol(NUMBER, Decl(commaOperatorsMultipleOperators.ts, 3, 3)) var STRING: string; ->STRING : Symbol(STRING, Decl(commaOperatorsMultipleOperators.ts, 3, 3)) +>STRING : Symbol(STRING, Decl(commaOperatorsMultipleOperators.ts, 4, 3)) var OBJECT: Object; ->OBJECT : Symbol(OBJECT, Decl(commaOperatorsMultipleOperators.ts, 4, 3)) +>OBJECT : Symbol(OBJECT, Decl(commaOperatorsMultipleOperators.ts, 5, 3)) >Object : Symbol(Object, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) //Expected: work well ANY, BOOLEAN, NUMBER; ->ANY : Symbol(ANY, Decl(commaOperatorsMultipleOperators.ts, 0, 3)) ->BOOLEAN : Symbol(BOOLEAN, Decl(commaOperatorsMultipleOperators.ts, 1, 3)) ->NUMBER : Symbol(NUMBER, Decl(commaOperatorsMultipleOperators.ts, 2, 3)) +>ANY : Symbol(ANY, Decl(commaOperatorsMultipleOperators.ts, 1, 3)) +>BOOLEAN : Symbol(BOOLEAN, Decl(commaOperatorsMultipleOperators.ts, 2, 3)) +>NUMBER : Symbol(NUMBER, Decl(commaOperatorsMultipleOperators.ts, 3, 3)) BOOLEAN, NUMBER, STRING; ->BOOLEAN : Symbol(BOOLEAN, Decl(commaOperatorsMultipleOperators.ts, 1, 3)) ->NUMBER : Symbol(NUMBER, Decl(commaOperatorsMultipleOperators.ts, 2, 3)) ->STRING : Symbol(STRING, Decl(commaOperatorsMultipleOperators.ts, 3, 3)) +>BOOLEAN : Symbol(BOOLEAN, Decl(commaOperatorsMultipleOperators.ts, 2, 3)) +>NUMBER : Symbol(NUMBER, Decl(commaOperatorsMultipleOperators.ts, 3, 3)) +>STRING : Symbol(STRING, Decl(commaOperatorsMultipleOperators.ts, 4, 3)) NUMBER, STRING, OBJECT; ->NUMBER : Symbol(NUMBER, Decl(commaOperatorsMultipleOperators.ts, 2, 3)) ->STRING : Symbol(STRING, Decl(commaOperatorsMultipleOperators.ts, 3, 3)) ->OBJECT : Symbol(OBJECT, Decl(commaOperatorsMultipleOperators.ts, 4, 3)) +>NUMBER : Symbol(NUMBER, Decl(commaOperatorsMultipleOperators.ts, 3, 3)) +>STRING : Symbol(STRING, Decl(commaOperatorsMultipleOperators.ts, 4, 3)) +>OBJECT : Symbol(OBJECT, Decl(commaOperatorsMultipleOperators.ts, 5, 3)) STRING, OBJECT, ANY; ->STRING : Symbol(STRING, Decl(commaOperatorsMultipleOperators.ts, 3, 3)) ->OBJECT : Symbol(OBJECT, Decl(commaOperatorsMultipleOperators.ts, 4, 3)) ->ANY : Symbol(ANY, Decl(commaOperatorsMultipleOperators.ts, 0, 3)) +>STRING : Symbol(STRING, Decl(commaOperatorsMultipleOperators.ts, 4, 3)) +>OBJECT : Symbol(OBJECT, Decl(commaOperatorsMultipleOperators.ts, 5, 3)) +>ANY : Symbol(ANY, Decl(commaOperatorsMultipleOperators.ts, 1, 3)) OBJECT, ANY, BOOLEAN; ->OBJECT : Symbol(OBJECT, Decl(commaOperatorsMultipleOperators.ts, 4, 3)) ->ANY : Symbol(ANY, Decl(commaOperatorsMultipleOperators.ts, 0, 3)) ->BOOLEAN : Symbol(BOOLEAN, Decl(commaOperatorsMultipleOperators.ts, 1, 3)) +>OBJECT : Symbol(OBJECT, Decl(commaOperatorsMultipleOperators.ts, 5, 3)) +>ANY : Symbol(ANY, Decl(commaOperatorsMultipleOperators.ts, 1, 3)) +>BOOLEAN : Symbol(BOOLEAN, Decl(commaOperatorsMultipleOperators.ts, 2, 3)) //Results should have the same type as the third operand var resultIsAny1 = (STRING, OBJECT, ANY); ->resultIsAny1 : Symbol(resultIsAny1, Decl(commaOperatorsMultipleOperators.ts, 14, 3)) ->STRING : Symbol(STRING, Decl(commaOperatorsMultipleOperators.ts, 3, 3)) ->OBJECT : Symbol(OBJECT, Decl(commaOperatorsMultipleOperators.ts, 4, 3)) ->ANY : Symbol(ANY, Decl(commaOperatorsMultipleOperators.ts, 0, 3)) +>resultIsAny1 : Symbol(resultIsAny1, Decl(commaOperatorsMultipleOperators.ts, 15, 3)) +>STRING : Symbol(STRING, Decl(commaOperatorsMultipleOperators.ts, 4, 3)) +>OBJECT : Symbol(OBJECT, Decl(commaOperatorsMultipleOperators.ts, 5, 3)) +>ANY : Symbol(ANY, Decl(commaOperatorsMultipleOperators.ts, 1, 3)) var resultIsBoolean1 = (OBJECT, ANY, BOOLEAN); ->resultIsBoolean1 : Symbol(resultIsBoolean1, Decl(commaOperatorsMultipleOperators.ts, 15, 3)) ->OBJECT : Symbol(OBJECT, Decl(commaOperatorsMultipleOperators.ts, 4, 3)) ->ANY : Symbol(ANY, Decl(commaOperatorsMultipleOperators.ts, 0, 3)) ->BOOLEAN : Symbol(BOOLEAN, Decl(commaOperatorsMultipleOperators.ts, 1, 3)) +>resultIsBoolean1 : Symbol(resultIsBoolean1, Decl(commaOperatorsMultipleOperators.ts, 16, 3)) +>OBJECT : Symbol(OBJECT, Decl(commaOperatorsMultipleOperators.ts, 5, 3)) +>ANY : Symbol(ANY, Decl(commaOperatorsMultipleOperators.ts, 1, 3)) +>BOOLEAN : Symbol(BOOLEAN, Decl(commaOperatorsMultipleOperators.ts, 2, 3)) var resultIsNumber1 = (ANY, BOOLEAN, NUMBER); ->resultIsNumber1 : Symbol(resultIsNumber1, Decl(commaOperatorsMultipleOperators.ts, 16, 3)) ->ANY : Symbol(ANY, Decl(commaOperatorsMultipleOperators.ts, 0, 3)) ->BOOLEAN : Symbol(BOOLEAN, Decl(commaOperatorsMultipleOperators.ts, 1, 3)) ->NUMBER : Symbol(NUMBER, Decl(commaOperatorsMultipleOperators.ts, 2, 3)) +>resultIsNumber1 : Symbol(resultIsNumber1, Decl(commaOperatorsMultipleOperators.ts, 17, 3)) +>ANY : Symbol(ANY, Decl(commaOperatorsMultipleOperators.ts, 1, 3)) +>BOOLEAN : Symbol(BOOLEAN, Decl(commaOperatorsMultipleOperators.ts, 2, 3)) +>NUMBER : Symbol(NUMBER, Decl(commaOperatorsMultipleOperators.ts, 3, 3)) var resultIsString1 = (BOOLEAN, NUMBER, STRING); ->resultIsString1 : Symbol(resultIsString1, Decl(commaOperatorsMultipleOperators.ts, 17, 3)) ->BOOLEAN : Symbol(BOOLEAN, Decl(commaOperatorsMultipleOperators.ts, 1, 3)) ->NUMBER : Symbol(NUMBER, Decl(commaOperatorsMultipleOperators.ts, 2, 3)) ->STRING : Symbol(STRING, Decl(commaOperatorsMultipleOperators.ts, 3, 3)) +>resultIsString1 : Symbol(resultIsString1, Decl(commaOperatorsMultipleOperators.ts, 18, 3)) +>BOOLEAN : Symbol(BOOLEAN, Decl(commaOperatorsMultipleOperators.ts, 2, 3)) +>NUMBER : Symbol(NUMBER, Decl(commaOperatorsMultipleOperators.ts, 3, 3)) +>STRING : Symbol(STRING, Decl(commaOperatorsMultipleOperators.ts, 4, 3)) var resultIsObject1 = (NUMBER, STRING, OBJECT); ->resultIsObject1 : Symbol(resultIsObject1, Decl(commaOperatorsMultipleOperators.ts, 18, 3)) ->NUMBER : Symbol(NUMBER, Decl(commaOperatorsMultipleOperators.ts, 2, 3)) ->STRING : Symbol(STRING, Decl(commaOperatorsMultipleOperators.ts, 3, 3)) ->OBJECT : Symbol(OBJECT, Decl(commaOperatorsMultipleOperators.ts, 4, 3)) +>resultIsObject1 : Symbol(resultIsObject1, Decl(commaOperatorsMultipleOperators.ts, 19, 3)) +>NUMBER : Symbol(NUMBER, Decl(commaOperatorsMultipleOperators.ts, 3, 3)) +>STRING : Symbol(STRING, Decl(commaOperatorsMultipleOperators.ts, 4, 3)) +>OBJECT : Symbol(OBJECT, Decl(commaOperatorsMultipleOperators.ts, 5, 3)) //Literal and expression null, true, 1; ++NUMBER, STRING.charAt(0), new Object(); ->NUMBER : Symbol(NUMBER, Decl(commaOperatorsMultipleOperators.ts, 2, 3)) +>NUMBER : Symbol(NUMBER, Decl(commaOperatorsMultipleOperators.ts, 3, 3)) >STRING.charAt : Symbol(String.charAt, Decl(lib.d.ts, --, --)) ->STRING : Symbol(STRING, Decl(commaOperatorsMultipleOperators.ts, 3, 3)) +>STRING : Symbol(STRING, Decl(commaOperatorsMultipleOperators.ts, 4, 3)) >charAt : Symbol(String.charAt, Decl(lib.d.ts, --, --)) >Object : Symbol(Object, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) var resultIsNumber2 = (null, true, 1); ->resultIsNumber2 : Symbol(resultIsNumber2, Decl(commaOperatorsMultipleOperators.ts, 24, 3)) +>resultIsNumber2 : Symbol(resultIsNumber2, Decl(commaOperatorsMultipleOperators.ts, 25, 3)) var resultIsObject2 = (++NUMBER, STRING.charAt(0), new Object()); ->resultIsObject2 : Symbol(resultIsObject2, Decl(commaOperatorsMultipleOperators.ts, 25, 3)) ->NUMBER : Symbol(NUMBER, Decl(commaOperatorsMultipleOperators.ts, 2, 3)) +>resultIsObject2 : Symbol(resultIsObject2, Decl(commaOperatorsMultipleOperators.ts, 26, 3)) +>NUMBER : Symbol(NUMBER, Decl(commaOperatorsMultipleOperators.ts, 3, 3)) >STRING.charAt : Symbol(String.charAt, Decl(lib.d.ts, --, --)) ->STRING : Symbol(STRING, Decl(commaOperatorsMultipleOperators.ts, 3, 3)) +>STRING : Symbol(STRING, Decl(commaOperatorsMultipleOperators.ts, 4, 3)) >charAt : Symbol(String.charAt, Decl(lib.d.ts, --, --)) >Object : Symbol(Object, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) diff --git a/tests/baselines/reference/commaOperatorsMultipleOperators.types b/tests/baselines/reference/commaOperatorsMultipleOperators.types index 9a2c7c7e5c5..a0d5b382c59 100644 --- a/tests/baselines/reference/commaOperatorsMultipleOperators.types +++ b/tests/baselines/reference/commaOperatorsMultipleOperators.types @@ -1,4 +1,5 @@ === tests/cases/conformance/expressions/commaOperator/commaOperatorsMultipleOperators.ts === + var ANY: any; >ANY : any @@ -99,11 +100,11 @@ var resultIsObject1 = (NUMBER, STRING, OBJECT); //Literal and expression null, true, 1; ->null, true, 1 : number ->null, true : boolean +>null, true, 1 : 1 +>null, true : true >null : null ->true : boolean ->1 : number +>true : true +>1 : 1 ++NUMBER, STRING.charAt(0), new Object(); >++NUMBER, STRING.charAt(0), new Object() : Object @@ -114,18 +115,18 @@ null, true, 1; >STRING.charAt : (pos: number) => string >STRING : string >charAt : (pos: number) => string ->0 : number +>0 : 0 >new Object() : Object >Object : ObjectConstructor var resultIsNumber2 = (null, true, 1); >resultIsNumber2 : number ->(null, true, 1) : number ->null, true, 1 : number ->null, true : boolean +>(null, true, 1) : 1 +>null, true, 1 : 1 +>null, true : true >null : null ->true : boolean ->1 : number +>true : true +>1 : 1 var resultIsObject2 = (++NUMBER, STRING.charAt(0), new Object()); >resultIsObject2 : Object @@ -138,7 +139,7 @@ var resultIsObject2 = (++NUMBER, STRING.charAt(0), new Object()); >STRING.charAt : (pos: number) => string >STRING : string >charAt : (pos: number) => string ->0 : number +>0 : 0 >new Object() : Object >Object : ObjectConstructor diff --git a/tests/baselines/reference/commentBeforeStaticMethod1.types b/tests/baselines/reference/commentBeforeStaticMethod1.types index 1b16709a701..0c9e69ed7a0 100644 --- a/tests/baselines/reference/commentBeforeStaticMethod1.types +++ b/tests/baselines/reference/commentBeforeStaticMethod1.types @@ -9,6 +9,6 @@ class C { >foo : () => string return "bar"; ->"bar" : string +>"bar" : "bar" } } diff --git a/tests/baselines/reference/commentEmitAtEndOfFile1.types b/tests/baselines/reference/commentEmitAtEndOfFile1.types index f96a1069a06..2071e98af8d 100644 --- a/tests/baselines/reference/commentEmitAtEndOfFile1.types +++ b/tests/baselines/reference/commentEmitAtEndOfFile1.types @@ -3,7 +3,7 @@ // test var f = '' >f : string ->'' : string +>'' : "" // test #2 module foo { diff --git a/tests/baselines/reference/commentOnAmbientVariable2.types b/tests/baselines/reference/commentOnAmbientVariable2.types index 28760dca1ec..10e5a442862 100644 --- a/tests/baselines/reference/commentOnAmbientVariable2.types +++ b/tests/baselines/reference/commentOnAmbientVariable2.types @@ -4,12 +4,12 @@ declare var x: number; >x : number x = 2; ->x = 2 : number +>x = 2 : 2 >x : number ->2 : number +>2 : 2 === tests/cases/compiler/commentOnAmbientVariable2_1.ts === var y = 1; >y : number ->1 : number +>1 : 1 diff --git a/tests/baselines/reference/commentOnExpressionStatement1.types b/tests/baselines/reference/commentOnExpressionStatement1.types index 11d5fe1c6b5..39141c8d52e 100644 --- a/tests/baselines/reference/commentOnExpressionStatement1.types +++ b/tests/baselines/reference/commentOnExpressionStatement1.types @@ -2,6 +2,6 @@ 1 + 1; // Comment. >1 + 1 : number ->1 : number ->1 : number +>1 : 1 +>1 : 1 diff --git a/tests/baselines/reference/commentOnIfStatement1.types b/tests/baselines/reference/commentOnIfStatement1.types index 7b983156f4d..4f7fcdddd22 100644 --- a/tests/baselines/reference/commentOnIfStatement1.types +++ b/tests/baselines/reference/commentOnIfStatement1.types @@ -2,5 +2,5 @@ // Test if (true) { ->true : boolean +>true : true } diff --git a/tests/baselines/reference/commentOnSimpleArrowFunctionBody1.types b/tests/baselines/reference/commentOnSimpleArrowFunctionBody1.types index 6dd530e438b..b8530468830 100644 --- a/tests/baselines/reference/commentOnSimpleArrowFunctionBody1.types +++ b/tests/baselines/reference/commentOnSimpleArrowFunctionBody1.types @@ -12,5 +12,5 @@ Foo(() => // do something 127); ->127 : number +>127 : 127 diff --git a/tests/baselines/reference/commentsAfterFunctionExpression1.types b/tests/baselines/reference/commentsAfterFunctionExpression1.types index 4a6b12bc210..b5712f1750c 100644 --- a/tests/baselines/reference/commentsAfterFunctionExpression1.types +++ b/tests/baselines/reference/commentsAfterFunctionExpression1.types @@ -7,20 +7,20 @@ var v = { >f : (a: any) => number >a => 0 : (a: any) => number >a : any ->0 : number +>0 : 0 g: (a => 0) /*t2*/, >g : (a: any) => number >(a => 0) : (a: any) => number >a => 0 : (a: any) => number >a : any ->0 : number +>0 : 0 h: (a => 0 /*t3*/) >h : (a: any) => number >(a => 0 /*t3*/) : (a: any) => number >a => 0 : (a: any) => number >a : any ->0 : number +>0 : 0 } diff --git a/tests/baselines/reference/commentsArgumentsOfCallExpression1.types b/tests/baselines/reference/commentsArgumentsOfCallExpression1.types index bcab3e3de36..81425e0dd5f 100644 --- a/tests/baselines/reference/commentsArgumentsOfCallExpression1.types +++ b/tests/baselines/reference/commentsArgumentsOfCallExpression1.types @@ -6,7 +6,7 @@ function foo(/*c1*/ x: any) { } foo(/*c2*/ 1); >foo(/*c2*/ 1) : void >foo : (x: any) => void ->1 : number +>1 : 1 foo(/*c3*/ function () { }); >foo(/*c3*/ function () { }) : void diff --git a/tests/baselines/reference/commentsArgumentsOfCallExpression2.types b/tests/baselines/reference/commentsArgumentsOfCallExpression2.types index f0a10077e66..7ec29aa9124 100644 --- a/tests/baselines/reference/commentsArgumentsOfCallExpression2.types +++ b/tests/baselines/reference/commentsArgumentsOfCallExpression2.types @@ -12,10 +12,10 @@ var a, b: any; foo(/*c2*/ 1, /*d2*/ 1 + 2, /*e1*/ a + b); >foo(/*c2*/ 1, /*d2*/ 1 + 2, /*e1*/ a + b) : void >foo : (x: any, y: any, w?: any) => void ->1 : number +>1 : 1 >1 + 2 : number ->1 : number ->2 : number +>1 : 1 +>2 : 2 >a + b : any >a : any >b : any @@ -51,5 +51,5 @@ foo( /*e4*/ /*e5*/ "hello"); ->"hello" : string +>"hello" : "hello" diff --git a/tests/baselines/reference/commentsBeforeFunctionExpression1.types b/tests/baselines/reference/commentsBeforeFunctionExpression1.types index a057918a74d..7182935f6b3 100644 --- a/tests/baselines/reference/commentsBeforeFunctionExpression1.types +++ b/tests/baselines/reference/commentsBeforeFunctionExpression1.types @@ -7,6 +7,6 @@ var v = { >f : (a: any) => number >(a) => 0 : (a: any) => number >a : any ->0 : number +>0 : 0 } diff --git a/tests/baselines/reference/commentsClassMembers.types b/tests/baselines/reference/commentsClassMembers.types index b599edc0463..3824b8acac0 100644 --- a/tests/baselines/reference/commentsClassMembers.types +++ b/tests/baselines/reference/commentsClassMembers.types @@ -574,7 +574,7 @@ var i1_r = i1.p2(20); >i1.p2 : (b: number) => number >i1 : c1 >p2 : (b: number) => number ->20 : number +>20 : 20 var i1_prop = i1.p3; >i1_prop : number @@ -607,7 +607,7 @@ var i1_ncr = i1.nc_p2(20); >i1.nc_p2 : (b: number) => number >i1 : c1 >nc_p2 : (b: number) => number ->20 : number +>20 : 20 var i1_ncprop = i1.nc_p3; >i1_ncprop : number @@ -640,7 +640,7 @@ var i1_s_r = c1.s2(20); >c1.s2 : (b: number) => number >c1 : typeof c1 >s2 : (b: number) => number ->20 : number +>20 : 20 var i1_s_prop = c1.s3; >i1_s_prop : number @@ -673,7 +673,7 @@ var i1_s_ncr = c1.nc_s2(20); >c1.nc_s2 : (b: number) => number >c1 : typeof c1 >nc_s2 : (b: number) => number ->20 : number +>20 : 20 var i1_s_ncprop = c1.nc_s3; >i1_s_ncprop : number @@ -743,11 +743,11 @@ class cProperties { public x = 10; /*trailing comment for property*/ >x : number ->10 : number +>10 : 10 private y = 10; // trailing comment of // style >y : number ->10 : number +>10 : 10 } var cProperties_i = new cProperties(); >cProperties_i : cProperties diff --git a/tests/baselines/reference/commentsCommentParsing.types b/tests/baselines/reference/commentsCommentParsing.types index a6e24609642..b41822679d8 100644 --- a/tests/baselines/reference/commentsCommentParsing.types +++ b/tests/baselines/reference/commentsCommentParsing.types @@ -151,8 +151,8 @@ function sum(a: number, b: number) { sum(10, 20); >sum(10, 20) : number >sum : (a: number, b: number) => number ->10 : number ->20 : number +>10 : 10 +>20 : 20 /** This is multiplication function*/ /** @param */ diff --git a/tests/baselines/reference/commentsEnums.types b/tests/baselines/reference/commentsEnums.types index ef2c52067d1..71d062f790a 100644 --- a/tests/baselines/reference/commentsEnums.types +++ b/tests/baselines/reference/commentsEnums.types @@ -6,18 +6,18 @@ enum Colors { /** Fancy name for 'blue'*/ Cornflower /* blue */, ->Cornflower : Colors +>Cornflower : Colors.Cornflower /** Fancy name for 'pink'*/ FancyPink ->FancyPink : Colors +>FancyPink : Colors.FancyPink } // trailing comment var x = Colors.Cornflower; >x : Colors ->Colors.Cornflower : Colors +>Colors.Cornflower : Colors.Cornflower >Colors : typeof Colors ->Cornflower : Colors +>Cornflower : Colors.Cornflower x = Colors.FancyPink; >x = Colors.FancyPink : Colors.FancyPink diff --git a/tests/baselines/reference/commentsFunction.types b/tests/baselines/reference/commentsFunction.types index db5e518339d..75a6cb6eaaf 100644 --- a/tests/baselines/reference/commentsFunction.types +++ b/tests/baselines/reference/commentsFunction.types @@ -26,8 +26,8 @@ function fooWithParameters(/** this is comment about a*/a: string, fooWithParameters("a", 10); >fooWithParameters("a", 10) : void >fooWithParameters : (a: string, b: number) => void ->"a" : string ->10 : number +>"a" : "a" +>10 : 10 /** fooFunc * comment @@ -64,14 +64,14 @@ var lambddaNoVarComment = /** this is lambda multiplication*/ (/**param a*/a: nu lambdaFoo(10, 20); >lambdaFoo(10, 20) : number >lambdaFoo : (a: number, b: number) => number ->10 : number ->20 : number +>10 : 10 +>20 : 20 lambddaNoVarComment(10, 20); >lambddaNoVarComment(10, 20) : number >lambddaNoVarComment : (a: number, b: number) => number ->10 : number ->20 : number +>10 : 10 +>20 : 20 function blah(a: string /* multiline trailing comment >blah : (a: string) => void @@ -104,12 +104,12 @@ lambdaFoo = (a, b) => a * b; // This is trailing comment /*leading comment*/() => 0; // Needs to be wrapped in parens to be a valid expression (not declaration) >() => 0 : () => number ->0 : number +>0 : 0 /*leading comment*/(() => 0); //trailing comment >(() => 0) : () => number >() => 0 : () => number ->0 : number +>0 : 0 function blah4(/*1*/a: string/*2*/,/*3*/b: string/*4*/) { >blah4 : (a: string, b: string) => void diff --git a/tests/baselines/reference/commentsInheritance.types b/tests/baselines/reference/commentsInheritance.types index 21dcde99dbf..804da3fd760 100644 --- a/tests/baselines/reference/commentsInheritance.types +++ b/tests/baselines/reference/commentsInheritance.types @@ -122,7 +122,7 @@ class c2 { >c2_prop : number return 10; ->10 : number +>10 : 10 } public c2_nc_p1: number; >c2_nc_p1 : number @@ -134,7 +134,7 @@ class c2 { >c2_nc_prop : number return 10; ->10 : number +>10 : 10 } /** c2 p1*/ public p1: number; @@ -149,7 +149,7 @@ class c2 { >prop : number return 10; ->10 : number +>10 : 10 } public nc_p1: number; >nc_p1 : number @@ -161,7 +161,7 @@ class c2 { >nc_prop : number return 10; ->10 : number +>10 : 10 } /** c2 constructor*/ constructor(a: number) { @@ -183,7 +183,7 @@ class c3 extends c2 { super(10); >super(10) : void >super : typeof c2 ->10 : number +>10 : 10 } /** c3 p1*/ public p1: number; @@ -198,7 +198,7 @@ class c3 extends c2 { >prop : number return 10; ->10 : number +>10 : 10 } public nc_p1: number; >nc_p1 : number @@ -210,14 +210,14 @@ class c3 extends c2 { >nc_prop : number return 10; ->10 : number +>10 : 10 } } var c2_i = new c2(10); >c2_i : c2 >new c2(10) : c2 >c2 : typeof c2 ->10 : number +>10 : 10 var c3_i = new c3(); >c3_i : c3 @@ -238,7 +238,7 @@ var c4_i = new c4(10); >c4_i : c4 >new c4(10) : c4 >c4 : typeof c4 ->10 : number +>10 : 10 interface i2 { >i2 : i2 diff --git a/tests/baselines/reference/commentsInterface.types b/tests/baselines/reference/commentsInterface.types index 13cc2b19f60..97b64d4c605 100644 --- a/tests/baselines/reference/commentsInterface.types +++ b/tests/baselines/reference/commentsInterface.types @@ -86,19 +86,19 @@ var i2_i_foo_r = i2_i.foo(30); >i2_i.foo : (b: number) => string >i2_i : i2 >foo : (b: number) => string ->30 : number +>30 : 30 var i2_i_i2_si = i2_i["hello"]; >i2_i_i2_si : any >i2_i["hello"] : any >i2_i : i2 ->"hello" : string +>"hello" : "hello" var i2_i_i2_ii = i2_i[30]; >i2_i_i2_ii : number >i2_i[30] : number >i2_i : i2 ->30 : number +>30 : 30 var i2_i_n = new i2_i(i1_i); >i2_i_n : any @@ -124,14 +124,14 @@ var i2_i_nc_foo_r = i2_i.nc_foo(30); >i2_i.nc_foo : (b: number) => string >i2_i : i2 >nc_foo : (b: number) => string ->30 : number +>30 : 30 var i2_i_r = i2_i(10, 20); >i2_i_r : number >i2_i(10, 20) : number >i2_i : i2 ->10 : number ->20 : number +>10 : 10 +>20 : 20 var i2_i_fnfoo = i2_i.fnfoo; >i2_i_fnfoo : (b: number) => string @@ -145,7 +145,7 @@ var i2_i_fnfoo_r = i2_i.fnfoo(10); >i2_i.fnfoo : (b: number) => string >i2_i : i2 >fnfoo : (b: number) => string ->10 : number +>10 : 10 var i2_i_nc_fnfoo = i2_i.nc_fnfoo; >i2_i_nc_fnfoo : (b: number) => string @@ -159,7 +159,7 @@ var i2_i_nc_fnfoo_r = i2_i.nc_fnfoo(10); >i2_i.nc_fnfoo : (b: number) => string >i2_i : i2 >nc_fnfoo : (b: number) => string ->10 : number +>10 : 10 interface i3 { >i3 : i3 @@ -203,7 +203,7 @@ i3_i = { >(/**i3_i a*/a: number) => "Hello" + a : (a: number) => string >a : number >"Hello" + a : string ->"Hello" : string +>"Hello" : "Hello" >a : number l: this.f, @@ -219,7 +219,7 @@ i3_i = { >this.f : any >this : any >f : any ->10 : number +>10 : 10 nc_x: this.l(this.x), >nc_x : any @@ -249,26 +249,26 @@ i3_i.f(10); >i3_i.f : (a: number) => string >i3_i : i3 >f : (a: number) => string ->10 : number +>10 : 10 i3_i.l(10); >i3_i.l(10) : string >i3_i.l : (b: number) => string >i3_i : i3 >l : (b: number) => string ->10 : number +>10 : 10 i3_i.nc_f(10); >i3_i.nc_f(10) : string >i3_i.nc_f : (a: number) => string >i3_i : i3 >nc_f : (a: number) => string ->10 : number +>10 : 10 i3_i.nc_l(10); >i3_i.nc_l(10) : string >i3_i.nc_l : (b: number) => string >i3_i : i3 >nc_l : (b: number) => string ->10 : number +>10 : 10 diff --git a/tests/baselines/reference/commentsOnObjectLiteral3.types b/tests/baselines/reference/commentsOnObjectLiteral3.types index a63920fce0f..4053e7e3f89 100644 --- a/tests/baselines/reference/commentsOnObjectLiteral3.types +++ b/tests/baselines/reference/commentsOnObjectLiteral3.types @@ -7,7 +7,7 @@ var v = { //property prop: 1 /* multiple trailing comments */ /*trailing comments*/, >prop : number ->1 : number +>1 : 1 //property func: function () { diff --git a/tests/baselines/reference/commentsOnObjectLiteral4.types b/tests/baselines/reference/commentsOnObjectLiteral4.types index 5d20d4f79cc..097d43cdd6d 100644 --- a/tests/baselines/reference/commentsOnObjectLiteral4.types +++ b/tests/baselines/reference/commentsOnObjectLiteral4.types @@ -11,7 +11,7 @@ var v = { >bar : number return 12; ->12 : number +>12 : 12 } } diff --git a/tests/baselines/reference/commentsOnPropertyOfObjectLiteral1.types b/tests/baselines/reference/commentsOnPropertyOfObjectLiteral1.types index 93ce87558d8..538afc61ee1 100644 --- a/tests/baselines/reference/commentsOnPropertyOfObjectLiteral1.types +++ b/tests/baselines/reference/commentsOnPropertyOfObjectLiteral1.types @@ -13,7 +13,7 @@ var resolve = { id1: /* c1 */ "hello", >id1 : string ->"hello" : string +>"hello" : "hello" id2: >id2 : (details: any) => any diff --git a/tests/baselines/reference/commentsOnRequireStatement.types b/tests/baselines/reference/commentsOnRequireStatement.types index 2cc6154ed60..cd146c731f7 100644 --- a/tests/baselines/reference/commentsOnRequireStatement.types +++ b/tests/baselines/reference/commentsOnRequireStatement.types @@ -2,12 +2,12 @@ export var subject = 10; >subject : number ->10 : number +>10 : 10 === tests/cases/compiler/1.ts === export var subject1 = 10; >subject1 : number ->10 : number +>10 : 10 === tests/cases/compiler/2.ts === /* blah0 */ diff --git a/tests/baselines/reference/commentsOnReturnStatement1.types b/tests/baselines/reference/commentsOnReturnStatement1.types index d44c91c0a8c..0188f088c3a 100644 --- a/tests/baselines/reference/commentsOnReturnStatement1.types +++ b/tests/baselines/reference/commentsOnReturnStatement1.types @@ -8,10 +8,10 @@ class DebugClass { // Start Debugger Test Code var i = 0; >i : number ->0 : number +>0 : 0 // End Debugger Test Code return true; ->true : boolean +>true : true } } diff --git a/tests/baselines/reference/commentsOnStaticMembers.types b/tests/baselines/reference/commentsOnStaticMembers.types index 46a1ca211ff..b4fae1094b6 100644 --- a/tests/baselines/reference/commentsOnStaticMembers.types +++ b/tests/baselines/reference/commentsOnStaticMembers.types @@ -8,7 +8,7 @@ class test { */ public static p1: string = ""; >p1 : string ->"" : string +>"" : "" /** * p2 comment does not appear in output @@ -21,7 +21,7 @@ class test { */ private static p3: string = ""; >p3 : string ->"" : string +>"" : "" /** * p4 comment does not appear in output diff --git a/tests/baselines/reference/commentsOverloads.types b/tests/baselines/reference/commentsOverloads.types index 3281ab83ab6..88632e04c6a 100644 --- a/tests/baselines/reference/commentsOverloads.types +++ b/tests/baselines/reference/commentsOverloads.types @@ -13,17 +13,17 @@ function f1(aOrb: any) { >aOrb : any return 10; ->10 : number +>10 : 10 } f1("hello"); >f1("hello") : number >f1 : { (a: number): number; (b: string): number; } ->"hello" : string +>"hello" : "hello" f1(10); >f1(10) : number >f1 : { (a: number): number; (b: string): number; } ->10 : number +>10 : 10 function f2(a: number): number; >f2 : { (a: number): number; (b: string): number; } @@ -40,17 +40,17 @@ function f2(aOrb: any) { >aOrb : any return 10; ->10 : number +>10 : 10 } f2("hello"); >f2("hello") : number >f2 : { (a: number): number; (b: string): number; } ->"hello" : string +>"hello" : "hello" f2(10); >f2(10) : number >f2 : { (a: number): number; (b: string): number; } ->10 : number +>10 : 10 function f3(a: number): number; >f3 : { (a: number): number; (b: string): number; } @@ -65,17 +65,17 @@ function f3(aOrb: any) { >aOrb : any return 10; ->10 : number +>10 : 10 } f3("hello"); >f3("hello") : number >f3 : { (a: number): number; (b: string): number; } ->"hello" : string +>"hello" : "hello" f3(10); >f3(10) : number >f3 : { (a: number): number; (b: string): number; } ->10 : number +>10 : 10 /** this is signature 4 - with number parameter*/ function f4(/**param a*/a: number): number; @@ -92,17 +92,17 @@ function f4(aOrb: any) { >aOrb : any return 10; ->10 : number +>10 : 10 } f4("hello"); >f4("hello") : number >f4 : { (a: number): number; (b: string): number; } ->"hello" : string +>"hello" : "hello" f4(10); >f4(10) : number >f4 : { (a: number): number; (b: string): number; } ->10 : number +>10 : 10 interface i1 { >i1 : i1 @@ -252,7 +252,7 @@ class c { >aorb : any return 10; ->10 : number +>10 : 10 } /** prop2 1*/ public prop2(a: number): number; @@ -268,7 +268,7 @@ class c { >aorb : any return 10; ->10 : number +>10 : 10 } public prop3(a: number): number; >prop3 : { (a: number): number; (b: string): number; } @@ -284,7 +284,7 @@ class c { >aorb : any return 10; ->10 : number +>10 : 10 } /** prop4 1*/ public prop4(a: number): number; @@ -301,7 +301,7 @@ class c { >aorb : any return 10; ->10 : number +>10 : 10 } /** prop5 1*/ public prop5(a: number): number; @@ -319,7 +319,7 @@ class c { >aorb : any return 10; ->10 : number +>10 : 10 } } class c1 { @@ -405,59 +405,59 @@ var c1_i_1 = new c1(10); >c1_i_1 : c1 >new c1(10) : c1 >c1 : typeof c1 ->10 : number +>10 : 10 var c1_i_2 = new c1("hello"); >c1_i_2 : c1 >new c1("hello") : c1 >c1 : typeof c1 ->"hello" : string +>"hello" : "hello" var c2_i_1 = new c2(10); >c2_i_1 : c2 >new c2(10) : c2 >c2 : typeof c2 ->10 : number +>10 : 10 var c2_i_2 = new c2("hello"); >c2_i_2 : c2 >new c2("hello") : c2 >c2 : typeof c2 ->"hello" : string +>"hello" : "hello" var c3_i_1 = new c3(10); >c3_i_1 : c3 >new c3(10) : c3 >c3 : typeof c3 ->10 : number +>10 : 10 var c3_i_2 = new c3("hello"); >c3_i_2 : c3 >new c3("hello") : c3 >c3 : typeof c3 ->"hello" : string +>"hello" : "hello" var c4_i_1 = new c4(10); >c4_i_1 : c4 >new c4(10) : c4 >c4 : typeof c4 ->10 : number +>10 : 10 var c4_i_2 = new c4("hello"); >c4_i_2 : c4 >new c4("hello") : c4 >c4 : typeof c4 ->"hello" : string +>"hello" : "hello" var c5_i_1 = new c5(10); >c5_i_1 : c5 >new c5(10) : c5 >c5 : typeof c5 ->10 : number +>10 : 10 var c5_i_2 = new c5("hello"); >c5_i_2 : c5 >new c5("hello") : c5 >c5 : typeof c5 ->"hello" : string +>"hello" : "hello" diff --git a/tests/baselines/reference/commentsPropertySignature1.types b/tests/baselines/reference/commentsPropertySignature1.types index 09dad1eaefb..f5fdf48042b 100644 --- a/tests/baselines/reference/commentsPropertySignature1.types +++ b/tests/baselines/reference/commentsPropertySignature1.types @@ -6,7 +6,7 @@ var a = { /** own x*/ x: 0 >x : number ->0 : number +>0 : 0 }; diff --git a/tests/baselines/reference/commentsVarDecl.types b/tests/baselines/reference/commentsVarDecl.types index 033590b3445..1127f5ed3f4 100644 --- a/tests/baselines/reference/commentsVarDecl.types +++ b/tests/baselines/reference/commentsVarDecl.types @@ -3,30 +3,30 @@ /** Variable comments*/ var myVariable = 10; // This trailing Comment1 >myVariable : number ->10 : number +>10 : 10 /** This is another variable comment*/ var anotherVariable = 30; >anotherVariable : number ->30 : number +>30 : 30 // shouldn't appear var aVar = ""; >aVar : string ->"" : string +>"" : "" /** this is multiline comment * All these variables are of number type */ var anotherAnotherVariable = 70; /* these are multiple trailing comments */ /* multiple trailing comments */ >anotherAnotherVariable : number ->70 : number +>70 : 70 /** Triple slash multiline comment*/ /** another line in the comment*/ /** comment line 2*/ var x = 70; /* multiline trailing comment >x : number ->70 : number +>70 : 70 this is multiline trailing comment */ /** Triple slash comment on the assignement shouldnt be in .d.ts file*/ @@ -39,12 +39,12 @@ x = myVariable; /** jsdocstyle comment - only this comment should be in .d.ts file*/ var n = 30; >n : number ->30 : number +>30 : 30 /** var deckaration with comment on type as well*/ var y = /** value comment */ 20; >y : number ->20 : number +>20 : 20 /// var deckaration with comment on type as well var yy = @@ -52,7 +52,7 @@ var yy = /// value comment 20; ->20 : number +>20 : 20 /** comment2 */ var z = /** lambda comment */ (x: number, y: number) => x + y; diff --git a/tests/baselines/reference/commentsVariableStatement1.types b/tests/baselines/reference/commentsVariableStatement1.types index 4bb6753db8a..1684f25c570 100644 --- a/tests/baselines/reference/commentsVariableStatement1.types +++ b/tests/baselines/reference/commentsVariableStatement1.types @@ -3,5 +3,5 @@ /** Comment */ var v = 1; >v : number ->1 : number +>1 : 1 diff --git a/tests/baselines/reference/commentsdoNotEmitComments.types b/tests/baselines/reference/commentsdoNotEmitComments.types index 465c841e20f..e30555db69a 100644 --- a/tests/baselines/reference/commentsdoNotEmitComments.types +++ b/tests/baselines/reference/commentsdoNotEmitComments.types @@ -3,7 +3,7 @@ /** Variable comments*/ var myVariable = 10; >myVariable : number ->10 : number +>10 : 10 /** function comments*/ function foo(/** parameter comment*/p: number) { @@ -18,7 +18,7 @@ var fooVar: () => void; foo(50); >foo(50) : void >foo : (p: number) => void ->50 : number +>50 : 50 fooVar(); >fooVar() : void @@ -35,7 +35,7 @@ class c { /** property comment */ public b = 10; >b : number ->10 : number +>10 : 10 /** function comment */ public myFoo() { @@ -158,9 +158,9 @@ declare var x; /** const enum member value comment (generated by TS) */ const enum color { red, green, blue } >color : color ->red : color ->green : color ->blue : color +>red : color.red +>green : color.green +>blue : color.blue var shade: color = color.green; >shade : color diff --git a/tests/baselines/reference/commentsemitComments.types b/tests/baselines/reference/commentsemitComments.types index 2594fb53fe9..03bf0912092 100644 --- a/tests/baselines/reference/commentsemitComments.types +++ b/tests/baselines/reference/commentsemitComments.types @@ -3,7 +3,7 @@ /** Variable comments*/ var myVariable = 10; >myVariable : number ->10 : number +>10 : 10 /** function comments*/ function foo(/** parameter comment*/p: number) { @@ -18,7 +18,7 @@ var fooVar: () => void; foo(50); >foo(50) : void >foo : (p: number) => void ->50 : number +>50 : 50 fooVar(); >fooVar() : void @@ -35,7 +35,7 @@ class c { /** property comment */ public b = 10; >b : number ->10 : number +>10 : 10 /** function comment */ public myFoo() { diff --git a/tests/baselines/reference/commonJSImportAsPrimaryExpression.types b/tests/baselines/reference/commonJSImportAsPrimaryExpression.types index 01d96b31fc7..921c659500c 100644 --- a/tests/baselines/reference/commonJSImportAsPrimaryExpression.types +++ b/tests/baselines/reference/commonJSImportAsPrimaryExpression.types @@ -18,10 +18,10 @@ export class C1 { m1 = 42; >m1 : number ->42 : number +>42 : 42 static s1 = true; >s1 : boolean ->true : boolean +>true : true } diff --git a/tests/baselines/reference/commonJSImportNotAsPrimaryExpression.types b/tests/baselines/reference/commonJSImportNotAsPrimaryExpression.types index 5d90a8dadc2..32e45936f33 100644 --- a/tests/baselines/reference/commonJSImportNotAsPrimaryExpression.types +++ b/tests/baselines/reference/commonJSImportNotAsPrimaryExpression.types @@ -28,7 +28,7 @@ var y: typeof foo.C1.s1 = false; >foo : typeof foo >C1 : typeof foo.C1 >s1 : boolean ->false : boolean +>false : false var z: foo.M1.I2; >z : f.I2 @@ -49,11 +49,11 @@ export class C1 { m1 = 42; >m1 : number ->42 : number +>42 : 42 static s1 = true; >s1 : boolean ->true : boolean +>true : true } export interface I1 { @@ -81,8 +81,8 @@ export enum E1 { >E1 : E1 A,B,C ->A : E1 ->B : E1 ->C : E1 +>A : E1.A +>B : E1.B +>C : E1.C } diff --git a/tests/baselines/reference/commonSourceDir5.types b/tests/baselines/reference/commonSourceDir5.types index dd72099d542..f1c3e40e983 100644 --- a/tests/baselines/reference/commonSourceDir5.types +++ b/tests/baselines/reference/commonSourceDir5.types @@ -19,8 +19,8 @@ export var i = Math.sqrt(-1); >Math.sqrt : (x: number) => number >Math : Math >sqrt : (x: number) => number ->-1 : number ->1 : number +>-1 : -1 +>1 : 1 export var z = pi * pi; >z : number diff --git a/tests/baselines/reference/commonSourceDir6.types b/tests/baselines/reference/commonSourceDir6.types index e30cdd2deee..890b95048fe 100644 --- a/tests/baselines/reference/commonSourceDir6.types +++ b/tests/baselines/reference/commonSourceDir6.types @@ -18,8 +18,8 @@ export var i = Math.sqrt(-1); >Math.sqrt : (x: number) => number >Math : Math >sqrt : (x: number) => number ->-1 : number ->1 : number +>-1 : -1 +>1 : 1 export var z = pi * pi; >z : number diff --git a/tests/baselines/reference/comparisonOperatorWithIdenticalPrimitiveType.types b/tests/baselines/reference/comparisonOperatorWithIdenticalPrimitiveType.types index a21af43e9c7..b4f1a81bff4 100644 --- a/tests/baselines/reference/comparisonOperatorWithIdenticalPrimitiveType.types +++ b/tests/baselines/reference/comparisonOperatorWithIdenticalPrimitiveType.types @@ -1,9 +1,9 @@ === tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithIdenticalPrimitiveType.ts === enum E { a, b, c } >E : E ->a : E ->b : E ->c : E +>a : E.a +>b : E.b +>c : E.c var a: number; >a : number diff --git a/tests/baselines/reference/comparisonOperatorWithOneOperandIsAny.types b/tests/baselines/reference/comparisonOperatorWithOneOperandIsAny.types index e132f03cfa3..9e3c5f59cbf 100644 --- a/tests/baselines/reference/comparisonOperatorWithOneOperandIsAny.types +++ b/tests/baselines/reference/comparisonOperatorWithOneOperandIsAny.types @@ -4,9 +4,9 @@ var x: any; enum E { a, b, c } >E : E ->a : E ->b : E ->c : E +>a : E.a +>b : E.b +>c : E.c function foo(t: T) { >foo : (t: T) => void diff --git a/tests/baselines/reference/comparisonOperatorWithOneOperandIsNull.types b/tests/baselines/reference/comparisonOperatorWithOneOperandIsNull.types index 12d9235d44b..e185a1d501b 100644 --- a/tests/baselines/reference/comparisonOperatorWithOneOperandIsNull.types +++ b/tests/baselines/reference/comparisonOperatorWithOneOperandIsNull.types @@ -1,9 +1,9 @@ === tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithOneOperandIsNull.ts === enum E { a, b, c } >E : E ->a : E ->b : E ->c : E +>a : E.a +>b : E.b +>c : E.c function foo(t: T) { >foo : (t: T) => void diff --git a/tests/baselines/reference/comparisonOperatorWithOneOperandIsUndefined.types b/tests/baselines/reference/comparisonOperatorWithOneOperandIsUndefined.types index b4a70c3e3d6..00f6ca234a2 100644 --- a/tests/baselines/reference/comparisonOperatorWithOneOperandIsUndefined.types +++ b/tests/baselines/reference/comparisonOperatorWithOneOperandIsUndefined.types @@ -5,9 +5,9 @@ var x: typeof undefined; enum E { a, b, c } >E : E ->a : E ->b : E ->c : E +>a : E.a +>b : E.b +>c : E.c function foo(t: T) { >foo : (t: T) => void diff --git a/tests/baselines/reference/comparisonOperatorWithSubtypeEnumAndNumber.types b/tests/baselines/reference/comparisonOperatorWithSubtypeEnumAndNumber.types index 0f07c158cc4..bf513174ef2 100644 --- a/tests/baselines/reference/comparisonOperatorWithSubtypeEnumAndNumber.types +++ b/tests/baselines/reference/comparisonOperatorWithSubtypeEnumAndNumber.types @@ -1,9 +1,9 @@ === tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithSubtypeEnumAndNumber.ts === enum E { a, b, c } >E : E ->a : E ->b : E ->c : E +>a : E.a +>b : E.b +>c : E.c var a: E; >a : E @@ -28,34 +28,34 @@ var ra2 = b < a; var ra3 = E.a < b; >ra3 : boolean >E.a < b : boolean ->E.a : E +>E.a : E.a >E : typeof E ->a : E +>a : E.a >b : number var ra4 = b < E.a; >ra4 : boolean >b < E.a : boolean >b : number ->E.a : E +>E.a : E.a >E : typeof E ->a : E +>a : E.a var ra5 = E.a < 0; >ra5 : boolean >E.a < 0 : boolean ->E.a : E +>E.a : E.a >E : typeof E ->a : E ->0 : number +>a : E.a +>0 : 0 var ra6 = 0 < E.a; >ra6 : boolean >0 < E.a : boolean ->0 : number ->E.a : E +>0 : 0 +>E.a : E.a >E : typeof E ->a : E +>a : E.a // operator > var rb1 = a > b; @@ -73,34 +73,34 @@ var rb2 = b > a; var rb3 = E.a > b; >rb3 : boolean >E.a > b : boolean ->E.a : E +>E.a : E.a >E : typeof E ->a : E +>a : E.a >b : number var rb4 = b > E.a; >rb4 : boolean >b > E.a : boolean >b : number ->E.a : E +>E.a : E.a >E : typeof E ->a : E +>a : E.a var rb5 = E.a > 0; >rb5 : boolean >E.a > 0 : boolean ->E.a : E +>E.a : E.a >E : typeof E ->a : E ->0 : number +>a : E.a +>0 : 0 var rb6 = 0 > E.a; >rb6 : boolean >0 > E.a : boolean ->0 : number ->E.a : E +>0 : 0 +>E.a : E.a >E : typeof E ->a : E +>a : E.a // operator <= var rc1 = a <= b; @@ -118,34 +118,34 @@ var rc2 = b <= a; var rc3 = E.a <= b; >rc3 : boolean >E.a <= b : boolean ->E.a : E +>E.a : E.a >E : typeof E ->a : E +>a : E.a >b : number var rc4 = b <= E.a; >rc4 : boolean >b <= E.a : boolean >b : number ->E.a : E +>E.a : E.a >E : typeof E ->a : E +>a : E.a var rc5 = E.a <= 0; >rc5 : boolean >E.a <= 0 : boolean ->E.a : E +>E.a : E.a >E : typeof E ->a : E ->0 : number +>a : E.a +>0 : 0 var rc6 = 0 <= E.a; >rc6 : boolean >0 <= E.a : boolean ->0 : number ->E.a : E +>0 : 0 +>E.a : E.a >E : typeof E ->a : E +>a : E.a // operator >= var rd1 = a >= b; @@ -163,34 +163,34 @@ var rd2 = b >= a; var rd3 = E.a >= b; >rd3 : boolean >E.a >= b : boolean ->E.a : E +>E.a : E.a >E : typeof E ->a : E +>a : E.a >b : number var rd4 = b >= E.a; >rd4 : boolean >b >= E.a : boolean >b : number ->E.a : E +>E.a : E.a >E : typeof E ->a : E +>a : E.a var rd5 = E.a >= 0; >rd5 : boolean >E.a >= 0 : boolean ->E.a : E +>E.a : E.a >E : typeof E ->a : E ->0 : number +>a : E.a +>0 : 0 var rd6 = 0 >= E.a; >rd6 : boolean >0 >= E.a : boolean ->0 : number ->E.a : E +>0 : 0 +>E.a : E.a >E : typeof E ->a : E +>a : E.a // operator == var re1 = a == b; diff --git a/tests/baselines/reference/complexNarrowingWithAny.js b/tests/baselines/reference/complexNarrowingWithAny.js new file mode 100644 index 00000000000..0a137f5d793 --- /dev/null +++ b/tests/baselines/reference/complexNarrowingWithAny.js @@ -0,0 +1,1027 @@ +//// [complexNarrowingWithAny.ts] +// Repro from #10869 + +/** + * This file is generated by the Angular 2 template compiler. + * Do not edit. + */ + /* tslint:disable */ + +// import * as import0 from '@angular/core/src/linker/ng_module_factory'; +// import * as import1 from '../../app'; +// import * as import2 from '@angular/common/src/common_module'; +// import * as import3 from '@angular/core/src/application_module'; +// import * as import4 from '@angular/platform-browser/src/browser'; +// import * as import5 from '@angular/forms/src/directives'; +// import * as import6 from '@angular/forms/src/form_providers'; +// import * as import7 from '@angular/common/src/localization'; +// import * as import8 from '@angular/core/src/application_init'; +// import * as import9 from '@angular/core/src/testability/testability'; +// import * as import10 from '@angular/core/src/application_ref'; +// import * as import11 from '@angular/core/src/linker/compiler'; +// import * as import12 from '@angular/platform-browser/src/dom/events/hammer_gestures'; +// import * as import13 from '@angular/platform-browser/src/dom/events/event_manager'; +// import * as import14 from '@angular/platform-browser/src/dom/shared_styles_host'; +// import * as import15 from '@angular/platform-browser/src/dom/dom_renderer'; +// import * as import16 from '@angular/platform-browser/src/security/dom_sanitization_service'; +// import * as import17 from '@angular/core/src/linker/view_utils'; +// import * as import18 from '@angular/forms/src/form_builder'; +// import * as import19 from '@angular/forms/src/directives/radio_control_value_accessor'; +// import * as import20 from '@angular/core/src/di/injector'; +// import * as import21 from '@angular/core/src/application_tokens'; +// import * as import22 from '@angular/platform-browser/src/dom/events/dom_events'; +// import * as import23 from '@angular/platform-browser/src/dom/events/key_events'; +// import * as import24 from '@angular/core/src/zone/ng_zone'; +// import * as import25 from '@angular/platform-browser/src/dom/debug/ng_probe'; +// import * as import26 from '@angular/core/src/console'; +// import * as import27 from '@angular/core/src/i18n/tokens'; +// import * as import28 from '@angular/core/src/error_handler'; +// import * as import29 from '@angular/platform-browser/src/dom/dom_tokens'; +// import * as import30 from '@angular/platform-browser/src/dom/animation_driver'; +// import * as import31 from '@angular/core/src/render/api'; +// import * as import32 from '@angular/core/src/security'; +// import * as import33 from '@angular/core/src/change_detection/differs/iterable_differs'; +// import * as import34 from '@angular/core/src/change_detection/differs/keyvalue_differs'; +// import * as import35 from '@angular/core/src/i18n/tokens'; +// import * as import36 from '@angular/core/src/render/api'; +// import * as import37 from '@angular/core/src/linker/view'; +// import * as import38 from '@angular/core/src/linker/element'; +// import * as import39 from '@angular/core/src/linker/view_utils'; +// import * as import40 from '@angular/core/src/linker/view_type'; +// import * as import41 from '@angular/core/src/change_detection/change_detection'; +// import * as import42 from '@angular/core/src/metadata/view'; +// import * as import43 from '@angular/core/src/linker/component_factory'; +// import * as import44 from '@angular/forms/src/directives/reactive_directives/form_group_directive'; +// import * as import45 from '@angular/forms/src/directives/ng_control_status'; +// import * as import46 from '@angular/forms/src/directives/default_value_accessor'; +// import * as import47 from '@angular/forms/src/directives/reactive_directives/form_control_name'; +// import * as import48 from '@angular/core/src/linker/element_ref'; +// import * as import49 from '@angular/forms/src/directives/control_value_accessor'; +// import * as import50 from '@angular/forms/src/directives/ng_control'; +// import * as import51 from '@angular/forms/src/directives/control_container'; + +//stubbed out imports + +namespace import44 { + export class FormGroupDirective { + constructor(any){} + } +} + +namespace import45 { + export class NgControlStatus { + constructor(any){} + } + export class NgControlStatusGroup { + constructor(any){} + } +} + +namespace import46 { + export class DefaultValueAccessor { + constructor(any){} + } +} + +namespace import47 { + export class FormControlName { + constructor(any){} + } +} + +namespace import48 { + export class FormControlName { + constructor(any){} + } +} + + +//HERE BE DRAGONS + +//Using a value here - 65+ seconds to typecheck +namespace import49 { + //real code uses an opaque token, using new String() to simulate. + //export var NG_VALUE_ACCESSOR = new OpaqueToken('ngValueAccessor') + export var NG_VALUE_ACCESSOR = new String('foo') +} + +//using a class - < 1 sec typecheck +// namespace import49 { +// export class NG_VALUE_ACCESSOR { +// constructor(any){} +// } +// } + +//END DRAGONS + + +namespace import50 { + export class NgControl { + constructor(any){} + } +} + +namespace import51 { + export class ControlContainer { + constructor(any){} + } +} + + + +class _View_AppComponent0 { + _text_0:any; + _el_1:any; + _FormGroupDirective_1_3:import44.FormGroupDirective; + _ControlContainer_1_4:any; + _NgControlStatusGroup_1_5:import45.NgControlStatusGroup; + _text_2:any; + _el_3:any; + _DefaultValueAccessor_3_3:import46.DefaultValueAccessor; + _NG_VALUE_ACCESSOR_3_4:any[]; + _FormControlName_3_5:import47.FormControlName; + _NgControl_3_6:any; + _NgControlStatus_3_7:import45.NgControlStatus; + _el_4:any; + _text_5:any; + _el_6:any; + _DefaultValueAccessor_6_3:import46.DefaultValueAccessor; + _NG_VALUE_ACCESSOR_6_4:any[]; + _FormControlName_6_5:import47.FormControlName; + _NgControl_6_6:any; + _NgControlStatus_6_7:import45.NgControlStatus; + _el_7:any; + _text_8:any; + _el_9:any; + _DefaultValueAccessor_9_3:import46.DefaultValueAccessor; + _NG_VALUE_ACCESSOR_9_4:any[]; + _FormControlName_9_5:import47.FormControlName; + _NgControl_9_6:any; + _NgControlStatus_9_7:import45.NgControlStatus; + _el_10:any; + _text_11:any; + _el_12:any; + _DefaultValueAccessor_12_3:import46.DefaultValueAccessor; + _NG_VALUE_ACCESSOR_12_4:any[]; + _FormControlName_12_5:import47.FormControlName; + _NgControl_12_6:any; + _NgControlStatus_12_7:import45.NgControlStatus; + _el_13:any; + _text_14:any; + _el_15:any; + _DefaultValueAccessor_15_3:import46.DefaultValueAccessor; + _NG_VALUE_ACCESSOR_15_4:any[]; + _FormControlName_15_5:import47.FormControlName; + _NgControl_15_6:any; + _NgControlStatus_15_7:import45.NgControlStatus; + _el_16:any; + _text_17:any; + _el_18:any; + _DefaultValueAccessor_18_3:import46.DefaultValueAccessor; + _NG_VALUE_ACCESSOR_18_4:any[]; + _FormControlName_18_5:import47.FormControlName; + _NgControl_18_6:any; + _NgControlStatus_18_7:import45.NgControlStatus; + _el_19:any; + _text_20:any; + _el_21:any; + _DefaultValueAccessor_21_3:import46.DefaultValueAccessor; + _NG_VALUE_ACCESSOR_21_4:any[]; + _FormControlName_21_5:import47.FormControlName; + _NgControl_21_6:any; + _NgControlStatus_21_7:import45.NgControlStatus; + _el_22:any; + _text_23:any; + _el_24:any; + _DefaultValueAccessor_24_3:import46.DefaultValueAccessor; + _NG_VALUE_ACCESSOR_24_4:any[]; + _FormControlName_24_5:import47.FormControlName; + _NgControl_24_6:any; + _NgControlStatus_24_7:import45.NgControlStatus; + _el_25:any; + _text_26:any; + _el_27:any; + _DefaultValueAccessor_27_3:import46.DefaultValueAccessor; + _NG_VALUE_ACCESSOR_27_4:any[]; + _FormControlName_27_5:import47.FormControlName; + _NgControl_27_6:any; + _NgControlStatus_27_7:import45.NgControlStatus; + _el_28:any; + _text_29:any; + _el_30:any; + _DefaultValueAccessor_30_3:import46.DefaultValueAccessor; + _NG_VALUE_ACCESSOR_30_4:any[]; + _FormControlName_30_5:import47.FormControlName; + _NgControl_30_6:any; + _NgControlStatus_30_7:import45.NgControlStatus; + _el_31:any; + _text_32:any; + _el_33:any; + _DefaultValueAccessor_33_3:import46.DefaultValueAccessor; + _NG_VALUE_ACCESSOR_33_4:any[]; + _FormControlName_33_5:import47.FormControlName; + _NgControl_33_6:any; + _NgControlStatus_33_7:import45.NgControlStatus; + _el_34:any; + _text_35:any; + _el_36:any; + _DefaultValueAccessor_36_3:import46.DefaultValueAccessor; + _NG_VALUE_ACCESSOR_36_4:any[]; + _FormControlName_36_5:import47.FormControlName; + _NgControl_36_6:any; + _NgControlStatus_36_7:import45.NgControlStatus; + _el_37:any; + _text_38:any; + _el_39:any; + _DefaultValueAccessor_39_3:import46.DefaultValueAccessor; + _NG_VALUE_ACCESSOR_39_4:any[]; + _FormControlName_39_5:import47.FormControlName; + _NgControl_39_6:any; + _NgControlStatus_39_7:import45.NgControlStatus; + _el_40:any; + _text_41:any; + _el_42:any; + _DefaultValueAccessor_42_3:import46.DefaultValueAccessor; + _NG_VALUE_ACCESSOR_42_4:any[]; + _FormControlName_42_5:import47.FormControlName; + _NgControl_42_6:any; + _NgControlStatus_42_7:import45.NgControlStatus; + _el_43:any; + _text_44:any; + _el_45:any; + _DefaultValueAccessor_45_3:import46.DefaultValueAccessor; + _NG_VALUE_ACCESSOR_45_4:any[]; + _FormControlName_45_5:import47.FormControlName; + _NgControl_45_6:any; + _NgControlStatus_45_7:import45.NgControlStatus; + _el_46:any; + _text_47:any; + _el_48:any; + _DefaultValueAccessor_48_3:import46.DefaultValueAccessor; + _NG_VALUE_ACCESSOR_48_4:any[]; + _FormControlName_48_5:import47.FormControlName; + _NgControl_48_6:any; + _NgControlStatus_48_7:import45.NgControlStatus; + _el_49:any; + _text_50:any; + _el_51:any; + _DefaultValueAccessor_51_3:import46.DefaultValueAccessor; + _NG_VALUE_ACCESSOR_51_4:any[]; + _FormControlName_51_5:import47.FormControlName; + _NgControl_51_6:any; + _NgControlStatus_51_7:import45.NgControlStatus; + _el_52:any; + _text_53:any; + _el_54:any; + _DefaultValueAccessor_54_3:import46.DefaultValueAccessor; + _NG_VALUE_ACCESSOR_54_4:any[]; + _FormControlName_54_5:import47.FormControlName; + _NgControl_54_6:any; + _NgControlStatus_54_7:import45.NgControlStatus; + _el_55:any; + _text_56:any; + _el_57:any; + _DefaultValueAccessor_57_3:import46.DefaultValueAccessor; + _NG_VALUE_ACCESSOR_57_4:any[]; + _FormControlName_57_5:import47.FormControlName; + _NgControl_57_6:any; + _NgControlStatus_57_7:import45.NgControlStatus; + _el_58:any; + _text_59:any; + _el_60:any; + _DefaultValueAccessor_60_3:import46.DefaultValueAccessor; + _NG_VALUE_ACCESSOR_60_4:any[]; + _FormControlName_60_5:import47.FormControlName; + _NgControl_60_6:any; + _NgControlStatus_60_7:import45.NgControlStatus; + _el_61:any; + _text_62:any; + _text_63:any; + /*private*/ _expr_2:any; + /*private*/ _expr_3:any; + /*private*/ _expr_4:any; + /*private*/ _expr_5:any; + /*private*/ _expr_6:any; + /*private*/ _expr_7:any; + /*private*/ _expr_8:any; + /*private*/ _expr_11:any; + /*private*/ _expr_12:any; + /*private*/ _expr_13:any; + /*private*/ _expr_14:any; + /*private*/ _expr_15:any; + /*private*/ _expr_16:any; + /*private*/ _expr_17:any; + /*private*/ _expr_20:any; + /*private*/ _expr_21:any; + /*private*/ _expr_22:any; + /*private*/ _expr_23:any; + /*private*/ _expr_24:any; + /*private*/ _expr_25:any; + /*private*/ _expr_26:any; + /*private*/ _expr_29:any; + /*private*/ _expr_30:any; + /*private*/ _expr_31:any; + /*private*/ _expr_32:any; + /*private*/ _expr_33:any; + /*private*/ _expr_34:any; + /*private*/ _expr_35:any; + /*private*/ _expr_38:any; + /*private*/ _expr_39:any; + /*private*/ _expr_40:any; + /*private*/ _expr_41:any; + /*private*/ _expr_42:any; + /*private*/ _expr_43:any; + /*private*/ _expr_44:any; + /*private*/ _expr_47:any; + /*private*/ _expr_48:any; + /*private*/ _expr_49:any; + /*private*/ _expr_50:any; + /*private*/ _expr_51:any; + /*private*/ _expr_52:any; + /*private*/ _expr_53:any; + /*private*/ _expr_56:any; + /*private*/ _expr_57:any; + /*private*/ _expr_58:any; + /*private*/ _expr_59:any; + /*private*/ _expr_60:any; + /*private*/ _expr_61:any; + /*private*/ _expr_62:any; + /*private*/ _expr_65:any; + /*private*/ _expr_66:any; + /*private*/ _expr_67:any; + /*private*/ _expr_68:any; + /*private*/ _expr_69:any; + /*private*/ _expr_70:any; + /*private*/ _expr_71:any; + /*private*/ _expr_74:any; + /*private*/ _expr_75:any; + /*private*/ _expr_76:any; + /*private*/ _expr_77:any; + /*private*/ _expr_78:any; + /*private*/ _expr_79:any; + /*private*/ _expr_80:any; + /*private*/ _expr_83:any; + /*private*/ _expr_84:any; + /*private*/ _expr_85:any; + /*private*/ _expr_86:any; + /*private*/ _expr_87:any; + /*private*/ _expr_88:any; + /*private*/ _expr_89:any; + /*private*/ _expr_92:any; + /*private*/ _expr_93:any; + /*private*/ _expr_94:any; + /*private*/ _expr_95:any; + /*private*/ _expr_96:any; + /*private*/ _expr_97:any; + /*private*/ _expr_98:any; + /*private*/ _expr_101:any; + /*private*/ _expr_102:any; + /*private*/ _expr_103:any; + /*private*/ _expr_104:any; + /*private*/ _expr_105:any; + /*private*/ _expr_106:any; + /*private*/ _expr_107:any; + /*private*/ _expr_110:any; + /*private*/ _expr_111:any; + /*private*/ _expr_112:any; + /*private*/ _expr_113:any; + /*private*/ _expr_114:any; + /*private*/ _expr_115:any; + /*private*/ _expr_116:any; + /*private*/ _expr_119:any; + /*private*/ _expr_120:any; + /*private*/ _expr_121:any; + /*private*/ _expr_122:any; + /*private*/ _expr_123:any; + /*private*/ _expr_124:any; + /*private*/ _expr_125:any; + /*private*/ _expr_128:any; + /*private*/ _expr_129:any; + /*private*/ _expr_130:any; + /*private*/ _expr_131:any; + /*private*/ _expr_132:any; + /*private*/ _expr_133:any; + /*private*/ _expr_134:any; + /*private*/ _expr_137:any; + /*private*/ _expr_138:any; + /*private*/ _expr_139:any; + /*private*/ _expr_140:any; + /*private*/ _expr_141:any; + /*private*/ _expr_142:any; + /*private*/ _expr_143:any; + /*private*/ _expr_146:any; + /*private*/ _expr_147:any; + /*private*/ _expr_148:any; + /*private*/ _expr_149:any; + /*private*/ _expr_150:any; + /*private*/ _expr_151:any; + /*private*/ _expr_152:any; + /*private*/ _expr_155:any; + /*private*/ _expr_156:any; + /*private*/ _expr_157:any; + /*private*/ _expr_158:any; + /*private*/ _expr_159:any; + /*private*/ _expr_160:any; + /*private*/ _expr_161:any; + /*private*/ _expr_164:any; + /*private*/ _expr_165:any; + /*private*/ _expr_166:any; + /*private*/ _expr_167:any; + /*private*/ _expr_168:any; + /*private*/ _expr_169:any; + /*private*/ _expr_170:any; + /*private*/ _expr_173:any; + /*private*/ _expr_174:any; + /*private*/ _expr_175:any; + /*private*/ _expr_176:any; + /*private*/ _expr_177:any; + /*private*/ _expr_178:any; + /*private*/ _expr_179:any; + /*private*/ _expr_182:any; + /*private*/ _expr_183:any; + /*private*/ _expr_184:any; + /*private*/ _expr_185:any; + /*private*/ _expr_186:any; + /*private*/ _expr_187:any; + /*private*/ _expr_188:any; + constructor(viewUtils:any,parentInjector:any,declarationEl:any) { + } + + injectorGetInternal(token:any,requestNodeIndex:number,notFoundResult:any):any { + if (((token === import46.DefaultValueAccessor) && (3 === requestNodeIndex))) { return this._DefaultValueAccessor_3_3; } + if (((token === import49.NG_VALUE_ACCESSOR) && (3 === requestNodeIndex))) { return this._NG_VALUE_ACCESSOR_3_4; } + if (((token === import47.FormControlName) && (3 === requestNodeIndex))) { return this._FormControlName_3_5; } + if (((token === import50.NgControl) && (3 === requestNodeIndex))) { return this._NgControl_3_6; } + if (((token === import45.NgControlStatus) && (3 === requestNodeIndex))) { return this._NgControlStatus_3_7; } + if (((token === import46.DefaultValueAccessor) && (6 === requestNodeIndex))) { return this._DefaultValueAccessor_6_3; } + if (((token === import49.NG_VALUE_ACCESSOR) && (6 === requestNodeIndex))) { return this._NG_VALUE_ACCESSOR_6_4; } + if (((token === import47.FormControlName) && (6 === requestNodeIndex))) { return this._FormControlName_6_5; } + if (((token === import50.NgControl) && (6 === requestNodeIndex))) { return this._NgControl_6_6; } + if (((token === import45.NgControlStatus) && (6 === requestNodeIndex))) { return this._NgControlStatus_6_7; } + if (((token === import46.DefaultValueAccessor) && (9 === requestNodeIndex))) { return this._DefaultValueAccessor_9_3; } + if (((token === import49.NG_VALUE_ACCESSOR) && (9 === requestNodeIndex))) { return this._NG_VALUE_ACCESSOR_9_4; } + if (((token === import47.FormControlName) && (9 === requestNodeIndex))) { return this._FormControlName_9_5; } + if (((token === import50.NgControl) && (9 === requestNodeIndex))) { return this._NgControl_9_6; } + if (((token === import45.NgControlStatus) && (9 === requestNodeIndex))) { return this._NgControlStatus_9_7; } + if (((token === import46.DefaultValueAccessor) && (12 === requestNodeIndex))) { return this._DefaultValueAccessor_12_3; } + if (((token === import49.NG_VALUE_ACCESSOR) && (12 === requestNodeIndex))) { return this._NG_VALUE_ACCESSOR_12_4; } + if (((token === import47.FormControlName) && (12 === requestNodeIndex))) { return this._FormControlName_12_5; } + if (((token === import50.NgControl) && (12 === requestNodeIndex))) { return this._NgControl_12_6; } + if (((token === import45.NgControlStatus) && (12 === requestNodeIndex))) { return this._NgControlStatus_12_7; } + if (((token === import46.DefaultValueAccessor) && (15 === requestNodeIndex))) { return this._DefaultValueAccessor_15_3; } + if (((token === import49.NG_VALUE_ACCESSOR) && (15 === requestNodeIndex))) { return this._NG_VALUE_ACCESSOR_15_4; } + if (((token === import47.FormControlName) && (15 === requestNodeIndex))) { return this._FormControlName_15_5; } + if (((token === import50.NgControl) && (15 === requestNodeIndex))) { return this._NgControl_15_6; } + if (((token === import45.NgControlStatus) && (15 === requestNodeIndex))) { return this._NgControlStatus_15_7; } + if (((token === import46.DefaultValueAccessor) && (18 === requestNodeIndex))) { return this._DefaultValueAccessor_18_3; } + if (((token === import49.NG_VALUE_ACCESSOR) && (18 === requestNodeIndex))) { return this._NG_VALUE_ACCESSOR_18_4; } + if (((token === import47.FormControlName) && (18 === requestNodeIndex))) { return this._FormControlName_18_5; } + if (((token === import50.NgControl) && (18 === requestNodeIndex))) { return this._NgControl_18_6; } + if (((token === import45.NgControlStatus) && (18 === requestNodeIndex))) { return this._NgControlStatus_18_7; } + if (((token === import46.DefaultValueAccessor) && (21 === requestNodeIndex))) { return this._DefaultValueAccessor_21_3; } + if (((token === import49.NG_VALUE_ACCESSOR) && (21 === requestNodeIndex))) { return this._NG_VALUE_ACCESSOR_21_4; } + if (((token === import47.FormControlName) && (21 === requestNodeIndex))) { return this._FormControlName_21_5; } + if (((token === import50.NgControl) && (21 === requestNodeIndex))) { return this._NgControl_21_6; } + if (((token === import45.NgControlStatus) && (21 === requestNodeIndex))) { return this._NgControlStatus_21_7; } + if (((token === import46.DefaultValueAccessor) && (24 === requestNodeIndex))) { return this._DefaultValueAccessor_24_3; } + if (((token === import49.NG_VALUE_ACCESSOR) && (24 === requestNodeIndex))) { return this._NG_VALUE_ACCESSOR_24_4; } + if (((token === import47.FormControlName) && (24 === requestNodeIndex))) { return this._FormControlName_24_5; } + if (((token === import50.NgControl) && (24 === requestNodeIndex))) { return this._NgControl_24_6; } + if (((token === import45.NgControlStatus) && (24 === requestNodeIndex))) { return this._NgControlStatus_24_7; } + if (((token === import46.DefaultValueAccessor) && (27 === requestNodeIndex))) { return this._DefaultValueAccessor_27_3; } + if (((token === import49.NG_VALUE_ACCESSOR) && (27 === requestNodeIndex))) { return this._NG_VALUE_ACCESSOR_27_4; } + if (((token === import47.FormControlName) && (27 === requestNodeIndex))) { return this._FormControlName_27_5; } + if (((token === import50.NgControl) && (27 === requestNodeIndex))) { return this._NgControl_27_6; } + if (((token === import45.NgControlStatus) && (27 === requestNodeIndex))) { return this._NgControlStatus_27_7; } + if (((token === import46.DefaultValueAccessor) && (30 === requestNodeIndex))) { return this._DefaultValueAccessor_30_3; } + if (((token === import49.NG_VALUE_ACCESSOR) && (30 === requestNodeIndex))) { return this._NG_VALUE_ACCESSOR_30_4; } + if (((token === import47.FormControlName) && (30 === requestNodeIndex))) { return this._FormControlName_30_5; } + if (((token === import50.NgControl) && (30 === requestNodeIndex))) { return this._NgControl_30_6; } + if (((token === import45.NgControlStatus) && (30 === requestNodeIndex))) { return this._NgControlStatus_30_7; } + if (((token === import46.DefaultValueAccessor) && (33 === requestNodeIndex))) { return this._DefaultValueAccessor_33_3; } + if (((token === import49.NG_VALUE_ACCESSOR) && (33 === requestNodeIndex))) { return this._NG_VALUE_ACCESSOR_33_4; } + if (((token === import47.FormControlName) && (33 === requestNodeIndex))) { return this._FormControlName_33_5; } + if (((token === import50.NgControl) && (33 === requestNodeIndex))) { return this._NgControl_33_6; } + if (((token === import45.NgControlStatus) && (33 === requestNodeIndex))) { return this._NgControlStatus_33_7; } + if (((token === import46.DefaultValueAccessor) && (36 === requestNodeIndex))) { return this._DefaultValueAccessor_36_3; } + if (((token === import49.NG_VALUE_ACCESSOR) && (36 === requestNodeIndex))) { return this._NG_VALUE_ACCESSOR_36_4; } + if (((token === import47.FormControlName) && (36 === requestNodeIndex))) { return this._FormControlName_36_5; } + if (((token === import50.NgControl) && (36 === requestNodeIndex))) { return this._NgControl_36_6; } + if (((token === import45.NgControlStatus) && (36 === requestNodeIndex))) { return this._NgControlStatus_36_7; } + if (((token === import46.DefaultValueAccessor) && (39 === requestNodeIndex))) { return this._DefaultValueAccessor_39_3; } + if (((token === import49.NG_VALUE_ACCESSOR) && (39 === requestNodeIndex))) { return this._NG_VALUE_ACCESSOR_39_4; } + if (((token === import47.FormControlName) && (39 === requestNodeIndex))) { return this._FormControlName_39_5; } + if (((token === import50.NgControl) && (39 === requestNodeIndex))) { return this._NgControl_39_6; } + if (((token === import45.NgControlStatus) && (39 === requestNodeIndex))) { return this._NgControlStatus_39_7; } + if (((token === import46.DefaultValueAccessor) && (42 === requestNodeIndex))) { return this._DefaultValueAccessor_42_3; } + if (((token === import49.NG_VALUE_ACCESSOR) && (42 === requestNodeIndex))) { return this._NG_VALUE_ACCESSOR_42_4; } + if (((token === import47.FormControlName) && (42 === requestNodeIndex))) { return this._FormControlName_42_5; } + if (((token === import50.NgControl) && (42 === requestNodeIndex))) { return this._NgControl_42_6; } + if (((token === import45.NgControlStatus) && (42 === requestNodeIndex))) { return this._NgControlStatus_42_7; } + if (((token === import46.DefaultValueAccessor) && (45 === requestNodeIndex))) { return this._DefaultValueAccessor_45_3; } + if (((token === import49.NG_VALUE_ACCESSOR) && (45 === requestNodeIndex))) { return this._NG_VALUE_ACCESSOR_45_4; } + if (((token === import47.FormControlName) && (45 === requestNodeIndex))) { return this._FormControlName_45_5; } + if (((token === import50.NgControl) && (45 === requestNodeIndex))) { return this._NgControl_45_6; } + if (((token === import45.NgControlStatus) && (45 === requestNodeIndex))) { return this._NgControlStatus_45_7; } + if (((token === import46.DefaultValueAccessor) && (48 === requestNodeIndex))) { return this._DefaultValueAccessor_48_3; } + if (((token === import49.NG_VALUE_ACCESSOR) && (48 === requestNodeIndex))) { return this._NG_VALUE_ACCESSOR_48_4; } + if (((token === import47.FormControlName) && (48 === requestNodeIndex))) { return this._FormControlName_48_5; } + if (((token === import50.NgControl) && (48 === requestNodeIndex))) { return this._NgControl_48_6; } + if (((token === import45.NgControlStatus) && (48 === requestNodeIndex))) { return this._NgControlStatus_48_7; } + if (((token === import46.DefaultValueAccessor) && (51 === requestNodeIndex))) { return this._DefaultValueAccessor_51_3; } + if (((token === import49.NG_VALUE_ACCESSOR) && (51 === requestNodeIndex))) { return this._NG_VALUE_ACCESSOR_51_4; } + if (((token === import47.FormControlName) && (51 === requestNodeIndex))) { return this._FormControlName_51_5; } + if (((token === import50.NgControl) && (51 === requestNodeIndex))) { return this._NgControl_51_6; } + if (((token === import45.NgControlStatus) && (51 === requestNodeIndex))) { return this._NgControlStatus_51_7; } + if (((token === import46.DefaultValueAccessor) && (54 === requestNodeIndex))) { return this._DefaultValueAccessor_54_3; } + if (((token === import49.NG_VALUE_ACCESSOR) && (54 === requestNodeIndex))) { return this._NG_VALUE_ACCESSOR_54_4; } + if (((token === import47.FormControlName) && (54 === requestNodeIndex))) { return this._FormControlName_54_5; } + if (((token === import50.NgControl) && (54 === requestNodeIndex))) { return this._NgControl_54_6; } + if (((token === import45.NgControlStatus) && (54 === requestNodeIndex))) { return this._NgControlStatus_54_7; } + if (((token === import46.DefaultValueAccessor) && (57 === requestNodeIndex))) { return this._DefaultValueAccessor_57_3; } + if (((token === import49.NG_VALUE_ACCESSOR) && (57 === requestNodeIndex))) { return this._NG_VALUE_ACCESSOR_57_4; } + if (((token === import47.FormControlName) && (57 === requestNodeIndex))) { return this._FormControlName_57_5; } + if (((token === import50.NgControl) && (57 === requestNodeIndex))) { return this._NgControl_57_6; } + if (((token === import45.NgControlStatus) && (57 === requestNodeIndex))) { return this._NgControlStatus_57_7; } + if (((token === import46.DefaultValueAccessor) && (60 === requestNodeIndex))) { return this._DefaultValueAccessor_60_3; } + if (((token === import49.NG_VALUE_ACCESSOR) && (60 === requestNodeIndex))) { return this._NG_VALUE_ACCESSOR_60_4; } + if (((token === import47.FormControlName) && (60 === requestNodeIndex))) { return this._FormControlName_60_5; } + if (((token === import50.NgControl) && (60 === requestNodeIndex))) { return this._NgControl_60_6; } + if (((token === import45.NgControlStatus) && (60 === requestNodeIndex))) { return this._NgControlStatus_60_7; } + if (((token === import44.FormGroupDirective) && ((1 <= requestNodeIndex) && (requestNodeIndex <= 62)))) { return this._FormGroupDirective_1_3; } + if (((token === import51.ControlContainer) && ((1 <= requestNodeIndex) && (requestNodeIndex <= 62)))) { return this._ControlContainer_1_4; } + if (((token === import45.NgControlStatusGroup) && ((1 <= requestNodeIndex) && (requestNodeIndex <= 62)))) { return this._NgControlStatusGroup_1_5; } + return notFoundResult; + } +} +export function viewFactory_AppComponent0(viewUtils:any,parentInjector:any,declarationEl:any):any { + return new _View_AppComponent0(viewUtils,parentInjector,declarationEl); +} + + +//// [complexNarrowingWithAny.js] +// Repro from #10869 +"use strict"; +/** + * This file is generated by the Angular 2 template compiler. + * Do not edit. + */ +/* tslint:disable */ +// import * as import0 from '@angular/core/src/linker/ng_module_factory'; +// import * as import1 from '../../app'; +// import * as import2 from '@angular/common/src/common_module'; +// import * as import3 from '@angular/core/src/application_module'; +// import * as import4 from '@angular/platform-browser/src/browser'; +// import * as import5 from '@angular/forms/src/directives'; +// import * as import6 from '@angular/forms/src/form_providers'; +// import * as import7 from '@angular/common/src/localization'; +// import * as import8 from '@angular/core/src/application_init'; +// import * as import9 from '@angular/core/src/testability/testability'; +// import * as import10 from '@angular/core/src/application_ref'; +// import * as import11 from '@angular/core/src/linker/compiler'; +// import * as import12 from '@angular/platform-browser/src/dom/events/hammer_gestures'; +// import * as import13 from '@angular/platform-browser/src/dom/events/event_manager'; +// import * as import14 from '@angular/platform-browser/src/dom/shared_styles_host'; +// import * as import15 from '@angular/platform-browser/src/dom/dom_renderer'; +// import * as import16 from '@angular/platform-browser/src/security/dom_sanitization_service'; +// import * as import17 from '@angular/core/src/linker/view_utils'; +// import * as import18 from '@angular/forms/src/form_builder'; +// import * as import19 from '@angular/forms/src/directives/radio_control_value_accessor'; +// import * as import20 from '@angular/core/src/di/injector'; +// import * as import21 from '@angular/core/src/application_tokens'; +// import * as import22 from '@angular/platform-browser/src/dom/events/dom_events'; +// import * as import23 from '@angular/platform-browser/src/dom/events/key_events'; +// import * as import24 from '@angular/core/src/zone/ng_zone'; +// import * as import25 from '@angular/platform-browser/src/dom/debug/ng_probe'; +// import * as import26 from '@angular/core/src/console'; +// import * as import27 from '@angular/core/src/i18n/tokens'; +// import * as import28 from '@angular/core/src/error_handler'; +// import * as import29 from '@angular/platform-browser/src/dom/dom_tokens'; +// import * as import30 from '@angular/platform-browser/src/dom/animation_driver'; +// import * as import31 from '@angular/core/src/render/api'; +// import * as import32 from '@angular/core/src/security'; +// import * as import33 from '@angular/core/src/change_detection/differs/iterable_differs'; +// import * as import34 from '@angular/core/src/change_detection/differs/keyvalue_differs'; +// import * as import35 from '@angular/core/src/i18n/tokens'; +// import * as import36 from '@angular/core/src/render/api'; +// import * as import37 from '@angular/core/src/linker/view'; +// import * as import38 from '@angular/core/src/linker/element'; +// import * as import39 from '@angular/core/src/linker/view_utils'; +// import * as import40 from '@angular/core/src/linker/view_type'; +// import * as import41 from '@angular/core/src/change_detection/change_detection'; +// import * as import42 from '@angular/core/src/metadata/view'; +// import * as import43 from '@angular/core/src/linker/component_factory'; +// import * as import44 from '@angular/forms/src/directives/reactive_directives/form_group_directive'; +// import * as import45 from '@angular/forms/src/directives/ng_control_status'; +// import * as import46 from '@angular/forms/src/directives/default_value_accessor'; +// import * as import47 from '@angular/forms/src/directives/reactive_directives/form_control_name'; +// import * as import48 from '@angular/core/src/linker/element_ref'; +// import * as import49 from '@angular/forms/src/directives/control_value_accessor'; +// import * as import50 from '@angular/forms/src/directives/ng_control'; +// import * as import51 from '@angular/forms/src/directives/control_container'; +//stubbed out imports +var import44; +(function (import44) { + var FormGroupDirective = (function () { + function FormGroupDirective(any) { + } + return FormGroupDirective; + }()); + import44.FormGroupDirective = FormGroupDirective; +})(import44 || (import44 = {})); +var import45; +(function (import45) { + var NgControlStatus = (function () { + function NgControlStatus(any) { + } + return NgControlStatus; + }()); + import45.NgControlStatus = NgControlStatus; + var NgControlStatusGroup = (function () { + function NgControlStatusGroup(any) { + } + return NgControlStatusGroup; + }()); + import45.NgControlStatusGroup = NgControlStatusGroup; +})(import45 || (import45 = {})); +var import46; +(function (import46) { + var DefaultValueAccessor = (function () { + function DefaultValueAccessor(any) { + } + return DefaultValueAccessor; + }()); + import46.DefaultValueAccessor = DefaultValueAccessor; +})(import46 || (import46 = {})); +var import47; +(function (import47) { + var FormControlName = (function () { + function FormControlName(any) { + } + return FormControlName; + }()); + import47.FormControlName = FormControlName; +})(import47 || (import47 = {})); +var import48; +(function (import48) { + var FormControlName = (function () { + function FormControlName(any) { + } + return FormControlName; + }()); + import48.FormControlName = FormControlName; +})(import48 || (import48 = {})); +//HERE BE DRAGONS +//Using a value here - 65+ seconds to typecheck +var import49; +(function (import49) { + //real code uses an opaque token, using new String() to simulate. + //export var NG_VALUE_ACCESSOR = new OpaqueToken('ngValueAccessor') + import49.NG_VALUE_ACCESSOR = new String('foo'); +})(import49 || (import49 = {})); +//using a class - < 1 sec typecheck +// namespace import49 { +// export class NG_VALUE_ACCESSOR { +// constructor(any){} +// } +// } +//END DRAGONS +var import50; +(function (import50) { + var NgControl = (function () { + function NgControl(any) { + } + return NgControl; + }()); + import50.NgControl = NgControl; +})(import50 || (import50 = {})); +var import51; +(function (import51) { + var ControlContainer = (function () { + function ControlContainer(any) { + } + return ControlContainer; + }()); + import51.ControlContainer = ControlContainer; +})(import51 || (import51 = {})); +var _View_AppComponent0 = (function () { + function _View_AppComponent0(viewUtils, parentInjector, declarationEl) { + } + _View_AppComponent0.prototype.injectorGetInternal = function (token, requestNodeIndex, notFoundResult) { + if (((token === import46.DefaultValueAccessor) && (3 === requestNodeIndex))) { + return this._DefaultValueAccessor_3_3; + } + if (((token === import49.NG_VALUE_ACCESSOR) && (3 === requestNodeIndex))) { + return this._NG_VALUE_ACCESSOR_3_4; + } + if (((token === import47.FormControlName) && (3 === requestNodeIndex))) { + return this._FormControlName_3_5; + } + if (((token === import50.NgControl) && (3 === requestNodeIndex))) { + return this._NgControl_3_6; + } + if (((token === import45.NgControlStatus) && (3 === requestNodeIndex))) { + return this._NgControlStatus_3_7; + } + if (((token === import46.DefaultValueAccessor) && (6 === requestNodeIndex))) { + return this._DefaultValueAccessor_6_3; + } + if (((token === import49.NG_VALUE_ACCESSOR) && (6 === requestNodeIndex))) { + return this._NG_VALUE_ACCESSOR_6_4; + } + if (((token === import47.FormControlName) && (6 === requestNodeIndex))) { + return this._FormControlName_6_5; + } + if (((token === import50.NgControl) && (6 === requestNodeIndex))) { + return this._NgControl_6_6; + } + if (((token === import45.NgControlStatus) && (6 === requestNodeIndex))) { + return this._NgControlStatus_6_7; + } + if (((token === import46.DefaultValueAccessor) && (9 === requestNodeIndex))) { + return this._DefaultValueAccessor_9_3; + } + if (((token === import49.NG_VALUE_ACCESSOR) && (9 === requestNodeIndex))) { + return this._NG_VALUE_ACCESSOR_9_4; + } + if (((token === import47.FormControlName) && (9 === requestNodeIndex))) { + return this._FormControlName_9_5; + } + if (((token === import50.NgControl) && (9 === requestNodeIndex))) { + return this._NgControl_9_6; + } + if (((token === import45.NgControlStatus) && (9 === requestNodeIndex))) { + return this._NgControlStatus_9_7; + } + if (((token === import46.DefaultValueAccessor) && (12 === requestNodeIndex))) { + return this._DefaultValueAccessor_12_3; + } + if (((token === import49.NG_VALUE_ACCESSOR) && (12 === requestNodeIndex))) { + return this._NG_VALUE_ACCESSOR_12_4; + } + if (((token === import47.FormControlName) && (12 === requestNodeIndex))) { + return this._FormControlName_12_5; + } + if (((token === import50.NgControl) && (12 === requestNodeIndex))) { + return this._NgControl_12_6; + } + if (((token === import45.NgControlStatus) && (12 === requestNodeIndex))) { + return this._NgControlStatus_12_7; + } + if (((token === import46.DefaultValueAccessor) && (15 === requestNodeIndex))) { + return this._DefaultValueAccessor_15_3; + } + if (((token === import49.NG_VALUE_ACCESSOR) && (15 === requestNodeIndex))) { + return this._NG_VALUE_ACCESSOR_15_4; + } + if (((token === import47.FormControlName) && (15 === requestNodeIndex))) { + return this._FormControlName_15_5; + } + if (((token === import50.NgControl) && (15 === requestNodeIndex))) { + return this._NgControl_15_6; + } + if (((token === import45.NgControlStatus) && (15 === requestNodeIndex))) { + return this._NgControlStatus_15_7; + } + if (((token === import46.DefaultValueAccessor) && (18 === requestNodeIndex))) { + return this._DefaultValueAccessor_18_3; + } + if (((token === import49.NG_VALUE_ACCESSOR) && (18 === requestNodeIndex))) { + return this._NG_VALUE_ACCESSOR_18_4; + } + if (((token === import47.FormControlName) && (18 === requestNodeIndex))) { + return this._FormControlName_18_5; + } + if (((token === import50.NgControl) && (18 === requestNodeIndex))) { + return this._NgControl_18_6; + } + if (((token === import45.NgControlStatus) && (18 === requestNodeIndex))) { + return this._NgControlStatus_18_7; + } + if (((token === import46.DefaultValueAccessor) && (21 === requestNodeIndex))) { + return this._DefaultValueAccessor_21_3; + } + if (((token === import49.NG_VALUE_ACCESSOR) && (21 === requestNodeIndex))) { + return this._NG_VALUE_ACCESSOR_21_4; + } + if (((token === import47.FormControlName) && (21 === requestNodeIndex))) { + return this._FormControlName_21_5; + } + if (((token === import50.NgControl) && (21 === requestNodeIndex))) { + return this._NgControl_21_6; + } + if (((token === import45.NgControlStatus) && (21 === requestNodeIndex))) { + return this._NgControlStatus_21_7; + } + if (((token === import46.DefaultValueAccessor) && (24 === requestNodeIndex))) { + return this._DefaultValueAccessor_24_3; + } + if (((token === import49.NG_VALUE_ACCESSOR) && (24 === requestNodeIndex))) { + return this._NG_VALUE_ACCESSOR_24_4; + } + if (((token === import47.FormControlName) && (24 === requestNodeIndex))) { + return this._FormControlName_24_5; + } + if (((token === import50.NgControl) && (24 === requestNodeIndex))) { + return this._NgControl_24_6; + } + if (((token === import45.NgControlStatus) && (24 === requestNodeIndex))) { + return this._NgControlStatus_24_7; + } + if (((token === import46.DefaultValueAccessor) && (27 === requestNodeIndex))) { + return this._DefaultValueAccessor_27_3; + } + if (((token === import49.NG_VALUE_ACCESSOR) && (27 === requestNodeIndex))) { + return this._NG_VALUE_ACCESSOR_27_4; + } + if (((token === import47.FormControlName) && (27 === requestNodeIndex))) { + return this._FormControlName_27_5; + } + if (((token === import50.NgControl) && (27 === requestNodeIndex))) { + return this._NgControl_27_6; + } + if (((token === import45.NgControlStatus) && (27 === requestNodeIndex))) { + return this._NgControlStatus_27_7; + } + if (((token === import46.DefaultValueAccessor) && (30 === requestNodeIndex))) { + return this._DefaultValueAccessor_30_3; + } + if (((token === import49.NG_VALUE_ACCESSOR) && (30 === requestNodeIndex))) { + return this._NG_VALUE_ACCESSOR_30_4; + } + if (((token === import47.FormControlName) && (30 === requestNodeIndex))) { + return this._FormControlName_30_5; + } + if (((token === import50.NgControl) && (30 === requestNodeIndex))) { + return this._NgControl_30_6; + } + if (((token === import45.NgControlStatus) && (30 === requestNodeIndex))) { + return this._NgControlStatus_30_7; + } + if (((token === import46.DefaultValueAccessor) && (33 === requestNodeIndex))) { + return this._DefaultValueAccessor_33_3; + } + if (((token === import49.NG_VALUE_ACCESSOR) && (33 === requestNodeIndex))) { + return this._NG_VALUE_ACCESSOR_33_4; + } + if (((token === import47.FormControlName) && (33 === requestNodeIndex))) { + return this._FormControlName_33_5; + } + if (((token === import50.NgControl) && (33 === requestNodeIndex))) { + return this._NgControl_33_6; + } + if (((token === import45.NgControlStatus) && (33 === requestNodeIndex))) { + return this._NgControlStatus_33_7; + } + if (((token === import46.DefaultValueAccessor) && (36 === requestNodeIndex))) { + return this._DefaultValueAccessor_36_3; + } + if (((token === import49.NG_VALUE_ACCESSOR) && (36 === requestNodeIndex))) { + return this._NG_VALUE_ACCESSOR_36_4; + } + if (((token === import47.FormControlName) && (36 === requestNodeIndex))) { + return this._FormControlName_36_5; + } + if (((token === import50.NgControl) && (36 === requestNodeIndex))) { + return this._NgControl_36_6; + } + if (((token === import45.NgControlStatus) && (36 === requestNodeIndex))) { + return this._NgControlStatus_36_7; + } + if (((token === import46.DefaultValueAccessor) && (39 === requestNodeIndex))) { + return this._DefaultValueAccessor_39_3; + } + if (((token === import49.NG_VALUE_ACCESSOR) && (39 === requestNodeIndex))) { + return this._NG_VALUE_ACCESSOR_39_4; + } + if (((token === import47.FormControlName) && (39 === requestNodeIndex))) { + return this._FormControlName_39_5; + } + if (((token === import50.NgControl) && (39 === requestNodeIndex))) { + return this._NgControl_39_6; + } + if (((token === import45.NgControlStatus) && (39 === requestNodeIndex))) { + return this._NgControlStatus_39_7; + } + if (((token === import46.DefaultValueAccessor) && (42 === requestNodeIndex))) { + return this._DefaultValueAccessor_42_3; + } + if (((token === import49.NG_VALUE_ACCESSOR) && (42 === requestNodeIndex))) { + return this._NG_VALUE_ACCESSOR_42_4; + } + if (((token === import47.FormControlName) && (42 === requestNodeIndex))) { + return this._FormControlName_42_5; + } + if (((token === import50.NgControl) && (42 === requestNodeIndex))) { + return this._NgControl_42_6; + } + if (((token === import45.NgControlStatus) && (42 === requestNodeIndex))) { + return this._NgControlStatus_42_7; + } + if (((token === import46.DefaultValueAccessor) && (45 === requestNodeIndex))) { + return this._DefaultValueAccessor_45_3; + } + if (((token === import49.NG_VALUE_ACCESSOR) && (45 === requestNodeIndex))) { + return this._NG_VALUE_ACCESSOR_45_4; + } + if (((token === import47.FormControlName) && (45 === requestNodeIndex))) { + return this._FormControlName_45_5; + } + if (((token === import50.NgControl) && (45 === requestNodeIndex))) { + return this._NgControl_45_6; + } + if (((token === import45.NgControlStatus) && (45 === requestNodeIndex))) { + return this._NgControlStatus_45_7; + } + if (((token === import46.DefaultValueAccessor) && (48 === requestNodeIndex))) { + return this._DefaultValueAccessor_48_3; + } + if (((token === import49.NG_VALUE_ACCESSOR) && (48 === requestNodeIndex))) { + return this._NG_VALUE_ACCESSOR_48_4; + } + if (((token === import47.FormControlName) && (48 === requestNodeIndex))) { + return this._FormControlName_48_5; + } + if (((token === import50.NgControl) && (48 === requestNodeIndex))) { + return this._NgControl_48_6; + } + if (((token === import45.NgControlStatus) && (48 === requestNodeIndex))) { + return this._NgControlStatus_48_7; + } + if (((token === import46.DefaultValueAccessor) && (51 === requestNodeIndex))) { + return this._DefaultValueAccessor_51_3; + } + if (((token === import49.NG_VALUE_ACCESSOR) && (51 === requestNodeIndex))) { + return this._NG_VALUE_ACCESSOR_51_4; + } + if (((token === import47.FormControlName) && (51 === requestNodeIndex))) { + return this._FormControlName_51_5; + } + if (((token === import50.NgControl) && (51 === requestNodeIndex))) { + return this._NgControl_51_6; + } + if (((token === import45.NgControlStatus) && (51 === requestNodeIndex))) { + return this._NgControlStatus_51_7; + } + if (((token === import46.DefaultValueAccessor) && (54 === requestNodeIndex))) { + return this._DefaultValueAccessor_54_3; + } + if (((token === import49.NG_VALUE_ACCESSOR) && (54 === requestNodeIndex))) { + return this._NG_VALUE_ACCESSOR_54_4; + } + if (((token === import47.FormControlName) && (54 === requestNodeIndex))) { + return this._FormControlName_54_5; + } + if (((token === import50.NgControl) && (54 === requestNodeIndex))) { + return this._NgControl_54_6; + } + if (((token === import45.NgControlStatus) && (54 === requestNodeIndex))) { + return this._NgControlStatus_54_7; + } + if (((token === import46.DefaultValueAccessor) && (57 === requestNodeIndex))) { + return this._DefaultValueAccessor_57_3; + } + if (((token === import49.NG_VALUE_ACCESSOR) && (57 === requestNodeIndex))) { + return this._NG_VALUE_ACCESSOR_57_4; + } + if (((token === import47.FormControlName) && (57 === requestNodeIndex))) { + return this._FormControlName_57_5; + } + if (((token === import50.NgControl) && (57 === requestNodeIndex))) { + return this._NgControl_57_6; + } + if (((token === import45.NgControlStatus) && (57 === requestNodeIndex))) { + return this._NgControlStatus_57_7; + } + if (((token === import46.DefaultValueAccessor) && (60 === requestNodeIndex))) { + return this._DefaultValueAccessor_60_3; + } + if (((token === import49.NG_VALUE_ACCESSOR) && (60 === requestNodeIndex))) { + return this._NG_VALUE_ACCESSOR_60_4; + } + if (((token === import47.FormControlName) && (60 === requestNodeIndex))) { + return this._FormControlName_60_5; + } + if (((token === import50.NgControl) && (60 === requestNodeIndex))) { + return this._NgControl_60_6; + } + if (((token === import45.NgControlStatus) && (60 === requestNodeIndex))) { + return this._NgControlStatus_60_7; + } + if (((token === import44.FormGroupDirective) && ((1 <= requestNodeIndex) && (requestNodeIndex <= 62)))) { + return this._FormGroupDirective_1_3; + } + if (((token === import51.ControlContainer) && ((1 <= requestNodeIndex) && (requestNodeIndex <= 62)))) { + return this._ControlContainer_1_4; + } + if (((token === import45.NgControlStatusGroup) && ((1 <= requestNodeIndex) && (requestNodeIndex <= 62)))) { + return this._NgControlStatusGroup_1_5; + } + return notFoundResult; + }; + return _View_AppComponent0; +}()); +function viewFactory_AppComponent0(viewUtils, parentInjector, declarationEl) { + return new _View_AppComponent0(viewUtils, parentInjector, declarationEl); +} +exports.viewFactory_AppComponent0 = viewFactory_AppComponent0; diff --git a/tests/baselines/reference/complexNarrowingWithAny.symbols b/tests/baselines/reference/complexNarrowingWithAny.symbols new file mode 100644 index 00000000000..d286502479c --- /dev/null +++ b/tests/baselines/reference/complexNarrowingWithAny.symbols @@ -0,0 +1,2304 @@ +=== tests/cases/compiler/complexNarrowingWithAny.ts === +// Repro from #10869 + +/** + * This file is generated by the Angular 2 template compiler. + * Do not edit. + */ + /* tslint:disable */ + +// import * as import0 from '@angular/core/src/linker/ng_module_factory'; +// import * as import1 from '../../app'; +// import * as import2 from '@angular/common/src/common_module'; +// import * as import3 from '@angular/core/src/application_module'; +// import * as import4 from '@angular/platform-browser/src/browser'; +// import * as import5 from '@angular/forms/src/directives'; +// import * as import6 from '@angular/forms/src/form_providers'; +// import * as import7 from '@angular/common/src/localization'; +// import * as import8 from '@angular/core/src/application_init'; +// import * as import9 from '@angular/core/src/testability/testability'; +// import * as import10 from '@angular/core/src/application_ref'; +// import * as import11 from '@angular/core/src/linker/compiler'; +// import * as import12 from '@angular/platform-browser/src/dom/events/hammer_gestures'; +// import * as import13 from '@angular/platform-browser/src/dom/events/event_manager'; +// import * as import14 from '@angular/platform-browser/src/dom/shared_styles_host'; +// import * as import15 from '@angular/platform-browser/src/dom/dom_renderer'; +// import * as import16 from '@angular/platform-browser/src/security/dom_sanitization_service'; +// import * as import17 from '@angular/core/src/linker/view_utils'; +// import * as import18 from '@angular/forms/src/form_builder'; +// import * as import19 from '@angular/forms/src/directives/radio_control_value_accessor'; +// import * as import20 from '@angular/core/src/di/injector'; +// import * as import21 from '@angular/core/src/application_tokens'; +// import * as import22 from '@angular/platform-browser/src/dom/events/dom_events'; +// import * as import23 from '@angular/platform-browser/src/dom/events/key_events'; +// import * as import24 from '@angular/core/src/zone/ng_zone'; +// import * as import25 from '@angular/platform-browser/src/dom/debug/ng_probe'; +// import * as import26 from '@angular/core/src/console'; +// import * as import27 from '@angular/core/src/i18n/tokens'; +// import * as import28 from '@angular/core/src/error_handler'; +// import * as import29 from '@angular/platform-browser/src/dom/dom_tokens'; +// import * as import30 from '@angular/platform-browser/src/dom/animation_driver'; +// import * as import31 from '@angular/core/src/render/api'; +// import * as import32 from '@angular/core/src/security'; +// import * as import33 from '@angular/core/src/change_detection/differs/iterable_differs'; +// import * as import34 from '@angular/core/src/change_detection/differs/keyvalue_differs'; +// import * as import35 from '@angular/core/src/i18n/tokens'; +// import * as import36 from '@angular/core/src/render/api'; +// import * as import37 from '@angular/core/src/linker/view'; +// import * as import38 from '@angular/core/src/linker/element'; +// import * as import39 from '@angular/core/src/linker/view_utils'; +// import * as import40 from '@angular/core/src/linker/view_type'; +// import * as import41 from '@angular/core/src/change_detection/change_detection'; +// import * as import42 from '@angular/core/src/metadata/view'; +// import * as import43 from '@angular/core/src/linker/component_factory'; +// import * as import44 from '@angular/forms/src/directives/reactive_directives/form_group_directive'; +// import * as import45 from '@angular/forms/src/directives/ng_control_status'; +// import * as import46 from '@angular/forms/src/directives/default_value_accessor'; +// import * as import47 from '@angular/forms/src/directives/reactive_directives/form_control_name'; +// import * as import48 from '@angular/core/src/linker/element_ref'; +// import * as import49 from '@angular/forms/src/directives/control_value_accessor'; +// import * as import50 from '@angular/forms/src/directives/ng_control'; +// import * as import51 from '@angular/forms/src/directives/control_container'; + +//stubbed out imports + +namespace import44 { +>import44 : Symbol(import44, Decl(complexNarrowingWithAny.ts, 0, 0)) + + export class FormGroupDirective { +>FormGroupDirective : Symbol(FormGroupDirective, Decl(complexNarrowingWithAny.ts, 63, 20)) + + constructor(any){} +>any : Symbol(any, Decl(complexNarrowingWithAny.ts, 65, 14)) + } +} + +namespace import45 { +>import45 : Symbol(import45, Decl(complexNarrowingWithAny.ts, 67, 1)) + + export class NgControlStatus { +>NgControlStatus : Symbol(NgControlStatus, Decl(complexNarrowingWithAny.ts, 69, 20)) + + constructor(any){} +>any : Symbol(any, Decl(complexNarrowingWithAny.ts, 71, 14)) + } + export class NgControlStatusGroup { +>NgControlStatusGroup : Symbol(NgControlStatusGroup, Decl(complexNarrowingWithAny.ts, 72, 2)) + + constructor(any){} +>any : Symbol(any, Decl(complexNarrowingWithAny.ts, 74, 14)) + } +} + +namespace import46 { +>import46 : Symbol(import46, Decl(complexNarrowingWithAny.ts, 76, 1)) + + export class DefaultValueAccessor { +>DefaultValueAccessor : Symbol(DefaultValueAccessor, Decl(complexNarrowingWithAny.ts, 78, 20)) + + constructor(any){} +>any : Symbol(any, Decl(complexNarrowingWithAny.ts, 80, 14)) + } +} + +namespace import47 { +>import47 : Symbol(import47, Decl(complexNarrowingWithAny.ts, 82, 1)) + + export class FormControlName { +>FormControlName : Symbol(FormControlName, Decl(complexNarrowingWithAny.ts, 84, 20)) + + constructor(any){} +>any : Symbol(any, Decl(complexNarrowingWithAny.ts, 86, 14)) + } +} + +namespace import48 { +>import48 : Symbol(import48, Decl(complexNarrowingWithAny.ts, 88, 1)) + + export class FormControlName { +>FormControlName : Symbol(FormControlName, Decl(complexNarrowingWithAny.ts, 90, 20)) + + constructor(any){} +>any : Symbol(any, Decl(complexNarrowingWithAny.ts, 92, 14)) + } +} + + +//HERE BE DRAGONS + +//Using a value here - 65+ seconds to typecheck +namespace import49 { +>import49 : Symbol(import49, Decl(complexNarrowingWithAny.ts, 94, 1)) + + //real code uses an opaque token, using new String() to simulate. + //export var NG_VALUE_ACCESSOR = new OpaqueToken('ngValueAccessor') + export var NG_VALUE_ACCESSOR = new String('foo') +>NG_VALUE_ACCESSOR : Symbol(NG_VALUE_ACCESSOR, Decl(complexNarrowingWithAny.ts, 103, 11)) +>String : Symbol(String, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +} + +//using a class - < 1 sec typecheck +// namespace import49 { +// export class NG_VALUE_ACCESSOR { +// constructor(any){} +// } +// } + +//END DRAGONS + + +namespace import50 { +>import50 : Symbol(import50, Decl(complexNarrowingWithAny.ts, 104, 1)) + + export class NgControl { +>NgControl : Symbol(NgControl, Decl(complexNarrowingWithAny.ts, 116, 20)) + + constructor(any){} +>any : Symbol(any, Decl(complexNarrowingWithAny.ts, 118, 14)) + } +} + +namespace import51 { +>import51 : Symbol(import51, Decl(complexNarrowingWithAny.ts, 120, 1)) + + export class ControlContainer { +>ControlContainer : Symbol(ControlContainer, Decl(complexNarrowingWithAny.ts, 122, 20)) + + constructor(any){} +>any : Symbol(any, Decl(complexNarrowingWithAny.ts, 124, 14)) + } +} + + + +class _View_AppComponent0 { +>_View_AppComponent0 : Symbol(_View_AppComponent0, Decl(complexNarrowingWithAny.ts, 126, 1)) + + _text_0:any; +>_text_0 : Symbol(_View_AppComponent0._text_0, Decl(complexNarrowingWithAny.ts, 130, 27)) + + _el_1:any; +>_el_1 : Symbol(_View_AppComponent0._el_1, Decl(complexNarrowingWithAny.ts, 131, 14)) + + _FormGroupDirective_1_3:import44.FormGroupDirective; +>_FormGroupDirective_1_3 : Symbol(_View_AppComponent0._FormGroupDirective_1_3, Decl(complexNarrowingWithAny.ts, 132, 12)) +>import44 : Symbol(import44, Decl(complexNarrowingWithAny.ts, 0, 0)) +>FormGroupDirective : Symbol(import44.FormGroupDirective, Decl(complexNarrowingWithAny.ts, 63, 20)) + + _ControlContainer_1_4:any; +>_ControlContainer_1_4 : Symbol(_View_AppComponent0._ControlContainer_1_4, Decl(complexNarrowingWithAny.ts, 133, 54)) + + _NgControlStatusGroup_1_5:import45.NgControlStatusGroup; +>_NgControlStatusGroup_1_5 : Symbol(_View_AppComponent0._NgControlStatusGroup_1_5, Decl(complexNarrowingWithAny.ts, 134, 28)) +>import45 : Symbol(import45, Decl(complexNarrowingWithAny.ts, 67, 1)) +>NgControlStatusGroup : Symbol(import45.NgControlStatusGroup, Decl(complexNarrowingWithAny.ts, 72, 2)) + + _text_2:any; +>_text_2 : Symbol(_View_AppComponent0._text_2, Decl(complexNarrowingWithAny.ts, 135, 58)) + + _el_3:any; +>_el_3 : Symbol(_View_AppComponent0._el_3, Decl(complexNarrowingWithAny.ts, 136, 14)) + + _DefaultValueAccessor_3_3:import46.DefaultValueAccessor; +>_DefaultValueAccessor_3_3 : Symbol(_View_AppComponent0._DefaultValueAccessor_3_3, Decl(complexNarrowingWithAny.ts, 137, 12)) +>import46 : Symbol(import46, Decl(complexNarrowingWithAny.ts, 76, 1)) +>DefaultValueAccessor : Symbol(import46.DefaultValueAccessor, Decl(complexNarrowingWithAny.ts, 78, 20)) + + _NG_VALUE_ACCESSOR_3_4:any[]; +>_NG_VALUE_ACCESSOR_3_4 : Symbol(_View_AppComponent0._NG_VALUE_ACCESSOR_3_4, Decl(complexNarrowingWithAny.ts, 138, 58)) + + _FormControlName_3_5:import47.FormControlName; +>_FormControlName_3_5 : Symbol(_View_AppComponent0._FormControlName_3_5, Decl(complexNarrowingWithAny.ts, 139, 31)) +>import47 : Symbol(import47, Decl(complexNarrowingWithAny.ts, 82, 1)) +>FormControlName : Symbol(import47.FormControlName, Decl(complexNarrowingWithAny.ts, 84, 20)) + + _NgControl_3_6:any; +>_NgControl_3_6 : Symbol(_View_AppComponent0._NgControl_3_6, Decl(complexNarrowingWithAny.ts, 140, 48)) + + _NgControlStatus_3_7:import45.NgControlStatus; +>_NgControlStatus_3_7 : Symbol(_View_AppComponent0._NgControlStatus_3_7, Decl(complexNarrowingWithAny.ts, 141, 21)) +>import45 : Symbol(import45, Decl(complexNarrowingWithAny.ts, 67, 1)) +>NgControlStatus : Symbol(import45.NgControlStatus, Decl(complexNarrowingWithAny.ts, 69, 20)) + + _el_4:any; +>_el_4 : Symbol(_View_AppComponent0._el_4, Decl(complexNarrowingWithAny.ts, 142, 48)) + + _text_5:any; +>_text_5 : Symbol(_View_AppComponent0._text_5, Decl(complexNarrowingWithAny.ts, 143, 12)) + + _el_6:any; +>_el_6 : Symbol(_View_AppComponent0._el_6, Decl(complexNarrowingWithAny.ts, 144, 14)) + + _DefaultValueAccessor_6_3:import46.DefaultValueAccessor; +>_DefaultValueAccessor_6_3 : Symbol(_View_AppComponent0._DefaultValueAccessor_6_3, Decl(complexNarrowingWithAny.ts, 145, 12)) +>import46 : Symbol(import46, Decl(complexNarrowingWithAny.ts, 76, 1)) +>DefaultValueAccessor : Symbol(import46.DefaultValueAccessor, Decl(complexNarrowingWithAny.ts, 78, 20)) + + _NG_VALUE_ACCESSOR_6_4:any[]; +>_NG_VALUE_ACCESSOR_6_4 : Symbol(_View_AppComponent0._NG_VALUE_ACCESSOR_6_4, Decl(complexNarrowingWithAny.ts, 146, 58)) + + _FormControlName_6_5:import47.FormControlName; +>_FormControlName_6_5 : Symbol(_View_AppComponent0._FormControlName_6_5, Decl(complexNarrowingWithAny.ts, 147, 31)) +>import47 : Symbol(import47, Decl(complexNarrowingWithAny.ts, 82, 1)) +>FormControlName : Symbol(import47.FormControlName, Decl(complexNarrowingWithAny.ts, 84, 20)) + + _NgControl_6_6:any; +>_NgControl_6_6 : Symbol(_View_AppComponent0._NgControl_6_6, Decl(complexNarrowingWithAny.ts, 148, 48)) + + _NgControlStatus_6_7:import45.NgControlStatus; +>_NgControlStatus_6_7 : Symbol(_View_AppComponent0._NgControlStatus_6_7, Decl(complexNarrowingWithAny.ts, 149, 21)) +>import45 : Symbol(import45, Decl(complexNarrowingWithAny.ts, 67, 1)) +>NgControlStatus : Symbol(import45.NgControlStatus, Decl(complexNarrowingWithAny.ts, 69, 20)) + + _el_7:any; +>_el_7 : Symbol(_View_AppComponent0._el_7, Decl(complexNarrowingWithAny.ts, 150, 48)) + + _text_8:any; +>_text_8 : Symbol(_View_AppComponent0._text_8, Decl(complexNarrowingWithAny.ts, 151, 12)) + + _el_9:any; +>_el_9 : Symbol(_View_AppComponent0._el_9, Decl(complexNarrowingWithAny.ts, 152, 14)) + + _DefaultValueAccessor_9_3:import46.DefaultValueAccessor; +>_DefaultValueAccessor_9_3 : Symbol(_View_AppComponent0._DefaultValueAccessor_9_3, Decl(complexNarrowingWithAny.ts, 153, 12)) +>import46 : Symbol(import46, Decl(complexNarrowingWithAny.ts, 76, 1)) +>DefaultValueAccessor : Symbol(import46.DefaultValueAccessor, Decl(complexNarrowingWithAny.ts, 78, 20)) + + _NG_VALUE_ACCESSOR_9_4:any[]; +>_NG_VALUE_ACCESSOR_9_4 : Symbol(_View_AppComponent0._NG_VALUE_ACCESSOR_9_4, Decl(complexNarrowingWithAny.ts, 154, 58)) + + _FormControlName_9_5:import47.FormControlName; +>_FormControlName_9_5 : Symbol(_View_AppComponent0._FormControlName_9_5, Decl(complexNarrowingWithAny.ts, 155, 31)) +>import47 : Symbol(import47, Decl(complexNarrowingWithAny.ts, 82, 1)) +>FormControlName : Symbol(import47.FormControlName, Decl(complexNarrowingWithAny.ts, 84, 20)) + + _NgControl_9_6:any; +>_NgControl_9_6 : Symbol(_View_AppComponent0._NgControl_9_6, Decl(complexNarrowingWithAny.ts, 156, 48)) + + _NgControlStatus_9_7:import45.NgControlStatus; +>_NgControlStatus_9_7 : Symbol(_View_AppComponent0._NgControlStatus_9_7, Decl(complexNarrowingWithAny.ts, 157, 21)) +>import45 : Symbol(import45, Decl(complexNarrowingWithAny.ts, 67, 1)) +>NgControlStatus : Symbol(import45.NgControlStatus, Decl(complexNarrowingWithAny.ts, 69, 20)) + + _el_10:any; +>_el_10 : Symbol(_View_AppComponent0._el_10, Decl(complexNarrowingWithAny.ts, 158, 48)) + + _text_11:any; +>_text_11 : Symbol(_View_AppComponent0._text_11, Decl(complexNarrowingWithAny.ts, 159, 13)) + + _el_12:any; +>_el_12 : Symbol(_View_AppComponent0._el_12, Decl(complexNarrowingWithAny.ts, 160, 15)) + + _DefaultValueAccessor_12_3:import46.DefaultValueAccessor; +>_DefaultValueAccessor_12_3 : Symbol(_View_AppComponent0._DefaultValueAccessor_12_3, Decl(complexNarrowingWithAny.ts, 161, 13)) +>import46 : Symbol(import46, Decl(complexNarrowingWithAny.ts, 76, 1)) +>DefaultValueAccessor : Symbol(import46.DefaultValueAccessor, Decl(complexNarrowingWithAny.ts, 78, 20)) + + _NG_VALUE_ACCESSOR_12_4:any[]; +>_NG_VALUE_ACCESSOR_12_4 : Symbol(_View_AppComponent0._NG_VALUE_ACCESSOR_12_4, Decl(complexNarrowingWithAny.ts, 162, 59)) + + _FormControlName_12_5:import47.FormControlName; +>_FormControlName_12_5 : Symbol(_View_AppComponent0._FormControlName_12_5, Decl(complexNarrowingWithAny.ts, 163, 32)) +>import47 : Symbol(import47, Decl(complexNarrowingWithAny.ts, 82, 1)) +>FormControlName : Symbol(import47.FormControlName, Decl(complexNarrowingWithAny.ts, 84, 20)) + + _NgControl_12_6:any; +>_NgControl_12_6 : Symbol(_View_AppComponent0._NgControl_12_6, Decl(complexNarrowingWithAny.ts, 164, 49)) + + _NgControlStatus_12_7:import45.NgControlStatus; +>_NgControlStatus_12_7 : Symbol(_View_AppComponent0._NgControlStatus_12_7, Decl(complexNarrowingWithAny.ts, 165, 22)) +>import45 : Symbol(import45, Decl(complexNarrowingWithAny.ts, 67, 1)) +>NgControlStatus : Symbol(import45.NgControlStatus, Decl(complexNarrowingWithAny.ts, 69, 20)) + + _el_13:any; +>_el_13 : Symbol(_View_AppComponent0._el_13, Decl(complexNarrowingWithAny.ts, 166, 49)) + + _text_14:any; +>_text_14 : Symbol(_View_AppComponent0._text_14, Decl(complexNarrowingWithAny.ts, 167, 13)) + + _el_15:any; +>_el_15 : Symbol(_View_AppComponent0._el_15, Decl(complexNarrowingWithAny.ts, 168, 15)) + + _DefaultValueAccessor_15_3:import46.DefaultValueAccessor; +>_DefaultValueAccessor_15_3 : Symbol(_View_AppComponent0._DefaultValueAccessor_15_3, Decl(complexNarrowingWithAny.ts, 169, 13)) +>import46 : Symbol(import46, Decl(complexNarrowingWithAny.ts, 76, 1)) +>DefaultValueAccessor : Symbol(import46.DefaultValueAccessor, Decl(complexNarrowingWithAny.ts, 78, 20)) + + _NG_VALUE_ACCESSOR_15_4:any[]; +>_NG_VALUE_ACCESSOR_15_4 : Symbol(_View_AppComponent0._NG_VALUE_ACCESSOR_15_4, Decl(complexNarrowingWithAny.ts, 170, 59)) + + _FormControlName_15_5:import47.FormControlName; +>_FormControlName_15_5 : Symbol(_View_AppComponent0._FormControlName_15_5, Decl(complexNarrowingWithAny.ts, 171, 32)) +>import47 : Symbol(import47, Decl(complexNarrowingWithAny.ts, 82, 1)) +>FormControlName : Symbol(import47.FormControlName, Decl(complexNarrowingWithAny.ts, 84, 20)) + + _NgControl_15_6:any; +>_NgControl_15_6 : Symbol(_View_AppComponent0._NgControl_15_6, Decl(complexNarrowingWithAny.ts, 172, 49)) + + _NgControlStatus_15_7:import45.NgControlStatus; +>_NgControlStatus_15_7 : Symbol(_View_AppComponent0._NgControlStatus_15_7, Decl(complexNarrowingWithAny.ts, 173, 22)) +>import45 : Symbol(import45, Decl(complexNarrowingWithAny.ts, 67, 1)) +>NgControlStatus : Symbol(import45.NgControlStatus, Decl(complexNarrowingWithAny.ts, 69, 20)) + + _el_16:any; +>_el_16 : Symbol(_View_AppComponent0._el_16, Decl(complexNarrowingWithAny.ts, 174, 49)) + + _text_17:any; +>_text_17 : Symbol(_View_AppComponent0._text_17, Decl(complexNarrowingWithAny.ts, 175, 13)) + + _el_18:any; +>_el_18 : Symbol(_View_AppComponent0._el_18, Decl(complexNarrowingWithAny.ts, 176, 15)) + + _DefaultValueAccessor_18_3:import46.DefaultValueAccessor; +>_DefaultValueAccessor_18_3 : Symbol(_View_AppComponent0._DefaultValueAccessor_18_3, Decl(complexNarrowingWithAny.ts, 177, 13)) +>import46 : Symbol(import46, Decl(complexNarrowingWithAny.ts, 76, 1)) +>DefaultValueAccessor : Symbol(import46.DefaultValueAccessor, Decl(complexNarrowingWithAny.ts, 78, 20)) + + _NG_VALUE_ACCESSOR_18_4:any[]; +>_NG_VALUE_ACCESSOR_18_4 : Symbol(_View_AppComponent0._NG_VALUE_ACCESSOR_18_4, Decl(complexNarrowingWithAny.ts, 178, 59)) + + _FormControlName_18_5:import47.FormControlName; +>_FormControlName_18_5 : Symbol(_View_AppComponent0._FormControlName_18_5, Decl(complexNarrowingWithAny.ts, 179, 32)) +>import47 : Symbol(import47, Decl(complexNarrowingWithAny.ts, 82, 1)) +>FormControlName : Symbol(import47.FormControlName, Decl(complexNarrowingWithAny.ts, 84, 20)) + + _NgControl_18_6:any; +>_NgControl_18_6 : Symbol(_View_AppComponent0._NgControl_18_6, Decl(complexNarrowingWithAny.ts, 180, 49)) + + _NgControlStatus_18_7:import45.NgControlStatus; +>_NgControlStatus_18_7 : Symbol(_View_AppComponent0._NgControlStatus_18_7, Decl(complexNarrowingWithAny.ts, 181, 22)) +>import45 : Symbol(import45, Decl(complexNarrowingWithAny.ts, 67, 1)) +>NgControlStatus : Symbol(import45.NgControlStatus, Decl(complexNarrowingWithAny.ts, 69, 20)) + + _el_19:any; +>_el_19 : Symbol(_View_AppComponent0._el_19, Decl(complexNarrowingWithAny.ts, 182, 49)) + + _text_20:any; +>_text_20 : Symbol(_View_AppComponent0._text_20, Decl(complexNarrowingWithAny.ts, 183, 13)) + + _el_21:any; +>_el_21 : Symbol(_View_AppComponent0._el_21, Decl(complexNarrowingWithAny.ts, 184, 15)) + + _DefaultValueAccessor_21_3:import46.DefaultValueAccessor; +>_DefaultValueAccessor_21_3 : Symbol(_View_AppComponent0._DefaultValueAccessor_21_3, Decl(complexNarrowingWithAny.ts, 185, 13)) +>import46 : Symbol(import46, Decl(complexNarrowingWithAny.ts, 76, 1)) +>DefaultValueAccessor : Symbol(import46.DefaultValueAccessor, Decl(complexNarrowingWithAny.ts, 78, 20)) + + _NG_VALUE_ACCESSOR_21_4:any[]; +>_NG_VALUE_ACCESSOR_21_4 : Symbol(_View_AppComponent0._NG_VALUE_ACCESSOR_21_4, Decl(complexNarrowingWithAny.ts, 186, 59)) + + _FormControlName_21_5:import47.FormControlName; +>_FormControlName_21_5 : Symbol(_View_AppComponent0._FormControlName_21_5, Decl(complexNarrowingWithAny.ts, 187, 32)) +>import47 : Symbol(import47, Decl(complexNarrowingWithAny.ts, 82, 1)) +>FormControlName : Symbol(import47.FormControlName, Decl(complexNarrowingWithAny.ts, 84, 20)) + + _NgControl_21_6:any; +>_NgControl_21_6 : Symbol(_View_AppComponent0._NgControl_21_6, Decl(complexNarrowingWithAny.ts, 188, 49)) + + _NgControlStatus_21_7:import45.NgControlStatus; +>_NgControlStatus_21_7 : Symbol(_View_AppComponent0._NgControlStatus_21_7, Decl(complexNarrowingWithAny.ts, 189, 22)) +>import45 : Symbol(import45, Decl(complexNarrowingWithAny.ts, 67, 1)) +>NgControlStatus : Symbol(import45.NgControlStatus, Decl(complexNarrowingWithAny.ts, 69, 20)) + + _el_22:any; +>_el_22 : Symbol(_View_AppComponent0._el_22, Decl(complexNarrowingWithAny.ts, 190, 49)) + + _text_23:any; +>_text_23 : Symbol(_View_AppComponent0._text_23, Decl(complexNarrowingWithAny.ts, 191, 13)) + + _el_24:any; +>_el_24 : Symbol(_View_AppComponent0._el_24, Decl(complexNarrowingWithAny.ts, 192, 15)) + + _DefaultValueAccessor_24_3:import46.DefaultValueAccessor; +>_DefaultValueAccessor_24_3 : Symbol(_View_AppComponent0._DefaultValueAccessor_24_3, Decl(complexNarrowingWithAny.ts, 193, 13)) +>import46 : Symbol(import46, Decl(complexNarrowingWithAny.ts, 76, 1)) +>DefaultValueAccessor : Symbol(import46.DefaultValueAccessor, Decl(complexNarrowingWithAny.ts, 78, 20)) + + _NG_VALUE_ACCESSOR_24_4:any[]; +>_NG_VALUE_ACCESSOR_24_4 : Symbol(_View_AppComponent0._NG_VALUE_ACCESSOR_24_4, Decl(complexNarrowingWithAny.ts, 194, 59)) + + _FormControlName_24_5:import47.FormControlName; +>_FormControlName_24_5 : Symbol(_View_AppComponent0._FormControlName_24_5, Decl(complexNarrowingWithAny.ts, 195, 32)) +>import47 : Symbol(import47, Decl(complexNarrowingWithAny.ts, 82, 1)) +>FormControlName : Symbol(import47.FormControlName, Decl(complexNarrowingWithAny.ts, 84, 20)) + + _NgControl_24_6:any; +>_NgControl_24_6 : Symbol(_View_AppComponent0._NgControl_24_6, Decl(complexNarrowingWithAny.ts, 196, 49)) + + _NgControlStatus_24_7:import45.NgControlStatus; +>_NgControlStatus_24_7 : Symbol(_View_AppComponent0._NgControlStatus_24_7, Decl(complexNarrowingWithAny.ts, 197, 22)) +>import45 : Symbol(import45, Decl(complexNarrowingWithAny.ts, 67, 1)) +>NgControlStatus : Symbol(import45.NgControlStatus, Decl(complexNarrowingWithAny.ts, 69, 20)) + + _el_25:any; +>_el_25 : Symbol(_View_AppComponent0._el_25, Decl(complexNarrowingWithAny.ts, 198, 49)) + + _text_26:any; +>_text_26 : Symbol(_View_AppComponent0._text_26, Decl(complexNarrowingWithAny.ts, 199, 13)) + + _el_27:any; +>_el_27 : Symbol(_View_AppComponent0._el_27, Decl(complexNarrowingWithAny.ts, 200, 15)) + + _DefaultValueAccessor_27_3:import46.DefaultValueAccessor; +>_DefaultValueAccessor_27_3 : Symbol(_View_AppComponent0._DefaultValueAccessor_27_3, Decl(complexNarrowingWithAny.ts, 201, 13)) +>import46 : Symbol(import46, Decl(complexNarrowingWithAny.ts, 76, 1)) +>DefaultValueAccessor : Symbol(import46.DefaultValueAccessor, Decl(complexNarrowingWithAny.ts, 78, 20)) + + _NG_VALUE_ACCESSOR_27_4:any[]; +>_NG_VALUE_ACCESSOR_27_4 : Symbol(_View_AppComponent0._NG_VALUE_ACCESSOR_27_4, Decl(complexNarrowingWithAny.ts, 202, 59)) + + _FormControlName_27_5:import47.FormControlName; +>_FormControlName_27_5 : Symbol(_View_AppComponent0._FormControlName_27_5, Decl(complexNarrowingWithAny.ts, 203, 32)) +>import47 : Symbol(import47, Decl(complexNarrowingWithAny.ts, 82, 1)) +>FormControlName : Symbol(import47.FormControlName, Decl(complexNarrowingWithAny.ts, 84, 20)) + + _NgControl_27_6:any; +>_NgControl_27_6 : Symbol(_View_AppComponent0._NgControl_27_6, Decl(complexNarrowingWithAny.ts, 204, 49)) + + _NgControlStatus_27_7:import45.NgControlStatus; +>_NgControlStatus_27_7 : Symbol(_View_AppComponent0._NgControlStatus_27_7, Decl(complexNarrowingWithAny.ts, 205, 22)) +>import45 : Symbol(import45, Decl(complexNarrowingWithAny.ts, 67, 1)) +>NgControlStatus : Symbol(import45.NgControlStatus, Decl(complexNarrowingWithAny.ts, 69, 20)) + + _el_28:any; +>_el_28 : Symbol(_View_AppComponent0._el_28, Decl(complexNarrowingWithAny.ts, 206, 49)) + + _text_29:any; +>_text_29 : Symbol(_View_AppComponent0._text_29, Decl(complexNarrowingWithAny.ts, 207, 13)) + + _el_30:any; +>_el_30 : Symbol(_View_AppComponent0._el_30, Decl(complexNarrowingWithAny.ts, 208, 15)) + + _DefaultValueAccessor_30_3:import46.DefaultValueAccessor; +>_DefaultValueAccessor_30_3 : Symbol(_View_AppComponent0._DefaultValueAccessor_30_3, Decl(complexNarrowingWithAny.ts, 209, 13)) +>import46 : Symbol(import46, Decl(complexNarrowingWithAny.ts, 76, 1)) +>DefaultValueAccessor : Symbol(import46.DefaultValueAccessor, Decl(complexNarrowingWithAny.ts, 78, 20)) + + _NG_VALUE_ACCESSOR_30_4:any[]; +>_NG_VALUE_ACCESSOR_30_4 : Symbol(_View_AppComponent0._NG_VALUE_ACCESSOR_30_4, Decl(complexNarrowingWithAny.ts, 210, 59)) + + _FormControlName_30_5:import47.FormControlName; +>_FormControlName_30_5 : Symbol(_View_AppComponent0._FormControlName_30_5, Decl(complexNarrowingWithAny.ts, 211, 32)) +>import47 : Symbol(import47, Decl(complexNarrowingWithAny.ts, 82, 1)) +>FormControlName : Symbol(import47.FormControlName, Decl(complexNarrowingWithAny.ts, 84, 20)) + + _NgControl_30_6:any; +>_NgControl_30_6 : Symbol(_View_AppComponent0._NgControl_30_6, Decl(complexNarrowingWithAny.ts, 212, 49)) + + _NgControlStatus_30_7:import45.NgControlStatus; +>_NgControlStatus_30_7 : Symbol(_View_AppComponent0._NgControlStatus_30_7, Decl(complexNarrowingWithAny.ts, 213, 22)) +>import45 : Symbol(import45, Decl(complexNarrowingWithAny.ts, 67, 1)) +>NgControlStatus : Symbol(import45.NgControlStatus, Decl(complexNarrowingWithAny.ts, 69, 20)) + + _el_31:any; +>_el_31 : Symbol(_View_AppComponent0._el_31, Decl(complexNarrowingWithAny.ts, 214, 49)) + + _text_32:any; +>_text_32 : Symbol(_View_AppComponent0._text_32, Decl(complexNarrowingWithAny.ts, 215, 13)) + + _el_33:any; +>_el_33 : Symbol(_View_AppComponent0._el_33, Decl(complexNarrowingWithAny.ts, 216, 15)) + + _DefaultValueAccessor_33_3:import46.DefaultValueAccessor; +>_DefaultValueAccessor_33_3 : Symbol(_View_AppComponent0._DefaultValueAccessor_33_3, Decl(complexNarrowingWithAny.ts, 217, 13)) +>import46 : Symbol(import46, Decl(complexNarrowingWithAny.ts, 76, 1)) +>DefaultValueAccessor : Symbol(import46.DefaultValueAccessor, Decl(complexNarrowingWithAny.ts, 78, 20)) + + _NG_VALUE_ACCESSOR_33_4:any[]; +>_NG_VALUE_ACCESSOR_33_4 : Symbol(_View_AppComponent0._NG_VALUE_ACCESSOR_33_4, Decl(complexNarrowingWithAny.ts, 218, 59)) + + _FormControlName_33_5:import47.FormControlName; +>_FormControlName_33_5 : Symbol(_View_AppComponent0._FormControlName_33_5, Decl(complexNarrowingWithAny.ts, 219, 32)) +>import47 : Symbol(import47, Decl(complexNarrowingWithAny.ts, 82, 1)) +>FormControlName : Symbol(import47.FormControlName, Decl(complexNarrowingWithAny.ts, 84, 20)) + + _NgControl_33_6:any; +>_NgControl_33_6 : Symbol(_View_AppComponent0._NgControl_33_6, Decl(complexNarrowingWithAny.ts, 220, 49)) + + _NgControlStatus_33_7:import45.NgControlStatus; +>_NgControlStatus_33_7 : Symbol(_View_AppComponent0._NgControlStatus_33_7, Decl(complexNarrowingWithAny.ts, 221, 22)) +>import45 : Symbol(import45, Decl(complexNarrowingWithAny.ts, 67, 1)) +>NgControlStatus : Symbol(import45.NgControlStatus, Decl(complexNarrowingWithAny.ts, 69, 20)) + + _el_34:any; +>_el_34 : Symbol(_View_AppComponent0._el_34, Decl(complexNarrowingWithAny.ts, 222, 49)) + + _text_35:any; +>_text_35 : Symbol(_View_AppComponent0._text_35, Decl(complexNarrowingWithAny.ts, 223, 13)) + + _el_36:any; +>_el_36 : Symbol(_View_AppComponent0._el_36, Decl(complexNarrowingWithAny.ts, 224, 15)) + + _DefaultValueAccessor_36_3:import46.DefaultValueAccessor; +>_DefaultValueAccessor_36_3 : Symbol(_View_AppComponent0._DefaultValueAccessor_36_3, Decl(complexNarrowingWithAny.ts, 225, 13)) +>import46 : Symbol(import46, Decl(complexNarrowingWithAny.ts, 76, 1)) +>DefaultValueAccessor : Symbol(import46.DefaultValueAccessor, Decl(complexNarrowingWithAny.ts, 78, 20)) + + _NG_VALUE_ACCESSOR_36_4:any[]; +>_NG_VALUE_ACCESSOR_36_4 : Symbol(_View_AppComponent0._NG_VALUE_ACCESSOR_36_4, Decl(complexNarrowingWithAny.ts, 226, 59)) + + _FormControlName_36_5:import47.FormControlName; +>_FormControlName_36_5 : Symbol(_View_AppComponent0._FormControlName_36_5, Decl(complexNarrowingWithAny.ts, 227, 32)) +>import47 : Symbol(import47, Decl(complexNarrowingWithAny.ts, 82, 1)) +>FormControlName : Symbol(import47.FormControlName, Decl(complexNarrowingWithAny.ts, 84, 20)) + + _NgControl_36_6:any; +>_NgControl_36_6 : Symbol(_View_AppComponent0._NgControl_36_6, Decl(complexNarrowingWithAny.ts, 228, 49)) + + _NgControlStatus_36_7:import45.NgControlStatus; +>_NgControlStatus_36_7 : Symbol(_View_AppComponent0._NgControlStatus_36_7, Decl(complexNarrowingWithAny.ts, 229, 22)) +>import45 : Symbol(import45, Decl(complexNarrowingWithAny.ts, 67, 1)) +>NgControlStatus : Symbol(import45.NgControlStatus, Decl(complexNarrowingWithAny.ts, 69, 20)) + + _el_37:any; +>_el_37 : Symbol(_View_AppComponent0._el_37, Decl(complexNarrowingWithAny.ts, 230, 49)) + + _text_38:any; +>_text_38 : Symbol(_View_AppComponent0._text_38, Decl(complexNarrowingWithAny.ts, 231, 13)) + + _el_39:any; +>_el_39 : Symbol(_View_AppComponent0._el_39, Decl(complexNarrowingWithAny.ts, 232, 15)) + + _DefaultValueAccessor_39_3:import46.DefaultValueAccessor; +>_DefaultValueAccessor_39_3 : Symbol(_View_AppComponent0._DefaultValueAccessor_39_3, Decl(complexNarrowingWithAny.ts, 233, 13)) +>import46 : Symbol(import46, Decl(complexNarrowingWithAny.ts, 76, 1)) +>DefaultValueAccessor : Symbol(import46.DefaultValueAccessor, Decl(complexNarrowingWithAny.ts, 78, 20)) + + _NG_VALUE_ACCESSOR_39_4:any[]; +>_NG_VALUE_ACCESSOR_39_4 : Symbol(_View_AppComponent0._NG_VALUE_ACCESSOR_39_4, Decl(complexNarrowingWithAny.ts, 234, 59)) + + _FormControlName_39_5:import47.FormControlName; +>_FormControlName_39_5 : Symbol(_View_AppComponent0._FormControlName_39_5, Decl(complexNarrowingWithAny.ts, 235, 32)) +>import47 : Symbol(import47, Decl(complexNarrowingWithAny.ts, 82, 1)) +>FormControlName : Symbol(import47.FormControlName, Decl(complexNarrowingWithAny.ts, 84, 20)) + + _NgControl_39_6:any; +>_NgControl_39_6 : Symbol(_View_AppComponent0._NgControl_39_6, Decl(complexNarrowingWithAny.ts, 236, 49)) + + _NgControlStatus_39_7:import45.NgControlStatus; +>_NgControlStatus_39_7 : Symbol(_View_AppComponent0._NgControlStatus_39_7, Decl(complexNarrowingWithAny.ts, 237, 22)) +>import45 : Symbol(import45, Decl(complexNarrowingWithAny.ts, 67, 1)) +>NgControlStatus : Symbol(import45.NgControlStatus, Decl(complexNarrowingWithAny.ts, 69, 20)) + + _el_40:any; +>_el_40 : Symbol(_View_AppComponent0._el_40, Decl(complexNarrowingWithAny.ts, 238, 49)) + + _text_41:any; +>_text_41 : Symbol(_View_AppComponent0._text_41, Decl(complexNarrowingWithAny.ts, 239, 13)) + + _el_42:any; +>_el_42 : Symbol(_View_AppComponent0._el_42, Decl(complexNarrowingWithAny.ts, 240, 15)) + + _DefaultValueAccessor_42_3:import46.DefaultValueAccessor; +>_DefaultValueAccessor_42_3 : Symbol(_View_AppComponent0._DefaultValueAccessor_42_3, Decl(complexNarrowingWithAny.ts, 241, 13)) +>import46 : Symbol(import46, Decl(complexNarrowingWithAny.ts, 76, 1)) +>DefaultValueAccessor : Symbol(import46.DefaultValueAccessor, Decl(complexNarrowingWithAny.ts, 78, 20)) + + _NG_VALUE_ACCESSOR_42_4:any[]; +>_NG_VALUE_ACCESSOR_42_4 : Symbol(_View_AppComponent0._NG_VALUE_ACCESSOR_42_4, Decl(complexNarrowingWithAny.ts, 242, 59)) + + _FormControlName_42_5:import47.FormControlName; +>_FormControlName_42_5 : Symbol(_View_AppComponent0._FormControlName_42_5, Decl(complexNarrowingWithAny.ts, 243, 32)) +>import47 : Symbol(import47, Decl(complexNarrowingWithAny.ts, 82, 1)) +>FormControlName : Symbol(import47.FormControlName, Decl(complexNarrowingWithAny.ts, 84, 20)) + + _NgControl_42_6:any; +>_NgControl_42_6 : Symbol(_View_AppComponent0._NgControl_42_6, Decl(complexNarrowingWithAny.ts, 244, 49)) + + _NgControlStatus_42_7:import45.NgControlStatus; +>_NgControlStatus_42_7 : Symbol(_View_AppComponent0._NgControlStatus_42_7, Decl(complexNarrowingWithAny.ts, 245, 22)) +>import45 : Symbol(import45, Decl(complexNarrowingWithAny.ts, 67, 1)) +>NgControlStatus : Symbol(import45.NgControlStatus, Decl(complexNarrowingWithAny.ts, 69, 20)) + + _el_43:any; +>_el_43 : Symbol(_View_AppComponent0._el_43, Decl(complexNarrowingWithAny.ts, 246, 49)) + + _text_44:any; +>_text_44 : Symbol(_View_AppComponent0._text_44, Decl(complexNarrowingWithAny.ts, 247, 13)) + + _el_45:any; +>_el_45 : Symbol(_View_AppComponent0._el_45, Decl(complexNarrowingWithAny.ts, 248, 15)) + + _DefaultValueAccessor_45_3:import46.DefaultValueAccessor; +>_DefaultValueAccessor_45_3 : Symbol(_View_AppComponent0._DefaultValueAccessor_45_3, Decl(complexNarrowingWithAny.ts, 249, 13)) +>import46 : Symbol(import46, Decl(complexNarrowingWithAny.ts, 76, 1)) +>DefaultValueAccessor : Symbol(import46.DefaultValueAccessor, Decl(complexNarrowingWithAny.ts, 78, 20)) + + _NG_VALUE_ACCESSOR_45_4:any[]; +>_NG_VALUE_ACCESSOR_45_4 : Symbol(_View_AppComponent0._NG_VALUE_ACCESSOR_45_4, Decl(complexNarrowingWithAny.ts, 250, 59)) + + _FormControlName_45_5:import47.FormControlName; +>_FormControlName_45_5 : Symbol(_View_AppComponent0._FormControlName_45_5, Decl(complexNarrowingWithAny.ts, 251, 32)) +>import47 : Symbol(import47, Decl(complexNarrowingWithAny.ts, 82, 1)) +>FormControlName : Symbol(import47.FormControlName, Decl(complexNarrowingWithAny.ts, 84, 20)) + + _NgControl_45_6:any; +>_NgControl_45_6 : Symbol(_View_AppComponent0._NgControl_45_6, Decl(complexNarrowingWithAny.ts, 252, 49)) + + _NgControlStatus_45_7:import45.NgControlStatus; +>_NgControlStatus_45_7 : Symbol(_View_AppComponent0._NgControlStatus_45_7, Decl(complexNarrowingWithAny.ts, 253, 22)) +>import45 : Symbol(import45, Decl(complexNarrowingWithAny.ts, 67, 1)) +>NgControlStatus : Symbol(import45.NgControlStatus, Decl(complexNarrowingWithAny.ts, 69, 20)) + + _el_46:any; +>_el_46 : Symbol(_View_AppComponent0._el_46, Decl(complexNarrowingWithAny.ts, 254, 49)) + + _text_47:any; +>_text_47 : Symbol(_View_AppComponent0._text_47, Decl(complexNarrowingWithAny.ts, 255, 13)) + + _el_48:any; +>_el_48 : Symbol(_View_AppComponent0._el_48, Decl(complexNarrowingWithAny.ts, 256, 15)) + + _DefaultValueAccessor_48_3:import46.DefaultValueAccessor; +>_DefaultValueAccessor_48_3 : Symbol(_View_AppComponent0._DefaultValueAccessor_48_3, Decl(complexNarrowingWithAny.ts, 257, 13)) +>import46 : Symbol(import46, Decl(complexNarrowingWithAny.ts, 76, 1)) +>DefaultValueAccessor : Symbol(import46.DefaultValueAccessor, Decl(complexNarrowingWithAny.ts, 78, 20)) + + _NG_VALUE_ACCESSOR_48_4:any[]; +>_NG_VALUE_ACCESSOR_48_4 : Symbol(_View_AppComponent0._NG_VALUE_ACCESSOR_48_4, Decl(complexNarrowingWithAny.ts, 258, 59)) + + _FormControlName_48_5:import47.FormControlName; +>_FormControlName_48_5 : Symbol(_View_AppComponent0._FormControlName_48_5, Decl(complexNarrowingWithAny.ts, 259, 32)) +>import47 : Symbol(import47, Decl(complexNarrowingWithAny.ts, 82, 1)) +>FormControlName : Symbol(import47.FormControlName, Decl(complexNarrowingWithAny.ts, 84, 20)) + + _NgControl_48_6:any; +>_NgControl_48_6 : Symbol(_View_AppComponent0._NgControl_48_6, Decl(complexNarrowingWithAny.ts, 260, 49)) + + _NgControlStatus_48_7:import45.NgControlStatus; +>_NgControlStatus_48_7 : Symbol(_View_AppComponent0._NgControlStatus_48_7, Decl(complexNarrowingWithAny.ts, 261, 22)) +>import45 : Symbol(import45, Decl(complexNarrowingWithAny.ts, 67, 1)) +>NgControlStatus : Symbol(import45.NgControlStatus, Decl(complexNarrowingWithAny.ts, 69, 20)) + + _el_49:any; +>_el_49 : Symbol(_View_AppComponent0._el_49, Decl(complexNarrowingWithAny.ts, 262, 49)) + + _text_50:any; +>_text_50 : Symbol(_View_AppComponent0._text_50, Decl(complexNarrowingWithAny.ts, 263, 13)) + + _el_51:any; +>_el_51 : Symbol(_View_AppComponent0._el_51, Decl(complexNarrowingWithAny.ts, 264, 15)) + + _DefaultValueAccessor_51_3:import46.DefaultValueAccessor; +>_DefaultValueAccessor_51_3 : Symbol(_View_AppComponent0._DefaultValueAccessor_51_3, Decl(complexNarrowingWithAny.ts, 265, 13)) +>import46 : Symbol(import46, Decl(complexNarrowingWithAny.ts, 76, 1)) +>DefaultValueAccessor : Symbol(import46.DefaultValueAccessor, Decl(complexNarrowingWithAny.ts, 78, 20)) + + _NG_VALUE_ACCESSOR_51_4:any[]; +>_NG_VALUE_ACCESSOR_51_4 : Symbol(_View_AppComponent0._NG_VALUE_ACCESSOR_51_4, Decl(complexNarrowingWithAny.ts, 266, 59)) + + _FormControlName_51_5:import47.FormControlName; +>_FormControlName_51_5 : Symbol(_View_AppComponent0._FormControlName_51_5, Decl(complexNarrowingWithAny.ts, 267, 32)) +>import47 : Symbol(import47, Decl(complexNarrowingWithAny.ts, 82, 1)) +>FormControlName : Symbol(import47.FormControlName, Decl(complexNarrowingWithAny.ts, 84, 20)) + + _NgControl_51_6:any; +>_NgControl_51_6 : Symbol(_View_AppComponent0._NgControl_51_6, Decl(complexNarrowingWithAny.ts, 268, 49)) + + _NgControlStatus_51_7:import45.NgControlStatus; +>_NgControlStatus_51_7 : Symbol(_View_AppComponent0._NgControlStatus_51_7, Decl(complexNarrowingWithAny.ts, 269, 22)) +>import45 : Symbol(import45, Decl(complexNarrowingWithAny.ts, 67, 1)) +>NgControlStatus : Symbol(import45.NgControlStatus, Decl(complexNarrowingWithAny.ts, 69, 20)) + + _el_52:any; +>_el_52 : Symbol(_View_AppComponent0._el_52, Decl(complexNarrowingWithAny.ts, 270, 49)) + + _text_53:any; +>_text_53 : Symbol(_View_AppComponent0._text_53, Decl(complexNarrowingWithAny.ts, 271, 13)) + + _el_54:any; +>_el_54 : Symbol(_View_AppComponent0._el_54, Decl(complexNarrowingWithAny.ts, 272, 15)) + + _DefaultValueAccessor_54_3:import46.DefaultValueAccessor; +>_DefaultValueAccessor_54_3 : Symbol(_View_AppComponent0._DefaultValueAccessor_54_3, Decl(complexNarrowingWithAny.ts, 273, 13)) +>import46 : Symbol(import46, Decl(complexNarrowingWithAny.ts, 76, 1)) +>DefaultValueAccessor : Symbol(import46.DefaultValueAccessor, Decl(complexNarrowingWithAny.ts, 78, 20)) + + _NG_VALUE_ACCESSOR_54_4:any[]; +>_NG_VALUE_ACCESSOR_54_4 : Symbol(_View_AppComponent0._NG_VALUE_ACCESSOR_54_4, Decl(complexNarrowingWithAny.ts, 274, 59)) + + _FormControlName_54_5:import47.FormControlName; +>_FormControlName_54_5 : Symbol(_View_AppComponent0._FormControlName_54_5, Decl(complexNarrowingWithAny.ts, 275, 32)) +>import47 : Symbol(import47, Decl(complexNarrowingWithAny.ts, 82, 1)) +>FormControlName : Symbol(import47.FormControlName, Decl(complexNarrowingWithAny.ts, 84, 20)) + + _NgControl_54_6:any; +>_NgControl_54_6 : Symbol(_View_AppComponent0._NgControl_54_6, Decl(complexNarrowingWithAny.ts, 276, 49)) + + _NgControlStatus_54_7:import45.NgControlStatus; +>_NgControlStatus_54_7 : Symbol(_View_AppComponent0._NgControlStatus_54_7, Decl(complexNarrowingWithAny.ts, 277, 22)) +>import45 : Symbol(import45, Decl(complexNarrowingWithAny.ts, 67, 1)) +>NgControlStatus : Symbol(import45.NgControlStatus, Decl(complexNarrowingWithAny.ts, 69, 20)) + + _el_55:any; +>_el_55 : Symbol(_View_AppComponent0._el_55, Decl(complexNarrowingWithAny.ts, 278, 49)) + + _text_56:any; +>_text_56 : Symbol(_View_AppComponent0._text_56, Decl(complexNarrowingWithAny.ts, 279, 13)) + + _el_57:any; +>_el_57 : Symbol(_View_AppComponent0._el_57, Decl(complexNarrowingWithAny.ts, 280, 15)) + + _DefaultValueAccessor_57_3:import46.DefaultValueAccessor; +>_DefaultValueAccessor_57_3 : Symbol(_View_AppComponent0._DefaultValueAccessor_57_3, Decl(complexNarrowingWithAny.ts, 281, 13)) +>import46 : Symbol(import46, Decl(complexNarrowingWithAny.ts, 76, 1)) +>DefaultValueAccessor : Symbol(import46.DefaultValueAccessor, Decl(complexNarrowingWithAny.ts, 78, 20)) + + _NG_VALUE_ACCESSOR_57_4:any[]; +>_NG_VALUE_ACCESSOR_57_4 : Symbol(_View_AppComponent0._NG_VALUE_ACCESSOR_57_4, Decl(complexNarrowingWithAny.ts, 282, 59)) + + _FormControlName_57_5:import47.FormControlName; +>_FormControlName_57_5 : Symbol(_View_AppComponent0._FormControlName_57_5, Decl(complexNarrowingWithAny.ts, 283, 32)) +>import47 : Symbol(import47, Decl(complexNarrowingWithAny.ts, 82, 1)) +>FormControlName : Symbol(import47.FormControlName, Decl(complexNarrowingWithAny.ts, 84, 20)) + + _NgControl_57_6:any; +>_NgControl_57_6 : Symbol(_View_AppComponent0._NgControl_57_6, Decl(complexNarrowingWithAny.ts, 284, 49)) + + _NgControlStatus_57_7:import45.NgControlStatus; +>_NgControlStatus_57_7 : Symbol(_View_AppComponent0._NgControlStatus_57_7, Decl(complexNarrowingWithAny.ts, 285, 22)) +>import45 : Symbol(import45, Decl(complexNarrowingWithAny.ts, 67, 1)) +>NgControlStatus : Symbol(import45.NgControlStatus, Decl(complexNarrowingWithAny.ts, 69, 20)) + + _el_58:any; +>_el_58 : Symbol(_View_AppComponent0._el_58, Decl(complexNarrowingWithAny.ts, 286, 49)) + + _text_59:any; +>_text_59 : Symbol(_View_AppComponent0._text_59, Decl(complexNarrowingWithAny.ts, 287, 13)) + + _el_60:any; +>_el_60 : Symbol(_View_AppComponent0._el_60, Decl(complexNarrowingWithAny.ts, 288, 15)) + + _DefaultValueAccessor_60_3:import46.DefaultValueAccessor; +>_DefaultValueAccessor_60_3 : Symbol(_View_AppComponent0._DefaultValueAccessor_60_3, Decl(complexNarrowingWithAny.ts, 289, 13)) +>import46 : Symbol(import46, Decl(complexNarrowingWithAny.ts, 76, 1)) +>DefaultValueAccessor : Symbol(import46.DefaultValueAccessor, Decl(complexNarrowingWithAny.ts, 78, 20)) + + _NG_VALUE_ACCESSOR_60_4:any[]; +>_NG_VALUE_ACCESSOR_60_4 : Symbol(_View_AppComponent0._NG_VALUE_ACCESSOR_60_4, Decl(complexNarrowingWithAny.ts, 290, 59)) + + _FormControlName_60_5:import47.FormControlName; +>_FormControlName_60_5 : Symbol(_View_AppComponent0._FormControlName_60_5, Decl(complexNarrowingWithAny.ts, 291, 32)) +>import47 : Symbol(import47, Decl(complexNarrowingWithAny.ts, 82, 1)) +>FormControlName : Symbol(import47.FormControlName, Decl(complexNarrowingWithAny.ts, 84, 20)) + + _NgControl_60_6:any; +>_NgControl_60_6 : Symbol(_View_AppComponent0._NgControl_60_6, Decl(complexNarrowingWithAny.ts, 292, 49)) + + _NgControlStatus_60_7:import45.NgControlStatus; +>_NgControlStatus_60_7 : Symbol(_View_AppComponent0._NgControlStatus_60_7, Decl(complexNarrowingWithAny.ts, 293, 22)) +>import45 : Symbol(import45, Decl(complexNarrowingWithAny.ts, 67, 1)) +>NgControlStatus : Symbol(import45.NgControlStatus, Decl(complexNarrowingWithAny.ts, 69, 20)) + + _el_61:any; +>_el_61 : Symbol(_View_AppComponent0._el_61, Decl(complexNarrowingWithAny.ts, 294, 49)) + + _text_62:any; +>_text_62 : Symbol(_View_AppComponent0._text_62, Decl(complexNarrowingWithAny.ts, 295, 13)) + + _text_63:any; +>_text_63 : Symbol(_View_AppComponent0._text_63, Decl(complexNarrowingWithAny.ts, 296, 15)) + + /*private*/ _expr_2:any; +>_expr_2 : Symbol(_View_AppComponent0._expr_2, Decl(complexNarrowingWithAny.ts, 297, 15)) + + /*private*/ _expr_3:any; +>_expr_3 : Symbol(_View_AppComponent0._expr_3, Decl(complexNarrowingWithAny.ts, 298, 26)) + + /*private*/ _expr_4:any; +>_expr_4 : Symbol(_View_AppComponent0._expr_4, Decl(complexNarrowingWithAny.ts, 299, 26)) + + /*private*/ _expr_5:any; +>_expr_5 : Symbol(_View_AppComponent0._expr_5, Decl(complexNarrowingWithAny.ts, 300, 26)) + + /*private*/ _expr_6:any; +>_expr_6 : Symbol(_View_AppComponent0._expr_6, Decl(complexNarrowingWithAny.ts, 301, 26)) + + /*private*/ _expr_7:any; +>_expr_7 : Symbol(_View_AppComponent0._expr_7, Decl(complexNarrowingWithAny.ts, 302, 26)) + + /*private*/ _expr_8:any; +>_expr_8 : Symbol(_View_AppComponent0._expr_8, Decl(complexNarrowingWithAny.ts, 303, 26)) + + /*private*/ _expr_11:any; +>_expr_11 : Symbol(_View_AppComponent0._expr_11, Decl(complexNarrowingWithAny.ts, 304, 26)) + + /*private*/ _expr_12:any; +>_expr_12 : Symbol(_View_AppComponent0._expr_12, Decl(complexNarrowingWithAny.ts, 305, 27)) + + /*private*/ _expr_13:any; +>_expr_13 : Symbol(_View_AppComponent0._expr_13, Decl(complexNarrowingWithAny.ts, 306, 27)) + + /*private*/ _expr_14:any; +>_expr_14 : Symbol(_View_AppComponent0._expr_14, Decl(complexNarrowingWithAny.ts, 307, 27)) + + /*private*/ _expr_15:any; +>_expr_15 : Symbol(_View_AppComponent0._expr_15, Decl(complexNarrowingWithAny.ts, 308, 27)) + + /*private*/ _expr_16:any; +>_expr_16 : Symbol(_View_AppComponent0._expr_16, Decl(complexNarrowingWithAny.ts, 309, 27)) + + /*private*/ _expr_17:any; +>_expr_17 : Symbol(_View_AppComponent0._expr_17, Decl(complexNarrowingWithAny.ts, 310, 27)) + + /*private*/ _expr_20:any; +>_expr_20 : Symbol(_View_AppComponent0._expr_20, Decl(complexNarrowingWithAny.ts, 311, 27)) + + /*private*/ _expr_21:any; +>_expr_21 : Symbol(_View_AppComponent0._expr_21, Decl(complexNarrowingWithAny.ts, 312, 27)) + + /*private*/ _expr_22:any; +>_expr_22 : Symbol(_View_AppComponent0._expr_22, Decl(complexNarrowingWithAny.ts, 313, 27)) + + /*private*/ _expr_23:any; +>_expr_23 : Symbol(_View_AppComponent0._expr_23, Decl(complexNarrowingWithAny.ts, 314, 27)) + + /*private*/ _expr_24:any; +>_expr_24 : Symbol(_View_AppComponent0._expr_24, Decl(complexNarrowingWithAny.ts, 315, 27)) + + /*private*/ _expr_25:any; +>_expr_25 : Symbol(_View_AppComponent0._expr_25, Decl(complexNarrowingWithAny.ts, 316, 27)) + + /*private*/ _expr_26:any; +>_expr_26 : Symbol(_View_AppComponent0._expr_26, Decl(complexNarrowingWithAny.ts, 317, 27)) + + /*private*/ _expr_29:any; +>_expr_29 : Symbol(_View_AppComponent0._expr_29, Decl(complexNarrowingWithAny.ts, 318, 27)) + + /*private*/ _expr_30:any; +>_expr_30 : Symbol(_View_AppComponent0._expr_30, Decl(complexNarrowingWithAny.ts, 319, 27)) + + /*private*/ _expr_31:any; +>_expr_31 : Symbol(_View_AppComponent0._expr_31, Decl(complexNarrowingWithAny.ts, 320, 27)) + + /*private*/ _expr_32:any; +>_expr_32 : Symbol(_View_AppComponent0._expr_32, Decl(complexNarrowingWithAny.ts, 321, 27)) + + /*private*/ _expr_33:any; +>_expr_33 : Symbol(_View_AppComponent0._expr_33, Decl(complexNarrowingWithAny.ts, 322, 27)) + + /*private*/ _expr_34:any; +>_expr_34 : Symbol(_View_AppComponent0._expr_34, Decl(complexNarrowingWithAny.ts, 323, 27)) + + /*private*/ _expr_35:any; +>_expr_35 : Symbol(_View_AppComponent0._expr_35, Decl(complexNarrowingWithAny.ts, 324, 27)) + + /*private*/ _expr_38:any; +>_expr_38 : Symbol(_View_AppComponent0._expr_38, Decl(complexNarrowingWithAny.ts, 325, 27)) + + /*private*/ _expr_39:any; +>_expr_39 : Symbol(_View_AppComponent0._expr_39, Decl(complexNarrowingWithAny.ts, 326, 27)) + + /*private*/ _expr_40:any; +>_expr_40 : Symbol(_View_AppComponent0._expr_40, Decl(complexNarrowingWithAny.ts, 327, 27)) + + /*private*/ _expr_41:any; +>_expr_41 : Symbol(_View_AppComponent0._expr_41, Decl(complexNarrowingWithAny.ts, 328, 27)) + + /*private*/ _expr_42:any; +>_expr_42 : Symbol(_View_AppComponent0._expr_42, Decl(complexNarrowingWithAny.ts, 329, 27)) + + /*private*/ _expr_43:any; +>_expr_43 : Symbol(_View_AppComponent0._expr_43, Decl(complexNarrowingWithAny.ts, 330, 27)) + + /*private*/ _expr_44:any; +>_expr_44 : Symbol(_View_AppComponent0._expr_44, Decl(complexNarrowingWithAny.ts, 331, 27)) + + /*private*/ _expr_47:any; +>_expr_47 : Symbol(_View_AppComponent0._expr_47, Decl(complexNarrowingWithAny.ts, 332, 27)) + + /*private*/ _expr_48:any; +>_expr_48 : Symbol(_View_AppComponent0._expr_48, Decl(complexNarrowingWithAny.ts, 333, 27)) + + /*private*/ _expr_49:any; +>_expr_49 : Symbol(_View_AppComponent0._expr_49, Decl(complexNarrowingWithAny.ts, 334, 27)) + + /*private*/ _expr_50:any; +>_expr_50 : Symbol(_View_AppComponent0._expr_50, Decl(complexNarrowingWithAny.ts, 335, 27)) + + /*private*/ _expr_51:any; +>_expr_51 : Symbol(_View_AppComponent0._expr_51, Decl(complexNarrowingWithAny.ts, 336, 27)) + + /*private*/ _expr_52:any; +>_expr_52 : Symbol(_View_AppComponent0._expr_52, Decl(complexNarrowingWithAny.ts, 337, 27)) + + /*private*/ _expr_53:any; +>_expr_53 : Symbol(_View_AppComponent0._expr_53, Decl(complexNarrowingWithAny.ts, 338, 27)) + + /*private*/ _expr_56:any; +>_expr_56 : Symbol(_View_AppComponent0._expr_56, Decl(complexNarrowingWithAny.ts, 339, 27)) + + /*private*/ _expr_57:any; +>_expr_57 : Symbol(_View_AppComponent0._expr_57, Decl(complexNarrowingWithAny.ts, 340, 27)) + + /*private*/ _expr_58:any; +>_expr_58 : Symbol(_View_AppComponent0._expr_58, Decl(complexNarrowingWithAny.ts, 341, 27)) + + /*private*/ _expr_59:any; +>_expr_59 : Symbol(_View_AppComponent0._expr_59, Decl(complexNarrowingWithAny.ts, 342, 27)) + + /*private*/ _expr_60:any; +>_expr_60 : Symbol(_View_AppComponent0._expr_60, Decl(complexNarrowingWithAny.ts, 343, 27)) + + /*private*/ _expr_61:any; +>_expr_61 : Symbol(_View_AppComponent0._expr_61, Decl(complexNarrowingWithAny.ts, 344, 27)) + + /*private*/ _expr_62:any; +>_expr_62 : Symbol(_View_AppComponent0._expr_62, Decl(complexNarrowingWithAny.ts, 345, 27)) + + /*private*/ _expr_65:any; +>_expr_65 : Symbol(_View_AppComponent0._expr_65, Decl(complexNarrowingWithAny.ts, 346, 27)) + + /*private*/ _expr_66:any; +>_expr_66 : Symbol(_View_AppComponent0._expr_66, Decl(complexNarrowingWithAny.ts, 347, 27)) + + /*private*/ _expr_67:any; +>_expr_67 : Symbol(_View_AppComponent0._expr_67, Decl(complexNarrowingWithAny.ts, 348, 27)) + + /*private*/ _expr_68:any; +>_expr_68 : Symbol(_View_AppComponent0._expr_68, Decl(complexNarrowingWithAny.ts, 349, 27)) + + /*private*/ _expr_69:any; +>_expr_69 : Symbol(_View_AppComponent0._expr_69, Decl(complexNarrowingWithAny.ts, 350, 27)) + + /*private*/ _expr_70:any; +>_expr_70 : Symbol(_View_AppComponent0._expr_70, Decl(complexNarrowingWithAny.ts, 351, 27)) + + /*private*/ _expr_71:any; +>_expr_71 : Symbol(_View_AppComponent0._expr_71, Decl(complexNarrowingWithAny.ts, 352, 27)) + + /*private*/ _expr_74:any; +>_expr_74 : Symbol(_View_AppComponent0._expr_74, Decl(complexNarrowingWithAny.ts, 353, 27)) + + /*private*/ _expr_75:any; +>_expr_75 : Symbol(_View_AppComponent0._expr_75, Decl(complexNarrowingWithAny.ts, 354, 27)) + + /*private*/ _expr_76:any; +>_expr_76 : Symbol(_View_AppComponent0._expr_76, Decl(complexNarrowingWithAny.ts, 355, 27)) + + /*private*/ _expr_77:any; +>_expr_77 : Symbol(_View_AppComponent0._expr_77, Decl(complexNarrowingWithAny.ts, 356, 27)) + + /*private*/ _expr_78:any; +>_expr_78 : Symbol(_View_AppComponent0._expr_78, Decl(complexNarrowingWithAny.ts, 357, 27)) + + /*private*/ _expr_79:any; +>_expr_79 : Symbol(_View_AppComponent0._expr_79, Decl(complexNarrowingWithAny.ts, 358, 27)) + + /*private*/ _expr_80:any; +>_expr_80 : Symbol(_View_AppComponent0._expr_80, Decl(complexNarrowingWithAny.ts, 359, 27)) + + /*private*/ _expr_83:any; +>_expr_83 : Symbol(_View_AppComponent0._expr_83, Decl(complexNarrowingWithAny.ts, 360, 27)) + + /*private*/ _expr_84:any; +>_expr_84 : Symbol(_View_AppComponent0._expr_84, Decl(complexNarrowingWithAny.ts, 361, 27)) + + /*private*/ _expr_85:any; +>_expr_85 : Symbol(_View_AppComponent0._expr_85, Decl(complexNarrowingWithAny.ts, 362, 27)) + + /*private*/ _expr_86:any; +>_expr_86 : Symbol(_View_AppComponent0._expr_86, Decl(complexNarrowingWithAny.ts, 363, 27)) + + /*private*/ _expr_87:any; +>_expr_87 : Symbol(_View_AppComponent0._expr_87, Decl(complexNarrowingWithAny.ts, 364, 27)) + + /*private*/ _expr_88:any; +>_expr_88 : Symbol(_View_AppComponent0._expr_88, Decl(complexNarrowingWithAny.ts, 365, 27)) + + /*private*/ _expr_89:any; +>_expr_89 : Symbol(_View_AppComponent0._expr_89, Decl(complexNarrowingWithAny.ts, 366, 27)) + + /*private*/ _expr_92:any; +>_expr_92 : Symbol(_View_AppComponent0._expr_92, Decl(complexNarrowingWithAny.ts, 367, 27)) + + /*private*/ _expr_93:any; +>_expr_93 : Symbol(_View_AppComponent0._expr_93, Decl(complexNarrowingWithAny.ts, 368, 27)) + + /*private*/ _expr_94:any; +>_expr_94 : Symbol(_View_AppComponent0._expr_94, Decl(complexNarrowingWithAny.ts, 369, 27)) + + /*private*/ _expr_95:any; +>_expr_95 : Symbol(_View_AppComponent0._expr_95, Decl(complexNarrowingWithAny.ts, 370, 27)) + + /*private*/ _expr_96:any; +>_expr_96 : Symbol(_View_AppComponent0._expr_96, Decl(complexNarrowingWithAny.ts, 371, 27)) + + /*private*/ _expr_97:any; +>_expr_97 : Symbol(_View_AppComponent0._expr_97, Decl(complexNarrowingWithAny.ts, 372, 27)) + + /*private*/ _expr_98:any; +>_expr_98 : Symbol(_View_AppComponent0._expr_98, Decl(complexNarrowingWithAny.ts, 373, 27)) + + /*private*/ _expr_101:any; +>_expr_101 : Symbol(_View_AppComponent0._expr_101, Decl(complexNarrowingWithAny.ts, 374, 27)) + + /*private*/ _expr_102:any; +>_expr_102 : Symbol(_View_AppComponent0._expr_102, Decl(complexNarrowingWithAny.ts, 375, 28)) + + /*private*/ _expr_103:any; +>_expr_103 : Symbol(_View_AppComponent0._expr_103, Decl(complexNarrowingWithAny.ts, 376, 28)) + + /*private*/ _expr_104:any; +>_expr_104 : Symbol(_View_AppComponent0._expr_104, Decl(complexNarrowingWithAny.ts, 377, 28)) + + /*private*/ _expr_105:any; +>_expr_105 : Symbol(_View_AppComponent0._expr_105, Decl(complexNarrowingWithAny.ts, 378, 28)) + + /*private*/ _expr_106:any; +>_expr_106 : Symbol(_View_AppComponent0._expr_106, Decl(complexNarrowingWithAny.ts, 379, 28)) + + /*private*/ _expr_107:any; +>_expr_107 : Symbol(_View_AppComponent0._expr_107, Decl(complexNarrowingWithAny.ts, 380, 28)) + + /*private*/ _expr_110:any; +>_expr_110 : Symbol(_View_AppComponent0._expr_110, Decl(complexNarrowingWithAny.ts, 381, 28)) + + /*private*/ _expr_111:any; +>_expr_111 : Symbol(_View_AppComponent0._expr_111, Decl(complexNarrowingWithAny.ts, 382, 28)) + + /*private*/ _expr_112:any; +>_expr_112 : Symbol(_View_AppComponent0._expr_112, Decl(complexNarrowingWithAny.ts, 383, 28)) + + /*private*/ _expr_113:any; +>_expr_113 : Symbol(_View_AppComponent0._expr_113, Decl(complexNarrowingWithAny.ts, 384, 28)) + + /*private*/ _expr_114:any; +>_expr_114 : Symbol(_View_AppComponent0._expr_114, Decl(complexNarrowingWithAny.ts, 385, 28)) + + /*private*/ _expr_115:any; +>_expr_115 : Symbol(_View_AppComponent0._expr_115, Decl(complexNarrowingWithAny.ts, 386, 28)) + + /*private*/ _expr_116:any; +>_expr_116 : Symbol(_View_AppComponent0._expr_116, Decl(complexNarrowingWithAny.ts, 387, 28)) + + /*private*/ _expr_119:any; +>_expr_119 : Symbol(_View_AppComponent0._expr_119, Decl(complexNarrowingWithAny.ts, 388, 28)) + + /*private*/ _expr_120:any; +>_expr_120 : Symbol(_View_AppComponent0._expr_120, Decl(complexNarrowingWithAny.ts, 389, 28)) + + /*private*/ _expr_121:any; +>_expr_121 : Symbol(_View_AppComponent0._expr_121, Decl(complexNarrowingWithAny.ts, 390, 28)) + + /*private*/ _expr_122:any; +>_expr_122 : Symbol(_View_AppComponent0._expr_122, Decl(complexNarrowingWithAny.ts, 391, 28)) + + /*private*/ _expr_123:any; +>_expr_123 : Symbol(_View_AppComponent0._expr_123, Decl(complexNarrowingWithAny.ts, 392, 28)) + + /*private*/ _expr_124:any; +>_expr_124 : Symbol(_View_AppComponent0._expr_124, Decl(complexNarrowingWithAny.ts, 393, 28)) + + /*private*/ _expr_125:any; +>_expr_125 : Symbol(_View_AppComponent0._expr_125, Decl(complexNarrowingWithAny.ts, 394, 28)) + + /*private*/ _expr_128:any; +>_expr_128 : Symbol(_View_AppComponent0._expr_128, Decl(complexNarrowingWithAny.ts, 395, 28)) + + /*private*/ _expr_129:any; +>_expr_129 : Symbol(_View_AppComponent0._expr_129, Decl(complexNarrowingWithAny.ts, 396, 28)) + + /*private*/ _expr_130:any; +>_expr_130 : Symbol(_View_AppComponent0._expr_130, Decl(complexNarrowingWithAny.ts, 397, 28)) + + /*private*/ _expr_131:any; +>_expr_131 : Symbol(_View_AppComponent0._expr_131, Decl(complexNarrowingWithAny.ts, 398, 28)) + + /*private*/ _expr_132:any; +>_expr_132 : Symbol(_View_AppComponent0._expr_132, Decl(complexNarrowingWithAny.ts, 399, 28)) + + /*private*/ _expr_133:any; +>_expr_133 : Symbol(_View_AppComponent0._expr_133, Decl(complexNarrowingWithAny.ts, 400, 28)) + + /*private*/ _expr_134:any; +>_expr_134 : Symbol(_View_AppComponent0._expr_134, Decl(complexNarrowingWithAny.ts, 401, 28)) + + /*private*/ _expr_137:any; +>_expr_137 : Symbol(_View_AppComponent0._expr_137, Decl(complexNarrowingWithAny.ts, 402, 28)) + + /*private*/ _expr_138:any; +>_expr_138 : Symbol(_View_AppComponent0._expr_138, Decl(complexNarrowingWithAny.ts, 403, 28)) + + /*private*/ _expr_139:any; +>_expr_139 : Symbol(_View_AppComponent0._expr_139, Decl(complexNarrowingWithAny.ts, 404, 28)) + + /*private*/ _expr_140:any; +>_expr_140 : Symbol(_View_AppComponent0._expr_140, Decl(complexNarrowingWithAny.ts, 405, 28)) + + /*private*/ _expr_141:any; +>_expr_141 : Symbol(_View_AppComponent0._expr_141, Decl(complexNarrowingWithAny.ts, 406, 28)) + + /*private*/ _expr_142:any; +>_expr_142 : Symbol(_View_AppComponent0._expr_142, Decl(complexNarrowingWithAny.ts, 407, 28)) + + /*private*/ _expr_143:any; +>_expr_143 : Symbol(_View_AppComponent0._expr_143, Decl(complexNarrowingWithAny.ts, 408, 28)) + + /*private*/ _expr_146:any; +>_expr_146 : Symbol(_View_AppComponent0._expr_146, Decl(complexNarrowingWithAny.ts, 409, 28)) + + /*private*/ _expr_147:any; +>_expr_147 : Symbol(_View_AppComponent0._expr_147, Decl(complexNarrowingWithAny.ts, 410, 28)) + + /*private*/ _expr_148:any; +>_expr_148 : Symbol(_View_AppComponent0._expr_148, Decl(complexNarrowingWithAny.ts, 411, 28)) + + /*private*/ _expr_149:any; +>_expr_149 : Symbol(_View_AppComponent0._expr_149, Decl(complexNarrowingWithAny.ts, 412, 28)) + + /*private*/ _expr_150:any; +>_expr_150 : Symbol(_View_AppComponent0._expr_150, Decl(complexNarrowingWithAny.ts, 413, 28)) + + /*private*/ _expr_151:any; +>_expr_151 : Symbol(_View_AppComponent0._expr_151, Decl(complexNarrowingWithAny.ts, 414, 28)) + + /*private*/ _expr_152:any; +>_expr_152 : Symbol(_View_AppComponent0._expr_152, Decl(complexNarrowingWithAny.ts, 415, 28)) + + /*private*/ _expr_155:any; +>_expr_155 : Symbol(_View_AppComponent0._expr_155, Decl(complexNarrowingWithAny.ts, 416, 28)) + + /*private*/ _expr_156:any; +>_expr_156 : Symbol(_View_AppComponent0._expr_156, Decl(complexNarrowingWithAny.ts, 417, 28)) + + /*private*/ _expr_157:any; +>_expr_157 : Symbol(_View_AppComponent0._expr_157, Decl(complexNarrowingWithAny.ts, 418, 28)) + + /*private*/ _expr_158:any; +>_expr_158 : Symbol(_View_AppComponent0._expr_158, Decl(complexNarrowingWithAny.ts, 419, 28)) + + /*private*/ _expr_159:any; +>_expr_159 : Symbol(_View_AppComponent0._expr_159, Decl(complexNarrowingWithAny.ts, 420, 28)) + + /*private*/ _expr_160:any; +>_expr_160 : Symbol(_View_AppComponent0._expr_160, Decl(complexNarrowingWithAny.ts, 421, 28)) + + /*private*/ _expr_161:any; +>_expr_161 : Symbol(_View_AppComponent0._expr_161, Decl(complexNarrowingWithAny.ts, 422, 28)) + + /*private*/ _expr_164:any; +>_expr_164 : Symbol(_View_AppComponent0._expr_164, Decl(complexNarrowingWithAny.ts, 423, 28)) + + /*private*/ _expr_165:any; +>_expr_165 : Symbol(_View_AppComponent0._expr_165, Decl(complexNarrowingWithAny.ts, 424, 28)) + + /*private*/ _expr_166:any; +>_expr_166 : Symbol(_View_AppComponent0._expr_166, Decl(complexNarrowingWithAny.ts, 425, 28)) + + /*private*/ _expr_167:any; +>_expr_167 : Symbol(_View_AppComponent0._expr_167, Decl(complexNarrowingWithAny.ts, 426, 28)) + + /*private*/ _expr_168:any; +>_expr_168 : Symbol(_View_AppComponent0._expr_168, Decl(complexNarrowingWithAny.ts, 427, 28)) + + /*private*/ _expr_169:any; +>_expr_169 : Symbol(_View_AppComponent0._expr_169, Decl(complexNarrowingWithAny.ts, 428, 28)) + + /*private*/ _expr_170:any; +>_expr_170 : Symbol(_View_AppComponent0._expr_170, Decl(complexNarrowingWithAny.ts, 429, 28)) + + /*private*/ _expr_173:any; +>_expr_173 : Symbol(_View_AppComponent0._expr_173, Decl(complexNarrowingWithAny.ts, 430, 28)) + + /*private*/ _expr_174:any; +>_expr_174 : Symbol(_View_AppComponent0._expr_174, Decl(complexNarrowingWithAny.ts, 431, 28)) + + /*private*/ _expr_175:any; +>_expr_175 : Symbol(_View_AppComponent0._expr_175, Decl(complexNarrowingWithAny.ts, 432, 28)) + + /*private*/ _expr_176:any; +>_expr_176 : Symbol(_View_AppComponent0._expr_176, Decl(complexNarrowingWithAny.ts, 433, 28)) + + /*private*/ _expr_177:any; +>_expr_177 : Symbol(_View_AppComponent0._expr_177, Decl(complexNarrowingWithAny.ts, 434, 28)) + + /*private*/ _expr_178:any; +>_expr_178 : Symbol(_View_AppComponent0._expr_178, Decl(complexNarrowingWithAny.ts, 435, 28)) + + /*private*/ _expr_179:any; +>_expr_179 : Symbol(_View_AppComponent0._expr_179, Decl(complexNarrowingWithAny.ts, 436, 28)) + + /*private*/ _expr_182:any; +>_expr_182 : Symbol(_View_AppComponent0._expr_182, Decl(complexNarrowingWithAny.ts, 437, 28)) + + /*private*/ _expr_183:any; +>_expr_183 : Symbol(_View_AppComponent0._expr_183, Decl(complexNarrowingWithAny.ts, 438, 28)) + + /*private*/ _expr_184:any; +>_expr_184 : Symbol(_View_AppComponent0._expr_184, Decl(complexNarrowingWithAny.ts, 439, 28)) + + /*private*/ _expr_185:any; +>_expr_185 : Symbol(_View_AppComponent0._expr_185, Decl(complexNarrowingWithAny.ts, 440, 28)) + + /*private*/ _expr_186:any; +>_expr_186 : Symbol(_View_AppComponent0._expr_186, Decl(complexNarrowingWithAny.ts, 441, 28)) + + /*private*/ _expr_187:any; +>_expr_187 : Symbol(_View_AppComponent0._expr_187, Decl(complexNarrowingWithAny.ts, 442, 28)) + + /*private*/ _expr_188:any; +>_expr_188 : Symbol(_View_AppComponent0._expr_188, Decl(complexNarrowingWithAny.ts, 443, 28)) + + constructor(viewUtils:any,parentInjector:any,declarationEl:any) { +>viewUtils : Symbol(viewUtils, Decl(complexNarrowingWithAny.ts, 445, 14)) +>parentInjector : Symbol(parentInjector, Decl(complexNarrowingWithAny.ts, 445, 28)) +>declarationEl : Symbol(declarationEl, Decl(complexNarrowingWithAny.ts, 445, 47)) + } + + injectorGetInternal(token:any,requestNodeIndex:number,notFoundResult:any):any { +>injectorGetInternal : Symbol(_View_AppComponent0.injectorGetInternal, Decl(complexNarrowingWithAny.ts, 446, 3)) +>token : Symbol(token, Decl(complexNarrowingWithAny.ts, 448, 22)) +>requestNodeIndex : Symbol(requestNodeIndex, Decl(complexNarrowingWithAny.ts, 448, 32)) +>notFoundResult : Symbol(notFoundResult, Decl(complexNarrowingWithAny.ts, 448, 56)) + + if (((token === import46.DefaultValueAccessor) && (3 === requestNodeIndex))) { return this._DefaultValueAccessor_3_3; } +>token : Symbol(token, Decl(complexNarrowingWithAny.ts, 448, 22)) +>import46.DefaultValueAccessor : Symbol(import46.DefaultValueAccessor, Decl(complexNarrowingWithAny.ts, 78, 20)) +>import46 : Symbol(import46, Decl(complexNarrowingWithAny.ts, 76, 1)) +>DefaultValueAccessor : Symbol(import46.DefaultValueAccessor, Decl(complexNarrowingWithAny.ts, 78, 20)) +>requestNodeIndex : Symbol(requestNodeIndex, Decl(complexNarrowingWithAny.ts, 448, 32)) +>this._DefaultValueAccessor_3_3 : Symbol(_View_AppComponent0._DefaultValueAccessor_3_3, Decl(complexNarrowingWithAny.ts, 137, 12)) +>this : Symbol(_View_AppComponent0, Decl(complexNarrowingWithAny.ts, 126, 1)) +>_DefaultValueAccessor_3_3 : Symbol(_View_AppComponent0._DefaultValueAccessor_3_3, Decl(complexNarrowingWithAny.ts, 137, 12)) + + if (((token === import49.NG_VALUE_ACCESSOR) && (3 === requestNodeIndex))) { return this._NG_VALUE_ACCESSOR_3_4; } +>token : Symbol(token, Decl(complexNarrowingWithAny.ts, 448, 22)) +>import49.NG_VALUE_ACCESSOR : Symbol(import49.NG_VALUE_ACCESSOR, Decl(complexNarrowingWithAny.ts, 103, 11)) +>import49 : Symbol(import49, Decl(complexNarrowingWithAny.ts, 94, 1)) +>NG_VALUE_ACCESSOR : Symbol(import49.NG_VALUE_ACCESSOR, Decl(complexNarrowingWithAny.ts, 103, 11)) +>requestNodeIndex : Symbol(requestNodeIndex, Decl(complexNarrowingWithAny.ts, 448, 32)) +>this._NG_VALUE_ACCESSOR_3_4 : Symbol(_View_AppComponent0._NG_VALUE_ACCESSOR_3_4, Decl(complexNarrowingWithAny.ts, 138, 58)) +>this : Symbol(_View_AppComponent0, Decl(complexNarrowingWithAny.ts, 126, 1)) +>_NG_VALUE_ACCESSOR_3_4 : Symbol(_View_AppComponent0._NG_VALUE_ACCESSOR_3_4, Decl(complexNarrowingWithAny.ts, 138, 58)) + + if (((token === import47.FormControlName) && (3 === requestNodeIndex))) { return this._FormControlName_3_5; } +>token : Symbol(token, Decl(complexNarrowingWithAny.ts, 448, 22)) +>import47.FormControlName : Symbol(import47.FormControlName, Decl(complexNarrowingWithAny.ts, 84, 20)) +>import47 : Symbol(import47, Decl(complexNarrowingWithAny.ts, 82, 1)) +>FormControlName : Symbol(import47.FormControlName, Decl(complexNarrowingWithAny.ts, 84, 20)) +>requestNodeIndex : Symbol(requestNodeIndex, Decl(complexNarrowingWithAny.ts, 448, 32)) +>this._FormControlName_3_5 : Symbol(_View_AppComponent0._FormControlName_3_5, Decl(complexNarrowingWithAny.ts, 139, 31)) +>this : Symbol(_View_AppComponent0, Decl(complexNarrowingWithAny.ts, 126, 1)) +>_FormControlName_3_5 : Symbol(_View_AppComponent0._FormControlName_3_5, Decl(complexNarrowingWithAny.ts, 139, 31)) + + if (((token === import50.NgControl) && (3 === requestNodeIndex))) { return this._NgControl_3_6; } +>token : Symbol(token, Decl(complexNarrowingWithAny.ts, 448, 22)) +>import50.NgControl : Symbol(import50.NgControl, Decl(complexNarrowingWithAny.ts, 116, 20)) +>import50 : Symbol(import50, Decl(complexNarrowingWithAny.ts, 104, 1)) +>NgControl : Symbol(import50.NgControl, Decl(complexNarrowingWithAny.ts, 116, 20)) +>requestNodeIndex : Symbol(requestNodeIndex, Decl(complexNarrowingWithAny.ts, 448, 32)) +>this._NgControl_3_6 : Symbol(_View_AppComponent0._NgControl_3_6, Decl(complexNarrowingWithAny.ts, 140, 48)) +>this : Symbol(_View_AppComponent0, Decl(complexNarrowingWithAny.ts, 126, 1)) +>_NgControl_3_6 : Symbol(_View_AppComponent0._NgControl_3_6, Decl(complexNarrowingWithAny.ts, 140, 48)) + + if (((token === import45.NgControlStatus) && (3 === requestNodeIndex))) { return this._NgControlStatus_3_7; } +>token : Symbol(token, Decl(complexNarrowingWithAny.ts, 448, 22)) +>import45.NgControlStatus : Symbol(import45.NgControlStatus, Decl(complexNarrowingWithAny.ts, 69, 20)) +>import45 : Symbol(import45, Decl(complexNarrowingWithAny.ts, 67, 1)) +>NgControlStatus : Symbol(import45.NgControlStatus, Decl(complexNarrowingWithAny.ts, 69, 20)) +>requestNodeIndex : Symbol(requestNodeIndex, Decl(complexNarrowingWithAny.ts, 448, 32)) +>this._NgControlStatus_3_7 : Symbol(_View_AppComponent0._NgControlStatus_3_7, Decl(complexNarrowingWithAny.ts, 141, 21)) +>this : Symbol(_View_AppComponent0, Decl(complexNarrowingWithAny.ts, 126, 1)) +>_NgControlStatus_3_7 : Symbol(_View_AppComponent0._NgControlStatus_3_7, Decl(complexNarrowingWithAny.ts, 141, 21)) + + if (((token === import46.DefaultValueAccessor) && (6 === requestNodeIndex))) { return this._DefaultValueAccessor_6_3; } +>token : Symbol(token, Decl(complexNarrowingWithAny.ts, 448, 22)) +>import46.DefaultValueAccessor : Symbol(import46.DefaultValueAccessor, Decl(complexNarrowingWithAny.ts, 78, 20)) +>import46 : Symbol(import46, Decl(complexNarrowingWithAny.ts, 76, 1)) +>DefaultValueAccessor : Symbol(import46.DefaultValueAccessor, Decl(complexNarrowingWithAny.ts, 78, 20)) +>requestNodeIndex : Symbol(requestNodeIndex, Decl(complexNarrowingWithAny.ts, 448, 32)) +>this._DefaultValueAccessor_6_3 : Symbol(_View_AppComponent0._DefaultValueAccessor_6_3, Decl(complexNarrowingWithAny.ts, 145, 12)) +>this : Symbol(_View_AppComponent0, Decl(complexNarrowingWithAny.ts, 126, 1)) +>_DefaultValueAccessor_6_3 : Symbol(_View_AppComponent0._DefaultValueAccessor_6_3, Decl(complexNarrowingWithAny.ts, 145, 12)) + + if (((token === import49.NG_VALUE_ACCESSOR) && (6 === requestNodeIndex))) { return this._NG_VALUE_ACCESSOR_6_4; } +>token : Symbol(token, Decl(complexNarrowingWithAny.ts, 448, 22)) +>import49.NG_VALUE_ACCESSOR : Symbol(import49.NG_VALUE_ACCESSOR, Decl(complexNarrowingWithAny.ts, 103, 11)) +>import49 : Symbol(import49, Decl(complexNarrowingWithAny.ts, 94, 1)) +>NG_VALUE_ACCESSOR : Symbol(import49.NG_VALUE_ACCESSOR, Decl(complexNarrowingWithAny.ts, 103, 11)) +>requestNodeIndex : Symbol(requestNodeIndex, Decl(complexNarrowingWithAny.ts, 448, 32)) +>this._NG_VALUE_ACCESSOR_6_4 : Symbol(_View_AppComponent0._NG_VALUE_ACCESSOR_6_4, Decl(complexNarrowingWithAny.ts, 146, 58)) +>this : Symbol(_View_AppComponent0, Decl(complexNarrowingWithAny.ts, 126, 1)) +>_NG_VALUE_ACCESSOR_6_4 : Symbol(_View_AppComponent0._NG_VALUE_ACCESSOR_6_4, Decl(complexNarrowingWithAny.ts, 146, 58)) + + if (((token === import47.FormControlName) && (6 === requestNodeIndex))) { return this._FormControlName_6_5; } +>token : Symbol(token, Decl(complexNarrowingWithAny.ts, 448, 22)) +>import47.FormControlName : Symbol(import47.FormControlName, Decl(complexNarrowingWithAny.ts, 84, 20)) +>import47 : Symbol(import47, Decl(complexNarrowingWithAny.ts, 82, 1)) +>FormControlName : Symbol(import47.FormControlName, Decl(complexNarrowingWithAny.ts, 84, 20)) +>requestNodeIndex : Symbol(requestNodeIndex, Decl(complexNarrowingWithAny.ts, 448, 32)) +>this._FormControlName_6_5 : Symbol(_View_AppComponent0._FormControlName_6_5, Decl(complexNarrowingWithAny.ts, 147, 31)) +>this : Symbol(_View_AppComponent0, Decl(complexNarrowingWithAny.ts, 126, 1)) +>_FormControlName_6_5 : Symbol(_View_AppComponent0._FormControlName_6_5, Decl(complexNarrowingWithAny.ts, 147, 31)) + + if (((token === import50.NgControl) && (6 === requestNodeIndex))) { return this._NgControl_6_6; } +>token : Symbol(token, Decl(complexNarrowingWithAny.ts, 448, 22)) +>import50.NgControl : Symbol(import50.NgControl, Decl(complexNarrowingWithAny.ts, 116, 20)) +>import50 : Symbol(import50, Decl(complexNarrowingWithAny.ts, 104, 1)) +>NgControl : Symbol(import50.NgControl, Decl(complexNarrowingWithAny.ts, 116, 20)) +>requestNodeIndex : Symbol(requestNodeIndex, Decl(complexNarrowingWithAny.ts, 448, 32)) +>this._NgControl_6_6 : Symbol(_View_AppComponent0._NgControl_6_6, Decl(complexNarrowingWithAny.ts, 148, 48)) +>this : Symbol(_View_AppComponent0, Decl(complexNarrowingWithAny.ts, 126, 1)) +>_NgControl_6_6 : Symbol(_View_AppComponent0._NgControl_6_6, Decl(complexNarrowingWithAny.ts, 148, 48)) + + if (((token === import45.NgControlStatus) && (6 === requestNodeIndex))) { return this._NgControlStatus_6_7; } +>token : Symbol(token, Decl(complexNarrowingWithAny.ts, 448, 22)) +>import45.NgControlStatus : Symbol(import45.NgControlStatus, Decl(complexNarrowingWithAny.ts, 69, 20)) +>import45 : Symbol(import45, Decl(complexNarrowingWithAny.ts, 67, 1)) +>NgControlStatus : Symbol(import45.NgControlStatus, Decl(complexNarrowingWithAny.ts, 69, 20)) +>requestNodeIndex : Symbol(requestNodeIndex, Decl(complexNarrowingWithAny.ts, 448, 32)) +>this._NgControlStatus_6_7 : Symbol(_View_AppComponent0._NgControlStatus_6_7, Decl(complexNarrowingWithAny.ts, 149, 21)) +>this : Symbol(_View_AppComponent0, Decl(complexNarrowingWithAny.ts, 126, 1)) +>_NgControlStatus_6_7 : Symbol(_View_AppComponent0._NgControlStatus_6_7, Decl(complexNarrowingWithAny.ts, 149, 21)) + + if (((token === import46.DefaultValueAccessor) && (9 === requestNodeIndex))) { return this._DefaultValueAccessor_9_3; } +>token : Symbol(token, Decl(complexNarrowingWithAny.ts, 448, 22)) +>import46.DefaultValueAccessor : Symbol(import46.DefaultValueAccessor, Decl(complexNarrowingWithAny.ts, 78, 20)) +>import46 : Symbol(import46, Decl(complexNarrowingWithAny.ts, 76, 1)) +>DefaultValueAccessor : Symbol(import46.DefaultValueAccessor, Decl(complexNarrowingWithAny.ts, 78, 20)) +>requestNodeIndex : Symbol(requestNodeIndex, Decl(complexNarrowingWithAny.ts, 448, 32)) +>this._DefaultValueAccessor_9_3 : Symbol(_View_AppComponent0._DefaultValueAccessor_9_3, Decl(complexNarrowingWithAny.ts, 153, 12)) +>this : Symbol(_View_AppComponent0, Decl(complexNarrowingWithAny.ts, 126, 1)) +>_DefaultValueAccessor_9_3 : Symbol(_View_AppComponent0._DefaultValueAccessor_9_3, Decl(complexNarrowingWithAny.ts, 153, 12)) + + if (((token === import49.NG_VALUE_ACCESSOR) && (9 === requestNodeIndex))) { return this._NG_VALUE_ACCESSOR_9_4; } +>token : Symbol(token, Decl(complexNarrowingWithAny.ts, 448, 22)) +>import49.NG_VALUE_ACCESSOR : Symbol(import49.NG_VALUE_ACCESSOR, Decl(complexNarrowingWithAny.ts, 103, 11)) +>import49 : Symbol(import49, Decl(complexNarrowingWithAny.ts, 94, 1)) +>NG_VALUE_ACCESSOR : Symbol(import49.NG_VALUE_ACCESSOR, Decl(complexNarrowingWithAny.ts, 103, 11)) +>requestNodeIndex : Symbol(requestNodeIndex, Decl(complexNarrowingWithAny.ts, 448, 32)) +>this._NG_VALUE_ACCESSOR_9_4 : Symbol(_View_AppComponent0._NG_VALUE_ACCESSOR_9_4, Decl(complexNarrowingWithAny.ts, 154, 58)) +>this : Symbol(_View_AppComponent0, Decl(complexNarrowingWithAny.ts, 126, 1)) +>_NG_VALUE_ACCESSOR_9_4 : Symbol(_View_AppComponent0._NG_VALUE_ACCESSOR_9_4, Decl(complexNarrowingWithAny.ts, 154, 58)) + + if (((token === import47.FormControlName) && (9 === requestNodeIndex))) { return this._FormControlName_9_5; } +>token : Symbol(token, Decl(complexNarrowingWithAny.ts, 448, 22)) +>import47.FormControlName : Symbol(import47.FormControlName, Decl(complexNarrowingWithAny.ts, 84, 20)) +>import47 : Symbol(import47, Decl(complexNarrowingWithAny.ts, 82, 1)) +>FormControlName : Symbol(import47.FormControlName, Decl(complexNarrowingWithAny.ts, 84, 20)) +>requestNodeIndex : Symbol(requestNodeIndex, Decl(complexNarrowingWithAny.ts, 448, 32)) +>this._FormControlName_9_5 : Symbol(_View_AppComponent0._FormControlName_9_5, Decl(complexNarrowingWithAny.ts, 155, 31)) +>this : Symbol(_View_AppComponent0, Decl(complexNarrowingWithAny.ts, 126, 1)) +>_FormControlName_9_5 : Symbol(_View_AppComponent0._FormControlName_9_5, Decl(complexNarrowingWithAny.ts, 155, 31)) + + if (((token === import50.NgControl) && (9 === requestNodeIndex))) { return this._NgControl_9_6; } +>token : Symbol(token, Decl(complexNarrowingWithAny.ts, 448, 22)) +>import50.NgControl : Symbol(import50.NgControl, Decl(complexNarrowingWithAny.ts, 116, 20)) +>import50 : Symbol(import50, Decl(complexNarrowingWithAny.ts, 104, 1)) +>NgControl : Symbol(import50.NgControl, Decl(complexNarrowingWithAny.ts, 116, 20)) +>requestNodeIndex : Symbol(requestNodeIndex, Decl(complexNarrowingWithAny.ts, 448, 32)) +>this._NgControl_9_6 : Symbol(_View_AppComponent0._NgControl_9_6, Decl(complexNarrowingWithAny.ts, 156, 48)) +>this : Symbol(_View_AppComponent0, Decl(complexNarrowingWithAny.ts, 126, 1)) +>_NgControl_9_6 : Symbol(_View_AppComponent0._NgControl_9_6, Decl(complexNarrowingWithAny.ts, 156, 48)) + + if (((token === import45.NgControlStatus) && (9 === requestNodeIndex))) { return this._NgControlStatus_9_7; } +>token : Symbol(token, Decl(complexNarrowingWithAny.ts, 448, 22)) +>import45.NgControlStatus : Symbol(import45.NgControlStatus, Decl(complexNarrowingWithAny.ts, 69, 20)) +>import45 : Symbol(import45, Decl(complexNarrowingWithAny.ts, 67, 1)) +>NgControlStatus : Symbol(import45.NgControlStatus, Decl(complexNarrowingWithAny.ts, 69, 20)) +>requestNodeIndex : Symbol(requestNodeIndex, Decl(complexNarrowingWithAny.ts, 448, 32)) +>this._NgControlStatus_9_7 : Symbol(_View_AppComponent0._NgControlStatus_9_7, Decl(complexNarrowingWithAny.ts, 157, 21)) +>this : Symbol(_View_AppComponent0, Decl(complexNarrowingWithAny.ts, 126, 1)) +>_NgControlStatus_9_7 : Symbol(_View_AppComponent0._NgControlStatus_9_7, Decl(complexNarrowingWithAny.ts, 157, 21)) + + if (((token === import46.DefaultValueAccessor) && (12 === requestNodeIndex))) { return this._DefaultValueAccessor_12_3; } +>token : Symbol(token, Decl(complexNarrowingWithAny.ts, 448, 22)) +>import46.DefaultValueAccessor : Symbol(import46.DefaultValueAccessor, Decl(complexNarrowingWithAny.ts, 78, 20)) +>import46 : Symbol(import46, Decl(complexNarrowingWithAny.ts, 76, 1)) +>DefaultValueAccessor : Symbol(import46.DefaultValueAccessor, Decl(complexNarrowingWithAny.ts, 78, 20)) +>requestNodeIndex : Symbol(requestNodeIndex, Decl(complexNarrowingWithAny.ts, 448, 32)) +>this._DefaultValueAccessor_12_3 : Symbol(_View_AppComponent0._DefaultValueAccessor_12_3, Decl(complexNarrowingWithAny.ts, 161, 13)) +>this : Symbol(_View_AppComponent0, Decl(complexNarrowingWithAny.ts, 126, 1)) +>_DefaultValueAccessor_12_3 : Symbol(_View_AppComponent0._DefaultValueAccessor_12_3, Decl(complexNarrowingWithAny.ts, 161, 13)) + + if (((token === import49.NG_VALUE_ACCESSOR) && (12 === requestNodeIndex))) { return this._NG_VALUE_ACCESSOR_12_4; } +>token : Symbol(token, Decl(complexNarrowingWithAny.ts, 448, 22)) +>import49.NG_VALUE_ACCESSOR : Symbol(import49.NG_VALUE_ACCESSOR, Decl(complexNarrowingWithAny.ts, 103, 11)) +>import49 : Symbol(import49, Decl(complexNarrowingWithAny.ts, 94, 1)) +>NG_VALUE_ACCESSOR : Symbol(import49.NG_VALUE_ACCESSOR, Decl(complexNarrowingWithAny.ts, 103, 11)) +>requestNodeIndex : Symbol(requestNodeIndex, Decl(complexNarrowingWithAny.ts, 448, 32)) +>this._NG_VALUE_ACCESSOR_12_4 : Symbol(_View_AppComponent0._NG_VALUE_ACCESSOR_12_4, Decl(complexNarrowingWithAny.ts, 162, 59)) +>this : Symbol(_View_AppComponent0, Decl(complexNarrowingWithAny.ts, 126, 1)) +>_NG_VALUE_ACCESSOR_12_4 : Symbol(_View_AppComponent0._NG_VALUE_ACCESSOR_12_4, Decl(complexNarrowingWithAny.ts, 162, 59)) + + if (((token === import47.FormControlName) && (12 === requestNodeIndex))) { return this._FormControlName_12_5; } +>token : Symbol(token, Decl(complexNarrowingWithAny.ts, 448, 22)) +>import47.FormControlName : Symbol(import47.FormControlName, Decl(complexNarrowingWithAny.ts, 84, 20)) +>import47 : Symbol(import47, Decl(complexNarrowingWithAny.ts, 82, 1)) +>FormControlName : Symbol(import47.FormControlName, Decl(complexNarrowingWithAny.ts, 84, 20)) +>requestNodeIndex : Symbol(requestNodeIndex, Decl(complexNarrowingWithAny.ts, 448, 32)) +>this._FormControlName_12_5 : Symbol(_View_AppComponent0._FormControlName_12_5, Decl(complexNarrowingWithAny.ts, 163, 32)) +>this : Symbol(_View_AppComponent0, Decl(complexNarrowingWithAny.ts, 126, 1)) +>_FormControlName_12_5 : Symbol(_View_AppComponent0._FormControlName_12_5, Decl(complexNarrowingWithAny.ts, 163, 32)) + + if (((token === import50.NgControl) && (12 === requestNodeIndex))) { return this._NgControl_12_6; } +>token : Symbol(token, Decl(complexNarrowingWithAny.ts, 448, 22)) +>import50.NgControl : Symbol(import50.NgControl, Decl(complexNarrowingWithAny.ts, 116, 20)) +>import50 : Symbol(import50, Decl(complexNarrowingWithAny.ts, 104, 1)) +>NgControl : Symbol(import50.NgControl, Decl(complexNarrowingWithAny.ts, 116, 20)) +>requestNodeIndex : Symbol(requestNodeIndex, Decl(complexNarrowingWithAny.ts, 448, 32)) +>this._NgControl_12_6 : Symbol(_View_AppComponent0._NgControl_12_6, Decl(complexNarrowingWithAny.ts, 164, 49)) +>this : Symbol(_View_AppComponent0, Decl(complexNarrowingWithAny.ts, 126, 1)) +>_NgControl_12_6 : Symbol(_View_AppComponent0._NgControl_12_6, Decl(complexNarrowingWithAny.ts, 164, 49)) + + if (((token === import45.NgControlStatus) && (12 === requestNodeIndex))) { return this._NgControlStatus_12_7; } +>token : Symbol(token, Decl(complexNarrowingWithAny.ts, 448, 22)) +>import45.NgControlStatus : Symbol(import45.NgControlStatus, Decl(complexNarrowingWithAny.ts, 69, 20)) +>import45 : Symbol(import45, Decl(complexNarrowingWithAny.ts, 67, 1)) +>NgControlStatus : Symbol(import45.NgControlStatus, Decl(complexNarrowingWithAny.ts, 69, 20)) +>requestNodeIndex : Symbol(requestNodeIndex, Decl(complexNarrowingWithAny.ts, 448, 32)) +>this._NgControlStatus_12_7 : Symbol(_View_AppComponent0._NgControlStatus_12_7, Decl(complexNarrowingWithAny.ts, 165, 22)) +>this : Symbol(_View_AppComponent0, Decl(complexNarrowingWithAny.ts, 126, 1)) +>_NgControlStatus_12_7 : Symbol(_View_AppComponent0._NgControlStatus_12_7, Decl(complexNarrowingWithAny.ts, 165, 22)) + + if (((token === import46.DefaultValueAccessor) && (15 === requestNodeIndex))) { return this._DefaultValueAccessor_15_3; } +>token : Symbol(token, Decl(complexNarrowingWithAny.ts, 448, 22)) +>import46.DefaultValueAccessor : Symbol(import46.DefaultValueAccessor, Decl(complexNarrowingWithAny.ts, 78, 20)) +>import46 : Symbol(import46, Decl(complexNarrowingWithAny.ts, 76, 1)) +>DefaultValueAccessor : Symbol(import46.DefaultValueAccessor, Decl(complexNarrowingWithAny.ts, 78, 20)) +>requestNodeIndex : Symbol(requestNodeIndex, Decl(complexNarrowingWithAny.ts, 448, 32)) +>this._DefaultValueAccessor_15_3 : Symbol(_View_AppComponent0._DefaultValueAccessor_15_3, Decl(complexNarrowingWithAny.ts, 169, 13)) +>this : Symbol(_View_AppComponent0, Decl(complexNarrowingWithAny.ts, 126, 1)) +>_DefaultValueAccessor_15_3 : Symbol(_View_AppComponent0._DefaultValueAccessor_15_3, Decl(complexNarrowingWithAny.ts, 169, 13)) + + if (((token === import49.NG_VALUE_ACCESSOR) && (15 === requestNodeIndex))) { return this._NG_VALUE_ACCESSOR_15_4; } +>token : Symbol(token, Decl(complexNarrowingWithAny.ts, 448, 22)) +>import49.NG_VALUE_ACCESSOR : Symbol(import49.NG_VALUE_ACCESSOR, Decl(complexNarrowingWithAny.ts, 103, 11)) +>import49 : Symbol(import49, Decl(complexNarrowingWithAny.ts, 94, 1)) +>NG_VALUE_ACCESSOR : Symbol(import49.NG_VALUE_ACCESSOR, Decl(complexNarrowingWithAny.ts, 103, 11)) +>requestNodeIndex : Symbol(requestNodeIndex, Decl(complexNarrowingWithAny.ts, 448, 32)) +>this._NG_VALUE_ACCESSOR_15_4 : Symbol(_View_AppComponent0._NG_VALUE_ACCESSOR_15_4, Decl(complexNarrowingWithAny.ts, 170, 59)) +>this : Symbol(_View_AppComponent0, Decl(complexNarrowingWithAny.ts, 126, 1)) +>_NG_VALUE_ACCESSOR_15_4 : Symbol(_View_AppComponent0._NG_VALUE_ACCESSOR_15_4, Decl(complexNarrowingWithAny.ts, 170, 59)) + + if (((token === import47.FormControlName) && (15 === requestNodeIndex))) { return this._FormControlName_15_5; } +>token : Symbol(token, Decl(complexNarrowingWithAny.ts, 448, 22)) +>import47.FormControlName : Symbol(import47.FormControlName, Decl(complexNarrowingWithAny.ts, 84, 20)) +>import47 : Symbol(import47, Decl(complexNarrowingWithAny.ts, 82, 1)) +>FormControlName : Symbol(import47.FormControlName, Decl(complexNarrowingWithAny.ts, 84, 20)) +>requestNodeIndex : Symbol(requestNodeIndex, Decl(complexNarrowingWithAny.ts, 448, 32)) +>this._FormControlName_15_5 : Symbol(_View_AppComponent0._FormControlName_15_5, Decl(complexNarrowingWithAny.ts, 171, 32)) +>this : Symbol(_View_AppComponent0, Decl(complexNarrowingWithAny.ts, 126, 1)) +>_FormControlName_15_5 : Symbol(_View_AppComponent0._FormControlName_15_5, Decl(complexNarrowingWithAny.ts, 171, 32)) + + if (((token === import50.NgControl) && (15 === requestNodeIndex))) { return this._NgControl_15_6; } +>token : Symbol(token, Decl(complexNarrowingWithAny.ts, 448, 22)) +>import50.NgControl : Symbol(import50.NgControl, Decl(complexNarrowingWithAny.ts, 116, 20)) +>import50 : Symbol(import50, Decl(complexNarrowingWithAny.ts, 104, 1)) +>NgControl : Symbol(import50.NgControl, Decl(complexNarrowingWithAny.ts, 116, 20)) +>requestNodeIndex : Symbol(requestNodeIndex, Decl(complexNarrowingWithAny.ts, 448, 32)) +>this._NgControl_15_6 : Symbol(_View_AppComponent0._NgControl_15_6, Decl(complexNarrowingWithAny.ts, 172, 49)) +>this : Symbol(_View_AppComponent0, Decl(complexNarrowingWithAny.ts, 126, 1)) +>_NgControl_15_6 : Symbol(_View_AppComponent0._NgControl_15_6, Decl(complexNarrowingWithAny.ts, 172, 49)) + + if (((token === import45.NgControlStatus) && (15 === requestNodeIndex))) { return this._NgControlStatus_15_7; } +>token : Symbol(token, Decl(complexNarrowingWithAny.ts, 448, 22)) +>import45.NgControlStatus : Symbol(import45.NgControlStatus, Decl(complexNarrowingWithAny.ts, 69, 20)) +>import45 : Symbol(import45, Decl(complexNarrowingWithAny.ts, 67, 1)) +>NgControlStatus : Symbol(import45.NgControlStatus, Decl(complexNarrowingWithAny.ts, 69, 20)) +>requestNodeIndex : Symbol(requestNodeIndex, Decl(complexNarrowingWithAny.ts, 448, 32)) +>this._NgControlStatus_15_7 : Symbol(_View_AppComponent0._NgControlStatus_15_7, Decl(complexNarrowingWithAny.ts, 173, 22)) +>this : Symbol(_View_AppComponent0, Decl(complexNarrowingWithAny.ts, 126, 1)) +>_NgControlStatus_15_7 : Symbol(_View_AppComponent0._NgControlStatus_15_7, Decl(complexNarrowingWithAny.ts, 173, 22)) + + if (((token === import46.DefaultValueAccessor) && (18 === requestNodeIndex))) { return this._DefaultValueAccessor_18_3; } +>token : Symbol(token, Decl(complexNarrowingWithAny.ts, 448, 22)) +>import46.DefaultValueAccessor : Symbol(import46.DefaultValueAccessor, Decl(complexNarrowingWithAny.ts, 78, 20)) +>import46 : Symbol(import46, Decl(complexNarrowingWithAny.ts, 76, 1)) +>DefaultValueAccessor : Symbol(import46.DefaultValueAccessor, Decl(complexNarrowingWithAny.ts, 78, 20)) +>requestNodeIndex : Symbol(requestNodeIndex, Decl(complexNarrowingWithAny.ts, 448, 32)) +>this._DefaultValueAccessor_18_3 : Symbol(_View_AppComponent0._DefaultValueAccessor_18_3, Decl(complexNarrowingWithAny.ts, 177, 13)) +>this : Symbol(_View_AppComponent0, Decl(complexNarrowingWithAny.ts, 126, 1)) +>_DefaultValueAccessor_18_3 : Symbol(_View_AppComponent0._DefaultValueAccessor_18_3, Decl(complexNarrowingWithAny.ts, 177, 13)) + + if (((token === import49.NG_VALUE_ACCESSOR) && (18 === requestNodeIndex))) { return this._NG_VALUE_ACCESSOR_18_4; } +>token : Symbol(token, Decl(complexNarrowingWithAny.ts, 448, 22)) +>import49.NG_VALUE_ACCESSOR : Symbol(import49.NG_VALUE_ACCESSOR, Decl(complexNarrowingWithAny.ts, 103, 11)) +>import49 : Symbol(import49, Decl(complexNarrowingWithAny.ts, 94, 1)) +>NG_VALUE_ACCESSOR : Symbol(import49.NG_VALUE_ACCESSOR, Decl(complexNarrowingWithAny.ts, 103, 11)) +>requestNodeIndex : Symbol(requestNodeIndex, Decl(complexNarrowingWithAny.ts, 448, 32)) +>this._NG_VALUE_ACCESSOR_18_4 : Symbol(_View_AppComponent0._NG_VALUE_ACCESSOR_18_4, Decl(complexNarrowingWithAny.ts, 178, 59)) +>this : Symbol(_View_AppComponent0, Decl(complexNarrowingWithAny.ts, 126, 1)) +>_NG_VALUE_ACCESSOR_18_4 : Symbol(_View_AppComponent0._NG_VALUE_ACCESSOR_18_4, Decl(complexNarrowingWithAny.ts, 178, 59)) + + if (((token === import47.FormControlName) && (18 === requestNodeIndex))) { return this._FormControlName_18_5; } +>token : Symbol(token, Decl(complexNarrowingWithAny.ts, 448, 22)) +>import47.FormControlName : Symbol(import47.FormControlName, Decl(complexNarrowingWithAny.ts, 84, 20)) +>import47 : Symbol(import47, Decl(complexNarrowingWithAny.ts, 82, 1)) +>FormControlName : Symbol(import47.FormControlName, Decl(complexNarrowingWithAny.ts, 84, 20)) +>requestNodeIndex : Symbol(requestNodeIndex, Decl(complexNarrowingWithAny.ts, 448, 32)) +>this._FormControlName_18_5 : Symbol(_View_AppComponent0._FormControlName_18_5, Decl(complexNarrowingWithAny.ts, 179, 32)) +>this : Symbol(_View_AppComponent0, Decl(complexNarrowingWithAny.ts, 126, 1)) +>_FormControlName_18_5 : Symbol(_View_AppComponent0._FormControlName_18_5, Decl(complexNarrowingWithAny.ts, 179, 32)) + + if (((token === import50.NgControl) && (18 === requestNodeIndex))) { return this._NgControl_18_6; } +>token : Symbol(token, Decl(complexNarrowingWithAny.ts, 448, 22)) +>import50.NgControl : Symbol(import50.NgControl, Decl(complexNarrowingWithAny.ts, 116, 20)) +>import50 : Symbol(import50, Decl(complexNarrowingWithAny.ts, 104, 1)) +>NgControl : Symbol(import50.NgControl, Decl(complexNarrowingWithAny.ts, 116, 20)) +>requestNodeIndex : Symbol(requestNodeIndex, Decl(complexNarrowingWithAny.ts, 448, 32)) +>this._NgControl_18_6 : Symbol(_View_AppComponent0._NgControl_18_6, Decl(complexNarrowingWithAny.ts, 180, 49)) +>this : Symbol(_View_AppComponent0, Decl(complexNarrowingWithAny.ts, 126, 1)) +>_NgControl_18_6 : Symbol(_View_AppComponent0._NgControl_18_6, Decl(complexNarrowingWithAny.ts, 180, 49)) + + if (((token === import45.NgControlStatus) && (18 === requestNodeIndex))) { return this._NgControlStatus_18_7; } +>token : Symbol(token, Decl(complexNarrowingWithAny.ts, 448, 22)) +>import45.NgControlStatus : Symbol(import45.NgControlStatus, Decl(complexNarrowingWithAny.ts, 69, 20)) +>import45 : Symbol(import45, Decl(complexNarrowingWithAny.ts, 67, 1)) +>NgControlStatus : Symbol(import45.NgControlStatus, Decl(complexNarrowingWithAny.ts, 69, 20)) +>requestNodeIndex : Symbol(requestNodeIndex, Decl(complexNarrowingWithAny.ts, 448, 32)) +>this._NgControlStatus_18_7 : Symbol(_View_AppComponent0._NgControlStatus_18_7, Decl(complexNarrowingWithAny.ts, 181, 22)) +>this : Symbol(_View_AppComponent0, Decl(complexNarrowingWithAny.ts, 126, 1)) +>_NgControlStatus_18_7 : Symbol(_View_AppComponent0._NgControlStatus_18_7, Decl(complexNarrowingWithAny.ts, 181, 22)) + + if (((token === import46.DefaultValueAccessor) && (21 === requestNodeIndex))) { return this._DefaultValueAccessor_21_3; } +>token : Symbol(token, Decl(complexNarrowingWithAny.ts, 448, 22)) +>import46.DefaultValueAccessor : Symbol(import46.DefaultValueAccessor, Decl(complexNarrowingWithAny.ts, 78, 20)) +>import46 : Symbol(import46, Decl(complexNarrowingWithAny.ts, 76, 1)) +>DefaultValueAccessor : Symbol(import46.DefaultValueAccessor, Decl(complexNarrowingWithAny.ts, 78, 20)) +>requestNodeIndex : Symbol(requestNodeIndex, Decl(complexNarrowingWithAny.ts, 448, 32)) +>this._DefaultValueAccessor_21_3 : Symbol(_View_AppComponent0._DefaultValueAccessor_21_3, Decl(complexNarrowingWithAny.ts, 185, 13)) +>this : Symbol(_View_AppComponent0, Decl(complexNarrowingWithAny.ts, 126, 1)) +>_DefaultValueAccessor_21_3 : Symbol(_View_AppComponent0._DefaultValueAccessor_21_3, Decl(complexNarrowingWithAny.ts, 185, 13)) + + if (((token === import49.NG_VALUE_ACCESSOR) && (21 === requestNodeIndex))) { return this._NG_VALUE_ACCESSOR_21_4; } +>token : Symbol(token, Decl(complexNarrowingWithAny.ts, 448, 22)) +>import49.NG_VALUE_ACCESSOR : Symbol(import49.NG_VALUE_ACCESSOR, Decl(complexNarrowingWithAny.ts, 103, 11)) +>import49 : Symbol(import49, Decl(complexNarrowingWithAny.ts, 94, 1)) +>NG_VALUE_ACCESSOR : Symbol(import49.NG_VALUE_ACCESSOR, Decl(complexNarrowingWithAny.ts, 103, 11)) +>requestNodeIndex : Symbol(requestNodeIndex, Decl(complexNarrowingWithAny.ts, 448, 32)) +>this._NG_VALUE_ACCESSOR_21_4 : Symbol(_View_AppComponent0._NG_VALUE_ACCESSOR_21_4, Decl(complexNarrowingWithAny.ts, 186, 59)) +>this : Symbol(_View_AppComponent0, Decl(complexNarrowingWithAny.ts, 126, 1)) +>_NG_VALUE_ACCESSOR_21_4 : Symbol(_View_AppComponent0._NG_VALUE_ACCESSOR_21_4, Decl(complexNarrowingWithAny.ts, 186, 59)) + + if (((token === import47.FormControlName) && (21 === requestNodeIndex))) { return this._FormControlName_21_5; } +>token : Symbol(token, Decl(complexNarrowingWithAny.ts, 448, 22)) +>import47.FormControlName : Symbol(import47.FormControlName, Decl(complexNarrowingWithAny.ts, 84, 20)) +>import47 : Symbol(import47, Decl(complexNarrowingWithAny.ts, 82, 1)) +>FormControlName : Symbol(import47.FormControlName, Decl(complexNarrowingWithAny.ts, 84, 20)) +>requestNodeIndex : Symbol(requestNodeIndex, Decl(complexNarrowingWithAny.ts, 448, 32)) +>this._FormControlName_21_5 : Symbol(_View_AppComponent0._FormControlName_21_5, Decl(complexNarrowingWithAny.ts, 187, 32)) +>this : Symbol(_View_AppComponent0, Decl(complexNarrowingWithAny.ts, 126, 1)) +>_FormControlName_21_5 : Symbol(_View_AppComponent0._FormControlName_21_5, Decl(complexNarrowingWithAny.ts, 187, 32)) + + if (((token === import50.NgControl) && (21 === requestNodeIndex))) { return this._NgControl_21_6; } +>token : Symbol(token, Decl(complexNarrowingWithAny.ts, 448, 22)) +>import50.NgControl : Symbol(import50.NgControl, Decl(complexNarrowingWithAny.ts, 116, 20)) +>import50 : Symbol(import50, Decl(complexNarrowingWithAny.ts, 104, 1)) +>NgControl : Symbol(import50.NgControl, Decl(complexNarrowingWithAny.ts, 116, 20)) +>requestNodeIndex : Symbol(requestNodeIndex, Decl(complexNarrowingWithAny.ts, 448, 32)) +>this._NgControl_21_6 : Symbol(_View_AppComponent0._NgControl_21_6, Decl(complexNarrowingWithAny.ts, 188, 49)) +>this : Symbol(_View_AppComponent0, Decl(complexNarrowingWithAny.ts, 126, 1)) +>_NgControl_21_6 : Symbol(_View_AppComponent0._NgControl_21_6, Decl(complexNarrowingWithAny.ts, 188, 49)) + + if (((token === import45.NgControlStatus) && (21 === requestNodeIndex))) { return this._NgControlStatus_21_7; } +>token : Symbol(token, Decl(complexNarrowingWithAny.ts, 448, 22)) +>import45.NgControlStatus : Symbol(import45.NgControlStatus, Decl(complexNarrowingWithAny.ts, 69, 20)) +>import45 : Symbol(import45, Decl(complexNarrowingWithAny.ts, 67, 1)) +>NgControlStatus : Symbol(import45.NgControlStatus, Decl(complexNarrowingWithAny.ts, 69, 20)) +>requestNodeIndex : Symbol(requestNodeIndex, Decl(complexNarrowingWithAny.ts, 448, 32)) +>this._NgControlStatus_21_7 : Symbol(_View_AppComponent0._NgControlStatus_21_7, Decl(complexNarrowingWithAny.ts, 189, 22)) +>this : Symbol(_View_AppComponent0, Decl(complexNarrowingWithAny.ts, 126, 1)) +>_NgControlStatus_21_7 : Symbol(_View_AppComponent0._NgControlStatus_21_7, Decl(complexNarrowingWithAny.ts, 189, 22)) + + if (((token === import46.DefaultValueAccessor) && (24 === requestNodeIndex))) { return this._DefaultValueAccessor_24_3; } +>token : Symbol(token, Decl(complexNarrowingWithAny.ts, 448, 22)) +>import46.DefaultValueAccessor : Symbol(import46.DefaultValueAccessor, Decl(complexNarrowingWithAny.ts, 78, 20)) +>import46 : Symbol(import46, Decl(complexNarrowingWithAny.ts, 76, 1)) +>DefaultValueAccessor : Symbol(import46.DefaultValueAccessor, Decl(complexNarrowingWithAny.ts, 78, 20)) +>requestNodeIndex : Symbol(requestNodeIndex, Decl(complexNarrowingWithAny.ts, 448, 32)) +>this._DefaultValueAccessor_24_3 : Symbol(_View_AppComponent0._DefaultValueAccessor_24_3, Decl(complexNarrowingWithAny.ts, 193, 13)) +>this : Symbol(_View_AppComponent0, Decl(complexNarrowingWithAny.ts, 126, 1)) +>_DefaultValueAccessor_24_3 : Symbol(_View_AppComponent0._DefaultValueAccessor_24_3, Decl(complexNarrowingWithAny.ts, 193, 13)) + + if (((token === import49.NG_VALUE_ACCESSOR) && (24 === requestNodeIndex))) { return this._NG_VALUE_ACCESSOR_24_4; } +>token : Symbol(token, Decl(complexNarrowingWithAny.ts, 448, 22)) +>import49.NG_VALUE_ACCESSOR : Symbol(import49.NG_VALUE_ACCESSOR, Decl(complexNarrowingWithAny.ts, 103, 11)) +>import49 : Symbol(import49, Decl(complexNarrowingWithAny.ts, 94, 1)) +>NG_VALUE_ACCESSOR : Symbol(import49.NG_VALUE_ACCESSOR, Decl(complexNarrowingWithAny.ts, 103, 11)) +>requestNodeIndex : Symbol(requestNodeIndex, Decl(complexNarrowingWithAny.ts, 448, 32)) +>this._NG_VALUE_ACCESSOR_24_4 : Symbol(_View_AppComponent0._NG_VALUE_ACCESSOR_24_4, Decl(complexNarrowingWithAny.ts, 194, 59)) +>this : Symbol(_View_AppComponent0, Decl(complexNarrowingWithAny.ts, 126, 1)) +>_NG_VALUE_ACCESSOR_24_4 : Symbol(_View_AppComponent0._NG_VALUE_ACCESSOR_24_4, Decl(complexNarrowingWithAny.ts, 194, 59)) + + if (((token === import47.FormControlName) && (24 === requestNodeIndex))) { return this._FormControlName_24_5; } +>token : Symbol(token, Decl(complexNarrowingWithAny.ts, 448, 22)) +>import47.FormControlName : Symbol(import47.FormControlName, Decl(complexNarrowingWithAny.ts, 84, 20)) +>import47 : Symbol(import47, Decl(complexNarrowingWithAny.ts, 82, 1)) +>FormControlName : Symbol(import47.FormControlName, Decl(complexNarrowingWithAny.ts, 84, 20)) +>requestNodeIndex : Symbol(requestNodeIndex, Decl(complexNarrowingWithAny.ts, 448, 32)) +>this._FormControlName_24_5 : Symbol(_View_AppComponent0._FormControlName_24_5, Decl(complexNarrowingWithAny.ts, 195, 32)) +>this : Symbol(_View_AppComponent0, Decl(complexNarrowingWithAny.ts, 126, 1)) +>_FormControlName_24_5 : Symbol(_View_AppComponent0._FormControlName_24_5, Decl(complexNarrowingWithAny.ts, 195, 32)) + + if (((token === import50.NgControl) && (24 === requestNodeIndex))) { return this._NgControl_24_6; } +>token : Symbol(token, Decl(complexNarrowingWithAny.ts, 448, 22)) +>import50.NgControl : Symbol(import50.NgControl, Decl(complexNarrowingWithAny.ts, 116, 20)) +>import50 : Symbol(import50, Decl(complexNarrowingWithAny.ts, 104, 1)) +>NgControl : Symbol(import50.NgControl, Decl(complexNarrowingWithAny.ts, 116, 20)) +>requestNodeIndex : Symbol(requestNodeIndex, Decl(complexNarrowingWithAny.ts, 448, 32)) +>this._NgControl_24_6 : Symbol(_View_AppComponent0._NgControl_24_6, Decl(complexNarrowingWithAny.ts, 196, 49)) +>this : Symbol(_View_AppComponent0, Decl(complexNarrowingWithAny.ts, 126, 1)) +>_NgControl_24_6 : Symbol(_View_AppComponent0._NgControl_24_6, Decl(complexNarrowingWithAny.ts, 196, 49)) + + if (((token === import45.NgControlStatus) && (24 === requestNodeIndex))) { return this._NgControlStatus_24_7; } +>token : Symbol(token, Decl(complexNarrowingWithAny.ts, 448, 22)) +>import45.NgControlStatus : Symbol(import45.NgControlStatus, Decl(complexNarrowingWithAny.ts, 69, 20)) +>import45 : Symbol(import45, Decl(complexNarrowingWithAny.ts, 67, 1)) +>NgControlStatus : Symbol(import45.NgControlStatus, Decl(complexNarrowingWithAny.ts, 69, 20)) +>requestNodeIndex : Symbol(requestNodeIndex, Decl(complexNarrowingWithAny.ts, 448, 32)) +>this._NgControlStatus_24_7 : Symbol(_View_AppComponent0._NgControlStatus_24_7, Decl(complexNarrowingWithAny.ts, 197, 22)) +>this : Symbol(_View_AppComponent0, Decl(complexNarrowingWithAny.ts, 126, 1)) +>_NgControlStatus_24_7 : Symbol(_View_AppComponent0._NgControlStatus_24_7, Decl(complexNarrowingWithAny.ts, 197, 22)) + + if (((token === import46.DefaultValueAccessor) && (27 === requestNodeIndex))) { return this._DefaultValueAccessor_27_3; } +>token : Symbol(token, Decl(complexNarrowingWithAny.ts, 448, 22)) +>import46.DefaultValueAccessor : Symbol(import46.DefaultValueAccessor, Decl(complexNarrowingWithAny.ts, 78, 20)) +>import46 : Symbol(import46, Decl(complexNarrowingWithAny.ts, 76, 1)) +>DefaultValueAccessor : Symbol(import46.DefaultValueAccessor, Decl(complexNarrowingWithAny.ts, 78, 20)) +>requestNodeIndex : Symbol(requestNodeIndex, Decl(complexNarrowingWithAny.ts, 448, 32)) +>this._DefaultValueAccessor_27_3 : Symbol(_View_AppComponent0._DefaultValueAccessor_27_3, Decl(complexNarrowingWithAny.ts, 201, 13)) +>this : Symbol(_View_AppComponent0, Decl(complexNarrowingWithAny.ts, 126, 1)) +>_DefaultValueAccessor_27_3 : Symbol(_View_AppComponent0._DefaultValueAccessor_27_3, Decl(complexNarrowingWithAny.ts, 201, 13)) + + if (((token === import49.NG_VALUE_ACCESSOR) && (27 === requestNodeIndex))) { return this._NG_VALUE_ACCESSOR_27_4; } +>token : Symbol(token, Decl(complexNarrowingWithAny.ts, 448, 22)) +>import49.NG_VALUE_ACCESSOR : Symbol(import49.NG_VALUE_ACCESSOR, Decl(complexNarrowingWithAny.ts, 103, 11)) +>import49 : Symbol(import49, Decl(complexNarrowingWithAny.ts, 94, 1)) +>NG_VALUE_ACCESSOR : Symbol(import49.NG_VALUE_ACCESSOR, Decl(complexNarrowingWithAny.ts, 103, 11)) +>requestNodeIndex : Symbol(requestNodeIndex, Decl(complexNarrowingWithAny.ts, 448, 32)) +>this._NG_VALUE_ACCESSOR_27_4 : Symbol(_View_AppComponent0._NG_VALUE_ACCESSOR_27_4, Decl(complexNarrowingWithAny.ts, 202, 59)) +>this : Symbol(_View_AppComponent0, Decl(complexNarrowingWithAny.ts, 126, 1)) +>_NG_VALUE_ACCESSOR_27_4 : Symbol(_View_AppComponent0._NG_VALUE_ACCESSOR_27_4, Decl(complexNarrowingWithAny.ts, 202, 59)) + + if (((token === import47.FormControlName) && (27 === requestNodeIndex))) { return this._FormControlName_27_5; } +>token : Symbol(token, Decl(complexNarrowingWithAny.ts, 448, 22)) +>import47.FormControlName : Symbol(import47.FormControlName, Decl(complexNarrowingWithAny.ts, 84, 20)) +>import47 : Symbol(import47, Decl(complexNarrowingWithAny.ts, 82, 1)) +>FormControlName : Symbol(import47.FormControlName, Decl(complexNarrowingWithAny.ts, 84, 20)) +>requestNodeIndex : Symbol(requestNodeIndex, Decl(complexNarrowingWithAny.ts, 448, 32)) +>this._FormControlName_27_5 : Symbol(_View_AppComponent0._FormControlName_27_5, Decl(complexNarrowingWithAny.ts, 203, 32)) +>this : Symbol(_View_AppComponent0, Decl(complexNarrowingWithAny.ts, 126, 1)) +>_FormControlName_27_5 : Symbol(_View_AppComponent0._FormControlName_27_5, Decl(complexNarrowingWithAny.ts, 203, 32)) + + if (((token === import50.NgControl) && (27 === requestNodeIndex))) { return this._NgControl_27_6; } +>token : Symbol(token, Decl(complexNarrowingWithAny.ts, 448, 22)) +>import50.NgControl : Symbol(import50.NgControl, Decl(complexNarrowingWithAny.ts, 116, 20)) +>import50 : Symbol(import50, Decl(complexNarrowingWithAny.ts, 104, 1)) +>NgControl : Symbol(import50.NgControl, Decl(complexNarrowingWithAny.ts, 116, 20)) +>requestNodeIndex : Symbol(requestNodeIndex, Decl(complexNarrowingWithAny.ts, 448, 32)) +>this._NgControl_27_6 : Symbol(_View_AppComponent0._NgControl_27_6, Decl(complexNarrowingWithAny.ts, 204, 49)) +>this : Symbol(_View_AppComponent0, Decl(complexNarrowingWithAny.ts, 126, 1)) +>_NgControl_27_6 : Symbol(_View_AppComponent0._NgControl_27_6, Decl(complexNarrowingWithAny.ts, 204, 49)) + + if (((token === import45.NgControlStatus) && (27 === requestNodeIndex))) { return this._NgControlStatus_27_7; } +>token : Symbol(token, Decl(complexNarrowingWithAny.ts, 448, 22)) +>import45.NgControlStatus : Symbol(import45.NgControlStatus, Decl(complexNarrowingWithAny.ts, 69, 20)) +>import45 : Symbol(import45, Decl(complexNarrowingWithAny.ts, 67, 1)) +>NgControlStatus : Symbol(import45.NgControlStatus, Decl(complexNarrowingWithAny.ts, 69, 20)) +>requestNodeIndex : Symbol(requestNodeIndex, Decl(complexNarrowingWithAny.ts, 448, 32)) +>this._NgControlStatus_27_7 : Symbol(_View_AppComponent0._NgControlStatus_27_7, Decl(complexNarrowingWithAny.ts, 205, 22)) +>this : Symbol(_View_AppComponent0, Decl(complexNarrowingWithAny.ts, 126, 1)) +>_NgControlStatus_27_7 : Symbol(_View_AppComponent0._NgControlStatus_27_7, Decl(complexNarrowingWithAny.ts, 205, 22)) + + if (((token === import46.DefaultValueAccessor) && (30 === requestNodeIndex))) { return this._DefaultValueAccessor_30_3; } +>token : Symbol(token, Decl(complexNarrowingWithAny.ts, 448, 22)) +>import46.DefaultValueAccessor : Symbol(import46.DefaultValueAccessor, Decl(complexNarrowingWithAny.ts, 78, 20)) +>import46 : Symbol(import46, Decl(complexNarrowingWithAny.ts, 76, 1)) +>DefaultValueAccessor : Symbol(import46.DefaultValueAccessor, Decl(complexNarrowingWithAny.ts, 78, 20)) +>requestNodeIndex : Symbol(requestNodeIndex, Decl(complexNarrowingWithAny.ts, 448, 32)) +>this._DefaultValueAccessor_30_3 : Symbol(_View_AppComponent0._DefaultValueAccessor_30_3, Decl(complexNarrowingWithAny.ts, 209, 13)) +>this : Symbol(_View_AppComponent0, Decl(complexNarrowingWithAny.ts, 126, 1)) +>_DefaultValueAccessor_30_3 : Symbol(_View_AppComponent0._DefaultValueAccessor_30_3, Decl(complexNarrowingWithAny.ts, 209, 13)) + + if (((token === import49.NG_VALUE_ACCESSOR) && (30 === requestNodeIndex))) { return this._NG_VALUE_ACCESSOR_30_4; } +>token : Symbol(token, Decl(complexNarrowingWithAny.ts, 448, 22)) +>import49.NG_VALUE_ACCESSOR : Symbol(import49.NG_VALUE_ACCESSOR, Decl(complexNarrowingWithAny.ts, 103, 11)) +>import49 : Symbol(import49, Decl(complexNarrowingWithAny.ts, 94, 1)) +>NG_VALUE_ACCESSOR : Symbol(import49.NG_VALUE_ACCESSOR, Decl(complexNarrowingWithAny.ts, 103, 11)) +>requestNodeIndex : Symbol(requestNodeIndex, Decl(complexNarrowingWithAny.ts, 448, 32)) +>this._NG_VALUE_ACCESSOR_30_4 : Symbol(_View_AppComponent0._NG_VALUE_ACCESSOR_30_4, Decl(complexNarrowingWithAny.ts, 210, 59)) +>this : Symbol(_View_AppComponent0, Decl(complexNarrowingWithAny.ts, 126, 1)) +>_NG_VALUE_ACCESSOR_30_4 : Symbol(_View_AppComponent0._NG_VALUE_ACCESSOR_30_4, Decl(complexNarrowingWithAny.ts, 210, 59)) + + if (((token === import47.FormControlName) && (30 === requestNodeIndex))) { return this._FormControlName_30_5; } +>token : Symbol(token, Decl(complexNarrowingWithAny.ts, 448, 22)) +>import47.FormControlName : Symbol(import47.FormControlName, Decl(complexNarrowingWithAny.ts, 84, 20)) +>import47 : Symbol(import47, Decl(complexNarrowingWithAny.ts, 82, 1)) +>FormControlName : Symbol(import47.FormControlName, Decl(complexNarrowingWithAny.ts, 84, 20)) +>requestNodeIndex : Symbol(requestNodeIndex, Decl(complexNarrowingWithAny.ts, 448, 32)) +>this._FormControlName_30_5 : Symbol(_View_AppComponent0._FormControlName_30_5, Decl(complexNarrowingWithAny.ts, 211, 32)) +>this : Symbol(_View_AppComponent0, Decl(complexNarrowingWithAny.ts, 126, 1)) +>_FormControlName_30_5 : Symbol(_View_AppComponent0._FormControlName_30_5, Decl(complexNarrowingWithAny.ts, 211, 32)) + + if (((token === import50.NgControl) && (30 === requestNodeIndex))) { return this._NgControl_30_6; } +>token : Symbol(token, Decl(complexNarrowingWithAny.ts, 448, 22)) +>import50.NgControl : Symbol(import50.NgControl, Decl(complexNarrowingWithAny.ts, 116, 20)) +>import50 : Symbol(import50, Decl(complexNarrowingWithAny.ts, 104, 1)) +>NgControl : Symbol(import50.NgControl, Decl(complexNarrowingWithAny.ts, 116, 20)) +>requestNodeIndex : Symbol(requestNodeIndex, Decl(complexNarrowingWithAny.ts, 448, 32)) +>this._NgControl_30_6 : Symbol(_View_AppComponent0._NgControl_30_6, Decl(complexNarrowingWithAny.ts, 212, 49)) +>this : Symbol(_View_AppComponent0, Decl(complexNarrowingWithAny.ts, 126, 1)) +>_NgControl_30_6 : Symbol(_View_AppComponent0._NgControl_30_6, Decl(complexNarrowingWithAny.ts, 212, 49)) + + if (((token === import45.NgControlStatus) && (30 === requestNodeIndex))) { return this._NgControlStatus_30_7; } +>token : Symbol(token, Decl(complexNarrowingWithAny.ts, 448, 22)) +>import45.NgControlStatus : Symbol(import45.NgControlStatus, Decl(complexNarrowingWithAny.ts, 69, 20)) +>import45 : Symbol(import45, Decl(complexNarrowingWithAny.ts, 67, 1)) +>NgControlStatus : Symbol(import45.NgControlStatus, Decl(complexNarrowingWithAny.ts, 69, 20)) +>requestNodeIndex : Symbol(requestNodeIndex, Decl(complexNarrowingWithAny.ts, 448, 32)) +>this._NgControlStatus_30_7 : Symbol(_View_AppComponent0._NgControlStatus_30_7, Decl(complexNarrowingWithAny.ts, 213, 22)) +>this : Symbol(_View_AppComponent0, Decl(complexNarrowingWithAny.ts, 126, 1)) +>_NgControlStatus_30_7 : Symbol(_View_AppComponent0._NgControlStatus_30_7, Decl(complexNarrowingWithAny.ts, 213, 22)) + + if (((token === import46.DefaultValueAccessor) && (33 === requestNodeIndex))) { return this._DefaultValueAccessor_33_3; } +>token : Symbol(token, Decl(complexNarrowingWithAny.ts, 448, 22)) +>import46.DefaultValueAccessor : Symbol(import46.DefaultValueAccessor, Decl(complexNarrowingWithAny.ts, 78, 20)) +>import46 : Symbol(import46, Decl(complexNarrowingWithAny.ts, 76, 1)) +>DefaultValueAccessor : Symbol(import46.DefaultValueAccessor, Decl(complexNarrowingWithAny.ts, 78, 20)) +>requestNodeIndex : Symbol(requestNodeIndex, Decl(complexNarrowingWithAny.ts, 448, 32)) +>this._DefaultValueAccessor_33_3 : Symbol(_View_AppComponent0._DefaultValueAccessor_33_3, Decl(complexNarrowingWithAny.ts, 217, 13)) +>this : Symbol(_View_AppComponent0, Decl(complexNarrowingWithAny.ts, 126, 1)) +>_DefaultValueAccessor_33_3 : Symbol(_View_AppComponent0._DefaultValueAccessor_33_3, Decl(complexNarrowingWithAny.ts, 217, 13)) + + if (((token === import49.NG_VALUE_ACCESSOR) && (33 === requestNodeIndex))) { return this._NG_VALUE_ACCESSOR_33_4; } +>token : Symbol(token, Decl(complexNarrowingWithAny.ts, 448, 22)) +>import49.NG_VALUE_ACCESSOR : Symbol(import49.NG_VALUE_ACCESSOR, Decl(complexNarrowingWithAny.ts, 103, 11)) +>import49 : Symbol(import49, Decl(complexNarrowingWithAny.ts, 94, 1)) +>NG_VALUE_ACCESSOR : Symbol(import49.NG_VALUE_ACCESSOR, Decl(complexNarrowingWithAny.ts, 103, 11)) +>requestNodeIndex : Symbol(requestNodeIndex, Decl(complexNarrowingWithAny.ts, 448, 32)) +>this._NG_VALUE_ACCESSOR_33_4 : Symbol(_View_AppComponent0._NG_VALUE_ACCESSOR_33_4, Decl(complexNarrowingWithAny.ts, 218, 59)) +>this : Symbol(_View_AppComponent0, Decl(complexNarrowingWithAny.ts, 126, 1)) +>_NG_VALUE_ACCESSOR_33_4 : Symbol(_View_AppComponent0._NG_VALUE_ACCESSOR_33_4, Decl(complexNarrowingWithAny.ts, 218, 59)) + + if (((token === import47.FormControlName) && (33 === requestNodeIndex))) { return this._FormControlName_33_5; } +>token : Symbol(token, Decl(complexNarrowingWithAny.ts, 448, 22)) +>import47.FormControlName : Symbol(import47.FormControlName, Decl(complexNarrowingWithAny.ts, 84, 20)) +>import47 : Symbol(import47, Decl(complexNarrowingWithAny.ts, 82, 1)) +>FormControlName : Symbol(import47.FormControlName, Decl(complexNarrowingWithAny.ts, 84, 20)) +>requestNodeIndex : Symbol(requestNodeIndex, Decl(complexNarrowingWithAny.ts, 448, 32)) +>this._FormControlName_33_5 : Symbol(_View_AppComponent0._FormControlName_33_5, Decl(complexNarrowingWithAny.ts, 219, 32)) +>this : Symbol(_View_AppComponent0, Decl(complexNarrowingWithAny.ts, 126, 1)) +>_FormControlName_33_5 : Symbol(_View_AppComponent0._FormControlName_33_5, Decl(complexNarrowingWithAny.ts, 219, 32)) + + if (((token === import50.NgControl) && (33 === requestNodeIndex))) { return this._NgControl_33_6; } +>token : Symbol(token, Decl(complexNarrowingWithAny.ts, 448, 22)) +>import50.NgControl : Symbol(import50.NgControl, Decl(complexNarrowingWithAny.ts, 116, 20)) +>import50 : Symbol(import50, Decl(complexNarrowingWithAny.ts, 104, 1)) +>NgControl : Symbol(import50.NgControl, Decl(complexNarrowingWithAny.ts, 116, 20)) +>requestNodeIndex : Symbol(requestNodeIndex, Decl(complexNarrowingWithAny.ts, 448, 32)) +>this._NgControl_33_6 : Symbol(_View_AppComponent0._NgControl_33_6, Decl(complexNarrowingWithAny.ts, 220, 49)) +>this : Symbol(_View_AppComponent0, Decl(complexNarrowingWithAny.ts, 126, 1)) +>_NgControl_33_6 : Symbol(_View_AppComponent0._NgControl_33_6, Decl(complexNarrowingWithAny.ts, 220, 49)) + + if (((token === import45.NgControlStatus) && (33 === requestNodeIndex))) { return this._NgControlStatus_33_7; } +>token : Symbol(token, Decl(complexNarrowingWithAny.ts, 448, 22)) +>import45.NgControlStatus : Symbol(import45.NgControlStatus, Decl(complexNarrowingWithAny.ts, 69, 20)) +>import45 : Symbol(import45, Decl(complexNarrowingWithAny.ts, 67, 1)) +>NgControlStatus : Symbol(import45.NgControlStatus, Decl(complexNarrowingWithAny.ts, 69, 20)) +>requestNodeIndex : Symbol(requestNodeIndex, Decl(complexNarrowingWithAny.ts, 448, 32)) +>this._NgControlStatus_33_7 : Symbol(_View_AppComponent0._NgControlStatus_33_7, Decl(complexNarrowingWithAny.ts, 221, 22)) +>this : Symbol(_View_AppComponent0, Decl(complexNarrowingWithAny.ts, 126, 1)) +>_NgControlStatus_33_7 : Symbol(_View_AppComponent0._NgControlStatus_33_7, Decl(complexNarrowingWithAny.ts, 221, 22)) + + if (((token === import46.DefaultValueAccessor) && (36 === requestNodeIndex))) { return this._DefaultValueAccessor_36_3; } +>token : Symbol(token, Decl(complexNarrowingWithAny.ts, 448, 22)) +>import46.DefaultValueAccessor : Symbol(import46.DefaultValueAccessor, Decl(complexNarrowingWithAny.ts, 78, 20)) +>import46 : Symbol(import46, Decl(complexNarrowingWithAny.ts, 76, 1)) +>DefaultValueAccessor : Symbol(import46.DefaultValueAccessor, Decl(complexNarrowingWithAny.ts, 78, 20)) +>requestNodeIndex : Symbol(requestNodeIndex, Decl(complexNarrowingWithAny.ts, 448, 32)) +>this._DefaultValueAccessor_36_3 : Symbol(_View_AppComponent0._DefaultValueAccessor_36_3, Decl(complexNarrowingWithAny.ts, 225, 13)) +>this : Symbol(_View_AppComponent0, Decl(complexNarrowingWithAny.ts, 126, 1)) +>_DefaultValueAccessor_36_3 : Symbol(_View_AppComponent0._DefaultValueAccessor_36_3, Decl(complexNarrowingWithAny.ts, 225, 13)) + + if (((token === import49.NG_VALUE_ACCESSOR) && (36 === requestNodeIndex))) { return this._NG_VALUE_ACCESSOR_36_4; } +>token : Symbol(token, Decl(complexNarrowingWithAny.ts, 448, 22)) +>import49.NG_VALUE_ACCESSOR : Symbol(import49.NG_VALUE_ACCESSOR, Decl(complexNarrowingWithAny.ts, 103, 11)) +>import49 : Symbol(import49, Decl(complexNarrowingWithAny.ts, 94, 1)) +>NG_VALUE_ACCESSOR : Symbol(import49.NG_VALUE_ACCESSOR, Decl(complexNarrowingWithAny.ts, 103, 11)) +>requestNodeIndex : Symbol(requestNodeIndex, Decl(complexNarrowingWithAny.ts, 448, 32)) +>this._NG_VALUE_ACCESSOR_36_4 : Symbol(_View_AppComponent0._NG_VALUE_ACCESSOR_36_4, Decl(complexNarrowingWithAny.ts, 226, 59)) +>this : Symbol(_View_AppComponent0, Decl(complexNarrowingWithAny.ts, 126, 1)) +>_NG_VALUE_ACCESSOR_36_4 : Symbol(_View_AppComponent0._NG_VALUE_ACCESSOR_36_4, Decl(complexNarrowingWithAny.ts, 226, 59)) + + if (((token === import47.FormControlName) && (36 === requestNodeIndex))) { return this._FormControlName_36_5; } +>token : Symbol(token, Decl(complexNarrowingWithAny.ts, 448, 22)) +>import47.FormControlName : Symbol(import47.FormControlName, Decl(complexNarrowingWithAny.ts, 84, 20)) +>import47 : Symbol(import47, Decl(complexNarrowingWithAny.ts, 82, 1)) +>FormControlName : Symbol(import47.FormControlName, Decl(complexNarrowingWithAny.ts, 84, 20)) +>requestNodeIndex : Symbol(requestNodeIndex, Decl(complexNarrowingWithAny.ts, 448, 32)) +>this._FormControlName_36_5 : Symbol(_View_AppComponent0._FormControlName_36_5, Decl(complexNarrowingWithAny.ts, 227, 32)) +>this : Symbol(_View_AppComponent0, Decl(complexNarrowingWithAny.ts, 126, 1)) +>_FormControlName_36_5 : Symbol(_View_AppComponent0._FormControlName_36_5, Decl(complexNarrowingWithAny.ts, 227, 32)) + + if (((token === import50.NgControl) && (36 === requestNodeIndex))) { return this._NgControl_36_6; } +>token : Symbol(token, Decl(complexNarrowingWithAny.ts, 448, 22)) +>import50.NgControl : Symbol(import50.NgControl, Decl(complexNarrowingWithAny.ts, 116, 20)) +>import50 : Symbol(import50, Decl(complexNarrowingWithAny.ts, 104, 1)) +>NgControl : Symbol(import50.NgControl, Decl(complexNarrowingWithAny.ts, 116, 20)) +>requestNodeIndex : Symbol(requestNodeIndex, Decl(complexNarrowingWithAny.ts, 448, 32)) +>this._NgControl_36_6 : Symbol(_View_AppComponent0._NgControl_36_6, Decl(complexNarrowingWithAny.ts, 228, 49)) +>this : Symbol(_View_AppComponent0, Decl(complexNarrowingWithAny.ts, 126, 1)) +>_NgControl_36_6 : Symbol(_View_AppComponent0._NgControl_36_6, Decl(complexNarrowingWithAny.ts, 228, 49)) + + if (((token === import45.NgControlStatus) && (36 === requestNodeIndex))) { return this._NgControlStatus_36_7; } +>token : Symbol(token, Decl(complexNarrowingWithAny.ts, 448, 22)) +>import45.NgControlStatus : Symbol(import45.NgControlStatus, Decl(complexNarrowingWithAny.ts, 69, 20)) +>import45 : Symbol(import45, Decl(complexNarrowingWithAny.ts, 67, 1)) +>NgControlStatus : Symbol(import45.NgControlStatus, Decl(complexNarrowingWithAny.ts, 69, 20)) +>requestNodeIndex : Symbol(requestNodeIndex, Decl(complexNarrowingWithAny.ts, 448, 32)) +>this._NgControlStatus_36_7 : Symbol(_View_AppComponent0._NgControlStatus_36_7, Decl(complexNarrowingWithAny.ts, 229, 22)) +>this : Symbol(_View_AppComponent0, Decl(complexNarrowingWithAny.ts, 126, 1)) +>_NgControlStatus_36_7 : Symbol(_View_AppComponent0._NgControlStatus_36_7, Decl(complexNarrowingWithAny.ts, 229, 22)) + + if (((token === import46.DefaultValueAccessor) && (39 === requestNodeIndex))) { return this._DefaultValueAccessor_39_3; } +>token : Symbol(token, Decl(complexNarrowingWithAny.ts, 448, 22)) +>import46.DefaultValueAccessor : Symbol(import46.DefaultValueAccessor, Decl(complexNarrowingWithAny.ts, 78, 20)) +>import46 : Symbol(import46, Decl(complexNarrowingWithAny.ts, 76, 1)) +>DefaultValueAccessor : Symbol(import46.DefaultValueAccessor, Decl(complexNarrowingWithAny.ts, 78, 20)) +>requestNodeIndex : Symbol(requestNodeIndex, Decl(complexNarrowingWithAny.ts, 448, 32)) +>this._DefaultValueAccessor_39_3 : Symbol(_View_AppComponent0._DefaultValueAccessor_39_3, Decl(complexNarrowingWithAny.ts, 233, 13)) +>this : Symbol(_View_AppComponent0, Decl(complexNarrowingWithAny.ts, 126, 1)) +>_DefaultValueAccessor_39_3 : Symbol(_View_AppComponent0._DefaultValueAccessor_39_3, Decl(complexNarrowingWithAny.ts, 233, 13)) + + if (((token === import49.NG_VALUE_ACCESSOR) && (39 === requestNodeIndex))) { return this._NG_VALUE_ACCESSOR_39_4; } +>token : Symbol(token, Decl(complexNarrowingWithAny.ts, 448, 22)) +>import49.NG_VALUE_ACCESSOR : Symbol(import49.NG_VALUE_ACCESSOR, Decl(complexNarrowingWithAny.ts, 103, 11)) +>import49 : Symbol(import49, Decl(complexNarrowingWithAny.ts, 94, 1)) +>NG_VALUE_ACCESSOR : Symbol(import49.NG_VALUE_ACCESSOR, Decl(complexNarrowingWithAny.ts, 103, 11)) +>requestNodeIndex : Symbol(requestNodeIndex, Decl(complexNarrowingWithAny.ts, 448, 32)) +>this._NG_VALUE_ACCESSOR_39_4 : Symbol(_View_AppComponent0._NG_VALUE_ACCESSOR_39_4, Decl(complexNarrowingWithAny.ts, 234, 59)) +>this : Symbol(_View_AppComponent0, Decl(complexNarrowingWithAny.ts, 126, 1)) +>_NG_VALUE_ACCESSOR_39_4 : Symbol(_View_AppComponent0._NG_VALUE_ACCESSOR_39_4, Decl(complexNarrowingWithAny.ts, 234, 59)) + + if (((token === import47.FormControlName) && (39 === requestNodeIndex))) { return this._FormControlName_39_5; } +>token : Symbol(token, Decl(complexNarrowingWithAny.ts, 448, 22)) +>import47.FormControlName : Symbol(import47.FormControlName, Decl(complexNarrowingWithAny.ts, 84, 20)) +>import47 : Symbol(import47, Decl(complexNarrowingWithAny.ts, 82, 1)) +>FormControlName : Symbol(import47.FormControlName, Decl(complexNarrowingWithAny.ts, 84, 20)) +>requestNodeIndex : Symbol(requestNodeIndex, Decl(complexNarrowingWithAny.ts, 448, 32)) +>this._FormControlName_39_5 : Symbol(_View_AppComponent0._FormControlName_39_5, Decl(complexNarrowingWithAny.ts, 235, 32)) +>this : Symbol(_View_AppComponent0, Decl(complexNarrowingWithAny.ts, 126, 1)) +>_FormControlName_39_5 : Symbol(_View_AppComponent0._FormControlName_39_5, Decl(complexNarrowingWithAny.ts, 235, 32)) + + if (((token === import50.NgControl) && (39 === requestNodeIndex))) { return this._NgControl_39_6; } +>token : Symbol(token, Decl(complexNarrowingWithAny.ts, 448, 22)) +>import50.NgControl : Symbol(import50.NgControl, Decl(complexNarrowingWithAny.ts, 116, 20)) +>import50 : Symbol(import50, Decl(complexNarrowingWithAny.ts, 104, 1)) +>NgControl : Symbol(import50.NgControl, Decl(complexNarrowingWithAny.ts, 116, 20)) +>requestNodeIndex : Symbol(requestNodeIndex, Decl(complexNarrowingWithAny.ts, 448, 32)) +>this._NgControl_39_6 : Symbol(_View_AppComponent0._NgControl_39_6, Decl(complexNarrowingWithAny.ts, 236, 49)) +>this : Symbol(_View_AppComponent0, Decl(complexNarrowingWithAny.ts, 126, 1)) +>_NgControl_39_6 : Symbol(_View_AppComponent0._NgControl_39_6, Decl(complexNarrowingWithAny.ts, 236, 49)) + + if (((token === import45.NgControlStatus) && (39 === requestNodeIndex))) { return this._NgControlStatus_39_7; } +>token : Symbol(token, Decl(complexNarrowingWithAny.ts, 448, 22)) +>import45.NgControlStatus : Symbol(import45.NgControlStatus, Decl(complexNarrowingWithAny.ts, 69, 20)) +>import45 : Symbol(import45, Decl(complexNarrowingWithAny.ts, 67, 1)) +>NgControlStatus : Symbol(import45.NgControlStatus, Decl(complexNarrowingWithAny.ts, 69, 20)) +>requestNodeIndex : Symbol(requestNodeIndex, Decl(complexNarrowingWithAny.ts, 448, 32)) +>this._NgControlStatus_39_7 : Symbol(_View_AppComponent0._NgControlStatus_39_7, Decl(complexNarrowingWithAny.ts, 237, 22)) +>this : Symbol(_View_AppComponent0, Decl(complexNarrowingWithAny.ts, 126, 1)) +>_NgControlStatus_39_7 : Symbol(_View_AppComponent0._NgControlStatus_39_7, Decl(complexNarrowingWithAny.ts, 237, 22)) + + if (((token === import46.DefaultValueAccessor) && (42 === requestNodeIndex))) { return this._DefaultValueAccessor_42_3; } +>token : Symbol(token, Decl(complexNarrowingWithAny.ts, 448, 22)) +>import46.DefaultValueAccessor : Symbol(import46.DefaultValueAccessor, Decl(complexNarrowingWithAny.ts, 78, 20)) +>import46 : Symbol(import46, Decl(complexNarrowingWithAny.ts, 76, 1)) +>DefaultValueAccessor : Symbol(import46.DefaultValueAccessor, Decl(complexNarrowingWithAny.ts, 78, 20)) +>requestNodeIndex : Symbol(requestNodeIndex, Decl(complexNarrowingWithAny.ts, 448, 32)) +>this._DefaultValueAccessor_42_3 : Symbol(_View_AppComponent0._DefaultValueAccessor_42_3, Decl(complexNarrowingWithAny.ts, 241, 13)) +>this : Symbol(_View_AppComponent0, Decl(complexNarrowingWithAny.ts, 126, 1)) +>_DefaultValueAccessor_42_3 : Symbol(_View_AppComponent0._DefaultValueAccessor_42_3, Decl(complexNarrowingWithAny.ts, 241, 13)) + + if (((token === import49.NG_VALUE_ACCESSOR) && (42 === requestNodeIndex))) { return this._NG_VALUE_ACCESSOR_42_4; } +>token : Symbol(token, Decl(complexNarrowingWithAny.ts, 448, 22)) +>import49.NG_VALUE_ACCESSOR : Symbol(import49.NG_VALUE_ACCESSOR, Decl(complexNarrowingWithAny.ts, 103, 11)) +>import49 : Symbol(import49, Decl(complexNarrowingWithAny.ts, 94, 1)) +>NG_VALUE_ACCESSOR : Symbol(import49.NG_VALUE_ACCESSOR, Decl(complexNarrowingWithAny.ts, 103, 11)) +>requestNodeIndex : Symbol(requestNodeIndex, Decl(complexNarrowingWithAny.ts, 448, 32)) +>this._NG_VALUE_ACCESSOR_42_4 : Symbol(_View_AppComponent0._NG_VALUE_ACCESSOR_42_4, Decl(complexNarrowingWithAny.ts, 242, 59)) +>this : Symbol(_View_AppComponent0, Decl(complexNarrowingWithAny.ts, 126, 1)) +>_NG_VALUE_ACCESSOR_42_4 : Symbol(_View_AppComponent0._NG_VALUE_ACCESSOR_42_4, Decl(complexNarrowingWithAny.ts, 242, 59)) + + if (((token === import47.FormControlName) && (42 === requestNodeIndex))) { return this._FormControlName_42_5; } +>token : Symbol(token, Decl(complexNarrowingWithAny.ts, 448, 22)) +>import47.FormControlName : Symbol(import47.FormControlName, Decl(complexNarrowingWithAny.ts, 84, 20)) +>import47 : Symbol(import47, Decl(complexNarrowingWithAny.ts, 82, 1)) +>FormControlName : Symbol(import47.FormControlName, Decl(complexNarrowingWithAny.ts, 84, 20)) +>requestNodeIndex : Symbol(requestNodeIndex, Decl(complexNarrowingWithAny.ts, 448, 32)) +>this._FormControlName_42_5 : Symbol(_View_AppComponent0._FormControlName_42_5, Decl(complexNarrowingWithAny.ts, 243, 32)) +>this : Symbol(_View_AppComponent0, Decl(complexNarrowingWithAny.ts, 126, 1)) +>_FormControlName_42_5 : Symbol(_View_AppComponent0._FormControlName_42_5, Decl(complexNarrowingWithAny.ts, 243, 32)) + + if (((token === import50.NgControl) && (42 === requestNodeIndex))) { return this._NgControl_42_6; } +>token : Symbol(token, Decl(complexNarrowingWithAny.ts, 448, 22)) +>import50.NgControl : Symbol(import50.NgControl, Decl(complexNarrowingWithAny.ts, 116, 20)) +>import50 : Symbol(import50, Decl(complexNarrowingWithAny.ts, 104, 1)) +>NgControl : Symbol(import50.NgControl, Decl(complexNarrowingWithAny.ts, 116, 20)) +>requestNodeIndex : Symbol(requestNodeIndex, Decl(complexNarrowingWithAny.ts, 448, 32)) +>this._NgControl_42_6 : Symbol(_View_AppComponent0._NgControl_42_6, Decl(complexNarrowingWithAny.ts, 244, 49)) +>this : Symbol(_View_AppComponent0, Decl(complexNarrowingWithAny.ts, 126, 1)) +>_NgControl_42_6 : Symbol(_View_AppComponent0._NgControl_42_6, Decl(complexNarrowingWithAny.ts, 244, 49)) + + if (((token === import45.NgControlStatus) && (42 === requestNodeIndex))) { return this._NgControlStatus_42_7; } +>token : Symbol(token, Decl(complexNarrowingWithAny.ts, 448, 22)) +>import45.NgControlStatus : Symbol(import45.NgControlStatus, Decl(complexNarrowingWithAny.ts, 69, 20)) +>import45 : Symbol(import45, Decl(complexNarrowingWithAny.ts, 67, 1)) +>NgControlStatus : Symbol(import45.NgControlStatus, Decl(complexNarrowingWithAny.ts, 69, 20)) +>requestNodeIndex : Symbol(requestNodeIndex, Decl(complexNarrowingWithAny.ts, 448, 32)) +>this._NgControlStatus_42_7 : Symbol(_View_AppComponent0._NgControlStatus_42_7, Decl(complexNarrowingWithAny.ts, 245, 22)) +>this : Symbol(_View_AppComponent0, Decl(complexNarrowingWithAny.ts, 126, 1)) +>_NgControlStatus_42_7 : Symbol(_View_AppComponent0._NgControlStatus_42_7, Decl(complexNarrowingWithAny.ts, 245, 22)) + + if (((token === import46.DefaultValueAccessor) && (45 === requestNodeIndex))) { return this._DefaultValueAccessor_45_3; } +>token : Symbol(token, Decl(complexNarrowingWithAny.ts, 448, 22)) +>import46.DefaultValueAccessor : Symbol(import46.DefaultValueAccessor, Decl(complexNarrowingWithAny.ts, 78, 20)) +>import46 : Symbol(import46, Decl(complexNarrowingWithAny.ts, 76, 1)) +>DefaultValueAccessor : Symbol(import46.DefaultValueAccessor, Decl(complexNarrowingWithAny.ts, 78, 20)) +>requestNodeIndex : Symbol(requestNodeIndex, Decl(complexNarrowingWithAny.ts, 448, 32)) +>this._DefaultValueAccessor_45_3 : Symbol(_View_AppComponent0._DefaultValueAccessor_45_3, Decl(complexNarrowingWithAny.ts, 249, 13)) +>this : Symbol(_View_AppComponent0, Decl(complexNarrowingWithAny.ts, 126, 1)) +>_DefaultValueAccessor_45_3 : Symbol(_View_AppComponent0._DefaultValueAccessor_45_3, Decl(complexNarrowingWithAny.ts, 249, 13)) + + if (((token === import49.NG_VALUE_ACCESSOR) && (45 === requestNodeIndex))) { return this._NG_VALUE_ACCESSOR_45_4; } +>token : Symbol(token, Decl(complexNarrowingWithAny.ts, 448, 22)) +>import49.NG_VALUE_ACCESSOR : Symbol(import49.NG_VALUE_ACCESSOR, Decl(complexNarrowingWithAny.ts, 103, 11)) +>import49 : Symbol(import49, Decl(complexNarrowingWithAny.ts, 94, 1)) +>NG_VALUE_ACCESSOR : Symbol(import49.NG_VALUE_ACCESSOR, Decl(complexNarrowingWithAny.ts, 103, 11)) +>requestNodeIndex : Symbol(requestNodeIndex, Decl(complexNarrowingWithAny.ts, 448, 32)) +>this._NG_VALUE_ACCESSOR_45_4 : Symbol(_View_AppComponent0._NG_VALUE_ACCESSOR_45_4, Decl(complexNarrowingWithAny.ts, 250, 59)) +>this : Symbol(_View_AppComponent0, Decl(complexNarrowingWithAny.ts, 126, 1)) +>_NG_VALUE_ACCESSOR_45_4 : Symbol(_View_AppComponent0._NG_VALUE_ACCESSOR_45_4, Decl(complexNarrowingWithAny.ts, 250, 59)) + + if (((token === import47.FormControlName) && (45 === requestNodeIndex))) { return this._FormControlName_45_5; } +>token : Symbol(token, Decl(complexNarrowingWithAny.ts, 448, 22)) +>import47.FormControlName : Symbol(import47.FormControlName, Decl(complexNarrowingWithAny.ts, 84, 20)) +>import47 : Symbol(import47, Decl(complexNarrowingWithAny.ts, 82, 1)) +>FormControlName : Symbol(import47.FormControlName, Decl(complexNarrowingWithAny.ts, 84, 20)) +>requestNodeIndex : Symbol(requestNodeIndex, Decl(complexNarrowingWithAny.ts, 448, 32)) +>this._FormControlName_45_5 : Symbol(_View_AppComponent0._FormControlName_45_5, Decl(complexNarrowingWithAny.ts, 251, 32)) +>this : Symbol(_View_AppComponent0, Decl(complexNarrowingWithAny.ts, 126, 1)) +>_FormControlName_45_5 : Symbol(_View_AppComponent0._FormControlName_45_5, Decl(complexNarrowingWithAny.ts, 251, 32)) + + if (((token === import50.NgControl) && (45 === requestNodeIndex))) { return this._NgControl_45_6; } +>token : Symbol(token, Decl(complexNarrowingWithAny.ts, 448, 22)) +>import50.NgControl : Symbol(import50.NgControl, Decl(complexNarrowingWithAny.ts, 116, 20)) +>import50 : Symbol(import50, Decl(complexNarrowingWithAny.ts, 104, 1)) +>NgControl : Symbol(import50.NgControl, Decl(complexNarrowingWithAny.ts, 116, 20)) +>requestNodeIndex : Symbol(requestNodeIndex, Decl(complexNarrowingWithAny.ts, 448, 32)) +>this._NgControl_45_6 : Symbol(_View_AppComponent0._NgControl_45_6, Decl(complexNarrowingWithAny.ts, 252, 49)) +>this : Symbol(_View_AppComponent0, Decl(complexNarrowingWithAny.ts, 126, 1)) +>_NgControl_45_6 : Symbol(_View_AppComponent0._NgControl_45_6, Decl(complexNarrowingWithAny.ts, 252, 49)) + + if (((token === import45.NgControlStatus) && (45 === requestNodeIndex))) { return this._NgControlStatus_45_7; } +>token : Symbol(token, Decl(complexNarrowingWithAny.ts, 448, 22)) +>import45.NgControlStatus : Symbol(import45.NgControlStatus, Decl(complexNarrowingWithAny.ts, 69, 20)) +>import45 : Symbol(import45, Decl(complexNarrowingWithAny.ts, 67, 1)) +>NgControlStatus : Symbol(import45.NgControlStatus, Decl(complexNarrowingWithAny.ts, 69, 20)) +>requestNodeIndex : Symbol(requestNodeIndex, Decl(complexNarrowingWithAny.ts, 448, 32)) +>this._NgControlStatus_45_7 : Symbol(_View_AppComponent0._NgControlStatus_45_7, Decl(complexNarrowingWithAny.ts, 253, 22)) +>this : Symbol(_View_AppComponent0, Decl(complexNarrowingWithAny.ts, 126, 1)) +>_NgControlStatus_45_7 : Symbol(_View_AppComponent0._NgControlStatus_45_7, Decl(complexNarrowingWithAny.ts, 253, 22)) + + if (((token === import46.DefaultValueAccessor) && (48 === requestNodeIndex))) { return this._DefaultValueAccessor_48_3; } +>token : Symbol(token, Decl(complexNarrowingWithAny.ts, 448, 22)) +>import46.DefaultValueAccessor : Symbol(import46.DefaultValueAccessor, Decl(complexNarrowingWithAny.ts, 78, 20)) +>import46 : Symbol(import46, Decl(complexNarrowingWithAny.ts, 76, 1)) +>DefaultValueAccessor : Symbol(import46.DefaultValueAccessor, Decl(complexNarrowingWithAny.ts, 78, 20)) +>requestNodeIndex : Symbol(requestNodeIndex, Decl(complexNarrowingWithAny.ts, 448, 32)) +>this._DefaultValueAccessor_48_3 : Symbol(_View_AppComponent0._DefaultValueAccessor_48_3, Decl(complexNarrowingWithAny.ts, 257, 13)) +>this : Symbol(_View_AppComponent0, Decl(complexNarrowingWithAny.ts, 126, 1)) +>_DefaultValueAccessor_48_3 : Symbol(_View_AppComponent0._DefaultValueAccessor_48_3, Decl(complexNarrowingWithAny.ts, 257, 13)) + + if (((token === import49.NG_VALUE_ACCESSOR) && (48 === requestNodeIndex))) { return this._NG_VALUE_ACCESSOR_48_4; } +>token : Symbol(token, Decl(complexNarrowingWithAny.ts, 448, 22)) +>import49.NG_VALUE_ACCESSOR : Symbol(import49.NG_VALUE_ACCESSOR, Decl(complexNarrowingWithAny.ts, 103, 11)) +>import49 : Symbol(import49, Decl(complexNarrowingWithAny.ts, 94, 1)) +>NG_VALUE_ACCESSOR : Symbol(import49.NG_VALUE_ACCESSOR, Decl(complexNarrowingWithAny.ts, 103, 11)) +>requestNodeIndex : Symbol(requestNodeIndex, Decl(complexNarrowingWithAny.ts, 448, 32)) +>this._NG_VALUE_ACCESSOR_48_4 : Symbol(_View_AppComponent0._NG_VALUE_ACCESSOR_48_4, Decl(complexNarrowingWithAny.ts, 258, 59)) +>this : Symbol(_View_AppComponent0, Decl(complexNarrowingWithAny.ts, 126, 1)) +>_NG_VALUE_ACCESSOR_48_4 : Symbol(_View_AppComponent0._NG_VALUE_ACCESSOR_48_4, Decl(complexNarrowingWithAny.ts, 258, 59)) + + if (((token === import47.FormControlName) && (48 === requestNodeIndex))) { return this._FormControlName_48_5; } +>token : Symbol(token, Decl(complexNarrowingWithAny.ts, 448, 22)) +>import47.FormControlName : Symbol(import47.FormControlName, Decl(complexNarrowingWithAny.ts, 84, 20)) +>import47 : Symbol(import47, Decl(complexNarrowingWithAny.ts, 82, 1)) +>FormControlName : Symbol(import47.FormControlName, Decl(complexNarrowingWithAny.ts, 84, 20)) +>requestNodeIndex : Symbol(requestNodeIndex, Decl(complexNarrowingWithAny.ts, 448, 32)) +>this._FormControlName_48_5 : Symbol(_View_AppComponent0._FormControlName_48_5, Decl(complexNarrowingWithAny.ts, 259, 32)) +>this : Symbol(_View_AppComponent0, Decl(complexNarrowingWithAny.ts, 126, 1)) +>_FormControlName_48_5 : Symbol(_View_AppComponent0._FormControlName_48_5, Decl(complexNarrowingWithAny.ts, 259, 32)) + + if (((token === import50.NgControl) && (48 === requestNodeIndex))) { return this._NgControl_48_6; } +>token : Symbol(token, Decl(complexNarrowingWithAny.ts, 448, 22)) +>import50.NgControl : Symbol(import50.NgControl, Decl(complexNarrowingWithAny.ts, 116, 20)) +>import50 : Symbol(import50, Decl(complexNarrowingWithAny.ts, 104, 1)) +>NgControl : Symbol(import50.NgControl, Decl(complexNarrowingWithAny.ts, 116, 20)) +>requestNodeIndex : Symbol(requestNodeIndex, Decl(complexNarrowingWithAny.ts, 448, 32)) +>this._NgControl_48_6 : Symbol(_View_AppComponent0._NgControl_48_6, Decl(complexNarrowingWithAny.ts, 260, 49)) +>this : Symbol(_View_AppComponent0, Decl(complexNarrowingWithAny.ts, 126, 1)) +>_NgControl_48_6 : Symbol(_View_AppComponent0._NgControl_48_6, Decl(complexNarrowingWithAny.ts, 260, 49)) + + if (((token === import45.NgControlStatus) && (48 === requestNodeIndex))) { return this._NgControlStatus_48_7; } +>token : Symbol(token, Decl(complexNarrowingWithAny.ts, 448, 22)) +>import45.NgControlStatus : Symbol(import45.NgControlStatus, Decl(complexNarrowingWithAny.ts, 69, 20)) +>import45 : Symbol(import45, Decl(complexNarrowingWithAny.ts, 67, 1)) +>NgControlStatus : Symbol(import45.NgControlStatus, Decl(complexNarrowingWithAny.ts, 69, 20)) +>requestNodeIndex : Symbol(requestNodeIndex, Decl(complexNarrowingWithAny.ts, 448, 32)) +>this._NgControlStatus_48_7 : Symbol(_View_AppComponent0._NgControlStatus_48_7, Decl(complexNarrowingWithAny.ts, 261, 22)) +>this : Symbol(_View_AppComponent0, Decl(complexNarrowingWithAny.ts, 126, 1)) +>_NgControlStatus_48_7 : Symbol(_View_AppComponent0._NgControlStatus_48_7, Decl(complexNarrowingWithAny.ts, 261, 22)) + + if (((token === import46.DefaultValueAccessor) && (51 === requestNodeIndex))) { return this._DefaultValueAccessor_51_3; } +>token : Symbol(token, Decl(complexNarrowingWithAny.ts, 448, 22)) +>import46.DefaultValueAccessor : Symbol(import46.DefaultValueAccessor, Decl(complexNarrowingWithAny.ts, 78, 20)) +>import46 : Symbol(import46, Decl(complexNarrowingWithAny.ts, 76, 1)) +>DefaultValueAccessor : Symbol(import46.DefaultValueAccessor, Decl(complexNarrowingWithAny.ts, 78, 20)) +>requestNodeIndex : Symbol(requestNodeIndex, Decl(complexNarrowingWithAny.ts, 448, 32)) +>this._DefaultValueAccessor_51_3 : Symbol(_View_AppComponent0._DefaultValueAccessor_51_3, Decl(complexNarrowingWithAny.ts, 265, 13)) +>this : Symbol(_View_AppComponent0, Decl(complexNarrowingWithAny.ts, 126, 1)) +>_DefaultValueAccessor_51_3 : Symbol(_View_AppComponent0._DefaultValueAccessor_51_3, Decl(complexNarrowingWithAny.ts, 265, 13)) + + if (((token === import49.NG_VALUE_ACCESSOR) && (51 === requestNodeIndex))) { return this._NG_VALUE_ACCESSOR_51_4; } +>token : Symbol(token, Decl(complexNarrowingWithAny.ts, 448, 22)) +>import49.NG_VALUE_ACCESSOR : Symbol(import49.NG_VALUE_ACCESSOR, Decl(complexNarrowingWithAny.ts, 103, 11)) +>import49 : Symbol(import49, Decl(complexNarrowingWithAny.ts, 94, 1)) +>NG_VALUE_ACCESSOR : Symbol(import49.NG_VALUE_ACCESSOR, Decl(complexNarrowingWithAny.ts, 103, 11)) +>requestNodeIndex : Symbol(requestNodeIndex, Decl(complexNarrowingWithAny.ts, 448, 32)) +>this._NG_VALUE_ACCESSOR_51_4 : Symbol(_View_AppComponent0._NG_VALUE_ACCESSOR_51_4, Decl(complexNarrowingWithAny.ts, 266, 59)) +>this : Symbol(_View_AppComponent0, Decl(complexNarrowingWithAny.ts, 126, 1)) +>_NG_VALUE_ACCESSOR_51_4 : Symbol(_View_AppComponent0._NG_VALUE_ACCESSOR_51_4, Decl(complexNarrowingWithAny.ts, 266, 59)) + + if (((token === import47.FormControlName) && (51 === requestNodeIndex))) { return this._FormControlName_51_5; } +>token : Symbol(token, Decl(complexNarrowingWithAny.ts, 448, 22)) +>import47.FormControlName : Symbol(import47.FormControlName, Decl(complexNarrowingWithAny.ts, 84, 20)) +>import47 : Symbol(import47, Decl(complexNarrowingWithAny.ts, 82, 1)) +>FormControlName : Symbol(import47.FormControlName, Decl(complexNarrowingWithAny.ts, 84, 20)) +>requestNodeIndex : Symbol(requestNodeIndex, Decl(complexNarrowingWithAny.ts, 448, 32)) +>this._FormControlName_51_5 : Symbol(_View_AppComponent0._FormControlName_51_5, Decl(complexNarrowingWithAny.ts, 267, 32)) +>this : Symbol(_View_AppComponent0, Decl(complexNarrowingWithAny.ts, 126, 1)) +>_FormControlName_51_5 : Symbol(_View_AppComponent0._FormControlName_51_5, Decl(complexNarrowingWithAny.ts, 267, 32)) + + if (((token === import50.NgControl) && (51 === requestNodeIndex))) { return this._NgControl_51_6; } +>token : Symbol(token, Decl(complexNarrowingWithAny.ts, 448, 22)) +>import50.NgControl : Symbol(import50.NgControl, Decl(complexNarrowingWithAny.ts, 116, 20)) +>import50 : Symbol(import50, Decl(complexNarrowingWithAny.ts, 104, 1)) +>NgControl : Symbol(import50.NgControl, Decl(complexNarrowingWithAny.ts, 116, 20)) +>requestNodeIndex : Symbol(requestNodeIndex, Decl(complexNarrowingWithAny.ts, 448, 32)) +>this._NgControl_51_6 : Symbol(_View_AppComponent0._NgControl_51_6, Decl(complexNarrowingWithAny.ts, 268, 49)) +>this : Symbol(_View_AppComponent0, Decl(complexNarrowingWithAny.ts, 126, 1)) +>_NgControl_51_6 : Symbol(_View_AppComponent0._NgControl_51_6, Decl(complexNarrowingWithAny.ts, 268, 49)) + + if (((token === import45.NgControlStatus) && (51 === requestNodeIndex))) { return this._NgControlStatus_51_7; } +>token : Symbol(token, Decl(complexNarrowingWithAny.ts, 448, 22)) +>import45.NgControlStatus : Symbol(import45.NgControlStatus, Decl(complexNarrowingWithAny.ts, 69, 20)) +>import45 : Symbol(import45, Decl(complexNarrowingWithAny.ts, 67, 1)) +>NgControlStatus : Symbol(import45.NgControlStatus, Decl(complexNarrowingWithAny.ts, 69, 20)) +>requestNodeIndex : Symbol(requestNodeIndex, Decl(complexNarrowingWithAny.ts, 448, 32)) +>this._NgControlStatus_51_7 : Symbol(_View_AppComponent0._NgControlStatus_51_7, Decl(complexNarrowingWithAny.ts, 269, 22)) +>this : Symbol(_View_AppComponent0, Decl(complexNarrowingWithAny.ts, 126, 1)) +>_NgControlStatus_51_7 : Symbol(_View_AppComponent0._NgControlStatus_51_7, Decl(complexNarrowingWithAny.ts, 269, 22)) + + if (((token === import46.DefaultValueAccessor) && (54 === requestNodeIndex))) { return this._DefaultValueAccessor_54_3; } +>token : Symbol(token, Decl(complexNarrowingWithAny.ts, 448, 22)) +>import46.DefaultValueAccessor : Symbol(import46.DefaultValueAccessor, Decl(complexNarrowingWithAny.ts, 78, 20)) +>import46 : Symbol(import46, Decl(complexNarrowingWithAny.ts, 76, 1)) +>DefaultValueAccessor : Symbol(import46.DefaultValueAccessor, Decl(complexNarrowingWithAny.ts, 78, 20)) +>requestNodeIndex : Symbol(requestNodeIndex, Decl(complexNarrowingWithAny.ts, 448, 32)) +>this._DefaultValueAccessor_54_3 : Symbol(_View_AppComponent0._DefaultValueAccessor_54_3, Decl(complexNarrowingWithAny.ts, 273, 13)) +>this : Symbol(_View_AppComponent0, Decl(complexNarrowingWithAny.ts, 126, 1)) +>_DefaultValueAccessor_54_3 : Symbol(_View_AppComponent0._DefaultValueAccessor_54_3, Decl(complexNarrowingWithAny.ts, 273, 13)) + + if (((token === import49.NG_VALUE_ACCESSOR) && (54 === requestNodeIndex))) { return this._NG_VALUE_ACCESSOR_54_4; } +>token : Symbol(token, Decl(complexNarrowingWithAny.ts, 448, 22)) +>import49.NG_VALUE_ACCESSOR : Symbol(import49.NG_VALUE_ACCESSOR, Decl(complexNarrowingWithAny.ts, 103, 11)) +>import49 : Symbol(import49, Decl(complexNarrowingWithAny.ts, 94, 1)) +>NG_VALUE_ACCESSOR : Symbol(import49.NG_VALUE_ACCESSOR, Decl(complexNarrowingWithAny.ts, 103, 11)) +>requestNodeIndex : Symbol(requestNodeIndex, Decl(complexNarrowingWithAny.ts, 448, 32)) +>this._NG_VALUE_ACCESSOR_54_4 : Symbol(_View_AppComponent0._NG_VALUE_ACCESSOR_54_4, Decl(complexNarrowingWithAny.ts, 274, 59)) +>this : Symbol(_View_AppComponent0, Decl(complexNarrowingWithAny.ts, 126, 1)) +>_NG_VALUE_ACCESSOR_54_4 : Symbol(_View_AppComponent0._NG_VALUE_ACCESSOR_54_4, Decl(complexNarrowingWithAny.ts, 274, 59)) + + if (((token === import47.FormControlName) && (54 === requestNodeIndex))) { return this._FormControlName_54_5; } +>token : Symbol(token, Decl(complexNarrowingWithAny.ts, 448, 22)) +>import47.FormControlName : Symbol(import47.FormControlName, Decl(complexNarrowingWithAny.ts, 84, 20)) +>import47 : Symbol(import47, Decl(complexNarrowingWithAny.ts, 82, 1)) +>FormControlName : Symbol(import47.FormControlName, Decl(complexNarrowingWithAny.ts, 84, 20)) +>requestNodeIndex : Symbol(requestNodeIndex, Decl(complexNarrowingWithAny.ts, 448, 32)) +>this._FormControlName_54_5 : Symbol(_View_AppComponent0._FormControlName_54_5, Decl(complexNarrowingWithAny.ts, 275, 32)) +>this : Symbol(_View_AppComponent0, Decl(complexNarrowingWithAny.ts, 126, 1)) +>_FormControlName_54_5 : Symbol(_View_AppComponent0._FormControlName_54_5, Decl(complexNarrowingWithAny.ts, 275, 32)) + + if (((token === import50.NgControl) && (54 === requestNodeIndex))) { return this._NgControl_54_6; } +>token : Symbol(token, Decl(complexNarrowingWithAny.ts, 448, 22)) +>import50.NgControl : Symbol(import50.NgControl, Decl(complexNarrowingWithAny.ts, 116, 20)) +>import50 : Symbol(import50, Decl(complexNarrowingWithAny.ts, 104, 1)) +>NgControl : Symbol(import50.NgControl, Decl(complexNarrowingWithAny.ts, 116, 20)) +>requestNodeIndex : Symbol(requestNodeIndex, Decl(complexNarrowingWithAny.ts, 448, 32)) +>this._NgControl_54_6 : Symbol(_View_AppComponent0._NgControl_54_6, Decl(complexNarrowingWithAny.ts, 276, 49)) +>this : Symbol(_View_AppComponent0, Decl(complexNarrowingWithAny.ts, 126, 1)) +>_NgControl_54_6 : Symbol(_View_AppComponent0._NgControl_54_6, Decl(complexNarrowingWithAny.ts, 276, 49)) + + if (((token === import45.NgControlStatus) && (54 === requestNodeIndex))) { return this._NgControlStatus_54_7; } +>token : Symbol(token, Decl(complexNarrowingWithAny.ts, 448, 22)) +>import45.NgControlStatus : Symbol(import45.NgControlStatus, Decl(complexNarrowingWithAny.ts, 69, 20)) +>import45 : Symbol(import45, Decl(complexNarrowingWithAny.ts, 67, 1)) +>NgControlStatus : Symbol(import45.NgControlStatus, Decl(complexNarrowingWithAny.ts, 69, 20)) +>requestNodeIndex : Symbol(requestNodeIndex, Decl(complexNarrowingWithAny.ts, 448, 32)) +>this._NgControlStatus_54_7 : Symbol(_View_AppComponent0._NgControlStatus_54_7, Decl(complexNarrowingWithAny.ts, 277, 22)) +>this : Symbol(_View_AppComponent0, Decl(complexNarrowingWithAny.ts, 126, 1)) +>_NgControlStatus_54_7 : Symbol(_View_AppComponent0._NgControlStatus_54_7, Decl(complexNarrowingWithAny.ts, 277, 22)) + + if (((token === import46.DefaultValueAccessor) && (57 === requestNodeIndex))) { return this._DefaultValueAccessor_57_3; } +>token : Symbol(token, Decl(complexNarrowingWithAny.ts, 448, 22)) +>import46.DefaultValueAccessor : Symbol(import46.DefaultValueAccessor, Decl(complexNarrowingWithAny.ts, 78, 20)) +>import46 : Symbol(import46, Decl(complexNarrowingWithAny.ts, 76, 1)) +>DefaultValueAccessor : Symbol(import46.DefaultValueAccessor, Decl(complexNarrowingWithAny.ts, 78, 20)) +>requestNodeIndex : Symbol(requestNodeIndex, Decl(complexNarrowingWithAny.ts, 448, 32)) +>this._DefaultValueAccessor_57_3 : Symbol(_View_AppComponent0._DefaultValueAccessor_57_3, Decl(complexNarrowingWithAny.ts, 281, 13)) +>this : Symbol(_View_AppComponent0, Decl(complexNarrowingWithAny.ts, 126, 1)) +>_DefaultValueAccessor_57_3 : Symbol(_View_AppComponent0._DefaultValueAccessor_57_3, Decl(complexNarrowingWithAny.ts, 281, 13)) + + if (((token === import49.NG_VALUE_ACCESSOR) && (57 === requestNodeIndex))) { return this._NG_VALUE_ACCESSOR_57_4; } +>token : Symbol(token, Decl(complexNarrowingWithAny.ts, 448, 22)) +>import49.NG_VALUE_ACCESSOR : Symbol(import49.NG_VALUE_ACCESSOR, Decl(complexNarrowingWithAny.ts, 103, 11)) +>import49 : Symbol(import49, Decl(complexNarrowingWithAny.ts, 94, 1)) +>NG_VALUE_ACCESSOR : Symbol(import49.NG_VALUE_ACCESSOR, Decl(complexNarrowingWithAny.ts, 103, 11)) +>requestNodeIndex : Symbol(requestNodeIndex, Decl(complexNarrowingWithAny.ts, 448, 32)) +>this._NG_VALUE_ACCESSOR_57_4 : Symbol(_View_AppComponent0._NG_VALUE_ACCESSOR_57_4, Decl(complexNarrowingWithAny.ts, 282, 59)) +>this : Symbol(_View_AppComponent0, Decl(complexNarrowingWithAny.ts, 126, 1)) +>_NG_VALUE_ACCESSOR_57_4 : Symbol(_View_AppComponent0._NG_VALUE_ACCESSOR_57_4, Decl(complexNarrowingWithAny.ts, 282, 59)) + + if (((token === import47.FormControlName) && (57 === requestNodeIndex))) { return this._FormControlName_57_5; } +>token : Symbol(token, Decl(complexNarrowingWithAny.ts, 448, 22)) +>import47.FormControlName : Symbol(import47.FormControlName, Decl(complexNarrowingWithAny.ts, 84, 20)) +>import47 : Symbol(import47, Decl(complexNarrowingWithAny.ts, 82, 1)) +>FormControlName : Symbol(import47.FormControlName, Decl(complexNarrowingWithAny.ts, 84, 20)) +>requestNodeIndex : Symbol(requestNodeIndex, Decl(complexNarrowingWithAny.ts, 448, 32)) +>this._FormControlName_57_5 : Symbol(_View_AppComponent0._FormControlName_57_5, Decl(complexNarrowingWithAny.ts, 283, 32)) +>this : Symbol(_View_AppComponent0, Decl(complexNarrowingWithAny.ts, 126, 1)) +>_FormControlName_57_5 : Symbol(_View_AppComponent0._FormControlName_57_5, Decl(complexNarrowingWithAny.ts, 283, 32)) + + if (((token === import50.NgControl) && (57 === requestNodeIndex))) { return this._NgControl_57_6; } +>token : Symbol(token, Decl(complexNarrowingWithAny.ts, 448, 22)) +>import50.NgControl : Symbol(import50.NgControl, Decl(complexNarrowingWithAny.ts, 116, 20)) +>import50 : Symbol(import50, Decl(complexNarrowingWithAny.ts, 104, 1)) +>NgControl : Symbol(import50.NgControl, Decl(complexNarrowingWithAny.ts, 116, 20)) +>requestNodeIndex : Symbol(requestNodeIndex, Decl(complexNarrowingWithAny.ts, 448, 32)) +>this._NgControl_57_6 : Symbol(_View_AppComponent0._NgControl_57_6, Decl(complexNarrowingWithAny.ts, 284, 49)) +>this : Symbol(_View_AppComponent0, Decl(complexNarrowingWithAny.ts, 126, 1)) +>_NgControl_57_6 : Symbol(_View_AppComponent0._NgControl_57_6, Decl(complexNarrowingWithAny.ts, 284, 49)) + + if (((token === import45.NgControlStatus) && (57 === requestNodeIndex))) { return this._NgControlStatus_57_7; } +>token : Symbol(token, Decl(complexNarrowingWithAny.ts, 448, 22)) +>import45.NgControlStatus : Symbol(import45.NgControlStatus, Decl(complexNarrowingWithAny.ts, 69, 20)) +>import45 : Symbol(import45, Decl(complexNarrowingWithAny.ts, 67, 1)) +>NgControlStatus : Symbol(import45.NgControlStatus, Decl(complexNarrowingWithAny.ts, 69, 20)) +>requestNodeIndex : Symbol(requestNodeIndex, Decl(complexNarrowingWithAny.ts, 448, 32)) +>this._NgControlStatus_57_7 : Symbol(_View_AppComponent0._NgControlStatus_57_7, Decl(complexNarrowingWithAny.ts, 285, 22)) +>this : Symbol(_View_AppComponent0, Decl(complexNarrowingWithAny.ts, 126, 1)) +>_NgControlStatus_57_7 : Symbol(_View_AppComponent0._NgControlStatus_57_7, Decl(complexNarrowingWithAny.ts, 285, 22)) + + if (((token === import46.DefaultValueAccessor) && (60 === requestNodeIndex))) { return this._DefaultValueAccessor_60_3; } +>token : Symbol(token, Decl(complexNarrowingWithAny.ts, 448, 22)) +>import46.DefaultValueAccessor : Symbol(import46.DefaultValueAccessor, Decl(complexNarrowingWithAny.ts, 78, 20)) +>import46 : Symbol(import46, Decl(complexNarrowingWithAny.ts, 76, 1)) +>DefaultValueAccessor : Symbol(import46.DefaultValueAccessor, Decl(complexNarrowingWithAny.ts, 78, 20)) +>requestNodeIndex : Symbol(requestNodeIndex, Decl(complexNarrowingWithAny.ts, 448, 32)) +>this._DefaultValueAccessor_60_3 : Symbol(_View_AppComponent0._DefaultValueAccessor_60_3, Decl(complexNarrowingWithAny.ts, 289, 13)) +>this : Symbol(_View_AppComponent0, Decl(complexNarrowingWithAny.ts, 126, 1)) +>_DefaultValueAccessor_60_3 : Symbol(_View_AppComponent0._DefaultValueAccessor_60_3, Decl(complexNarrowingWithAny.ts, 289, 13)) + + if (((token === import49.NG_VALUE_ACCESSOR) && (60 === requestNodeIndex))) { return this._NG_VALUE_ACCESSOR_60_4; } +>token : Symbol(token, Decl(complexNarrowingWithAny.ts, 448, 22)) +>import49.NG_VALUE_ACCESSOR : Symbol(import49.NG_VALUE_ACCESSOR, Decl(complexNarrowingWithAny.ts, 103, 11)) +>import49 : Symbol(import49, Decl(complexNarrowingWithAny.ts, 94, 1)) +>NG_VALUE_ACCESSOR : Symbol(import49.NG_VALUE_ACCESSOR, Decl(complexNarrowingWithAny.ts, 103, 11)) +>requestNodeIndex : Symbol(requestNodeIndex, Decl(complexNarrowingWithAny.ts, 448, 32)) +>this._NG_VALUE_ACCESSOR_60_4 : Symbol(_View_AppComponent0._NG_VALUE_ACCESSOR_60_4, Decl(complexNarrowingWithAny.ts, 290, 59)) +>this : Symbol(_View_AppComponent0, Decl(complexNarrowingWithAny.ts, 126, 1)) +>_NG_VALUE_ACCESSOR_60_4 : Symbol(_View_AppComponent0._NG_VALUE_ACCESSOR_60_4, Decl(complexNarrowingWithAny.ts, 290, 59)) + + if (((token === import47.FormControlName) && (60 === requestNodeIndex))) { return this._FormControlName_60_5; } +>token : Symbol(token, Decl(complexNarrowingWithAny.ts, 448, 22)) +>import47.FormControlName : Symbol(import47.FormControlName, Decl(complexNarrowingWithAny.ts, 84, 20)) +>import47 : Symbol(import47, Decl(complexNarrowingWithAny.ts, 82, 1)) +>FormControlName : Symbol(import47.FormControlName, Decl(complexNarrowingWithAny.ts, 84, 20)) +>requestNodeIndex : Symbol(requestNodeIndex, Decl(complexNarrowingWithAny.ts, 448, 32)) +>this._FormControlName_60_5 : Symbol(_View_AppComponent0._FormControlName_60_5, Decl(complexNarrowingWithAny.ts, 291, 32)) +>this : Symbol(_View_AppComponent0, Decl(complexNarrowingWithAny.ts, 126, 1)) +>_FormControlName_60_5 : Symbol(_View_AppComponent0._FormControlName_60_5, Decl(complexNarrowingWithAny.ts, 291, 32)) + + if (((token === import50.NgControl) && (60 === requestNodeIndex))) { return this._NgControl_60_6; } +>token : Symbol(token, Decl(complexNarrowingWithAny.ts, 448, 22)) +>import50.NgControl : Symbol(import50.NgControl, Decl(complexNarrowingWithAny.ts, 116, 20)) +>import50 : Symbol(import50, Decl(complexNarrowingWithAny.ts, 104, 1)) +>NgControl : Symbol(import50.NgControl, Decl(complexNarrowingWithAny.ts, 116, 20)) +>requestNodeIndex : Symbol(requestNodeIndex, Decl(complexNarrowingWithAny.ts, 448, 32)) +>this._NgControl_60_6 : Symbol(_View_AppComponent0._NgControl_60_6, Decl(complexNarrowingWithAny.ts, 292, 49)) +>this : Symbol(_View_AppComponent0, Decl(complexNarrowingWithAny.ts, 126, 1)) +>_NgControl_60_6 : Symbol(_View_AppComponent0._NgControl_60_6, Decl(complexNarrowingWithAny.ts, 292, 49)) + + if (((token === import45.NgControlStatus) && (60 === requestNodeIndex))) { return this._NgControlStatus_60_7; } +>token : Symbol(token, Decl(complexNarrowingWithAny.ts, 448, 22)) +>import45.NgControlStatus : Symbol(import45.NgControlStatus, Decl(complexNarrowingWithAny.ts, 69, 20)) +>import45 : Symbol(import45, Decl(complexNarrowingWithAny.ts, 67, 1)) +>NgControlStatus : Symbol(import45.NgControlStatus, Decl(complexNarrowingWithAny.ts, 69, 20)) +>requestNodeIndex : Symbol(requestNodeIndex, Decl(complexNarrowingWithAny.ts, 448, 32)) +>this._NgControlStatus_60_7 : Symbol(_View_AppComponent0._NgControlStatus_60_7, Decl(complexNarrowingWithAny.ts, 293, 22)) +>this : Symbol(_View_AppComponent0, Decl(complexNarrowingWithAny.ts, 126, 1)) +>_NgControlStatus_60_7 : Symbol(_View_AppComponent0._NgControlStatus_60_7, Decl(complexNarrowingWithAny.ts, 293, 22)) + + if (((token === import44.FormGroupDirective) && ((1 <= requestNodeIndex) && (requestNodeIndex <= 62)))) { return this._FormGroupDirective_1_3; } +>token : Symbol(token, Decl(complexNarrowingWithAny.ts, 448, 22)) +>import44.FormGroupDirective : Symbol(import44.FormGroupDirective, Decl(complexNarrowingWithAny.ts, 63, 20)) +>import44 : Symbol(import44, Decl(complexNarrowingWithAny.ts, 0, 0)) +>FormGroupDirective : Symbol(import44.FormGroupDirective, Decl(complexNarrowingWithAny.ts, 63, 20)) +>requestNodeIndex : Symbol(requestNodeIndex, Decl(complexNarrowingWithAny.ts, 448, 32)) +>requestNodeIndex : Symbol(requestNodeIndex, Decl(complexNarrowingWithAny.ts, 448, 32)) +>this._FormGroupDirective_1_3 : Symbol(_View_AppComponent0._FormGroupDirective_1_3, Decl(complexNarrowingWithAny.ts, 132, 12)) +>this : Symbol(_View_AppComponent0, Decl(complexNarrowingWithAny.ts, 126, 1)) +>_FormGroupDirective_1_3 : Symbol(_View_AppComponent0._FormGroupDirective_1_3, Decl(complexNarrowingWithAny.ts, 132, 12)) + + if (((token === import51.ControlContainer) && ((1 <= requestNodeIndex) && (requestNodeIndex <= 62)))) { return this._ControlContainer_1_4; } +>token : Symbol(token, Decl(complexNarrowingWithAny.ts, 448, 22)) +>import51.ControlContainer : Symbol(import51.ControlContainer, Decl(complexNarrowingWithAny.ts, 122, 20)) +>import51 : Symbol(import51, Decl(complexNarrowingWithAny.ts, 120, 1)) +>ControlContainer : Symbol(import51.ControlContainer, Decl(complexNarrowingWithAny.ts, 122, 20)) +>requestNodeIndex : Symbol(requestNodeIndex, Decl(complexNarrowingWithAny.ts, 448, 32)) +>requestNodeIndex : Symbol(requestNodeIndex, Decl(complexNarrowingWithAny.ts, 448, 32)) +>this._ControlContainer_1_4 : Symbol(_View_AppComponent0._ControlContainer_1_4, Decl(complexNarrowingWithAny.ts, 133, 54)) +>this : Symbol(_View_AppComponent0, Decl(complexNarrowingWithAny.ts, 126, 1)) +>_ControlContainer_1_4 : Symbol(_View_AppComponent0._ControlContainer_1_4, Decl(complexNarrowingWithAny.ts, 133, 54)) + + if (((token === import45.NgControlStatusGroup) && ((1 <= requestNodeIndex) && (requestNodeIndex <= 62)))) { return this._NgControlStatusGroup_1_5; } +>token : Symbol(token, Decl(complexNarrowingWithAny.ts, 448, 22)) +>import45.NgControlStatusGroup : Symbol(import45.NgControlStatusGroup, Decl(complexNarrowingWithAny.ts, 72, 2)) +>import45 : Symbol(import45, Decl(complexNarrowingWithAny.ts, 67, 1)) +>NgControlStatusGroup : Symbol(import45.NgControlStatusGroup, Decl(complexNarrowingWithAny.ts, 72, 2)) +>requestNodeIndex : Symbol(requestNodeIndex, Decl(complexNarrowingWithAny.ts, 448, 32)) +>requestNodeIndex : Symbol(requestNodeIndex, Decl(complexNarrowingWithAny.ts, 448, 32)) +>this._NgControlStatusGroup_1_5 : Symbol(_View_AppComponent0._NgControlStatusGroup_1_5, Decl(complexNarrowingWithAny.ts, 134, 28)) +>this : Symbol(_View_AppComponent0, Decl(complexNarrowingWithAny.ts, 126, 1)) +>_NgControlStatusGroup_1_5 : Symbol(_View_AppComponent0._NgControlStatusGroup_1_5, Decl(complexNarrowingWithAny.ts, 134, 28)) + + return notFoundResult; +>notFoundResult : Symbol(notFoundResult, Decl(complexNarrowingWithAny.ts, 448, 56)) + } +} +export function viewFactory_AppComponent0(viewUtils:any,parentInjector:any,declarationEl:any):any { +>viewFactory_AppComponent0 : Symbol(viewFactory_AppComponent0, Decl(complexNarrowingWithAny.ts, 554, 1)) +>viewUtils : Symbol(viewUtils, Decl(complexNarrowingWithAny.ts, 555, 42)) +>parentInjector : Symbol(parentInjector, Decl(complexNarrowingWithAny.ts, 555, 56)) +>declarationEl : Symbol(declarationEl, Decl(complexNarrowingWithAny.ts, 555, 75)) + + return new _View_AppComponent0(viewUtils,parentInjector,declarationEl); +>_View_AppComponent0 : Symbol(_View_AppComponent0, Decl(complexNarrowingWithAny.ts, 126, 1)) +>viewUtils : Symbol(viewUtils, Decl(complexNarrowingWithAny.ts, 555, 42)) +>parentInjector : Symbol(parentInjector, Decl(complexNarrowingWithAny.ts, 555, 56)) +>declarationEl : Symbol(declarationEl, Decl(complexNarrowingWithAny.ts, 555, 75)) +} + diff --git a/tests/baselines/reference/complexNarrowingWithAny.types b/tests/baselines/reference/complexNarrowingWithAny.types new file mode 100644 index 00000000000..656621b7a7a --- /dev/null +++ b/tests/baselines/reference/complexNarrowingWithAny.types @@ -0,0 +1,3043 @@ +=== tests/cases/compiler/complexNarrowingWithAny.ts === +// Repro from #10869 + +/** + * This file is generated by the Angular 2 template compiler. + * Do not edit. + */ + /* tslint:disable */ + +// import * as import0 from '@angular/core/src/linker/ng_module_factory'; +// import * as import1 from '../../app'; +// import * as import2 from '@angular/common/src/common_module'; +// import * as import3 from '@angular/core/src/application_module'; +// import * as import4 from '@angular/platform-browser/src/browser'; +// import * as import5 from '@angular/forms/src/directives'; +// import * as import6 from '@angular/forms/src/form_providers'; +// import * as import7 from '@angular/common/src/localization'; +// import * as import8 from '@angular/core/src/application_init'; +// import * as import9 from '@angular/core/src/testability/testability'; +// import * as import10 from '@angular/core/src/application_ref'; +// import * as import11 from '@angular/core/src/linker/compiler'; +// import * as import12 from '@angular/platform-browser/src/dom/events/hammer_gestures'; +// import * as import13 from '@angular/platform-browser/src/dom/events/event_manager'; +// import * as import14 from '@angular/platform-browser/src/dom/shared_styles_host'; +// import * as import15 from '@angular/platform-browser/src/dom/dom_renderer'; +// import * as import16 from '@angular/platform-browser/src/security/dom_sanitization_service'; +// import * as import17 from '@angular/core/src/linker/view_utils'; +// import * as import18 from '@angular/forms/src/form_builder'; +// import * as import19 from '@angular/forms/src/directives/radio_control_value_accessor'; +// import * as import20 from '@angular/core/src/di/injector'; +// import * as import21 from '@angular/core/src/application_tokens'; +// import * as import22 from '@angular/platform-browser/src/dom/events/dom_events'; +// import * as import23 from '@angular/platform-browser/src/dom/events/key_events'; +// import * as import24 from '@angular/core/src/zone/ng_zone'; +// import * as import25 from '@angular/platform-browser/src/dom/debug/ng_probe'; +// import * as import26 from '@angular/core/src/console'; +// import * as import27 from '@angular/core/src/i18n/tokens'; +// import * as import28 from '@angular/core/src/error_handler'; +// import * as import29 from '@angular/platform-browser/src/dom/dom_tokens'; +// import * as import30 from '@angular/platform-browser/src/dom/animation_driver'; +// import * as import31 from '@angular/core/src/render/api'; +// import * as import32 from '@angular/core/src/security'; +// import * as import33 from '@angular/core/src/change_detection/differs/iterable_differs'; +// import * as import34 from '@angular/core/src/change_detection/differs/keyvalue_differs'; +// import * as import35 from '@angular/core/src/i18n/tokens'; +// import * as import36 from '@angular/core/src/render/api'; +// import * as import37 from '@angular/core/src/linker/view'; +// import * as import38 from '@angular/core/src/linker/element'; +// import * as import39 from '@angular/core/src/linker/view_utils'; +// import * as import40 from '@angular/core/src/linker/view_type'; +// import * as import41 from '@angular/core/src/change_detection/change_detection'; +// import * as import42 from '@angular/core/src/metadata/view'; +// import * as import43 from '@angular/core/src/linker/component_factory'; +// import * as import44 from '@angular/forms/src/directives/reactive_directives/form_group_directive'; +// import * as import45 from '@angular/forms/src/directives/ng_control_status'; +// import * as import46 from '@angular/forms/src/directives/default_value_accessor'; +// import * as import47 from '@angular/forms/src/directives/reactive_directives/form_control_name'; +// import * as import48 from '@angular/core/src/linker/element_ref'; +// import * as import49 from '@angular/forms/src/directives/control_value_accessor'; +// import * as import50 from '@angular/forms/src/directives/ng_control'; +// import * as import51 from '@angular/forms/src/directives/control_container'; + +//stubbed out imports + +namespace import44 { +>import44 : typeof import44 + + export class FormGroupDirective { +>FormGroupDirective : FormGroupDirective + + constructor(any){} +>any : any + } +} + +namespace import45 { +>import45 : typeof import45 + + export class NgControlStatus { +>NgControlStatus : NgControlStatus + + constructor(any){} +>any : any + } + export class NgControlStatusGroup { +>NgControlStatusGroup : NgControlStatusGroup + + constructor(any){} +>any : any + } +} + +namespace import46 { +>import46 : typeof import46 + + export class DefaultValueAccessor { +>DefaultValueAccessor : DefaultValueAccessor + + constructor(any){} +>any : any + } +} + +namespace import47 { +>import47 : typeof import47 + + export class FormControlName { +>FormControlName : FormControlName + + constructor(any){} +>any : any + } +} + +namespace import48 { +>import48 : typeof import48 + + export class FormControlName { +>FormControlName : FormControlName + + constructor(any){} +>any : any + } +} + + +//HERE BE DRAGONS + +//Using a value here - 65+ seconds to typecheck +namespace import49 { +>import49 : typeof import49 + + //real code uses an opaque token, using new String() to simulate. + //export var NG_VALUE_ACCESSOR = new OpaqueToken('ngValueAccessor') + export var NG_VALUE_ACCESSOR = new String('foo') +>NG_VALUE_ACCESSOR : String +>new String('foo') : String +>String : StringConstructor +>'foo' : "foo" +} + +//using a class - < 1 sec typecheck +// namespace import49 { +// export class NG_VALUE_ACCESSOR { +// constructor(any){} +// } +// } + +//END DRAGONS + + +namespace import50 { +>import50 : typeof import50 + + export class NgControl { +>NgControl : NgControl + + constructor(any){} +>any : any + } +} + +namespace import51 { +>import51 : typeof import51 + + export class ControlContainer { +>ControlContainer : ControlContainer + + constructor(any){} +>any : any + } +} + + + +class _View_AppComponent0 { +>_View_AppComponent0 : _View_AppComponent0 + + _text_0:any; +>_text_0 : any + + _el_1:any; +>_el_1 : any + + _FormGroupDirective_1_3:import44.FormGroupDirective; +>_FormGroupDirective_1_3 : import44.FormGroupDirective +>import44 : any +>FormGroupDirective : import44.FormGroupDirective + + _ControlContainer_1_4:any; +>_ControlContainer_1_4 : any + + _NgControlStatusGroup_1_5:import45.NgControlStatusGroup; +>_NgControlStatusGroup_1_5 : import45.NgControlStatusGroup +>import45 : any +>NgControlStatusGroup : import45.NgControlStatusGroup + + _text_2:any; +>_text_2 : any + + _el_3:any; +>_el_3 : any + + _DefaultValueAccessor_3_3:import46.DefaultValueAccessor; +>_DefaultValueAccessor_3_3 : import46.DefaultValueAccessor +>import46 : any +>DefaultValueAccessor : import46.DefaultValueAccessor + + _NG_VALUE_ACCESSOR_3_4:any[]; +>_NG_VALUE_ACCESSOR_3_4 : any[] + + _FormControlName_3_5:import47.FormControlName; +>_FormControlName_3_5 : import47.FormControlName +>import47 : any +>FormControlName : import47.FormControlName + + _NgControl_3_6:any; +>_NgControl_3_6 : any + + _NgControlStatus_3_7:import45.NgControlStatus; +>_NgControlStatus_3_7 : import45.NgControlStatus +>import45 : any +>NgControlStatus : import45.NgControlStatus + + _el_4:any; +>_el_4 : any + + _text_5:any; +>_text_5 : any + + _el_6:any; +>_el_6 : any + + _DefaultValueAccessor_6_3:import46.DefaultValueAccessor; +>_DefaultValueAccessor_6_3 : import46.DefaultValueAccessor +>import46 : any +>DefaultValueAccessor : import46.DefaultValueAccessor + + _NG_VALUE_ACCESSOR_6_4:any[]; +>_NG_VALUE_ACCESSOR_6_4 : any[] + + _FormControlName_6_5:import47.FormControlName; +>_FormControlName_6_5 : import47.FormControlName +>import47 : any +>FormControlName : import47.FormControlName + + _NgControl_6_6:any; +>_NgControl_6_6 : any + + _NgControlStatus_6_7:import45.NgControlStatus; +>_NgControlStatus_6_7 : import45.NgControlStatus +>import45 : any +>NgControlStatus : import45.NgControlStatus + + _el_7:any; +>_el_7 : any + + _text_8:any; +>_text_8 : any + + _el_9:any; +>_el_9 : any + + _DefaultValueAccessor_9_3:import46.DefaultValueAccessor; +>_DefaultValueAccessor_9_3 : import46.DefaultValueAccessor +>import46 : any +>DefaultValueAccessor : import46.DefaultValueAccessor + + _NG_VALUE_ACCESSOR_9_4:any[]; +>_NG_VALUE_ACCESSOR_9_4 : any[] + + _FormControlName_9_5:import47.FormControlName; +>_FormControlName_9_5 : import47.FormControlName +>import47 : any +>FormControlName : import47.FormControlName + + _NgControl_9_6:any; +>_NgControl_9_6 : any + + _NgControlStatus_9_7:import45.NgControlStatus; +>_NgControlStatus_9_7 : import45.NgControlStatus +>import45 : any +>NgControlStatus : import45.NgControlStatus + + _el_10:any; +>_el_10 : any + + _text_11:any; +>_text_11 : any + + _el_12:any; +>_el_12 : any + + _DefaultValueAccessor_12_3:import46.DefaultValueAccessor; +>_DefaultValueAccessor_12_3 : import46.DefaultValueAccessor +>import46 : any +>DefaultValueAccessor : import46.DefaultValueAccessor + + _NG_VALUE_ACCESSOR_12_4:any[]; +>_NG_VALUE_ACCESSOR_12_4 : any[] + + _FormControlName_12_5:import47.FormControlName; +>_FormControlName_12_5 : import47.FormControlName +>import47 : any +>FormControlName : import47.FormControlName + + _NgControl_12_6:any; +>_NgControl_12_6 : any + + _NgControlStatus_12_7:import45.NgControlStatus; +>_NgControlStatus_12_7 : import45.NgControlStatus +>import45 : any +>NgControlStatus : import45.NgControlStatus + + _el_13:any; +>_el_13 : any + + _text_14:any; +>_text_14 : any + + _el_15:any; +>_el_15 : any + + _DefaultValueAccessor_15_3:import46.DefaultValueAccessor; +>_DefaultValueAccessor_15_3 : import46.DefaultValueAccessor +>import46 : any +>DefaultValueAccessor : import46.DefaultValueAccessor + + _NG_VALUE_ACCESSOR_15_4:any[]; +>_NG_VALUE_ACCESSOR_15_4 : any[] + + _FormControlName_15_5:import47.FormControlName; +>_FormControlName_15_5 : import47.FormControlName +>import47 : any +>FormControlName : import47.FormControlName + + _NgControl_15_6:any; +>_NgControl_15_6 : any + + _NgControlStatus_15_7:import45.NgControlStatus; +>_NgControlStatus_15_7 : import45.NgControlStatus +>import45 : any +>NgControlStatus : import45.NgControlStatus + + _el_16:any; +>_el_16 : any + + _text_17:any; +>_text_17 : any + + _el_18:any; +>_el_18 : any + + _DefaultValueAccessor_18_3:import46.DefaultValueAccessor; +>_DefaultValueAccessor_18_3 : import46.DefaultValueAccessor +>import46 : any +>DefaultValueAccessor : import46.DefaultValueAccessor + + _NG_VALUE_ACCESSOR_18_4:any[]; +>_NG_VALUE_ACCESSOR_18_4 : any[] + + _FormControlName_18_5:import47.FormControlName; +>_FormControlName_18_5 : import47.FormControlName +>import47 : any +>FormControlName : import47.FormControlName + + _NgControl_18_6:any; +>_NgControl_18_6 : any + + _NgControlStatus_18_7:import45.NgControlStatus; +>_NgControlStatus_18_7 : import45.NgControlStatus +>import45 : any +>NgControlStatus : import45.NgControlStatus + + _el_19:any; +>_el_19 : any + + _text_20:any; +>_text_20 : any + + _el_21:any; +>_el_21 : any + + _DefaultValueAccessor_21_3:import46.DefaultValueAccessor; +>_DefaultValueAccessor_21_3 : import46.DefaultValueAccessor +>import46 : any +>DefaultValueAccessor : import46.DefaultValueAccessor + + _NG_VALUE_ACCESSOR_21_4:any[]; +>_NG_VALUE_ACCESSOR_21_4 : any[] + + _FormControlName_21_5:import47.FormControlName; +>_FormControlName_21_5 : import47.FormControlName +>import47 : any +>FormControlName : import47.FormControlName + + _NgControl_21_6:any; +>_NgControl_21_6 : any + + _NgControlStatus_21_7:import45.NgControlStatus; +>_NgControlStatus_21_7 : import45.NgControlStatus +>import45 : any +>NgControlStatus : import45.NgControlStatus + + _el_22:any; +>_el_22 : any + + _text_23:any; +>_text_23 : any + + _el_24:any; +>_el_24 : any + + _DefaultValueAccessor_24_3:import46.DefaultValueAccessor; +>_DefaultValueAccessor_24_3 : import46.DefaultValueAccessor +>import46 : any +>DefaultValueAccessor : import46.DefaultValueAccessor + + _NG_VALUE_ACCESSOR_24_4:any[]; +>_NG_VALUE_ACCESSOR_24_4 : any[] + + _FormControlName_24_5:import47.FormControlName; +>_FormControlName_24_5 : import47.FormControlName +>import47 : any +>FormControlName : import47.FormControlName + + _NgControl_24_6:any; +>_NgControl_24_6 : any + + _NgControlStatus_24_7:import45.NgControlStatus; +>_NgControlStatus_24_7 : import45.NgControlStatus +>import45 : any +>NgControlStatus : import45.NgControlStatus + + _el_25:any; +>_el_25 : any + + _text_26:any; +>_text_26 : any + + _el_27:any; +>_el_27 : any + + _DefaultValueAccessor_27_3:import46.DefaultValueAccessor; +>_DefaultValueAccessor_27_3 : import46.DefaultValueAccessor +>import46 : any +>DefaultValueAccessor : import46.DefaultValueAccessor + + _NG_VALUE_ACCESSOR_27_4:any[]; +>_NG_VALUE_ACCESSOR_27_4 : any[] + + _FormControlName_27_5:import47.FormControlName; +>_FormControlName_27_5 : import47.FormControlName +>import47 : any +>FormControlName : import47.FormControlName + + _NgControl_27_6:any; +>_NgControl_27_6 : any + + _NgControlStatus_27_7:import45.NgControlStatus; +>_NgControlStatus_27_7 : import45.NgControlStatus +>import45 : any +>NgControlStatus : import45.NgControlStatus + + _el_28:any; +>_el_28 : any + + _text_29:any; +>_text_29 : any + + _el_30:any; +>_el_30 : any + + _DefaultValueAccessor_30_3:import46.DefaultValueAccessor; +>_DefaultValueAccessor_30_3 : import46.DefaultValueAccessor +>import46 : any +>DefaultValueAccessor : import46.DefaultValueAccessor + + _NG_VALUE_ACCESSOR_30_4:any[]; +>_NG_VALUE_ACCESSOR_30_4 : any[] + + _FormControlName_30_5:import47.FormControlName; +>_FormControlName_30_5 : import47.FormControlName +>import47 : any +>FormControlName : import47.FormControlName + + _NgControl_30_6:any; +>_NgControl_30_6 : any + + _NgControlStatus_30_7:import45.NgControlStatus; +>_NgControlStatus_30_7 : import45.NgControlStatus +>import45 : any +>NgControlStatus : import45.NgControlStatus + + _el_31:any; +>_el_31 : any + + _text_32:any; +>_text_32 : any + + _el_33:any; +>_el_33 : any + + _DefaultValueAccessor_33_3:import46.DefaultValueAccessor; +>_DefaultValueAccessor_33_3 : import46.DefaultValueAccessor +>import46 : any +>DefaultValueAccessor : import46.DefaultValueAccessor + + _NG_VALUE_ACCESSOR_33_4:any[]; +>_NG_VALUE_ACCESSOR_33_4 : any[] + + _FormControlName_33_5:import47.FormControlName; +>_FormControlName_33_5 : import47.FormControlName +>import47 : any +>FormControlName : import47.FormControlName + + _NgControl_33_6:any; +>_NgControl_33_6 : any + + _NgControlStatus_33_7:import45.NgControlStatus; +>_NgControlStatus_33_7 : import45.NgControlStatus +>import45 : any +>NgControlStatus : import45.NgControlStatus + + _el_34:any; +>_el_34 : any + + _text_35:any; +>_text_35 : any + + _el_36:any; +>_el_36 : any + + _DefaultValueAccessor_36_3:import46.DefaultValueAccessor; +>_DefaultValueAccessor_36_3 : import46.DefaultValueAccessor +>import46 : any +>DefaultValueAccessor : import46.DefaultValueAccessor + + _NG_VALUE_ACCESSOR_36_4:any[]; +>_NG_VALUE_ACCESSOR_36_4 : any[] + + _FormControlName_36_5:import47.FormControlName; +>_FormControlName_36_5 : import47.FormControlName +>import47 : any +>FormControlName : import47.FormControlName + + _NgControl_36_6:any; +>_NgControl_36_6 : any + + _NgControlStatus_36_7:import45.NgControlStatus; +>_NgControlStatus_36_7 : import45.NgControlStatus +>import45 : any +>NgControlStatus : import45.NgControlStatus + + _el_37:any; +>_el_37 : any + + _text_38:any; +>_text_38 : any + + _el_39:any; +>_el_39 : any + + _DefaultValueAccessor_39_3:import46.DefaultValueAccessor; +>_DefaultValueAccessor_39_3 : import46.DefaultValueAccessor +>import46 : any +>DefaultValueAccessor : import46.DefaultValueAccessor + + _NG_VALUE_ACCESSOR_39_4:any[]; +>_NG_VALUE_ACCESSOR_39_4 : any[] + + _FormControlName_39_5:import47.FormControlName; +>_FormControlName_39_5 : import47.FormControlName +>import47 : any +>FormControlName : import47.FormControlName + + _NgControl_39_6:any; +>_NgControl_39_6 : any + + _NgControlStatus_39_7:import45.NgControlStatus; +>_NgControlStatus_39_7 : import45.NgControlStatus +>import45 : any +>NgControlStatus : import45.NgControlStatus + + _el_40:any; +>_el_40 : any + + _text_41:any; +>_text_41 : any + + _el_42:any; +>_el_42 : any + + _DefaultValueAccessor_42_3:import46.DefaultValueAccessor; +>_DefaultValueAccessor_42_3 : import46.DefaultValueAccessor +>import46 : any +>DefaultValueAccessor : import46.DefaultValueAccessor + + _NG_VALUE_ACCESSOR_42_4:any[]; +>_NG_VALUE_ACCESSOR_42_4 : any[] + + _FormControlName_42_5:import47.FormControlName; +>_FormControlName_42_5 : import47.FormControlName +>import47 : any +>FormControlName : import47.FormControlName + + _NgControl_42_6:any; +>_NgControl_42_6 : any + + _NgControlStatus_42_7:import45.NgControlStatus; +>_NgControlStatus_42_7 : import45.NgControlStatus +>import45 : any +>NgControlStatus : import45.NgControlStatus + + _el_43:any; +>_el_43 : any + + _text_44:any; +>_text_44 : any + + _el_45:any; +>_el_45 : any + + _DefaultValueAccessor_45_3:import46.DefaultValueAccessor; +>_DefaultValueAccessor_45_3 : import46.DefaultValueAccessor +>import46 : any +>DefaultValueAccessor : import46.DefaultValueAccessor + + _NG_VALUE_ACCESSOR_45_4:any[]; +>_NG_VALUE_ACCESSOR_45_4 : any[] + + _FormControlName_45_5:import47.FormControlName; +>_FormControlName_45_5 : import47.FormControlName +>import47 : any +>FormControlName : import47.FormControlName + + _NgControl_45_6:any; +>_NgControl_45_6 : any + + _NgControlStatus_45_7:import45.NgControlStatus; +>_NgControlStatus_45_7 : import45.NgControlStatus +>import45 : any +>NgControlStatus : import45.NgControlStatus + + _el_46:any; +>_el_46 : any + + _text_47:any; +>_text_47 : any + + _el_48:any; +>_el_48 : any + + _DefaultValueAccessor_48_3:import46.DefaultValueAccessor; +>_DefaultValueAccessor_48_3 : import46.DefaultValueAccessor +>import46 : any +>DefaultValueAccessor : import46.DefaultValueAccessor + + _NG_VALUE_ACCESSOR_48_4:any[]; +>_NG_VALUE_ACCESSOR_48_4 : any[] + + _FormControlName_48_5:import47.FormControlName; +>_FormControlName_48_5 : import47.FormControlName +>import47 : any +>FormControlName : import47.FormControlName + + _NgControl_48_6:any; +>_NgControl_48_6 : any + + _NgControlStatus_48_7:import45.NgControlStatus; +>_NgControlStatus_48_7 : import45.NgControlStatus +>import45 : any +>NgControlStatus : import45.NgControlStatus + + _el_49:any; +>_el_49 : any + + _text_50:any; +>_text_50 : any + + _el_51:any; +>_el_51 : any + + _DefaultValueAccessor_51_3:import46.DefaultValueAccessor; +>_DefaultValueAccessor_51_3 : import46.DefaultValueAccessor +>import46 : any +>DefaultValueAccessor : import46.DefaultValueAccessor + + _NG_VALUE_ACCESSOR_51_4:any[]; +>_NG_VALUE_ACCESSOR_51_4 : any[] + + _FormControlName_51_5:import47.FormControlName; +>_FormControlName_51_5 : import47.FormControlName +>import47 : any +>FormControlName : import47.FormControlName + + _NgControl_51_6:any; +>_NgControl_51_6 : any + + _NgControlStatus_51_7:import45.NgControlStatus; +>_NgControlStatus_51_7 : import45.NgControlStatus +>import45 : any +>NgControlStatus : import45.NgControlStatus + + _el_52:any; +>_el_52 : any + + _text_53:any; +>_text_53 : any + + _el_54:any; +>_el_54 : any + + _DefaultValueAccessor_54_3:import46.DefaultValueAccessor; +>_DefaultValueAccessor_54_3 : import46.DefaultValueAccessor +>import46 : any +>DefaultValueAccessor : import46.DefaultValueAccessor + + _NG_VALUE_ACCESSOR_54_4:any[]; +>_NG_VALUE_ACCESSOR_54_4 : any[] + + _FormControlName_54_5:import47.FormControlName; +>_FormControlName_54_5 : import47.FormControlName +>import47 : any +>FormControlName : import47.FormControlName + + _NgControl_54_6:any; +>_NgControl_54_6 : any + + _NgControlStatus_54_7:import45.NgControlStatus; +>_NgControlStatus_54_7 : import45.NgControlStatus +>import45 : any +>NgControlStatus : import45.NgControlStatus + + _el_55:any; +>_el_55 : any + + _text_56:any; +>_text_56 : any + + _el_57:any; +>_el_57 : any + + _DefaultValueAccessor_57_3:import46.DefaultValueAccessor; +>_DefaultValueAccessor_57_3 : import46.DefaultValueAccessor +>import46 : any +>DefaultValueAccessor : import46.DefaultValueAccessor + + _NG_VALUE_ACCESSOR_57_4:any[]; +>_NG_VALUE_ACCESSOR_57_4 : any[] + + _FormControlName_57_5:import47.FormControlName; +>_FormControlName_57_5 : import47.FormControlName +>import47 : any +>FormControlName : import47.FormControlName + + _NgControl_57_6:any; +>_NgControl_57_6 : any + + _NgControlStatus_57_7:import45.NgControlStatus; +>_NgControlStatus_57_7 : import45.NgControlStatus +>import45 : any +>NgControlStatus : import45.NgControlStatus + + _el_58:any; +>_el_58 : any + + _text_59:any; +>_text_59 : any + + _el_60:any; +>_el_60 : any + + _DefaultValueAccessor_60_3:import46.DefaultValueAccessor; +>_DefaultValueAccessor_60_3 : import46.DefaultValueAccessor +>import46 : any +>DefaultValueAccessor : import46.DefaultValueAccessor + + _NG_VALUE_ACCESSOR_60_4:any[]; +>_NG_VALUE_ACCESSOR_60_4 : any[] + + _FormControlName_60_5:import47.FormControlName; +>_FormControlName_60_5 : import47.FormControlName +>import47 : any +>FormControlName : import47.FormControlName + + _NgControl_60_6:any; +>_NgControl_60_6 : any + + _NgControlStatus_60_7:import45.NgControlStatus; +>_NgControlStatus_60_7 : import45.NgControlStatus +>import45 : any +>NgControlStatus : import45.NgControlStatus + + _el_61:any; +>_el_61 : any + + _text_62:any; +>_text_62 : any + + _text_63:any; +>_text_63 : any + + /*private*/ _expr_2:any; +>_expr_2 : any + + /*private*/ _expr_3:any; +>_expr_3 : any + + /*private*/ _expr_4:any; +>_expr_4 : any + + /*private*/ _expr_5:any; +>_expr_5 : any + + /*private*/ _expr_6:any; +>_expr_6 : any + + /*private*/ _expr_7:any; +>_expr_7 : any + + /*private*/ _expr_8:any; +>_expr_8 : any + + /*private*/ _expr_11:any; +>_expr_11 : any + + /*private*/ _expr_12:any; +>_expr_12 : any + + /*private*/ _expr_13:any; +>_expr_13 : any + + /*private*/ _expr_14:any; +>_expr_14 : any + + /*private*/ _expr_15:any; +>_expr_15 : any + + /*private*/ _expr_16:any; +>_expr_16 : any + + /*private*/ _expr_17:any; +>_expr_17 : any + + /*private*/ _expr_20:any; +>_expr_20 : any + + /*private*/ _expr_21:any; +>_expr_21 : any + + /*private*/ _expr_22:any; +>_expr_22 : any + + /*private*/ _expr_23:any; +>_expr_23 : any + + /*private*/ _expr_24:any; +>_expr_24 : any + + /*private*/ _expr_25:any; +>_expr_25 : any + + /*private*/ _expr_26:any; +>_expr_26 : any + + /*private*/ _expr_29:any; +>_expr_29 : any + + /*private*/ _expr_30:any; +>_expr_30 : any + + /*private*/ _expr_31:any; +>_expr_31 : any + + /*private*/ _expr_32:any; +>_expr_32 : any + + /*private*/ _expr_33:any; +>_expr_33 : any + + /*private*/ _expr_34:any; +>_expr_34 : any + + /*private*/ _expr_35:any; +>_expr_35 : any + + /*private*/ _expr_38:any; +>_expr_38 : any + + /*private*/ _expr_39:any; +>_expr_39 : any + + /*private*/ _expr_40:any; +>_expr_40 : any + + /*private*/ _expr_41:any; +>_expr_41 : any + + /*private*/ _expr_42:any; +>_expr_42 : any + + /*private*/ _expr_43:any; +>_expr_43 : any + + /*private*/ _expr_44:any; +>_expr_44 : any + + /*private*/ _expr_47:any; +>_expr_47 : any + + /*private*/ _expr_48:any; +>_expr_48 : any + + /*private*/ _expr_49:any; +>_expr_49 : any + + /*private*/ _expr_50:any; +>_expr_50 : any + + /*private*/ _expr_51:any; +>_expr_51 : any + + /*private*/ _expr_52:any; +>_expr_52 : any + + /*private*/ _expr_53:any; +>_expr_53 : any + + /*private*/ _expr_56:any; +>_expr_56 : any + + /*private*/ _expr_57:any; +>_expr_57 : any + + /*private*/ _expr_58:any; +>_expr_58 : any + + /*private*/ _expr_59:any; +>_expr_59 : any + + /*private*/ _expr_60:any; +>_expr_60 : any + + /*private*/ _expr_61:any; +>_expr_61 : any + + /*private*/ _expr_62:any; +>_expr_62 : any + + /*private*/ _expr_65:any; +>_expr_65 : any + + /*private*/ _expr_66:any; +>_expr_66 : any + + /*private*/ _expr_67:any; +>_expr_67 : any + + /*private*/ _expr_68:any; +>_expr_68 : any + + /*private*/ _expr_69:any; +>_expr_69 : any + + /*private*/ _expr_70:any; +>_expr_70 : any + + /*private*/ _expr_71:any; +>_expr_71 : any + + /*private*/ _expr_74:any; +>_expr_74 : any + + /*private*/ _expr_75:any; +>_expr_75 : any + + /*private*/ _expr_76:any; +>_expr_76 : any + + /*private*/ _expr_77:any; +>_expr_77 : any + + /*private*/ _expr_78:any; +>_expr_78 : any + + /*private*/ _expr_79:any; +>_expr_79 : any + + /*private*/ _expr_80:any; +>_expr_80 : any + + /*private*/ _expr_83:any; +>_expr_83 : any + + /*private*/ _expr_84:any; +>_expr_84 : any + + /*private*/ _expr_85:any; +>_expr_85 : any + + /*private*/ _expr_86:any; +>_expr_86 : any + + /*private*/ _expr_87:any; +>_expr_87 : any + + /*private*/ _expr_88:any; +>_expr_88 : any + + /*private*/ _expr_89:any; +>_expr_89 : any + + /*private*/ _expr_92:any; +>_expr_92 : any + + /*private*/ _expr_93:any; +>_expr_93 : any + + /*private*/ _expr_94:any; +>_expr_94 : any + + /*private*/ _expr_95:any; +>_expr_95 : any + + /*private*/ _expr_96:any; +>_expr_96 : any + + /*private*/ _expr_97:any; +>_expr_97 : any + + /*private*/ _expr_98:any; +>_expr_98 : any + + /*private*/ _expr_101:any; +>_expr_101 : any + + /*private*/ _expr_102:any; +>_expr_102 : any + + /*private*/ _expr_103:any; +>_expr_103 : any + + /*private*/ _expr_104:any; +>_expr_104 : any + + /*private*/ _expr_105:any; +>_expr_105 : any + + /*private*/ _expr_106:any; +>_expr_106 : any + + /*private*/ _expr_107:any; +>_expr_107 : any + + /*private*/ _expr_110:any; +>_expr_110 : any + + /*private*/ _expr_111:any; +>_expr_111 : any + + /*private*/ _expr_112:any; +>_expr_112 : any + + /*private*/ _expr_113:any; +>_expr_113 : any + + /*private*/ _expr_114:any; +>_expr_114 : any + + /*private*/ _expr_115:any; +>_expr_115 : any + + /*private*/ _expr_116:any; +>_expr_116 : any + + /*private*/ _expr_119:any; +>_expr_119 : any + + /*private*/ _expr_120:any; +>_expr_120 : any + + /*private*/ _expr_121:any; +>_expr_121 : any + + /*private*/ _expr_122:any; +>_expr_122 : any + + /*private*/ _expr_123:any; +>_expr_123 : any + + /*private*/ _expr_124:any; +>_expr_124 : any + + /*private*/ _expr_125:any; +>_expr_125 : any + + /*private*/ _expr_128:any; +>_expr_128 : any + + /*private*/ _expr_129:any; +>_expr_129 : any + + /*private*/ _expr_130:any; +>_expr_130 : any + + /*private*/ _expr_131:any; +>_expr_131 : any + + /*private*/ _expr_132:any; +>_expr_132 : any + + /*private*/ _expr_133:any; +>_expr_133 : any + + /*private*/ _expr_134:any; +>_expr_134 : any + + /*private*/ _expr_137:any; +>_expr_137 : any + + /*private*/ _expr_138:any; +>_expr_138 : any + + /*private*/ _expr_139:any; +>_expr_139 : any + + /*private*/ _expr_140:any; +>_expr_140 : any + + /*private*/ _expr_141:any; +>_expr_141 : any + + /*private*/ _expr_142:any; +>_expr_142 : any + + /*private*/ _expr_143:any; +>_expr_143 : any + + /*private*/ _expr_146:any; +>_expr_146 : any + + /*private*/ _expr_147:any; +>_expr_147 : any + + /*private*/ _expr_148:any; +>_expr_148 : any + + /*private*/ _expr_149:any; +>_expr_149 : any + + /*private*/ _expr_150:any; +>_expr_150 : any + + /*private*/ _expr_151:any; +>_expr_151 : any + + /*private*/ _expr_152:any; +>_expr_152 : any + + /*private*/ _expr_155:any; +>_expr_155 : any + + /*private*/ _expr_156:any; +>_expr_156 : any + + /*private*/ _expr_157:any; +>_expr_157 : any + + /*private*/ _expr_158:any; +>_expr_158 : any + + /*private*/ _expr_159:any; +>_expr_159 : any + + /*private*/ _expr_160:any; +>_expr_160 : any + + /*private*/ _expr_161:any; +>_expr_161 : any + + /*private*/ _expr_164:any; +>_expr_164 : any + + /*private*/ _expr_165:any; +>_expr_165 : any + + /*private*/ _expr_166:any; +>_expr_166 : any + + /*private*/ _expr_167:any; +>_expr_167 : any + + /*private*/ _expr_168:any; +>_expr_168 : any + + /*private*/ _expr_169:any; +>_expr_169 : any + + /*private*/ _expr_170:any; +>_expr_170 : any + + /*private*/ _expr_173:any; +>_expr_173 : any + + /*private*/ _expr_174:any; +>_expr_174 : any + + /*private*/ _expr_175:any; +>_expr_175 : any + + /*private*/ _expr_176:any; +>_expr_176 : any + + /*private*/ _expr_177:any; +>_expr_177 : any + + /*private*/ _expr_178:any; +>_expr_178 : any + + /*private*/ _expr_179:any; +>_expr_179 : any + + /*private*/ _expr_182:any; +>_expr_182 : any + + /*private*/ _expr_183:any; +>_expr_183 : any + + /*private*/ _expr_184:any; +>_expr_184 : any + + /*private*/ _expr_185:any; +>_expr_185 : any + + /*private*/ _expr_186:any; +>_expr_186 : any + + /*private*/ _expr_187:any; +>_expr_187 : any + + /*private*/ _expr_188:any; +>_expr_188 : any + + constructor(viewUtils:any,parentInjector:any,declarationEl:any) { +>viewUtils : any +>parentInjector : any +>declarationEl : any + } + + injectorGetInternal(token:any,requestNodeIndex:number,notFoundResult:any):any { +>injectorGetInternal : (token: any, requestNodeIndex: number, notFoundResult: any) => any +>token : any +>requestNodeIndex : number +>notFoundResult : any + + if (((token === import46.DefaultValueAccessor) && (3 === requestNodeIndex))) { return this._DefaultValueAccessor_3_3; } +>((token === import46.DefaultValueAccessor) && (3 === requestNodeIndex)) : boolean +>(token === import46.DefaultValueAccessor) && (3 === requestNodeIndex) : boolean +>(token === import46.DefaultValueAccessor) : boolean +>token === import46.DefaultValueAccessor : boolean +>token : any +>import46.DefaultValueAccessor : typeof import46.DefaultValueAccessor +>import46 : typeof import46 +>DefaultValueAccessor : typeof import46.DefaultValueAccessor +>(3 === requestNodeIndex) : boolean +>3 === requestNodeIndex : boolean +>3 : 3 +>requestNodeIndex : number +>this._DefaultValueAccessor_3_3 : import46.DefaultValueAccessor +>this : this +>_DefaultValueAccessor_3_3 : import46.DefaultValueAccessor + + if (((token === import49.NG_VALUE_ACCESSOR) && (3 === requestNodeIndex))) { return this._NG_VALUE_ACCESSOR_3_4; } +>((token === import49.NG_VALUE_ACCESSOR) && (3 === requestNodeIndex)) : boolean +>(token === import49.NG_VALUE_ACCESSOR) && (3 === requestNodeIndex) : boolean +>(token === import49.NG_VALUE_ACCESSOR) : boolean +>token === import49.NG_VALUE_ACCESSOR : boolean +>token : any +>import49.NG_VALUE_ACCESSOR : String +>import49 : typeof import49 +>NG_VALUE_ACCESSOR : String +>(3 === requestNodeIndex) : boolean +>3 === requestNodeIndex : boolean +>3 : 3 +>requestNodeIndex : number +>this._NG_VALUE_ACCESSOR_3_4 : any[] +>this : this +>_NG_VALUE_ACCESSOR_3_4 : any[] + + if (((token === import47.FormControlName) && (3 === requestNodeIndex))) { return this._FormControlName_3_5; } +>((token === import47.FormControlName) && (3 === requestNodeIndex)) : boolean +>(token === import47.FormControlName) && (3 === requestNodeIndex) : boolean +>(token === import47.FormControlName) : boolean +>token === import47.FormControlName : boolean +>token : any +>import47.FormControlName : typeof import47.FormControlName +>import47 : typeof import47 +>FormControlName : typeof import47.FormControlName +>(3 === requestNodeIndex) : boolean +>3 === requestNodeIndex : boolean +>3 : 3 +>requestNodeIndex : number +>this._FormControlName_3_5 : import47.FormControlName +>this : this +>_FormControlName_3_5 : import47.FormControlName + + if (((token === import50.NgControl) && (3 === requestNodeIndex))) { return this._NgControl_3_6; } +>((token === import50.NgControl) && (3 === requestNodeIndex)) : boolean +>(token === import50.NgControl) && (3 === requestNodeIndex) : boolean +>(token === import50.NgControl) : boolean +>token === import50.NgControl : boolean +>token : any +>import50.NgControl : typeof import50.NgControl +>import50 : typeof import50 +>NgControl : typeof import50.NgControl +>(3 === requestNodeIndex) : boolean +>3 === requestNodeIndex : boolean +>3 : 3 +>requestNodeIndex : number +>this._NgControl_3_6 : any +>this : this +>_NgControl_3_6 : any + + if (((token === import45.NgControlStatus) && (3 === requestNodeIndex))) { return this._NgControlStatus_3_7; } +>((token === import45.NgControlStatus) && (3 === requestNodeIndex)) : boolean +>(token === import45.NgControlStatus) && (3 === requestNodeIndex) : boolean +>(token === import45.NgControlStatus) : boolean +>token === import45.NgControlStatus : boolean +>token : any +>import45.NgControlStatus : typeof import45.NgControlStatus +>import45 : typeof import45 +>NgControlStatus : typeof import45.NgControlStatus +>(3 === requestNodeIndex) : boolean +>3 === requestNodeIndex : boolean +>3 : 3 +>requestNodeIndex : number +>this._NgControlStatus_3_7 : import45.NgControlStatus +>this : this +>_NgControlStatus_3_7 : import45.NgControlStatus + + if (((token === import46.DefaultValueAccessor) && (6 === requestNodeIndex))) { return this._DefaultValueAccessor_6_3; } +>((token === import46.DefaultValueAccessor) && (6 === requestNodeIndex)) : boolean +>(token === import46.DefaultValueAccessor) && (6 === requestNodeIndex) : boolean +>(token === import46.DefaultValueAccessor) : boolean +>token === import46.DefaultValueAccessor : boolean +>token : any +>import46.DefaultValueAccessor : typeof import46.DefaultValueAccessor +>import46 : typeof import46 +>DefaultValueAccessor : typeof import46.DefaultValueAccessor +>(6 === requestNodeIndex) : boolean +>6 === requestNodeIndex : boolean +>6 : 6 +>requestNodeIndex : number +>this._DefaultValueAccessor_6_3 : import46.DefaultValueAccessor +>this : this +>_DefaultValueAccessor_6_3 : import46.DefaultValueAccessor + + if (((token === import49.NG_VALUE_ACCESSOR) && (6 === requestNodeIndex))) { return this._NG_VALUE_ACCESSOR_6_4; } +>((token === import49.NG_VALUE_ACCESSOR) && (6 === requestNodeIndex)) : boolean +>(token === import49.NG_VALUE_ACCESSOR) && (6 === requestNodeIndex) : boolean +>(token === import49.NG_VALUE_ACCESSOR) : boolean +>token === import49.NG_VALUE_ACCESSOR : boolean +>token : any +>import49.NG_VALUE_ACCESSOR : String +>import49 : typeof import49 +>NG_VALUE_ACCESSOR : String +>(6 === requestNodeIndex) : boolean +>6 === requestNodeIndex : boolean +>6 : 6 +>requestNodeIndex : number +>this._NG_VALUE_ACCESSOR_6_4 : any[] +>this : this +>_NG_VALUE_ACCESSOR_6_4 : any[] + + if (((token === import47.FormControlName) && (6 === requestNodeIndex))) { return this._FormControlName_6_5; } +>((token === import47.FormControlName) && (6 === requestNodeIndex)) : boolean +>(token === import47.FormControlName) && (6 === requestNodeIndex) : boolean +>(token === import47.FormControlName) : boolean +>token === import47.FormControlName : boolean +>token : any +>import47.FormControlName : typeof import47.FormControlName +>import47 : typeof import47 +>FormControlName : typeof import47.FormControlName +>(6 === requestNodeIndex) : boolean +>6 === requestNodeIndex : boolean +>6 : 6 +>requestNodeIndex : number +>this._FormControlName_6_5 : import47.FormControlName +>this : this +>_FormControlName_6_5 : import47.FormControlName + + if (((token === import50.NgControl) && (6 === requestNodeIndex))) { return this._NgControl_6_6; } +>((token === import50.NgControl) && (6 === requestNodeIndex)) : boolean +>(token === import50.NgControl) && (6 === requestNodeIndex) : boolean +>(token === import50.NgControl) : boolean +>token === import50.NgControl : boolean +>token : any +>import50.NgControl : typeof import50.NgControl +>import50 : typeof import50 +>NgControl : typeof import50.NgControl +>(6 === requestNodeIndex) : boolean +>6 === requestNodeIndex : boolean +>6 : 6 +>requestNodeIndex : number +>this._NgControl_6_6 : any +>this : this +>_NgControl_6_6 : any + + if (((token === import45.NgControlStatus) && (6 === requestNodeIndex))) { return this._NgControlStatus_6_7; } +>((token === import45.NgControlStatus) && (6 === requestNodeIndex)) : boolean +>(token === import45.NgControlStatus) && (6 === requestNodeIndex) : boolean +>(token === import45.NgControlStatus) : boolean +>token === import45.NgControlStatus : boolean +>token : any +>import45.NgControlStatus : typeof import45.NgControlStatus +>import45 : typeof import45 +>NgControlStatus : typeof import45.NgControlStatus +>(6 === requestNodeIndex) : boolean +>6 === requestNodeIndex : boolean +>6 : 6 +>requestNodeIndex : number +>this._NgControlStatus_6_7 : import45.NgControlStatus +>this : this +>_NgControlStatus_6_7 : import45.NgControlStatus + + if (((token === import46.DefaultValueAccessor) && (9 === requestNodeIndex))) { return this._DefaultValueAccessor_9_3; } +>((token === import46.DefaultValueAccessor) && (9 === requestNodeIndex)) : boolean +>(token === import46.DefaultValueAccessor) && (9 === requestNodeIndex) : boolean +>(token === import46.DefaultValueAccessor) : boolean +>token === import46.DefaultValueAccessor : boolean +>token : any +>import46.DefaultValueAccessor : typeof import46.DefaultValueAccessor +>import46 : typeof import46 +>DefaultValueAccessor : typeof import46.DefaultValueAccessor +>(9 === requestNodeIndex) : boolean +>9 === requestNodeIndex : boolean +>9 : 9 +>requestNodeIndex : number +>this._DefaultValueAccessor_9_3 : import46.DefaultValueAccessor +>this : this +>_DefaultValueAccessor_9_3 : import46.DefaultValueAccessor + + if (((token === import49.NG_VALUE_ACCESSOR) && (9 === requestNodeIndex))) { return this._NG_VALUE_ACCESSOR_9_4; } +>((token === import49.NG_VALUE_ACCESSOR) && (9 === requestNodeIndex)) : boolean +>(token === import49.NG_VALUE_ACCESSOR) && (9 === requestNodeIndex) : boolean +>(token === import49.NG_VALUE_ACCESSOR) : boolean +>token === import49.NG_VALUE_ACCESSOR : boolean +>token : any +>import49.NG_VALUE_ACCESSOR : String +>import49 : typeof import49 +>NG_VALUE_ACCESSOR : String +>(9 === requestNodeIndex) : boolean +>9 === requestNodeIndex : boolean +>9 : 9 +>requestNodeIndex : number +>this._NG_VALUE_ACCESSOR_9_4 : any[] +>this : this +>_NG_VALUE_ACCESSOR_9_4 : any[] + + if (((token === import47.FormControlName) && (9 === requestNodeIndex))) { return this._FormControlName_9_5; } +>((token === import47.FormControlName) && (9 === requestNodeIndex)) : boolean +>(token === import47.FormControlName) && (9 === requestNodeIndex) : boolean +>(token === import47.FormControlName) : boolean +>token === import47.FormControlName : boolean +>token : any +>import47.FormControlName : typeof import47.FormControlName +>import47 : typeof import47 +>FormControlName : typeof import47.FormControlName +>(9 === requestNodeIndex) : boolean +>9 === requestNodeIndex : boolean +>9 : 9 +>requestNodeIndex : number +>this._FormControlName_9_5 : import47.FormControlName +>this : this +>_FormControlName_9_5 : import47.FormControlName + + if (((token === import50.NgControl) && (9 === requestNodeIndex))) { return this._NgControl_9_6; } +>((token === import50.NgControl) && (9 === requestNodeIndex)) : boolean +>(token === import50.NgControl) && (9 === requestNodeIndex) : boolean +>(token === import50.NgControl) : boolean +>token === import50.NgControl : boolean +>token : any +>import50.NgControl : typeof import50.NgControl +>import50 : typeof import50 +>NgControl : typeof import50.NgControl +>(9 === requestNodeIndex) : boolean +>9 === requestNodeIndex : boolean +>9 : 9 +>requestNodeIndex : number +>this._NgControl_9_6 : any +>this : this +>_NgControl_9_6 : any + + if (((token === import45.NgControlStatus) && (9 === requestNodeIndex))) { return this._NgControlStatus_9_7; } +>((token === import45.NgControlStatus) && (9 === requestNodeIndex)) : boolean +>(token === import45.NgControlStatus) && (9 === requestNodeIndex) : boolean +>(token === import45.NgControlStatus) : boolean +>token === import45.NgControlStatus : boolean +>token : any +>import45.NgControlStatus : typeof import45.NgControlStatus +>import45 : typeof import45 +>NgControlStatus : typeof import45.NgControlStatus +>(9 === requestNodeIndex) : boolean +>9 === requestNodeIndex : boolean +>9 : 9 +>requestNodeIndex : number +>this._NgControlStatus_9_7 : import45.NgControlStatus +>this : this +>_NgControlStatus_9_7 : import45.NgControlStatus + + if (((token === import46.DefaultValueAccessor) && (12 === requestNodeIndex))) { return this._DefaultValueAccessor_12_3; } +>((token === import46.DefaultValueAccessor) && (12 === requestNodeIndex)) : boolean +>(token === import46.DefaultValueAccessor) && (12 === requestNodeIndex) : boolean +>(token === import46.DefaultValueAccessor) : boolean +>token === import46.DefaultValueAccessor : boolean +>token : any +>import46.DefaultValueAccessor : typeof import46.DefaultValueAccessor +>import46 : typeof import46 +>DefaultValueAccessor : typeof import46.DefaultValueAccessor +>(12 === requestNodeIndex) : boolean +>12 === requestNodeIndex : boolean +>12 : 12 +>requestNodeIndex : number +>this._DefaultValueAccessor_12_3 : import46.DefaultValueAccessor +>this : this +>_DefaultValueAccessor_12_3 : import46.DefaultValueAccessor + + if (((token === import49.NG_VALUE_ACCESSOR) && (12 === requestNodeIndex))) { return this._NG_VALUE_ACCESSOR_12_4; } +>((token === import49.NG_VALUE_ACCESSOR) && (12 === requestNodeIndex)) : boolean +>(token === import49.NG_VALUE_ACCESSOR) && (12 === requestNodeIndex) : boolean +>(token === import49.NG_VALUE_ACCESSOR) : boolean +>token === import49.NG_VALUE_ACCESSOR : boolean +>token : any +>import49.NG_VALUE_ACCESSOR : String +>import49 : typeof import49 +>NG_VALUE_ACCESSOR : String +>(12 === requestNodeIndex) : boolean +>12 === requestNodeIndex : boolean +>12 : 12 +>requestNodeIndex : number +>this._NG_VALUE_ACCESSOR_12_4 : any[] +>this : this +>_NG_VALUE_ACCESSOR_12_4 : any[] + + if (((token === import47.FormControlName) && (12 === requestNodeIndex))) { return this._FormControlName_12_5; } +>((token === import47.FormControlName) && (12 === requestNodeIndex)) : boolean +>(token === import47.FormControlName) && (12 === requestNodeIndex) : boolean +>(token === import47.FormControlName) : boolean +>token === import47.FormControlName : boolean +>token : any +>import47.FormControlName : typeof import47.FormControlName +>import47 : typeof import47 +>FormControlName : typeof import47.FormControlName +>(12 === requestNodeIndex) : boolean +>12 === requestNodeIndex : boolean +>12 : 12 +>requestNodeIndex : number +>this._FormControlName_12_5 : import47.FormControlName +>this : this +>_FormControlName_12_5 : import47.FormControlName + + if (((token === import50.NgControl) && (12 === requestNodeIndex))) { return this._NgControl_12_6; } +>((token === import50.NgControl) && (12 === requestNodeIndex)) : boolean +>(token === import50.NgControl) && (12 === requestNodeIndex) : boolean +>(token === import50.NgControl) : boolean +>token === import50.NgControl : boolean +>token : any +>import50.NgControl : typeof import50.NgControl +>import50 : typeof import50 +>NgControl : typeof import50.NgControl +>(12 === requestNodeIndex) : boolean +>12 === requestNodeIndex : boolean +>12 : 12 +>requestNodeIndex : number +>this._NgControl_12_6 : any +>this : this +>_NgControl_12_6 : any + + if (((token === import45.NgControlStatus) && (12 === requestNodeIndex))) { return this._NgControlStatus_12_7; } +>((token === import45.NgControlStatus) && (12 === requestNodeIndex)) : boolean +>(token === import45.NgControlStatus) && (12 === requestNodeIndex) : boolean +>(token === import45.NgControlStatus) : boolean +>token === import45.NgControlStatus : boolean +>token : any +>import45.NgControlStatus : typeof import45.NgControlStatus +>import45 : typeof import45 +>NgControlStatus : typeof import45.NgControlStatus +>(12 === requestNodeIndex) : boolean +>12 === requestNodeIndex : boolean +>12 : 12 +>requestNodeIndex : number +>this._NgControlStatus_12_7 : import45.NgControlStatus +>this : this +>_NgControlStatus_12_7 : import45.NgControlStatus + + if (((token === import46.DefaultValueAccessor) && (15 === requestNodeIndex))) { return this._DefaultValueAccessor_15_3; } +>((token === import46.DefaultValueAccessor) && (15 === requestNodeIndex)) : boolean +>(token === import46.DefaultValueAccessor) && (15 === requestNodeIndex) : boolean +>(token === import46.DefaultValueAccessor) : boolean +>token === import46.DefaultValueAccessor : boolean +>token : any +>import46.DefaultValueAccessor : typeof import46.DefaultValueAccessor +>import46 : typeof import46 +>DefaultValueAccessor : typeof import46.DefaultValueAccessor +>(15 === requestNodeIndex) : boolean +>15 === requestNodeIndex : boolean +>15 : 15 +>requestNodeIndex : number +>this._DefaultValueAccessor_15_3 : import46.DefaultValueAccessor +>this : this +>_DefaultValueAccessor_15_3 : import46.DefaultValueAccessor + + if (((token === import49.NG_VALUE_ACCESSOR) && (15 === requestNodeIndex))) { return this._NG_VALUE_ACCESSOR_15_4; } +>((token === import49.NG_VALUE_ACCESSOR) && (15 === requestNodeIndex)) : boolean +>(token === import49.NG_VALUE_ACCESSOR) && (15 === requestNodeIndex) : boolean +>(token === import49.NG_VALUE_ACCESSOR) : boolean +>token === import49.NG_VALUE_ACCESSOR : boolean +>token : any +>import49.NG_VALUE_ACCESSOR : String +>import49 : typeof import49 +>NG_VALUE_ACCESSOR : String +>(15 === requestNodeIndex) : boolean +>15 === requestNodeIndex : boolean +>15 : 15 +>requestNodeIndex : number +>this._NG_VALUE_ACCESSOR_15_4 : any[] +>this : this +>_NG_VALUE_ACCESSOR_15_4 : any[] + + if (((token === import47.FormControlName) && (15 === requestNodeIndex))) { return this._FormControlName_15_5; } +>((token === import47.FormControlName) && (15 === requestNodeIndex)) : boolean +>(token === import47.FormControlName) && (15 === requestNodeIndex) : boolean +>(token === import47.FormControlName) : boolean +>token === import47.FormControlName : boolean +>token : any +>import47.FormControlName : typeof import47.FormControlName +>import47 : typeof import47 +>FormControlName : typeof import47.FormControlName +>(15 === requestNodeIndex) : boolean +>15 === requestNodeIndex : boolean +>15 : 15 +>requestNodeIndex : number +>this._FormControlName_15_5 : import47.FormControlName +>this : this +>_FormControlName_15_5 : import47.FormControlName + + if (((token === import50.NgControl) && (15 === requestNodeIndex))) { return this._NgControl_15_6; } +>((token === import50.NgControl) && (15 === requestNodeIndex)) : boolean +>(token === import50.NgControl) && (15 === requestNodeIndex) : boolean +>(token === import50.NgControl) : boolean +>token === import50.NgControl : boolean +>token : any +>import50.NgControl : typeof import50.NgControl +>import50 : typeof import50 +>NgControl : typeof import50.NgControl +>(15 === requestNodeIndex) : boolean +>15 === requestNodeIndex : boolean +>15 : 15 +>requestNodeIndex : number +>this._NgControl_15_6 : any +>this : this +>_NgControl_15_6 : any + + if (((token === import45.NgControlStatus) && (15 === requestNodeIndex))) { return this._NgControlStatus_15_7; } +>((token === import45.NgControlStatus) && (15 === requestNodeIndex)) : boolean +>(token === import45.NgControlStatus) && (15 === requestNodeIndex) : boolean +>(token === import45.NgControlStatus) : boolean +>token === import45.NgControlStatus : boolean +>token : any +>import45.NgControlStatus : typeof import45.NgControlStatus +>import45 : typeof import45 +>NgControlStatus : typeof import45.NgControlStatus +>(15 === requestNodeIndex) : boolean +>15 === requestNodeIndex : boolean +>15 : 15 +>requestNodeIndex : number +>this._NgControlStatus_15_7 : import45.NgControlStatus +>this : this +>_NgControlStatus_15_7 : import45.NgControlStatus + + if (((token === import46.DefaultValueAccessor) && (18 === requestNodeIndex))) { return this._DefaultValueAccessor_18_3; } +>((token === import46.DefaultValueAccessor) && (18 === requestNodeIndex)) : boolean +>(token === import46.DefaultValueAccessor) && (18 === requestNodeIndex) : boolean +>(token === import46.DefaultValueAccessor) : boolean +>token === import46.DefaultValueAccessor : boolean +>token : any +>import46.DefaultValueAccessor : typeof import46.DefaultValueAccessor +>import46 : typeof import46 +>DefaultValueAccessor : typeof import46.DefaultValueAccessor +>(18 === requestNodeIndex) : boolean +>18 === requestNodeIndex : boolean +>18 : 18 +>requestNodeIndex : number +>this._DefaultValueAccessor_18_3 : import46.DefaultValueAccessor +>this : this +>_DefaultValueAccessor_18_3 : import46.DefaultValueAccessor + + if (((token === import49.NG_VALUE_ACCESSOR) && (18 === requestNodeIndex))) { return this._NG_VALUE_ACCESSOR_18_4; } +>((token === import49.NG_VALUE_ACCESSOR) && (18 === requestNodeIndex)) : boolean +>(token === import49.NG_VALUE_ACCESSOR) && (18 === requestNodeIndex) : boolean +>(token === import49.NG_VALUE_ACCESSOR) : boolean +>token === import49.NG_VALUE_ACCESSOR : boolean +>token : any +>import49.NG_VALUE_ACCESSOR : String +>import49 : typeof import49 +>NG_VALUE_ACCESSOR : String +>(18 === requestNodeIndex) : boolean +>18 === requestNodeIndex : boolean +>18 : 18 +>requestNodeIndex : number +>this._NG_VALUE_ACCESSOR_18_4 : any[] +>this : this +>_NG_VALUE_ACCESSOR_18_4 : any[] + + if (((token === import47.FormControlName) && (18 === requestNodeIndex))) { return this._FormControlName_18_5; } +>((token === import47.FormControlName) && (18 === requestNodeIndex)) : boolean +>(token === import47.FormControlName) && (18 === requestNodeIndex) : boolean +>(token === import47.FormControlName) : boolean +>token === import47.FormControlName : boolean +>token : any +>import47.FormControlName : typeof import47.FormControlName +>import47 : typeof import47 +>FormControlName : typeof import47.FormControlName +>(18 === requestNodeIndex) : boolean +>18 === requestNodeIndex : boolean +>18 : 18 +>requestNodeIndex : number +>this._FormControlName_18_5 : import47.FormControlName +>this : this +>_FormControlName_18_5 : import47.FormControlName + + if (((token === import50.NgControl) && (18 === requestNodeIndex))) { return this._NgControl_18_6; } +>((token === import50.NgControl) && (18 === requestNodeIndex)) : boolean +>(token === import50.NgControl) && (18 === requestNodeIndex) : boolean +>(token === import50.NgControl) : boolean +>token === import50.NgControl : boolean +>token : any +>import50.NgControl : typeof import50.NgControl +>import50 : typeof import50 +>NgControl : typeof import50.NgControl +>(18 === requestNodeIndex) : boolean +>18 === requestNodeIndex : boolean +>18 : 18 +>requestNodeIndex : number +>this._NgControl_18_6 : any +>this : this +>_NgControl_18_6 : any + + if (((token === import45.NgControlStatus) && (18 === requestNodeIndex))) { return this._NgControlStatus_18_7; } +>((token === import45.NgControlStatus) && (18 === requestNodeIndex)) : boolean +>(token === import45.NgControlStatus) && (18 === requestNodeIndex) : boolean +>(token === import45.NgControlStatus) : boolean +>token === import45.NgControlStatus : boolean +>token : any +>import45.NgControlStatus : typeof import45.NgControlStatus +>import45 : typeof import45 +>NgControlStatus : typeof import45.NgControlStatus +>(18 === requestNodeIndex) : boolean +>18 === requestNodeIndex : boolean +>18 : 18 +>requestNodeIndex : number +>this._NgControlStatus_18_7 : import45.NgControlStatus +>this : this +>_NgControlStatus_18_7 : import45.NgControlStatus + + if (((token === import46.DefaultValueAccessor) && (21 === requestNodeIndex))) { return this._DefaultValueAccessor_21_3; } +>((token === import46.DefaultValueAccessor) && (21 === requestNodeIndex)) : boolean +>(token === import46.DefaultValueAccessor) && (21 === requestNodeIndex) : boolean +>(token === import46.DefaultValueAccessor) : boolean +>token === import46.DefaultValueAccessor : boolean +>token : any +>import46.DefaultValueAccessor : typeof import46.DefaultValueAccessor +>import46 : typeof import46 +>DefaultValueAccessor : typeof import46.DefaultValueAccessor +>(21 === requestNodeIndex) : boolean +>21 === requestNodeIndex : boolean +>21 : 21 +>requestNodeIndex : number +>this._DefaultValueAccessor_21_3 : import46.DefaultValueAccessor +>this : this +>_DefaultValueAccessor_21_3 : import46.DefaultValueAccessor + + if (((token === import49.NG_VALUE_ACCESSOR) && (21 === requestNodeIndex))) { return this._NG_VALUE_ACCESSOR_21_4; } +>((token === import49.NG_VALUE_ACCESSOR) && (21 === requestNodeIndex)) : boolean +>(token === import49.NG_VALUE_ACCESSOR) && (21 === requestNodeIndex) : boolean +>(token === import49.NG_VALUE_ACCESSOR) : boolean +>token === import49.NG_VALUE_ACCESSOR : boolean +>token : any +>import49.NG_VALUE_ACCESSOR : String +>import49 : typeof import49 +>NG_VALUE_ACCESSOR : String +>(21 === requestNodeIndex) : boolean +>21 === requestNodeIndex : boolean +>21 : 21 +>requestNodeIndex : number +>this._NG_VALUE_ACCESSOR_21_4 : any[] +>this : this +>_NG_VALUE_ACCESSOR_21_4 : any[] + + if (((token === import47.FormControlName) && (21 === requestNodeIndex))) { return this._FormControlName_21_5; } +>((token === import47.FormControlName) && (21 === requestNodeIndex)) : boolean +>(token === import47.FormControlName) && (21 === requestNodeIndex) : boolean +>(token === import47.FormControlName) : boolean +>token === import47.FormControlName : boolean +>token : any +>import47.FormControlName : typeof import47.FormControlName +>import47 : typeof import47 +>FormControlName : typeof import47.FormControlName +>(21 === requestNodeIndex) : boolean +>21 === requestNodeIndex : boolean +>21 : 21 +>requestNodeIndex : number +>this._FormControlName_21_5 : import47.FormControlName +>this : this +>_FormControlName_21_5 : import47.FormControlName + + if (((token === import50.NgControl) && (21 === requestNodeIndex))) { return this._NgControl_21_6; } +>((token === import50.NgControl) && (21 === requestNodeIndex)) : boolean +>(token === import50.NgControl) && (21 === requestNodeIndex) : boolean +>(token === import50.NgControl) : boolean +>token === import50.NgControl : boolean +>token : any +>import50.NgControl : typeof import50.NgControl +>import50 : typeof import50 +>NgControl : typeof import50.NgControl +>(21 === requestNodeIndex) : boolean +>21 === requestNodeIndex : boolean +>21 : 21 +>requestNodeIndex : number +>this._NgControl_21_6 : any +>this : this +>_NgControl_21_6 : any + + if (((token === import45.NgControlStatus) && (21 === requestNodeIndex))) { return this._NgControlStatus_21_7; } +>((token === import45.NgControlStatus) && (21 === requestNodeIndex)) : boolean +>(token === import45.NgControlStatus) && (21 === requestNodeIndex) : boolean +>(token === import45.NgControlStatus) : boolean +>token === import45.NgControlStatus : boolean +>token : any +>import45.NgControlStatus : typeof import45.NgControlStatus +>import45 : typeof import45 +>NgControlStatus : typeof import45.NgControlStatus +>(21 === requestNodeIndex) : boolean +>21 === requestNodeIndex : boolean +>21 : 21 +>requestNodeIndex : number +>this._NgControlStatus_21_7 : import45.NgControlStatus +>this : this +>_NgControlStatus_21_7 : import45.NgControlStatus + + if (((token === import46.DefaultValueAccessor) && (24 === requestNodeIndex))) { return this._DefaultValueAccessor_24_3; } +>((token === import46.DefaultValueAccessor) && (24 === requestNodeIndex)) : boolean +>(token === import46.DefaultValueAccessor) && (24 === requestNodeIndex) : boolean +>(token === import46.DefaultValueAccessor) : boolean +>token === import46.DefaultValueAccessor : boolean +>token : any +>import46.DefaultValueAccessor : typeof import46.DefaultValueAccessor +>import46 : typeof import46 +>DefaultValueAccessor : typeof import46.DefaultValueAccessor +>(24 === requestNodeIndex) : boolean +>24 === requestNodeIndex : boolean +>24 : 24 +>requestNodeIndex : number +>this._DefaultValueAccessor_24_3 : import46.DefaultValueAccessor +>this : this +>_DefaultValueAccessor_24_3 : import46.DefaultValueAccessor + + if (((token === import49.NG_VALUE_ACCESSOR) && (24 === requestNodeIndex))) { return this._NG_VALUE_ACCESSOR_24_4; } +>((token === import49.NG_VALUE_ACCESSOR) && (24 === requestNodeIndex)) : boolean +>(token === import49.NG_VALUE_ACCESSOR) && (24 === requestNodeIndex) : boolean +>(token === import49.NG_VALUE_ACCESSOR) : boolean +>token === import49.NG_VALUE_ACCESSOR : boolean +>token : any +>import49.NG_VALUE_ACCESSOR : String +>import49 : typeof import49 +>NG_VALUE_ACCESSOR : String +>(24 === requestNodeIndex) : boolean +>24 === requestNodeIndex : boolean +>24 : 24 +>requestNodeIndex : number +>this._NG_VALUE_ACCESSOR_24_4 : any[] +>this : this +>_NG_VALUE_ACCESSOR_24_4 : any[] + + if (((token === import47.FormControlName) && (24 === requestNodeIndex))) { return this._FormControlName_24_5; } +>((token === import47.FormControlName) && (24 === requestNodeIndex)) : boolean +>(token === import47.FormControlName) && (24 === requestNodeIndex) : boolean +>(token === import47.FormControlName) : boolean +>token === import47.FormControlName : boolean +>token : any +>import47.FormControlName : typeof import47.FormControlName +>import47 : typeof import47 +>FormControlName : typeof import47.FormControlName +>(24 === requestNodeIndex) : boolean +>24 === requestNodeIndex : boolean +>24 : 24 +>requestNodeIndex : number +>this._FormControlName_24_5 : import47.FormControlName +>this : this +>_FormControlName_24_5 : import47.FormControlName + + if (((token === import50.NgControl) && (24 === requestNodeIndex))) { return this._NgControl_24_6; } +>((token === import50.NgControl) && (24 === requestNodeIndex)) : boolean +>(token === import50.NgControl) && (24 === requestNodeIndex) : boolean +>(token === import50.NgControl) : boolean +>token === import50.NgControl : boolean +>token : any +>import50.NgControl : typeof import50.NgControl +>import50 : typeof import50 +>NgControl : typeof import50.NgControl +>(24 === requestNodeIndex) : boolean +>24 === requestNodeIndex : boolean +>24 : 24 +>requestNodeIndex : number +>this._NgControl_24_6 : any +>this : this +>_NgControl_24_6 : any + + if (((token === import45.NgControlStatus) && (24 === requestNodeIndex))) { return this._NgControlStatus_24_7; } +>((token === import45.NgControlStatus) && (24 === requestNodeIndex)) : boolean +>(token === import45.NgControlStatus) && (24 === requestNodeIndex) : boolean +>(token === import45.NgControlStatus) : boolean +>token === import45.NgControlStatus : boolean +>token : any +>import45.NgControlStatus : typeof import45.NgControlStatus +>import45 : typeof import45 +>NgControlStatus : typeof import45.NgControlStatus +>(24 === requestNodeIndex) : boolean +>24 === requestNodeIndex : boolean +>24 : 24 +>requestNodeIndex : number +>this._NgControlStatus_24_7 : import45.NgControlStatus +>this : this +>_NgControlStatus_24_7 : import45.NgControlStatus + + if (((token === import46.DefaultValueAccessor) && (27 === requestNodeIndex))) { return this._DefaultValueAccessor_27_3; } +>((token === import46.DefaultValueAccessor) && (27 === requestNodeIndex)) : boolean +>(token === import46.DefaultValueAccessor) && (27 === requestNodeIndex) : boolean +>(token === import46.DefaultValueAccessor) : boolean +>token === import46.DefaultValueAccessor : boolean +>token : any +>import46.DefaultValueAccessor : typeof import46.DefaultValueAccessor +>import46 : typeof import46 +>DefaultValueAccessor : typeof import46.DefaultValueAccessor +>(27 === requestNodeIndex) : boolean +>27 === requestNodeIndex : boolean +>27 : 27 +>requestNodeIndex : number +>this._DefaultValueAccessor_27_3 : import46.DefaultValueAccessor +>this : this +>_DefaultValueAccessor_27_3 : import46.DefaultValueAccessor + + if (((token === import49.NG_VALUE_ACCESSOR) && (27 === requestNodeIndex))) { return this._NG_VALUE_ACCESSOR_27_4; } +>((token === import49.NG_VALUE_ACCESSOR) && (27 === requestNodeIndex)) : boolean +>(token === import49.NG_VALUE_ACCESSOR) && (27 === requestNodeIndex) : boolean +>(token === import49.NG_VALUE_ACCESSOR) : boolean +>token === import49.NG_VALUE_ACCESSOR : boolean +>token : any +>import49.NG_VALUE_ACCESSOR : String +>import49 : typeof import49 +>NG_VALUE_ACCESSOR : String +>(27 === requestNodeIndex) : boolean +>27 === requestNodeIndex : boolean +>27 : 27 +>requestNodeIndex : number +>this._NG_VALUE_ACCESSOR_27_4 : any[] +>this : this +>_NG_VALUE_ACCESSOR_27_4 : any[] + + if (((token === import47.FormControlName) && (27 === requestNodeIndex))) { return this._FormControlName_27_5; } +>((token === import47.FormControlName) && (27 === requestNodeIndex)) : boolean +>(token === import47.FormControlName) && (27 === requestNodeIndex) : boolean +>(token === import47.FormControlName) : boolean +>token === import47.FormControlName : boolean +>token : any +>import47.FormControlName : typeof import47.FormControlName +>import47 : typeof import47 +>FormControlName : typeof import47.FormControlName +>(27 === requestNodeIndex) : boolean +>27 === requestNodeIndex : boolean +>27 : 27 +>requestNodeIndex : number +>this._FormControlName_27_5 : import47.FormControlName +>this : this +>_FormControlName_27_5 : import47.FormControlName + + if (((token === import50.NgControl) && (27 === requestNodeIndex))) { return this._NgControl_27_6; } +>((token === import50.NgControl) && (27 === requestNodeIndex)) : boolean +>(token === import50.NgControl) && (27 === requestNodeIndex) : boolean +>(token === import50.NgControl) : boolean +>token === import50.NgControl : boolean +>token : any +>import50.NgControl : typeof import50.NgControl +>import50 : typeof import50 +>NgControl : typeof import50.NgControl +>(27 === requestNodeIndex) : boolean +>27 === requestNodeIndex : boolean +>27 : 27 +>requestNodeIndex : number +>this._NgControl_27_6 : any +>this : this +>_NgControl_27_6 : any + + if (((token === import45.NgControlStatus) && (27 === requestNodeIndex))) { return this._NgControlStatus_27_7; } +>((token === import45.NgControlStatus) && (27 === requestNodeIndex)) : boolean +>(token === import45.NgControlStatus) && (27 === requestNodeIndex) : boolean +>(token === import45.NgControlStatus) : boolean +>token === import45.NgControlStatus : boolean +>token : any +>import45.NgControlStatus : typeof import45.NgControlStatus +>import45 : typeof import45 +>NgControlStatus : typeof import45.NgControlStatus +>(27 === requestNodeIndex) : boolean +>27 === requestNodeIndex : boolean +>27 : 27 +>requestNodeIndex : number +>this._NgControlStatus_27_7 : import45.NgControlStatus +>this : this +>_NgControlStatus_27_7 : import45.NgControlStatus + + if (((token === import46.DefaultValueAccessor) && (30 === requestNodeIndex))) { return this._DefaultValueAccessor_30_3; } +>((token === import46.DefaultValueAccessor) && (30 === requestNodeIndex)) : boolean +>(token === import46.DefaultValueAccessor) && (30 === requestNodeIndex) : boolean +>(token === import46.DefaultValueAccessor) : boolean +>token === import46.DefaultValueAccessor : boolean +>token : any +>import46.DefaultValueAccessor : typeof import46.DefaultValueAccessor +>import46 : typeof import46 +>DefaultValueAccessor : typeof import46.DefaultValueAccessor +>(30 === requestNodeIndex) : boolean +>30 === requestNodeIndex : boolean +>30 : 30 +>requestNodeIndex : number +>this._DefaultValueAccessor_30_3 : import46.DefaultValueAccessor +>this : this +>_DefaultValueAccessor_30_3 : import46.DefaultValueAccessor + + if (((token === import49.NG_VALUE_ACCESSOR) && (30 === requestNodeIndex))) { return this._NG_VALUE_ACCESSOR_30_4; } +>((token === import49.NG_VALUE_ACCESSOR) && (30 === requestNodeIndex)) : boolean +>(token === import49.NG_VALUE_ACCESSOR) && (30 === requestNodeIndex) : boolean +>(token === import49.NG_VALUE_ACCESSOR) : boolean +>token === import49.NG_VALUE_ACCESSOR : boolean +>token : any +>import49.NG_VALUE_ACCESSOR : String +>import49 : typeof import49 +>NG_VALUE_ACCESSOR : String +>(30 === requestNodeIndex) : boolean +>30 === requestNodeIndex : boolean +>30 : 30 +>requestNodeIndex : number +>this._NG_VALUE_ACCESSOR_30_4 : any[] +>this : this +>_NG_VALUE_ACCESSOR_30_4 : any[] + + if (((token === import47.FormControlName) && (30 === requestNodeIndex))) { return this._FormControlName_30_5; } +>((token === import47.FormControlName) && (30 === requestNodeIndex)) : boolean +>(token === import47.FormControlName) && (30 === requestNodeIndex) : boolean +>(token === import47.FormControlName) : boolean +>token === import47.FormControlName : boolean +>token : any +>import47.FormControlName : typeof import47.FormControlName +>import47 : typeof import47 +>FormControlName : typeof import47.FormControlName +>(30 === requestNodeIndex) : boolean +>30 === requestNodeIndex : boolean +>30 : 30 +>requestNodeIndex : number +>this._FormControlName_30_5 : import47.FormControlName +>this : this +>_FormControlName_30_5 : import47.FormControlName + + if (((token === import50.NgControl) && (30 === requestNodeIndex))) { return this._NgControl_30_6; } +>((token === import50.NgControl) && (30 === requestNodeIndex)) : boolean +>(token === import50.NgControl) && (30 === requestNodeIndex) : boolean +>(token === import50.NgControl) : boolean +>token === import50.NgControl : boolean +>token : any +>import50.NgControl : typeof import50.NgControl +>import50 : typeof import50 +>NgControl : typeof import50.NgControl +>(30 === requestNodeIndex) : boolean +>30 === requestNodeIndex : boolean +>30 : 30 +>requestNodeIndex : number +>this._NgControl_30_6 : any +>this : this +>_NgControl_30_6 : any + + if (((token === import45.NgControlStatus) && (30 === requestNodeIndex))) { return this._NgControlStatus_30_7; } +>((token === import45.NgControlStatus) && (30 === requestNodeIndex)) : boolean +>(token === import45.NgControlStatus) && (30 === requestNodeIndex) : boolean +>(token === import45.NgControlStatus) : boolean +>token === import45.NgControlStatus : boolean +>token : any +>import45.NgControlStatus : typeof import45.NgControlStatus +>import45 : typeof import45 +>NgControlStatus : typeof import45.NgControlStatus +>(30 === requestNodeIndex) : boolean +>30 === requestNodeIndex : boolean +>30 : 30 +>requestNodeIndex : number +>this._NgControlStatus_30_7 : import45.NgControlStatus +>this : this +>_NgControlStatus_30_7 : import45.NgControlStatus + + if (((token === import46.DefaultValueAccessor) && (33 === requestNodeIndex))) { return this._DefaultValueAccessor_33_3; } +>((token === import46.DefaultValueAccessor) && (33 === requestNodeIndex)) : boolean +>(token === import46.DefaultValueAccessor) && (33 === requestNodeIndex) : boolean +>(token === import46.DefaultValueAccessor) : boolean +>token === import46.DefaultValueAccessor : boolean +>token : any +>import46.DefaultValueAccessor : typeof import46.DefaultValueAccessor +>import46 : typeof import46 +>DefaultValueAccessor : typeof import46.DefaultValueAccessor +>(33 === requestNodeIndex) : boolean +>33 === requestNodeIndex : boolean +>33 : 33 +>requestNodeIndex : number +>this._DefaultValueAccessor_33_3 : import46.DefaultValueAccessor +>this : this +>_DefaultValueAccessor_33_3 : import46.DefaultValueAccessor + + if (((token === import49.NG_VALUE_ACCESSOR) && (33 === requestNodeIndex))) { return this._NG_VALUE_ACCESSOR_33_4; } +>((token === import49.NG_VALUE_ACCESSOR) && (33 === requestNodeIndex)) : boolean +>(token === import49.NG_VALUE_ACCESSOR) && (33 === requestNodeIndex) : boolean +>(token === import49.NG_VALUE_ACCESSOR) : boolean +>token === import49.NG_VALUE_ACCESSOR : boolean +>token : any +>import49.NG_VALUE_ACCESSOR : String +>import49 : typeof import49 +>NG_VALUE_ACCESSOR : String +>(33 === requestNodeIndex) : boolean +>33 === requestNodeIndex : boolean +>33 : 33 +>requestNodeIndex : number +>this._NG_VALUE_ACCESSOR_33_4 : any[] +>this : this +>_NG_VALUE_ACCESSOR_33_4 : any[] + + if (((token === import47.FormControlName) && (33 === requestNodeIndex))) { return this._FormControlName_33_5; } +>((token === import47.FormControlName) && (33 === requestNodeIndex)) : boolean +>(token === import47.FormControlName) && (33 === requestNodeIndex) : boolean +>(token === import47.FormControlName) : boolean +>token === import47.FormControlName : boolean +>token : any +>import47.FormControlName : typeof import47.FormControlName +>import47 : typeof import47 +>FormControlName : typeof import47.FormControlName +>(33 === requestNodeIndex) : boolean +>33 === requestNodeIndex : boolean +>33 : 33 +>requestNodeIndex : number +>this._FormControlName_33_5 : import47.FormControlName +>this : this +>_FormControlName_33_5 : import47.FormControlName + + if (((token === import50.NgControl) && (33 === requestNodeIndex))) { return this._NgControl_33_6; } +>((token === import50.NgControl) && (33 === requestNodeIndex)) : boolean +>(token === import50.NgControl) && (33 === requestNodeIndex) : boolean +>(token === import50.NgControl) : boolean +>token === import50.NgControl : boolean +>token : any +>import50.NgControl : typeof import50.NgControl +>import50 : typeof import50 +>NgControl : typeof import50.NgControl +>(33 === requestNodeIndex) : boolean +>33 === requestNodeIndex : boolean +>33 : 33 +>requestNodeIndex : number +>this._NgControl_33_6 : any +>this : this +>_NgControl_33_6 : any + + if (((token === import45.NgControlStatus) && (33 === requestNodeIndex))) { return this._NgControlStatus_33_7; } +>((token === import45.NgControlStatus) && (33 === requestNodeIndex)) : boolean +>(token === import45.NgControlStatus) && (33 === requestNodeIndex) : boolean +>(token === import45.NgControlStatus) : boolean +>token === import45.NgControlStatus : boolean +>token : any +>import45.NgControlStatus : typeof import45.NgControlStatus +>import45 : typeof import45 +>NgControlStatus : typeof import45.NgControlStatus +>(33 === requestNodeIndex) : boolean +>33 === requestNodeIndex : boolean +>33 : 33 +>requestNodeIndex : number +>this._NgControlStatus_33_7 : import45.NgControlStatus +>this : this +>_NgControlStatus_33_7 : import45.NgControlStatus + + if (((token === import46.DefaultValueAccessor) && (36 === requestNodeIndex))) { return this._DefaultValueAccessor_36_3; } +>((token === import46.DefaultValueAccessor) && (36 === requestNodeIndex)) : boolean +>(token === import46.DefaultValueAccessor) && (36 === requestNodeIndex) : boolean +>(token === import46.DefaultValueAccessor) : boolean +>token === import46.DefaultValueAccessor : boolean +>token : any +>import46.DefaultValueAccessor : typeof import46.DefaultValueAccessor +>import46 : typeof import46 +>DefaultValueAccessor : typeof import46.DefaultValueAccessor +>(36 === requestNodeIndex) : boolean +>36 === requestNodeIndex : boolean +>36 : 36 +>requestNodeIndex : number +>this._DefaultValueAccessor_36_3 : import46.DefaultValueAccessor +>this : this +>_DefaultValueAccessor_36_3 : import46.DefaultValueAccessor + + if (((token === import49.NG_VALUE_ACCESSOR) && (36 === requestNodeIndex))) { return this._NG_VALUE_ACCESSOR_36_4; } +>((token === import49.NG_VALUE_ACCESSOR) && (36 === requestNodeIndex)) : boolean +>(token === import49.NG_VALUE_ACCESSOR) && (36 === requestNodeIndex) : boolean +>(token === import49.NG_VALUE_ACCESSOR) : boolean +>token === import49.NG_VALUE_ACCESSOR : boolean +>token : any +>import49.NG_VALUE_ACCESSOR : String +>import49 : typeof import49 +>NG_VALUE_ACCESSOR : String +>(36 === requestNodeIndex) : boolean +>36 === requestNodeIndex : boolean +>36 : 36 +>requestNodeIndex : number +>this._NG_VALUE_ACCESSOR_36_4 : any[] +>this : this +>_NG_VALUE_ACCESSOR_36_4 : any[] + + if (((token === import47.FormControlName) && (36 === requestNodeIndex))) { return this._FormControlName_36_5; } +>((token === import47.FormControlName) && (36 === requestNodeIndex)) : boolean +>(token === import47.FormControlName) && (36 === requestNodeIndex) : boolean +>(token === import47.FormControlName) : boolean +>token === import47.FormControlName : boolean +>token : any +>import47.FormControlName : typeof import47.FormControlName +>import47 : typeof import47 +>FormControlName : typeof import47.FormControlName +>(36 === requestNodeIndex) : boolean +>36 === requestNodeIndex : boolean +>36 : 36 +>requestNodeIndex : number +>this._FormControlName_36_5 : import47.FormControlName +>this : this +>_FormControlName_36_5 : import47.FormControlName + + if (((token === import50.NgControl) && (36 === requestNodeIndex))) { return this._NgControl_36_6; } +>((token === import50.NgControl) && (36 === requestNodeIndex)) : boolean +>(token === import50.NgControl) && (36 === requestNodeIndex) : boolean +>(token === import50.NgControl) : boolean +>token === import50.NgControl : boolean +>token : any +>import50.NgControl : typeof import50.NgControl +>import50 : typeof import50 +>NgControl : typeof import50.NgControl +>(36 === requestNodeIndex) : boolean +>36 === requestNodeIndex : boolean +>36 : 36 +>requestNodeIndex : number +>this._NgControl_36_6 : any +>this : this +>_NgControl_36_6 : any + + if (((token === import45.NgControlStatus) && (36 === requestNodeIndex))) { return this._NgControlStatus_36_7; } +>((token === import45.NgControlStatus) && (36 === requestNodeIndex)) : boolean +>(token === import45.NgControlStatus) && (36 === requestNodeIndex) : boolean +>(token === import45.NgControlStatus) : boolean +>token === import45.NgControlStatus : boolean +>token : any +>import45.NgControlStatus : typeof import45.NgControlStatus +>import45 : typeof import45 +>NgControlStatus : typeof import45.NgControlStatus +>(36 === requestNodeIndex) : boolean +>36 === requestNodeIndex : boolean +>36 : 36 +>requestNodeIndex : number +>this._NgControlStatus_36_7 : import45.NgControlStatus +>this : this +>_NgControlStatus_36_7 : import45.NgControlStatus + + if (((token === import46.DefaultValueAccessor) && (39 === requestNodeIndex))) { return this._DefaultValueAccessor_39_3; } +>((token === import46.DefaultValueAccessor) && (39 === requestNodeIndex)) : boolean +>(token === import46.DefaultValueAccessor) && (39 === requestNodeIndex) : boolean +>(token === import46.DefaultValueAccessor) : boolean +>token === import46.DefaultValueAccessor : boolean +>token : any +>import46.DefaultValueAccessor : typeof import46.DefaultValueAccessor +>import46 : typeof import46 +>DefaultValueAccessor : typeof import46.DefaultValueAccessor +>(39 === requestNodeIndex) : boolean +>39 === requestNodeIndex : boolean +>39 : 39 +>requestNodeIndex : number +>this._DefaultValueAccessor_39_3 : import46.DefaultValueAccessor +>this : this +>_DefaultValueAccessor_39_3 : import46.DefaultValueAccessor + + if (((token === import49.NG_VALUE_ACCESSOR) && (39 === requestNodeIndex))) { return this._NG_VALUE_ACCESSOR_39_4; } +>((token === import49.NG_VALUE_ACCESSOR) && (39 === requestNodeIndex)) : boolean +>(token === import49.NG_VALUE_ACCESSOR) && (39 === requestNodeIndex) : boolean +>(token === import49.NG_VALUE_ACCESSOR) : boolean +>token === import49.NG_VALUE_ACCESSOR : boolean +>token : any +>import49.NG_VALUE_ACCESSOR : String +>import49 : typeof import49 +>NG_VALUE_ACCESSOR : String +>(39 === requestNodeIndex) : boolean +>39 === requestNodeIndex : boolean +>39 : 39 +>requestNodeIndex : number +>this._NG_VALUE_ACCESSOR_39_4 : any[] +>this : this +>_NG_VALUE_ACCESSOR_39_4 : any[] + + if (((token === import47.FormControlName) && (39 === requestNodeIndex))) { return this._FormControlName_39_5; } +>((token === import47.FormControlName) && (39 === requestNodeIndex)) : boolean +>(token === import47.FormControlName) && (39 === requestNodeIndex) : boolean +>(token === import47.FormControlName) : boolean +>token === import47.FormControlName : boolean +>token : any +>import47.FormControlName : typeof import47.FormControlName +>import47 : typeof import47 +>FormControlName : typeof import47.FormControlName +>(39 === requestNodeIndex) : boolean +>39 === requestNodeIndex : boolean +>39 : 39 +>requestNodeIndex : number +>this._FormControlName_39_5 : import47.FormControlName +>this : this +>_FormControlName_39_5 : import47.FormControlName + + if (((token === import50.NgControl) && (39 === requestNodeIndex))) { return this._NgControl_39_6; } +>((token === import50.NgControl) && (39 === requestNodeIndex)) : boolean +>(token === import50.NgControl) && (39 === requestNodeIndex) : boolean +>(token === import50.NgControl) : boolean +>token === import50.NgControl : boolean +>token : any +>import50.NgControl : typeof import50.NgControl +>import50 : typeof import50 +>NgControl : typeof import50.NgControl +>(39 === requestNodeIndex) : boolean +>39 === requestNodeIndex : boolean +>39 : 39 +>requestNodeIndex : number +>this._NgControl_39_6 : any +>this : this +>_NgControl_39_6 : any + + if (((token === import45.NgControlStatus) && (39 === requestNodeIndex))) { return this._NgControlStatus_39_7; } +>((token === import45.NgControlStatus) && (39 === requestNodeIndex)) : boolean +>(token === import45.NgControlStatus) && (39 === requestNodeIndex) : boolean +>(token === import45.NgControlStatus) : boolean +>token === import45.NgControlStatus : boolean +>token : any +>import45.NgControlStatus : typeof import45.NgControlStatus +>import45 : typeof import45 +>NgControlStatus : typeof import45.NgControlStatus +>(39 === requestNodeIndex) : boolean +>39 === requestNodeIndex : boolean +>39 : 39 +>requestNodeIndex : number +>this._NgControlStatus_39_7 : import45.NgControlStatus +>this : this +>_NgControlStatus_39_7 : import45.NgControlStatus + + if (((token === import46.DefaultValueAccessor) && (42 === requestNodeIndex))) { return this._DefaultValueAccessor_42_3; } +>((token === import46.DefaultValueAccessor) && (42 === requestNodeIndex)) : boolean +>(token === import46.DefaultValueAccessor) && (42 === requestNodeIndex) : boolean +>(token === import46.DefaultValueAccessor) : boolean +>token === import46.DefaultValueAccessor : boolean +>token : any +>import46.DefaultValueAccessor : typeof import46.DefaultValueAccessor +>import46 : typeof import46 +>DefaultValueAccessor : typeof import46.DefaultValueAccessor +>(42 === requestNodeIndex) : boolean +>42 === requestNodeIndex : boolean +>42 : 42 +>requestNodeIndex : number +>this._DefaultValueAccessor_42_3 : import46.DefaultValueAccessor +>this : this +>_DefaultValueAccessor_42_3 : import46.DefaultValueAccessor + + if (((token === import49.NG_VALUE_ACCESSOR) && (42 === requestNodeIndex))) { return this._NG_VALUE_ACCESSOR_42_4; } +>((token === import49.NG_VALUE_ACCESSOR) && (42 === requestNodeIndex)) : boolean +>(token === import49.NG_VALUE_ACCESSOR) && (42 === requestNodeIndex) : boolean +>(token === import49.NG_VALUE_ACCESSOR) : boolean +>token === import49.NG_VALUE_ACCESSOR : boolean +>token : any +>import49.NG_VALUE_ACCESSOR : String +>import49 : typeof import49 +>NG_VALUE_ACCESSOR : String +>(42 === requestNodeIndex) : boolean +>42 === requestNodeIndex : boolean +>42 : 42 +>requestNodeIndex : number +>this._NG_VALUE_ACCESSOR_42_4 : any[] +>this : this +>_NG_VALUE_ACCESSOR_42_4 : any[] + + if (((token === import47.FormControlName) && (42 === requestNodeIndex))) { return this._FormControlName_42_5; } +>((token === import47.FormControlName) && (42 === requestNodeIndex)) : boolean +>(token === import47.FormControlName) && (42 === requestNodeIndex) : boolean +>(token === import47.FormControlName) : boolean +>token === import47.FormControlName : boolean +>token : any +>import47.FormControlName : typeof import47.FormControlName +>import47 : typeof import47 +>FormControlName : typeof import47.FormControlName +>(42 === requestNodeIndex) : boolean +>42 === requestNodeIndex : boolean +>42 : 42 +>requestNodeIndex : number +>this._FormControlName_42_5 : import47.FormControlName +>this : this +>_FormControlName_42_5 : import47.FormControlName + + if (((token === import50.NgControl) && (42 === requestNodeIndex))) { return this._NgControl_42_6; } +>((token === import50.NgControl) && (42 === requestNodeIndex)) : boolean +>(token === import50.NgControl) && (42 === requestNodeIndex) : boolean +>(token === import50.NgControl) : boolean +>token === import50.NgControl : boolean +>token : any +>import50.NgControl : typeof import50.NgControl +>import50 : typeof import50 +>NgControl : typeof import50.NgControl +>(42 === requestNodeIndex) : boolean +>42 === requestNodeIndex : boolean +>42 : 42 +>requestNodeIndex : number +>this._NgControl_42_6 : any +>this : this +>_NgControl_42_6 : any + + if (((token === import45.NgControlStatus) && (42 === requestNodeIndex))) { return this._NgControlStatus_42_7; } +>((token === import45.NgControlStatus) && (42 === requestNodeIndex)) : boolean +>(token === import45.NgControlStatus) && (42 === requestNodeIndex) : boolean +>(token === import45.NgControlStatus) : boolean +>token === import45.NgControlStatus : boolean +>token : any +>import45.NgControlStatus : typeof import45.NgControlStatus +>import45 : typeof import45 +>NgControlStatus : typeof import45.NgControlStatus +>(42 === requestNodeIndex) : boolean +>42 === requestNodeIndex : boolean +>42 : 42 +>requestNodeIndex : number +>this._NgControlStatus_42_7 : import45.NgControlStatus +>this : this +>_NgControlStatus_42_7 : import45.NgControlStatus + + if (((token === import46.DefaultValueAccessor) && (45 === requestNodeIndex))) { return this._DefaultValueAccessor_45_3; } +>((token === import46.DefaultValueAccessor) && (45 === requestNodeIndex)) : boolean +>(token === import46.DefaultValueAccessor) && (45 === requestNodeIndex) : boolean +>(token === import46.DefaultValueAccessor) : boolean +>token === import46.DefaultValueAccessor : boolean +>token : any +>import46.DefaultValueAccessor : typeof import46.DefaultValueAccessor +>import46 : typeof import46 +>DefaultValueAccessor : typeof import46.DefaultValueAccessor +>(45 === requestNodeIndex) : boolean +>45 === requestNodeIndex : boolean +>45 : 45 +>requestNodeIndex : number +>this._DefaultValueAccessor_45_3 : import46.DefaultValueAccessor +>this : this +>_DefaultValueAccessor_45_3 : import46.DefaultValueAccessor + + if (((token === import49.NG_VALUE_ACCESSOR) && (45 === requestNodeIndex))) { return this._NG_VALUE_ACCESSOR_45_4; } +>((token === import49.NG_VALUE_ACCESSOR) && (45 === requestNodeIndex)) : boolean +>(token === import49.NG_VALUE_ACCESSOR) && (45 === requestNodeIndex) : boolean +>(token === import49.NG_VALUE_ACCESSOR) : boolean +>token === import49.NG_VALUE_ACCESSOR : boolean +>token : any +>import49.NG_VALUE_ACCESSOR : String +>import49 : typeof import49 +>NG_VALUE_ACCESSOR : String +>(45 === requestNodeIndex) : boolean +>45 === requestNodeIndex : boolean +>45 : 45 +>requestNodeIndex : number +>this._NG_VALUE_ACCESSOR_45_4 : any[] +>this : this +>_NG_VALUE_ACCESSOR_45_4 : any[] + + if (((token === import47.FormControlName) && (45 === requestNodeIndex))) { return this._FormControlName_45_5; } +>((token === import47.FormControlName) && (45 === requestNodeIndex)) : boolean +>(token === import47.FormControlName) && (45 === requestNodeIndex) : boolean +>(token === import47.FormControlName) : boolean +>token === import47.FormControlName : boolean +>token : any +>import47.FormControlName : typeof import47.FormControlName +>import47 : typeof import47 +>FormControlName : typeof import47.FormControlName +>(45 === requestNodeIndex) : boolean +>45 === requestNodeIndex : boolean +>45 : 45 +>requestNodeIndex : number +>this._FormControlName_45_5 : import47.FormControlName +>this : this +>_FormControlName_45_5 : import47.FormControlName + + if (((token === import50.NgControl) && (45 === requestNodeIndex))) { return this._NgControl_45_6; } +>((token === import50.NgControl) && (45 === requestNodeIndex)) : boolean +>(token === import50.NgControl) && (45 === requestNodeIndex) : boolean +>(token === import50.NgControl) : boolean +>token === import50.NgControl : boolean +>token : any +>import50.NgControl : typeof import50.NgControl +>import50 : typeof import50 +>NgControl : typeof import50.NgControl +>(45 === requestNodeIndex) : boolean +>45 === requestNodeIndex : boolean +>45 : 45 +>requestNodeIndex : number +>this._NgControl_45_6 : any +>this : this +>_NgControl_45_6 : any + + if (((token === import45.NgControlStatus) && (45 === requestNodeIndex))) { return this._NgControlStatus_45_7; } +>((token === import45.NgControlStatus) && (45 === requestNodeIndex)) : boolean +>(token === import45.NgControlStatus) && (45 === requestNodeIndex) : boolean +>(token === import45.NgControlStatus) : boolean +>token === import45.NgControlStatus : boolean +>token : any +>import45.NgControlStatus : typeof import45.NgControlStatus +>import45 : typeof import45 +>NgControlStatus : typeof import45.NgControlStatus +>(45 === requestNodeIndex) : boolean +>45 === requestNodeIndex : boolean +>45 : 45 +>requestNodeIndex : number +>this._NgControlStatus_45_7 : import45.NgControlStatus +>this : this +>_NgControlStatus_45_7 : import45.NgControlStatus + + if (((token === import46.DefaultValueAccessor) && (48 === requestNodeIndex))) { return this._DefaultValueAccessor_48_3; } +>((token === import46.DefaultValueAccessor) && (48 === requestNodeIndex)) : boolean +>(token === import46.DefaultValueAccessor) && (48 === requestNodeIndex) : boolean +>(token === import46.DefaultValueAccessor) : boolean +>token === import46.DefaultValueAccessor : boolean +>token : any +>import46.DefaultValueAccessor : typeof import46.DefaultValueAccessor +>import46 : typeof import46 +>DefaultValueAccessor : typeof import46.DefaultValueAccessor +>(48 === requestNodeIndex) : boolean +>48 === requestNodeIndex : boolean +>48 : 48 +>requestNodeIndex : number +>this._DefaultValueAccessor_48_3 : import46.DefaultValueAccessor +>this : this +>_DefaultValueAccessor_48_3 : import46.DefaultValueAccessor + + if (((token === import49.NG_VALUE_ACCESSOR) && (48 === requestNodeIndex))) { return this._NG_VALUE_ACCESSOR_48_4; } +>((token === import49.NG_VALUE_ACCESSOR) && (48 === requestNodeIndex)) : boolean +>(token === import49.NG_VALUE_ACCESSOR) && (48 === requestNodeIndex) : boolean +>(token === import49.NG_VALUE_ACCESSOR) : boolean +>token === import49.NG_VALUE_ACCESSOR : boolean +>token : any +>import49.NG_VALUE_ACCESSOR : String +>import49 : typeof import49 +>NG_VALUE_ACCESSOR : String +>(48 === requestNodeIndex) : boolean +>48 === requestNodeIndex : boolean +>48 : 48 +>requestNodeIndex : number +>this._NG_VALUE_ACCESSOR_48_4 : any[] +>this : this +>_NG_VALUE_ACCESSOR_48_4 : any[] + + if (((token === import47.FormControlName) && (48 === requestNodeIndex))) { return this._FormControlName_48_5; } +>((token === import47.FormControlName) && (48 === requestNodeIndex)) : boolean +>(token === import47.FormControlName) && (48 === requestNodeIndex) : boolean +>(token === import47.FormControlName) : boolean +>token === import47.FormControlName : boolean +>token : any +>import47.FormControlName : typeof import47.FormControlName +>import47 : typeof import47 +>FormControlName : typeof import47.FormControlName +>(48 === requestNodeIndex) : boolean +>48 === requestNodeIndex : boolean +>48 : 48 +>requestNodeIndex : number +>this._FormControlName_48_5 : import47.FormControlName +>this : this +>_FormControlName_48_5 : import47.FormControlName + + if (((token === import50.NgControl) && (48 === requestNodeIndex))) { return this._NgControl_48_6; } +>((token === import50.NgControl) && (48 === requestNodeIndex)) : boolean +>(token === import50.NgControl) && (48 === requestNodeIndex) : boolean +>(token === import50.NgControl) : boolean +>token === import50.NgControl : boolean +>token : any +>import50.NgControl : typeof import50.NgControl +>import50 : typeof import50 +>NgControl : typeof import50.NgControl +>(48 === requestNodeIndex) : boolean +>48 === requestNodeIndex : boolean +>48 : 48 +>requestNodeIndex : number +>this._NgControl_48_6 : any +>this : this +>_NgControl_48_6 : any + + if (((token === import45.NgControlStatus) && (48 === requestNodeIndex))) { return this._NgControlStatus_48_7; } +>((token === import45.NgControlStatus) && (48 === requestNodeIndex)) : boolean +>(token === import45.NgControlStatus) && (48 === requestNodeIndex) : boolean +>(token === import45.NgControlStatus) : boolean +>token === import45.NgControlStatus : boolean +>token : any +>import45.NgControlStatus : typeof import45.NgControlStatus +>import45 : typeof import45 +>NgControlStatus : typeof import45.NgControlStatus +>(48 === requestNodeIndex) : boolean +>48 === requestNodeIndex : boolean +>48 : 48 +>requestNodeIndex : number +>this._NgControlStatus_48_7 : import45.NgControlStatus +>this : this +>_NgControlStatus_48_7 : import45.NgControlStatus + + if (((token === import46.DefaultValueAccessor) && (51 === requestNodeIndex))) { return this._DefaultValueAccessor_51_3; } +>((token === import46.DefaultValueAccessor) && (51 === requestNodeIndex)) : boolean +>(token === import46.DefaultValueAccessor) && (51 === requestNodeIndex) : boolean +>(token === import46.DefaultValueAccessor) : boolean +>token === import46.DefaultValueAccessor : boolean +>token : any +>import46.DefaultValueAccessor : typeof import46.DefaultValueAccessor +>import46 : typeof import46 +>DefaultValueAccessor : typeof import46.DefaultValueAccessor +>(51 === requestNodeIndex) : boolean +>51 === requestNodeIndex : boolean +>51 : 51 +>requestNodeIndex : number +>this._DefaultValueAccessor_51_3 : import46.DefaultValueAccessor +>this : this +>_DefaultValueAccessor_51_3 : import46.DefaultValueAccessor + + if (((token === import49.NG_VALUE_ACCESSOR) && (51 === requestNodeIndex))) { return this._NG_VALUE_ACCESSOR_51_4; } +>((token === import49.NG_VALUE_ACCESSOR) && (51 === requestNodeIndex)) : boolean +>(token === import49.NG_VALUE_ACCESSOR) && (51 === requestNodeIndex) : boolean +>(token === import49.NG_VALUE_ACCESSOR) : boolean +>token === import49.NG_VALUE_ACCESSOR : boolean +>token : any +>import49.NG_VALUE_ACCESSOR : String +>import49 : typeof import49 +>NG_VALUE_ACCESSOR : String +>(51 === requestNodeIndex) : boolean +>51 === requestNodeIndex : boolean +>51 : 51 +>requestNodeIndex : number +>this._NG_VALUE_ACCESSOR_51_4 : any[] +>this : this +>_NG_VALUE_ACCESSOR_51_4 : any[] + + if (((token === import47.FormControlName) && (51 === requestNodeIndex))) { return this._FormControlName_51_5; } +>((token === import47.FormControlName) && (51 === requestNodeIndex)) : boolean +>(token === import47.FormControlName) && (51 === requestNodeIndex) : boolean +>(token === import47.FormControlName) : boolean +>token === import47.FormControlName : boolean +>token : any +>import47.FormControlName : typeof import47.FormControlName +>import47 : typeof import47 +>FormControlName : typeof import47.FormControlName +>(51 === requestNodeIndex) : boolean +>51 === requestNodeIndex : boolean +>51 : 51 +>requestNodeIndex : number +>this._FormControlName_51_5 : import47.FormControlName +>this : this +>_FormControlName_51_5 : import47.FormControlName + + if (((token === import50.NgControl) && (51 === requestNodeIndex))) { return this._NgControl_51_6; } +>((token === import50.NgControl) && (51 === requestNodeIndex)) : boolean +>(token === import50.NgControl) && (51 === requestNodeIndex) : boolean +>(token === import50.NgControl) : boolean +>token === import50.NgControl : boolean +>token : any +>import50.NgControl : typeof import50.NgControl +>import50 : typeof import50 +>NgControl : typeof import50.NgControl +>(51 === requestNodeIndex) : boolean +>51 === requestNodeIndex : boolean +>51 : 51 +>requestNodeIndex : number +>this._NgControl_51_6 : any +>this : this +>_NgControl_51_6 : any + + if (((token === import45.NgControlStatus) && (51 === requestNodeIndex))) { return this._NgControlStatus_51_7; } +>((token === import45.NgControlStatus) && (51 === requestNodeIndex)) : boolean +>(token === import45.NgControlStatus) && (51 === requestNodeIndex) : boolean +>(token === import45.NgControlStatus) : boolean +>token === import45.NgControlStatus : boolean +>token : any +>import45.NgControlStatus : typeof import45.NgControlStatus +>import45 : typeof import45 +>NgControlStatus : typeof import45.NgControlStatus +>(51 === requestNodeIndex) : boolean +>51 === requestNodeIndex : boolean +>51 : 51 +>requestNodeIndex : number +>this._NgControlStatus_51_7 : import45.NgControlStatus +>this : this +>_NgControlStatus_51_7 : import45.NgControlStatus + + if (((token === import46.DefaultValueAccessor) && (54 === requestNodeIndex))) { return this._DefaultValueAccessor_54_3; } +>((token === import46.DefaultValueAccessor) && (54 === requestNodeIndex)) : boolean +>(token === import46.DefaultValueAccessor) && (54 === requestNodeIndex) : boolean +>(token === import46.DefaultValueAccessor) : boolean +>token === import46.DefaultValueAccessor : boolean +>token : any +>import46.DefaultValueAccessor : typeof import46.DefaultValueAccessor +>import46 : typeof import46 +>DefaultValueAccessor : typeof import46.DefaultValueAccessor +>(54 === requestNodeIndex) : boolean +>54 === requestNodeIndex : boolean +>54 : 54 +>requestNodeIndex : number +>this._DefaultValueAccessor_54_3 : import46.DefaultValueAccessor +>this : this +>_DefaultValueAccessor_54_3 : import46.DefaultValueAccessor + + if (((token === import49.NG_VALUE_ACCESSOR) && (54 === requestNodeIndex))) { return this._NG_VALUE_ACCESSOR_54_4; } +>((token === import49.NG_VALUE_ACCESSOR) && (54 === requestNodeIndex)) : boolean +>(token === import49.NG_VALUE_ACCESSOR) && (54 === requestNodeIndex) : boolean +>(token === import49.NG_VALUE_ACCESSOR) : boolean +>token === import49.NG_VALUE_ACCESSOR : boolean +>token : any +>import49.NG_VALUE_ACCESSOR : String +>import49 : typeof import49 +>NG_VALUE_ACCESSOR : String +>(54 === requestNodeIndex) : boolean +>54 === requestNodeIndex : boolean +>54 : 54 +>requestNodeIndex : number +>this._NG_VALUE_ACCESSOR_54_4 : any[] +>this : this +>_NG_VALUE_ACCESSOR_54_4 : any[] + + if (((token === import47.FormControlName) && (54 === requestNodeIndex))) { return this._FormControlName_54_5; } +>((token === import47.FormControlName) && (54 === requestNodeIndex)) : boolean +>(token === import47.FormControlName) && (54 === requestNodeIndex) : boolean +>(token === import47.FormControlName) : boolean +>token === import47.FormControlName : boolean +>token : any +>import47.FormControlName : typeof import47.FormControlName +>import47 : typeof import47 +>FormControlName : typeof import47.FormControlName +>(54 === requestNodeIndex) : boolean +>54 === requestNodeIndex : boolean +>54 : 54 +>requestNodeIndex : number +>this._FormControlName_54_5 : import47.FormControlName +>this : this +>_FormControlName_54_5 : import47.FormControlName + + if (((token === import50.NgControl) && (54 === requestNodeIndex))) { return this._NgControl_54_6; } +>((token === import50.NgControl) && (54 === requestNodeIndex)) : boolean +>(token === import50.NgControl) && (54 === requestNodeIndex) : boolean +>(token === import50.NgControl) : boolean +>token === import50.NgControl : boolean +>token : any +>import50.NgControl : typeof import50.NgControl +>import50 : typeof import50 +>NgControl : typeof import50.NgControl +>(54 === requestNodeIndex) : boolean +>54 === requestNodeIndex : boolean +>54 : 54 +>requestNodeIndex : number +>this._NgControl_54_6 : any +>this : this +>_NgControl_54_6 : any + + if (((token === import45.NgControlStatus) && (54 === requestNodeIndex))) { return this._NgControlStatus_54_7; } +>((token === import45.NgControlStatus) && (54 === requestNodeIndex)) : boolean +>(token === import45.NgControlStatus) && (54 === requestNodeIndex) : boolean +>(token === import45.NgControlStatus) : boolean +>token === import45.NgControlStatus : boolean +>token : any +>import45.NgControlStatus : typeof import45.NgControlStatus +>import45 : typeof import45 +>NgControlStatus : typeof import45.NgControlStatus +>(54 === requestNodeIndex) : boolean +>54 === requestNodeIndex : boolean +>54 : 54 +>requestNodeIndex : number +>this._NgControlStatus_54_7 : import45.NgControlStatus +>this : this +>_NgControlStatus_54_7 : import45.NgControlStatus + + if (((token === import46.DefaultValueAccessor) && (57 === requestNodeIndex))) { return this._DefaultValueAccessor_57_3; } +>((token === import46.DefaultValueAccessor) && (57 === requestNodeIndex)) : boolean +>(token === import46.DefaultValueAccessor) && (57 === requestNodeIndex) : boolean +>(token === import46.DefaultValueAccessor) : boolean +>token === import46.DefaultValueAccessor : boolean +>token : any +>import46.DefaultValueAccessor : typeof import46.DefaultValueAccessor +>import46 : typeof import46 +>DefaultValueAccessor : typeof import46.DefaultValueAccessor +>(57 === requestNodeIndex) : boolean +>57 === requestNodeIndex : boolean +>57 : 57 +>requestNodeIndex : number +>this._DefaultValueAccessor_57_3 : import46.DefaultValueAccessor +>this : this +>_DefaultValueAccessor_57_3 : import46.DefaultValueAccessor + + if (((token === import49.NG_VALUE_ACCESSOR) && (57 === requestNodeIndex))) { return this._NG_VALUE_ACCESSOR_57_4; } +>((token === import49.NG_VALUE_ACCESSOR) && (57 === requestNodeIndex)) : boolean +>(token === import49.NG_VALUE_ACCESSOR) && (57 === requestNodeIndex) : boolean +>(token === import49.NG_VALUE_ACCESSOR) : boolean +>token === import49.NG_VALUE_ACCESSOR : boolean +>token : any +>import49.NG_VALUE_ACCESSOR : String +>import49 : typeof import49 +>NG_VALUE_ACCESSOR : String +>(57 === requestNodeIndex) : boolean +>57 === requestNodeIndex : boolean +>57 : 57 +>requestNodeIndex : number +>this._NG_VALUE_ACCESSOR_57_4 : any[] +>this : this +>_NG_VALUE_ACCESSOR_57_4 : any[] + + if (((token === import47.FormControlName) && (57 === requestNodeIndex))) { return this._FormControlName_57_5; } +>((token === import47.FormControlName) && (57 === requestNodeIndex)) : boolean +>(token === import47.FormControlName) && (57 === requestNodeIndex) : boolean +>(token === import47.FormControlName) : boolean +>token === import47.FormControlName : boolean +>token : any +>import47.FormControlName : typeof import47.FormControlName +>import47 : typeof import47 +>FormControlName : typeof import47.FormControlName +>(57 === requestNodeIndex) : boolean +>57 === requestNodeIndex : boolean +>57 : 57 +>requestNodeIndex : number +>this._FormControlName_57_5 : import47.FormControlName +>this : this +>_FormControlName_57_5 : import47.FormControlName + + if (((token === import50.NgControl) && (57 === requestNodeIndex))) { return this._NgControl_57_6; } +>((token === import50.NgControl) && (57 === requestNodeIndex)) : boolean +>(token === import50.NgControl) && (57 === requestNodeIndex) : boolean +>(token === import50.NgControl) : boolean +>token === import50.NgControl : boolean +>token : any +>import50.NgControl : typeof import50.NgControl +>import50 : typeof import50 +>NgControl : typeof import50.NgControl +>(57 === requestNodeIndex) : boolean +>57 === requestNodeIndex : boolean +>57 : 57 +>requestNodeIndex : number +>this._NgControl_57_6 : any +>this : this +>_NgControl_57_6 : any + + if (((token === import45.NgControlStatus) && (57 === requestNodeIndex))) { return this._NgControlStatus_57_7; } +>((token === import45.NgControlStatus) && (57 === requestNodeIndex)) : boolean +>(token === import45.NgControlStatus) && (57 === requestNodeIndex) : boolean +>(token === import45.NgControlStatus) : boolean +>token === import45.NgControlStatus : boolean +>token : any +>import45.NgControlStatus : typeof import45.NgControlStatus +>import45 : typeof import45 +>NgControlStatus : typeof import45.NgControlStatus +>(57 === requestNodeIndex) : boolean +>57 === requestNodeIndex : boolean +>57 : 57 +>requestNodeIndex : number +>this._NgControlStatus_57_7 : import45.NgControlStatus +>this : this +>_NgControlStatus_57_7 : import45.NgControlStatus + + if (((token === import46.DefaultValueAccessor) && (60 === requestNodeIndex))) { return this._DefaultValueAccessor_60_3; } +>((token === import46.DefaultValueAccessor) && (60 === requestNodeIndex)) : boolean +>(token === import46.DefaultValueAccessor) && (60 === requestNodeIndex) : boolean +>(token === import46.DefaultValueAccessor) : boolean +>token === import46.DefaultValueAccessor : boolean +>token : any +>import46.DefaultValueAccessor : typeof import46.DefaultValueAccessor +>import46 : typeof import46 +>DefaultValueAccessor : typeof import46.DefaultValueAccessor +>(60 === requestNodeIndex) : boolean +>60 === requestNodeIndex : boolean +>60 : 60 +>requestNodeIndex : number +>this._DefaultValueAccessor_60_3 : import46.DefaultValueAccessor +>this : this +>_DefaultValueAccessor_60_3 : import46.DefaultValueAccessor + + if (((token === import49.NG_VALUE_ACCESSOR) && (60 === requestNodeIndex))) { return this._NG_VALUE_ACCESSOR_60_4; } +>((token === import49.NG_VALUE_ACCESSOR) && (60 === requestNodeIndex)) : boolean +>(token === import49.NG_VALUE_ACCESSOR) && (60 === requestNodeIndex) : boolean +>(token === import49.NG_VALUE_ACCESSOR) : boolean +>token === import49.NG_VALUE_ACCESSOR : boolean +>token : any +>import49.NG_VALUE_ACCESSOR : String +>import49 : typeof import49 +>NG_VALUE_ACCESSOR : String +>(60 === requestNodeIndex) : boolean +>60 === requestNodeIndex : boolean +>60 : 60 +>requestNodeIndex : number +>this._NG_VALUE_ACCESSOR_60_4 : any[] +>this : this +>_NG_VALUE_ACCESSOR_60_4 : any[] + + if (((token === import47.FormControlName) && (60 === requestNodeIndex))) { return this._FormControlName_60_5; } +>((token === import47.FormControlName) && (60 === requestNodeIndex)) : boolean +>(token === import47.FormControlName) && (60 === requestNodeIndex) : boolean +>(token === import47.FormControlName) : boolean +>token === import47.FormControlName : boolean +>token : any +>import47.FormControlName : typeof import47.FormControlName +>import47 : typeof import47 +>FormControlName : typeof import47.FormControlName +>(60 === requestNodeIndex) : boolean +>60 === requestNodeIndex : boolean +>60 : 60 +>requestNodeIndex : number +>this._FormControlName_60_5 : import47.FormControlName +>this : this +>_FormControlName_60_5 : import47.FormControlName + + if (((token === import50.NgControl) && (60 === requestNodeIndex))) { return this._NgControl_60_6; } +>((token === import50.NgControl) && (60 === requestNodeIndex)) : boolean +>(token === import50.NgControl) && (60 === requestNodeIndex) : boolean +>(token === import50.NgControl) : boolean +>token === import50.NgControl : boolean +>token : any +>import50.NgControl : typeof import50.NgControl +>import50 : typeof import50 +>NgControl : typeof import50.NgControl +>(60 === requestNodeIndex) : boolean +>60 === requestNodeIndex : boolean +>60 : 60 +>requestNodeIndex : number +>this._NgControl_60_6 : any +>this : this +>_NgControl_60_6 : any + + if (((token === import45.NgControlStatus) && (60 === requestNodeIndex))) { return this._NgControlStatus_60_7; } +>((token === import45.NgControlStatus) && (60 === requestNodeIndex)) : boolean +>(token === import45.NgControlStatus) && (60 === requestNodeIndex) : boolean +>(token === import45.NgControlStatus) : boolean +>token === import45.NgControlStatus : boolean +>token : any +>import45.NgControlStatus : typeof import45.NgControlStatus +>import45 : typeof import45 +>NgControlStatus : typeof import45.NgControlStatus +>(60 === requestNodeIndex) : boolean +>60 === requestNodeIndex : boolean +>60 : 60 +>requestNodeIndex : number +>this._NgControlStatus_60_7 : import45.NgControlStatus +>this : this +>_NgControlStatus_60_7 : import45.NgControlStatus + + if (((token === import44.FormGroupDirective) && ((1 <= requestNodeIndex) && (requestNodeIndex <= 62)))) { return this._FormGroupDirective_1_3; } +>((token === import44.FormGroupDirective) && ((1 <= requestNodeIndex) && (requestNodeIndex <= 62))) : boolean +>(token === import44.FormGroupDirective) && ((1 <= requestNodeIndex) && (requestNodeIndex <= 62)) : boolean +>(token === import44.FormGroupDirective) : boolean +>token === import44.FormGroupDirective : boolean +>token : any +>import44.FormGroupDirective : typeof import44.FormGroupDirective +>import44 : typeof import44 +>FormGroupDirective : typeof import44.FormGroupDirective +>((1 <= requestNodeIndex) && (requestNodeIndex <= 62)) : boolean +>(1 <= requestNodeIndex) && (requestNodeIndex <= 62) : boolean +>(1 <= requestNodeIndex) : boolean +>1 <= requestNodeIndex : boolean +>1 : 1 +>requestNodeIndex : number +>(requestNodeIndex <= 62) : boolean +>requestNodeIndex <= 62 : boolean +>requestNodeIndex : number +>62 : 62 +>this._FormGroupDirective_1_3 : import44.FormGroupDirective +>this : this +>_FormGroupDirective_1_3 : import44.FormGroupDirective + + if (((token === import51.ControlContainer) && ((1 <= requestNodeIndex) && (requestNodeIndex <= 62)))) { return this._ControlContainer_1_4; } +>((token === import51.ControlContainer) && ((1 <= requestNodeIndex) && (requestNodeIndex <= 62))) : boolean +>(token === import51.ControlContainer) && ((1 <= requestNodeIndex) && (requestNodeIndex <= 62)) : boolean +>(token === import51.ControlContainer) : boolean +>token === import51.ControlContainer : boolean +>token : any +>import51.ControlContainer : typeof import51.ControlContainer +>import51 : typeof import51 +>ControlContainer : typeof import51.ControlContainer +>((1 <= requestNodeIndex) && (requestNodeIndex <= 62)) : boolean +>(1 <= requestNodeIndex) && (requestNodeIndex <= 62) : boolean +>(1 <= requestNodeIndex) : boolean +>1 <= requestNodeIndex : boolean +>1 : 1 +>requestNodeIndex : number +>(requestNodeIndex <= 62) : boolean +>requestNodeIndex <= 62 : boolean +>requestNodeIndex : number +>62 : 62 +>this._ControlContainer_1_4 : any +>this : this +>_ControlContainer_1_4 : any + + if (((token === import45.NgControlStatusGroup) && ((1 <= requestNodeIndex) && (requestNodeIndex <= 62)))) { return this._NgControlStatusGroup_1_5; } +>((token === import45.NgControlStatusGroup) && ((1 <= requestNodeIndex) && (requestNodeIndex <= 62))) : boolean +>(token === import45.NgControlStatusGroup) && ((1 <= requestNodeIndex) && (requestNodeIndex <= 62)) : boolean +>(token === import45.NgControlStatusGroup) : boolean +>token === import45.NgControlStatusGroup : boolean +>token : any +>import45.NgControlStatusGroup : typeof import45.NgControlStatusGroup +>import45 : typeof import45 +>NgControlStatusGroup : typeof import45.NgControlStatusGroup +>((1 <= requestNodeIndex) && (requestNodeIndex <= 62)) : boolean +>(1 <= requestNodeIndex) && (requestNodeIndex <= 62) : boolean +>(1 <= requestNodeIndex) : boolean +>1 <= requestNodeIndex : boolean +>1 : 1 +>requestNodeIndex : number +>(requestNodeIndex <= 62) : boolean +>requestNodeIndex <= 62 : boolean +>requestNodeIndex : number +>62 : 62 +>this._NgControlStatusGroup_1_5 : import45.NgControlStatusGroup +>this : this +>_NgControlStatusGroup_1_5 : import45.NgControlStatusGroup + + return notFoundResult; +>notFoundResult : any + } +} +export function viewFactory_AppComponent0(viewUtils:any,parentInjector:any,declarationEl:any):any { +>viewFactory_AppComponent0 : (viewUtils: any, parentInjector: any, declarationEl: any) => any +>viewUtils : any +>parentInjector : any +>declarationEl : any + + return new _View_AppComponent0(viewUtils,parentInjector,declarationEl); +>new _View_AppComponent0(viewUtils,parentInjector,declarationEl) : _View_AppComponent0 +>_View_AppComponent0 : typeof _View_AppComponent0 +>viewUtils : any +>parentInjector : any +>declarationEl : any +} + diff --git a/tests/baselines/reference/complicatedPrivacy.errors.txt b/tests/baselines/reference/complicatedPrivacy.errors.txt index 2ba3abbab8a..c81605a5a83 100644 --- a/tests/baselines/reference/complicatedPrivacy.errors.txt +++ b/tests/baselines/reference/complicatedPrivacy.errors.txt @@ -1,7 +1,7 @@ tests/cases/compiler/complicatedPrivacy.ts(11,24): error TS1054: A 'get' accessor cannot have parameters. tests/cases/compiler/complicatedPrivacy.ts(35,5): error TS1170: A computed property name in a type literal must directly refer to a built-in symbol. tests/cases/compiler/complicatedPrivacy.ts(35,6): error TS2304: Cannot find name 'number'. -tests/cases/compiler/complicatedPrivacy.ts(73,55): error TS2305: Module 'mglo5' has no exported member 'i6'. +tests/cases/compiler/complicatedPrivacy.ts(73,55): error TS2694: Namespace 'mglo5' has no exported member 'i6'. ==== tests/cases/compiler/complicatedPrivacy.ts (4 errors) ==== @@ -85,7 +85,7 @@ tests/cases/compiler/complicatedPrivacy.ts(73,55): error TS2305: Module 'mglo5' export class c_pr implements mglo5.i5, mglo5.i6 { ~~ -!!! error TS2305: Module 'mglo5' has no exported member 'i6'. +!!! error TS2694: Namespace 'mglo5' has no exported member 'i6'. f1() { return "Hello"; } diff --git a/tests/baselines/reference/compoundAdditionAssignmentLHSCanBeAssigned.types b/tests/baselines/reference/compoundAdditionAssignmentLHSCanBeAssigned.types index 77189e5fee2..64eb0ddfdbb 100644 --- a/tests/baselines/reference/compoundAdditionAssignmentLHSCanBeAssigned.types +++ b/tests/baselines/reference/compoundAdditionAssignmentLHSCanBeAssigned.types @@ -1,8 +1,8 @@ === tests/cases/conformance/expressions/assignmentOperator/compoundAdditionAssignmentLHSCanBeAssigned.ts === enum E { a, b } >E : E ->a : E ->b : E +>a : E.a +>b : E.b var a: any; >a : any @@ -26,24 +26,24 @@ x1 += b; x1 += true; >x1 += true : any >x1 : any ->true : boolean +>true : true x1 += 0; >x1 += 0 : any >x1 : any ->0 : number +>0 : 0 x1 += ''; >x1 += '' : string >x1 : any ->'' : string +>'' : "" x1 += E.a; >x1 += E.a : any >x1 : any ->E.a : E +>E.a : E.a >E : typeof E ->a : E +>a : E.a x1 += {}; >x1 += {} : any @@ -76,24 +76,24 @@ x2 += b; x2 += true; >x2 += true : string >x2 : string ->true : boolean +>true : true x2 += 0; >x2 += 0 : string >x2 : string ->0 : number +>0 : 0 x2 += ''; >x2 += '' : string >x2 : string ->'' : string +>'' : "" x2 += E.a; >x2 += E.a : string >x2 : string ->E.a : E +>E.a : E.a >E : typeof E ->a : E +>a : E.a x2 += {}; >x2 += {} : string @@ -121,14 +121,14 @@ x3 += a; x3 += 0; >x3 += 0 : number >x3 : number ->0 : number +>0 : 0 x3 += E.a; >x3 += E.a : number >x3 : number ->E.a : E +>E.a : E.a >E : typeof E ->a : E +>a : E.a x3 += null; >x3 += null : number @@ -190,7 +190,7 @@ x6 += a; x6 += ''; >x6 += '' : string >x6 : {} ->'' : string +>'' : "" var x7: void; >x7 : void diff --git a/tests/baselines/reference/compoundAdditionAssignmentWithInvalidOperands.errors.txt b/tests/baselines/reference/compoundAdditionAssignmentWithInvalidOperands.errors.txt index 45be0c3129f..cadc5c945d1 100644 --- a/tests/baselines/reference/compoundAdditionAssignmentWithInvalidOperands.errors.txt +++ b/tests/baselines/reference/compoundAdditionAssignmentWithInvalidOperands.errors.txt @@ -1,29 +1,29 @@ tests/cases/conformance/expressions/assignmentOperator/compoundAdditionAssignmentWithInvalidOperands.ts(6,1): error TS2365: Operator '+=' cannot be applied to types 'boolean' and 'void'. -tests/cases/conformance/expressions/assignmentOperator/compoundAdditionAssignmentWithInvalidOperands.ts(7,1): error TS2365: Operator '+=' cannot be applied to types 'boolean' and 'boolean'. -tests/cases/conformance/expressions/assignmentOperator/compoundAdditionAssignmentWithInvalidOperands.ts(8,1): error TS2365: Operator '+=' cannot be applied to types 'boolean' and 'number'. -tests/cases/conformance/expressions/assignmentOperator/compoundAdditionAssignmentWithInvalidOperands.ts(9,1): error TS2365: Operator '+=' cannot be applied to types 'boolean' and 'E'. +tests/cases/conformance/expressions/assignmentOperator/compoundAdditionAssignmentWithInvalidOperands.ts(7,1): error TS2365: Operator '+=' cannot be applied to types 'boolean' and 'true'. +tests/cases/conformance/expressions/assignmentOperator/compoundAdditionAssignmentWithInvalidOperands.ts(8,1): error TS2365: Operator '+=' cannot be applied to types 'boolean' and '0'. +tests/cases/conformance/expressions/assignmentOperator/compoundAdditionAssignmentWithInvalidOperands.ts(9,1): error TS2365: Operator '+=' cannot be applied to types 'boolean' and 'E.a'. tests/cases/conformance/expressions/assignmentOperator/compoundAdditionAssignmentWithInvalidOperands.ts(10,1): error TS2365: Operator '+=' cannot be applied to types 'boolean' and '{}'. tests/cases/conformance/expressions/assignmentOperator/compoundAdditionAssignmentWithInvalidOperands.ts(11,1): error TS2365: Operator '+=' cannot be applied to types 'boolean' and 'boolean'. tests/cases/conformance/expressions/assignmentOperator/compoundAdditionAssignmentWithInvalidOperands.ts(12,1): error TS2365: Operator '+=' cannot be applied to types 'boolean' and 'boolean'. tests/cases/conformance/expressions/assignmentOperator/compoundAdditionAssignmentWithInvalidOperands.ts(15,1): error TS2365: Operator '+=' cannot be applied to types '{}' and 'void'. -tests/cases/conformance/expressions/assignmentOperator/compoundAdditionAssignmentWithInvalidOperands.ts(16,1): error TS2365: Operator '+=' cannot be applied to types '{}' and 'boolean'. -tests/cases/conformance/expressions/assignmentOperator/compoundAdditionAssignmentWithInvalidOperands.ts(17,1): error TS2365: Operator '+=' cannot be applied to types '{}' and 'number'. -tests/cases/conformance/expressions/assignmentOperator/compoundAdditionAssignmentWithInvalidOperands.ts(18,1): error TS2365: Operator '+=' cannot be applied to types '{}' and 'E'. +tests/cases/conformance/expressions/assignmentOperator/compoundAdditionAssignmentWithInvalidOperands.ts(16,1): error TS2365: Operator '+=' cannot be applied to types '{}' and 'true'. +tests/cases/conformance/expressions/assignmentOperator/compoundAdditionAssignmentWithInvalidOperands.ts(17,1): error TS2365: Operator '+=' cannot be applied to types '{}' and '0'. +tests/cases/conformance/expressions/assignmentOperator/compoundAdditionAssignmentWithInvalidOperands.ts(18,1): error TS2365: Operator '+=' cannot be applied to types '{}' and 'E.a'. tests/cases/conformance/expressions/assignmentOperator/compoundAdditionAssignmentWithInvalidOperands.ts(19,1): error TS2365: Operator '+=' cannot be applied to types '{}' and '{}'. tests/cases/conformance/expressions/assignmentOperator/compoundAdditionAssignmentWithInvalidOperands.ts(20,1): error TS2365: Operator '+=' cannot be applied to types '{}' and '{}'. tests/cases/conformance/expressions/assignmentOperator/compoundAdditionAssignmentWithInvalidOperands.ts(21,1): error TS2365: Operator '+=' cannot be applied to types '{}' and '{}'. tests/cases/conformance/expressions/assignmentOperator/compoundAdditionAssignmentWithInvalidOperands.ts(24,1): error TS2365: Operator '+=' cannot be applied to types 'void' and 'void'. -tests/cases/conformance/expressions/assignmentOperator/compoundAdditionAssignmentWithInvalidOperands.ts(25,1): error TS2365: Operator '+=' cannot be applied to types 'void' and 'boolean'. -tests/cases/conformance/expressions/assignmentOperator/compoundAdditionAssignmentWithInvalidOperands.ts(26,1): error TS2365: Operator '+=' cannot be applied to types 'void' and 'number'. -tests/cases/conformance/expressions/assignmentOperator/compoundAdditionAssignmentWithInvalidOperands.ts(27,1): error TS2365: Operator '+=' cannot be applied to types 'void' and 'E'. +tests/cases/conformance/expressions/assignmentOperator/compoundAdditionAssignmentWithInvalidOperands.ts(25,1): error TS2365: Operator '+=' cannot be applied to types 'void' and 'true'. +tests/cases/conformance/expressions/assignmentOperator/compoundAdditionAssignmentWithInvalidOperands.ts(26,1): error TS2365: Operator '+=' cannot be applied to types 'void' and '0'. +tests/cases/conformance/expressions/assignmentOperator/compoundAdditionAssignmentWithInvalidOperands.ts(27,1): error TS2365: Operator '+=' cannot be applied to types 'void' and 'E.a'. tests/cases/conformance/expressions/assignmentOperator/compoundAdditionAssignmentWithInvalidOperands.ts(28,1): error TS2365: Operator '+=' cannot be applied to types 'void' and '{}'. tests/cases/conformance/expressions/assignmentOperator/compoundAdditionAssignmentWithInvalidOperands.ts(29,1): error TS2365: Operator '+=' cannot be applied to types 'void' and 'void'. tests/cases/conformance/expressions/assignmentOperator/compoundAdditionAssignmentWithInvalidOperands.ts(30,1): error TS2365: Operator '+=' cannot be applied to types 'void' and 'void'. tests/cases/conformance/expressions/assignmentOperator/compoundAdditionAssignmentWithInvalidOperands.ts(33,1): error TS2365: Operator '+=' cannot be applied to types 'number' and 'void'. -tests/cases/conformance/expressions/assignmentOperator/compoundAdditionAssignmentWithInvalidOperands.ts(34,1): error TS2365: Operator '+=' cannot be applied to types 'number' and 'boolean'. +tests/cases/conformance/expressions/assignmentOperator/compoundAdditionAssignmentWithInvalidOperands.ts(34,1): error TS2365: Operator '+=' cannot be applied to types 'number' and 'true'. tests/cases/conformance/expressions/assignmentOperator/compoundAdditionAssignmentWithInvalidOperands.ts(35,1): error TS2365: Operator '+=' cannot be applied to types 'number' and '{}'. tests/cases/conformance/expressions/assignmentOperator/compoundAdditionAssignmentWithInvalidOperands.ts(38,1): error TS2365: Operator '+=' cannot be applied to types 'E' and 'void'. -tests/cases/conformance/expressions/assignmentOperator/compoundAdditionAssignmentWithInvalidOperands.ts(39,1): error TS2365: Operator '+=' cannot be applied to types 'E' and 'boolean'. +tests/cases/conformance/expressions/assignmentOperator/compoundAdditionAssignmentWithInvalidOperands.ts(39,1): error TS2365: Operator '+=' cannot be applied to types 'E' and 'true'. tests/cases/conformance/expressions/assignmentOperator/compoundAdditionAssignmentWithInvalidOperands.ts(40,1): error TS2365: Operator '+=' cannot be applied to types 'E' and '{}'. @@ -38,13 +38,13 @@ tests/cases/conformance/expressions/assignmentOperator/compoundAdditionAssignmen !!! error TS2365: Operator '+=' cannot be applied to types 'boolean' and 'void'. x1 += true; ~~~~~~~~~~ -!!! error TS2365: Operator '+=' cannot be applied to types 'boolean' and 'boolean'. +!!! error TS2365: Operator '+=' cannot be applied to types 'boolean' and 'true'. x1 += 0; ~~~~~~~ -!!! error TS2365: Operator '+=' cannot be applied to types 'boolean' and 'number'. +!!! error TS2365: Operator '+=' cannot be applied to types 'boolean' and '0'. x1 += E.a; ~~~~~~~~~ -!!! error TS2365: Operator '+=' cannot be applied to types 'boolean' and 'E'. +!!! error TS2365: Operator '+=' cannot be applied to types 'boolean' and 'E.a'. x1 += {}; ~~~~~~~~ !!! error TS2365: Operator '+=' cannot be applied to types 'boolean' and '{}'. @@ -61,13 +61,13 @@ tests/cases/conformance/expressions/assignmentOperator/compoundAdditionAssignmen !!! error TS2365: Operator '+=' cannot be applied to types '{}' and 'void'. x2 += true; ~~~~~~~~~~ -!!! error TS2365: Operator '+=' cannot be applied to types '{}' and 'boolean'. +!!! error TS2365: Operator '+=' cannot be applied to types '{}' and 'true'. x2 += 0; ~~~~~~~ -!!! error TS2365: Operator '+=' cannot be applied to types '{}' and 'number'. +!!! error TS2365: Operator '+=' cannot be applied to types '{}' and '0'. x2 += E.a; ~~~~~~~~~ -!!! error TS2365: Operator '+=' cannot be applied to types '{}' and 'E'. +!!! error TS2365: Operator '+=' cannot be applied to types '{}' and 'E.a'. x2 += {}; ~~~~~~~~ !!! error TS2365: Operator '+=' cannot be applied to types '{}' and '{}'. @@ -84,13 +84,13 @@ tests/cases/conformance/expressions/assignmentOperator/compoundAdditionAssignmen !!! error TS2365: Operator '+=' cannot be applied to types 'void' and 'void'. x3 += true; ~~~~~~~~~~ -!!! error TS2365: Operator '+=' cannot be applied to types 'void' and 'boolean'. +!!! error TS2365: Operator '+=' cannot be applied to types 'void' and 'true'. x3 += 0; ~~~~~~~ -!!! error TS2365: Operator '+=' cannot be applied to types 'void' and 'number'. +!!! error TS2365: Operator '+=' cannot be applied to types 'void' and '0'. x3 += E.a; ~~~~~~~~~ -!!! error TS2365: Operator '+=' cannot be applied to types 'void' and 'E'. +!!! error TS2365: Operator '+=' cannot be applied to types 'void' and 'E.a'. x3 += {}; ~~~~~~~~ !!! error TS2365: Operator '+=' cannot be applied to types 'void' and '{}'. @@ -107,7 +107,7 @@ tests/cases/conformance/expressions/assignmentOperator/compoundAdditionAssignmen !!! error TS2365: Operator '+=' cannot be applied to types 'number' and 'void'. x4 += true; ~~~~~~~~~~ -!!! error TS2365: Operator '+=' cannot be applied to types 'number' and 'boolean'. +!!! error TS2365: Operator '+=' cannot be applied to types 'number' and 'true'. x4 += {}; ~~~~~~~~ !!! error TS2365: Operator '+=' cannot be applied to types 'number' and '{}'. @@ -118,7 +118,7 @@ tests/cases/conformance/expressions/assignmentOperator/compoundAdditionAssignmen !!! error TS2365: Operator '+=' cannot be applied to types 'E' and 'void'. x5 += true; ~~~~~~~~~~ -!!! error TS2365: Operator '+=' cannot be applied to types 'E' and 'boolean'. +!!! error TS2365: Operator '+=' cannot be applied to types 'E' and 'true'. x5 += {}; ~~~~~~~~ !!! error TS2365: Operator '+=' cannot be applied to types 'E' and '{}'. \ No newline at end of file diff --git a/tests/baselines/reference/compoundArithmeticAssignmentLHSCanBeAssigned.types b/tests/baselines/reference/compoundArithmeticAssignmentLHSCanBeAssigned.types index 3b346bac53b..81fff36594e 100644 --- a/tests/baselines/reference/compoundArithmeticAssignmentLHSCanBeAssigned.types +++ b/tests/baselines/reference/compoundArithmeticAssignmentLHSCanBeAssigned.types @@ -1,9 +1,9 @@ === tests/cases/conformance/expressions/assignmentOperator/compoundArithmeticAssignmentLHSCanBeAssigned.ts === enum E { a, b, c } >E : E ->a : E ->b : E ->c : E +>a : E.a +>b : E.b +>c : E.c var a: any; >a : any diff --git a/tests/baselines/reference/compoundAssignmentLHSIsReference.types b/tests/baselines/reference/compoundAssignmentLHSIsReference.types index 12c601d377f..4816307f508 100644 --- a/tests/baselines/reference/compoundAssignmentLHSIsReference.types +++ b/tests/baselines/reference/compoundAssignmentLHSIsReference.types @@ -54,14 +54,14 @@ x3['a'] *= value; >x3['a'] *= value : number >x3['a'] : number >x3 : { a: number; } ->'a' : string +>'a' : "a" >value : any x3['a'] += value; >x3['a'] += value : any >x3['a'] : number >x3 : { a: number; } ->'a' : string +>'a' : "a" >value : any // parentheses, the contained expression is reference @@ -115,7 +115,7 @@ function fn2(x4: number) { >(x3['a']) : number >x3['a'] : number >x3 : { a: number; } ->'a' : string +>'a' : "a" >value : any (x3['a']) += value; @@ -123,6 +123,6 @@ function fn2(x4: number) { >(x3['a']) : number >x3['a'] : number >x3 : { a: number; } ->'a' : string +>'a' : "a" >value : any diff --git a/tests/baselines/reference/compoundExponentiationAssignmentLHSCanBeAssigned1.types b/tests/baselines/reference/compoundExponentiationAssignmentLHSCanBeAssigned1.types index 060a231da1b..46f9d762ca3 100644 --- a/tests/baselines/reference/compoundExponentiationAssignmentLHSCanBeAssigned1.types +++ b/tests/baselines/reference/compoundExponentiationAssignmentLHSCanBeAssigned1.types @@ -1,9 +1,9 @@ === tests/cases/conformance/es7/exponentiationOperator/compoundExponentiationAssignmentLHSCanBeAssigned1.ts === enum E { a, b, c } >E : E ->a : E ->b : E ->c : E +>a : E.a +>b : E.b +>c : E.c var a: any; >a : any diff --git a/tests/baselines/reference/compoundExponentiationAssignmentLHSIsReference.types b/tests/baselines/reference/compoundExponentiationAssignmentLHSIsReference.types index 35f42f4fa77..55b90382d7b 100644 --- a/tests/baselines/reference/compoundExponentiationAssignmentLHSIsReference.types +++ b/tests/baselines/reference/compoundExponentiationAssignmentLHSIsReference.types @@ -37,7 +37,7 @@ x3['a'] **= value; >x3['a'] **= value : number >x3['a'] : number >x3 : { a: number; } ->'a' : string +>'a' : "a" >value : any // parentheses, the contained expression is reference @@ -71,6 +71,6 @@ function fn2(x4: number) { >(x3['a']) : number >x3['a'] : number >x3 : { a: number; } ->'a' : string +>'a' : "a" >value : any diff --git a/tests/baselines/reference/compoundVarDecl1.types b/tests/baselines/reference/compoundVarDecl1.types index 40f12ea52c0..08c1716760d 100644 --- a/tests/baselines/reference/compoundVarDecl1.types +++ b/tests/baselines/reference/compoundVarDecl1.types @@ -2,18 +2,18 @@ module Foo { var a = 1, b = 1; a = b + 2; } >Foo : typeof Foo >a : number ->1 : number +>1 : 1 >b : number ->1 : number +>1 : 1 >a = b + 2 : number >a : number >b + 2 : number >b : number ->2 : number +>2 : 2 var foo = 4, bar = 5; >foo : number ->4 : number +>4 : 4 >bar : number ->5 : number +>5 : 5 diff --git a/tests/baselines/reference/computedPropertiesInDestructuring1.errors.txt b/tests/baselines/reference/computedPropertiesInDestructuring1.errors.txt index dc536e544b2..d2d63a48174 100644 --- a/tests/baselines/reference/computedPropertiesInDestructuring1.errors.txt +++ b/tests/baselines/reference/computedPropertiesInDestructuring1.errors.txt @@ -1,7 +1,7 @@ -tests/cases/compiler/computedPropertiesInDestructuring1.ts(20,8): error TS2349: Cannot invoke an expression whose type lacks a call signature. +tests/cases/compiler/computedPropertiesInDestructuring1.ts(20,8): error TS2349: Cannot invoke an expression whose type lacks a call signature. Type 'String' has no compatible call signatures. tests/cases/compiler/computedPropertiesInDestructuring1.ts(21,12): error TS2339: Property 'toExponential' does not exist on type 'string'. -tests/cases/compiler/computedPropertiesInDestructuring1.ts(33,4): error TS2349: Cannot invoke an expression whose type lacks a call signature. -tests/cases/compiler/computedPropertiesInDestructuring1.ts(34,5): error TS2365: Operator '+' cannot be applied to types 'number' and '{}'. +tests/cases/compiler/computedPropertiesInDestructuring1.ts(33,4): error TS2349: Cannot invoke an expression whose type lacks a call signature. Type 'String' has no compatible call signatures. +tests/cases/compiler/computedPropertiesInDestructuring1.ts(34,5): error TS2365: Operator '+' cannot be applied to types '1' and '{}'. ==== tests/cases/compiler/computedPropertiesInDestructuring1.ts (4 errors) ==== @@ -26,7 +26,7 @@ tests/cases/compiler/computedPropertiesInDestructuring1.ts(34,5): error TS2365: // report errors on type errors in computed properties used in destructuring let [{[foo()]: bar6}] = [{bar: "bar"}]; ~~~~~ -!!! error TS2349: Cannot invoke an expression whose type lacks a call signature. +!!! error TS2349: Cannot invoke an expression whose type lacks a call signature. Type 'String' has no compatible call signatures. let [{[foo.toExponential()]: bar7}] = [{bar: "bar"}]; ~~~~~~~~~~~~~ !!! error TS2339: Property 'toExponential' does not exist on type 'string'. @@ -43,10 +43,10 @@ tests/cases/compiler/computedPropertiesInDestructuring1.ts(34,5): error TS2365: [{[foo()]: bar4}] = [{bar: "bar"}]; ~~~~~ -!!! error TS2349: Cannot invoke an expression whose type lacks a call signature. +!!! error TS2349: Cannot invoke an expression whose type lacks a call signature. Type 'String' has no compatible call signatures. [{[(1 + {})]: bar4}] = [{bar: "bar"}]; ~~~~~~ -!!! error TS2365: Operator '+' cannot be applied to types 'number' and '{}'. +!!! error TS2365: Operator '+' cannot be applied to types '1' and '{}'. \ No newline at end of file diff --git a/tests/baselines/reference/computedPropertiesInDestructuring1_ES6.errors.txt b/tests/baselines/reference/computedPropertiesInDestructuring1_ES6.errors.txt index 96ab892d1b9..fa4d29cf426 100644 --- a/tests/baselines/reference/computedPropertiesInDestructuring1_ES6.errors.txt +++ b/tests/baselines/reference/computedPropertiesInDestructuring1_ES6.errors.txt @@ -1,7 +1,7 @@ -tests/cases/compiler/computedPropertiesInDestructuring1_ES6.ts(21,8): error TS2349: Cannot invoke an expression whose type lacks a call signature. +tests/cases/compiler/computedPropertiesInDestructuring1_ES6.ts(21,8): error TS2349: Cannot invoke an expression whose type lacks a call signature. Type 'String' has no compatible call signatures. tests/cases/compiler/computedPropertiesInDestructuring1_ES6.ts(22,12): error TS2339: Property 'toExponential' does not exist on type 'string'. -tests/cases/compiler/computedPropertiesInDestructuring1_ES6.ts(34,4): error TS2349: Cannot invoke an expression whose type lacks a call signature. -tests/cases/compiler/computedPropertiesInDestructuring1_ES6.ts(35,5): error TS2365: Operator '+' cannot be applied to types 'number' and '{}'. +tests/cases/compiler/computedPropertiesInDestructuring1_ES6.ts(34,4): error TS2349: Cannot invoke an expression whose type lacks a call signature. Type 'String' has no compatible call signatures. +tests/cases/compiler/computedPropertiesInDestructuring1_ES6.ts(35,5): error TS2365: Operator '+' cannot be applied to types '1' and '{}'. ==== tests/cases/compiler/computedPropertiesInDestructuring1_ES6.ts (4 errors) ==== @@ -27,7 +27,7 @@ tests/cases/compiler/computedPropertiesInDestructuring1_ES6.ts(35,5): error TS23 // report errors on type errors in computed properties used in destructuring let [{[foo()]: bar6}] = [{bar: "bar"}]; ~~~~~ -!!! error TS2349: Cannot invoke an expression whose type lacks a call signature. +!!! error TS2349: Cannot invoke an expression whose type lacks a call signature. Type 'String' has no compatible call signatures. let [{[foo.toExponential()]: bar7}] = [{bar: "bar"}]; ~~~~~~~~~~~~~ !!! error TS2339: Property 'toExponential' does not exist on type 'string'. @@ -44,8 +44,8 @@ tests/cases/compiler/computedPropertiesInDestructuring1_ES6.ts(35,5): error TS23 [{[foo()]: bar4}] = [{bar: "bar"}]; ~~~~~ -!!! error TS2349: Cannot invoke an expression whose type lacks a call signature. +!!! error TS2349: Cannot invoke an expression whose type lacks a call signature. Type 'String' has no compatible call signatures. [{[(1 + {})]: bar4}] = [{bar: "bar"}]; ~~~~~~ -!!! error TS2365: Operator '+' cannot be applied to types 'number' and '{}'. +!!! error TS2365: Operator '+' cannot be applied to types '1' and '{}'. \ No newline at end of file diff --git a/tests/baselines/reference/computedPropertiesInDestructuring2.types b/tests/baselines/reference/computedPropertiesInDestructuring2.types index 0fa20662270..137a0793e6d 100644 --- a/tests/baselines/reference/computedPropertiesInDestructuring2.types +++ b/tests/baselines/reference/computedPropertiesInDestructuring2.types @@ -2,7 +2,7 @@ let foo2 = () => "bar"; >foo2 : () => string >() => "bar" : () => string ->"bar" : string +>"bar" : "bar" let {[foo2()]: bar3} = {}; >foo2() : string diff --git a/tests/baselines/reference/computedPropertiesInDestructuring2_ES6.types b/tests/baselines/reference/computedPropertiesInDestructuring2_ES6.types index f0d8b1033c8..979689438d2 100644 --- a/tests/baselines/reference/computedPropertiesInDestructuring2_ES6.types +++ b/tests/baselines/reference/computedPropertiesInDestructuring2_ES6.types @@ -3,7 +3,7 @@ let foo2 = () => "bar"; >foo2 : () => string >() => "bar" : () => string ->"bar" : string +>"bar" : "bar" let {[foo2()]: bar3} = {}; >foo2() : string diff --git a/tests/baselines/reference/computedPropertyNames10_ES5.types b/tests/baselines/reference/computedPropertyNames10_ES5.types index b9d999397ab..650890fb10e 100644 --- a/tests/baselines/reference/computedPropertyNames10_ES5.types +++ b/tests/baselines/reference/computedPropertyNames10_ES5.types @@ -33,17 +33,17 @@ var v = { >s : string [""]() { }, ->"" : string +>"" : "" [0]() { }, ->0 : number +>0 : 0 [a]() { }, >a : any [true]() { }, >true : any ->true : boolean +>true : true [`hello bye`]() { }, >`hello bye` : string diff --git a/tests/baselines/reference/computedPropertyNames10_ES6.types b/tests/baselines/reference/computedPropertyNames10_ES6.types index 1883febb39b..2ff86ed9712 100644 --- a/tests/baselines/reference/computedPropertyNames10_ES6.types +++ b/tests/baselines/reference/computedPropertyNames10_ES6.types @@ -33,17 +33,17 @@ var v = { >s : string [""]() { }, ->"" : string +>"" : "" [0]() { }, ->0 : number +>0 : 0 [a]() { }, >a : any [true]() { }, >true : any ->true : boolean +>true : true [`hello bye`]() { }, >`hello bye` : string diff --git a/tests/baselines/reference/computedPropertyNames11_ES5.types b/tests/baselines/reference/computedPropertyNames11_ES5.types index e15b46cc6c1..0787a889f40 100644 --- a/tests/baselines/reference/computedPropertyNames11_ES5.types +++ b/tests/baselines/reference/computedPropertyNames11_ES5.types @@ -14,7 +14,7 @@ var v = { get [s]() { return 0; }, >s : string ->0 : number +>0 : 0 set [n](v) { }, >n : number @@ -24,7 +24,7 @@ var v = { >s + s : string >s : string >s : string ->0 : number +>0 : 0 set [s + n](v) { }, >s + n : string @@ -35,15 +35,15 @@ var v = { get [+s]() { return 0; }, >+s : number >s : string ->0 : number +>0 : 0 set [""](v) { }, ->"" : string +>"" : "" >v : any get [0]() { return 0; }, ->0 : number ->0 : number +>0 : 0 +>0 : 0 set [a](v) { }, >a : any @@ -51,8 +51,8 @@ var v = { get [true]() { return 0; }, >true : any ->true : boolean ->0 : number +>true : true +>0 : 0 set [`hello bye`](v) { }, >`hello bye` : string @@ -61,5 +61,5 @@ var v = { get [`hello ${a} bye`]() { return 0; } >`hello ${a} bye` : string >a : any ->0 : number +>0 : 0 } diff --git a/tests/baselines/reference/computedPropertyNames11_ES6.types b/tests/baselines/reference/computedPropertyNames11_ES6.types index eb5fc105a7a..4783d07a2af 100644 --- a/tests/baselines/reference/computedPropertyNames11_ES6.types +++ b/tests/baselines/reference/computedPropertyNames11_ES6.types @@ -14,7 +14,7 @@ var v = { get [s]() { return 0; }, >s : string ->0 : number +>0 : 0 set [n](v) { }, >n : number @@ -24,7 +24,7 @@ var v = { >s + s : string >s : string >s : string ->0 : number +>0 : 0 set [s + n](v) { }, >s + n : string @@ -35,15 +35,15 @@ var v = { get [+s]() { return 0; }, >+s : number >s : string ->0 : number +>0 : 0 set [""](v) { }, ->"" : string +>"" : "" >v : any get [0]() { return 0; }, ->0 : number ->0 : number +>0 : 0 +>0 : 0 set [a](v) { }, >a : any @@ -51,8 +51,8 @@ var v = { get [true]() { return 0; }, >true : any ->true : boolean ->0 : number +>true : true +>0 : 0 set [`hello bye`](v) { }, >`hello bye` : string @@ -61,5 +61,5 @@ var v = { get [`hello ${a} bye`]() { return 0; } >`hello ${a} bye` : string >a : any ->0 : number +>0 : 0 } diff --git a/tests/baselines/reference/computedPropertyNames13_ES5.types b/tests/baselines/reference/computedPropertyNames13_ES5.types index 59694df32a7..2585fe15f94 100644 --- a/tests/baselines/reference/computedPropertyNames13_ES5.types +++ b/tests/baselines/reference/computedPropertyNames13_ES5.types @@ -32,17 +32,17 @@ class C { >s : string static [""]() { } ->"" : string +>"" : "" [0]() { } ->0 : number +>0 : 0 [a]() { } >a : any static [true]() { } >true : any ->true : boolean +>true : true [`hello bye`]() { } >`hello bye` : string diff --git a/tests/baselines/reference/computedPropertyNames13_ES6.types b/tests/baselines/reference/computedPropertyNames13_ES6.types index a2d0f14e72c..61e8cae265c 100644 --- a/tests/baselines/reference/computedPropertyNames13_ES6.types +++ b/tests/baselines/reference/computedPropertyNames13_ES6.types @@ -32,17 +32,17 @@ class C { >s : string static [""]() { } ->"" : string +>"" : "" [0]() { } ->0 : number +>0 : 0 [a]() { } >a : any static [true]() { } >true : any ->true : boolean +>true : true [`hello bye`]() { } >`hello bye` : string diff --git a/tests/baselines/reference/computedPropertyNames16_ES5.types b/tests/baselines/reference/computedPropertyNames16_ES5.types index ab7ea23cffe..5c0fb34bc25 100644 --- a/tests/baselines/reference/computedPropertyNames16_ES5.types +++ b/tests/baselines/reference/computedPropertyNames16_ES5.types @@ -13,7 +13,7 @@ class C { get [s]() { return 0;} >s : string ->0 : number +>0 : 0 set [n](v) { } >n : number @@ -23,7 +23,7 @@ class C { >s + s : string >s : string >s : string ->0 : number +>0 : 0 set [s + n](v) { } >s + n : string @@ -34,15 +34,15 @@ class C { get [+s]() { return 0; } >+s : number >s : string ->0 : number +>0 : 0 static set [""](v) { } ->"" : string +>"" : "" >v : any get [0]() { return 0; } ->0 : number ->0 : number +>0 : 0 +>0 : 0 set [a](v) { } >a : any @@ -50,8 +50,8 @@ class C { static get [true]() { return 0; } >true : any ->true : boolean ->0 : number +>true : true +>0 : 0 set [`hello bye`](v) { } >`hello bye` : string @@ -60,5 +60,5 @@ class C { get [`hello ${a} bye`]() { return 0; } >`hello ${a} bye` : string >a : any ->0 : number +>0 : 0 } diff --git a/tests/baselines/reference/computedPropertyNames16_ES6.types b/tests/baselines/reference/computedPropertyNames16_ES6.types index c7286e6640e..7ebb2cd0060 100644 --- a/tests/baselines/reference/computedPropertyNames16_ES6.types +++ b/tests/baselines/reference/computedPropertyNames16_ES6.types @@ -13,7 +13,7 @@ class C { get [s]() { return 0;} >s : string ->0 : number +>0 : 0 set [n](v) { } >n : number @@ -23,7 +23,7 @@ class C { >s + s : string >s : string >s : string ->0 : number +>0 : 0 set [s + n](v) { } >s + n : string @@ -34,15 +34,15 @@ class C { get [+s]() { return 0; } >+s : number >s : string ->0 : number +>0 : 0 static set [""](v) { } ->"" : string +>"" : "" >v : any get [0]() { return 0; } ->0 : number ->0 : number +>0 : 0 +>0 : 0 set [a](v) { } >a : any @@ -50,8 +50,8 @@ class C { static get [true]() { return 0; } >true : any ->true : boolean ->0 : number +>true : true +>0 : 0 set [`hello bye`](v) { } >`hello bye` : string @@ -60,5 +60,5 @@ class C { get [`hello ${a} bye`]() { return 0; } >`hello ${a} bye` : string >a : any ->0 : number +>0 : 0 } diff --git a/tests/baselines/reference/computedPropertyNames18_ES5.types b/tests/baselines/reference/computedPropertyNames18_ES5.types index d6808a8edc0..e9de10f5ace 100644 --- a/tests/baselines/reference/computedPropertyNames18_ES5.types +++ b/tests/baselines/reference/computedPropertyNames18_ES5.types @@ -10,6 +10,6 @@ function foo() { >this.bar : any >this : any >bar : any ->0 : number +>0 : 0 } } diff --git a/tests/baselines/reference/computedPropertyNames18_ES6.types b/tests/baselines/reference/computedPropertyNames18_ES6.types index 11d58e48c69..1b376e9a1e3 100644 --- a/tests/baselines/reference/computedPropertyNames18_ES6.types +++ b/tests/baselines/reference/computedPropertyNames18_ES6.types @@ -10,6 +10,6 @@ function foo() { >this.bar : any >this : any >bar : any ->0 : number +>0 : 0 } } diff --git a/tests/baselines/reference/computedPropertyNames1_ES5.types b/tests/baselines/reference/computedPropertyNames1_ES5.types index a77895e06d1..d0c11e448bb 100644 --- a/tests/baselines/reference/computedPropertyNames1_ES5.types +++ b/tests/baselines/reference/computedPropertyNames1_ES5.types @@ -5,13 +5,13 @@ var v = { get [0 + 1]() { return 0 }, >0 + 1 : number ->0 : number ->1 : number ->0 : number +>0 : 0 +>1 : 1 +>0 : 0 set [0 + 1](v: string) { } //No error >0 + 1 : number ->0 : number ->1 : number +>0 : 0 +>1 : 1 >v : string } diff --git a/tests/baselines/reference/computedPropertyNames1_ES6.types b/tests/baselines/reference/computedPropertyNames1_ES6.types index 503988b0314..6fddad0067c 100644 --- a/tests/baselines/reference/computedPropertyNames1_ES6.types +++ b/tests/baselines/reference/computedPropertyNames1_ES6.types @@ -5,13 +5,13 @@ var v = { get [0 + 1]() { return 0 }, >0 + 1 : number ->0 : number ->1 : number ->0 : number +>0 : 0 +>1 : 1 +>0 : 0 set [0 + 1](v: string) { } //No error >0 + 1 : number ->0 : number ->1 : number +>0 : 0 +>1 : 1 >v : string } diff --git a/tests/baselines/reference/computedPropertyNames20_ES5.types b/tests/baselines/reference/computedPropertyNames20_ES5.types index 65ee55be379..d685b52ef06 100644 --- a/tests/baselines/reference/computedPropertyNames20_ES5.types +++ b/tests/baselines/reference/computedPropertyNames20_ES5.types @@ -7,5 +7,5 @@ var obj = { >this.bar : any >this : any >bar : any ->0 : number +>0 : 0 } diff --git a/tests/baselines/reference/computedPropertyNames20_ES6.types b/tests/baselines/reference/computedPropertyNames20_ES6.types index 91e5c8d7843..af475ee66e6 100644 --- a/tests/baselines/reference/computedPropertyNames20_ES6.types +++ b/tests/baselines/reference/computedPropertyNames20_ES6.types @@ -7,5 +7,5 @@ var obj = { >this.bar : any >this : any >bar : any ->0 : number +>0 : 0 } diff --git a/tests/baselines/reference/computedPropertyNames22_ES5.types b/tests/baselines/reference/computedPropertyNames22_ES5.types index eeec22d2e61..e244d4fb554 100644 --- a/tests/baselines/reference/computedPropertyNames22_ES5.types +++ b/tests/baselines/reference/computedPropertyNames22_ES5.types @@ -17,6 +17,6 @@ class C { }; return 0; ->0 : number +>0 : 0 } } diff --git a/tests/baselines/reference/computedPropertyNames22_ES6.types b/tests/baselines/reference/computedPropertyNames22_ES6.types index af9ef9d3a31..06329679bfb 100644 --- a/tests/baselines/reference/computedPropertyNames22_ES6.types +++ b/tests/baselines/reference/computedPropertyNames22_ES6.types @@ -17,6 +17,6 @@ class C { }; return 0; ->0 : number +>0 : 0 } } diff --git a/tests/baselines/reference/computedPropertyNames25_ES5.types b/tests/baselines/reference/computedPropertyNames25_ES5.types index f1acc296709..aed42994255 100644 --- a/tests/baselines/reference/computedPropertyNames25_ES5.types +++ b/tests/baselines/reference/computedPropertyNames25_ES5.types @@ -6,7 +6,7 @@ class Base { >bar : () => number return 0; ->0 : number +>0 : 0 } } class C extends Base { @@ -28,6 +28,6 @@ class C extends Base { }; return 0; ->0 : number +>0 : 0 } } diff --git a/tests/baselines/reference/computedPropertyNames25_ES6.types b/tests/baselines/reference/computedPropertyNames25_ES6.types index 26c38013906..73a4ca912f9 100644 --- a/tests/baselines/reference/computedPropertyNames25_ES6.types +++ b/tests/baselines/reference/computedPropertyNames25_ES6.types @@ -6,7 +6,7 @@ class Base { >bar : () => number return 0; ->0 : number +>0 : 0 } } class C extends Base { @@ -28,6 +28,6 @@ class C extends Base { }; return 0; ->0 : number +>0 : 0 } } diff --git a/tests/baselines/reference/computedPropertyNames28_ES5.types b/tests/baselines/reference/computedPropertyNames28_ES5.types index 89a2a7ac017..0d816d980fe 100644 --- a/tests/baselines/reference/computedPropertyNames28_ES5.types +++ b/tests/baselines/reference/computedPropertyNames28_ES5.types @@ -16,11 +16,11 @@ class C extends Base { >{ [(super(), "prop")]() { } } : { [x: string]: () => void; } [(super(), "prop")]() { } ->(super(), "prop") : string ->super(), "prop" : string +>(super(), "prop") : "prop" +>super(), "prop" : "prop" >super() : void >super : typeof Base ->"prop" : string +>"prop" : "prop" }; } diff --git a/tests/baselines/reference/computedPropertyNames28_ES6.types b/tests/baselines/reference/computedPropertyNames28_ES6.types index df020c9a5ff..7c803ec43af 100644 --- a/tests/baselines/reference/computedPropertyNames28_ES6.types +++ b/tests/baselines/reference/computedPropertyNames28_ES6.types @@ -16,11 +16,11 @@ class C extends Base { >{ [(super(), "prop")]() { } } : { [x: string]: () => void; } [(super(), "prop")]() { } ->(super(), "prop") : string ->super(), "prop" : string +>(super(), "prop") : "prop" +>super(), "prop" : "prop" >super() : void >super : typeof Base ->"prop" : string +>"prop" : "prop" }; } diff --git a/tests/baselines/reference/computedPropertyNames29_ES5.types b/tests/baselines/reference/computedPropertyNames29_ES5.types index d2f89ef6b18..3f825c244e0 100644 --- a/tests/baselines/reference/computedPropertyNames29_ES5.types +++ b/tests/baselines/reference/computedPropertyNames29_ES5.types @@ -21,6 +21,6 @@ class C { }; } return 0; ->0 : number +>0 : 0 } } diff --git a/tests/baselines/reference/computedPropertyNames29_ES6.types b/tests/baselines/reference/computedPropertyNames29_ES6.types index bb324b2b382..a1375622271 100644 --- a/tests/baselines/reference/computedPropertyNames29_ES6.types +++ b/tests/baselines/reference/computedPropertyNames29_ES6.types @@ -21,6 +21,6 @@ class C { }; } return 0; ->0 : number +>0 : 0 } } diff --git a/tests/baselines/reference/computedPropertyNames31_ES5.types b/tests/baselines/reference/computedPropertyNames31_ES5.types index 832b2bc067a..37661cbec11 100644 --- a/tests/baselines/reference/computedPropertyNames31_ES5.types +++ b/tests/baselines/reference/computedPropertyNames31_ES5.types @@ -6,7 +6,7 @@ class Base { >bar : () => number return 0; ->0 : number +>0 : 0 } } class C extends Base { @@ -32,6 +32,6 @@ class C extends Base { }; } return 0; ->0 : number +>0 : 0 } } diff --git a/tests/baselines/reference/computedPropertyNames31_ES6.types b/tests/baselines/reference/computedPropertyNames31_ES6.types index 4f59b1e8c6d..dbb4f47662e 100644 --- a/tests/baselines/reference/computedPropertyNames31_ES6.types +++ b/tests/baselines/reference/computedPropertyNames31_ES6.types @@ -6,7 +6,7 @@ class Base { >bar : () => number return 0; ->0 : number +>0 : 0 } } class C extends Base { @@ -32,6 +32,6 @@ class C extends Base { }; } return 0; ->0 : number +>0 : 0 } } diff --git a/tests/baselines/reference/computedPropertyNames33_ES5.types b/tests/baselines/reference/computedPropertyNames33_ES5.types index 7031981481f..046d4bf96a9 100644 --- a/tests/baselines/reference/computedPropertyNames33_ES5.types +++ b/tests/baselines/reference/computedPropertyNames33_ES5.types @@ -2,7 +2,7 @@ function foo() { return '' } >foo : () => string >T : T ->'' : string +>'' : "" class C { >C : C @@ -22,6 +22,6 @@ class C { }; return 0; ->0 : number +>0 : 0 } } diff --git a/tests/baselines/reference/computedPropertyNames33_ES6.types b/tests/baselines/reference/computedPropertyNames33_ES6.types index 3c57daf2ace..07cf7c1639f 100644 --- a/tests/baselines/reference/computedPropertyNames33_ES6.types +++ b/tests/baselines/reference/computedPropertyNames33_ES6.types @@ -2,7 +2,7 @@ function foo() { return '' } >foo : () => string >T : T ->'' : string +>'' : "" class C { >C : C @@ -22,6 +22,6 @@ class C { }; return 0; ->0 : number +>0 : 0 } } diff --git a/tests/baselines/reference/computedPropertyNames37_ES5.types b/tests/baselines/reference/computedPropertyNames37_ES5.types index 21b68c7c12c..b1ba3a4315e 100644 --- a/tests/baselines/reference/computedPropertyNames37_ES5.types +++ b/tests/baselines/reference/computedPropertyNames37_ES5.types @@ -17,12 +17,12 @@ class C { // Computed properties get ["get1"]() { return new Foo } ->"get1" : string +>"get1" : "get1" >new Foo : Foo >Foo : typeof Foo set ["set1"](p: Foo2) { } ->"set1" : string +>"set1" : "set1" >p : Foo2 >Foo2 : Foo2 } diff --git a/tests/baselines/reference/computedPropertyNames37_ES6.types b/tests/baselines/reference/computedPropertyNames37_ES6.types index e436a54172b..67c84380e8b 100644 --- a/tests/baselines/reference/computedPropertyNames37_ES6.types +++ b/tests/baselines/reference/computedPropertyNames37_ES6.types @@ -17,12 +17,12 @@ class C { // Computed properties get ["get1"]() { return new Foo } ->"get1" : string +>"get1" : "get1" >new Foo : Foo >Foo : typeof Foo set ["set1"](p: Foo2) { } ->"set1" : string +>"set1" : "set1" >p : Foo2 >Foo2 : Foo2 } diff --git a/tests/baselines/reference/computedPropertyNames41_ES5.types b/tests/baselines/reference/computedPropertyNames41_ES5.types index 5aa7ae44404..0be69bec4a5 100644 --- a/tests/baselines/reference/computedPropertyNames41_ES5.types +++ b/tests/baselines/reference/computedPropertyNames41_ES5.types @@ -17,7 +17,7 @@ class C { // Computed properties static [""]() { return new Foo } ->"" : string +>"" : "" >new Foo : Foo >Foo : typeof Foo } diff --git a/tests/baselines/reference/computedPropertyNames41_ES6.types b/tests/baselines/reference/computedPropertyNames41_ES6.types index 70bfcf12a75..297a41eecec 100644 --- a/tests/baselines/reference/computedPropertyNames41_ES6.types +++ b/tests/baselines/reference/computedPropertyNames41_ES6.types @@ -17,7 +17,7 @@ class C { // Computed properties static [""]() { return new Foo } ->"" : string +>"" : "" >new Foo : Foo >Foo : typeof Foo } diff --git a/tests/baselines/reference/computedPropertyNames46_ES5.types b/tests/baselines/reference/computedPropertyNames46_ES5.types index b8df0d56e13..7ea3ffda244 100644 --- a/tests/baselines/reference/computedPropertyNames46_ES5.types +++ b/tests/baselines/reference/computedPropertyNames46_ES5.types @@ -1,12 +1,12 @@ === tests/cases/conformance/es6/computedProperties/computedPropertyNames46_ES5.ts === var o = { ->o : { [x: string]: number; } ->{ ["" || 0]: 0} : { [x: string]: number; } +>o : { [x: number]: number; } +>{ ["" || 0]: 0} : { [x: number]: number; } ["" || 0]: 0 ->"" || 0 : string | number ->"" : string ->0 : number ->0 : number +>"" || 0 : 0 +>"" : "" +>0 : 0 +>0 : 0 }; diff --git a/tests/baselines/reference/computedPropertyNames46_ES6.types b/tests/baselines/reference/computedPropertyNames46_ES6.types index a786eca200c..3914f6facef 100644 --- a/tests/baselines/reference/computedPropertyNames46_ES6.types +++ b/tests/baselines/reference/computedPropertyNames46_ES6.types @@ -1,12 +1,12 @@ === tests/cases/conformance/es6/computedProperties/computedPropertyNames46_ES6.ts === var o = { ->o : { [x: string]: number; } ->{ ["" || 0]: 0} : { [x: string]: number; } +>o : { [x: number]: number; } +>{ ["" || 0]: 0} : { [x: number]: number; } ["" || 0]: 0 ->"" || 0 : string | number ->"" : string ->0 : number ->0 : number +>"" || 0 : 0 +>"" : "" +>0 : 0 +>0 : 0 }; diff --git a/tests/baselines/reference/computedPropertyNames47_ES5.types b/tests/baselines/reference/computedPropertyNames47_ES5.types index cdc2c3301f6..19811ae8ec2 100644 --- a/tests/baselines/reference/computedPropertyNames47_ES5.types +++ b/tests/baselines/reference/computedPropertyNames47_ES5.types @@ -19,6 +19,6 @@ var o = { >E2.x : E2 >E2 : typeof E2 >x : E2 ->0 : number +>0 : 0 }; diff --git a/tests/baselines/reference/computedPropertyNames47_ES6.types b/tests/baselines/reference/computedPropertyNames47_ES6.types index a923e934d66..46edecb450a 100644 --- a/tests/baselines/reference/computedPropertyNames47_ES6.types +++ b/tests/baselines/reference/computedPropertyNames47_ES6.types @@ -19,6 +19,6 @@ var o = { >E2.x : E2 >E2 : typeof E2 >x : E2 ->0 : number +>0 : 0 }; diff --git a/tests/baselines/reference/computedPropertyNames48_ES5.types b/tests/baselines/reference/computedPropertyNames48_ES5.types index 12752d8abeb..545dc641434 100644 --- a/tests/baselines/reference/computedPropertyNames48_ES5.types +++ b/tests/baselines/reference/computedPropertyNames48_ES5.types @@ -21,7 +21,7 @@ extractIndexer({ [a]: "" >a : any ->"" : string +>"" : "" }); // Should return string @@ -34,19 +34,19 @@ extractIndexer({ >E.x : E >E : typeof E >x : E ->"" : string +>"" : "" }); // Should return string extractIndexer({ >extractIndexer({ ["" || 0]: ""}) : string >extractIndexer : (p: { [n: number]: T; }) => T ->{ ["" || 0]: ""} : { [x: string]: string; } +>{ ["" || 0]: ""} : { [x: number]: string; } ["" || 0]: "" ->"" || 0 : string | number ->"" : string ->0 : number ->"" : string +>"" || 0 : 0 +>"" : "" +>0 : 0 +>"" : "" }); // Should return any (widened form of undefined) diff --git a/tests/baselines/reference/computedPropertyNames48_ES6.types b/tests/baselines/reference/computedPropertyNames48_ES6.types index 832bc3c7025..0f352b57d24 100644 --- a/tests/baselines/reference/computedPropertyNames48_ES6.types +++ b/tests/baselines/reference/computedPropertyNames48_ES6.types @@ -21,7 +21,7 @@ extractIndexer({ [a]: "" >a : any ->"" : string +>"" : "" }); // Should return string @@ -34,19 +34,19 @@ extractIndexer({ >E.x : E >E : typeof E >x : E ->"" : string +>"" : "" }); // Should return string extractIndexer({ >extractIndexer({ ["" || 0]: ""}) : string >extractIndexer : (p: { [n: number]: T; }) => T ->{ ["" || 0]: ""} : { [x: string]: string; } +>{ ["" || 0]: ""} : { [x: number]: string; } ["" || 0]: "" ->"" || 0 : string | number ->"" : string ->0 : number ->"" : string +>"" || 0 : 0 +>"" : "" +>0 : 0 +>"" : "" }); // Should return any (widened form of undefined) diff --git a/tests/baselines/reference/computedPropertyNames4_ES5.types b/tests/baselines/reference/computedPropertyNames4_ES5.types index a71b3984ec8..64ef5f6a611 100644 --- a/tests/baselines/reference/computedPropertyNames4_ES5.types +++ b/tests/baselines/reference/computedPropertyNames4_ES5.types @@ -14,7 +14,7 @@ var v = { [s]: 0, >s : string ->0 : number +>0 : 0 [n]: n, >n : number @@ -24,13 +24,13 @@ var v = { >s + s : string >s : string >s : string ->1 : number +>1 : 1 [s + n]: 2, >s + n : string >s : string >n : number ->2 : number +>2 : 2 [+s]: s, >+s : number @@ -38,28 +38,28 @@ var v = { >s : string [""]: 0, ->"" : string ->0 : number +>"" : "" +>0 : 0 [0]: 0, ->0 : number ->0 : number +>0 : 0 +>0 : 0 [a]: 1, >a : any ->1 : number +>1 : 1 [true]: 0, >true : any ->true : boolean ->0 : number +>true : true +>0 : 0 [`hello bye`]: 0, >`hello bye` : string ->0 : number +>0 : 0 [`hello ${a} bye`]: 0 >`hello ${a} bye` : string >a : any ->0 : number +>0 : 0 } diff --git a/tests/baselines/reference/computedPropertyNames4_ES6.types b/tests/baselines/reference/computedPropertyNames4_ES6.types index a4bcc59711c..0c608e21601 100644 --- a/tests/baselines/reference/computedPropertyNames4_ES6.types +++ b/tests/baselines/reference/computedPropertyNames4_ES6.types @@ -14,7 +14,7 @@ var v = { [s]: 0, >s : string ->0 : number +>0 : 0 [n]: n, >n : number @@ -24,13 +24,13 @@ var v = { >s + s : string >s : string >s : string ->1 : number +>1 : 1 [s + n]: 2, >s + n : string >s : string >n : number ->2 : number +>2 : 2 [+s]: s, >+s : number @@ -38,28 +38,28 @@ var v = { >s : string [""]: 0, ->"" : string ->0 : number +>"" : "" +>0 : 0 [0]: 0, ->0 : number ->0 : number +>0 : 0 +>0 : 0 [a]: 1, >a : any ->1 : number +>1 : 1 [true]: 0, >true : any ->true : boolean ->0 : number +>true : true +>0 : 0 [`hello bye`]: 0, >`hello bye` : string ->0 : number +>0 : 0 [`hello ${a} bye`]: 0 >`hello ${a} bye` : string >a : any ->0 : number +>0 : 0 } diff --git a/tests/baselines/reference/computedPropertyNames7_ES5.types b/tests/baselines/reference/computedPropertyNames7_ES5.types index 3411198b590..fbc070e3951 100644 --- a/tests/baselines/reference/computedPropertyNames7_ES5.types +++ b/tests/baselines/reference/computedPropertyNames7_ES5.types @@ -13,5 +13,5 @@ var v = { >E.member : E >E : typeof E >member : E ->0 : number +>0 : 0 } diff --git a/tests/baselines/reference/computedPropertyNames7_ES6.types b/tests/baselines/reference/computedPropertyNames7_ES6.types index eb72d546dbc..f8f1dd7f791 100644 --- a/tests/baselines/reference/computedPropertyNames7_ES6.types +++ b/tests/baselines/reference/computedPropertyNames7_ES6.types @@ -13,5 +13,5 @@ var v = { >E.member : E >E : typeof E >member : E ->0 : number +>0 : 0 } diff --git a/tests/baselines/reference/computedPropertyNamesContextualType10_ES5.errors.txt b/tests/baselines/reference/computedPropertyNamesContextualType10_ES5.errors.txt index 7fa95fe9426..f277df6f4c8 100644 --- a/tests/baselines/reference/computedPropertyNamesContextualType10_ES5.errors.txt +++ b/tests/baselines/reference/computedPropertyNamesContextualType10_ES5.errors.txt @@ -1,7 +1,7 @@ -tests/cases/conformance/es6/computedProperties/computedPropertyNamesContextualType10_ES5.ts(5,5): error TS2322: Type '{ [x: number]: string | number; }' is not assignable to type 'I'. +tests/cases/conformance/es6/computedProperties/computedPropertyNamesContextualType10_ES5.ts(5,5): error TS2322: Type '{ [x: number]: "" | 0; }' is not assignable to type 'I'. Index signatures are incompatible. - Type 'string | number' is not assignable to type 'boolean'. - Type 'string' is not assignable to type 'boolean'. + Type '"" | 0' is not assignable to type 'boolean'. + Type '""' is not assignable to type 'boolean'. ==== tests/cases/conformance/es6/computedProperties/computedPropertyNamesContextualType10_ES5.ts (1 errors) ==== @@ -11,10 +11,10 @@ tests/cases/conformance/es6/computedProperties/computedPropertyNamesContextualTy var o: I = { ~ -!!! error TS2322: Type '{ [x: number]: string | number; }' is not assignable to type 'I'. +!!! error TS2322: Type '{ [x: number]: "" | 0; }' is not assignable to type 'I'. !!! error TS2322: Index signatures are incompatible. -!!! error TS2322: Type 'string | number' is not assignable to type 'boolean'. -!!! error TS2322: Type 'string' is not assignable to type 'boolean'. +!!! error TS2322: Type '"" | 0' is not assignable to type 'boolean'. +!!! error TS2322: Type '""' is not assignable to type 'boolean'. [+"foo"]: "", [+"bar"]: 0 } \ No newline at end of file diff --git a/tests/baselines/reference/computedPropertyNamesContextualType10_ES6.errors.txt b/tests/baselines/reference/computedPropertyNamesContextualType10_ES6.errors.txt index 116cd1a2531..689ec135d3f 100644 --- a/tests/baselines/reference/computedPropertyNamesContextualType10_ES6.errors.txt +++ b/tests/baselines/reference/computedPropertyNamesContextualType10_ES6.errors.txt @@ -1,7 +1,7 @@ -tests/cases/conformance/es6/computedProperties/computedPropertyNamesContextualType10_ES6.ts(5,5): error TS2322: Type '{ [x: number]: string | number; }' is not assignable to type 'I'. +tests/cases/conformance/es6/computedProperties/computedPropertyNamesContextualType10_ES6.ts(5,5): error TS2322: Type '{ [x: number]: "" | 0; }' is not assignable to type 'I'. Index signatures are incompatible. - Type 'string | number' is not assignable to type 'boolean'. - Type 'string' is not assignable to type 'boolean'. + Type '"" | 0' is not assignable to type 'boolean'. + Type '""' is not assignable to type 'boolean'. ==== tests/cases/conformance/es6/computedProperties/computedPropertyNamesContextualType10_ES6.ts (1 errors) ==== @@ -11,10 +11,10 @@ tests/cases/conformance/es6/computedProperties/computedPropertyNamesContextualTy var o: I = { ~ -!!! error TS2322: Type '{ [x: number]: string | number; }' is not assignable to type 'I'. +!!! error TS2322: Type '{ [x: number]: "" | 0; }' is not assignable to type 'I'. !!! error TS2322: Index signatures are incompatible. -!!! error TS2322: Type 'string | number' is not assignable to type 'boolean'. -!!! error TS2322: Type 'string' is not assignable to type 'boolean'. +!!! error TS2322: Type '"" | 0' is not assignable to type 'boolean'. +!!! error TS2322: Type '""' is not assignable to type 'boolean'. [+"foo"]: "", [+"bar"]: 0 } \ No newline at end of file diff --git a/tests/baselines/reference/computedPropertyNamesContextualType1_ES5.types b/tests/baselines/reference/computedPropertyNamesContextualType1_ES5.types index 09cad594624..05ae43cf69b 100644 --- a/tests/baselines/reference/computedPropertyNamesContextualType1_ES5.types +++ b/tests/baselines/reference/computedPropertyNamesContextualType1_ES5.types @@ -18,8 +18,8 @@ var o: I = { ["" + 0](y) { return y.length; }, >"" + 0 : string ->"" : string ->0 : number +>"" : "" +>0 : 0 >y : string >y.length : number >y : string @@ -27,8 +27,8 @@ var o: I = { ["" + 1]: y => y.length >"" + 1 : string ->"" : string ->1 : number +>"" : "" +>1 : 1 >y => y.length : (y: string) => number >y : string >y.length : number diff --git a/tests/baselines/reference/computedPropertyNamesContextualType1_ES6.types b/tests/baselines/reference/computedPropertyNamesContextualType1_ES6.types index d9e9970ebec..9caae76eeda 100644 --- a/tests/baselines/reference/computedPropertyNamesContextualType1_ES6.types +++ b/tests/baselines/reference/computedPropertyNamesContextualType1_ES6.types @@ -18,8 +18,8 @@ var o: I = { ["" + 0](y) { return y.length; }, >"" + 0 : string ->"" : string ->0 : number +>"" : "" +>0 : 0 >y : string >y.length : number >y : string @@ -27,8 +27,8 @@ var o: I = { ["" + 1]: y => y.length >"" + 1 : string ->"" : string ->1 : number +>"" : "" +>1 : 1 >y => y.length : (y: string) => number >y : string >y.length : number diff --git a/tests/baselines/reference/computedPropertyNamesContextualType2_ES5.types b/tests/baselines/reference/computedPropertyNamesContextualType2_ES5.types index 5a5c48f2536..a9ca7b5ac6c 100644 --- a/tests/baselines/reference/computedPropertyNamesContextualType2_ES5.types +++ b/tests/baselines/reference/computedPropertyNamesContextualType2_ES5.types @@ -18,7 +18,7 @@ var o: I = { [+"foo"](y) { return y.length; }, >+"foo" : number ->"foo" : string +>"foo" : "foo" >y : string >y.length : number >y : string @@ -26,7 +26,7 @@ var o: I = { [+"bar"]: y => y.length >+"bar" : number ->"bar" : string +>"bar" : "bar" >y => y.length : (y: string) => number >y : string >y.length : number diff --git a/tests/baselines/reference/computedPropertyNamesContextualType2_ES6.types b/tests/baselines/reference/computedPropertyNamesContextualType2_ES6.types index 330351790ca..990b22b178f 100644 --- a/tests/baselines/reference/computedPropertyNamesContextualType2_ES6.types +++ b/tests/baselines/reference/computedPropertyNamesContextualType2_ES6.types @@ -18,7 +18,7 @@ var o: I = { [+"foo"](y) { return y.length; }, >+"foo" : number ->"foo" : string +>"foo" : "foo" >y : string >y.length : number >y : string @@ -26,7 +26,7 @@ var o: I = { [+"bar"]: y => y.length >+"bar" : number ->"bar" : string +>"bar" : "bar" >y => y.length : (y: string) => number >y : string >y.length : number diff --git a/tests/baselines/reference/computedPropertyNamesContextualType3_ES5.types b/tests/baselines/reference/computedPropertyNamesContextualType3_ES5.types index faff27c9154..58c6c3c58f2 100644 --- a/tests/baselines/reference/computedPropertyNamesContextualType3_ES5.types +++ b/tests/baselines/reference/computedPropertyNamesContextualType3_ES5.types @@ -14,7 +14,7 @@ var o: I = { [+"foo"](y) { return y.length; }, >+"foo" : number ->"foo" : string +>"foo" : "foo" >y : string >y.length : number >y : string @@ -22,7 +22,7 @@ var o: I = { [+"bar"]: y => y.length >+"bar" : number ->"bar" : string +>"bar" : "bar" >y => y.length : (y: string) => number >y : string >y.length : number diff --git a/tests/baselines/reference/computedPropertyNamesContextualType3_ES6.types b/tests/baselines/reference/computedPropertyNamesContextualType3_ES6.types index 18c32957944..89f62c9a02d 100644 --- a/tests/baselines/reference/computedPropertyNamesContextualType3_ES6.types +++ b/tests/baselines/reference/computedPropertyNamesContextualType3_ES6.types @@ -14,7 +14,7 @@ var o: I = { [+"foo"](y) { return y.length; }, >+"foo" : number ->"foo" : string +>"foo" : "foo" >y : string >y.length : number >y : string @@ -22,7 +22,7 @@ var o: I = { [+"bar"]: y => y.length >+"bar" : number ->"bar" : string +>"bar" : "bar" >y => y.length : (y: string) => number >y : string >y.length : number diff --git a/tests/baselines/reference/computedPropertyNamesContextualType4_ES5.types b/tests/baselines/reference/computedPropertyNamesContextualType4_ES5.types index 6f75f1a3633..1fe66e50ce5 100644 --- a/tests/baselines/reference/computedPropertyNamesContextualType4_ES5.types +++ b/tests/baselines/reference/computedPropertyNamesContextualType4_ES5.types @@ -16,13 +16,13 @@ var o: I = { [""+"foo"]: "", >""+"foo" : string ->"" : string ->"foo" : string ->"" : string +>"" : "" +>"foo" : "foo" +>"" : "" [""+"bar"]: 0 >""+"bar" : string ->"" : string ->"bar" : string ->0 : number +>"" : "" +>"bar" : "bar" +>0 : 0 } diff --git a/tests/baselines/reference/computedPropertyNamesContextualType4_ES6.types b/tests/baselines/reference/computedPropertyNamesContextualType4_ES6.types index 9ee84176237..0a74effe990 100644 --- a/tests/baselines/reference/computedPropertyNamesContextualType4_ES6.types +++ b/tests/baselines/reference/computedPropertyNamesContextualType4_ES6.types @@ -16,13 +16,13 @@ var o: I = { [""+"foo"]: "", >""+"foo" : string ->"" : string ->"foo" : string ->"" : string +>"" : "" +>"foo" : "foo" +>"" : "" [""+"bar"]: 0 >""+"bar" : string ->"" : string ->"bar" : string ->0 : number +>"" : "" +>"bar" : "bar" +>0 : 0 } diff --git a/tests/baselines/reference/computedPropertyNamesContextualType5_ES5.types b/tests/baselines/reference/computedPropertyNamesContextualType5_ES5.types index 38594f756ab..5721a1fcc86 100644 --- a/tests/baselines/reference/computedPropertyNamesContextualType5_ES5.types +++ b/tests/baselines/reference/computedPropertyNamesContextualType5_ES5.types @@ -16,11 +16,11 @@ var o: I = { [+"foo"]: "", >+"foo" : number ->"foo" : string ->"" : string +>"foo" : "foo" +>"" : "" [+"bar"]: 0 >+"bar" : number ->"bar" : string ->0 : number +>"bar" : "bar" +>0 : 0 } diff --git a/tests/baselines/reference/computedPropertyNamesContextualType5_ES6.types b/tests/baselines/reference/computedPropertyNamesContextualType5_ES6.types index a07b2e8cd95..a63da9b633d 100644 --- a/tests/baselines/reference/computedPropertyNamesContextualType5_ES6.types +++ b/tests/baselines/reference/computedPropertyNamesContextualType5_ES6.types @@ -16,11 +16,11 @@ var o: I = { [+"foo"]: "", >+"foo" : number ->"foo" : string ->"" : string +>"foo" : "foo" +>"" : "" [+"bar"]: 0 >+"bar" : number ->"bar" : string ->0 : number +>"bar" : "bar" +>0 : 0 } diff --git a/tests/baselines/reference/computedPropertyNamesContextualType6_ES5.types b/tests/baselines/reference/computedPropertyNamesContextualType6_ES5.types index e5b7440f49e..63651072644 100644 --- a/tests/baselines/reference/computedPropertyNamesContextualType6_ES5.types +++ b/tests/baselines/reference/computedPropertyNamesContextualType6_ES5.types @@ -19,31 +19,31 @@ declare function foo(obj: I): T foo({ >foo({ p: "", 0: () => { }, ["hi" + "bye"]: true, [0 + 1]: 0, [+"hi"]: [0]}) : string | number | boolean | (() => void) | number[] >foo : (obj: I) => T ->{ p: "", 0: () => { }, ["hi" + "bye"]: true, [0 + 1]: 0, [+"hi"]: [0]} : { [x: string]: string | number | boolean | (() => void) | number[]; [x: number]: number | (() => void) | number[]; 0: () => void; p: string; } +>{ p: "", 0: () => { }, ["hi" + "bye"]: true, [0 + 1]: 0, [+"hi"]: [0]} : { [x: string]: true | "" | 0 | (() => void) | number[]; [x: number]: 0 | (() => void) | number[]; 0: () => void; p: ""; } p: "", >p : string ->"" : string +>"" : "" 0: () => { }, >() => { } : () => void ["hi" + "bye"]: true, >"hi" + "bye" : string ->"hi" : string ->"bye" : string ->true : boolean +>"hi" : "hi" +>"bye" : "bye" +>true : true [0 + 1]: 0, >0 + 1 : number ->0 : number ->1 : number ->0 : number +>0 : 0 +>1 : 1 +>0 : 0 [+"hi"]: [0] >+"hi" : number ->"hi" : string +>"hi" : "hi" >[0] : number[] ->0 : number +>0 : 0 }); diff --git a/tests/baselines/reference/computedPropertyNamesContextualType6_ES6.types b/tests/baselines/reference/computedPropertyNamesContextualType6_ES6.types index 71498d7f3d4..fa34f015a23 100644 --- a/tests/baselines/reference/computedPropertyNamesContextualType6_ES6.types +++ b/tests/baselines/reference/computedPropertyNamesContextualType6_ES6.types @@ -19,31 +19,31 @@ declare function foo(obj: I): T foo({ >foo({ p: "", 0: () => { }, ["hi" + "bye"]: true, [0 + 1]: 0, [+"hi"]: [0]}) : string | number | boolean | (() => void) | number[] >foo : (obj: I) => T ->{ p: "", 0: () => { }, ["hi" + "bye"]: true, [0 + 1]: 0, [+"hi"]: [0]} : { [x: string]: string | number | boolean | (() => void) | number[]; [x: number]: number | (() => void) | number[]; 0: () => void; p: string; } +>{ p: "", 0: () => { }, ["hi" + "bye"]: true, [0 + 1]: 0, [+"hi"]: [0]} : { [x: string]: true | "" | 0 | (() => void) | number[]; [x: number]: 0 | (() => void) | number[]; 0: () => void; p: ""; } p: "", >p : string ->"" : string +>"" : "" 0: () => { }, >() => { } : () => void ["hi" + "bye"]: true, >"hi" + "bye" : string ->"hi" : string ->"bye" : string ->true : boolean +>"hi" : "hi" +>"bye" : "bye" +>true : true [0 + 1]: 0, >0 + 1 : number ->0 : number ->1 : number ->0 : number +>0 : 0 +>1 : 1 +>0 : 0 [+"hi"]: [0] >+"hi" : number ->"hi" : string +>"hi" : "hi" >[0] : number[] ->0 : number +>0 : 0 }); diff --git a/tests/baselines/reference/computedPropertyNamesContextualType7_ES5.types b/tests/baselines/reference/computedPropertyNamesContextualType7_ES5.types index c2099456303..b77a129a0b4 100644 --- a/tests/baselines/reference/computedPropertyNamesContextualType7_ES5.types +++ b/tests/baselines/reference/computedPropertyNamesContextualType7_ES5.types @@ -42,21 +42,21 @@ foo({ ["hi" + "bye"]: true, >"hi" + "bye" : string ->"hi" : string ->"bye" : string ->true : boolean +>"hi" : "hi" +>"bye" : "bye" +>true : true [0 + 1]: 0, >0 + 1 : number ->0 : number ->1 : number ->0 : number +>0 : 0 +>1 : 1 +>0 : 0 [+"hi"]: [0] >+"hi" : number ->"hi" : string +>"hi" : "hi" >[0] : number[] ->0 : number +>0 : 0 }); @@ -65,5 +65,5 @@ g({ p: "" }); >g : (obj: J) => T >{ p: "" } : { p: string; } >p : string ->"" : string +>"" : "" diff --git a/tests/baselines/reference/computedPropertyNamesContextualType7_ES6.types b/tests/baselines/reference/computedPropertyNamesContextualType7_ES6.types index 6ae7d7eeada..f041b2b4eb4 100644 --- a/tests/baselines/reference/computedPropertyNamesContextualType7_ES6.types +++ b/tests/baselines/reference/computedPropertyNamesContextualType7_ES6.types @@ -42,21 +42,21 @@ foo({ ["hi" + "bye"]: true, >"hi" + "bye" : string ->"hi" : string ->"bye" : string ->true : boolean +>"hi" : "hi" +>"bye" : "bye" +>true : true [0 + 1]: 0, >0 + 1 : number ->0 : number ->1 : number ->0 : number +>0 : 0 +>1 : 1 +>0 : 0 [+"hi"]: [0] >+"hi" : number ->"hi" : string +>"hi" : "hi" >[0] : number[] ->0 : number +>0 : 0 }); @@ -65,5 +65,5 @@ g({ p: "" }); >g : (obj: J) => T >{ p: "" } : { p: string; } >p : string ->"" : string +>"" : "" diff --git a/tests/baselines/reference/computedPropertyNamesContextualType8_ES5.errors.txt b/tests/baselines/reference/computedPropertyNamesContextualType8_ES5.errors.txt index ee36609095a..6bfc98ae6a8 100644 --- a/tests/baselines/reference/computedPropertyNamesContextualType8_ES5.errors.txt +++ b/tests/baselines/reference/computedPropertyNamesContextualType8_ES5.errors.txt @@ -1,7 +1,7 @@ -tests/cases/conformance/es6/computedProperties/computedPropertyNamesContextualType8_ES5.ts(6,5): error TS2322: Type '{ [x: string]: string | number; }' is not assignable to type 'I'. +tests/cases/conformance/es6/computedProperties/computedPropertyNamesContextualType8_ES5.ts(6,5): error TS2322: Type '{ [x: string]: "" | 0; }' is not assignable to type 'I'. Index signatures are incompatible. - Type 'string | number' is not assignable to type 'boolean'. - Type 'string' is not assignable to type 'boolean'. + Type '"" | 0' is not assignable to type 'boolean'. + Type '""' is not assignable to type 'boolean'. ==== tests/cases/conformance/es6/computedProperties/computedPropertyNamesContextualType8_ES5.ts (1 errors) ==== @@ -12,10 +12,10 @@ tests/cases/conformance/es6/computedProperties/computedPropertyNamesContextualTy var o: I = { ~ -!!! error TS2322: Type '{ [x: string]: string | number; }' is not assignable to type 'I'. +!!! error TS2322: Type '{ [x: string]: "" | 0; }' is not assignable to type 'I'. !!! error TS2322: Index signatures are incompatible. -!!! error TS2322: Type 'string | number' is not assignable to type 'boolean'. -!!! error TS2322: Type 'string' is not assignable to type 'boolean'. +!!! error TS2322: Type '"" | 0' is not assignable to type 'boolean'. +!!! error TS2322: Type '""' is not assignable to type 'boolean'. [""+"foo"]: "", [""+"bar"]: 0 } \ No newline at end of file diff --git a/tests/baselines/reference/computedPropertyNamesContextualType8_ES6.errors.txt b/tests/baselines/reference/computedPropertyNamesContextualType8_ES6.errors.txt index 1048fd2e119..30f0b6f529e 100644 --- a/tests/baselines/reference/computedPropertyNamesContextualType8_ES6.errors.txt +++ b/tests/baselines/reference/computedPropertyNamesContextualType8_ES6.errors.txt @@ -1,7 +1,7 @@ -tests/cases/conformance/es6/computedProperties/computedPropertyNamesContextualType8_ES6.ts(6,5): error TS2322: Type '{ [x: string]: string | number; }' is not assignable to type 'I'. +tests/cases/conformance/es6/computedProperties/computedPropertyNamesContextualType8_ES6.ts(6,5): error TS2322: Type '{ [x: string]: "" | 0; }' is not assignable to type 'I'. Index signatures are incompatible. - Type 'string | number' is not assignable to type 'boolean'. - Type 'string' is not assignable to type 'boolean'. + Type '"" | 0' is not assignable to type 'boolean'. + Type '""' is not assignable to type 'boolean'. ==== tests/cases/conformance/es6/computedProperties/computedPropertyNamesContextualType8_ES6.ts (1 errors) ==== @@ -12,10 +12,10 @@ tests/cases/conformance/es6/computedProperties/computedPropertyNamesContextualTy var o: I = { ~ -!!! error TS2322: Type '{ [x: string]: string | number; }' is not assignable to type 'I'. +!!! error TS2322: Type '{ [x: string]: "" | 0; }' is not assignable to type 'I'. !!! error TS2322: Index signatures are incompatible. -!!! error TS2322: Type 'string | number' is not assignable to type 'boolean'. -!!! error TS2322: Type 'string' is not assignable to type 'boolean'. +!!! error TS2322: Type '"" | 0' is not assignable to type 'boolean'. +!!! error TS2322: Type '""' is not assignable to type 'boolean'. [""+"foo"]: "", [""+"bar"]: 0 } \ No newline at end of file diff --git a/tests/baselines/reference/computedPropertyNamesContextualType9_ES5.errors.txt b/tests/baselines/reference/computedPropertyNamesContextualType9_ES5.errors.txt index e76b3a704dc..4f94dd3467f 100644 --- a/tests/baselines/reference/computedPropertyNamesContextualType9_ES5.errors.txt +++ b/tests/baselines/reference/computedPropertyNamesContextualType9_ES5.errors.txt @@ -1,7 +1,7 @@ -tests/cases/conformance/es6/computedProperties/computedPropertyNamesContextualType9_ES5.ts(6,5): error TS2322: Type '{ [x: number]: string | number; }' is not assignable to type 'I'. +tests/cases/conformance/es6/computedProperties/computedPropertyNamesContextualType9_ES5.ts(6,5): error TS2322: Type '{ [x: number]: "" | 0; }' is not assignable to type 'I'. Index signatures are incompatible. - Type 'string | number' is not assignable to type 'boolean'. - Type 'string' is not assignable to type 'boolean'. + Type '"" | 0' is not assignable to type 'boolean'. + Type '""' is not assignable to type 'boolean'. ==== tests/cases/conformance/es6/computedProperties/computedPropertyNamesContextualType9_ES5.ts (1 errors) ==== @@ -12,10 +12,10 @@ tests/cases/conformance/es6/computedProperties/computedPropertyNamesContextualTy var o: I = { ~ -!!! error TS2322: Type '{ [x: number]: string | number; }' is not assignable to type 'I'. +!!! error TS2322: Type '{ [x: number]: "" | 0; }' is not assignable to type 'I'. !!! error TS2322: Index signatures are incompatible. -!!! error TS2322: Type 'string | number' is not assignable to type 'boolean'. -!!! error TS2322: Type 'string' is not assignable to type 'boolean'. +!!! error TS2322: Type '"" | 0' is not assignable to type 'boolean'. +!!! error TS2322: Type '""' is not assignable to type 'boolean'. [+"foo"]: "", [+"bar"]: 0 } \ No newline at end of file diff --git a/tests/baselines/reference/computedPropertyNamesContextualType9_ES6.errors.txt b/tests/baselines/reference/computedPropertyNamesContextualType9_ES6.errors.txt index 468ad400c26..5eeccfe7293 100644 --- a/tests/baselines/reference/computedPropertyNamesContextualType9_ES6.errors.txt +++ b/tests/baselines/reference/computedPropertyNamesContextualType9_ES6.errors.txt @@ -1,7 +1,7 @@ -tests/cases/conformance/es6/computedProperties/computedPropertyNamesContextualType9_ES6.ts(6,5): error TS2322: Type '{ [x: number]: string | number; }' is not assignable to type 'I'. +tests/cases/conformance/es6/computedProperties/computedPropertyNamesContextualType9_ES6.ts(6,5): error TS2322: Type '{ [x: number]: "" | 0; }' is not assignable to type 'I'. Index signatures are incompatible. - Type 'string | number' is not assignable to type 'boolean'. - Type 'string' is not assignable to type 'boolean'. + Type '"" | 0' is not assignable to type 'boolean'. + Type '""' is not assignable to type 'boolean'. ==== tests/cases/conformance/es6/computedProperties/computedPropertyNamesContextualType9_ES6.ts (1 errors) ==== @@ -12,10 +12,10 @@ tests/cases/conformance/es6/computedProperties/computedPropertyNamesContextualTy var o: I = { ~ -!!! error TS2322: Type '{ [x: number]: string | number; }' is not assignable to type 'I'. +!!! error TS2322: Type '{ [x: number]: "" | 0; }' is not assignable to type 'I'. !!! error TS2322: Index signatures are incompatible. -!!! error TS2322: Type 'string | number' is not assignable to type 'boolean'. -!!! error TS2322: Type 'string' is not assignable to type 'boolean'. +!!! error TS2322: Type '"" | 0' is not assignable to type 'boolean'. +!!! error TS2322: Type '""' is not assignable to type 'boolean'. [+"foo"]: "", [+"bar"]: 0 } \ No newline at end of file diff --git a/tests/baselines/reference/computedPropertyNamesDeclarationEmit1_ES5.types b/tests/baselines/reference/computedPropertyNamesDeclarationEmit1_ES5.types index a05d5556495..dd12b763441 100644 --- a/tests/baselines/reference/computedPropertyNamesDeclarationEmit1_ES5.types +++ b/tests/baselines/reference/computedPropertyNamesDeclarationEmit1_ES5.types @@ -4,18 +4,18 @@ class C { ["" + ""]() { } >"" + "" : string ->"" : string ->"" : string +>"" : "" +>"" : "" get ["" + ""]() { return 0; } >"" + "" : string ->"" : string ->"" : string ->0 : number +>"" : "" +>"" : "" +>0 : 0 set ["" + ""](x) { } >"" + "" : string ->"" : string ->"" : string +>"" : "" +>"" : "" >x : any } diff --git a/tests/baselines/reference/computedPropertyNamesDeclarationEmit1_ES6.types b/tests/baselines/reference/computedPropertyNamesDeclarationEmit1_ES6.types index 8b635956dcd..2ee96225fb9 100644 --- a/tests/baselines/reference/computedPropertyNamesDeclarationEmit1_ES6.types +++ b/tests/baselines/reference/computedPropertyNamesDeclarationEmit1_ES6.types @@ -4,18 +4,18 @@ class C { ["" + ""]() { } >"" + "" : string ->"" : string ->"" : string +>"" : "" +>"" : "" get ["" + ""]() { return 0; } >"" + "" : string ->"" : string ->"" : string ->0 : number +>"" : "" +>"" : "" +>0 : 0 set ["" + ""](x) { } >"" + "" : string ->"" : string ->"" : string +>"" : "" +>"" : "" >x : any } diff --git a/tests/baselines/reference/computedPropertyNamesDeclarationEmit2_ES5.types b/tests/baselines/reference/computedPropertyNamesDeclarationEmit2_ES5.types index c49010b2c09..30fc69390e5 100644 --- a/tests/baselines/reference/computedPropertyNamesDeclarationEmit2_ES5.types +++ b/tests/baselines/reference/computedPropertyNamesDeclarationEmit2_ES5.types @@ -4,18 +4,18 @@ class C { static ["" + ""]() { } >"" + "" : string ->"" : string ->"" : string +>"" : "" +>"" : "" static get ["" + ""]() { return 0; } >"" + "" : string ->"" : string ->"" : string ->0 : number +>"" : "" +>"" : "" +>0 : 0 static set ["" + ""](x) { } >"" + "" : string ->"" : string ->"" : string +>"" : "" +>"" : "" >x : any } diff --git a/tests/baselines/reference/computedPropertyNamesDeclarationEmit2_ES6.types b/tests/baselines/reference/computedPropertyNamesDeclarationEmit2_ES6.types index 0b0083b9a1a..181b935790c 100644 --- a/tests/baselines/reference/computedPropertyNamesDeclarationEmit2_ES6.types +++ b/tests/baselines/reference/computedPropertyNamesDeclarationEmit2_ES6.types @@ -4,18 +4,18 @@ class C { static ["" + ""]() { } >"" + "" : string ->"" : string ->"" : string +>"" : "" +>"" : "" static get ["" + ""]() { return 0; } >"" + "" : string ->"" : string ->"" : string ->0 : number +>"" : "" +>"" : "" +>0 : 0 static set ["" + ""](x) { } >"" + "" : string ->"" : string ->"" : string +>"" : "" +>"" : "" >x : any } diff --git a/tests/baselines/reference/computedPropertyNamesDeclarationEmit5_ES5.types b/tests/baselines/reference/computedPropertyNamesDeclarationEmit5_ES5.types index 0653059b535..fd5971fc849 100644 --- a/tests/baselines/reference/computedPropertyNamesDeclarationEmit5_ES5.types +++ b/tests/baselines/reference/computedPropertyNamesDeclarationEmit5_ES5.types @@ -5,24 +5,24 @@ var v = { ["" + ""]: 0, >"" + "" : string ->"" : string ->"" : string ->0 : number +>"" : "" +>"" : "" +>0 : 0 ["" + ""]() { }, >"" + "" : string ->"" : string ->"" : string +>"" : "" +>"" : "" get ["" + ""]() { return 0; }, >"" + "" : string ->"" : string ->"" : string ->0 : number +>"" : "" +>"" : "" +>0 : 0 set ["" + ""](x) { } >"" + "" : string ->"" : string ->"" : string +>"" : "" +>"" : "" >x : any } diff --git a/tests/baselines/reference/computedPropertyNamesDeclarationEmit5_ES6.types b/tests/baselines/reference/computedPropertyNamesDeclarationEmit5_ES6.types index 45d1e74f24a..886d93e061c 100644 --- a/tests/baselines/reference/computedPropertyNamesDeclarationEmit5_ES6.types +++ b/tests/baselines/reference/computedPropertyNamesDeclarationEmit5_ES6.types @@ -5,24 +5,24 @@ var v = { ["" + ""]: 0, >"" + "" : string ->"" : string ->"" : string ->0 : number +>"" : "" +>"" : "" +>0 : 0 ["" + ""]() { }, >"" + "" : string ->"" : string ->"" : string +>"" : "" +>"" : "" get ["" + ""]() { return 0; }, >"" + "" : string ->"" : string ->"" : string ->0 : number +>"" : "" +>"" : "" +>0 : 0 set ["" + ""](x) { } >"" + "" : string ->"" : string ->"" : string +>"" : "" +>"" : "" >x : any } diff --git a/tests/baselines/reference/computedPropertyNamesSourceMap1_ES5.types b/tests/baselines/reference/computedPropertyNamesSourceMap1_ES5.types index 528591441b0..555782bf6cf 100644 --- a/tests/baselines/reference/computedPropertyNamesSourceMap1_ES5.types +++ b/tests/baselines/reference/computedPropertyNamesSourceMap1_ES5.types @@ -3,14 +3,14 @@ class C { >C : C ["hello"]() { ->"hello" : string +>"hello" : "hello" debugger; } get ["goodbye"]() { ->"goodbye" : string +>"goodbye" : "goodbye" return 0; ->0 : number +>0 : 0 } } diff --git a/tests/baselines/reference/computedPropertyNamesSourceMap1_ES6.types b/tests/baselines/reference/computedPropertyNamesSourceMap1_ES6.types index cd7b75384b0..93ce203c0ef 100644 --- a/tests/baselines/reference/computedPropertyNamesSourceMap1_ES6.types +++ b/tests/baselines/reference/computedPropertyNamesSourceMap1_ES6.types @@ -3,14 +3,14 @@ class C { >C : C ["hello"]() { ->"hello" : string +>"hello" : "hello" debugger; } get ["goodbye"]() { ->"goodbye" : string +>"goodbye" : "goodbye" return 0; ->0 : number +>0 : 0 } } diff --git a/tests/baselines/reference/computedPropertyNamesSourceMap2_ES5.types b/tests/baselines/reference/computedPropertyNamesSourceMap2_ES5.types index 29b64c990c2..bf2352f338d 100644 --- a/tests/baselines/reference/computedPropertyNamesSourceMap2_ES5.types +++ b/tests/baselines/reference/computedPropertyNamesSourceMap2_ES5.types @@ -4,14 +4,14 @@ var v = { >{ ["hello"]() { debugger; }, get ["goodbye"]() { return 0; }} : { ["hello"](): void; readonly ["goodbye"]: number; } ["hello"]() { ->"hello" : string +>"hello" : "hello" debugger; }, get ["goodbye"]() { ->"goodbye" : string +>"goodbye" : "goodbye" return 0; ->0 : number +>0 : 0 } } diff --git a/tests/baselines/reference/computedPropertyNamesSourceMap2_ES6.types b/tests/baselines/reference/computedPropertyNamesSourceMap2_ES6.types index fea16b5de8d..ae4429d0437 100644 --- a/tests/baselines/reference/computedPropertyNamesSourceMap2_ES6.types +++ b/tests/baselines/reference/computedPropertyNamesSourceMap2_ES6.types @@ -4,14 +4,14 @@ var v = { >{ ["hello"]() { debugger; }, get ["goodbye"]() { return 0; }} : { ["hello"](): void; readonly ["goodbye"]: number; } ["hello"]() { ->"hello" : string +>"hello" : "hello" debugger; }, get ["goodbye"]() { ->"goodbye" : string +>"goodbye" : "goodbye" return 0; ->0 : number +>0 : 0 } } diff --git a/tests/baselines/reference/computedPropertyNamesWithStaticProperty.types b/tests/baselines/reference/computedPropertyNamesWithStaticProperty.types index d003b6b32f1..9a99ae7605b 100644 --- a/tests/baselines/reference/computedPropertyNamesWithStaticProperty.types +++ b/tests/baselines/reference/computedPropertyNamesWithStaticProperty.types @@ -4,7 +4,7 @@ class C { static staticProp = 10; >staticProp : number ->10 : number +>10 : 10 get [C.staticProp]() { >C.staticProp : number @@ -12,7 +12,7 @@ class C { >staticProp : number return "hello"; ->"hello" : string +>"hello" : "hello" } set [C.staticProp](x: string) { >C.staticProp : number diff --git a/tests/baselines/reference/concatError.types b/tests/baselines/reference/concatError.types index 9624342bd21..bb9a85a91b4 100644 --- a/tests/baselines/reference/concatError.types +++ b/tests/baselines/reference/concatError.types @@ -20,7 +20,7 @@ fa = fa.concat([0]); >fa : number[] >concat : { (...items: number[][]): number[]; (...items: (number | number[])[]): number[]; } >[0] : number[] ->0 : number +>0 : 0 fa = fa.concat(0); >fa = fa.concat(0) : number[] @@ -29,7 +29,7 @@ fa = fa.concat(0); >fa.concat : { (...items: number[][]): number[]; (...items: (number | number[])[]): number[]; } >fa : number[] >concat : { (...items: number[][]): number[]; (...items: (number | number[])[]): number[]; } ->0 : number +>0 : 0 diff --git a/tests/baselines/reference/concatTuples.types b/tests/baselines/reference/concatTuples.types index 3923470b78d..fbb3ce96a57 100644 --- a/tests/baselines/reference/concatTuples.types +++ b/tests/baselines/reference/concatTuples.types @@ -3,8 +3,8 @@ let ijs: [number, number][] = [[1, 2]]; >ijs : [number, number][] >[[1, 2]] : [number, number][] >[1, 2] : [number, number] ->1 : number ->2 : number +>1 : 1 +>2 : 2 ijs = ijs.concat([[3, 4], [5, 6]]); >ijs = ijs.concat([[3, 4], [5, 6]]) : [number, number][] @@ -15,9 +15,9 @@ ijs = ijs.concat([[3, 4], [5, 6]]); >concat : { (...items: [number, number][][]): [number, number][]; (...items: ([number, number] | [number, number][])[]): [number, number][]; } >[[3, 4], [5, 6]] : [number, number][] >[3, 4] : [number, number] ->3 : number ->4 : number +>3 : 3 +>4 : 4 >[5, 6] : [number, number] ->5 : number ->6 : number +>5 : 5 +>6 : 6 diff --git a/tests/baselines/reference/conditionalExpression1.errors.txt b/tests/baselines/reference/conditionalExpression1.errors.txt index 0e291986785..66af5336808 100644 --- a/tests/baselines/reference/conditionalExpression1.errors.txt +++ b/tests/baselines/reference/conditionalExpression1.errors.txt @@ -1,9 +1,9 @@ -tests/cases/compiler/conditionalExpression1.ts(1,5): error TS2322: Type 'string | number' is not assignable to type 'boolean'. - Type 'string' is not assignable to type 'boolean'. +tests/cases/compiler/conditionalExpression1.ts(1,5): error TS2322: Type '"" | 1' is not assignable to type 'boolean'. + Type '""' is not assignable to type 'boolean'. ==== tests/cases/compiler/conditionalExpression1.ts (1 errors) ==== var x: boolean = (true ? 1 : ""); // should be an error ~ -!!! error TS2322: Type 'string | number' is not assignable to type 'boolean'. -!!! error TS2322: Type 'string' is not assignable to type 'boolean'. \ No newline at end of file +!!! error TS2322: Type '"" | 1' is not assignable to type 'boolean'. +!!! error TS2322: Type '""' is not assignable to type 'boolean'. \ No newline at end of file diff --git a/tests/baselines/reference/conditionalExpressions2.types b/tests/baselines/reference/conditionalExpressions2.types index 77714e664fb..0247b0f649d 100644 --- a/tests/baselines/reference/conditionalExpressions2.types +++ b/tests/baselines/reference/conditionalExpressions2.types @@ -2,53 +2,53 @@ var a = false ? 1 : null; >a : number ->false ? 1 : null : number ->false : boolean ->1 : number +>false ? 1 : null : 1 +>false : false +>1 : 1 >null : null var b = false ? undefined : 0; >b : number ->false ? undefined : 0 : number ->false : boolean +>false ? undefined : 0 : 0 +>false : false >undefined : undefined ->0 : number +>0 : 0 var c = false ? 1 : 0; >c : number ->false ? 1 : 0 : number ->false : boolean ->1 : number ->0 : number +>false ? 1 : 0 : 0 | 1 +>false : false +>1 : 1 +>0 : 0 var d = false ? false : true; >d : boolean >false ? false : true : boolean ->false : boolean ->false : boolean ->true : boolean +>false : false +>false : false +>true : true var e = false ? "foo" : "bar"; >e : string ->false ? "foo" : "bar" : string ->false : boolean ->"foo" : string ->"bar" : string +>false ? "foo" : "bar" : "foo" | "bar" +>false : false +>"foo" : "foo" +>"bar" : "bar" var f = false ? null : undefined; >f : any >false ? null : undefined : null ->false : boolean +>false : false >null : null >undefined : undefined var g = true ? {g:5} : null; >g : { g: number; } >true ? {g:5} : null : { g: number; } ->true : boolean +>true : true >{g:5} : { g: number; } >g : number ->5 : number +>5 : 5 >null : null var h = [{h:5}, null]; @@ -56,14 +56,14 @@ var h = [{h:5}, null]; >[{h:5}, null] : { h: number; }[] >{h:5} : { h: number; } >h : number ->5 : number +>5 : 5 >null : null function i() { if (true) { return { x: 5 }; } else { return null; } } >i : () => { x: number; } ->true : boolean +>true : true >{ x: 5 } : { x: number; } >x : number ->5 : number +>5 : 5 >null : null diff --git a/tests/baselines/reference/conditionalOperatorConditionIsBooleanType.errors.txt b/tests/baselines/reference/conditionalOperatorConditionIsBooleanType.errors.txt new file mode 100644 index 00000000000..25153c1ba15 --- /dev/null +++ b/tests/baselines/reference/conditionalOperatorConditionIsBooleanType.errors.txt @@ -0,0 +1,71 @@ +tests/cases/conformance/expressions/conditonalOperator/conditionalOperatorConditionIsBooleanType.ts(35,1): error TS2365: Operator '>' cannot be applied to types '2' and '1'. +tests/cases/conformance/expressions/conditonalOperator/conditionalOperatorConditionIsBooleanType.ts(58,23): error TS2365: Operator '>' cannot be applied to types '2' and '1'. + + +==== tests/cases/conformance/expressions/conditonalOperator/conditionalOperatorConditionIsBooleanType.ts (2 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; + condBoolean ? exprBoolean1 : exprBoolean2; + condBoolean ? exprNumber1 : exprNumber2; + condBoolean ? exprString1 : exprString2; + condBoolean ? exprIsObject1 : exprIsObject2; + condBoolean ? exprString1 : exprBoolean1; // union + + //Cond is a boolean type literal + true ? exprAny1 : exprAny2; + false ? exprBoolean1 : exprBoolean2; + true ? exprNumber1 : exprNumber2; + false ? exprString1 : exprString2; + true ? exprIsObject1 : exprIsObject2; + true ? exprString1 : exprBoolean1; // union + + //Cond is a boolean type expression + !true ? exprAny1 : exprAny2; + typeof "123" == "string" ? exprBoolean1 : exprBoolean2; + 2 > 1 ? exprNumber1 : exprNumber2; + ~~~~~ +!!! error TS2365: Operator '>' cannot be applied to types '2' and '1'. + null === undefined ? exprString1 : exprString2; + true || false ? exprIsObject1 : exprIsObject2; + null === undefined ? exprString1 : exprBoolean1; // union + + //Results shoud be same as Expr1 and Expr2 + var resultIsAny1 = condBoolean ? exprAny1 : exprAny2; + var resultIsBoolean1 = condBoolean ? exprBoolean1 : exprBoolean2; + var resultIsNumber1 = condBoolean ? exprNumber1 : exprNumber2; + var resultIsString1 = condBoolean ? exprString1 : exprString2; + var resultIsObject1 = condBoolean ? exprIsObject1 : exprIsObject2; + var resultIsStringOrBoolean1 = condBoolean ? exprString1 : exprBoolean1; // union + + var resultIsAny2 = true ? exprAny1 : exprAny2; + var resultIsBoolean2 = false ? exprBoolean1 : exprBoolean2; + var resultIsNumber2 = true ? exprNumber1 : exprNumber2; + var resultIsString2 = false ? exprString1 : exprString2; + var resultIsObject2 = true ? exprIsObject1 : exprIsObject2; + var resultIsStringOrBoolean2 = true ? exprString1 : exprBoolean1; // union + var resultIsStringOrBoolean3 = false ? exprString1 : exprBoolean1; // union + + var resultIsAny3 = !true ? exprAny1 : exprAny2; + var resultIsBoolean3 = typeof "123" == "string" ? exprBoolean1 : exprBoolean2; + var resultIsNumber3 = 2 > 1 ? exprNumber1 : exprNumber2; + ~~~~~ +!!! error TS2365: Operator '>' cannot be applied to types '2' and '1'. + var resultIsString3 = null === undefined ? exprString1 : exprString2; + var resultIsObject3 = true || false ? exprIsObject1 : exprIsObject2; + var resultIsStringOrBoolean4 = typeof "123" === "string" ? exprString1 : exprBoolean1; // union + \ No newline at end of file diff --git a/tests/baselines/reference/conditionalOperatorConditionIsBooleanType.types b/tests/baselines/reference/conditionalOperatorConditionIsBooleanType.types index ec3bd526e9e..7733b80f69b 100644 --- a/tests/baselines/reference/conditionalOperatorConditionIsBooleanType.types +++ b/tests/baselines/reference/conditionalOperatorConditionIsBooleanType.types @@ -146,7 +146,7 @@ true || false ? exprIsObject1 : exprIsObject2; >true || false ? exprIsObject1 : exprIsObject2 : Object >true || false : boolean >true : boolean ->false : boolean +>false : false >exprIsObject1 : Object >exprIsObject2 : Object @@ -291,7 +291,7 @@ var resultIsObject3 = true || false ? exprIsObject1 : exprIsObject2; >true || false ? exprIsObject1 : exprIsObject2 : Object >true || false : boolean >true : boolean ->false : boolean +>false : false >exprIsObject1 : Object >exprIsObject2 : Object diff --git a/tests/baselines/reference/conditionalOperatorConditionIsNumberType.types b/tests/baselines/reference/conditionalOperatorConditionIsNumberType.types index 5951dc07350..f1d7e7bd369 100644 --- a/tests/baselines/reference/conditionalOperatorConditionIsNumberType.types +++ b/tests/baselines/reference/conditionalOperatorConditionIsNumberType.types @@ -75,73 +75,73 @@ condNumber ? exprString1 : exprBoolean1; // Union //Cond is a number type literal 1 ? exprAny1 : exprAny2; >1 ? exprAny1 : exprAny2 : any ->1 : number +>1 : 1 >exprAny1 : any >exprAny2 : any 0 ? exprBoolean1 : exprBoolean2; >0 ? exprBoolean1 : exprBoolean2 : boolean ->0 : number +>0 : 0 >exprBoolean1 : boolean >exprBoolean2 : boolean 0.123456789 ? exprNumber1 : exprNumber2; >0.123456789 ? exprNumber1 : exprNumber2 : number ->0.123456789 : number +>0.123456789 : 0.123456789 >exprNumber1 : number >exprNumber2 : number - 10000000000000 ? exprString1 : exprString2; >- 10000000000000 ? exprString1 : exprString2 : string ->- 10000000000000 : number ->10000000000000 : number +>- 10000000000000 : -10000000000000 +>10000000000000 : 10000000000000 >exprString1 : string >exprString2 : string 1000000000000 ? exprIsObject1 : exprIsObject2; >1000000000000 ? exprIsObject1 : exprIsObject2 : Object ->1000000000000 : number +>1000000000000 : 1000000000000 >exprIsObject1 : Object >exprIsObject2 : Object 10000 ? exprString1 : exprBoolean1; // Union >10000 ? exprString1 : exprBoolean1 : string | boolean ->10000 : number +>10000 : 10000 >exprString1 : string >exprBoolean1 : boolean //Cond is a number type expression function foo() { return 1 }; >foo : () => number ->1 : number +>1 : 1 var array = [1, 2, 3]; >array : number[] >[1, 2, 3] : number[] ->1 : number ->2 : number ->3 : number +>1 : 1 +>2 : 2 +>3 : 3 1 * 0 ? exprAny1 : exprAny2; >1 * 0 ? exprAny1 : exprAny2 : any >1 * 0 : number ->1 : number ->0 : number +>1 : 1 +>0 : 0 >exprAny1 : any >exprAny2 : any 1 + 1 ? exprBoolean1 : exprBoolean2; >1 + 1 ? exprBoolean1 : exprBoolean2 : boolean >1 + 1 : number ->1 : number ->1 : number +>1 : 1 +>1 : 1 >exprBoolean1 : boolean >exprBoolean2 : boolean "string".length ? exprNumber1 : exprNumber2; >"string".length ? exprNumber1 : exprNumber2 : number >"string".length : number ->"string" : string +>"string" : "string" >length : number >exprNumber1 : number >exprNumber2 : number @@ -160,7 +160,7 @@ foo() / array[1] ? exprIsObject1 : exprIsObject2; >foo : () => number >array[1] : number >array : number[] ->1 : number +>1 : 1 >exprIsObject1 : Object >exprIsObject2 : Object @@ -217,43 +217,43 @@ var resultIsStringOrBoolean1 = condNumber ? exprString1 : exprBoolean1; // Union var resultIsAny2 = 1 ? exprAny1 : exprAny2; >resultIsAny2 : any >1 ? exprAny1 : exprAny2 : any ->1 : number +>1 : 1 >exprAny1 : any >exprAny2 : any var resultIsBoolean2 = 0 ? exprBoolean1 : exprBoolean2; >resultIsBoolean2 : boolean >0 ? exprBoolean1 : exprBoolean2 : boolean ->0 : number +>0 : 0 >exprBoolean1 : boolean >exprBoolean2 : boolean var resultIsNumber2 = 0.123456789 ? exprNumber1 : exprNumber2; >resultIsNumber2 : number >0.123456789 ? exprNumber1 : exprNumber2 : number ->0.123456789 : number +>0.123456789 : 0.123456789 >exprNumber1 : number >exprNumber2 : number var resultIsString2 = - 10000000000000 ? exprString1 : exprString2; >resultIsString2 : string >- 10000000000000 ? exprString1 : exprString2 : string ->- 10000000000000 : number ->10000000000000 : number +>- 10000000000000 : -10000000000000 +>10000000000000 : 10000000000000 >exprString1 : string >exprString2 : string var resultIsObject2 = 1000000000000 ? exprIsObject1 : exprIsObject2; >resultIsObject2 : Object >1000000000000 ? exprIsObject1 : exprIsObject2 : Object ->1000000000000 : number +>1000000000000 : 1000000000000 >exprIsObject1 : Object >exprIsObject2 : Object var resultIsStringOrBoolean2 = 10000 ? exprString1 : exprBoolean1; // Union >resultIsStringOrBoolean2 : string | boolean >10000 ? exprString1 : exprBoolean1 : string | boolean ->10000 : number +>10000 : 10000 >exprString1 : string >exprBoolean1 : boolean @@ -261,8 +261,8 @@ var resultIsAny3 = 1 * 0 ? exprAny1 : exprAny2; >resultIsAny3 : any >1 * 0 ? exprAny1 : exprAny2 : any >1 * 0 : number ->1 : number ->0 : number +>1 : 1 +>0 : 0 >exprAny1 : any >exprAny2 : any @@ -270,8 +270,8 @@ var resultIsBoolean3 = 1 + 1 ? exprBoolean1 : exprBoolean2; >resultIsBoolean3 : boolean >1 + 1 ? exprBoolean1 : exprBoolean2 : boolean >1 + 1 : number ->1 : number ->1 : number +>1 : 1 +>1 : 1 >exprBoolean1 : boolean >exprBoolean2 : boolean @@ -279,7 +279,7 @@ var resultIsNumber3 = "string".length ? exprNumber1 : exprNumber2; >resultIsNumber3 : number >"string".length ? exprNumber1 : exprNumber2 : number >"string".length : number ->"string" : string +>"string" : "string" >length : number >exprNumber1 : number >exprNumber2 : number @@ -300,7 +300,7 @@ var resultIsObject3 = foo() / array[1] ? exprIsObject1 : exprIsObject2; >foo : () => number >array[1] : number >array : number[] ->1 : number +>1 : 1 >exprIsObject1 : Object >exprIsObject2 : Object @@ -312,7 +312,7 @@ var resultIsStringOrBoolean3 = foo() / array[1] ? exprString1 : exprBoolean1; // >foo : () => number >array[1] : number >array : number[] ->1 : number +>1 : 1 >exprString1 : string >exprBoolean1 : boolean diff --git a/tests/baselines/reference/conditionalOperatorConditionIsObjectType.types b/tests/baselines/reference/conditionalOperatorConditionIsObjectType.types index 14a0f375ead..34cfe67f602 100644 --- a/tests/baselines/reference/conditionalOperatorConditionIsObjectType.types +++ b/tests/baselines/reference/conditionalOperatorConditionIsObjectType.types @@ -115,9 +115,9 @@ condObject ? exprString1 : exprBoolean1; // union >({ a: 1, b: "s" }) : { a: number; b: string; } >{ a: 1, b: "s" } : { a: number; b: string; } >a : number ->1 : number +>1 : 1 >b : string ->"s" : string +>"s" : "s" >exprString1 : string >exprString2 : string @@ -126,9 +126,9 @@ condObject ? exprString1 : exprBoolean1; // union >({ a: 1, b: "s" }) : { a: number; b: string; } >{ a: 1, b: "s" } : { a: number; b: string; } >a : number ->1 : number +>1 : 1 >b : string ->"s" : string +>"s" : "s" >exprIsObject1 : Object >exprIsObject2 : Object @@ -137,9 +137,9 @@ condObject ? exprString1 : exprBoolean1; // union >({ a: 1, b: "s" }) : { a: number; b: string; } >{ a: 1, b: "s" } : { a: number; b: string; } >a : number ->1 : number +>1 : 1 >b : string ->"s" : string +>"s" : "s" >exprString1 : string >exprBoolean1 : boolean @@ -271,9 +271,9 @@ var resultIsString2 = ({ a: 1, b: "s" }) ? exprString1 : exprString2; >({ a: 1, b: "s" }) : { a: number; b: string; } >{ a: 1, b: "s" } : { a: number; b: string; } >a : number ->1 : number +>1 : 1 >b : string ->"s" : string +>"s" : "s" >exprString1 : string >exprString2 : string @@ -283,9 +283,9 @@ var resultIsObject2 = ({ a: 1, b: "s" }) ? exprIsObject1 : exprIsObject2; >({ a: 1, b: "s" }) : { a: number; b: string; } >{ a: 1, b: "s" } : { a: number; b: string; } >a : number ->1 : number +>1 : 1 >b : string ->"s" : string +>"s" : "s" >exprIsObject1 : Object >exprIsObject2 : Object @@ -295,9 +295,9 @@ var resultIsStringOrBoolean2 = ({ a: 1, b: "s" }) ? exprString1 : exprBoolean1; >({ a: 1, b: "s" }) : { a: number; b: string; } >{ a: 1, b: "s" } : { a: number; b: string; } >a : number ->1 : number +>1 : 1 >b : string ->"s" : string +>"s" : "s" >exprString1 : string >exprBoolean1 : boolean diff --git a/tests/baselines/reference/conditionalOperatorConditoinIsAnyType.types b/tests/baselines/reference/conditionalOperatorConditoinIsAnyType.types index d79e570ec42..5903a10d4e5 100644 --- a/tests/baselines/reference/conditionalOperatorConditoinIsAnyType.types +++ b/tests/baselines/reference/conditionalOperatorConditoinIsAnyType.types @@ -130,7 +130,7 @@ x("x") ? exprBoolean1 : exprBoolean2; >x("x") ? exprBoolean1 : exprBoolean2 : boolean >x("x") : any >x : any ->"x" : string +>"x" : "x" >exprBoolean1 : boolean >exprBoolean2 : boolean @@ -146,7 +146,7 @@ x("x") ? exprString1 : exprString2; >x("x") ? exprString1 : exprString2 : string >x("x") : any >x : any ->"x" : string +>"x" : "x" >exprString1 : string >exprString2 : string @@ -288,7 +288,7 @@ var resultIsBoolean3 = x("x") ? exprBoolean1 : exprBoolean2; >x("x") ? exprBoolean1 : exprBoolean2 : boolean >x("x") : any >x : any ->"x" : string +>"x" : "x" >exprBoolean1 : boolean >exprBoolean2 : boolean @@ -306,7 +306,7 @@ var resultIsString3 = x("x") ? exprString1 : exprString2; >x("x") ? exprString1 : exprString2 : string >x("x") : any >x : any ->"x" : string +>"x" : "x" >exprString1 : string >exprString2 : string diff --git a/tests/baselines/reference/conditionalOperatorConditoinIsStringType.types b/tests/baselines/reference/conditionalOperatorConditoinIsStringType.types index af5abb25063..a6906d7024a 100644 --- a/tests/baselines/reference/conditionalOperatorConditoinIsStringType.types +++ b/tests/baselines/reference/conditionalOperatorConditoinIsStringType.types @@ -75,51 +75,51 @@ condString ? exprString1 : exprBoolean1; // union //Cond is a string type literal "" ? exprAny1 : exprAny2; >"" ? exprAny1 : exprAny2 : any ->"" : string +>"" : "" >exprAny1 : any >exprAny2 : any "string" ? exprBoolean1 : exprBoolean2; >"string" ? exprBoolean1 : exprBoolean2 : boolean ->"string" : string +>"string" : "string" >exprBoolean1 : boolean >exprBoolean2 : boolean 'c' ? exprNumber1 : exprNumber2; >'c' ? exprNumber1 : exprNumber2 : number ->'c' : string +>'c' : "c" >exprNumber1 : number >exprNumber2 : number 'string' ? exprString1 : exprString2; >'string' ? exprString1 : exprString2 : string ->'string' : string +>'string' : "string" >exprString1 : string >exprString2 : string " " ? exprIsObject1 : exprIsObject2; >" " ? exprIsObject1 : exprIsObject2 : Object ->" " : string +>" " : " " >exprIsObject1 : Object >exprIsObject2 : Object "hello " ? exprString1 : exprBoolean1; // union >"hello " ? exprString1 : exprBoolean1 : string | boolean ->"hello " : string +>"hello " : "hello " >exprString1 : string >exprBoolean1 : boolean //Cond is a string type expression function foo() { return "string" }; >foo : () => string ->"string" : string +>"string" : "string" var array = ["1", "2", "3"]; >array : string[] >["1", "2", "3"] : string[] ->"1" : string ->"2" : string ->"3" : string +>"1" : "1" +>"2" : "2" +>"3" : "3" typeof condString ? exprAny1 : exprAny2; >typeof condString ? exprAny1 : exprAny2 : any @@ -140,7 +140,7 @@ condString + "string" ? exprNumber1 : exprNumber2; >condString + "string" ? exprNumber1 : exprNumber2 : number >condString + "string" : string >condString : string ->"string" : string +>"string" : "string" >exprNumber1 : number >exprNumber2 : number @@ -155,7 +155,7 @@ array[1] ? exprIsObject1 : exprIsObject2; >array[1] ? exprIsObject1 : exprIsObject2 : Object >array[1] : string >array : string[] ->1 : number +>1 : 1 >exprIsObject1 : Object >exprIsObject2 : Object @@ -212,42 +212,42 @@ var resultIsStringOrBoolean1 = condString ? exprString1 : exprBoolean1; // union var resultIsAny2 = "" ? exprAny1 : exprAny2; >resultIsAny2 : any >"" ? exprAny1 : exprAny2 : any ->"" : string +>"" : "" >exprAny1 : any >exprAny2 : any var resultIsBoolean2 = "string" ? exprBoolean1 : exprBoolean2; >resultIsBoolean2 : boolean >"string" ? exprBoolean1 : exprBoolean2 : boolean ->"string" : string +>"string" : "string" >exprBoolean1 : boolean >exprBoolean2 : boolean var resultIsNumber2 = 'c' ? exprNumber1 : exprNumber2; >resultIsNumber2 : number >'c' ? exprNumber1 : exprNumber2 : number ->'c' : string +>'c' : "c" >exprNumber1 : number >exprNumber2 : number var resultIsString2 = 'string' ? exprString1 : exprString2; >resultIsString2 : string >'string' ? exprString1 : exprString2 : string ->'string' : string +>'string' : "string" >exprString1 : string >exprString2 : string var resultIsObject2 = " " ? exprIsObject1 : exprIsObject2; >resultIsObject2 : Object >" " ? exprIsObject1 : exprIsObject2 : Object ->" " : string +>" " : " " >exprIsObject1 : Object >exprIsObject2 : Object var resultIsStringOrBoolean2 = "hello" ? exprString1 : exprBoolean1; // union >resultIsStringOrBoolean2 : string | boolean >"hello" ? exprString1 : exprBoolean1 : string | boolean ->"hello" : string +>"hello" : "hello" >exprString1 : string >exprBoolean1 : boolean @@ -273,7 +273,7 @@ var resultIsNumber3 = condString + "string" ? exprNumber1 : exprNumber2; >condString + "string" ? exprNumber1 : exprNumber2 : number >condString + "string" : string >condString : string ->"string" : string +>"string" : "string" >exprNumber1 : number >exprNumber2 : number @@ -290,7 +290,7 @@ var resultIsObject3 = array[1] ? exprIsObject1 : exprIsObject2; >array[1] ? exprIsObject1 : exprIsObject2 : Object >array[1] : string >array : string[] ->1 : number +>1 : 1 >exprIsObject1 : Object >exprIsObject2 : Object diff --git a/tests/baselines/reference/conditionalOperatorWithIdenticalBCT.types b/tests/baselines/reference/conditionalOperatorWithIdenticalBCT.types index 3f5f6454eda..3a655853163 100644 --- a/tests/baselines/reference/conditionalOperatorWithIdenticalBCT.types +++ b/tests/baselines/reference/conditionalOperatorWithIdenticalBCT.types @@ -32,62 +32,62 @@ var b: B; //Be Not contextually typed true ? x : a; >true ? x : a : X ->true : boolean +>true : true >x : X >a : A var result1 = true ? x : a; >result1 : X >true ? x : a : X ->true : boolean +>true : true >x : X >a : A //Expr1 and Expr2 are literals true ? {} : 1; >true ? {} : 1 : {} ->true : boolean +>true : true >{} : {} ->1 : number +>1 : 1 true ? { a: 1 } : { a: 2, b: 'string' }; >true ? { a: 1 } : { a: 2, b: 'string' } : { a: number; } | { a: number; b: string; } ->true : boolean +>true : true >{ a: 1 } : { a: number; } >a : number ->1 : number +>1 : 1 >{ a: 2, b: 'string' } : { a: number; b: string; } >a : number ->2 : number +>2 : 2 >b : string ->'string' : string +>'string' : "string" var result2 = true ? {} : 1; >result2 : {} >true ? {} : 1 : {} ->true : boolean +>true : true >{} : {} ->1 : number +>1 : 1 var result3 = true ? { a: 1 } : { a: 2, b: 'string' }; >result3 : { a: number; } | { a: number; b: string; } >true ? { a: 1 } : { a: 2, b: 'string' } : { a: number; } | { a: number; b: string; } ->true : boolean +>true : true >{ a: 1 } : { a: number; } >a : number ->1 : number +>1 : 1 >{ a: 2, b: 'string' } : { a: number; b: string; } >a : number ->2 : number +>2 : 2 >b : string ->'string' : string +>'string' : "string" //Contextually typed var resultIsX1: X = true ? x : a; >resultIsX1 : X >X : X >true ? x : a : X ->true : boolean +>true : true >x : X >a : A @@ -96,7 +96,7 @@ var result4: (t: A) => any = true ? (m) => m.propertyX : (n) => n.propertyA; >t : A >A : A >true ? (m) => m.propertyX : (n) => n.propertyA : (m: A) => any ->true : boolean +>true : true >(m) => m.propertyX : (m: A) => any >m : A >m.propertyX : any @@ -112,62 +112,62 @@ var result4: (t: A) => any = true ? (m) => m.propertyX : (n) => n.propertyA; //Be Not contextually typed true ? a : x; >true ? a : x : X ->true : boolean +>true : true >a : A >x : X var result5 = true ? a : x; >result5 : X >true ? a : x : X ->true : boolean +>true : true >a : A >x : X //Expr1 and Expr2 are literals true ? 1 : {}; >true ? 1 : {} : {} ->true : boolean ->1 : number +>true : true +>1 : 1 >{} : {} true ? { a: 2, b: 'string' } : { a: 1 }; >true ? { a: 2, b: 'string' } : { a: 1 } : { a: number; b: string; } | { a: number; } ->true : boolean +>true : true >{ a: 2, b: 'string' } : { a: number; b: string; } >a : number ->2 : number +>2 : 2 >b : string ->'string' : string +>'string' : "string" >{ a: 1 } : { a: number; } >a : number ->1 : number +>1 : 1 var result6 = true ? 1 : {}; >result6 : {} >true ? 1 : {} : {} ->true : boolean ->1 : number +>true : true +>1 : 1 >{} : {} var result7 = true ? { a: 2, b: 'string' } : { a: 1 }; >result7 : { a: number; b: string; } | { a: number; } >true ? { a: 2, b: 'string' } : { a: 1 } : { a: number; b: string; } | { a: number; } ->true : boolean +>true : true >{ a: 2, b: 'string' } : { a: number; b: string; } >a : number ->2 : number +>2 : 2 >b : string ->'string' : string +>'string' : "string" >{ a: 1 } : { a: number; } >a : number ->1 : number +>1 : 1 //Contextually typed var resultIsX2: X = true ? x : a; >resultIsX2 : X >X : X >true ? x : a : X ->true : boolean +>true : true >x : X >a : A @@ -176,7 +176,7 @@ var result8: (t: A) => any = true ? (m) => m.propertyA : (n) => n.propertyX; >t : A >A : A >true ? (m) => m.propertyA : (n) => n.propertyX : (n: A) => any ->true : boolean +>true : true >(m) => m.propertyA : (m: A) => number >m : A >m.propertyA : number @@ -194,7 +194,7 @@ var resultIsX3: X = true ? a : b; >resultIsX3 : X >X : X >true ? a : b : A | B ->true : boolean +>true : true >a : A >b : B @@ -203,7 +203,7 @@ var result10: (t: X) => any = true ? (m) => m.propertyX1 : (n) => n.propertyX2; >t : X >X : X >true ? (m) => m.propertyX1 : (n) => n.propertyX2 : ((m: X) => number) | ((n: X) => string) ->true : boolean +>true : true >(m) => m.propertyX1 : (m: X) => number >m : X >m.propertyX1 : number @@ -218,8 +218,8 @@ 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 | number ->true : boolean ->1 : number ->'string' : string +>true ? 1 : 'string' : 1 | "string" +>true : true +>1 : 1 +>'string' : "string" diff --git a/tests/baselines/reference/constDeclarationShadowedByVarDeclaration2.types b/tests/baselines/reference/constDeclarationShadowedByVarDeclaration2.types index a5a7dd1d0cd..23e81800264 100644 --- a/tests/baselines/reference/constDeclarationShadowedByVarDeclaration2.types +++ b/tests/baselines/reference/constDeclarationShadowedByVarDeclaration2.types @@ -5,14 +5,14 @@ function outer() { >outer : () => void const x = 0; ->x : number ->0 : number +>x : 0 +>0 : 0 function inner() { >inner : () => void var x = "inner"; >x : string ->"inner" : string +>"inner" : "inner" } } diff --git a/tests/baselines/reference/constDeclarationShadowedByVarDeclaration3.types b/tests/baselines/reference/constDeclarationShadowedByVarDeclaration3.types index 1271d4ef869..919a9eb96f2 100644 --- a/tests/baselines/reference/constDeclarationShadowedByVarDeclaration3.types +++ b/tests/baselines/reference/constDeclarationShadowedByVarDeclaration3.types @@ -8,11 +8,11 @@ class Rule { >RegExp : RegExp >new RegExp('') : RegExp >RegExp : RegExpConstructor ->'' : string +>'' : "" public name: string = ''; >name : string ->'' : string +>'' : "" constructor(name: string) { >name : string diff --git a/tests/baselines/reference/constDeclarations-errors.errors.txt b/tests/baselines/reference/constDeclarations-errors.errors.txt index 98b12b616f7..2c9c17cc102 100644 --- a/tests/baselines/reference/constDeclarations-errors.errors.txt +++ b/tests/baselines/reference/constDeclarations-errors.errors.txt @@ -4,12 +4,14 @@ tests/cases/compiler/constDeclarations-errors.ts(5,7): error TS1155: 'const' dec tests/cases/compiler/constDeclarations-errors.ts(5,11): error TS1155: 'const' declarations must be initialized tests/cases/compiler/constDeclarations-errors.ts(5,15): error TS1155: 'const' declarations must be initialized tests/cases/compiler/constDeclarations-errors.ts(5,27): error TS1155: 'const' declarations must be initialized +tests/cases/compiler/constDeclarations-errors.ts(10,19): error TS2365: Operator '<' cannot be applied to types '0' and '1'. tests/cases/compiler/constDeclarations-errors.ts(10,27): error TS2449: The operand of an increment or decrement operator cannot be a constant or a read-only property. tests/cases/compiler/constDeclarations-errors.ts(13,11): error TS1155: 'const' declarations must be initialized tests/cases/compiler/constDeclarations-errors.ts(16,20): error TS1155: 'const' declarations must be initialized +tests/cases/compiler/constDeclarations-errors.ts(16,25): error TS2365: Operator '<' cannot be applied to types '0' and '1'. -==== tests/cases/compiler/constDeclarations-errors.ts (9 errors) ==== +==== tests/cases/compiler/constDeclarations-errors.ts (11 errors) ==== // error, missing intialicer const c1; @@ -32,6 +34,8 @@ tests/cases/compiler/constDeclarations-errors.ts(16,20): error TS1155: 'const' d // error, assigning to a const for(const c8 = 0; c8 < 1; c8++) { } + ~~~~~~ +!!! error TS2365: Operator '<' cannot be applied to types '0' and '1'. ~~ !!! error TS2449: The operand of an increment or decrement operator cannot be a constant or a read-only property. @@ -43,4 +47,6 @@ tests/cases/compiler/constDeclarations-errors.ts(16,20): error TS1155: 'const' d // error, can not be unintalized for(const c10 = 0, c11; c10 < 1;) { } ~~~ -!!! error TS1155: 'const' declarations must be initialized \ No newline at end of file +!!! error TS1155: 'const' declarations must be initialized + ~~~~~~~ +!!! error TS2365: Operator '<' cannot be applied to types '0' and '1'. \ No newline at end of file diff --git a/tests/baselines/reference/constDeclarations-es5.types b/tests/baselines/reference/constDeclarations-es5.types index a897c3f9cd0..e801607727e 100644 --- a/tests/baselines/reference/constDeclarations-es5.types +++ b/tests/baselines/reference/constDeclarations-es5.types @@ -1,18 +1,18 @@ === tests/cases/compiler/constDeclarations-es5.ts === const z7 = false; ->z7 : boolean ->false : boolean +>z7 : false +>false : false const z8: number = 23; >z8 : number ->23 : number +>23 : 23 const z9 = 0, z10 :string = "", z11 = null; ->z9 : number ->0 : number +>z9 : 0 +>0 : 0 >z10 : string ->"" : string +>"" : "" >z11 : any >null : null diff --git a/tests/baselines/reference/constDeclarations-scopes2.errors.txt b/tests/baselines/reference/constDeclarations-scopes2.errors.txt new file mode 100644 index 00000000000..b998f3a9980 --- /dev/null +++ b/tests/baselines/reference/constDeclarations-scopes2.errors.txt @@ -0,0 +1,21 @@ +tests/cases/compiler/constDeclarations-scopes2.ts(9,19): error TS2365: Operator '<' cannot be applied to types '0' and '10'. + + +==== tests/cases/compiler/constDeclarations-scopes2.ts (1 errors) ==== + + // global + const c = "string"; + + var n: number; + var b: boolean; + + // for scope + for (const c = 0; c < 10; n = c ) { + ~~~~~~ +!!! error TS2365: Operator '<' cannot be applied to types '0' and '10'. + // for block + const c = false; + b = c; + } + + \ No newline at end of file diff --git a/tests/baselines/reference/constDeclarations.errors.txt b/tests/baselines/reference/constDeclarations.errors.txt new file mode 100644 index 00000000000..1642610eec2 --- /dev/null +++ b/tests/baselines/reference/constDeclarations.errors.txt @@ -0,0 +1,17 @@ +tests/cases/compiler/constDeclarations.ts(8,19): error TS2365: Operator '<' cannot be applied to types '0' and '9'. + + +==== tests/cases/compiler/constDeclarations.ts (1 errors) ==== + + // No error + const c1 = false; + const c2: number = 23; + const c3 = 0, c4 :string = "", c5 = null; + + + for(const c4 = 0; c4 < 9; ) { break; } + ~~~~~~ +!!! error TS2365: Operator '<' cannot be applied to types '0' and '9'. + + + for(const c5 = 0, c6 = 0; c5 < c6; ) { break; } \ No newline at end of file diff --git a/tests/baselines/reference/constDeclarations.js b/tests/baselines/reference/constDeclarations.js index 060c0aba61c..7e5902ed5a1 100644 --- a/tests/baselines/reference/constDeclarations.js +++ b/tests/baselines/reference/constDeclarations.js @@ -25,6 +25,6 @@ for (const c5 = 0, c6 = 0; c5 < c6;) { //// [constDeclarations.d.ts] -declare const c1: boolean; +declare const c1: false; declare const c2: number; -declare const c3: number, c4: string, c5: any; +declare const c3: 0, c4: string, c5: any; diff --git a/tests/baselines/reference/constDeclarations2.js b/tests/baselines/reference/constDeclarations2.js index e4ee67ebdcd..ea7134d4664 100644 --- a/tests/baselines/reference/constDeclarations2.js +++ b/tests/baselines/reference/constDeclarations2.js @@ -20,7 +20,7 @@ var M; //// [constDeclarations2.d.ts] declare module M { - const c1: boolean; + const c1: false; const c2: number; - const c3: number, c4: string, c5: any; + const c3: 0, c4: string, c5: any; } diff --git a/tests/baselines/reference/constDeclarations2.types b/tests/baselines/reference/constDeclarations2.types index f8184b8f8e0..54a273dfb4d 100644 --- a/tests/baselines/reference/constDeclarations2.types +++ b/tests/baselines/reference/constDeclarations2.types @@ -5,18 +5,18 @@ module M { >M : typeof M export const c1 = false; ->c1 : boolean ->false : boolean +>c1 : false +>false : false export const c2: number = 23; >c2 : number ->23 : number +>23 : 23 export const c3 = 0, c4 :string = "", c5 = null; ->c3 : number ->0 : number +>c3 : 0 +>0 : 0 >c4 : string ->"" : string +>"" : "" >c5 : any >null : null } diff --git a/tests/baselines/reference/constEnum1.types b/tests/baselines/reference/constEnum1.types index 9ae95992847..17f6f5de278 100644 --- a/tests/baselines/reference/constEnum1.types +++ b/tests/baselines/reference/constEnum1.types @@ -9,7 +9,7 @@ const enum E { a = 10, >a : E ->10 : number +>10 : 10 b = a, >b : E @@ -20,7 +20,7 @@ const enum E { >(a+1) : number >a+1 : number >a : E ->1 : number +>1 : 1 e, >e : E @@ -35,16 +35,16 @@ const enum E { >a << 2 >> 1 : number >a << 2 : number >a : E ->2 : number ->1 : number +>2 : 2 +>1 : 1 g = a << 2 >>> 1, >g : E >a << 2 >>> 1 : number >a << 2 : number >a : E ->2 : number ->1 : number +>2 : 2 +>1 : 1 h = a | b >h : E diff --git a/tests/baselines/reference/constEnumDeclarations.types b/tests/baselines/reference/constEnumDeclarations.types index 481c2673660..1f86028b385 100644 --- a/tests/baselines/reference/constEnumDeclarations.types +++ b/tests/baselines/reference/constEnumDeclarations.types @@ -5,11 +5,11 @@ const enum E { A = 1, >A : E ->1 : number +>1 : 1 B = 2, >B : E ->2 : number +>2 : 2 C = A | B >C : E @@ -22,12 +22,12 @@ const enum E2 { >E2 : E2 A = 1, ->A : E2 ->1 : number +>A : E2.A +>1 : 1 B, ->B : E2 +>B : E2.B C ->C : E2 +>C : E2.C } diff --git a/tests/baselines/reference/constEnumExternalModule.types b/tests/baselines/reference/constEnumExternalModule.types index 5d03b77b1b7..2bd978a2caf 100644 --- a/tests/baselines/reference/constEnumExternalModule.types +++ b/tests/baselines/reference/constEnumExternalModule.types @@ -14,7 +14,7 @@ const enum E { V = 100 >V : E ->100 : number +>100 : 100 } export = E diff --git a/tests/baselines/reference/constEnumMergingWithValues4.types b/tests/baselines/reference/constEnumMergingWithValues4.types index 92d04fc10cc..8df07d3026d 100644 --- a/tests/baselines/reference/constEnumMergingWithValues4.types +++ b/tests/baselines/reference/constEnumMergingWithValues4.types @@ -13,7 +13,7 @@ module foo { var x = 1; >x : number ->1 : number +>1 : 1 } diff --git a/tests/baselines/reference/constEnumOnlyModuleMerging.types b/tests/baselines/reference/constEnumOnlyModuleMerging.types index 452c0f46add..ec78f39e055 100644 --- a/tests/baselines/reference/constEnumOnlyModuleMerging.types +++ b/tests/baselines/reference/constEnumOnlyModuleMerging.types @@ -4,7 +4,7 @@ module Outer { export var x = 1; >x : number ->1 : number +>1 : 1 } module Outer { diff --git a/tests/baselines/reference/constEnumPropertyAccess1.types b/tests/baselines/reference/constEnumPropertyAccess1.types index f0e00fe7717..869a31d5e1f 100644 --- a/tests/baselines/reference/constEnumPropertyAccess1.types +++ b/tests/baselines/reference/constEnumPropertyAccess1.types @@ -9,11 +9,11 @@ const enum G { A = 1, >A : G ->1 : number +>1 : 1 B = 2, >B : G ->2 : number +>2 : 2 C = A + B, >C : G @@ -25,7 +25,7 @@ const enum G { >D : G >A * 2 : number >A : G ->2 : number +>2 : 2 } var o: { @@ -35,10 +35,10 @@ var o: { >idx : number } = { ->{ 1: true } : { 1: boolean; } +>{ 1: true } : { 1: true; } 1: true ->true : boolean +>true : true }; @@ -52,7 +52,7 @@ var a1 = G["A"]; >a1 : G >G["A"] : G >G : typeof G ->"A" : string +>"A" : "A" var g = o[G.A]; >g : boolean @@ -76,7 +76,7 @@ class C { >B : G return true; ->true : boolean +>true : true } set [G.B](x: number) { } >G.B : G diff --git a/tests/baselines/reference/constEnumPropertyAccess2.errors.txt b/tests/baselines/reference/constEnumPropertyAccess2.errors.txt index a943ee00962..ef5dd331d32 100644 --- a/tests/baselines/reference/constEnumPropertyAccess2.errors.txt +++ b/tests/baselines/reference/constEnumPropertyAccess2.errors.txt @@ -1,6 +1,6 @@ tests/cases/conformance/constEnums/constEnumPropertyAccess2.ts(14,9): error TS2475: 'const' enums can only be used in property or index access expressions or the right hand side of an import declaration or export assignment. tests/cases/conformance/constEnums/constEnumPropertyAccess2.ts(15,12): error TS2476: A const enum member can only be accessed using a string literal. -tests/cases/conformance/constEnums/constEnumPropertyAccess2.ts(17,1): error TS2322: Type 'string' is not assignable to type 'G'. +tests/cases/conformance/constEnums/constEnumPropertyAccess2.ts(17,1): error TS2322: Type '"string"' is not assignable to type 'G'. tests/cases/conformance/constEnums/constEnumPropertyAccess2.ts(19,1): error TS2450: Left-hand side of assignment expression cannot be a constant or a read-only property. @@ -27,7 +27,7 @@ tests/cases/conformance/constEnums/constEnumPropertyAccess2.ts(19,1): error TS24 var g: G; g = "string"; ~ -!!! error TS2322: Type 'string' is not assignable to type 'G'. +!!! error TS2322: Type '"string"' is not assignable to type 'G'. function foo(x: G) { } G.B = 3; ~~~ diff --git a/tests/baselines/reference/constEnumToStringNoComments.types b/tests/baselines/reference/constEnumToStringNoComments.types index 21c4dc6c703..eef69de320d 100644 --- a/tests/baselines/reference/constEnumToStringNoComments.types +++ b/tests/baselines/reference/constEnumToStringNoComments.types @@ -3,138 +3,138 @@ const enum Foo { >Foo : Foo X = 100, ->X : Foo ->100 : number +>X : Foo.X +>100 : 100 Y = 0.5, ->Y : Foo ->0.5 : number +>Y : Foo.Y +>0.5 : 0.5 Z = 2., ->Z : Foo ->2. : number +>Z : Foo.Z +>2. : 2 A = -1, ->A : Foo ->-1 : number ->1 : number +>A : Foo.A +>-1 : -1 +>1 : 1 B = -1.5, ->B : Foo ->-1.5 : number ->1.5 : number +>B : Foo.B +>-1.5 : -1.5 +>1.5 : 1.5 C = -1. ->C : Foo ->-1. : number ->1. : number +>C : Foo.A +>-1. : -1 +>1. : 1 } let x0 = Foo.X.toString(); >x0 : string >Foo.X.toString() : string >Foo.X.toString : (radix?: number) => string ->Foo.X : Foo +>Foo.X : Foo.X >Foo : typeof Foo ->X : Foo +>X : Foo.X >toString : (radix?: number) => string let x1 = Foo["X"].toString(); >x1 : string >Foo["X"].toString() : string >Foo["X"].toString : (radix?: number) => string ->Foo["X"] : Foo +>Foo["X"] : Foo.X >Foo : typeof Foo ->"X" : string +>"X" : "X" >toString : (radix?: number) => string let y0 = Foo.Y.toString(); >y0 : string >Foo.Y.toString() : string >Foo.Y.toString : (radix?: number) => string ->Foo.Y : Foo +>Foo.Y : Foo.Y >Foo : typeof Foo ->Y : Foo +>Y : Foo.Y >toString : (radix?: number) => string let y1 = Foo["Y"].toString(); >y1 : string >Foo["Y"].toString() : string >Foo["Y"].toString : (radix?: number) => string ->Foo["Y"] : Foo +>Foo["Y"] : Foo.Y >Foo : typeof Foo ->"Y" : string +>"Y" : "Y" >toString : (radix?: number) => string let z0 = Foo.Z.toString(); >z0 : string >Foo.Z.toString() : string >Foo.Z.toString : (radix?: number) => string ->Foo.Z : Foo +>Foo.Z : Foo.Z >Foo : typeof Foo ->Z : Foo +>Z : Foo.Z >toString : (radix?: number) => string let z1 = Foo["Z"].toString(); >z1 : string >Foo["Z"].toString() : string >Foo["Z"].toString : (radix?: number) => string ->Foo["Z"] : Foo +>Foo["Z"] : Foo.Z >Foo : typeof Foo ->"Z" : string +>"Z" : "Z" >toString : (radix?: number) => string let a0 = Foo.A.toString(); >a0 : string >Foo.A.toString() : string >Foo.A.toString : (radix?: number) => string ->Foo.A : Foo +>Foo.A : Foo.A >Foo : typeof Foo ->A : Foo +>A : Foo.A >toString : (radix?: number) => string let a1 = Foo["A"].toString(); >a1 : string >Foo["A"].toString() : string >Foo["A"].toString : (radix?: number) => string ->Foo["A"] : Foo +>Foo["A"] : Foo.A >Foo : typeof Foo ->"A" : string +>"A" : "A" >toString : (radix?: number) => string let b0 = Foo.B.toString(); >b0 : string >Foo.B.toString() : string >Foo.B.toString : (radix?: number) => string ->Foo.B : Foo +>Foo.B : Foo.B >Foo : typeof Foo ->B : Foo +>B : Foo.B >toString : (radix?: number) => string let b1 = Foo["B"].toString(); >b1 : string >Foo["B"].toString() : string >Foo["B"].toString : (radix?: number) => string ->Foo["B"] : Foo +>Foo["B"] : Foo.B >Foo : typeof Foo ->"B" : string +>"B" : "B" >toString : (radix?: number) => string let c0 = Foo.C.toString(); >c0 : string >Foo.C.toString() : string >Foo.C.toString : (radix?: number) => string ->Foo.C : Foo +>Foo.C : Foo.A >Foo : typeof Foo ->C : Foo +>C : Foo.A >toString : (radix?: number) => string let c1 = Foo["C"].toString(); >c1 : string >Foo["C"].toString() : string >Foo["C"].toString : (radix?: number) => string ->Foo["C"] : Foo +>Foo["C"] : Foo.A >Foo : typeof Foo ->"C" : string +>"C" : "C" >toString : (radix?: number) => string diff --git a/tests/baselines/reference/constEnumToStringWithComments.types b/tests/baselines/reference/constEnumToStringWithComments.types index 72d7d367f5d..ff0e737ec86 100644 --- a/tests/baselines/reference/constEnumToStringWithComments.types +++ b/tests/baselines/reference/constEnumToStringWithComments.types @@ -3,138 +3,138 @@ const enum Foo { >Foo : Foo X = 100, ->X : Foo ->100 : number +>X : Foo.X +>100 : 100 Y = 0.5, ->Y : Foo ->0.5 : number +>Y : Foo.Y +>0.5 : 0.5 Z = 2., ->Z : Foo ->2. : number +>Z : Foo.Z +>2. : 2 A = -1, ->A : Foo ->-1 : number ->1 : number +>A : Foo.A +>-1 : -1 +>1 : 1 B = -1.5, ->B : Foo ->-1.5 : number ->1.5 : number +>B : Foo.B +>-1.5 : -1.5 +>1.5 : 1.5 C = -1. ->C : Foo ->-1. : number ->1. : number +>C : Foo.A +>-1. : -1 +>1. : 1 } let x0 = Foo.X.toString(); >x0 : string >Foo.X.toString() : string >Foo.X.toString : (radix?: number) => string ->Foo.X : Foo +>Foo.X : Foo.X >Foo : typeof Foo ->X : Foo +>X : Foo.X >toString : (radix?: number) => string let x1 = Foo["X"].toString(); >x1 : string >Foo["X"].toString() : string >Foo["X"].toString : (radix?: number) => string ->Foo["X"] : Foo +>Foo["X"] : Foo.X >Foo : typeof Foo ->"X" : string +>"X" : "X" >toString : (radix?: number) => string let y0 = Foo.Y.toString(); >y0 : string >Foo.Y.toString() : string >Foo.Y.toString : (radix?: number) => string ->Foo.Y : Foo +>Foo.Y : Foo.Y >Foo : typeof Foo ->Y : Foo +>Y : Foo.Y >toString : (radix?: number) => string let y1 = Foo["Y"].toString(); >y1 : string >Foo["Y"].toString() : string >Foo["Y"].toString : (radix?: number) => string ->Foo["Y"] : Foo +>Foo["Y"] : Foo.Y >Foo : typeof Foo ->"Y" : string +>"Y" : "Y" >toString : (radix?: number) => string let z0 = Foo.Z.toString(); >z0 : string >Foo.Z.toString() : string >Foo.Z.toString : (radix?: number) => string ->Foo.Z : Foo +>Foo.Z : Foo.Z >Foo : typeof Foo ->Z : Foo +>Z : Foo.Z >toString : (radix?: number) => string let z1 = Foo["Z"].toString(); >z1 : string >Foo["Z"].toString() : string >Foo["Z"].toString : (radix?: number) => string ->Foo["Z"] : Foo +>Foo["Z"] : Foo.Z >Foo : typeof Foo ->"Z" : string +>"Z" : "Z" >toString : (radix?: number) => string let a0 = Foo.A.toString(); >a0 : string >Foo.A.toString() : string >Foo.A.toString : (radix?: number) => string ->Foo.A : Foo +>Foo.A : Foo.A >Foo : typeof Foo ->A : Foo +>A : Foo.A >toString : (radix?: number) => string let a1 = Foo["A"].toString(); >a1 : string >Foo["A"].toString() : string >Foo["A"].toString : (radix?: number) => string ->Foo["A"] : Foo +>Foo["A"] : Foo.A >Foo : typeof Foo ->"A" : string +>"A" : "A" >toString : (radix?: number) => string let b0 = Foo.B.toString(); >b0 : string >Foo.B.toString() : string >Foo.B.toString : (radix?: number) => string ->Foo.B : Foo +>Foo.B : Foo.B >Foo : typeof Foo ->B : Foo +>B : Foo.B >toString : (radix?: number) => string let b1 = Foo["B"].toString(); >b1 : string >Foo["B"].toString() : string >Foo["B"].toString : (radix?: number) => string ->Foo["B"] : Foo +>Foo["B"] : Foo.B >Foo : typeof Foo ->"B" : string +>"B" : "B" >toString : (radix?: number) => string let c0 = Foo.C.toString(); >c0 : string >Foo.C.toString() : string >Foo.C.toString : (radix?: number) => string ->Foo.C : Foo +>Foo.C : Foo.A >Foo : typeof Foo ->C : Foo +>C : Foo.A >toString : (radix?: number) => string let c1 = Foo["C"].toString(); >c1 : string >Foo["C"].toString() : string >Foo["C"].toString : (radix?: number) => string ->Foo["C"] : Foo +>Foo["C"] : Foo.A >Foo : typeof Foo ->"C" : string +>"C" : "C" >toString : (radix?: number) => string diff --git a/tests/baselines/reference/constEnums.types b/tests/baselines/reference/constEnums.types index 83ee20100e5..c0bfef91434 100644 --- a/tests/baselines/reference/constEnums.types +++ b/tests/baselines/reference/constEnums.types @@ -4,7 +4,7 @@ const enum Enum1 { A0 = 100, >A0 : Enum1 ->100 : number +>100 : 100 } const enum Enum1 { @@ -19,7 +19,7 @@ const enum Enum1 { C = 10, >C : Enum1 ->10 : number +>10 : 10 D = A | B, >D : Enum1 @@ -31,20 +31,20 @@ const enum Enum1 { >E : Enum1 >A | 1 : number >A : Enum1 ->1 : number +>1 : 1 F = 1 | A, >F : Enum1 >1 | A : number ->1 : number +>1 : 1 >A : Enum1 G = (1 & 1), >G : Enum1 >(1 & 1) : number >1 & 1 : number ->1 : number ->1 : number +>1 : 1 +>1 : 1 H = ~(A | B), >H : Enum1 @@ -58,12 +58,12 @@ const enum Enum1 { >I : Enum1 >A >>> 1 : number >A : Enum1 ->1 : number +>1 : 1 J = 1 & A, >J : Enum1 >1 & A : number ->1 : number +>1 : 1 >A : Enum1 K = ~(1 | 5), @@ -71,8 +71,8 @@ const enum Enum1 { >~(1 | 5) : number >(1 | 5) : number >1 | 5 : number ->1 : number ->5 : number +>1 : 1 +>5 : 5 L = ~D, >L : Enum1 @@ -89,7 +89,7 @@ const enum Enum1 { >N : Enum1 >E << 1 : number >E : Enum1 ->1 : number +>1 : 1 O = E >> B, >O : Enum1 @@ -101,7 +101,7 @@ const enum Enum1 { >P : Enum1 >E >> 1 : number >E : Enum1 ->1 : number +>1 : 1 Q = -D, >Q : Enum1 @@ -112,12 +112,12 @@ const enum Enum1 { >R : Enum1 >C & 5 : number >C : Enum1 ->5 : number +>5 : 5 S = 5 & C, >S : Enum1 >5 & C : number ->5 : number +>5 : 5 >C : Enum1 T = C | D, @@ -130,12 +130,12 @@ const enum Enum1 { >U : Enum1 >C | 1 : number >C : Enum1 ->1 : number +>1 : 1 V = 10 | D, >V : Enum1 >10 | D : number ->10 : number +>10 : 10 >D : Enum1 W = Enum1.V, @@ -159,13 +159,13 @@ const enum Enum1 { >W3 : Enum1 >Enum1["A0"] : Enum1 >Enum1 : typeof Enum1 ->"A0" : string +>"A0" : "A0" W4 = Enum1["W"], >W4 : Enum1 >Enum1["W"] : Enum1 >Enum1 : typeof Enum1 ->"W" : string +>"W" : "W" } @@ -183,7 +183,7 @@ module A { V1 = 1, >V1 : E ->1 : number +>1 : 1 V2 = A.B.C.E.V1 | 100 >V2 : E @@ -197,7 +197,7 @@ module A { >C : typeof C >E : typeof E >V1 : E ->100 : number +>100 : 100 } } } @@ -226,8 +226,8 @@ module A { >B : typeof B >C : typeof C >E : typeof E ->"V2" : string ->200 : number +>"V2" : "V2" +>200 : 200 } } } @@ -246,12 +246,12 @@ module A1 { >E : E V1 = 10, ->V1 : E ->10 : number +>V1 : E.V1 +>10 : 10 V2 = 110, ->V2 : E ->110 : number +>V2 : E.V2 +>110 : 110 } } } @@ -270,12 +270,12 @@ module A2 { >E : E V1 = 10, ->V1 : E ->10 : number +>V1 : E.V1 +>10 : 10 V2 = 110, ->V2 : E ->110 : number +>V2 : E.V2 +>110 : 110 } } // module C will be classified as value @@ -284,7 +284,7 @@ module A2 { var x = 1 >x : number ->1 : number +>1 : 1 } } } @@ -496,7 +496,7 @@ function foo(x: Enum1) { case Enum1["T"]: >Enum1["T"] : Enum1 >Enum1 : typeof Enum1 ->"T" : string +>"T" : "T" case Enum1.U: >Enum1.U : Enum1 @@ -558,7 +558,7 @@ function bar(e: A.B.C.E): number { >C : typeof A.B.C >E : typeof I >V1 : I ->1 : number +>1 : 1 case A.B.C.E.V2: return 1; >A.B.C.E.V2 : I @@ -570,7 +570,7 @@ function bar(e: A.B.C.E): number { >C : typeof A.B.C >E : typeof I >V2 : I ->1 : number +>1 : 1 case A.B.C.E.V3: return 1; >A.B.C.E.V3 : I @@ -582,6 +582,6 @@ function bar(e: A.B.C.E): number { >C : typeof A.B.C >E : typeof I >V3 : I ->1 : number +>1 : 1 } } diff --git a/tests/baselines/reference/constIndexedAccess.types b/tests/baselines/reference/constIndexedAccess.types index eb02c7bde2e..0740a6efc67 100644 --- a/tests/baselines/reference/constIndexedAccess.types +++ b/tests/baselines/reference/constIndexedAccess.types @@ -4,10 +4,10 @@ const enum numbers { >numbers : numbers zero, ->zero : numbers +>zero : numbers.zero one ->one : numbers +>one : numbers.one } interface indexAccess { @@ -25,69 +25,69 @@ let s = test[0]; >s : string >test[0] : string >test : indexAccess ->0 : number +>0 : 0 let n = test[1]; >n : number >test[1] : number >test : indexAccess ->1 : number +>1 : 1 let s1 = test[numbers.zero]; >s1 : string >test[numbers.zero] : string >test : indexAccess ->numbers.zero : numbers +>numbers.zero : numbers.zero >numbers : typeof numbers ->zero : numbers +>zero : numbers.zero let n1 = test[numbers.one]; >n1 : number >test[numbers.one] : number >test : indexAccess ->numbers.one : numbers +>numbers.one : numbers.one >numbers : typeof numbers ->one : numbers +>one : numbers.one let s2 = test[numbers["zero"]]; >s2 : string >test[numbers["zero"]] : string >test : indexAccess ->numbers["zero"] : numbers +>numbers["zero"] : numbers.zero >numbers : typeof numbers ->"zero" : string +>"zero" : "zero" let n2 = test[numbers["one"]]; >n2 : number >test[numbers["one"]] : number >test : indexAccess ->numbers["one"] : numbers +>numbers["one"] : numbers.one >numbers : typeof numbers ->"one" : string +>"one" : "one" enum numbersNotConst { >numbersNotConst : numbersNotConst zero, ->zero : numbersNotConst +>zero : numbersNotConst.zero one ->one : numbersNotConst +>one : numbersNotConst.one } let s3 = test[numbersNotConst.zero]; >s3 : any >test[numbersNotConst.zero] : any >test : indexAccess ->numbersNotConst.zero : numbersNotConst +>numbersNotConst.zero : numbersNotConst.zero >numbersNotConst : typeof numbersNotConst ->zero : numbersNotConst +>zero : numbersNotConst.zero let n3 = test[numbersNotConst.one]; >n3 : any >test[numbersNotConst.one] : any >test : indexAccess ->numbersNotConst.one : numbersNotConst +>numbersNotConst.one : numbersNotConst.one >numbersNotConst : typeof numbersNotConst ->one : numbersNotConst +>one : numbersNotConst.one diff --git a/tests/baselines/reference/constructSignaturesWithIdenticalOverloads.types b/tests/baselines/reference/constructSignaturesWithIdenticalOverloads.types index ca2cb6fefb7..8ea80c02d19 100644 --- a/tests/baselines/reference/constructSignaturesWithIdenticalOverloads.types +++ b/tests/baselines/reference/constructSignaturesWithIdenticalOverloads.types @@ -20,8 +20,8 @@ var r1 = new C(1, ''); >r1 : C >new C(1, '') : C >C : typeof C ->1 : number ->'' : string +>1 : 1 +>'' : "" class C2 { >C2 : C2 @@ -46,8 +46,8 @@ var r2 = new C2(1, ''); >r2 : C2 >new C2(1, '') : C2 >C2 : typeof C2 ->1 : number ->'' : string +>1 : 1 +>'' : "" interface I { >I : I @@ -71,8 +71,8 @@ var r3 = new i(1, ''); >r3 : C >new i(1, '') : C >i : I ->1 : number ->'' : string +>1 : 1 +>'' : "" interface I2 { >I2 : I2 @@ -117,8 +117,8 @@ var r4 = new i2(1, ''); >r4 : C2 >new i2(1, '') : C2 >i2 : I2 ->1 : number ->'' : string +>1 : 1 +>'' : "" var a: { >a : { new (x: number, y: string): C; new (x: number, y: string): C; } @@ -138,8 +138,8 @@ var r5 = new a(1, ''); >r5 : C >new a(1, '') : C >a : { new (x: number, y: string): C; new (x: number, y: string): C; } ->1 : number ->'' : string +>1 : 1 +>'' : "" var b: { >b : { new (x: T, y: string): C2; new (x: T, y: string): C2; } @@ -165,6 +165,6 @@ var r6 = new b(1, ''); >r6 : C2 >new b(1, '') : C2 >b : { new (x: T, y: string): C2; new (x: T, y: string): C2; } ->1 : number ->'' : string +>1 : 1 +>'' : "" diff --git a/tests/baselines/reference/constructSignaturesWithOverloads.types b/tests/baselines/reference/constructSignaturesWithOverloads.types index 8ff678c5de8..775006e24e0 100644 --- a/tests/baselines/reference/constructSignaturesWithOverloads.types +++ b/tests/baselines/reference/constructSignaturesWithOverloads.types @@ -20,8 +20,8 @@ var r1 = new C(1, ''); >r1 : C >new C(1, '') : C >C : typeof C ->1 : number ->'' : string +>1 : 1 +>'' : "" class C2 { >C2 : C2 @@ -46,8 +46,8 @@ var r2 = new C2(1, ''); >r2 : C2 >new C2(1, '') : C2 >C2 : typeof C2 ->1 : number ->'' : string +>1 : 1 +>'' : "" interface I { >I : I @@ -71,8 +71,8 @@ var r3 = new i(1, ''); >r3 : C >new i(1, '') : C >i : I ->1 : number ->'' : string +>1 : 1 +>'' : "" interface I2 { >I2 : I2 @@ -118,8 +118,8 @@ var r4 = new i2(1, ''); >r4 : C2 >new i2(1, '') : C2 >i2 : I2 ->1 : number ->'' : string +>1 : 1 +>'' : "" var a: { >a : { new (x: number, y?: string): C; new (x: number, y: string): C; } @@ -139,8 +139,8 @@ var r5 = new a(1, ''); >r5 : C >new a(1, '') : C >a : { new (x: number, y?: string): C; new (x: number, y: string): C; } ->1 : number ->'' : string +>1 : 1 +>'' : "" var b: { >b : { new (x: T, y?: string): C2; new (x: T, y: string): C2; } @@ -166,6 +166,6 @@ var r6 = new b(1, ''); >r6 : C2 >new b(1, '') : C2 >b : { new (x: T, y?: string): C2; new (x: T, y: string): C2; } ->1 : number ->'' : string +>1 : 1 +>'' : "" diff --git a/tests/baselines/reference/constructableDecoratorOnClass01.errors.txt b/tests/baselines/reference/constructableDecoratorOnClass01.errors.txt index f390aaf8550..aae5f9aac42 100644 --- a/tests/baselines/reference/constructableDecoratorOnClass01.errors.txt +++ b/tests/baselines/reference/constructableDecoratorOnClass01.errors.txt @@ -1,5 +1,5 @@ tests/cases/conformance/decorators/class/constructableDecoratorOnClass01.ts(4,1): error TS1238: Unable to resolve signature of class decorator when called as an expression. - Cannot invoke an expression whose type lacks a call signature. + Cannot invoke an expression whose type lacks a call signature. Type 'typeof CtorDtor' has no compatible call signatures. ==== tests/cases/conformance/decorators/class/constructableDecoratorOnClass01.ts (1 errors) ==== @@ -9,7 +9,7 @@ tests/cases/conformance/decorators/class/constructableDecoratorOnClass01.ts(4,1) @CtorDtor ~~~~~~~~~ !!! error TS1238: Unable to resolve signature of class decorator when called as an expression. -!!! error TS1238: Cannot invoke an expression whose type lacks a call signature. +!!! error TS1238: Cannot invoke an expression whose type lacks a call signature. Type 'typeof CtorDtor' has no compatible call signatures. class C { } diff --git a/tests/baselines/reference/constructorFunctionTypeIsAssignableToBaseType2.types b/tests/baselines/reference/constructorFunctionTypeIsAssignableToBaseType2.types index e0e86df4a26..6bfac199b2b 100644 --- a/tests/baselines/reference/constructorFunctionTypeIsAssignableToBaseType2.types +++ b/tests/baselines/reference/constructorFunctionTypeIsAssignableToBaseType2.types @@ -60,6 +60,6 @@ class Derived2 extends Base { >x : any return 1; ->1 : number +>1 : 1 } } diff --git a/tests/baselines/reference/constructorImplementationWithDefaultValues.types b/tests/baselines/reference/constructorImplementationWithDefaultValues.types index fa99cc17fe0..fbb78bcb2a9 100644 --- a/tests/baselines/reference/constructorImplementationWithDefaultValues.types +++ b/tests/baselines/reference/constructorImplementationWithDefaultValues.types @@ -7,7 +7,7 @@ class C { constructor(x = 1) { >x : number ->1 : number +>1 : 1 var y = x; >y : number diff --git a/tests/baselines/reference/constructorImplementationWithDefaultValues2.errors.txt b/tests/baselines/reference/constructorImplementationWithDefaultValues2.errors.txt index 2fb24c0d5d8..9cad967dd77 100644 --- a/tests/baselines/reference/constructorImplementationWithDefaultValues2.errors.txt +++ b/tests/baselines/reference/constructorImplementationWithDefaultValues2.errors.txt @@ -1,5 +1,5 @@ -tests/cases/conformance/classes/constructorDeclarations/constructorParameters/constructorImplementationWithDefaultValues2.ts(3,17): error TS2322: Type 'number' is not assignable to type 'string'. -tests/cases/conformance/classes/constructorDeclarations/constructorParameters/constructorImplementationWithDefaultValues2.ts(10,17): error TS2322: Type 'number' is not assignable to type 'T'. +tests/cases/conformance/classes/constructorDeclarations/constructorParameters/constructorImplementationWithDefaultValues2.ts(3,17): error TS2322: Type '1' is not assignable to type 'string'. +tests/cases/conformance/classes/constructorDeclarations/constructorParameters/constructorImplementationWithDefaultValues2.ts(10,17): error TS2322: Type '1' is not assignable to type 'T'. tests/cases/conformance/classes/constructorDeclarations/constructorParameters/constructorImplementationWithDefaultValues2.ts(10,27): error TS2322: Type 'T' is not assignable to type 'U'. tests/cases/conformance/classes/constructorDeclarations/constructorParameters/constructorImplementationWithDefaultValues2.ts(17,17): error TS2322: Type 'Date' is not assignable to type 'T'. @@ -9,7 +9,7 @@ tests/cases/conformance/classes/constructorDeclarations/constructorParameters/co constructor(x); constructor(public x: string = 1) { // error ~~~~~~~~~~~~~~~~~~~~ -!!! error TS2322: Type 'number' is not assignable to type 'string'. +!!! error TS2322: Type '1' is not assignable to type 'string'. var y = x; } } @@ -18,7 +18,7 @@ tests/cases/conformance/classes/constructorDeclarations/constructorParameters/co constructor(x: T, y: U); constructor(x: T = 1, public y: U = x) { // error ~~~~~~~~ -!!! error TS2322: Type 'number' is not assignable to type 'T'. +!!! error TS2322: Type '1' is not assignable to type 'T'. ~~~~~~~~~~~~~~~ !!! error TS2322: Type 'T' is not assignable to type 'U'. var z = x; diff --git a/tests/baselines/reference/constructorOverloads2.types b/tests/baselines/reference/constructorOverloads2.types index dde032c0fd2..1b75c54c87f 100644 --- a/tests/baselines/reference/constructorOverloads2.types +++ b/tests/baselines/reference/constructorOverloads2.types @@ -45,13 +45,13 @@ var f1 = new Foo("hey"); >f1 : Foo >new Foo("hey") : Foo >Foo : typeof Foo ->"hey" : string +>"hey" : "hey" var f2 = new Foo(0); >f2 : Foo >new Foo(0) : Foo >Foo : typeof Foo ->0 : number +>0 : 0 var f3 = new Foo(f1); >f3 : Foo diff --git a/tests/baselines/reference/constructorOverloads4.errors.txt b/tests/baselines/reference/constructorOverloads4.errors.txt index d2cc5ecd65b..3e6923d25dc 100644 --- a/tests/baselines/reference/constructorOverloads4.errors.txt +++ b/tests/baselines/reference/constructorOverloads4.errors.txt @@ -1,7 +1,7 @@ tests/cases/compiler/constructorOverloads4.ts(2,18): error TS2300: Duplicate identifier 'Function'. tests/cases/compiler/constructorOverloads4.ts(5,21): error TS2300: Duplicate identifier 'Function'. tests/cases/compiler/constructorOverloads4.ts(6,21): error TS2300: Duplicate identifier 'Function'. -tests/cases/compiler/constructorOverloads4.ts(10,1): error TS2349: Cannot invoke an expression whose type lacks a call signature. +tests/cases/compiler/constructorOverloads4.ts(10,1): error TS2349: Cannot invoke an expression whose type lacks a call signature. Type 'Function' has no compatible call signatures. tests/cases/compiler/constructorOverloads4.ts(11,1): error TS2348: Value of type 'typeof Function' is not callable. Did you mean to include 'new'? @@ -23,7 +23,7 @@ tests/cases/compiler/constructorOverloads4.ts(11,1): error TS2348: Value of type (new M.Function("return 5"))(); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2349: Cannot invoke an expression whose type lacks a call signature. +!!! error TS2349: Cannot invoke an expression whose type lacks a call signature. Type 'Function' has no compatible call signatures. M.Function("yo"); ~~~~~~~~~~~~~~~~ !!! error TS2348: Value of type 'typeof Function' is not callable. Did you mean to include 'new'? diff --git a/tests/baselines/reference/constructorParameterShadowsOuterScopes.errors.txt b/tests/baselines/reference/constructorParameterShadowsOuterScopes.errors.txt index 87af1b85f2d..978681dc5b3 100644 --- a/tests/baselines/reference/constructorParameterShadowsOuterScopes.errors.txt +++ b/tests/baselines/reference/constructorParameterShadowsOuterScopes.errors.txt @@ -1,5 +1,5 @@ tests/cases/conformance/classes/propertyMemberDeclarations/constructorParameterShadowsOuterScopes.ts(8,9): error TS2301: Initializer of instance member variable 'b' cannot reference identifier 'x' declared in the constructor. -tests/cases/conformance/classes/propertyMemberDeclarations/constructorParameterShadowsOuterScopes.ts(10,9): error TS2322: Type 'number' is not assignable to type 'string'. +tests/cases/conformance/classes/propertyMemberDeclarations/constructorParameterShadowsOuterScopes.ts(10,9): error TS2322: Type '2' is not assignable to type 'string'. tests/cases/conformance/classes/propertyMemberDeclarations/constructorParameterShadowsOuterScopes.ts(16,9): error TS2301: Initializer of instance member variable 'b' cannot reference identifier 'y' declared in the constructor. @@ -17,7 +17,7 @@ tests/cases/conformance/classes/propertyMemberDeclarations/constructorParameterS constructor(x: string) { x = 2; // error, x is string ~ -!!! error TS2322: Type 'number' is not assignable to type 'string'. +!!! error TS2322: Type '2' is not assignable to type 'string'. } } diff --git a/tests/baselines/reference/constructorReturningAPrimitive.types b/tests/baselines/reference/constructorReturningAPrimitive.types index 4b431cfb36b..d3732d3b789 100644 --- a/tests/baselines/reference/constructorReturningAPrimitive.types +++ b/tests/baselines/reference/constructorReturningAPrimitive.types @@ -7,7 +7,7 @@ class A { constructor() { return 1; ->1 : number +>1 : 1 } } diff --git a/tests/baselines/reference/constructorReturnsInvalidType.errors.txt b/tests/baselines/reference/constructorReturnsInvalidType.errors.txt index 3b9a84fea98..a1a5c5e75b9 100644 --- a/tests/baselines/reference/constructorReturnsInvalidType.errors.txt +++ b/tests/baselines/reference/constructorReturnsInvalidType.errors.txt @@ -1,4 +1,4 @@ -tests/cases/compiler/constructorReturnsInvalidType.ts(3,16): error TS2322: Type 'number' is not assignable to type 'X'. +tests/cases/compiler/constructorReturnsInvalidType.ts(3,16): error TS2322: Type '1' is not assignable to type 'X'. tests/cases/compiler/constructorReturnsInvalidType.ts(3,16): error TS2409: Return type of constructor signature must be assignable to the instance type of the class @@ -7,7 +7,7 @@ tests/cases/compiler/constructorReturnsInvalidType.ts(3,16): error TS2409: Retur constructor() { return 1; ~ -!!! error TS2322: Type 'number' is not assignable to type 'X'. +!!! error TS2322: Type '1' is not assignable to type 'X'. ~ !!! error TS2409: Return type of constructor signature must be assignable to the instance type of the class } diff --git a/tests/baselines/reference/constructorWithAssignableReturnExpression.errors.txt b/tests/baselines/reference/constructorWithAssignableReturnExpression.errors.txt index 421e629c113..77c63a217e7 100644 --- a/tests/baselines/reference/constructorWithAssignableReturnExpression.errors.txt +++ b/tests/baselines/reference/constructorWithAssignableReturnExpression.errors.txt @@ -1,4 +1,4 @@ -tests/cases/conformance/classes/constructorDeclarations/constructorWithAssignableReturnExpression.ts(12,16): error TS2322: Type 'number' is not assignable to type 'D'. +tests/cases/conformance/classes/constructorDeclarations/constructorWithAssignableReturnExpression.ts(12,16): error TS2322: Type '1' is not assignable to type 'D'. tests/cases/conformance/classes/constructorDeclarations/constructorWithAssignableReturnExpression.ts(12,16): error TS2409: Return type of constructor signature must be assignable to the instance type of the class tests/cases/conformance/classes/constructorDeclarations/constructorWithAssignableReturnExpression.ts(26,16): error TS2322: Type '{ x: number; }' is not assignable to type 'F'. Types of property 'x' are incompatible. @@ -20,7 +20,7 @@ tests/cases/conformance/classes/constructorDeclarations/constructorWithAssignabl constructor() { return 1; // error ~ -!!! error TS2322: Type 'number' is not assignable to type 'D'. +!!! error TS2322: Type '1' is not assignable to type 'D'. ~ !!! error TS2409: Return type of constructor signature must be assignable to the instance type of the class } diff --git a/tests/baselines/reference/constructorWithIncompleteTypeAnnotation.errors.txt b/tests/baselines/reference/constructorWithIncompleteTypeAnnotation.errors.txt index 4011a51f557..49d3e378855 100644 --- a/tests/baselines/reference/constructorWithIncompleteTypeAnnotation.errors.txt +++ b/tests/baselines/reference/constructorWithIncompleteTypeAnnotation.errors.txt @@ -38,9 +38,10 @@ tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(160,30): error T tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(160,31): error TS2304: Cannot find name 'Property'. tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(167,13): error TS2365: Operator '+=' cannot be applied to types 'number' and 'void'. tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(181,40): error TS2447: The '^' operator is not allowed for boolean types. Consider using '!==' instead. -tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(182,13): error TS2322: Type 'boolean' is not assignable to type 'number | true'. -tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(184,13): error TS2322: Type 'boolean' is not assignable to type 'number | true'. -tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(192,13): error TS2322: Type 'boolean' is not assignable to type 'number | true'. +tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(182,13): error TS2322: Type 'boolean' is not assignable to type 'number'. +tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(184,13): error TS2322: Type 'boolean' is not assignable to type 'number'. +tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(188,13): error TS2322: Type 'true' is not assignable to type 'number'. +tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(192,13): error TS2322: Type 'boolean' is not assignable to type 'number'. tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(206,28): error TS1109: Expression expected. tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(214,16): error TS2304: Cannot find name 'bool'. tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(219,10): error TS1068: Unexpected token. A constructor, method, accessor, or property was expected. @@ -86,7 +87,7 @@ tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(260,55): error T tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(262,1): error TS1128: Declaration or statement expected. -==== tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts (86 errors) ==== +==== tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts (87 errors) ==== declare module "fs" { export class File { @@ -353,21 +354,23 @@ tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(262,1): error TS !!! error TS2447: The '^' operator is not allowed for boolean types. Consider using '!==' instead. b = !b;/*!*/ ~ -!!! error TS2322: Type 'boolean' is not assignable to type 'number | true'. +!!! error TS2322: Type 'boolean' is not assignable to type 'number'. i = ~i;/*~i*/ b = i < (i - 1) && (i + 1) > i;/*< && >*/ ~ -!!! error TS2322: Type 'boolean' is not assignable to type 'number | true'. +!!! error TS2322: Type 'boolean' is not assignable to type 'number'. var f = true ? 1 : 0;/*? :*/ // YES : i++;/*++*/ i--;/*--*/ b = true && false || true;/*&& ||*/ + ~ +!!! error TS2322: Type 'true' is not assignable to type 'number'. i = i << 5;/*<<*/ i = i >> 5;/*>>*/ var j = i; b = i == j && i != j && i <= j && i >= j;/*= == && != <= >=*/ ~ -!!! error TS2322: Type 'boolean' is not assignable to type 'number | true'. +!!! error TS2322: Type 'boolean' is not assignable to type 'number'. i += 5.0;/*+=*/ i -= i;/*-=*/ i *= i;/**=*/ diff --git a/tests/baselines/reference/contextualSignatureInstantiation.types b/tests/baselines/reference/contextualSignatureInstantiation.types index 49d6871804c..6fd318e5ec6 100644 --- a/tests/baselines/reference/contextualSignatureInstantiation.types +++ b/tests/baselines/reference/contextualSignatureInstantiation.types @@ -74,16 +74,16 @@ var a = bar(1, 1, g); // Should be number >a : number >bar(1, 1, g) : number >bar : (x: T, y: U, cb: (x: T, y: U) => V) => V ->1 : number ->1 : number +>1 : 1 +>1 : 1 >g : (x: T, y: T) => T var a = baz(1, 1, g); // Should be number >a : number >baz(1, 1, g) : number >baz : (x: T, y: T, cb: (x: T, y: T) => U) => U ->1 : number ->1 : number +>1 : 1 +>1 : 1 >g : (x: T, y: T) => T var b: number | string; @@ -99,16 +99,16 @@ var b = bar(1, "one", g); // Should be number | string >b : string | number >bar(1, "one", g) : string | number >bar : (x: T, y: U, cb: (x: T, y: U) => V) => V ->1 : number ->"one" : string +>1 : 1 +>"one" : "one" >g : (x: T, y: T) => T var b = bar("one", 1, g); // Should be number | string >b : string | number >bar("one", 1, g) : string | number >bar : (x: T, y: U, cb: (x: T, y: U) => V) => V ->"one" : string ->1 : number +>"one" : "one" +>1 : 1 >g : (x: T, y: T) => T var b = baz(b, b, g); // Should be number | string @@ -132,16 +132,16 @@ var d = bar(1, "one", h); // Should be number[] | string[] >d : number[] | string[] >bar(1, "one", h) : number[] | string[] >bar : (x: T, y: U, cb: (x: T, y: U) => V) => V ->1 : number ->"one" : string +>1 : 1 +>"one" : "one" >h : (x: T, y: U) => T[] | U[] var d = bar("one", 1, h); // Should be number[] | string[] >d : number[] | string[] >bar("one", 1, h) : number[] | string[] >bar : (x: T, y: U, cb: (x: T, y: U) => V) => V ->"one" : string ->1 : number +>"one" : "one" +>1 : 1 >h : (x: T, y: U) => T[] | U[] var d = baz(d, d, g); // Should be number[] | string[] diff --git a/tests/baselines/reference/contextualSignatureInstantiation3.types b/tests/baselines/reference/contextualSignatureInstantiation3.types index d01b2b1f8e4..945a4374ad1 100644 --- a/tests/baselines/reference/contextualSignatureInstantiation3.types +++ b/tests/baselines/reference/contextualSignatureInstantiation3.types @@ -43,9 +43,9 @@ function singleton(x: T) { var xs = [1, 2, 3]; >xs : number[] >[1, 2, 3] : number[] ->1 : number ->2 : number ->3 : number +>1 : 1 +>2 : 2 +>3 : 3 // Have compiler check that we get the correct types var v1: number[]; diff --git a/tests/baselines/reference/contextualSignatureInstantiationWithTypeParameterConstrainedToOuterTypeParameter.types b/tests/baselines/reference/contextualSignatureInstantiationWithTypeParameterConstrainedToOuterTypeParameter.types index d0a6d49487b..ac2ece4c039 100644 --- a/tests/baselines/reference/contextualSignatureInstantiationWithTypeParameterConstrainedToOuterTypeParameter.types +++ b/tests/baselines/reference/contextualSignatureInstantiationWithTypeParameterConstrainedToOuterTypeParameter.types @@ -31,7 +31,7 @@ var x = h("", f()); // Call should succeed and x should be string. All t >x : string >h("", f()) : string >h : (v: V, func: (v: V) => W) => W ->"" : string +>"" : "" >f() : (u: U) => U >f : () => (u: U) => U diff --git a/tests/baselines/reference/contextualTypeWithUnionTypeIndexSignatures.types b/tests/baselines/reference/contextualTypeWithUnionTypeIndexSignatures.types index 965e4d21d99..97c5f0fdf90 100644 --- a/tests/baselines/reference/contextualTypeWithUnionTypeIndexSignatures.types +++ b/tests/baselines/reference/contextualTypeWithUnionTypeIndexSignatures.types @@ -91,7 +91,7 @@ var x: IWithNoStringIndexSignature | IWithStringIndexSignature1 = { foo: "hello" >IWithStringIndexSignature1 : IWithStringIndexSignature1 >{ foo: "hello" } : { foo: string; } >foo : string ->"hello" : string +>"hello" : "hello" var x2: IWithStringIndexSignature1 | IWithStringIndexSignature2 = { z: a => a.toString() }; // a should be number >x2 : IWithStringIndexSignature1 | IWithStringIndexSignature2 @@ -143,7 +143,7 @@ var x3: IWithNoNumberIndexSignature | IWithNumberIndexSignature1 = { 0: "hello" >IWithNoNumberIndexSignature : IWithNoNumberIndexSignature >IWithNumberIndexSignature1 : IWithNumberIndexSignature1 >{ 0: "hello" } : { 0: string; } ->"hello" : string +>"hello" : "hello" var x4: IWithNumberIndexSignature1 | IWithNumberIndexSignature2 = { 1: a => a.toString() }; // a should be number >x4 : IWithNumberIndexSignature1 | IWithNumberIndexSignature2 diff --git a/tests/baselines/reference/contextualTypeWithUnionTypeMembers.types b/tests/baselines/reference/contextualTypeWithUnionTypeMembers.types index 8f2abf37e0e..3d13b94bc59 100644 --- a/tests/baselines/reference/contextualTypeWithUnionTypeMembers.types +++ b/tests/baselines/reference/contextualTypeWithUnionTypeMembers.types @@ -80,7 +80,7 @@ var i1Ori2: I1 | I2 = { // Like i1 commonPropertyType: "hello", >commonPropertyType : string ->"hello" : string +>"hello" : "hello" commonMethodType: a=> a, >commonMethodType : (a: string) => string @@ -102,7 +102,7 @@ var i1Ori2: I1 | I2 = { // Like i1 propertyOnlyInI1: "Hello", >propertyOnlyInI1 : string ->"Hello" : string +>"Hello" : "Hello" }; var i1Ori2: I1 | I2 = { // Like i2 @@ -113,7 +113,7 @@ var i1Ori2: I1 | I2 = { // Like i2 commonPropertyType: "hello", >commonPropertyType : string ->"hello" : string +>"hello" : "hello" commonMethodType: a=> a, >commonMethodType : (a: string) => string @@ -135,7 +135,7 @@ var i1Ori2: I1 | I2 = { // Like i2 propertyOnlyInI2: "Hello", >propertyOnlyInI2 : string ->"Hello" : string +>"Hello" : "Hello" }; var i1Ori2: I1 | I2 = { // Like i1 and i2 both @@ -146,7 +146,7 @@ var i1Ori2: I1 | I2 = { // Like i1 and i2 both commonPropertyType: "hello", >commonPropertyType : string ->"hello" : string +>"hello" : "hello" commonMethodType: a=> a, >commonMethodType : (a: string) => string @@ -168,7 +168,7 @@ var i1Ori2: I1 | I2 = { // Like i1 and i2 both propertyOnlyInI1: "Hello", >propertyOnlyInI1 : string ->"Hello" : string +>"Hello" : "Hello" methodOnlyInI2: a => a, >methodOnlyInI2 : (a: string) => string @@ -178,7 +178,7 @@ var i1Ori2: I1 | I2 = { // Like i1 and i2 both propertyOnlyInI2: "Hello", >propertyOnlyInI2 : string ->"Hello" : string +>"Hello" : "Hello" }; @@ -194,7 +194,7 @@ var arrayI1OrI2: Array | I2> = [i1, i2, { // Like i1 commonPropertyType: "hello", >commonPropertyType : string ->"hello" : string +>"hello" : "hello" commonMethodType: a=> a, >commonMethodType : (a: string) => string @@ -216,7 +216,7 @@ var arrayI1OrI2: Array | I2> = [i1, i2, { // Like i1 propertyOnlyInI1: "Hello", >propertyOnlyInI1 : string ->"Hello" : string +>"Hello" : "Hello" }, { // Like i2 @@ -224,7 +224,7 @@ var arrayI1OrI2: Array | I2> = [i1, i2, { // Like i1 commonPropertyType: "hello", >commonPropertyType : string ->"hello" : string +>"hello" : "hello" commonMethodType: a=> a, >commonMethodType : (a: string) => string @@ -246,14 +246,14 @@ var arrayI1OrI2: Array | I2> = [i1, i2, { // Like i1 propertyOnlyInI2: "Hello", >propertyOnlyInI2 : string ->"Hello" : string +>"Hello" : "Hello" }, { // Like i1 and i2 both >{ // Like i1 and i2 both commonPropertyType: "hello", commonMethodType: a=> a, commonMethodWithTypeParameter: a => a, methodOnlyInI1: a => a, propertyOnlyInI1: "Hello", methodOnlyInI2: a => a, propertyOnlyInI2: "Hello", } : { commonPropertyType: string; commonMethodType: (a: string) => string; commonMethodWithTypeParameter: (a: number) => number; methodOnlyInI1: (a: string) => string; propertyOnlyInI1: string; methodOnlyInI2: (a: string) => string; propertyOnlyInI2: string; } commonPropertyType: "hello", >commonPropertyType : string ->"hello" : string +>"hello" : "hello" commonMethodType: a=> a, >commonMethodType : (a: string) => string @@ -275,7 +275,7 @@ var arrayI1OrI2: Array | I2> = [i1, i2, { // Like i1 propertyOnlyInI1: "Hello", >propertyOnlyInI1 : string ->"Hello" : string +>"Hello" : "Hello" methodOnlyInI2: a => a, >methodOnlyInI2 : (a: string) => string @@ -285,7 +285,7 @@ var arrayI1OrI2: Array | I2> = [i1, i2, { // Like i1 propertyOnlyInI2: "Hello", >propertyOnlyInI2 : string ->"Hello" : string +>"Hello" : "Hello" }]; @@ -358,7 +358,7 @@ var i11Ori21: I11 | I21 = { }, commonPropertyDifferentType: "hello", >commonPropertyDifferentType : string ->"hello" : string +>"hello" : "hello" }; var i11Ori21: I11 | I21 = { @@ -388,7 +388,7 @@ var i11Ori21: I11 | I21 = { }, commonPropertyDifferentType: 10, >commonPropertyDifferentType : number ->10 : number +>10 : 10 }; var arrayOrI11OrI21: Array = [i11, i21, i11 || i21, { @@ -425,7 +425,7 @@ var arrayOrI11OrI21: Array = [i11, i21, i11 || i21, { }, commonPropertyDifferentType: "hello", >commonPropertyDifferentType : string ->"hello" : string +>"hello" : "hello" }, { >{ // Like i2 commonMethodDifferentReturnType: (a, b) => { var z = a.charCodeAt(b); return z; }, commonPropertyDifferentType: 10, } : { commonMethodDifferentReturnType: (a: string, b: number) => number; commonPropertyDifferentType: number; } @@ -451,6 +451,6 @@ var arrayOrI11OrI21: Array = [i11, i21, i11 || i21, { }, commonPropertyDifferentType: 10, >commonPropertyDifferentType : number ->10 : number +>10 : 10 }]; diff --git a/tests/baselines/reference/contextualTyping1.types b/tests/baselines/reference/contextualTyping1.types index 6b2a794f987..1f300311e94 100644 --- a/tests/baselines/reference/contextualTyping1.types +++ b/tests/baselines/reference/contextualTyping1.types @@ -4,5 +4,5 @@ var foo: {id:number;} = {id:4}; >id : number >{id:4} : { id: number; } >id : number ->4 : number +>4 : 4 diff --git a/tests/baselines/reference/contextualTyping10.types b/tests/baselines/reference/contextualTyping10.types index 938f2731a30..6379d6f82aa 100644 --- a/tests/baselines/reference/contextualTyping10.types +++ b/tests/baselines/reference/contextualTyping10.types @@ -6,8 +6,8 @@ class foo { public bar:{id:number;}[] = [{id:1}, {id:2}]; } >[{id:1}, {id:2}] : { id: number; }[] >{id:1} : { id: number; } >id : number ->1 : number +>1 : 1 >{id:2} : { id: number; } >id : number ->2 : number +>2 : 2 diff --git a/tests/baselines/reference/contextualTyping15.types b/tests/baselines/reference/contextualTyping15.types index ed4fdad3bfc..6d726c70642 100644 --- a/tests/baselines/reference/contextualTyping15.types +++ b/tests/baselines/reference/contextualTyping15.types @@ -4,5 +4,5 @@ class foo { public bar: { (): number; (i: number): number; } = function() { retu >bar : { (): number; (i: number): number; } >i : number >function() { return 1 } : () => number ->1 : number +>1 : 1 diff --git a/tests/baselines/reference/contextualTyping16.types b/tests/baselines/reference/contextualTyping16.types index 63f93649208..6eded1712c1 100644 --- a/tests/baselines/reference/contextualTyping16.types +++ b/tests/baselines/reference/contextualTyping16.types @@ -4,10 +4,10 @@ var foo: {id:number;} = {id:4}; foo = {id:5}; >id : number >{id:4} : { id: number; } >id : number ->4 : number +>4 : 4 >foo = {id:5} : { id: number; } >foo : { id: number; } >{id:5} : { id: number; } >id : number ->5 : number +>5 : 5 diff --git a/tests/baselines/reference/contextualTyping18.types b/tests/baselines/reference/contextualTyping18.types index 0bef546022d..3d5ee402828 100644 --- a/tests/baselines/reference/contextualTyping18.types +++ b/tests/baselines/reference/contextualTyping18.types @@ -10,5 +10,5 @@ var foo: {id:number;} = <{id:number;}>({ }); foo = {id: 5}; >foo : { id: number; } >{id: 5} : { id: number; } >id : number ->5 : number +>5 : 5 diff --git a/tests/baselines/reference/contextualTyping19.types b/tests/baselines/reference/contextualTyping19.types index d384a68749a..c5ad59fa61b 100644 --- a/tests/baselines/reference/contextualTyping19.types +++ b/tests/baselines/reference/contextualTyping19.types @@ -5,14 +5,14 @@ var foo:{id:number;}[] = [{id:1}]; foo = [{id:1}, {id:2}]; >[{id:1}] : { id: number; }[] >{id:1} : { id: number; } >id : number ->1 : number +>1 : 1 >foo = [{id:1}, {id:2}] : { id: number; }[] >foo : { id: number; }[] >[{id:1}, {id:2}] : { id: number; }[] >{id:1} : { id: number; } >id : number ->1 : number +>1 : 1 >{id:2} : { id: number; } >id : number ->2 : number +>2 : 2 diff --git a/tests/baselines/reference/contextualTyping23.types b/tests/baselines/reference/contextualTyping23.types index 0bb8b7a58e7..351ee51c28d 100644 --- a/tests/baselines/reference/contextualTyping23.types +++ b/tests/baselines/reference/contextualTyping23.types @@ -7,5 +7,5 @@ var foo:(a:{():number; (i:number):number; })=>number; foo = function(a){return 5 >foo : (a: { (): number; (i: number): number; }) => number >function(a){return 5} : (a: { (): number; (i: number): number; }) => number >a : { (): number; (i: number): number; } ->5 : number +>5 : 5 diff --git a/tests/baselines/reference/contextualTyping28.types b/tests/baselines/reference/contextualTyping28.types index e4833fd8838..bf246ce5b72 100644 --- a/tests/baselines/reference/contextualTyping28.types +++ b/tests/baselines/reference/contextualTyping28.types @@ -5,5 +5,5 @@ function foo(param:number[]){}; foo([1]); >foo([1]) : void >foo : (param: number[]) => void >[1] : number[] ->1 : number +>1 : 1 diff --git a/tests/baselines/reference/contextualTyping29.types b/tests/baselines/reference/contextualTyping29.types index 96695a6d0ba..ba96d77393c 100644 --- a/tests/baselines/reference/contextualTyping29.types +++ b/tests/baselines/reference/contextualTyping29.types @@ -5,6 +5,6 @@ function foo(param:number[]){}; foo([1, 3]); >foo([1, 3]) : void >foo : (param: number[]) => void >[1, 3] : number[] ->1 : number ->3 : number +>1 : 1 +>3 : 3 diff --git a/tests/baselines/reference/contextualTyping3.types b/tests/baselines/reference/contextualTyping3.types index 81c201ee572..c582cc0eb07 100644 --- a/tests/baselines/reference/contextualTyping3.types +++ b/tests/baselines/reference/contextualTyping3.types @@ -5,5 +5,5 @@ class foo { public bar:{id:number;} = {id:5}; } >id : number >{id:5} : { id: number; } >id : number ->5 : number +>5 : 5 diff --git a/tests/baselines/reference/contextualTyping31.types b/tests/baselines/reference/contextualTyping31.types index 22a8f08cf90..3b9da8bd434 100644 --- a/tests/baselines/reference/contextualTyping31.types +++ b/tests/baselines/reference/contextualTyping31.types @@ -5,5 +5,5 @@ function foo(param:number[]){}; foo([1]); >foo([1]) : void >foo : (param: number[]) => void >[1] : number[] ->1 : number +>1 : 1 diff --git a/tests/baselines/reference/contextualTyping32.types b/tests/baselines/reference/contextualTyping32.types index 59f6040cf7f..e6c6a72f546 100644 --- a/tests/baselines/reference/contextualTyping32.types +++ b/tests/baselines/reference/contextualTyping32.types @@ -7,7 +7,7 @@ function foo(param: {():number; (i:number):number; }[]) { }; foo([function(){ret >foo : (param: { (): number; (i: number): number; }[]) => void >[function(){return 1;}, function(){return 4}] : (() => number)[] >function(){return 1;} : () => number ->1 : number +>1 : 1 >function(){return 4} : () => number ->4 : number +>4 : 4 diff --git a/tests/baselines/reference/contextualTyping34.types b/tests/baselines/reference/contextualTyping34.types index 6bc6b622fc8..48dd3e41a66 100644 --- a/tests/baselines/reference/contextualTyping34.types +++ b/tests/baselines/reference/contextualTyping34.types @@ -6,5 +6,5 @@ var foo = <{ id: number;}> ({id:4}); >({id:4}) : { id: number; } >{id:4} : { id: number; } >id : number ->4 : number +>4 : 4 diff --git a/tests/baselines/reference/contextualTyping35.types b/tests/baselines/reference/contextualTyping35.types index 08bb6b27b8e..4465e0ca1a9 100644 --- a/tests/baselines/reference/contextualTyping35.types +++ b/tests/baselines/reference/contextualTyping35.types @@ -5,7 +5,7 @@ var foo = <{ id: number;}> {id:4, name: "as"}; >id : number >{id:4, name: "as"} : { id: number; name: string; } >id : number ->4 : number +>4 : 4 >name : string ->"as" : string +>"as" : "as" diff --git a/tests/baselines/reference/contextualTyping36.types b/tests/baselines/reference/contextualTyping36.types index 6c93ed30a9f..2cd07e33ee6 100644 --- a/tests/baselines/reference/contextualTyping36.types +++ b/tests/baselines/reference/contextualTyping36.types @@ -6,7 +6,7 @@ var foo = <{ id: number; }[]>[{ id: 4 }, <{ id: number; }>({ })]; >[{ id: 4 }, <{ id: number; }>({ })] : { id: number; }[] >{ id: 4 } : { id: number; } >id : number ->4 : number +>4 : 4 ><{ id: number; }>({ }) : { id: number; } >id : number >({ }) : {} diff --git a/tests/baselines/reference/contextualTyping37.types b/tests/baselines/reference/contextualTyping37.types index 8acd4aedf04..2f61262c9d1 100644 --- a/tests/baselines/reference/contextualTyping37.types +++ b/tests/baselines/reference/contextualTyping37.types @@ -6,6 +6,6 @@ var foo = <{ id: number; }[]>[{ foo: "s" }, { }]; >[{ foo: "s" }, { }] : ({ foo: string; } | {})[] >{ foo: "s" } : { foo: string; } >foo : string ->"s" : string +>"s" : "s" >{ } : {} diff --git a/tests/baselines/reference/contextualTyping40.types b/tests/baselines/reference/contextualTyping40.types index 1889d79f139..44e0c0f0a63 100644 --- a/tests/baselines/reference/contextualTyping40.types +++ b/tests/baselines/reference/contextualTyping40.types @@ -4,5 +4,5 @@ var foo = <{():number; (i:number):number; }> function(){return 1;}; ><{():number; (i:number):number; }> function(){return 1;} : { (): number; (i: number): number; } >i : number >function(){return 1;} : () => number ->1 : number +>1 : 1 diff --git a/tests/baselines/reference/contextualTyping6.types b/tests/baselines/reference/contextualTyping6.types index b79811a948a..222212bdbf4 100644 --- a/tests/baselines/reference/contextualTyping6.types +++ b/tests/baselines/reference/contextualTyping6.types @@ -5,8 +5,8 @@ var foo:{id:number;}[] = [{id:1}, {id:2}]; >[{id:1}, {id:2}] : { id: number; }[] >{id:1} : { id: number; } >id : number ->1 : number +>1 : 1 >{id:2} : { id: number; } >id : number ->2 : number +>2 : 2 diff --git a/tests/baselines/reference/contextualTypingOfConditionalExpression.types b/tests/baselines/reference/contextualTypingOfConditionalExpression.types index a2e29a0e66b..5712e7d581e 100644 --- a/tests/baselines/reference/contextualTypingOfConditionalExpression.types +++ b/tests/baselines/reference/contextualTypingOfConditionalExpression.types @@ -3,7 +3,7 @@ var x: (a: number) => void = true ? (a) => a.toExponential() : (b) => b.toFixed( >x : (a: number) => void >a : number >true ? (a) => a.toExponential() : (b) => b.toFixed() : (a: number) => string ->true : boolean +>true : true >(a) => a.toExponential() : (a: number) => string >a : number >a.toExponential() : string @@ -43,7 +43,7 @@ var x2: (a: A) => void = true ? (a) => a.foo : (b) => b.foo; >a : A >A : A >true ? (a) => a.foo : (b) => b.foo : (a: A) => number ->true : boolean +>true : true >(a) => a.foo : (a: A) => number >a : A >a.foo : number diff --git a/tests/baselines/reference/contextualTypingOfObjectLiterals.types b/tests/baselines/reference/contextualTypingOfObjectLiterals.types index a99fb2f39af..19189e32245 100644 --- a/tests/baselines/reference/contextualTypingOfObjectLiterals.types +++ b/tests/baselines/reference/contextualTypingOfObjectLiterals.types @@ -7,7 +7,7 @@ var obj2 = {x: ""}; >obj2 : { x: string; } >{x: ""} : { x: string; } >x : string ->"" : string +>"" : "" obj1 = {}; // Ok >obj1 = {} : {} diff --git a/tests/baselines/reference/contextualTypingWithFixedTypeParameters1.errors.txt b/tests/baselines/reference/contextualTypingWithFixedTypeParameters1.errors.txt index 251a3a1bde3..95b3c66c264 100644 --- a/tests/baselines/reference/contextualTypingWithFixedTypeParameters1.errors.txt +++ b/tests/baselines/reference/contextualTypingWithFixedTypeParameters1.errors.txt @@ -1,6 +1,6 @@ tests/cases/compiler/contextualTypingWithFixedTypeParameters1.ts(2,22): error TS2339: Property 'foo' does not exist on type 'string'. tests/cases/compiler/contextualTypingWithFixedTypeParameters1.ts(3,32): error TS2339: Property 'foo' does not exist on type 'string'. -tests/cases/compiler/contextualTypingWithFixedTypeParameters1.ts(3,38): error TS2345: Argument of type 'number' is not assignable to parameter of type 'string'. +tests/cases/compiler/contextualTypingWithFixedTypeParameters1.ts(3,38): error TS2345: Argument of type '1' is not assignable to parameter of type 'string'. ==== tests/cases/compiler/contextualTypingWithFixedTypeParameters1.ts (3 errors) ==== @@ -12,4 +12,4 @@ tests/cases/compiler/contextualTypingWithFixedTypeParameters1.ts(3,38): error TS ~~~ !!! error TS2339: Property 'foo' does not exist on type 'string'. ~ -!!! error TS2345: Argument of type 'number' is not assignable to parameter of type 'string'. \ No newline at end of file +!!! error TS2345: Argument of type '1' is not assignable to parameter of type 'string'. \ No newline at end of file diff --git a/tests/baselines/reference/contextuallyTypeCommaOperator01.types b/tests/baselines/reference/contextuallyTypeCommaOperator01.types index c3b7b700d64..05516949210 100644 --- a/tests/baselines/reference/contextuallyTypeCommaOperator01.types +++ b/tests/baselines/reference/contextuallyTypeCommaOperator01.types @@ -9,7 +9,7 @@ x = (100, a => a); >x : (a: string) => string >(100, a => a) : (a: string) => string >100, a => a : (a: string) => string ->100 : number +>100 : 100 >a => a : (a: string) => string >a : string >a : string diff --git a/tests/baselines/reference/contextuallyTypeLogicalAnd01.types b/tests/baselines/reference/contextuallyTypeLogicalAnd01.types index a405888c8a9..e55e1e4b511 100644 --- a/tests/baselines/reference/contextuallyTypeLogicalAnd01.types +++ b/tests/baselines/reference/contextuallyTypeLogicalAnd01.types @@ -6,13 +6,13 @@ let x: (a: string) => string; let y = true; >y : boolean ->true : boolean +>true : true x = y && (a => a); >x = y && (a => a) : (a: string) => string >x : (a: string) => string >y && (a => a) : (a: string) => string ->y : boolean +>y : true >(a => a) : (a: string) => string >a => a : (a: string) => string >a : string diff --git a/tests/baselines/reference/contextuallyTypedBindingInitializer.types b/tests/baselines/reference/contextuallyTypedBindingInitializer.types index 0d4dfcdd5d9..e9624b156c7 100644 --- a/tests/baselines/reference/contextuallyTypedBindingInitializer.types +++ b/tests/baselines/reference/contextuallyTypedBindingInitializer.types @@ -30,7 +30,7 @@ function f2({ "show": showRename = v => v.toString() }: Show) {} function f3({ ["show"]: showRename = v => v.toString() }: Show) {} >f3 : ({["show"]: showRename}: Show) => void ->"show" : string +>"show" : "show" >showRename : (x: number) => string >v => v.toString() : (v: number) => string >v : number @@ -70,8 +70,8 @@ function g({ prop = ["hello", 1234] }: Tuples) {} >g : ({prop}: Tuples) => void >prop : [string, number] >["hello", 1234] : [string, number] ->"hello" : string ->1234 : number +>"hello" : "hello" +>1234 : 1234 >Tuples : Tuples interface StringUnion { diff --git a/tests/baselines/reference/contextuallyTypedBindingInitializerNegative.errors.txt b/tests/baselines/reference/contextuallyTypedBindingInitializerNegative.errors.txt deleted file mode 100644 index 447ccec5ddf..00000000000 --- a/tests/baselines/reference/contextuallyTypedBindingInitializerNegative.errors.txt +++ /dev/null @@ -1,67 +0,0 @@ -tests/cases/conformance/types/contextualTypes/methodDeclarations/contextuallyTypedBindingInitializerNegative.ts(4,20): error TS2322: Type '(v: number) => number' is not assignable to type '(x: number) => string'. - Type 'number' is not assignable to type 'string'. -tests/cases/conformance/types/contextualTypes/methodDeclarations/contextuallyTypedBindingInitializerNegative.ts(5,23): error TS2322: Type '(v: number) => number' is not assignable to type '(x: number) => string'. - Type 'number' is not assignable to type 'string'. -tests/cases/conformance/types/contextualTypes/methodDeclarations/contextuallyTypedBindingInitializerNegative.ts(6,25): error TS2322: Type '(v: number) => number' is not assignable to type '(x: number) => string'. - Type 'number' is not assignable to type 'string'. -tests/cases/conformance/types/contextualTypes/methodDeclarations/contextuallyTypedBindingInitializerNegative.ts(11,23): error TS2322: Type '{ show: (v: number) => number; }' is not assignable to type 'Show'. - Types of property 'show' are incompatible. - Type '(v: number) => number' is not assignable to type '(x: number) => string'. - Type 'number' is not assignable to type 'string'. -tests/cases/conformance/types/contextualTypes/methodDeclarations/contextuallyTypedBindingInitializerNegative.ts(16,23): error TS2322: Type '(arg: string) => number' is not assignable to type '(s: string) => string'. - Type 'number' is not assignable to type 'string'. -tests/cases/conformance/types/contextualTypes/methodDeclarations/contextuallyTypedBindingInitializerNegative.ts(21,14): error TS2322: Type '[number, number]' is not assignable to type '[string, number]'. - Type 'number' is not assignable to type 'string'. -tests/cases/conformance/types/contextualTypes/methodDeclarations/contextuallyTypedBindingInitializerNegative.ts(26,14): error TS2322: Type '"baz"' is not assignable to type '"foo" | "bar"'. - - -==== tests/cases/conformance/types/contextualTypes/methodDeclarations/contextuallyTypedBindingInitializerNegative.ts (7 errors) ==== - interface Show { - show: (x: number) => string; - } - function f({ show: showRename = v => v }: Show) {} - ~~~~~~~~~~ -!!! error TS2322: Type '(v: number) => number' is not assignable to type '(x: number) => string'. -!!! error TS2322: Type 'number' is not assignable to type 'string'. - function f2({ "show": showRename = v => v }: Show) {} - ~~~~~~~~~~ -!!! error TS2322: Type '(v: number) => number' is not assignable to type '(x: number) => string'. -!!! error TS2322: Type 'number' is not assignable to type 'string'. - function f3({ ["show"]: showRename = v => v }: Show) {} - ~~~~~~~~~~ -!!! error TS2322: Type '(v: number) => number' is not assignable to type '(x: number) => string'. -!!! error TS2322: Type 'number' is not assignable to type 'string'. - - interface Nested { - nested: Show - } - function ff({ nested: nestedRename = { show: v => v } }: Nested) {} - ~~~~~~~~~~~~ -!!! error TS2322: Type '{ show: (v: number) => number; }' is not assignable to type 'Show'. -!!! error TS2322: Types of property 'show' are incompatible. -!!! error TS2322: Type '(v: number) => number' is not assignable to type '(x: number) => string'. -!!! error TS2322: Type 'number' is not assignable to type 'string'. - - interface StringIdentity { - stringIdentity(s: string): string; - } - let { stringIdentity: id = arg => arg.length }: StringIdentity = { stringIdentity: x => x}; - ~~ -!!! error TS2322: Type '(arg: string) => number' is not assignable to type '(s: string) => string'. -!!! error TS2322: Type 'number' is not assignable to type 'string'. - - interface Tuples { - prop: [string, number]; - } - function g({ prop = [101, 1234] }: Tuples) {} - ~~~~ -!!! error TS2322: Type '[number, number]' is not assignable to type '[string, number]'. -!!! error TS2322: Type 'number' is not assignable to type 'string'. - - interface StringUnion { - prop: "foo" | "bar"; - } - function h({ prop = "baz" }: StringUnion) {} - ~~~~ -!!! error TS2322: Type '"baz"' is not assignable to type '"foo" | "bar"'. - \ No newline at end of file diff --git a/tests/baselines/reference/contextuallyTypedBindingInitializerNegative.symbols b/tests/baselines/reference/contextuallyTypedBindingInitializerNegative.symbols new file mode 100644 index 00000000000..a9013e7f98e --- /dev/null +++ b/tests/baselines/reference/contextuallyTypedBindingInitializerNegative.symbols @@ -0,0 +1,88 @@ +=== tests/cases/conformance/types/contextualTypes/methodDeclarations/contextuallyTypedBindingInitializerNegative.ts === +interface Show { +>Show : Symbol(Show, Decl(contextuallyTypedBindingInitializerNegative.ts, 0, 0)) + + show: (x: number) => string; +>show : Symbol(Show.show, Decl(contextuallyTypedBindingInitializerNegative.ts, 0, 16)) +>x : Symbol(x, Decl(contextuallyTypedBindingInitializerNegative.ts, 1, 11)) +} +function f({ show: showRename = v => v }: Show) {} +>f : Symbol(f, Decl(contextuallyTypedBindingInitializerNegative.ts, 2, 1)) +>show : Symbol(Show.show, Decl(contextuallyTypedBindingInitializerNegative.ts, 0, 16)) +>showRename : Symbol(showRename, Decl(contextuallyTypedBindingInitializerNegative.ts, 3, 12)) +>v : Symbol(v, Decl(contextuallyTypedBindingInitializerNegative.ts, 3, 31)) +>v : Symbol(v, Decl(contextuallyTypedBindingInitializerNegative.ts, 3, 31)) +>Show : Symbol(Show, Decl(contextuallyTypedBindingInitializerNegative.ts, 0, 0)) + +function f2({ "show": showRename = v => v }: Show) {} +>f2 : Symbol(f2, Decl(contextuallyTypedBindingInitializerNegative.ts, 3, 50)) +>showRename : Symbol(showRename, Decl(contextuallyTypedBindingInitializerNegative.ts, 4, 13)) +>v : Symbol(v, Decl(contextuallyTypedBindingInitializerNegative.ts, 4, 34)) +>v : Symbol(v, Decl(contextuallyTypedBindingInitializerNegative.ts, 4, 34)) +>Show : Symbol(Show, Decl(contextuallyTypedBindingInitializerNegative.ts, 0, 0)) + +function f3({ ["show"]: showRename = v => v }: Show) {} +>f3 : Symbol(f3, Decl(contextuallyTypedBindingInitializerNegative.ts, 4, 53)) +>"show" : Symbol(showRename, Decl(contextuallyTypedBindingInitializerNegative.ts, 5, 13)) +>showRename : Symbol(showRename, Decl(contextuallyTypedBindingInitializerNegative.ts, 5, 13)) +>v : Symbol(v, Decl(contextuallyTypedBindingInitializerNegative.ts, 5, 36)) +>v : Symbol(v, Decl(contextuallyTypedBindingInitializerNegative.ts, 5, 36)) +>Show : Symbol(Show, Decl(contextuallyTypedBindingInitializerNegative.ts, 0, 0)) + +interface Nested { +>Nested : Symbol(Nested, Decl(contextuallyTypedBindingInitializerNegative.ts, 5, 55)) + + nested: Show +>nested : Symbol(Nested.nested, Decl(contextuallyTypedBindingInitializerNegative.ts, 7, 18)) +>Show : Symbol(Show, Decl(contextuallyTypedBindingInitializerNegative.ts, 0, 0)) +} +function ff({ nested: nestedRename = { show: v => v } }: Nested) {} +>ff : Symbol(ff, Decl(contextuallyTypedBindingInitializerNegative.ts, 9, 1)) +>nested : Symbol(Nested.nested, Decl(contextuallyTypedBindingInitializerNegative.ts, 7, 18)) +>nestedRename : Symbol(nestedRename, Decl(contextuallyTypedBindingInitializerNegative.ts, 10, 13)) +>show : Symbol(show, Decl(contextuallyTypedBindingInitializerNegative.ts, 10, 38)) +>v : Symbol(v, Decl(contextuallyTypedBindingInitializerNegative.ts, 10, 44)) +>v : Symbol(v, Decl(contextuallyTypedBindingInitializerNegative.ts, 10, 44)) +>Nested : Symbol(Nested, Decl(contextuallyTypedBindingInitializerNegative.ts, 5, 55)) + +interface StringIdentity { +>StringIdentity : Symbol(StringIdentity, Decl(contextuallyTypedBindingInitializerNegative.ts, 10, 67)) + + stringIdentity(s: string): string; +>stringIdentity : Symbol(StringIdentity.stringIdentity, Decl(contextuallyTypedBindingInitializerNegative.ts, 12, 26)) +>s : Symbol(s, Decl(contextuallyTypedBindingInitializerNegative.ts, 13, 19)) +} +let { stringIdentity: id = arg => arg.length }: StringIdentity = { stringIdentity: x => x}; +>stringIdentity : Symbol(StringIdentity.stringIdentity, Decl(contextuallyTypedBindingInitializerNegative.ts, 12, 26)) +>id : Symbol(id, Decl(contextuallyTypedBindingInitializerNegative.ts, 15, 5)) +>arg : Symbol(arg, Decl(contextuallyTypedBindingInitializerNegative.ts, 15, 26)) +>arg.length : Symbol(String.length, Decl(lib.d.ts, --, --)) +>arg : Symbol(arg, Decl(contextuallyTypedBindingInitializerNegative.ts, 15, 26)) +>length : Symbol(String.length, Decl(lib.d.ts, --, --)) +>StringIdentity : Symbol(StringIdentity, Decl(contextuallyTypedBindingInitializerNegative.ts, 10, 67)) +>stringIdentity : Symbol(stringIdentity, Decl(contextuallyTypedBindingInitializerNegative.ts, 15, 66)) +>x : Symbol(x, Decl(contextuallyTypedBindingInitializerNegative.ts, 15, 82)) +>x : Symbol(x, Decl(contextuallyTypedBindingInitializerNegative.ts, 15, 82)) + +interface Tuples { +>Tuples : Symbol(Tuples, Decl(contextuallyTypedBindingInitializerNegative.ts, 15, 91)) + + prop: [string, number]; +>prop : Symbol(Tuples.prop, Decl(contextuallyTypedBindingInitializerNegative.ts, 17, 18)) +} +function g({ prop = [101, 1234] }: Tuples) {} +>g : Symbol(g, Decl(contextuallyTypedBindingInitializerNegative.ts, 19, 1)) +>prop : Symbol(prop, Decl(contextuallyTypedBindingInitializerNegative.ts, 20, 12)) +>Tuples : Symbol(Tuples, Decl(contextuallyTypedBindingInitializerNegative.ts, 15, 91)) + +interface StringUnion { +>StringUnion : Symbol(StringUnion, Decl(contextuallyTypedBindingInitializerNegative.ts, 20, 45)) + + prop: "foo" | "bar"; +>prop : Symbol(StringUnion.prop, Decl(contextuallyTypedBindingInitializerNegative.ts, 22, 23)) +} +function h({ prop = "baz" }: StringUnion) {} +>h : Symbol(h, Decl(contextuallyTypedBindingInitializerNegative.ts, 24, 1)) +>prop : Symbol(prop, Decl(contextuallyTypedBindingInitializerNegative.ts, 25, 12)) +>StringUnion : Symbol(StringUnion, Decl(contextuallyTypedBindingInitializerNegative.ts, 20, 45)) + diff --git a/tests/baselines/reference/contextuallyTypedBindingInitializerNegative.types b/tests/baselines/reference/contextuallyTypedBindingInitializerNegative.types new file mode 100644 index 00000000000..5adc82c3e62 --- /dev/null +++ b/tests/baselines/reference/contextuallyTypedBindingInitializerNegative.types @@ -0,0 +1,100 @@ +=== tests/cases/conformance/types/contextualTypes/methodDeclarations/contextuallyTypedBindingInitializerNegative.ts === +interface Show { +>Show : Show + + show: (x: number) => string; +>show : (x: number) => string +>x : number +} +function f({ show: showRename = v => v }: Show) {} +>f : ({show: showRename}: Show) => void +>show : any +>showRename : ((x: number) => string) | ((v: number) => number) +>v => v : (v: number) => number +>v : number +>v : number +>Show : Show + +function f2({ "show": showRename = v => v }: Show) {} +>f2 : ({"show": showRename}: Show) => void +>showRename : ((x: number) => string) | ((v: number) => number) +>v => v : (v: number) => number +>v : number +>v : number +>Show : Show + +function f3({ ["show"]: showRename = v => v }: Show) {} +>f3 : ({["show"]: showRename}: Show) => void +>"show" : "show" +>showRename : ((x: number) => string) | ((v: number) => number) +>v => v : (v: number) => number +>v : number +>v : number +>Show : Show + +interface Nested { +>Nested : Nested + + nested: Show +>nested : Show +>Show : Show +} +function ff({ nested: nestedRename = { show: v => v } }: Nested) {} +>ff : ({nested: nestedRename}: Nested) => void +>nested : any +>nestedRename : Show | { show: (v: number) => number; } +>{ show: v => v } : { show: (v: number) => number; } +>show : (v: number) => number +>v => v : (v: number) => number +>v : number +>v : number +>Nested : Nested + +interface StringIdentity { +>StringIdentity : StringIdentity + + stringIdentity(s: string): string; +>stringIdentity : (s: string) => string +>s : string +} +let { stringIdentity: id = arg => arg.length }: StringIdentity = { stringIdentity: x => x}; +>stringIdentity : any +>id : ((s: string) => string) | ((arg: string) => number) +>arg => arg.length : (arg: string) => number +>arg : string +>arg.length : number +>arg : string +>length : number +>StringIdentity : StringIdentity +>{ stringIdentity: x => x} : { stringIdentity: (x: string) => string; } +>stringIdentity : (x: string) => string +>x => x : (x: string) => string +>x : string +>x : string + +interface Tuples { +>Tuples : Tuples + + prop: [string, number]; +>prop : [string, number] +} +function g({ prop = [101, 1234] }: Tuples) {} +>g : ({prop}: Tuples) => void +>prop : [string, number] | [number, number] +>[101, 1234] : [number, number] +>101 : 101 +>1234 : 1234 +>Tuples : Tuples + +interface StringUnion { +>StringUnion : StringUnion + + prop: "foo" | "bar"; +>prop : "foo" | "bar" +} +function h({ prop = "baz" }: StringUnion) {} +>h : ({prop}: StringUnion) => void +>prop : "foo" | "bar" | "baz" +>"baz" : "baz" +>StringUnion : StringUnion + diff --git a/tests/baselines/reference/contextuallyTypedFunctionExpressionsAndReturnAnnotations.types b/tests/baselines/reference/contextuallyTypedFunctionExpressionsAndReturnAnnotations.types index 94b184f65da..7fc2f88f326 100644 --- a/tests/baselines/reference/contextuallyTypedFunctionExpressionsAndReturnAnnotations.types +++ b/tests/baselines/reference/contextuallyTypedFunctionExpressionsAndReturnAnnotations.types @@ -19,7 +19,7 @@ foo((y): (y2: number) => void => { >y.charAt : (pos: number) => string >y : string >charAt : (pos: number) => string ->0 : number +>0 : 0 return null; >null : null @@ -44,7 +44,7 @@ foo((y: string) => { >toFixed : (fractionDigits?: number) => string return 0; ->0 : number +>0 : 0 }; }); diff --git a/tests/baselines/reference/contextuallyTypedIife.types b/tests/baselines/reference/contextuallyTypedIife.types index 8777e3cef3f..ca0f7f2a508 100644 --- a/tests/baselines/reference/contextuallyTypedIife.types +++ b/tests/baselines/reference/contextuallyTypedIife.types @@ -5,7 +5,7 @@ >(jake => { }) : (jake: string) => void >jake => { } : (jake: string) => void >jake : string ->"build" : string +>"build" : "build" // function expression (function (cats) { })("lol"); @@ -13,7 +13,7 @@ >(function (cats) { }) : (cats: string) => void >function (cats) { } : (cats: string) => void >cats : string ->"lol" : string +>"lol" : "lol" // Lots of Irritating Superfluous Parentheses (function (x) { } ("!")); @@ -21,7 +21,7 @@ >function (x) { } ("!") : void >function (x) { } : (x: string) => void >x : string ->"!" : string +>"!" : "!" ((((function (y) { }))))("-"); >((((function (y) { }))))("-") : void @@ -31,7 +31,7 @@ >(function (y) { }) : (y: string) => void >function (y) { } : (y: string) => void >y : string ->"-" : string +>"-" : "-" // multiple arguments ((a, b, c) => { })("foo", 101, false); @@ -41,9 +41,9 @@ >a : string >b : number >c : boolean ->"foo" : string ->101 : number ->false : boolean +>"foo" : "foo" +>101 : 101 +>false : false // default parameters ((m = 10) => m + 1)(12); @@ -51,21 +51,21 @@ >((m = 10) => m + 1) : (m?: number) => number >(m = 10) => m + 1 : (m?: number) => number >m : number ->10 : number +>10 : 10 >m + 1 : number >m : number ->1 : number ->12 : number +>1 : 1 +>12 : 12 ((n = 10) => n + 1)(); >((n = 10) => n + 1)() : number >((n = 10) => n + 1) : (n?: number) => number >(n = 10) => n + 1 : (n?: number) => number >n : number ->10 : number +>10 : 10 >n + 1 : number >n : number ->1 : number +>1 : 1 // optional parameters ((j?) => j + 1)(12); @@ -75,8 +75,8 @@ >j : number >j + 1 : number >j : number ->1 : number ->12 : number +>1 : 1 +>12 : 12 ((k?) => k + 1)(); >((k?) => k + 1)() : any @@ -85,7 +85,7 @@ >k : any >k + 1 : any >k : any ->1 : number +>1 : 1 ((l, o?) => l + o)(12); // o should be any >((l, o?) => l + o)(12) : any @@ -96,7 +96,7 @@ >l + o : any >l : number >o : any ->12 : number +>12 : 12 // rest parameters ((...numbers) => numbers.every(n => n > 0))(5,6,7); @@ -112,10 +112,10 @@ >n : number >n > 0 : boolean >n : number ->0 : number ->5 : number ->6 : number ->7 : number +>0 : 0 +>5 : 5 +>6 : 6 +>7 : 7 ((...mixed) => mixed.every(n => !!n))(5,'oops','oh no'); >((...mixed) => mixed.every(n => !!n))(5,'oops','oh no') : boolean @@ -131,9 +131,9 @@ >!!n : boolean >!n : boolean >n : string | number ->5 : number ->'oops' : string ->'oh no' : string +>5 : 5 +>'oops' : "oops" +>'oh no' : "oh no" ((...noNumbers) => noNumbers.some(n => n > 0))(); >((...noNumbers) => noNumbers.some(n => n > 0))() : boolean @@ -148,7 +148,7 @@ >n : any >n > 0 : boolean >n : any ->0 : number +>0 : 0 ((first, ...rest) => first ? [] : rest.map(n => n > 0))(8,9,10); >((first, ...rest) => first ? [] : rest.map(n => n > 0))(8,9,10) : boolean[] @@ -167,10 +167,10 @@ >n : number >n > 0 : boolean >n : number ->0 : number ->8 : number ->9 : number ->10 : number +>0 : 0 +>8 : 8 +>9 : 9 +>10 : 10 // destructuring parameters (with defaults too!) (({ q }) => q)({ q : 13 }); @@ -181,42 +181,42 @@ >q : number >{ q : 13 } : { q: number; } >q : number ->13 : number +>13 : 13 (({ p = 14 }) => p)({ p : 15 }); >(({ p = 14 }) => p)({ p : 15 }) : number >(({ p = 14 }) => p) : ({p}: { p: number; }) => number >({ p = 14 }) => p : ({p}: { p: number; }) => number >p : number ->14 : number +>14 : 14 >p : number >{ p : 15 } : { p: number; } >p : number ->15 : number +>15 : 15 (({ r = 17 } = { r: 18 }) => r)({r : 19}); >(({ r = 17 } = { r: 18 }) => r)({r : 19}) : number >(({ r = 17 } = { r: 18 }) => r) : ({r}?: { r: number; }) => number >({ r = 17 } = { r: 18 }) => r : ({r}?: { r: number; }) => number >r : number ->17 : number +>17 : 17 >{ r: 18 } : { r: number; } >r : number ->18 : number +>18 : 18 >r : number >{r : 19} : { r: number; } >r : number ->19 : number +>19 : 19 (({ u = 22 } = { u: 23 }) => u)(); >(({ u = 22 } = { u: 23 }) => u)() : number >(({ u = 22 } = { u: 23 }) => u) : ({u}?: { u?: number; }) => number >({ u = 22 } = { u: 23 }) => u : ({u}?: { u?: number; }) => number >u : number ->22 : number +>22 : 22 >{ u: 23 } : { u?: number; } >u : number ->23 : number +>23 : 23 >u : number // contextually typed parameters. @@ -228,7 +228,7 @@ let twelve = (f => f(12))(i => i); >f : (i: any) => any >f(12) : any >f : (i: any) => any ->12 : number +>12 : 12 >i => i : (i: any) => any >i : any >i : any @@ -243,7 +243,7 @@ let eleven = (o => o.a(11))({ a: function(n) { return n; } }); >o.a : (n: any) => any >o : { a: (n: any) => any; } >a : (n: any) => any ->11 : number +>11 : 11 >{ a: function(n) { return n; } } : { a: (n: any) => any; } >a : (n: any) => any >function(n) { return n; } : (n: any) => any diff --git a/tests/baselines/reference/contextuallyTypedObjectLiteralMethodDeclaration01.types b/tests/baselines/reference/contextuallyTypedObjectLiteralMethodDeclaration01.types index dcb25792fe0..5335cc4f81f 100644 --- a/tests/baselines/reference/contextuallyTypedObjectLiteralMethodDeclaration01.types +++ b/tests/baselines/reference/contextuallyTypedObjectLiteralMethodDeclaration01.types @@ -40,11 +40,11 @@ function getFoo1(): Foo { >arg : A arg.numProp = 10; ->arg.numProp = 10 : number +>arg.numProp = 10 : 10 >arg.numProp : number >arg : A >numProp : number ->10 : number +>10 : 10 }, method2(arg) { @@ -52,11 +52,11 @@ function getFoo1(): Foo { >arg : B arg.strProp = "hello"; ->arg.strProp = "hello" : string +>arg.strProp = "hello" : "hello" >arg.strProp : string >arg : B >strProp : string ->"hello" : string +>"hello" : "hello" } } } @@ -74,11 +74,11 @@ function getFoo2(): Foo { >arg : A arg.numProp = 10; ->arg.numProp = 10 : number +>arg.numProp = 10 : 10 >arg.numProp : number >arg : A >numProp : number ->10 : number +>10 : 10 }, method2: (arg) => { @@ -87,11 +87,11 @@ function getFoo2(): Foo { >arg : B arg.strProp = "hello"; ->arg.strProp = "hello" : string +>arg.strProp = "hello" : "hello" >arg.strProp : string >arg : B >strProp : string ->"hello" : string +>"hello" : "hello" } } } @@ -109,11 +109,11 @@ function getFoo3(): Foo { >arg : A arg.numProp = 10; ->arg.numProp = 10 : number +>arg.numProp = 10 : 10 >arg.numProp : number >arg : A >numProp : number ->10 : number +>10 : 10 }, method2: function (arg) { @@ -122,11 +122,11 @@ function getFoo3(): Foo { >arg : B arg.strProp = "hello"; ->arg.strProp = "hello" : string +>arg.strProp = "hello" : "hello" >arg.strProp : string >arg : B >strProp : string ->"hello" : string +>"hello" : "hello" } } } diff --git a/tests/baselines/reference/contextuallyTypingOrOperator.types b/tests/baselines/reference/contextuallyTypingOrOperator.types index 676ad04bfa9..3ca4ff4ee8f 100644 --- a/tests/baselines/reference/contextuallyTypingOrOperator.types +++ b/tests/baselines/reference/contextuallyTypingOrOperator.types @@ -15,7 +15,7 @@ var v: { a: (_: string) => number } = { a: s => s.length } || { a: s => 1 }; >a : (s: string) => number >s => 1 : (s: string) => number >s : string ->1 : number +>1 : 1 var v2 = (s: string) => s.length || function (s) { s.length }; >v2 : (s: string) => number | ((s: any) => void) @@ -41,14 +41,14 @@ var v3 = (s: string) => s.length || function (s: number) { return 1 }; >length : number >function (s: number) { return 1 } : (s: number) => number >s : number ->1 : number +>1 : 1 var v4 = (s: number) => 1 || function (s: string) { return s.length }; ->v4 : (s: number) => number | ((s: string) => number) ->(s: number) => 1 || function (s: string) { return s.length } : (s: number) => number | ((s: string) => number) +>v4 : (s: number) => 1 | ((s: string) => number) +>(s: number) => 1 || function (s: string) { return s.length } : (s: number) => 1 | ((s: string) => number) >s : number ->1 || function (s: string) { return s.length } : number | ((s: string) => number) ->1 : number +>1 || function (s: string) { return s.length } : 1 | ((s: string) => number) +>1 : 1 >function (s: string) { return s.length } : (s: string) => number >s : string >s.length : number diff --git a/tests/baselines/reference/contextuallyTypingOrOperator2.types b/tests/baselines/reference/contextuallyTypingOrOperator2.types index 2a73ccc9c9d..f72e6f3e92e 100644 --- a/tests/baselines/reference/contextuallyTypingOrOperator2.types +++ b/tests/baselines/reference/contextuallyTypingOrOperator2.types @@ -15,7 +15,7 @@ var v: { a: (_: string) => number } = { a: s => s.length } || { a: s => 1 }; >a : (s: string) => number >s => 1 : (s: string) => number >s : string ->1 : number +>1 : 1 var v2 = (s: string) => s.length || function (s) { s.aaa }; >v2 : (s: string) => number | ((s: any) => void) diff --git a/tests/baselines/reference/continueInIterationStatement1.types b/tests/baselines/reference/continueInIterationStatement1.types index 4fcf3794844..a61ec004fba 100644 --- a/tests/baselines/reference/continueInIterationStatement1.types +++ b/tests/baselines/reference/continueInIterationStatement1.types @@ -1,6 +1,6 @@ === tests/cases/compiler/continueInIterationStatement1.ts === while (true) { ->true : boolean +>true : true continue; } diff --git a/tests/baselines/reference/continueInIterationStatement2.types b/tests/baselines/reference/continueInIterationStatement2.types index 4a3d50c7501..59d7b88cc59 100644 --- a/tests/baselines/reference/continueInIterationStatement2.types +++ b/tests/baselines/reference/continueInIterationStatement2.types @@ -3,5 +3,5 @@ do { continue; } while (true); ->true : boolean +>true : true diff --git a/tests/baselines/reference/continueInLoopsWithCapturedBlockScopedBindings1.types b/tests/baselines/reference/continueInLoopsWithCapturedBlockScopedBindings1.types index 885b67d4140..4ccf96ad624 100644 --- a/tests/baselines/reference/continueInLoopsWithCapturedBlockScopedBindings1.types +++ b/tests/baselines/reference/continueInLoopsWithCapturedBlockScopedBindings1.types @@ -5,8 +5,8 @@ function foo() { for (const i of [0, 1]) { >i : number >[0, 1] : number[] ->0 : number ->1 : number +>0 : 0 +>1 : 1 if (i === 0) { >i === 0 : boolean diff --git a/tests/baselines/reference/continueLabel.types b/tests/baselines/reference/continueLabel.types index a25f3311607..788133b337b 100644 --- a/tests/baselines/reference/continueLabel.types +++ b/tests/baselines/reference/continueLabel.types @@ -2,10 +2,10 @@ label1: for(var i = 0; i < 1; i++) { >label1 : any >i : number ->0 : number +>0 : 0 >i < 1 : boolean >i : number ->1 : number +>1 : 1 >i++ : number >i : number diff --git a/tests/baselines/reference/continueTarget2.types b/tests/baselines/reference/continueTarget2.types index 1e9a2325642..5b8fc5a01d2 100644 --- a/tests/baselines/reference/continueTarget2.types +++ b/tests/baselines/reference/continueTarget2.types @@ -3,7 +3,7 @@ target: >target : any while (true) { ->true : boolean +>true : true continue target; >target : any diff --git a/tests/baselines/reference/continueTarget3.types b/tests/baselines/reference/continueTarget3.types index d55f1c3f6d2..502c406b05f 100644 --- a/tests/baselines/reference/continueTarget3.types +++ b/tests/baselines/reference/continueTarget3.types @@ -7,7 +7,7 @@ target2: >target2 : any while (true) { ->true : boolean +>true : true continue target1; >target1 : any diff --git a/tests/baselines/reference/continueTarget4.types b/tests/baselines/reference/continueTarget4.types index e3e3ae82dfe..e07208ccc10 100644 --- a/tests/baselines/reference/continueTarget4.types +++ b/tests/baselines/reference/continueTarget4.types @@ -7,7 +7,7 @@ target2: >target2 : any while (true) { ->true : boolean +>true : true continue target2; >target2 : any diff --git a/tests/baselines/reference/controlFlowAssignmentExpression.types b/tests/baselines/reference/controlFlowAssignmentExpression.types index 107fb4cb332..4cc2c52cc1b 100644 --- a/tests/baselines/reference/controlFlowAssignmentExpression.types +++ b/tests/baselines/reference/controlFlowAssignmentExpression.types @@ -6,9 +6,9 @@ let obj: any; >obj : any x = ""; ->x = "" : string +>x = "" : "" >x : string | number | boolean ->"" : string +>"" : "" x = x.length; >x = x.length : number @@ -21,18 +21,18 @@ x; // number >x : number x = true; ->x = true : boolean +>x = true : true >x : string | number | boolean ->true : boolean +>true : true (x = "", obj).foo = (x = x.length); >(x = "", obj).foo = (x = x.length) : number >(x = "", obj).foo : any >(x = "", obj) : any >x = "", obj : any ->x = "" : string +>x = "" : "" >x : string | number | boolean ->"" : string +>"" : "" >obj : any >foo : any >(x = x.length) : number diff --git a/tests/baselines/reference/controlFlowBinaryAndExpression.types b/tests/baselines/reference/controlFlowBinaryAndExpression.types index 8a1924c42eb..1e7f4e44848 100644 --- a/tests/baselines/reference/controlFlowBinaryAndExpression.types +++ b/tests/baselines/reference/controlFlowBinaryAndExpression.types @@ -6,31 +6,31 @@ let cond: boolean; >cond : boolean (x = "") && (x = 0); ->(x = "") && (x = 0) : number ->(x = "") : string ->x = "" : string +>(x = "") && (x = 0) : "" +>(x = "") : "" +>x = "" : "" >x : string | number | boolean ->"" : string ->(x = 0) : number ->x = 0 : number +>"" : "" +>(x = 0) : 0 +>x = 0 : 0 >x : string | number | boolean ->0 : number +>0 : 0 x; // string | number >x : string | number x = ""; ->x = "" : string +>x = "" : "" >x : string | number | boolean ->"" : string +>"" : "" cond && (x = 0); ->cond && (x = 0) : number +>cond && (x = 0) : 0 >cond : boolean ->(x = 0) : number ->x = 0 : number +>(x = 0) : 0 +>x = 0 : 0 >x : string | number | boolean ->0 : number +>0 : 0 x; // string | number >x : string | number diff --git a/tests/baselines/reference/controlFlowBinaryOrExpression.types b/tests/baselines/reference/controlFlowBinaryOrExpression.types index 7e92fcdbbd1..166718b9266 100644 --- a/tests/baselines/reference/controlFlowBinaryOrExpression.types +++ b/tests/baselines/reference/controlFlowBinaryOrExpression.types @@ -6,31 +6,31 @@ let cond: boolean; >cond : boolean (x = "") || (x = 0); ->(x = "") || (x = 0) : string | number ->(x = "") : string ->x = "" : string +>(x = "") || (x = 0) : 0 +>(x = "") : "" +>x = "" : "" >x : string | number | boolean ->"" : string ->(x = 0) : number ->x = 0 : number +>"" : "" +>(x = 0) : 0 +>x = 0 : 0 >x : string | number | boolean ->0 : number +>0 : 0 x; // string | number >x : string | number x = ""; ->x = "" : string +>x = "" : "" >x : string | number | boolean ->"" : string +>"" : "" cond || (x = 0); ->cond || (x = 0) : number | true +>cond || (x = 0) : true | 0 >cond : boolean ->(x = 0) : number ->x = 0 : number +>(x = 0) : 0 +>x = 0 : 0 >x : string | number | boolean ->0 : number +>0 : 0 x; // string | number >x : string | number diff --git a/tests/baselines/reference/controlFlowCaching.types b/tests/baselines/reference/controlFlowCaching.types index 137fbc3d19c..4b7df020c94 100644 --- a/tests/baselines/reference/controlFlowCaching.types +++ b/tests/baselines/reference/controlFlowCaching.types @@ -49,14 +49,14 @@ function f(dim, offsets, arr, acommon, centerAnchorLimit, g, has, lin) { >o.rotation : any >o : any >rotation : any ->360 : number +>360 : 360 start, stop, titlePos, titleRotation = 0, titleOffset, axisVector, tickVector, anchorOffset, labelOffset, labelAlign, >start : any >stop : any >titlePos : any >titleRotation : number ->0 : number +>0 : 0 >titleOffset : any >axisVector : any >tickVector : any @@ -151,7 +151,7 @@ function f(dim, offsets, arr, acommon, centerAnchorLimit, g, has, lin) { >ta : any >tick : any >fontColor : any ->"black" : string +>"black" : "black" taTitleFontColor = o.titleFontColor || (ta.title && ta.title.fontColor) || "black", >taTitleFontColor : any @@ -170,7 +170,7 @@ function f(dim, offsets, arr, acommon, centerAnchorLimit, g, has, lin) { >ta : any >title : any >fontColor : any ->"black" : string +>"black" : "black" taTitleGap = (o.titleGap == 0) ? 0 : o.titleGap || (ta.title && ta.title.gap) || 15, >taTitleGap : any @@ -181,7 +181,7 @@ function f(dim, offsets, arr, acommon, centerAnchorLimit, g, has, lin) { >o : any >titleGap : any >0 : 0 ->0 : number +>0 : 0 >o.titleGap || (ta.title && ta.title.gap) || 15 : any >o.titleGap || (ta.title && ta.title.gap) : any >o.titleGap : any @@ -197,7 +197,7 @@ function f(dim, offsets, arr, acommon, centerAnchorLimit, g, has, lin) { >ta : any >title : any >gap : any ->15 : number +>15 : 15 taTitleOrientation = o.titleOrientation || (ta.title && ta.title.orientation) || "axis", >taTitleOrientation : any @@ -216,7 +216,7 @@ function f(dim, offsets, arr, acommon, centerAnchorLimit, g, has, lin) { >ta : any >title : any >orientation : any ->"axis" : string +>"axis" : "axis" taMajorTick = this.chart.theme.getTick("major", o), >taMajorTick : any @@ -228,7 +228,7 @@ function f(dim, offsets, arr, acommon, centerAnchorLimit, g, has, lin) { >chart : any >theme : any >getTick : any ->"major" : string +>"major" : "major" >o : any taMinorTick = this.chart.theme.getTick("minor", o), @@ -241,7 +241,7 @@ function f(dim, offsets, arr, acommon, centerAnchorLimit, g, has, lin) { >chart : any >theme : any >getTick : any ->"minor" : string +>"minor" : "minor" >o : any taMicroTick = this.chart.theme.getTick("micro", o), @@ -254,14 +254,14 @@ function f(dim, offsets, arr, acommon, centerAnchorLimit, g, has, lin) { >chart : any >theme : any >getTick : any ->"micro" : string +>"micro" : "micro" >o : any taStroke = "stroke" in o ? o.stroke : ta.stroke, >taStroke : any >"stroke" in o ? o.stroke : ta.stroke : any >"stroke" in o : boolean ->"stroke" : string +>"stroke" : "stroke" >o : any >o.stroke : any >o : any @@ -285,7 +285,7 @@ function f(dim, offsets, arr, acommon, centerAnchorLimit, g, has, lin) { >splitFontString : any >taFont : any >size : any ->0 : number +>0 : 0 cosr = Math.abs(Math.cos(rotation * Math.PI / 180)), >cosr : number @@ -303,7 +303,7 @@ function f(dim, offsets, arr, acommon, centerAnchorLimit, g, has, lin) { >Math.PI : number >Math : Math >PI : number ->180 : number +>180 : 180 sinr = Math.abs(Math.sin(rotation * Math.PI / 180)), >sinr : number @@ -321,7 +321,7 @@ function f(dim, offsets, arr, acommon, centerAnchorLimit, g, has, lin) { >Math.PI : number >Math : Math >PI : number ->180 : number +>180 : 180 tsize = taTitleFont ? g.normalizedLength(g.splitFontString(taTitleFont).size) : 0; >tsize : any @@ -338,17 +338,17 @@ function f(dim, offsets, arr, acommon, centerAnchorLimit, g, has, lin) { >splitFontString : any >taTitleFont : any >size : any ->0 : number +>0 : 0 if (rotation < 0) { >rotation < 0 : boolean >rotation : number ->0 : number +>0 : 0 rotation += 360; >rotation += 360 : number >rotation : number ->360 : number +>360 : 360 } var cachedLabelW = this._getMaxLabelSize(); >cachedLabelW : any @@ -381,7 +381,7 @@ function f(dim, offsets, arr, acommon, centerAnchorLimit, g, has, lin) { >(cachedLabelW || 0) : any >cachedLabelW || 0 : any >cachedLabelW : any ->0 : number +>0 : 0 >sinr : number >labelGap : any >Math.max(taMajorTick.length > 0 ? taMajorTick.length : 0, taMinorTick.length > 0 ? taMinorTick.length : 0) : number @@ -393,11 +393,11 @@ function f(dim, offsets, arr, acommon, centerAnchorLimit, g, has, lin) { >taMajorTick.length : any >taMajorTick : any >length : any ->0 : number +>0 : 0 >taMajorTick.length : any >taMajorTick : any >length : any ->0 : number +>0 : 0 taMinorTick.length > 0 ? taMinorTick.length : 0) + >taMinorTick.length > 0 ? taMinorTick.length : 0 : any @@ -405,11 +405,11 @@ function f(dim, offsets, arr, acommon, centerAnchorLimit, g, has, lin) { >taMinorTick.length : any >taMinorTick : any >length : any ->0 : number +>0 : 0 >taMinorTick.length : any >taMinorTick : any >length : any ->0 : number +>0 : 0 tsize + taTitleGap; >tsize : any @@ -420,13 +420,13 @@ function f(dim, offsets, arr, acommon, centerAnchorLimit, g, has, lin) { >axisVector : any >{ x: isRtl ? -1 : 1, y: 0 } : { x: number; y: number; } >x : number ->isRtl ? -1 : 1 : number +>isRtl ? -1 : 1 : 1 | -1 >isRtl : any ->-1 : number ->1 : number ->1 : number +>-1 : -1 +>1 : 1 +>1 : 1 >y : number ->0 : number +>0 : 0 switch (rotation) { >rotation : number @@ -437,7 +437,7 @@ function f(dim, offsets, arr, acommon, centerAnchorLimit, g, has, lin) { >rotation : number >(90 - centerAnchorLimit) : number >90 - centerAnchorLimit : number ->90 : number +>90 : 90 >centerAnchorLimit : any labelOffset.y = leftBottom ? size : 0; @@ -448,14 +448,14 @@ function f(dim, offsets, arr, acommon, centerAnchorLimit, g, has, lin) { >leftBottom ? size : 0 : any >leftBottom : boolean >size : any ->0 : number +>0 : 0 } else if (rotation < (90 + centerAnchorLimit)) { >rotation < (90 + centerAnchorLimit) : boolean >rotation : number >(90 + centerAnchorLimit) : any >90 + centerAnchorLimit : any ->90 : number +>90 : 90 >centerAnchorLimit : any labelOffset.x = -size * 0.4; @@ -466,12 +466,12 @@ function f(dim, offsets, arr, acommon, centerAnchorLimit, g, has, lin) { >-size * 0.4 : number >-size : number >size : any ->0.4 : number +>0.4 : 0.4 } else if (rotation < 180) { >rotation < 180 : boolean >rotation : number ->180 : number +>180 : 180 labelOffset.y = leftBottom ? 0 : -size; >labelOffset.y = leftBottom ? 0 : -size : number @@ -480,7 +480,7 @@ function f(dim, offsets, arr, acommon, centerAnchorLimit, g, has, lin) { >y : any >leftBottom ? 0 : -size : number >leftBottom : boolean ->0 : number +>0 : 0 >-size : number >size : any @@ -489,7 +489,7 @@ function f(dim, offsets, arr, acommon, centerAnchorLimit, g, has, lin) { >rotation : number >(270 - centerAnchorLimit) : number >270 - centerAnchorLimit : number ->270 : number +>270 : 270 >centerAnchorLimit : any labelOffset.y = leftBottom ? 0 : -size; @@ -499,7 +499,7 @@ function f(dim, offsets, arr, acommon, centerAnchorLimit, g, has, lin) { >y : any >leftBottom ? 0 : -size : number >leftBottom : boolean ->0 : number +>0 : 0 >-size : number >size : any @@ -508,7 +508,7 @@ function f(dim, offsets, arr, acommon, centerAnchorLimit, g, has, lin) { >rotation : number >(270 + centerAnchorLimit) : any >270 + centerAnchorLimit : any ->270 : number +>270 : 270 >centerAnchorLimit : any labelOffset.y = leftBottom ? size * 0.4 : 0; @@ -520,8 +520,8 @@ function f(dim, offsets, arr, acommon, centerAnchorLimit, g, has, lin) { >leftBottom : boolean >size * 0.4 : number >size : any ->0.4 : number ->0 : number +>0.4 : 0.4 +>0 : 0 } else { labelOffset.y = leftBottom ? size : 0; @@ -532,22 +532,22 @@ function f(dim, offsets, arr, acommon, centerAnchorLimit, g, has, lin) { >leftBottom ? size : 0 : any >leftBottom : boolean >size : any ->0 : number +>0 : 0 } } titleRotation = (taTitleOrientation && taTitleOrientation == "away") ? 180 : 0; ->titleRotation = (taTitleOrientation && taTitleOrientation == "away") ? 180 : 0 : number +>titleRotation = (taTitleOrientation && taTitleOrientation == "away") ? 180 : 0 : 0 | 180 >titleRotation : number ->(taTitleOrientation && taTitleOrientation == "away") ? 180 : 0 : number +>(taTitleOrientation && taTitleOrientation == "away") ? 180 : 0 : 0 | 180 >(taTitleOrientation && taTitleOrientation == "away") : boolean >taTitleOrientation && taTitleOrientation == "away" : boolean >taTitleOrientation : any >taTitleOrientation == "away" : boolean >taTitleOrientation : any >"away" : "away" ->180 : number ->0 : number +>180 : 180 +>0 : 0 titlePos.y = offsets.t - titleOffset + (titleRotation ? 0 : tsize); >titlePos.y = offsets.t - titleOffset + (titleRotation ? 0 : tsize) : any @@ -563,7 +563,7 @@ function f(dim, offsets, arr, acommon, centerAnchorLimit, g, has, lin) { >(titleRotation ? 0 : tsize) : any >titleRotation ? 0 : tsize : any >titleRotation : number ->0 : number +>0 : 0 >tsize : any switch (labelAlign) { @@ -573,18 +573,18 @@ function f(dim, offsets, arr, acommon, centerAnchorLimit, g, has, lin) { >"start" : "start" labelAlign = "end"; ->labelAlign = "end" : string +>labelAlign = "end" : "end" >labelAlign : any ->"end" : string +>"end" : "end" break; case "end": >"end" : "end" labelAlign = "start"; ->labelAlign = "start" : string +>labelAlign = "start" : "start" >labelAlign : any ->"start" : string +>"start" : "start" break; case "middle": diff --git a/tests/baselines/reference/controlFlowCommaOperator.types b/tests/baselines/reference/controlFlowCommaOperator.types index 211fae3655a..52fd3d7b87d 100644 --- a/tests/baselines/reference/controlFlowCommaOperator.types +++ b/tests/baselines/reference/controlFlowCommaOperator.types @@ -5,17 +5,17 @@ function f(x: string | number | boolean) { let y: string | number | boolean = false; >y : string | number | boolean ->false : boolean +>false : false let z: string | number | boolean = false; >z : string | number | boolean ->false : boolean +>false : false if (y = "", typeof x === "string") { >y = "", typeof x === "string" : boolean ->y = "" : string +>y = "" : "" >y : string | number | boolean ->"" : string +>"" : "" >typeof x === "string" : boolean >typeof x : string >x : string | number | boolean @@ -28,13 +28,13 @@ function f(x: string | number | boolean) { >y : string z; // boolean ->z : boolean +>z : false } else if (z = 1, typeof x === "number") { >z = 1, typeof x === "number" : boolean ->z = 1 : number +>z = 1 : 1 >z : string | number | boolean ->1 : number +>1 : 1 >typeof x === "number" : boolean >typeof x : string >x : number | boolean @@ -66,6 +66,6 @@ function f(x: string | number | boolean) { >y : string z; // number | boolean ->z : number | boolean +>z : number | false } diff --git a/tests/baselines/reference/controlFlowConditionalExpression.types b/tests/baselines/reference/controlFlowConditionalExpression.types index c6084e052b1..a648b86e835 100644 --- a/tests/baselines/reference/controlFlowConditionalExpression.types +++ b/tests/baselines/reference/controlFlowConditionalExpression.types @@ -6,14 +6,14 @@ let cond: boolean; >cond : boolean cond ? x = "" : x = 3; ->cond ? x = "" : x = 3 : string | number +>cond ? x = "" : x = 3 : "" | 3 >cond : boolean ->x = "" : string +>x = "" : "" >x : string | number | boolean ->"" : string ->x = 3 : number +>"" : "" +>x = 3 : 3 >x : string | number | boolean ->3 : number +>3 : 3 x; // string | number >x : string | number diff --git a/tests/baselines/reference/controlFlowDeleteOperator.types b/tests/baselines/reference/controlFlowDeleteOperator.types index b0040f12bc2..5715cfc4043 100644 --- a/tests/baselines/reference/controlFlowDeleteOperator.types +++ b/tests/baselines/reference/controlFlowDeleteOperator.types @@ -9,7 +9,7 @@ function f() { >b : string | number >{ b: 1 } : { b: number; } >b : number ->1 : number +>1 : 1 x.a; >x.a : string | number | undefined @@ -22,18 +22,18 @@ function f() { >b : string | number x.a = 1; ->x.a = 1 : number +>x.a = 1 : 1 >x.a : string | number | undefined >x : { a?: string | number | undefined; b: string | number; } >a : string | number | undefined ->1 : number +>1 : 1 x.b = 1; ->x.b = 1 : number +>x.b = 1 : 1 >x.b : string | number >x : { a?: string | number | undefined; b: string | number; } >b : string | number ->1 : number +>1 : 1 x.a; >x.a : number diff --git a/tests/baselines/reference/controlFlowDestructuringDeclaration.types b/tests/baselines/reference/controlFlowDestructuringDeclaration.types index 2e3b1f5647e..d50b743b746 100644 --- a/tests/baselines/reference/controlFlowDestructuringDeclaration.types +++ b/tests/baselines/reference/controlFlowDestructuringDeclaration.types @@ -5,14 +5,14 @@ function f1() { let x: string | number = 1; >x : string | number ->1 : number +>1 : 1 x; >x : number let y: string | undefined = ""; >y : string | undefined ->"" : string +>"" : "" y; >y : string @@ -24,7 +24,7 @@ function f2() { let [x]: [string | number] = [1]; >x : string | number >[1] : [number] ->1 : number +>1 : 1 x; >x : number @@ -32,14 +32,14 @@ function f2() { let [y]: [string | undefined] = [""]; >y : string | undefined >[""] : [string] ->"" : string +>"" : "" y; >y : string let [z = ""]: [string | undefined] = [undefined]; >z : string ->"" : string +>"" : "" >[undefined] : [undefined] >undefined : undefined @@ -53,7 +53,7 @@ function f3() { let [x]: (string | number)[] = [1]; >x : string | number >[1] : number[] ->1 : number +>1 : 1 x; >x : number @@ -61,14 +61,14 @@ function f3() { let [y]: (string | undefined)[] = [""]; >y : string | undefined >[""] : string[] ->"" : string +>"" : "" y; >y : string let [z = ""]: (string | undefined)[] = [undefined]; >z : string ->"" : string +>"" : "" >[undefined] : undefined[] >undefined : undefined @@ -84,7 +84,7 @@ function f4() { >x : string | number >{ x: 1 } : { x: number; } >x : number ->1 : number +>1 : 1 x; >x : number @@ -94,14 +94,14 @@ function f4() { >y : string | undefined >{ y: "" } : { y: string; } >y : string ->"" : string +>"" : "" y; >y : string let { z = "" }: { z: string | undefined } = { z: undefined }; >z : string ->"" : string +>"" : "" >z : string | undefined >{ z: undefined } : { z: undefined; } >z : undefined @@ -119,7 +119,7 @@ function f5() { >x : string | number | undefined >{ x: 1 } : { x: number; } >x : number ->1 : number +>1 : 1 x; >x : number @@ -129,14 +129,14 @@ function f5() { >y : string | undefined >{ y: "" } : { y: string; } >y : string ->"" : string +>"" : "" y; >y : string let { z = "" }: { z?: string | undefined } = { z: undefined }; >z : string ->"" : string +>"" : "" >z : string | undefined >{ z: undefined } : { z: undefined; } >z : undefined @@ -167,7 +167,7 @@ function f6() { let { z = "" }: { z?: string | undefined } = {}; >z : string ->"" : string +>"" : "" >z : string | undefined >{} : {} @@ -183,7 +183,7 @@ function f7() { >x : string >{ x: 1 } : { x: number; } >x : number ->1 : number +>1 : 1 let { x }: { [x: string]: string | number } = o; >x : string | number diff --git a/tests/baselines/reference/controlFlowDestructuringParameters.types b/tests/baselines/reference/controlFlowDestructuringParameters.types index 396852bf37a..d0729e6d7d5 100644 --- a/tests/baselines/reference/controlFlowDestructuringParameters.types +++ b/tests/baselines/reference/controlFlowDestructuringParameters.types @@ -8,7 +8,7 @@ >[{ x: 1 }] : { x: number; }[] >{ x: 1 } : { x: number; } >x : number ->1 : number +>1 : 1 >map : (callbackfn: (value: { x: number; }, index: number, array: { x: number; }[]) => U, thisArg?: any) => U[] ({ x }) => x diff --git a/tests/baselines/reference/controlFlowDoWhileStatement.types b/tests/baselines/reference/controlFlowDoWhileStatement.types index 55329cbcea1..24f3e92b144 100644 --- a/tests/baselines/reference/controlFlowDoWhileStatement.types +++ b/tests/baselines/reference/controlFlowDoWhileStatement.types @@ -9,9 +9,9 @@ function a() { >x : string | number x = ""; ->x = "" : string +>x = "" : "" >x : string | number ->"" : string +>"" : "" do { x; // string @@ -27,18 +27,18 @@ function b() { >x : string | number x = ""; ->x = "" : string +>x = "" : "" >x : string | number ->"" : string +>"" : "" do { x; // string >x : string x = 42; ->x = 42 : number +>x = 42 : 42 >x : string | number ->42 : number +>42 : 42 break; } while (cond) @@ -51,9 +51,9 @@ function c() { >x : string | number x = ""; ->x = "" : string +>x = "" : "" >x : string | number ->"" : string +>"" : "" do { x; // string @@ -81,18 +81,18 @@ function d() { >x : string | number x = 1000; ->x = 1000 : number +>x = 1000 : 1000 >x : string | number ->1000 : number +>1000 : 1000 do { x; // number >x : number x = ""; ->x = "" : string +>x = "" : "" >x : string | number ->"" : string +>"" : "" } while (x = x.length) >x = x.length : number @@ -111,15 +111,15 @@ function e() { >x : string | number x = ""; ->x = "" : string +>x = "" : "" >x : string | number ->"" : string +>"" : "" do { x = 42; ->x = 42 : number +>x = 42 : 42 >x : string | number ->42 : number +>42 : 42 } while (cond) >cond : boolean @@ -136,18 +136,18 @@ function f() { >Function : Function x = ""; ->x = "" : string +>x = "" : "" >x : string | number | boolean | Function | RegExp ->"" : string +>"" : "" do { if (cond) { >cond : boolean x = 42; ->x = 42 : number +>x = 42 : 42 >x : string | number | boolean | Function | RegExp ->42 : number +>42 : 42 break; } @@ -155,9 +155,9 @@ function f() { >cond : boolean x = true; ->x = true : boolean +>x = true : true >x : string | number | boolean | Function | RegExp ->true : boolean +>true : true continue; } @@ -170,7 +170,7 @@ function f() { >cond : boolean x; // number | boolean | RegExp ->x : number | boolean | RegExp +>x : number | true | RegExp } function g() { >g : () => void @@ -181,18 +181,18 @@ function g() { >Function : Function x = ""; ->x = "" : string +>x = "" : "" >x : string | number | boolean | Function | RegExp ->"" : string +>"" : "" do { if (cond) { >cond : boolean x = 42; ->x = 42 : number +>x = 42 : 42 >x : string | number | boolean | Function | RegExp ->42 : number +>42 : 42 break; } @@ -200,9 +200,9 @@ function g() { >cond : boolean x = true; ->x = true : boolean +>x = true : true >x : string | number | boolean | Function | RegExp ->true : boolean +>true : true continue; } @@ -212,7 +212,7 @@ function g() { >/a/ : RegExp } while (true) ->true : boolean +>true : true x; // number >x : number diff --git a/tests/baselines/reference/controlFlowForInStatement.types b/tests/baselines/reference/controlFlowForInStatement.types index cab3a701602..e3a4407bff3 100644 --- a/tests/baselines/reference/controlFlowForInStatement.types +++ b/tests/baselines/reference/controlFlowForInStatement.types @@ -28,9 +28,9 @@ for (let y in obj) { >cond : boolean x = 42; ->x = 42 : number +>x = 42 : 42 >x : string | number | boolean | Function | RegExp ->42 : number +>42 : 42 continue; } @@ -38,13 +38,13 @@ for (let y in obj) { >cond : boolean x = true; ->x = true : boolean +>x = true : true >x : string | number | boolean | Function | RegExp ->true : boolean +>true : true break; } } x; // RegExp | string | number | boolean ->x : string | number | boolean | RegExp +>x : string | number | true | RegExp diff --git a/tests/baselines/reference/controlFlowForOfStatement.types b/tests/baselines/reference/controlFlowForOfStatement.types index 41e312347e7..91e0d0a5758 100644 --- a/tests/baselines/reference/controlFlowForOfStatement.types +++ b/tests/baselines/reference/controlFlowForOfStatement.types @@ -10,9 +10,9 @@ function a() { >a : () => void x = true; ->x = true : boolean +>x = true : true >x : string | number | boolean | RegExp ->true : boolean +>true : true for (x of obj) { >x : string | number | boolean | RegExp @@ -27,6 +27,6 @@ function a() { >toExponential : (fractionDigits?: number) => string } x; // string | boolean ->x : string | boolean +>x : string | true } diff --git a/tests/baselines/reference/controlFlowForStatement.types b/tests/baselines/reference/controlFlowForStatement.types index d0b0a2e6b8a..d227e87ea1d 100644 --- a/tests/baselines/reference/controlFlowForStatement.types +++ b/tests/baselines/reference/controlFlowForStatement.types @@ -9,13 +9,13 @@ function a() { >x : string | number | boolean for (x = ""; cond; x = 5) { ->x = "" : string +>x = "" : "" >x : string | number | boolean ->"" : string +>"" : "" >cond : boolean ->x = 5 : number +>x = 5 : 5 >x : string | number | boolean ->5 : number +>5 : 5 x; // string | number >x : string | number @@ -28,9 +28,9 @@ function b() { >x : string | number | boolean for (x = 5; cond; x = x.length) { ->x = 5 : number +>x = 5 : 5 >x : string | number | boolean ->5 : number +>5 : 5 >cond : boolean >x = x.length : number >x : string | number | boolean @@ -42,9 +42,9 @@ function b() { >x : number x = ""; ->x = "" : string +>x = "" : "" >x : string | number | boolean ->"" : string +>"" : "" } } function c() { @@ -54,18 +54,18 @@ function c() { >x : string | number | boolean for (x = 5; x = x.toExponential(); x = 5) { ->x = 5 : number +>x = 5 : 5 >x : string | number | boolean ->5 : number +>5 : 5 >x = x.toExponential() : string >x : string | number | boolean >x.toExponential() : string >x.toExponential : (fractionDigits?: number) => string >x : number >toExponential : (fractionDigits?: number) => string ->x = 5 : number +>x = 5 : 5 >x : string | number | boolean ->5 : number +>5 : 5 x; // string >x : string @@ -78,16 +78,16 @@ function d() { >x : string | number | boolean for (x = ""; typeof x === "string"; x = 5) { ->x = "" : string +>x = "" : "" >x : string | number | boolean ->"" : string +>"" : "" >typeof x === "string" : boolean >typeof x : string >x : string | number >"string" : "string" ->x = 5 : number +>x = 5 : 5 >x : string | number | boolean ->5 : number +>5 : 5 x; // string >x : string @@ -101,23 +101,23 @@ function e() { >RegExp : RegExp for (x = "" || 0; typeof x !== "string"; x = "" || true) { ->x = "" || 0 : string | number +>x = "" || 0 : 0 >x : string | number | boolean | RegExp ->"" || 0 : string | number ->"" : string ->0 : number +>"" || 0 : 0 +>"" : "" +>0 : 0 >typeof x !== "string" : boolean >typeof x : string ->x : string | number | boolean +>x : number | true >"string" : "string" ->x = "" || true : string | boolean +>x = "" || true : true >x : string | number | boolean | RegExp ->"" || true : string | boolean ->"" : string ->true : boolean +>"" || true : true +>"" : "" +>true : true x; // number | boolean ->x : number | boolean +>x : number | true } } function f() { diff --git a/tests/baselines/reference/controlFlowIIFE.types b/tests/baselines/reference/controlFlowIIFE.types index dd1fbacc424..6173e79dbbb 100644 --- a/tests/baselines/reference/controlFlowIIFE.types +++ b/tests/baselines/reference/controlFlowIIFE.types @@ -90,9 +90,9 @@ function f3() { >length : number >y : number >z : number ->y = 1 : number +>y = 1 : 1 >y : number ->1 : number +>1 : 1 } } @@ -107,9 +107,9 @@ let maybeNumber: number | undefined; >function () { maybeNumber = 1;} : () => void maybeNumber = 1; ->maybeNumber = 1 : number +>maybeNumber = 1 : 1 >maybeNumber : number | undefined ->1 : number +>1 : 1 })(); maybeNumber++; @@ -118,7 +118,7 @@ maybeNumber++; if (maybeNumber !== undefined) { >maybeNumber !== undefined : boolean ->maybeNumber : number +>maybeNumber : number | undefined >undefined : undefined maybeNumber++; @@ -136,7 +136,7 @@ if (!test) { throw new Error('Test is not defined'); >new Error('Test is not defined') : Error >Error : ErrorConstructor ->'Test is not defined' : string +>'Test is not defined' : "Test is not defined" } (() => { >(() => { test.slice(1); // No error})() : void @@ -148,6 +148,6 @@ if (!test) { >test.slice : (start?: number | undefined, end?: number | undefined) => string >test : string >slice : (start?: number | undefined, end?: number | undefined) => string ->1 : number +>1 : 1 })(); diff --git a/tests/baselines/reference/controlFlowIfStatement.js b/tests/baselines/reference/controlFlowIfStatement.js index e40b831552f..5b09b13e5fd 100644 --- a/tests/baselines/reference/controlFlowIfStatement.js +++ b/tests/baselines/reference/controlFlowIfStatement.js @@ -1,4 +1,5 @@ //// [controlFlowIfStatement.ts] + let x: string | number | boolean | RegExp; let cond: boolean; diff --git a/tests/baselines/reference/controlFlowIfStatement.symbols b/tests/baselines/reference/controlFlowIfStatement.symbols index e4d2bb9f184..29d235de780 100644 --- a/tests/baselines/reference/controlFlowIfStatement.symbols +++ b/tests/baselines/reference/controlFlowIfStatement.symbols @@ -1,112 +1,113 @@ === tests/cases/conformance/controlFlow/controlFlowIfStatement.ts === + let x: string | number | boolean | RegExp; ->x : Symbol(x, Decl(controlFlowIfStatement.ts, 0, 3)) +>x : Symbol(x, Decl(controlFlowIfStatement.ts, 1, 3)) >RegExp : Symbol(RegExp, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) let cond: boolean; ->cond : Symbol(cond, Decl(controlFlowIfStatement.ts, 1, 3)) +>cond : Symbol(cond, Decl(controlFlowIfStatement.ts, 2, 3)) x = /a/; ->x : Symbol(x, Decl(controlFlowIfStatement.ts, 0, 3)) +>x : Symbol(x, Decl(controlFlowIfStatement.ts, 1, 3)) if (x /* RegExp */, (x = true)) { ->x : Symbol(x, Decl(controlFlowIfStatement.ts, 0, 3)) ->x : Symbol(x, Decl(controlFlowIfStatement.ts, 0, 3)) +>x : Symbol(x, Decl(controlFlowIfStatement.ts, 1, 3)) +>x : Symbol(x, Decl(controlFlowIfStatement.ts, 1, 3)) x; // boolean ->x : Symbol(x, Decl(controlFlowIfStatement.ts, 0, 3)) +>x : Symbol(x, Decl(controlFlowIfStatement.ts, 1, 3)) x = ""; ->x : Symbol(x, Decl(controlFlowIfStatement.ts, 0, 3)) +>x : Symbol(x, Decl(controlFlowIfStatement.ts, 1, 3)) } else { x; // boolean ->x : Symbol(x, Decl(controlFlowIfStatement.ts, 0, 3)) +>x : Symbol(x, Decl(controlFlowIfStatement.ts, 1, 3)) x = 42; ->x : Symbol(x, Decl(controlFlowIfStatement.ts, 0, 3)) +>x : Symbol(x, Decl(controlFlowIfStatement.ts, 1, 3)) } x; // string | number ->x : Symbol(x, Decl(controlFlowIfStatement.ts, 0, 3)) +>x : Symbol(x, Decl(controlFlowIfStatement.ts, 1, 3)) function a() { ->a : Symbol(a, Decl(controlFlowIfStatement.ts, 12, 2)) +>a : Symbol(a, Decl(controlFlowIfStatement.ts, 13, 2)) let x: string | number; ->x : Symbol(x, Decl(controlFlowIfStatement.ts, 15, 7)) +>x : Symbol(x, Decl(controlFlowIfStatement.ts, 16, 7)) if (cond) { ->cond : Symbol(cond, Decl(controlFlowIfStatement.ts, 1, 3)) +>cond : Symbol(cond, Decl(controlFlowIfStatement.ts, 2, 3)) x = 42; ->x : Symbol(x, Decl(controlFlowIfStatement.ts, 15, 7)) +>x : Symbol(x, Decl(controlFlowIfStatement.ts, 16, 7)) } else { x = ""; ->x : Symbol(x, Decl(controlFlowIfStatement.ts, 15, 7)) +>x : Symbol(x, Decl(controlFlowIfStatement.ts, 16, 7)) return; } x; // number ->x : Symbol(x, Decl(controlFlowIfStatement.ts, 15, 7)) +>x : Symbol(x, Decl(controlFlowIfStatement.ts, 16, 7)) } function b() { ->b : Symbol(b, Decl(controlFlowIfStatement.ts, 24, 1)) +>b : Symbol(b, Decl(controlFlowIfStatement.ts, 25, 1)) let x: string | number; ->x : Symbol(x, Decl(controlFlowIfStatement.ts, 26, 7)) +>x : Symbol(x, Decl(controlFlowIfStatement.ts, 27, 7)) if (cond) { ->cond : Symbol(cond, Decl(controlFlowIfStatement.ts, 1, 3)) +>cond : Symbol(cond, Decl(controlFlowIfStatement.ts, 2, 3)) x = 42; ->x : Symbol(x, Decl(controlFlowIfStatement.ts, 26, 7)) +>x : Symbol(x, Decl(controlFlowIfStatement.ts, 27, 7)) throw ""; } else { x = ""; ->x : Symbol(x, Decl(controlFlowIfStatement.ts, 26, 7)) +>x : Symbol(x, Decl(controlFlowIfStatement.ts, 27, 7)) } x; // string ->x : Symbol(x, Decl(controlFlowIfStatement.ts, 26, 7)) +>x : Symbol(x, Decl(controlFlowIfStatement.ts, 27, 7)) } function c(data: string | T): T { ->c : Symbol(c, Decl(controlFlowIfStatement.ts, 35, 1)) ->T : Symbol(T, Decl(controlFlowIfStatement.ts, 36, 11)) ->data : Symbol(data, Decl(controlFlowIfStatement.ts, 36, 14)) ->T : Symbol(T, Decl(controlFlowIfStatement.ts, 36, 11)) ->T : Symbol(T, Decl(controlFlowIfStatement.ts, 36, 11)) +>c : Symbol(c, Decl(controlFlowIfStatement.ts, 36, 1)) +>T : Symbol(T, Decl(controlFlowIfStatement.ts, 37, 11)) +>data : Symbol(data, Decl(controlFlowIfStatement.ts, 37, 14)) +>T : Symbol(T, Decl(controlFlowIfStatement.ts, 37, 11)) +>T : Symbol(T, Decl(controlFlowIfStatement.ts, 37, 11)) if (typeof data === 'string') { ->data : Symbol(data, Decl(controlFlowIfStatement.ts, 36, 14)) +>data : Symbol(data, Decl(controlFlowIfStatement.ts, 37, 14)) return JSON.parse(data); >JSON.parse : Symbol(JSON.parse, Decl(lib.d.ts, --, --)) >JSON : Symbol(JSON, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) >parse : Symbol(JSON.parse, Decl(lib.d.ts, --, --)) ->data : Symbol(data, Decl(controlFlowIfStatement.ts, 36, 14)) +>data : Symbol(data, Decl(controlFlowIfStatement.ts, 37, 14)) } else { return data; ->data : Symbol(data, Decl(controlFlowIfStatement.ts, 36, 14)) +>data : Symbol(data, Decl(controlFlowIfStatement.ts, 37, 14)) } } function d(data: string | T): never { ->d : Symbol(d, Decl(controlFlowIfStatement.ts, 43, 1)) ->T : Symbol(T, Decl(controlFlowIfStatement.ts, 44, 11)) ->data : Symbol(data, Decl(controlFlowIfStatement.ts, 44, 29)) ->T : Symbol(T, Decl(controlFlowIfStatement.ts, 44, 11)) +>d : Symbol(d, Decl(controlFlowIfStatement.ts, 44, 1)) +>T : Symbol(T, Decl(controlFlowIfStatement.ts, 45, 11)) +>data : Symbol(data, Decl(controlFlowIfStatement.ts, 45, 29)) +>T : Symbol(T, Decl(controlFlowIfStatement.ts, 45, 11)) if (typeof data === 'string') { ->data : Symbol(data, Decl(controlFlowIfStatement.ts, 44, 29)) +>data : Symbol(data, Decl(controlFlowIfStatement.ts, 45, 29)) throw new Error('will always happen'); >Error : Symbol(Error, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) } else { return data; ->data : Symbol(data, Decl(controlFlowIfStatement.ts, 44, 29)) +>data : Symbol(data, Decl(controlFlowIfStatement.ts, 45, 29)) } } diff --git a/tests/baselines/reference/controlFlowIfStatement.types b/tests/baselines/reference/controlFlowIfStatement.types index 79985378bf5..fd8f25b9ee3 100644 --- a/tests/baselines/reference/controlFlowIfStatement.types +++ b/tests/baselines/reference/controlFlowIfStatement.types @@ -1,4 +1,5 @@ === tests/cases/conformance/controlFlow/controlFlowIfStatement.ts === + let x: string | number | boolean | RegExp; >x : string | number | boolean | RegExp >RegExp : RegExp @@ -12,29 +13,29 @@ x = /a/; >/a/ : RegExp if (x /* RegExp */, (x = true)) { ->x /* RegExp */, (x = true) : boolean +>x /* RegExp */, (x = true) : true >x : RegExp ->(x = true) : boolean ->x = true : boolean +>(x = true) : true +>x = true : true >x : string | number | boolean | RegExp ->true : boolean +>true : true x; // boolean >x : true x = ""; ->x = "" : string +>x = "" : "" >x : string | number | boolean | RegExp ->"" : string +>"" : "" } else { x; // boolean ->x : boolean +>x : true x = 42; ->x = 42 : number +>x = 42 : 42 >x : string | number | boolean | RegExp ->42 : number +>42 : 42 } x; // string | number >x : string | number @@ -49,15 +50,15 @@ function a() { >cond : boolean x = 42; ->x = 42 : number +>x = 42 : 42 >x : string | number ->42 : number +>42 : 42 } else { x = ""; ->x = "" : string +>x = "" : "" >x : string | number ->"" : string +>"" : "" return; } @@ -74,18 +75,18 @@ function b() { >cond : boolean x = 42; ->x = 42 : number +>x = 42 : 42 >x : string | number ->42 : number +>42 : 42 throw ""; ->"" : string +>"" : "" } else { x = ""; ->x = "" : string +>x = "" : "" >x : string | number ->"" : string +>"" : "" } x; // string >x : string @@ -130,7 +131,7 @@ function d(data: string | T): never { throw new Error('will always happen'); >new Error('will always happen') : Error >Error : ErrorConstructor ->'will always happen' : string +>'will always happen' : "will always happen" } else { return data; diff --git a/tests/baselines/reference/controlFlowInstanceof.types b/tests/baselines/reference/controlFlowInstanceof.types index e52d1a25b1d..3dc9fff8b04 100644 --- a/tests/baselines/reference/controlFlowInstanceof.types +++ b/tests/baselines/reference/controlFlowInstanceof.types @@ -33,7 +33,7 @@ function f1(s: Set | Set) { >s.add : (value: number) => Set >s : Set >add : (value: number) => Set ->42 : number +>42 : 42 } function f2(s: Set | Set) { @@ -67,7 +67,7 @@ function f2(s: Set | Set) { >s.add : (value: number) => Set >s : Set >add : (value: number) => Set ->42 : number +>42 : 42 } function f3(s: Set | Set) { diff --git a/tests/baselines/reference/controlFlowIteration.types b/tests/baselines/reference/controlFlowIteration.types index 52be501d68e..a8c05b9732f 100644 --- a/tests/baselines/reference/controlFlowIteration.types +++ b/tests/baselines/reference/controlFlowIteration.types @@ -10,15 +10,15 @@ function ff() { >x : string | undefined while (true) { ->true : boolean +>true : true if (cond) { >cond : boolean x = ""; ->x = "" : string +>x = "" : "" >x : string | undefined ->"" : string +>"" : "" } else { if (x) { diff --git a/tests/baselines/reference/controlFlowOuterVariable.js b/tests/baselines/reference/controlFlowOuterVariable.js new file mode 100644 index 00000000000..1925d75eb31 --- /dev/null +++ b/tests/baselines/reference/controlFlowOuterVariable.js @@ -0,0 +1,26 @@ +//// [controlFlowOuterVariable.ts] + +// Repros from #10641 + +const CONFIG = { + foo: '', + setFoo: function(foo: string) { + CONFIG.foo = foo; + } +}; + +const helper = function(t: T[]) { + helper(t.slice(1)); +} + +//// [controlFlowOuterVariable.js] +// Repros from #10641 +var CONFIG = { + foo: '', + setFoo: function (foo) { + CONFIG.foo = foo; + } +}; +var helper = function (t) { + helper(t.slice(1)); +}; diff --git a/tests/baselines/reference/controlFlowOuterVariable.symbols b/tests/baselines/reference/controlFlowOuterVariable.symbols new file mode 100644 index 00000000000..35974f28a86 --- /dev/null +++ b/tests/baselines/reference/controlFlowOuterVariable.symbols @@ -0,0 +1,34 @@ +=== tests/cases/compiler/controlFlowOuterVariable.ts === + +// Repros from #10641 + +const CONFIG = { +>CONFIG : Symbol(CONFIG, Decl(controlFlowOuterVariable.ts, 3, 5)) + + foo: '', +>foo : Symbol(foo, Decl(controlFlowOuterVariable.ts, 3, 16)) + + setFoo: function(foo: string) { +>setFoo : Symbol(setFoo, Decl(controlFlowOuterVariable.ts, 4, 12)) +>foo : Symbol(foo, Decl(controlFlowOuterVariable.ts, 5, 21)) + + CONFIG.foo = foo; +>CONFIG.foo : Symbol(foo, Decl(controlFlowOuterVariable.ts, 3, 16)) +>CONFIG : Symbol(CONFIG, Decl(controlFlowOuterVariable.ts, 3, 5)) +>foo : Symbol(foo, Decl(controlFlowOuterVariable.ts, 3, 16)) +>foo : Symbol(foo, Decl(controlFlowOuterVariable.ts, 5, 21)) + } +}; + +const helper = function(t: T[]) { +>helper : Symbol(helper, Decl(controlFlowOuterVariable.ts, 10, 5)) +>T : Symbol(T, Decl(controlFlowOuterVariable.ts, 10, 24)) +>t : Symbol(t, Decl(controlFlowOuterVariable.ts, 10, 27)) +>T : Symbol(T, Decl(controlFlowOuterVariable.ts, 10, 24)) + + helper(t.slice(1)); +>helper : Symbol(helper, Decl(controlFlowOuterVariable.ts, 10, 5)) +>t.slice : Symbol(Array.slice, Decl(lib.d.ts, --, --)) +>t : Symbol(t, Decl(controlFlowOuterVariable.ts, 10, 27)) +>slice : Symbol(Array.slice, Decl(lib.d.ts, --, --)) +} diff --git a/tests/baselines/reference/controlFlowOuterVariable.types b/tests/baselines/reference/controlFlowOuterVariable.types new file mode 100644 index 00000000000..859542e70e1 --- /dev/null +++ b/tests/baselines/reference/controlFlowOuterVariable.types @@ -0,0 +1,42 @@ +=== tests/cases/compiler/controlFlowOuterVariable.ts === + +// Repros from #10641 + +const CONFIG = { +>CONFIG : { foo: string; setFoo: (foo: string) => void; } +>{ foo: '', setFoo: function(foo: string) { CONFIG.foo = foo; }} : { foo: string; setFoo: (foo: string) => void; } + + foo: '', +>foo : string +>'' : "" + + setFoo: function(foo: string) { +>setFoo : (foo: string) => void +>function(foo: string) { CONFIG.foo = foo; } : (foo: string) => void +>foo : string + + CONFIG.foo = foo; +>CONFIG.foo = foo : string +>CONFIG.foo : string +>CONFIG : { foo: string; setFoo: (foo: string) => void; } +>foo : string +>foo : string + } +}; + +const helper = function(t: T[]) { +>helper : (t: T[]) => void +>function(t: T[]) { helper(t.slice(1));} : (t: T[]) => void +>T : T +>t : T[] +>T : T + + helper(t.slice(1)); +>helper(t.slice(1)) : void +>helper : (t: T[]) => void +>t.slice(1) : T[] +>t.slice : (start?: number | undefined, end?: number | undefined) => T[] +>t : T[] +>slice : (start?: number | undefined, end?: number | undefined) => T[] +>1 : 1 +} diff --git a/tests/baselines/reference/controlFlowPropertyDeclarations.types b/tests/baselines/reference/controlFlowPropertyDeclarations.types index 030f22a1ffb..fae5ed27da2 100644 --- a/tests/baselines/reference/controlFlowPropertyDeclarations.types +++ b/tests/baselines/reference/controlFlowPropertyDeclarations.types @@ -8,7 +8,7 @@ var HTMLDOMPropertyConfig = require('react/lib/HTMLDOMPropertyConfig'); >HTMLDOMPropertyConfig : any >require('react/lib/HTMLDOMPropertyConfig') : any >require : any ->'react/lib/HTMLDOMPropertyConfig' : string +>'react/lib/HTMLDOMPropertyConfig' : "react/lib/HTMLDOMPropertyConfig" // Populate property map with ReactJS's attribute and property mappings // TODO handle/use .Properties value eg: MUST_USE_PROPERTY is not HTML attr @@ -70,13 +70,13 @@ function repeatString(string, times) { if (times < 0) { throw new Error(); } >times < 0 : boolean >times : any ->0 : number +>0 : 0 >new Error() : Error >Error : ErrorConstructor var repeated = ''; >repeated : string ->'' : string +>'' : "" while (times) { >times : any @@ -84,7 +84,7 @@ function repeatString(string, times) { if (times & 1) { >times & 1 : number >times : any ->1 : number +>1 : 1 repeated += string; >repeated += string : string @@ -94,7 +94,7 @@ function repeatString(string, times) { if (times >>= 1) { >times >>= 1 : number >times : any ->1 : number +>1 : 1 string += string; >string += string : any @@ -156,7 +156,7 @@ function trimEnd(haystack, needle) { >haystack.slice : any >haystack : any >slice : any ->0 : number +>0 : 0 >-needle.length : number >needle.length : any >needle : any @@ -281,7 +281,7 @@ export class HTMLtoJSX { var text = '' >text : string ->'' : string +>'' : "" if (this._inPreTag) { >this._inPreTag : boolean @@ -303,7 +303,7 @@ export class HTMLtoJSX { .replace(/\r/g, '') >replace : { (searchValue: string, replaceValue: string): string; (searchValue: string, replacer: (substring: string, ...args: any[]) => string): string; (searchValue: RegExp, replaceValue: string): string; (searchValue: RegExp, replacer: (substring: string, ...args: any[]) => string): string; } >/\r/g : RegExp ->'' : string +>'' : "" .replace(/( {2,}|\n|\t|\{|\})/g, function(whitespace) { >replace : { (searchValue: string, replaceValue: string): string; (searchValue: string, replacer: (substring: string, ...args: any[]) => string): string; (searchValue: RegExp, replaceValue: string): string; (searchValue: RegExp, replacer: (substring: string, ...args: any[]) => string): string; } @@ -314,13 +314,13 @@ export class HTMLtoJSX { return '{' + JSON.stringify(whitespace) + '}'; >'{' + JSON.stringify(whitespace) + '}' : string >'{' + JSON.stringify(whitespace) : string ->'{' : string +>'{' : "{" >JSON.stringify(whitespace) : string >JSON.stringify : { (value: any, replacer?: (key: string, value: any) => any, space?: string | number): string; (value: any, replacer?: (string | number)[], space?: string | number): string; } >JSON : JSON >stringify : { (value: any, replacer?: (key: string, value: any) => any, space?: string | number): string; (value: any, replacer?: (string | number)[], space?: string | number): string; } >whitespace : string ->'}' : string +>'}' : "}" }); } else { @@ -331,9 +331,9 @@ export class HTMLtoJSX { >text.indexOf : (searchString: string, position?: number) => number >text : string >indexOf : (searchString: string, position?: number) => number ->'\n' : string ->-1 : number ->1 : number +>'\n' : "\n" +>-1 : -1 +>1 : 1 } } this.output += text; diff --git a/tests/baselines/reference/controlFlowPropertyInitializer.types b/tests/baselines/reference/controlFlowPropertyInitializer.types index d35a4c13698..7da8fefe958 100644 --- a/tests/baselines/reference/controlFlowPropertyInitializer.types +++ b/tests/baselines/reference/controlFlowPropertyInitializer.types @@ -3,13 +3,13 @@ // Repro from #8967 const LANG = "Turbo Pascal" ->LANG : string ->"Turbo Pascal" : string +>LANG : "Turbo Pascal" +>"Turbo Pascal" : "Turbo Pascal" class BestLanguage { >BestLanguage : BestLanguage name = LANG; >name : string ->LANG : string +>LANG : "Turbo Pascal" } diff --git a/tests/baselines/reference/controlFlowWhileStatement.types b/tests/baselines/reference/controlFlowWhileStatement.types index 8caae2238d2..19f7fc49d02 100644 --- a/tests/baselines/reference/controlFlowWhileStatement.types +++ b/tests/baselines/reference/controlFlowWhileStatement.types @@ -9,9 +9,9 @@ function a() { >x : string | number x = ""; ->x = "" : string +>x = "" : "" >x : string | number ->"" : string +>"" : "" while (cond) { >cond : boolean @@ -27,9 +27,9 @@ function b() { >x : string | number x = ""; ->x = "" : string +>x = "" : "" >x : string | number ->"" : string +>"" : "" while (cond) { >cond : boolean @@ -38,9 +38,9 @@ function b() { >x : string x = 42; ->x = 42 : number +>x = 42 : 42 >x : string | number ->42 : number +>42 : 42 break; } @@ -52,9 +52,9 @@ function c() { >x : string | number x = ""; ->x = "" : string +>x = "" : "" >x : string | number ->"" : string +>"" : "" while (cond) { >cond : boolean @@ -83,9 +83,9 @@ function d() { >x : string | number x = ""; ->x = "" : string +>x = "" : "" >x : string | number ->"" : string +>"" : "" while (x = x.length) { >x = x.length : number @@ -98,9 +98,9 @@ function d() { >x : number x = ""; ->x = "" : string +>x = "" : "" >x : string | number ->"" : string +>"" : "" } } function e() { @@ -110,9 +110,9 @@ function e() { >x : string | number x = ""; ->x = "" : string +>x = "" : "" >x : string | number ->"" : string +>"" : "" while (cond) { >cond : boolean @@ -121,9 +121,9 @@ function e() { >x : string | number x = 42; ->x = 42 : number +>x = 42 : 42 >x : string | number ->42 : number +>42 : 42 x; // number >x : number @@ -140,9 +140,9 @@ function f() { >Function : Function x = ""; ->x = "" : string +>x = "" : "" >x : string | number | boolean | Function | RegExp ->"" : string +>"" : "" while (cond) { >cond : boolean @@ -151,9 +151,9 @@ function f() { >cond : true x = 42; ->x = 42 : number +>x = 42 : 42 >x : string | number | boolean | Function | RegExp ->42 : number +>42 : 42 break; } @@ -161,9 +161,9 @@ function f() { >cond : true x = true; ->x = true : boolean +>x = true : true >x : string | number | boolean | Function | RegExp ->true : boolean +>true : true continue; } @@ -173,7 +173,7 @@ function f() { >/a/ : RegExp } x; // string | number | boolean | RegExp ->x : string | number | boolean | RegExp +>x : string | number | true | RegExp } function g() { >g : () => void @@ -184,20 +184,20 @@ function g() { >Function : Function x = ""; ->x = "" : string +>x = "" : "" >x : string | number | boolean | Function | RegExp ->"" : string +>"" : "" while (true) { ->true : boolean +>true : true if (cond) { >cond : boolean x = 42; ->x = 42 : number +>x = 42 : 42 >x : string | number | boolean | Function | RegExp ->42 : number +>42 : 42 break; } @@ -205,9 +205,9 @@ function g() { >cond : boolean x = true; ->x = true : boolean +>x = true : true >x : string | number | boolean | Function | RegExp ->true : boolean +>true : true continue; } @@ -226,22 +226,22 @@ function h1() { >x : string | number | boolean x = ""; ->x = "" : string +>x = "" : "" >x : string | number | boolean ->"" : string +>"" : "" while (x > 1) { >x > 1 : boolean >x : string | number ->1 : number +>1 : 1 x; // string | number >x : string | number x = 1; ->x = 1 : number +>x = 1 : 1 >x : string | number | boolean ->1 : number +>1 : 1 x; // number >x : number @@ -260,9 +260,9 @@ function h2() { >x : string | number | boolean x = ""; ->x = "" : string +>x = "" : "" >x : string | number | boolean ->"" : string +>"" : "" while (cond) { >cond : boolean @@ -287,9 +287,9 @@ function h3() { >x : string | number | boolean x = ""; ->x = "" : string +>x = "" : "" >x : string | number | boolean ->"" : string +>"" : "" while (cond) { >cond : boolean diff --git a/tests/baselines/reference/declFileAccessors.types b/tests/baselines/reference/declFileAccessors.types index 00b10f7bf40..a038c66b271 100644 --- a/tests/baselines/reference/declFileAccessors.types +++ b/tests/baselines/reference/declFileAccessors.types @@ -9,7 +9,7 @@ export class c1 { >p3 : number return 10; ->10 : number +>10 : 10 } /** setter property*/ public set p3(/** this is value*/value: number) { @@ -21,7 +21,7 @@ export class c1 { >pp3 : number return 10; ->10 : number +>10 : 10 } /** private setter property*/ private set pp3(/** this is value*/value: number) { @@ -33,7 +33,7 @@ export class c1 { >s3 : number return 10; ->10 : number +>10 : 10 } /** setter property*/ static set s3( /** this is value*/value: number) { @@ -44,7 +44,7 @@ export class c1 { >nc_p3 : number return 10; ->10 : number +>10 : 10 } public set nc_p3(value: number) { >nc_p3 : number @@ -54,7 +54,7 @@ export class c1 { >nc_pp3 : number return 10; ->10 : number +>10 : 10 } private set nc_pp3(value: number) { >nc_pp3 : number @@ -64,7 +64,7 @@ export class c1 { >nc_s3 : string return ""; ->"" : string +>"" : "" } static set nc_s3(value: string) { >nc_s3 : string @@ -76,7 +76,7 @@ export class c1 { >onlyGetter : number return 10; ->10 : number +>10 : 10 } // Only setter property @@ -96,7 +96,7 @@ class c2 { >p3 : number return 10; ->10 : number +>10 : 10 } /** setter property*/ public set p3(/** this is value*/value: number) { @@ -108,7 +108,7 @@ class c2 { >pp3 : number return 10; ->10 : number +>10 : 10 } /** private setter property*/ private set pp3(/** this is value*/value: number) { @@ -120,7 +120,7 @@ class c2 { >s3 : number return 10; ->10 : number +>10 : 10 } /** setter property*/ static set s3( /** this is value*/value: number) { @@ -131,7 +131,7 @@ class c2 { >nc_p3 : number return 10; ->10 : number +>10 : 10 } public set nc_p3(value: number) { >nc_p3 : number @@ -141,7 +141,7 @@ class c2 { >nc_pp3 : number return 10; ->10 : number +>10 : 10 } private set nc_pp3(value: number) { >nc_pp3 : number @@ -151,7 +151,7 @@ class c2 { >nc_s3 : string return ""; ->"" : string +>"" : "" } static set nc_s3(value: string) { >nc_s3 : string @@ -163,7 +163,7 @@ class c2 { >onlyGetter : number return 10; ->10 : number +>10 : 10 } // Only setter property diff --git a/tests/baselines/reference/declFileConstructors.types b/tests/baselines/reference/declFileConstructors.types index 68782eb3617..733a624e776 100644 --- a/tests/baselines/reference/declFileConstructors.types +++ b/tests/baselines/reference/declFileConstructors.types @@ -38,7 +38,7 @@ export class ConstructorWithRestParamters { >rests.join : (separator?: string) => string >rests : string[] >join : (separator?: string) => string ->"" : string +>"" : "" } } @@ -85,7 +85,7 @@ export class ConstructorWithParameterInitializer { constructor(public x = "hello") { >x : string ->"hello" : string +>"hello" : "hello" } } @@ -128,7 +128,7 @@ class GlobalConstructorWithRestParamters { >rests.join : (separator?: string) => string >rests : string[] >join : (separator?: string) => string ->"" : string +>"" : "" } } @@ -175,6 +175,6 @@ class GlobalConstructorWithParameterInitializer { constructor(public x = "hello") { >x : string ->"hello" : string +>"hello" : "hello" } } diff --git a/tests/baselines/reference/declFileEnumUsedAsValue.types b/tests/baselines/reference/declFileEnumUsedAsValue.types index 19aa3de4331..fe323095922 100644 --- a/tests/baselines/reference/declFileEnumUsedAsValue.types +++ b/tests/baselines/reference/declFileEnumUsedAsValue.types @@ -4,13 +4,13 @@ enum e { >e : e a, ->a : e +>a : e.a b, ->b : e +>b : e.b c ->c : e +>c : e.c } var x = e; >x : typeof e diff --git a/tests/baselines/reference/declFileEnums.types b/tests/baselines/reference/declFileEnums.types index 5fb0d0736be..5b0bfff5bed 100644 --- a/tests/baselines/reference/declFileEnums.types +++ b/tests/baselines/reference/declFileEnums.types @@ -4,13 +4,13 @@ enum e1 { >e1 : e1 a, ->a : e1 +>a : e1.a b, ->b : e1 +>b : e1.b c ->c : e1 +>c : e1.c } enum e2 { @@ -18,17 +18,17 @@ enum e2 { a = 10, >a : e2 ->10 : number +>10 : 10 b = a + 2, >b : e2 >a + 2 : number >a : e2 ->2 : number +>2 : 2 c = 10, >c : e2 ->10 : number +>10 : 10 } enum e3 { @@ -36,7 +36,7 @@ enum e3 { a = 10, >a : e3 ->10 : number +>10 : 10 b = Math.PI, >b : e3 @@ -48,27 +48,27 @@ enum e3 { >c : e3 >a + 3 : number >a : e3 ->3 : number +>3 : 3 } enum e4 { >e4 : e4 a, ->a : e4 +>a : e4.a b, ->b : e4 +>b : e4.b c, ->c : e4 +>c : e4.c d = 10, ->d : e4 ->10 : number +>d : e4.d +>10 : 10 e ->e : e4 +>e : e4.e } enum e5 { diff --git a/tests/baselines/reference/declFileForVarList.types b/tests/baselines/reference/declFileForVarList.types index 5e55104666b..d4c401d2383 100644 --- a/tests/baselines/reference/declFileForVarList.types +++ b/tests/baselines/reference/declFileForVarList.types @@ -4,13 +4,13 @@ var x, y, z = 1; >x : any >y : any >z : number ->1 : number +>1 : 1 var x1 = 1, y2 = 2, z2 = 3; >x1 : number ->1 : number +>1 : 1 >y2 : number ->2 : number +>2 : 2 >z2 : number ->3 : number +>3 : 3 diff --git a/tests/baselines/reference/declFileFunctions.types b/tests/baselines/reference/declFileFunctions.types index 9ad974463b7..ee35577ce3e 100644 --- a/tests/baselines/reference/declFileFunctions.types +++ b/tests/baselines/reference/declFileFunctions.types @@ -29,7 +29,7 @@ export function fooWithRestParameters(a: string, ...rests: string[]) { >rests.join : (separator?: string) => string >rests : string[] >join : (separator?: string) => string ->"" : string +>"" : "" } export function fooWithOverloads(a: string): string; @@ -66,7 +66,7 @@ export function fooWithTypePredicate(a: any): a is number { >a : any return true; ->true : boolean +>true : true } export function fooWithTypePredicateAndMulitpleParams(a: any, b: any, c: any): a is number { >fooWithTypePredicateAndMulitpleParams : (a: any, b: any, c: any) => a is number @@ -76,7 +76,7 @@ export function fooWithTypePredicateAndMulitpleParams(a: any, b: any, c: any): a >a : any return true; ->true : boolean +>true : true } export function fooWithTypeTypePredicateAndGeneric(a: any): a is T { >fooWithTypeTypePredicateAndGeneric : (a: any) => a is T @@ -86,7 +86,7 @@ export function fooWithTypeTypePredicateAndGeneric(a: any): a is T { >T : T return true; ->true : boolean +>true : true } export function fooWithTypeTypePredicateAndRestParam(a: any, ...rest): a is number { >fooWithTypeTypePredicateAndRestParam : (a: any, ...rest: any[]) => a is number @@ -95,7 +95,7 @@ export function fooWithTypeTypePredicateAndRestParam(a: any, ...rest): a is numb >a : any return true; ->true : boolean +>true : true } /** This comment should appear for nonExportedFoo*/ @@ -127,7 +127,7 @@ function nonExportedFooWithRestParameters(a: string, ...rests: string[]) { >rests.join : (separator?: string) => string >rests : string[] >join : (separator?: string) => string ->"" : string +>"" : "" } function nonExportedFooWithOverloads(a: string): string; @@ -176,7 +176,7 @@ function globalfooWithRestParameters(a: string, ...rests: string[]) { >rests.join : (separator?: string) => string >rests : string[] >join : (separator?: string) => string ->"" : string +>"" : "" } function globalfooWithOverloads(a: string): string; >globalfooWithOverloads : { (a: string): string; (a: number): number; } diff --git a/tests/baselines/reference/declFileMethods.types b/tests/baselines/reference/declFileMethods.types index ecd7b8e0cff..44c08117e93 100644 --- a/tests/baselines/reference/declFileMethods.types +++ b/tests/baselines/reference/declFileMethods.types @@ -32,7 +32,7 @@ export class c1 { >rests.join : (separator?: string) => string >rests : string[] >join : (separator?: string) => string ->"" : string +>"" : "" } public fooWithOverloads(a: string): string; @@ -81,7 +81,7 @@ export class c1 { >rests.join : (separator?: string) => string >rests : string[] >join : (separator?: string) => string ->"" : string +>"" : "" } private privateFooWithOverloads(a: string): string; >privateFooWithOverloads : { (a: string): string; (a: number): number; } @@ -129,7 +129,7 @@ export class c1 { >rests.join : (separator?: string) => string >rests : string[] >join : (separator?: string) => string ->"" : string +>"" : "" } static staticFooWithOverloads(a: string): string; >staticFooWithOverloads : { (a: string): string; (a: number): number; } @@ -177,7 +177,7 @@ export class c1 { >rests.join : (separator?: string) => string >rests : string[] >join : (separator?: string) => string ->"" : string +>"" : "" } private static privateStaticFooWithOverloads(a: string): string; >privateStaticFooWithOverloads : { (a: string): string; (a: number): number; } @@ -259,7 +259,7 @@ class c2 { >rests.join : (separator?: string) => string >rests : string[] >join : (separator?: string) => string ->"" : string +>"" : "" } public fooWithOverloads(a: string): string; @@ -308,7 +308,7 @@ class c2 { >rests.join : (separator?: string) => string >rests : string[] >join : (separator?: string) => string ->"" : string +>"" : "" } private privateFooWithOverloads(a: string): string; >privateFooWithOverloads : { (a: string): string; (a: number): number; } @@ -356,7 +356,7 @@ class c2 { >rests.join : (separator?: string) => string >rests : string[] >join : (separator?: string) => string ->"" : string +>"" : "" } static staticFooWithOverloads(a: string): string; >staticFooWithOverloads : { (a: string): string; (a: number): number; } @@ -404,7 +404,7 @@ class c2 { >rests.join : (separator?: string) => string >rests : string[] >join : (separator?: string) => string ->"" : string +>"" : "" } private static privateStaticFooWithOverloads(a: string): string; >privateStaticFooWithOverloads : { (a: string): string; (a: number): number; } diff --git a/tests/baselines/reference/declFileObjectLiteralWithAccessors.types b/tests/baselines/reference/declFileObjectLiteralWithAccessors.types index f7bb57b0e1e..389b88de565 100644 --- a/tests/baselines/reference/declFileObjectLiteralWithAccessors.types +++ b/tests/baselines/reference/declFileObjectLiteralWithAccessors.types @@ -9,7 +9,7 @@ function /*1*/makePoint(x: number) { b: 10, >b : number ->10 : number +>10 : 10 get x() { return x; }, >x : number @@ -30,7 +30,7 @@ var /*4*/point = makePoint(2); >point : { b: number; x: number; } >makePoint(2) : { b: number; x: number; } >makePoint : (x: number) => { b: number; x: number; } ->2 : number +>2 : 2 var /*2*/x = point.x; >x : number @@ -39,9 +39,9 @@ var /*2*/x = point.x; >x : number point./*3*/x = 30; ->point./*3*/x = 30 : number +>point./*3*/x = 30 : 30 >point./*3*/x : number >point : { b: number; x: number; } >x : number ->30 : number +>30 : 30 diff --git a/tests/baselines/reference/declFileObjectLiteralWithOnlyGetter.types b/tests/baselines/reference/declFileObjectLiteralWithOnlyGetter.types index dd3cbe20983..c4e563f5a03 100644 --- a/tests/baselines/reference/declFileObjectLiteralWithOnlyGetter.types +++ b/tests/baselines/reference/declFileObjectLiteralWithOnlyGetter.types @@ -17,7 +17,7 @@ var /*4*/point = makePoint(2); >point : { readonly x: number; } >makePoint(2) : { readonly x: number; } >makePoint : (x: number) => { readonly x: number; } ->2 : number +>2 : 2 var /*2*/x = point./*3*/x; >x : number diff --git a/tests/baselines/reference/declFileObjectLiteralWithOnlySetter.types b/tests/baselines/reference/declFileObjectLiteralWithOnlySetter.types index 2b9b98a8963..2f15818e0f2 100644 --- a/tests/baselines/reference/declFileObjectLiteralWithOnlySetter.types +++ b/tests/baselines/reference/declFileObjectLiteralWithOnlySetter.types @@ -9,7 +9,7 @@ function /*1*/makePoint(x: number) { b: 10, >b : number ->10 : number +>10 : 10 set x(a: number) { this.b = a; } >x : number @@ -26,12 +26,12 @@ var /*3*/point = makePoint(2); >point : { b: number; x: number; } >makePoint(2) : { b: number; x: number; } >makePoint : (x: number) => { b: number; x: number; } ->2 : number +>2 : 2 point./*2*/x = 30; ->point./*2*/x = 30 : number +>point./*2*/x = 30 : 30 >point./*2*/x : number >point : { b: number; x: number; } >x : number ->30 : number +>30 : 30 diff --git a/tests/baselines/reference/declFilePrivateStatic.types b/tests/baselines/reference/declFilePrivateStatic.types index 35aaa3acdeb..29f8f1a9aab 100644 --- a/tests/baselines/reference/declFilePrivateStatic.types +++ b/tests/baselines/reference/declFilePrivateStatic.types @@ -5,11 +5,11 @@ class C { private static x = 1; >x : number ->1 : number +>1 : 1 static y = 1; >y : number ->1 : number +>1 : 1 private static a() { } >a : () => void @@ -19,11 +19,11 @@ class C { private static get c() { return 1; } >c : number ->1 : number +>1 : 1 static get d() { return 1; } >d : number ->1 : number +>1 : 1 private static set e(v) { } >e : any diff --git a/tests/baselines/reference/declFileRegressionTests.types b/tests/baselines/reference/declFileRegressionTests.types index 7b8933e1def..721f5b1e70a 100644 --- a/tests/baselines/reference/declFileRegressionTests.types +++ b/tests/baselines/reference/declFileRegressionTests.types @@ -7,10 +7,10 @@ var n = { w: null, x: '', y: () => { }, z: 32 }; >w : null >null : null >x : string ->'' : string +>'' : "" >y : () => void >() => { } : () => void >z : number ->32 : number +>32 : 32 diff --git a/tests/baselines/reference/declFileRestParametersOfFunctionAndFunctionType.types b/tests/baselines/reference/declFileRestParametersOfFunctionAndFunctionType.types index 0bfa5b6312c..8e0cdd8d409 100644 --- a/tests/baselines/reference/declFileRestParametersOfFunctionAndFunctionType.types +++ b/tests/baselines/reference/declFileRestParametersOfFunctionAndFunctionType.types @@ -29,7 +29,7 @@ var f6 = () => { return [10]; } >() => { return [10]; } : () => any[] >[10] : any[] >10 : any ->10 : number +>10 : 10 diff --git a/tests/baselines/reference/declFileTypeAnnotationBuiltInType.types b/tests/baselines/reference/declFileTypeAnnotationBuiltInType.types index a1b2d9edd43..87776b3b417 100644 --- a/tests/baselines/reference/declFileTypeAnnotationBuiltInType.types +++ b/tests/baselines/reference/declFileTypeAnnotationBuiltInType.types @@ -5,13 +5,13 @@ function foo(): string { >foo : () => string return ""; ->"" : string +>"" : "" } function foo2() { >foo2 : () => string return ""; ->"" : string +>"" : "" } // number @@ -19,13 +19,13 @@ function foo3(): number { >foo3 : () => number return 10; ->10 : number +>10 : 10 } function foo4() { >foo4 : () => number return 10; ->10 : number +>10 : 10 } // boolean @@ -33,13 +33,13 @@ function foo5(): boolean { >foo5 : () => boolean return true; ->true : boolean +>true : true } function foo6() { >foo6 : () => boolean return false; ->false : boolean +>false : false } // void diff --git a/tests/baselines/reference/declFileTypeAnnotationParenType.types b/tests/baselines/reference/declFileTypeAnnotationParenType.types index 31b6ad03751..f3c8db5533a 100644 --- a/tests/baselines/reference/declFileTypeAnnotationParenType.types +++ b/tests/baselines/reference/declFileTypeAnnotationParenType.types @@ -25,19 +25,19 @@ var y = [() => new c()]; var k: (() => c) | string = (() => new c()) || ""; >k : string | (() => c) >c : c ->(() => new c()) || "" : string | (() => c) +>(() => new c()) || "" : "" | (() => c) >(() => new c()) : () => c >() => new c() : () => c >new c() : c >c : typeof c ->"" : string +>"" : "" var l = (() => new c()) || ""; >l : string | (() => c) ->(() => new c()) || "" : string | (() => c) +>(() => new c()) || "" : "" | (() => c) >(() => new c()) : () => c >() => new c() : () => c >new c() : c >c : typeof c ->"" : string +>"" : "" diff --git a/tests/baselines/reference/declFileTypeofEnum.types b/tests/baselines/reference/declFileTypeofEnum.types index 1c900a453b7..1d69d0594c8 100644 --- a/tests/baselines/reference/declFileTypeofEnum.types +++ b/tests/baselines/reference/declFileTypeofEnum.types @@ -4,32 +4,32 @@ enum days { >days : days monday, ->monday : days +>monday : days.monday tuesday, ->tuesday : days +>tuesday : days.tuesday wednesday, ->wednesday : days +>wednesday : days.wednesday thursday, ->thursday : days +>thursday : days.thursday friday, ->friday : days +>friday : days.friday saturday, ->saturday : days +>saturday : days.saturday sunday ->sunday : days +>sunday : days.sunday } var weekendDay = days.saturday; >weekendDay : days ->days.saturday : days +>days.saturday : days.saturday >days : typeof days ->saturday : days +>saturday : days.saturday var daysOfMonth = days; >daysOfMonth : typeof days diff --git a/tests/baselines/reference/declFileTypeofInAnonymousType.types b/tests/baselines/reference/declFileTypeofInAnonymousType.types index fa9d0bcbd17..2ab5e673fb2 100644 --- a/tests/baselines/reference/declFileTypeofInAnonymousType.types +++ b/tests/baselines/reference/declFileTypeofInAnonymousType.types @@ -10,13 +10,13 @@ module m1 { >e : e weekday, ->weekday : e +>weekday : e.weekday weekend, ->weekend : e +>weekend : e.weekend holiday ->holiday : e +>holiday : e.holiday } } var a: { c: m1.c; }; @@ -74,10 +74,10 @@ var d = { mh: m1.e.holiday >mh : m1.e ->m1.e.holiday : m1.e +>m1.e.holiday : m1.e.holiday >m1.e : typeof m1.e >m1 : typeof m1 >e : typeof m1.e ->holiday : m1.e +>holiday : m1.e.holiday }; diff --git a/tests/baselines/reference/declInput.types b/tests/baselines/reference/declInput.types index e59e3811fdf..edca1b9a943 100644 --- a/tests/baselines/reference/declInput.types +++ b/tests/baselines/reference/declInput.types @@ -9,7 +9,7 @@ class bar { public f() { return ''; } >f : () => string ->'' : string +>'' : "" public g() { return {a: null, b: undefined, c: void 4 }; } >g : () => { a: bar; b: any; c: any; } @@ -22,16 +22,16 @@ class bar { >undefined : undefined >c : undefined >void 4 : undefined ->4 : number +>4 : 4 public h(x = 4, y = null, z = '') { x++; } >h : (x?: number, y?: any, z?: string) => void >x : number ->4 : number +>4 : 4 >y : any >null : null >z : string ->'' : string +>'' : "" >x++ : number >x : number } diff --git a/tests/baselines/reference/declInput3.types b/tests/baselines/reference/declInput3.types index 0dcbc6bd3cd..aaa947cdca9 100644 --- a/tests/baselines/reference/declInput3.types +++ b/tests/baselines/reference/declInput3.types @@ -9,7 +9,7 @@ class bar { public f() { return ''; } >f : () => string ->'' : string +>'' : "" public g() { return {a: null, b: undefined, c: void 4 }; } >g : () => { a: bar; b: any; c: any; } @@ -22,16 +22,16 @@ class bar { >undefined : undefined >c : undefined >void 4 : undefined ->4 : number +>4 : 4 public h(x = 4, y = null, z = '') { x++; } >h : (x?: number, y?: any, z?: string) => void >x : number ->4 : number +>4 : 4 >y : any >null : null >z : string ->'' : string +>'' : "" >x++ : number >x : number } diff --git a/tests/baselines/reference/declarationEmitDefaultExport3.types b/tests/baselines/reference/declarationEmitDefaultExport3.types index 91ee71f61ac..2717e248784 100644 --- a/tests/baselines/reference/declarationEmitDefaultExport3.types +++ b/tests/baselines/reference/declarationEmitDefaultExport3.types @@ -3,5 +3,5 @@ export default function foo() { >foo : () => string return "" ->"" : string +>"" : "" } diff --git a/tests/baselines/reference/declarationEmitDefaultExport4.types b/tests/baselines/reference/declarationEmitDefaultExport4.types index ab97484176d..db47735b1ed 100644 --- a/tests/baselines/reference/declarationEmitDefaultExport4.types +++ b/tests/baselines/reference/declarationEmitDefaultExport4.types @@ -1,5 +1,5 @@ === tests/cases/compiler/declarationEmitDefaultExport4.ts === export default function () { return 1; ->1 : number +>1 : 1 } diff --git a/tests/baselines/reference/declarationEmitDefaultExport5.types b/tests/baselines/reference/declarationEmitDefaultExport5.types index d2b177cc084..71f0cbde697 100644 --- a/tests/baselines/reference/declarationEmitDefaultExport5.types +++ b/tests/baselines/reference/declarationEmitDefaultExport5.types @@ -1,6 +1,6 @@ === tests/cases/compiler/declarationEmitDefaultExport5.ts === export default 1 + 2; >1 + 2 : number ->1 : number ->2 : number +>1 : 1 +>2 : 2 diff --git a/tests/baselines/reference/declarationEmitDefaultExport8.types b/tests/baselines/reference/declarationEmitDefaultExport8.types index bd99ee14530..ed66a0fcb6f 100644 --- a/tests/baselines/reference/declarationEmitDefaultExport8.types +++ b/tests/baselines/reference/declarationEmitDefaultExport8.types @@ -2,7 +2,7 @@ var _default = 1; >_default : number ->1 : number +>1 : 1 export {_default as d} >_default : number @@ -10,6 +10,6 @@ export {_default as d} export default 1 + 2; >1 + 2 : number ->1 : number ->2 : number +>1 : 1 +>2 : 2 diff --git a/tests/baselines/reference/declarationEmitDefaultExportWithTempVarName.js b/tests/baselines/reference/declarationEmitDefaultExportWithTempVarName.js index 643f9a8c889..44e0560132f 100644 --- a/tests/baselines/reference/declarationEmitDefaultExportWithTempVarName.js +++ b/tests/baselines/reference/declarationEmitDefaultExportWithTempVarName.js @@ -15,5 +15,5 @@ System.register([], function (exports_1, context_1) { //// [pi.d.ts] -declare var _default: number; +declare var _default: 3.14159; export default _default; diff --git a/tests/baselines/reference/declarationEmitDefaultExportWithTempVarNameWithBundling.js b/tests/baselines/reference/declarationEmitDefaultExportWithTempVarNameWithBundling.js index 35bdf2f9ecc..6b16d06cb84 100644 --- a/tests/baselines/reference/declarationEmitDefaultExportWithTempVarNameWithBundling.js +++ b/tests/baselines/reference/declarationEmitDefaultExportWithTempVarNameWithBundling.js @@ -17,6 +17,6 @@ System.register("pi", [], function (exports_1, context_1) { //// [app.d.ts] declare module "pi" { - var _default: number; + var _default: 3.14159; export default _default; } diff --git a/tests/baselines/reference/declarationEmitDestructuring3.types b/tests/baselines/reference/declarationEmitDestructuring3.types index da9fc6d6606..8e15071c979 100644 --- a/tests/baselines/reference/declarationEmitDestructuring3.types +++ b/tests/baselines/reference/declarationEmitDestructuring3.types @@ -10,8 +10,8 @@ function foo([x, ...y] = [1, "string", true]) { } >x : string | number | boolean >y : (string | number | boolean)[] >[1, "string", true] : (string | number | boolean)[] ->1 : number ->"string" : string ->true : boolean +>1 : 1 +>"string" : "string" +>true : true diff --git a/tests/baselines/reference/declarationEmitDestructuring5.types b/tests/baselines/reference/declarationEmitDestructuring5.types index 961dea62bcb..c0223a0f061 100644 --- a/tests/baselines/reference/declarationEmitDestructuring5.types +++ b/tests/baselines/reference/declarationEmitDestructuring5.types @@ -22,11 +22,11 @@ function bar1([z, , , ] = [1, 3, 4, 6, 7]) { } > : undefined > : undefined >[1, 3, 4, 6, 7] : [number, number, number, number, number] ->1 : number ->3 : number ->4 : number ->6 : number ->7 : number +>1 : 1 +>3 : 3 +>4 : 4 +>6 : 6 +>7 : 7 function bar2([,,z, , , ]) { } >bar2 : ([, , z, , ,]: [any, any, any, any, any]) => void diff --git a/tests/baselines/reference/declarationEmitDestructuringArrayPattern1.types b/tests/baselines/reference/declarationEmitDestructuringArrayPattern1.types index 0feeaf2db1a..640062c0785 100644 --- a/tests/baselines/reference/declarationEmitDestructuringArrayPattern1.types +++ b/tests/baselines/reference/declarationEmitDestructuringArrayPattern1.types @@ -2,36 +2,36 @@ var [] = [1, "hello"]; // Dont emit anything >[1, "hello"] : (string | number)[] ->1 : number ->"hello" : string +>1 : 1 +>"hello" : "hello" var [x] = [1, "hello"]; // emit x: number >x : number >[1, "hello"] : [number, string] ->1 : number ->"hello" : string +>1 : 1 +>"hello" : "hello" var [x1, y1] = [1, "hello"]; // emit x1: number, y1: string >x1 : number >y1 : string >[1, "hello"] : [number, string] ->1 : number ->"hello" : string +>1 : 1 +>"hello" : "hello" var [, , z1] = [0, 1, 2]; // emit z1: number > : undefined > : undefined >z1 : number >[0, 1, 2] : [number, number, number] ->0 : number ->1 : number ->2 : number +>0 : 0 +>1 : 1 +>2 : 2 var a = [1, "hello"]; >a : (string | number)[] >[1, "hello"] : (string | number)[] ->1 : number ->"hello" : string +>1 : 1 +>"hello" : "hello" var [x2] = a; // emit x2: number | string >x2 : string | number diff --git a/tests/baselines/reference/declarationEmitDestructuringArrayPattern3.types b/tests/baselines/reference/declarationEmitDestructuringArrayPattern3.types index 406494aa13b..3bd324a1c26 100644 --- a/tests/baselines/reference/declarationEmitDestructuringArrayPattern3.types +++ b/tests/baselines/reference/declarationEmitDestructuringArrayPattern3.types @@ -6,6 +6,6 @@ module M { >a : number >b : number >[1, 2] : [number, number] ->1 : number ->2 : number +>1 : 1 +>2 : 2 } diff --git a/tests/baselines/reference/declarationEmitDestructuringArrayPattern4.types b/tests/baselines/reference/declarationEmitDestructuringArrayPattern4.types index 2cc56abcb05..0141b3f79e7 100644 --- a/tests/baselines/reference/declarationEmitDestructuringArrayPattern4.types +++ b/tests/baselines/reference/declarationEmitDestructuringArrayPattern4.types @@ -2,26 +2,26 @@ var [...a5] = [1, 2, 3]; >a5 : number[] >[1, 2, 3] : number[] ->1 : number ->2 : number ->3 : number +>1 : 1 +>2 : 2 +>3 : 3 var [x14, ...a6] = [1, 2, 3]; >x14 : number >a6 : number[] >[1, 2, 3] : number[] ->1 : number ->2 : number ->3 : number +>1 : 1 +>2 : 2 +>3 : 3 var [x15, y15, ...a7] = [1, 2, 3]; >x15 : number >y15 : number >a7 : number[] >[1, 2, 3] : number[] ->1 : number ->2 : number ->3 : number +>1 : 1 +>2 : 2 +>3 : 3 var [x16, y16, z16, ...a8] = [1, 2, 3]; >x16 : number @@ -29,33 +29,33 @@ var [x16, y16, z16, ...a8] = [1, 2, 3]; >z16 : number >a8 : number[] >[1, 2, 3] : number[] ->1 : number ->2 : number ->3 : number +>1 : 1 +>2 : 2 +>3 : 3 var [...a9] = [1, "hello", true]; >a9 : (string | number | boolean)[] >[1, "hello", true] : (string | number | boolean)[] ->1 : number ->"hello" : string ->true : boolean +>1 : 1 +>"hello" : "hello" +>true : true var [x17, ...a10] = [1, "hello", true]; >x17 : string | number | boolean >a10 : (string | number | boolean)[] >[1, "hello", true] : (string | number | boolean)[] ->1 : number ->"hello" : string ->true : boolean +>1 : 1 +>"hello" : "hello" +>true : true var [x18, y18, ...a12] = [1, "hello", true]; >x18 : string | number | boolean >y18 : string | number | boolean >a12 : (string | number | boolean)[] >[1, "hello", true] : (string | number | boolean)[] ->1 : number ->"hello" : string ->true : boolean +>1 : 1 +>"hello" : "hello" +>true : true var [x19, y19, z19, ...a13] = [1, "hello", true]; >x19 : string | number | boolean @@ -63,7 +63,7 @@ var [x19, y19, z19, ...a13] = [1, "hello", true]; >z19 : string | number | boolean >a13 : (string | number | boolean)[] >[1, "hello", true] : (string | number | boolean)[] ->1 : number ->"hello" : string ->true : boolean +>1 : 1 +>"hello" : "hello" +>true : true diff --git a/tests/baselines/reference/declarationEmitDestructuringArrayPattern5.types b/tests/baselines/reference/declarationEmitDestructuringArrayPattern5.types index fa5720f4da7..41f4660bf29 100644 --- a/tests/baselines/reference/declarationEmitDestructuringArrayPattern5.types +++ b/tests/baselines/reference/declarationEmitDestructuringArrayPattern5.types @@ -4,18 +4,18 @@ var [, , z] = [1, 2, 4]; > : undefined >z : number >[1, 2, 4] : [number, number, number] ->1 : number ->2 : number ->4 : number +>1 : 1 +>2 : 2 +>4 : 4 var [, a, , ] = [3, 4, 5]; > : undefined >a : number > : undefined >[3, 4, 5] : [number, number, number] ->3 : number ->4 : number ->5 : number +>3 : 3 +>4 : 4 +>5 : 5 var [, , [, b, ]] = [3,5,[0, 1]]; > : undefined @@ -23,9 +23,9 @@ var [, , [, b, ]] = [3,5,[0, 1]]; > : undefined >b : number >[3,5,[0, 1]] : [number, number, [number, number]] ->3 : number ->5 : number +>3 : 3 +>5 : 5 >[0, 1] : [number, number] ->0 : number ->1 : number +>0 : 0 +>1 : 1 diff --git a/tests/baselines/reference/declarationEmitDestructuringObjectLiteralPattern2.types b/tests/baselines/reference/declarationEmitDestructuringObjectLiteralPattern2.types index 49d4e2e837c..f8f9a6a319c 100644 --- a/tests/baselines/reference/declarationEmitDestructuringObjectLiteralPattern2.types +++ b/tests/baselines/reference/declarationEmitDestructuringObjectLiteralPattern2.types @@ -11,36 +11,36 @@ var { a: x11, b: { a: y11, b: { a: z11 }}} = { a: 1, b: { a: "hello", b: { a: tr >z11 : boolean >{ a: 1, b: { a: "hello", b: { a: true } } } : { a: number; b: { a: string; b: { a: boolean; }; }; } >a : number ->1 : number +>1 : 1 >b : { a: string; b: { a: boolean; }; } >{ a: "hello", b: { a: true } } : { a: string; b: { a: boolean; }; } >a : string ->"hello" : string +>"hello" : "hello" >b : { a: boolean; } >{ a: true } : { a: boolean; } >a : boolean ->true : boolean +>true : true function f15() { >f15 : () => { a4: string; b4: number; c4: boolean; } var a4 = "hello"; >a4 : string ->"hello" : string +>"hello" : "hello" var b4 = 1; >b4 : number ->1 : number +>1 : 1 var c4 = true; >c4 : boolean ->true : boolean +>true : true return { a4, b4, c4 }; >{ a4, b4, c4 } : { a4: string; b4: number; c4: boolean; } >a4 : string >b4 : number ->c4 : boolean +>c4 : true } var { a4, b4, c4 } = f15(); >a4 : string diff --git a/tests/baselines/reference/declarationEmit_bindingPatterns.types b/tests/baselines/reference/declarationEmit_bindingPatterns.types index eff2d4bd4a3..b3da24a2b95 100644 --- a/tests/baselines/reference/declarationEmit_bindingPatterns.types +++ b/tests/baselines/reference/declarationEmit_bindingPatterns.types @@ -5,7 +5,7 @@ const k = ({x: z = 'y'}) => { } >({x: z = 'y'}) => { } : ({x: z}: { x?: string; }) => void >x : any >z : string ->'y' : string +>'y' : "y" var a; >a : any diff --git a/tests/baselines/reference/declarationEmit_classMemberNameConflict.types b/tests/baselines/reference/declarationEmit_classMemberNameConflict.types index c76072413e5..66bc493b2ee 100644 --- a/tests/baselines/reference/declarationEmit_classMemberNameConflict.types +++ b/tests/baselines/reference/declarationEmit_classMemberNameConflict.types @@ -41,7 +41,7 @@ export class C3 { get C3() { return 0; } // has to be the same as the class name >C3 : number ->0 : number +>0 : 0 bar() { >bar : () => (t: typeof C3) => void diff --git a/tests/baselines/reference/declarationEmit_classMemberNameConflict2.js b/tests/baselines/reference/declarationEmit_classMemberNameConflict2.js index 03dc5cdbafd..d3ebddc8d17 100644 --- a/tests/baselines/reference/declarationEmit_classMemberNameConflict2.js +++ b/tests/baselines/reference/declarationEmit_classMemberNameConflict2.js @@ -45,7 +45,7 @@ var Foo = (function () { //// [declarationEmit_classMemberNameConflict2.d.ts] -declare const Bar: string; +declare const Bar: "bar"; declare enum Hello { World = 0, } diff --git a/tests/baselines/reference/declarationEmit_classMemberNameConflict2.types b/tests/baselines/reference/declarationEmit_classMemberNameConflict2.types index 9f8ddd8a2d5..dd184f7ba34 100644 --- a/tests/baselines/reference/declarationEmit_classMemberNameConflict2.types +++ b/tests/baselines/reference/declarationEmit_classMemberNameConflict2.types @@ -1,8 +1,8 @@ === tests/cases/compiler/declarationEmit_classMemberNameConflict2.ts === const Bar = 'bar'; ->Bar : string ->'bar' : string +>Bar : "bar" +>'bar' : "bar" enum Hello { >Hello : Hello @@ -24,7 +24,7 @@ class Foo { // Same names + string => OK Bar = Bar; >Bar : string ->Bar : string +>Bar : "bar" // Same names + enum => OK Hello = Hello; diff --git a/tests/baselines/reference/declarationEmit_expressionInExtends2.types b/tests/baselines/reference/declarationEmit_expressionInExtends2.types index 77a1539267d..3f2b8964a2d 100644 --- a/tests/baselines/reference/declarationEmit_expressionInExtends2.types +++ b/tests/baselines/reference/declarationEmit_expressionInExtends2.types @@ -28,5 +28,5 @@ class MyClass extends getClass(2) { >MyClass : MyClass >getClass(2) : C >getClass : (c: T) => typeof C ->2 : number +>2 : 2 } diff --git a/tests/baselines/reference/declarationEmit_invalidReference.types b/tests/baselines/reference/declarationEmit_invalidReference.types index 35d623c3c05..942f2088fc0 100644 --- a/tests/baselines/reference/declarationEmit_invalidReference.types +++ b/tests/baselines/reference/declarationEmit_invalidReference.types @@ -2,5 +2,5 @@ /// var x = 0; >x : number ->0 : number +>0 : 0 diff --git a/tests/baselines/reference/declarationEmit_protectedMembers.types b/tests/baselines/reference/declarationEmit_protectedMembers.types index d541e1d14d2..dd2f0012bf9 100644 --- a/tests/baselines/reference/declarationEmit_protectedMembers.types +++ b/tests/baselines/reference/declarationEmit_protectedMembers.types @@ -22,7 +22,7 @@ class C1 { protected get accessor() { return 0; } >accessor : number ->0 : number +>0 : 0 protected static sx: number; >sx : number @@ -42,7 +42,7 @@ class C1 { protected static get staticGetter() { return 0; } >staticGetter : number ->0 : number +>0 : 0 } // Derived class overriding protected members @@ -110,7 +110,7 @@ class C3 extends C2 { static get staticGetter() { return 1; } >staticGetter : number ->1 : number +>1 : 1 } // Protected properties in constructors diff --git a/tests/baselines/reference/declarationsAndAssignments.errors.txt b/tests/baselines/reference/declarationsAndAssignments.errors.txt index 3ed9e241c39..64bd8d7e578 100644 --- a/tests/baselines/reference/declarationsAndAssignments.errors.txt +++ b/tests/baselines/reference/declarationsAndAssignments.errors.txt @@ -5,7 +5,7 @@ tests/cases/conformance/es6/destructuring/declarationsAndAssignments.ts(23,25): tests/cases/conformance/es6/destructuring/declarationsAndAssignments.ts(24,19): error TS2353: Object literal may only specify known properties, and 'x' does not exist in type '{ y: any; }'. tests/cases/conformance/es6/destructuring/declarationsAndAssignments.ts(28,28): error TS2353: Object literal may only specify known properties, and 'y' does not exist in type '{ x: any; }'. tests/cases/conformance/es6/destructuring/declarationsAndAssignments.ts(29,22): error TS2353: Object literal may only specify known properties, and 'x' does not exist in type '{ y: any; }'. -tests/cases/conformance/es6/destructuring/declarationsAndAssignments.ts(56,17): error TS2322: Type 'number' is not assignable to type 'string'. +tests/cases/conformance/es6/destructuring/declarationsAndAssignments.ts(58,9): error TS2403: Subsequent variable declarations must have the same type. Variable 'y' must be of type 'string | 1', but here has type 'string'. tests/cases/conformance/es6/destructuring/declarationsAndAssignments.ts(62,10): error TS2525: Initializer provides no value for this binding element and the binding element has no default value. tests/cases/conformance/es6/destructuring/declarationsAndAssignments.ts(62,13): error TS2525: Initializer provides no value for this binding element and the binding element has no default value. tests/cases/conformance/es6/destructuring/declarationsAndAssignments.ts(62,16): error TS2525: Initializer provides no value for this binding element and the binding element has no default value. @@ -17,10 +17,10 @@ tests/cases/conformance/es6/destructuring/declarationsAndAssignments.ts(73,11): tests/cases/conformance/es6/destructuring/declarationsAndAssignments.ts(73,14): error TS2525: Initializer provides no value for this binding element and the binding element has no default value. tests/cases/conformance/es6/destructuring/declarationsAndAssignments.ts(74,11): error TS2459: Type 'undefined[]' has no property 'a' and no string index signature. tests/cases/conformance/es6/destructuring/declarationsAndAssignments.ts(74,14): error TS2459: Type 'undefined[]' has no property 'b' and no string index signature. -tests/cases/conformance/es6/destructuring/declarationsAndAssignments.ts(106,5): error TS2345: Argument of type '[number, [string, { y: boolean; }]]' is not assignable to parameter of type '[number, [string, { x: any; y?: boolean; }]]'. - Type '[string, { y: boolean; }]' is not assignable to type '[string, { x: any; y?: boolean; }]'. - Type '{ y: boolean; }' is not assignable to type '{ x: any; y?: boolean; }'. - Property 'x' is missing in type '{ y: boolean; }'. +tests/cases/conformance/es6/destructuring/declarationsAndAssignments.ts(106,5): error TS2345: Argument of type '[number, [string, { y: false; }]]' is not assignable to parameter of type '[number, [string, { x: any; y?: boolean; }]]'. + Type '[string, { y: false; }]' is not assignable to type '[string, { x: any; y?: boolean; }]'. + Type '{ y: false; }' is not assignable to type '{ x: any; y?: boolean; }'. + Property 'x' is missing in type '{ y: false; }'. tests/cases/conformance/es6/destructuring/declarationsAndAssignments.ts(138,6): error TS2322: Type 'string' is not assignable to type 'number'. tests/cases/conformance/es6/destructuring/declarationsAndAssignments.ts(138,9): error TS2322: Type 'number' is not assignable to type 'string'. @@ -96,10 +96,10 @@ tests/cases/conformance/es6/destructuring/declarationsAndAssignments.ts(138,9): function f7() { var [x = 0, y = 1] = [1, "hello"]; // Error, initializer for y must be string - ~ -!!! error TS2322: Type 'number' is not assignable to type 'string'. var x: number; var y: string; + ~ +!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'y' must be of type 'string | 1', but here has type 'string'. } function f8() { @@ -171,10 +171,10 @@ tests/cases/conformance/es6/destructuring/declarationsAndAssignments.ts(138,9): f14([2, ["abc", { x: 0 }]]); f14([2, ["abc", { y: false }]]); // Error, no x ~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2345: Argument of type '[number, [string, { y: boolean; }]]' is not assignable to parameter of type '[number, [string, { x: any; y?: boolean; }]]'. -!!! error TS2345: Type '[string, { y: boolean; }]' is not assignable to type '[string, { x: any; y?: boolean; }]'. -!!! error TS2345: Type '{ y: boolean; }' is not assignable to type '{ x: any; y?: boolean; }'. -!!! error TS2345: Property 'x' is missing in type '{ y: boolean; }'. +!!! error TS2345: Argument of type '[number, [string, { y: false; }]]' is not assignable to parameter of type '[number, [string, { x: any; y?: boolean; }]]'. +!!! error TS2345: Type '[string, { y: false; }]' is not assignable to type '[string, { x: any; y?: boolean; }]'. +!!! error TS2345: Type '{ y: false; }' is not assignable to type '{ x: any; y?: boolean; }'. +!!! error TS2345: Property 'x' is missing in type '{ y: false; }'. module M { export var [a, b] = [1, 2]; diff --git a/tests/baselines/reference/declareFileExportAssignmentWithVarFromVariableStatement.types b/tests/baselines/reference/declareFileExportAssignmentWithVarFromVariableStatement.types index c33ed5219a8..db7096752c5 100644 --- a/tests/baselines/reference/declareFileExportAssignmentWithVarFromVariableStatement.types +++ b/tests/baselines/reference/declareFileExportAssignmentWithVarFromVariableStatement.types @@ -28,7 +28,7 @@ module m2 { var x = 10, m2: { >x : number ->10 : number +>10 : 10 >m2 : { (): m2.connectExport; test1: m2.connectModule; test2(): m2.connectModule; } (): m2.connectExport; diff --git a/tests/baselines/reference/decoratorInstantiateModulesInFunctionBodies.types b/tests/baselines/reference/decoratorInstantiateModulesInFunctionBodies.types index 17b37c79378..d768f3c6c7a 100644 --- a/tests/baselines/reference/decoratorInstantiateModulesInFunctionBodies.types +++ b/tests/baselines/reference/decoratorInstantiateModulesInFunctionBodies.types @@ -3,7 +3,7 @@ // from #3108 export var test = 'abc'; >test : string ->'abc' : string +>'abc' : "abc" === tests/cases/conformance/decorators/class/b.ts === import { test } from './a'; diff --git a/tests/baselines/reference/decoratorMetadataOnInferredType.types b/tests/baselines/reference/decoratorMetadataOnInferredType.types index 41c9334244f..41ac7f060d2 100644 --- a/tests/baselines/reference/decoratorMetadataOnInferredType.types +++ b/tests/baselines/reference/decoratorMetadataOnInferredType.types @@ -17,7 +17,7 @@ class A { >console.log : (msg: string) => void >console : { log(msg: string): void; } >log : (msg: string) => void ->'new A' : string +>'new A' : "new A" } function decorator(target: Object, propertyKey: string) { diff --git a/tests/baselines/reference/decoratorMetadataPromise.types b/tests/baselines/reference/decoratorMetadataPromise.types index dc07cdc1fe6..eff5fe92c12 100644 --- a/tests/baselines/reference/decoratorMetadataPromise.types +++ b/tests/baselines/reference/decoratorMetadataPromise.types @@ -19,7 +19,7 @@ class A { async bar(): Promise { return 0; } >bar : () => Promise >Promise : Promise ->0 : number +>0 : 0 @decorator >decorator : MethodDecorator diff --git a/tests/baselines/reference/decoratorMetadataWithConstructorType.types b/tests/baselines/reference/decoratorMetadataWithConstructorType.types index ad83706f4f9..4ca404c8116 100644 --- a/tests/baselines/reference/decoratorMetadataWithConstructorType.types +++ b/tests/baselines/reference/decoratorMetadataWithConstructorType.types @@ -17,7 +17,7 @@ class A { >console.log : (msg: string) => void >console : { log(msg: string): void; } >log : (msg: string) => void ->'new A' : string +>'new A' : "new A" } function decorator(target: Object, propertyKey: string) { diff --git a/tests/baselines/reference/decoratorOnClass5.es6.types b/tests/baselines/reference/decoratorOnClass5.es6.types index 5532c50fe52..891126c9ba6 100644 --- a/tests/baselines/reference/decoratorOnClass5.es6.types +++ b/tests/baselines/reference/decoratorOnClass5.es6.types @@ -20,7 +20,7 @@ class C { static y = 1; >y : number ->1 : number +>1 : 1 } let c = new C(); diff --git a/tests/baselines/reference/decoratorOnClass6.es6.types b/tests/baselines/reference/decoratorOnClass6.es6.types index 0b335558400..89c4ebfc101 100644 --- a/tests/baselines/reference/decoratorOnClass6.es6.types +++ b/tests/baselines/reference/decoratorOnClass6.es6.types @@ -20,7 +20,7 @@ export class C { static y = 1; >y : number ->1 : number +>1 : 1 } let c = new C(); diff --git a/tests/baselines/reference/decoratorOnClass7.es6.types b/tests/baselines/reference/decoratorOnClass7.es6.types index af7ae0516e3..d2d54175bf9 100644 --- a/tests/baselines/reference/decoratorOnClass7.es6.types +++ b/tests/baselines/reference/decoratorOnClass7.es6.types @@ -20,7 +20,7 @@ export default class C { static y = 1; >y : number ->1 : number +>1 : 1 } let c = new C(); diff --git a/tests/baselines/reference/decoratorOnClass8.es6.types b/tests/baselines/reference/decoratorOnClass8.es6.types index 045b036e335..4116a8b20d6 100644 --- a/tests/baselines/reference/decoratorOnClass8.es6.types +++ b/tests/baselines/reference/decoratorOnClass8.es6.types @@ -12,5 +12,5 @@ declare function dec(target: T): T; export default class { static y = 1; >y : number ->1 : number +>1 : 1 } diff --git a/tests/baselines/reference/decoratorOnClassAccessor1.types b/tests/baselines/reference/decoratorOnClassAccessor1.types index e5ba5149d7a..8d46fad586f 100644 --- a/tests/baselines/reference/decoratorOnClassAccessor1.types +++ b/tests/baselines/reference/decoratorOnClassAccessor1.types @@ -16,5 +16,5 @@ class C { @dec get accessor() { return 1; } >dec : (target: any, propertyKey: string, descriptor: TypedPropertyDescriptor) => TypedPropertyDescriptor >accessor : number ->1 : number +>1 : 1 } diff --git a/tests/baselines/reference/decoratorOnClassAccessor2.types b/tests/baselines/reference/decoratorOnClassAccessor2.types index 32902ce7ca0..b71e5943e0f 100644 --- a/tests/baselines/reference/decoratorOnClassAccessor2.types +++ b/tests/baselines/reference/decoratorOnClassAccessor2.types @@ -16,5 +16,5 @@ class C { @dec public get accessor() { return 1; } >dec : (target: any, propertyKey: string, descriptor: TypedPropertyDescriptor) => TypedPropertyDescriptor >accessor : number ->1 : number +>1 : 1 } diff --git a/tests/baselines/reference/decoratorOnClassMethod13.types b/tests/baselines/reference/decoratorOnClassMethod13.types index 5fdbe071828..eba738d5ef5 100644 --- a/tests/baselines/reference/decoratorOnClassMethod13.types +++ b/tests/baselines/reference/decoratorOnClassMethod13.types @@ -15,9 +15,9 @@ class C { @dec ["1"]() { } >dec : (target: any, propertyKey: string, descriptor: TypedPropertyDescriptor) => TypedPropertyDescriptor ->"1" : string +>"1" : "1" @dec ["b"]() { } >dec : (target: any, propertyKey: string, descriptor: TypedPropertyDescriptor) => TypedPropertyDescriptor ->"b" : string +>"b" : "b" } diff --git a/tests/baselines/reference/decoratorOnClassMethod4.types b/tests/baselines/reference/decoratorOnClassMethod4.types index 026508257a5..5c47dc8a4ca 100644 --- a/tests/baselines/reference/decoratorOnClassMethod4.types +++ b/tests/baselines/reference/decoratorOnClassMethod4.types @@ -15,5 +15,5 @@ class C { @dec ["method"]() {} >dec : (target: any, propertyKey: string, descriptor: TypedPropertyDescriptor) => TypedPropertyDescriptor ->"method" : string +>"method" : "method" } diff --git a/tests/baselines/reference/decoratorOnClassMethod5.types b/tests/baselines/reference/decoratorOnClassMethod5.types index d55ddd832b9..749eb6b3b9c 100644 --- a/tests/baselines/reference/decoratorOnClassMethod5.types +++ b/tests/baselines/reference/decoratorOnClassMethod5.types @@ -16,5 +16,5 @@ class C { @dec() ["method"]() {} >dec() : (target: any, propertyKey: string, descriptor: TypedPropertyDescriptor) => TypedPropertyDescriptor >dec : () => (target: any, propertyKey: string, descriptor: TypedPropertyDescriptor) => TypedPropertyDescriptor ->"method" : string +>"method" : "method" } diff --git a/tests/baselines/reference/decoratorOnClassMethod7.types b/tests/baselines/reference/decoratorOnClassMethod7.types index 8a72e24bd5b..c8d21157fe9 100644 --- a/tests/baselines/reference/decoratorOnClassMethod7.types +++ b/tests/baselines/reference/decoratorOnClassMethod7.types @@ -15,5 +15,5 @@ class C { @dec public ["method"]() {} >dec : (target: any, propertyKey: string, descriptor: TypedPropertyDescriptor) => TypedPropertyDescriptor ->"method" : string +>"method" : "method" } diff --git a/tests/baselines/reference/decrementOperatorWithAnyOtherType.types b/tests/baselines/reference/decrementOperatorWithAnyOtherType.types index 65eea6d1a71..c8b8852e4d2 100644 --- a/tests/baselines/reference/decrementOperatorWithAnyOtherType.types +++ b/tests/baselines/reference/decrementOperatorWithAnyOtherType.types @@ -10,14 +10,14 @@ var ANY1; var ANY2: any[] = ["", ""]; >ANY2 : any[] >["", ""] : string[] ->"" : string ->"" : string +>"" : "" +>"" : "" var obj = {x:1,y:null}; >obj : { x: number; y: any; } >{x:1,y:null} : { x: number; y: null; } >x : number ->1 : number +>1 : 1 >y : null >null : null @@ -65,7 +65,7 @@ var ResultIsNumber5 = --ANY2[0]; >--ANY2[0] : number >ANY2[0] : any >ANY2 : any[] ->0 : number +>0 : 0 var ResultIsNumber6 = --obj.x; >ResultIsNumber6 : number @@ -100,7 +100,7 @@ var ResultIsNumber9 = ANY2[0]--; >ANY2[0]-- : number >ANY2[0] : any >ANY2 : any[] ->0 : number +>0 : 0 var ResultIsNumber10 = obj.x--; >ResultIsNumber10 : number @@ -143,7 +143,7 @@ var ResultIsNumber13 = M.n--; >--ANY2[0] : number >ANY2[0] : any >ANY2 : any[] ->0 : number +>0 : 0 --ANY, --ANY1; >--ANY, --ANY1 : number @@ -176,7 +176,7 @@ ANY2[0]--; >ANY2[0]-- : number >ANY2[0] : any >ANY2 : any[] ->0 : number +>0 : 0 ANY--, ANY1--; >ANY--, ANY1-- : number diff --git a/tests/baselines/reference/decrementOperatorWithNumberType.types b/tests/baselines/reference/decrementOperatorWithNumberType.types index f990ad18fc7..c81dc0660ec 100644 --- a/tests/baselines/reference/decrementOperatorWithNumberType.types +++ b/tests/baselines/reference/decrementOperatorWithNumberType.types @@ -6,8 +6,8 @@ var NUMBER: number; var NUMBER1: number[] = [1, 2]; >NUMBER1 : number[] >[1, 2] : number[] ->1 : number ->2 : number +>1 : 1 +>2 : 2 class A { >A : A @@ -72,7 +72,7 @@ var ResultIsNumber7 = NUMBER1[0]--; >NUMBER1[0]-- : number >NUMBER1[0] : number >NUMBER1 : number[] ->0 : number +>0 : 0 // miss assignment operators --NUMBER; @@ -83,7 +83,7 @@ var ResultIsNumber7 = NUMBER1[0]--; >--NUMBER1[0] : number >NUMBER1[0] : number >NUMBER1 : number[] ->0 : number +>0 : 0 --objA.a; >--objA.a : number @@ -115,7 +115,7 @@ NUMBER1[0]--; >NUMBER1[0]-- : number >NUMBER1[0] : number >NUMBER1 : number[] ->0 : number +>0 : 0 objA.a--; >objA.a-- : number diff --git a/tests/baselines/reference/defaultArgsInFunctionExpressions.errors.txt b/tests/baselines/reference/defaultArgsInFunctionExpressions.errors.txt index 60a9e92bc95..b0b0f876be4 100644 --- a/tests/baselines/reference/defaultArgsInFunctionExpressions.errors.txt +++ b/tests/baselines/reference/defaultArgsInFunctionExpressions.errors.txt @@ -1,9 +1,9 @@ -tests/cases/compiler/defaultArgsInFunctionExpressions.ts(4,19): error TS2345: Argument of type 'string' is not assignable to parameter of type 'number'. +tests/cases/compiler/defaultArgsInFunctionExpressions.ts(4,19): error TS2345: Argument of type '""' is not assignable to parameter of type 'number'. tests/cases/compiler/defaultArgsInFunctionExpressions.ts(5,1): error TS2322: Type 'number' is not assignable to type 'string'. -tests/cases/compiler/defaultArgsInFunctionExpressions.ts(8,20): error TS2322: Type 'number' is not assignable to type 'string'. +tests/cases/compiler/defaultArgsInFunctionExpressions.ts(8,20): error TS2322: Type '3' is not assignable to type 'string'. tests/cases/compiler/defaultArgsInFunctionExpressions.ts(11,1): error TS2322: Type 'string' is not assignable to type 'number'. tests/cases/compiler/defaultArgsInFunctionExpressions.ts(14,51): error TS2352: Type 'string' cannot be converted to type 'number'. -tests/cases/compiler/defaultArgsInFunctionExpressions.ts(17,41): error TS2322: Type 'string' is not assignable to type 'number'. +tests/cases/compiler/defaultArgsInFunctionExpressions.ts(17,41): error TS2322: Type '""' is not assignable to type 'number'. tests/cases/compiler/defaultArgsInFunctionExpressions.ts(20,62): error TS2352: Type 'string' cannot be converted to type 'number'. tests/cases/compiler/defaultArgsInFunctionExpressions.ts(28,15): error TS2304: Cannot find name 'T'. @@ -14,7 +14,7 @@ tests/cases/compiler/defaultArgsInFunctionExpressions.ts(28,15): error TS2304: C n = f(); var s: string = f(''); ~~ -!!! error TS2345: Argument of type 'string' is not assignable to parameter of type 'number'. +!!! error TS2345: Argument of type '""' is not assignable to parameter of type 'number'. s = f(); ~ !!! error TS2322: Type 'number' is not assignable to type 'string'. @@ -22,7 +22,7 @@ tests/cases/compiler/defaultArgsInFunctionExpressions.ts(28,15): error TS2304: C // Type check the default argument with the type annotation var f2 = function (a: string = 3) { return a; }; // Should error, but be of type (a: string) => string; ~~~~~~~~~~~~~ -!!! error TS2322: Type 'number' is not assignable to type 'string'. +!!! error TS2322: Type '3' is not assignable to type 'string'. s = f2(''); s = f2(); n = f2(); @@ -37,7 +37,7 @@ tests/cases/compiler/defaultArgsInFunctionExpressions.ts(28,15): error TS2304: C // Type check using the function's contextual type var f4: (a: number) => void = function (a = "") { }; ~~~~~~ -!!! error TS2322: Type 'string' is not assignable to type 'number'. +!!! error TS2322: Type '""' is not assignable to type 'number'. // Contextually type the default arg using the function's contextual type var f5: (a: (s: string) => any) => void = function (a = s => s) { }; diff --git a/tests/baselines/reference/defaultBestCommonTypesHaveDecls.errors.txt b/tests/baselines/reference/defaultBestCommonTypesHaveDecls.errors.txt index 5000ae05cc3..3b81fe0864e 100644 --- a/tests/baselines/reference/defaultBestCommonTypesHaveDecls.errors.txt +++ b/tests/baselines/reference/defaultBestCommonTypesHaveDecls.errors.txt @@ -1,7 +1,7 @@ tests/cases/compiler/defaultBestCommonTypesHaveDecls.ts(2,6): error TS2339: Property 'length' does not exist on type '{}'. tests/cases/compiler/defaultBestCommonTypesHaveDecls.ts(5,6): error TS2339: Property 'length' does not exist on type 'Object'. tests/cases/compiler/defaultBestCommonTypesHaveDecls.ts(8,14): error TS2453: The type argument for type parameter 'T' cannot be inferred from the usage. Consider specifying the type arguments explicitly. - Type argument candidate 'number' is not a valid type argument because it is not a supertype of candidate 'string'. + Type argument candidate '1' is not a valid type argument because it is not a supertype of candidate '""'. ==== tests/cases/compiler/defaultBestCommonTypesHaveDecls.ts (3 errors) ==== @@ -19,7 +19,7 @@ tests/cases/compiler/defaultBestCommonTypesHaveDecls.ts(8,14): error TS2453: The var result = concat(1, ""); // error ~~~~~~ !!! error TS2453: The type argument for type parameter 'T' cannot be inferred from the usage. Consider specifying the type arguments explicitly. -!!! error TS2453: Type argument candidate 'number' is not a valid type argument because it is not a supertype of candidate 'string'. +!!! error TS2453: Type argument candidate '1' is not a valid type argument because it is not a supertype of candidate '""'. var elementCount = result.length; function concat2(x: T, y: U) { return null; } diff --git a/tests/baselines/reference/defaultIndexProps1.types b/tests/baselines/reference/defaultIndexProps1.types index 0b188a40c20..d79685da387 100644 --- a/tests/baselines/reference/defaultIndexProps1.types +++ b/tests/baselines/reference/defaultIndexProps1.types @@ -4,7 +4,7 @@ class Foo { public v = "Yo"; >v : string ->"Yo" : string +>"Yo" : "Yo" } var f = new Foo(); @@ -16,17 +16,17 @@ var q = f["v"]; >q : string >f["v"] : string >f : Foo ->"v" : string +>"v" : "v" var o = {v:"Yo2"}; >o : { v: string; } >{v:"Yo2"} : { v: string; } >v : string ->"Yo2" : string +>"Yo2" : "Yo2" var q2 = o["v"]; >q2 : string >o["v"] : string >o : { v: string; } ->"v" : string +>"v" : "v" diff --git a/tests/baselines/reference/defaultIndexProps2.types b/tests/baselines/reference/defaultIndexProps2.types index 3b0d8278966..a50e4af450e 100644 --- a/tests/baselines/reference/defaultIndexProps2.types +++ b/tests/baselines/reference/defaultIndexProps2.types @@ -4,7 +4,7 @@ class Foo { public v = "Yo"; >v : string ->"Yo" : string +>"Yo" : "Yo" } var f = new Foo(); @@ -18,18 +18,18 @@ var o = {v:"Yo2"}; >o : { v: string; } >{v:"Yo2"} : { v: string; } >v : string ->"Yo2" : string +>"Yo2" : "Yo2" // WScript.Echo(o[0]); 1[0]; >1[0] : any ->1 : number ->0 : number +>1 : 1 +>0 : 0 var q = "s"[0]; >q : string >"s"[0] : string ->"s" : string ->0 : number +>"s" : "s" +>0 : 0 diff --git a/tests/baselines/reference/deleteOperatorWithBooleanType.types b/tests/baselines/reference/deleteOperatorWithBooleanType.types index 068c67031ef..664a2530f33 100644 --- a/tests/baselines/reference/deleteOperatorWithBooleanType.types +++ b/tests/baselines/reference/deleteOperatorWithBooleanType.types @@ -5,7 +5,7 @@ var BOOLEAN: boolean; function foo(): boolean { return true; } >foo : () => boolean ->true : boolean +>true : true class A { >A : A @@ -15,7 +15,7 @@ class A { static foo() { return false; } >foo : () => boolean ->false : boolean +>false : false } module M { >M : typeof M @@ -39,16 +39,16 @@ var ResultIsBoolean1 = delete BOOLEAN; var ResultIsBoolean2 = delete true; >ResultIsBoolean2 : boolean >delete true : boolean ->true : boolean +>true : true var ResultIsBoolean3 = delete { x: true, y: false }; >ResultIsBoolean3 : boolean >delete { x: true, y: false } : boolean >{ x: true, y: false } : { x: boolean; y: boolean; } >x : boolean ->true : boolean +>true : true >y : boolean ->false : boolean +>false : false // boolean type expressions var ResultIsBoolean4 = delete objA.a; @@ -89,7 +89,7 @@ var ResultIsBoolean8 = delete delete BOOLEAN; // miss assignment operators delete true; >delete true : boolean ->true : boolean +>true : true delete BOOLEAN; >delete BOOLEAN : boolean @@ -101,10 +101,10 @@ delete foo(); >foo : () => boolean delete true, false; ->delete true, false : boolean +>delete true, false : false >delete true : boolean ->true : boolean ->false : boolean +>true : true +>false : false delete objA.a; >delete objA.a : boolean diff --git a/tests/baselines/reference/deleteOperatorWithEnumType.types b/tests/baselines/reference/deleteOperatorWithEnumType.types index d3266a6aa6c..5248ef6d46e 100644 --- a/tests/baselines/reference/deleteOperatorWithEnumType.types +++ b/tests/baselines/reference/deleteOperatorWithEnumType.types @@ -6,8 +6,8 @@ enum ENUM { }; enum ENUM1 { A, B, "" }; >ENUM1 : ENUM1 ->A : ENUM1 ->B : ENUM1 +>A : ENUM1.A +>B : ENUM1.B // enum type var var ResultIsBoolean1 = delete ENUM; @@ -24,9 +24,9 @@ var ResultIsBoolean2 = delete ENUM1; var ResultIsBoolean3 = delete ENUM1["A"]; >ResultIsBoolean3 : boolean >delete ENUM1["A"] : boolean ->ENUM1["A"] : ENUM1 +>ENUM1["A"] : ENUM1.A >ENUM1 : typeof ENUM1 ->"A" : string +>"A" : "A" var ResultIsBoolean4 = delete (ENUM[0] + ENUM1["B"]); >ResultIsBoolean4 : boolean @@ -35,10 +35,10 @@ var ResultIsBoolean4 = delete (ENUM[0] + ENUM1["B"]); >ENUM[0] + ENUM1["B"] : string >ENUM[0] : string >ENUM : typeof ENUM ->0 : number ->ENUM1["B"] : ENUM1 +>0 : 0 +>ENUM1["B"] : ENUM1.B >ENUM1 : typeof ENUM1 ->"B" : string +>"B" : "B" // multiple delete operators var ResultIsBoolean5 = delete delete ENUM; @@ -56,10 +56,10 @@ var ResultIsBoolean6 = delete delete delete (ENUM[0] + ENUM1["B"]); >ENUM[0] + ENUM1["B"] : string >ENUM[0] : string >ENUM : typeof ENUM ->0 : number ->ENUM1["B"] : ENUM1 +>0 : 0 +>ENUM1["B"] : ENUM1.B >ENUM1 : typeof ENUM1 ->"B" : string +>"B" : "B" // miss assignment operators delete ENUM; @@ -72,9 +72,9 @@ delete ENUM1; delete ENUM1.B; >delete ENUM1.B : boolean ->ENUM1.B : ENUM1 +>ENUM1.B : ENUM1.B >ENUM1 : typeof ENUM1 ->B : ENUM1 +>B : ENUM1.B delete ENUM, ENUM1; >delete ENUM, ENUM1 : typeof ENUM1 diff --git a/tests/baselines/reference/deleteOperatorWithNumberType.types b/tests/baselines/reference/deleteOperatorWithNumberType.types index e631745d089..e3a26b618e1 100644 --- a/tests/baselines/reference/deleteOperatorWithNumberType.types +++ b/tests/baselines/reference/deleteOperatorWithNumberType.types @@ -6,12 +6,12 @@ var NUMBER: number; var NUMBER1: number[] = [1, 2]; >NUMBER1 : number[] >[1, 2] : number[] ->1 : number ->2 : number +>1 : 1 +>2 : 2 function foo(): number { return 1; } >foo : () => number ->1 : number +>1 : 1 class A { >A : A @@ -21,7 +21,7 @@ class A { static foo() { return 1; } >foo : () => number ->1 : number +>1 : 1 } module M { >M : typeof M @@ -50,23 +50,23 @@ var ResultIsBoolean2 = delete NUMBER1; var ResultIsBoolean3 = delete 1; >ResultIsBoolean3 : boolean >delete 1 : boolean ->1 : number +>1 : 1 var ResultIsBoolean4 = delete { x: 1, y: 2}; >ResultIsBoolean4 : boolean >delete { x: 1, y: 2} : boolean >{ x: 1, y: 2} : { x: number; y: number; } >x : number ->1 : number +>1 : 1 >y : number ->2 : number +>2 : 2 var ResultIsBoolean5 = delete { x: 1, y: (n: number) => { return n; } }; >ResultIsBoolean5 : boolean >delete { x: 1, y: (n: number) => { return n; } } : boolean >{ x: 1, y: (n: number) => { return n; } } : { x: number; y: (n: number) => number; } >x : number ->1 : number +>1 : 1 >y : (n: number) => number >(n: number) => { return n; } : (n: number) => number >n : number @@ -92,7 +92,7 @@ var ResultIsBoolean8 = delete NUMBER1[0]; >delete NUMBER1[0] : boolean >NUMBER1[0] : number >NUMBER1 : number[] ->0 : number +>0 : 0 var ResultIsBoolean9 = delete foo(); >ResultIsBoolean9 : boolean @@ -136,7 +136,7 @@ var ResultIsBoolean13 = delete delete delete (NUMBER + NUMBER); // miss assignment operators delete 1; >delete 1 : boolean ->1 : number +>1 : 1 delete NUMBER; >delete NUMBER : boolean diff --git a/tests/baselines/reference/deleteOperatorWithStringType.types b/tests/baselines/reference/deleteOperatorWithStringType.types index 0492aeff176..842ad281ef7 100644 --- a/tests/baselines/reference/deleteOperatorWithStringType.types +++ b/tests/baselines/reference/deleteOperatorWithStringType.types @@ -6,12 +6,12 @@ var STRING: string; var STRING1: string[] = ["", "abc"]; >STRING1 : string[] >["", "abc"] : string[] ->"" : string ->"abc" : string +>"" : "" +>"abc" : "abc" function foo(): string { return "abc"; } >foo : () => string ->"abc" : string +>"abc" : "abc" class A { >A : A @@ -21,7 +21,7 @@ class A { static foo() { return ""; } >foo : () => string ->"" : string +>"" : "" } module M { >M : typeof M @@ -50,23 +50,23 @@ var ResultIsBoolean2 = delete STRING1; var ResultIsBoolean3 = delete ""; >ResultIsBoolean3 : boolean >delete "" : boolean ->"" : string +>"" : "" var ResultIsBoolean4 = delete { x: "", y: "" }; >ResultIsBoolean4 : boolean >delete { x: "", y: "" } : boolean >{ x: "", y: "" } : { x: string; y: string; } >x : string ->"" : string +>"" : "" >y : string ->"" : string +>"" : "" var ResultIsBoolean5 = delete { x: "", y: (s: string) => { return s; } }; >ResultIsBoolean5 : boolean >delete { x: "", y: (s: string) => { return s; } } : boolean >{ x: "", y: (s: string) => { return s; } } : { x: string; y: (s: string) => string; } >x : string ->"" : string +>"" : "" >y : (s: string) => string >(s: string) => { return s; } : (s: string) => string >s : string @@ -92,7 +92,7 @@ var ResultIsBoolean8 = delete STRING1[0]; >delete STRING1[0] : boolean >STRING1[0] : string >STRING1 : string[] ->0 : number +>0 : 0 var ResultIsBoolean9 = delete foo(); >ResultIsBoolean9 : boolean @@ -123,7 +123,7 @@ var ResultIsBoolean12 = delete STRING.charAt(0); >STRING.charAt : (pos: number) => string >STRING : string >charAt : (pos: number) => string ->0 : number +>0 : 0 // multiple delete operator var ResultIsBoolean13 = delete delete STRING; @@ -145,7 +145,7 @@ var ResultIsBoolean14 = delete delete delete (STRING + STRING); // miss assignment operators delete ""; >delete "" : boolean ->"" : string +>"" : "" delete STRING; >delete STRING : boolean diff --git a/tests/baselines/reference/derivedClassOverridesProtectedMembers2.types b/tests/baselines/reference/derivedClassOverridesProtectedMembers2.types index 2799555a3a2..5d981250698 100644 --- a/tests/baselines/reference/derivedClassOverridesProtectedMembers2.types +++ b/tests/baselines/reference/derivedClassOverridesProtectedMembers2.types @@ -227,12 +227,12 @@ var r7 = d2['']; >r7 : { foo: string; } >d2[''] : { foo: string; } >d2 : Derived2 ->'' : string +>'' : "" var r8 = d2[1]; >r8 : { foo: string; bar: string; } >d2[1] : { foo: string; bar: string; } >d2 : Derived2 ->1 : number +>1 : 1 diff --git a/tests/baselines/reference/destructureOptionalParameter.types b/tests/baselines/reference/destructureOptionalParameter.types index 9baffd5f8fa..a72b03f5939 100644 --- a/tests/baselines/reference/destructureOptionalParameter.types +++ b/tests/baselines/reference/destructureOptionalParameter.types @@ -15,9 +15,9 @@ function f2({ a, b }: { a: number, b: number } = { a: 0, b: 0 }) { >b : number >{ a: 0, b: 0 } : { a: number; b: number; } >a : number ->0 : number +>0 : 0 >b : number ->0 : number +>0 : 0 a; >a : number diff --git a/tests/baselines/reference/destructuringArrayBindingPatternAndAssignment2.errors.txt b/tests/baselines/reference/destructuringArrayBindingPatternAndAssignment2.errors.txt index e22b23122d3..7fba74522e2 100644 --- a/tests/baselines/reference/destructuringArrayBindingPatternAndAssignment2.errors.txt +++ b/tests/baselines/reference/destructuringArrayBindingPatternAndAssignment2.errors.txt @@ -1,9 +1,8 @@ tests/cases/conformance/es6/destructuring/destructuringArrayBindingPatternAndAssignment2.ts(3,6): error TS2525: Initializer provides no value for this binding element and the binding element has no default value. tests/cases/conformance/es6/destructuring/destructuringArrayBindingPatternAndAssignment2.ts(3,12): error TS2525: Initializer provides no value for this binding element and the binding element has no default value. tests/cases/conformance/es6/destructuring/destructuringArrayBindingPatternAndAssignment2.ts(4,5): error TS2461: Type 'undefined' is not an array type. -tests/cases/conformance/es6/destructuring/destructuringArrayBindingPatternAndAssignment2.ts(9,5): error TS2322: Type '[number, number, string]' is not assignable to type '[number, boolean, string]'. - Type 'number' is not assignable to type 'boolean'. -tests/cases/conformance/es6/destructuring/destructuringArrayBindingPatternAndAssignment2.ts(17,6): error TS2322: Type 'string' is not assignable to type 'Number'. +tests/cases/conformance/es6/destructuring/destructuringArrayBindingPatternAndAssignment2.ts(9,5): error TS2322: Type '[number, 2, string]' is not assignable to type '[number, boolean, string]'. + Type '2' is not assignable to type 'boolean'. tests/cases/conformance/es6/destructuring/destructuringArrayBindingPatternAndAssignment2.ts(22,5): error TS2322: Type 'number[]' is not assignable to type '[number, number]'. Property '0' is missing in type 'number[]'. tests/cases/conformance/es6/destructuring/destructuringArrayBindingPatternAndAssignment2.ts(23,5): error TS2322: Type 'number[]' is not assignable to type '[string, string]'. @@ -11,7 +10,7 @@ tests/cases/conformance/es6/destructuring/destructuringArrayBindingPatternAndAss tests/cases/conformance/es6/destructuring/destructuringArrayBindingPatternAndAssignment2.ts(34,5): error TS2461: Type 'F' is not an array type. -==== tests/cases/conformance/es6/destructuring/destructuringArrayBindingPatternAndAssignment2.ts (8 errors) ==== +==== tests/cases/conformance/es6/destructuring/destructuringArrayBindingPatternAndAssignment2.ts (7 errors) ==== // V is an array assignment pattern, S is the type Any or an array-like type (section 3.3.2), and, for each assignment element E in V, // S is the type Any, or var [[a0], [[a1]]] = [] // Error @@ -28,8 +27,8 @@ tests/cases/conformance/es6/destructuring/destructuringArrayBindingPatternAndAss // where N is the numeric index of E in the array assignment pattern, or var [b0, b1, b2]: [number, boolean, string] = [1, 2, "string"]; // Error ~~~~~~~~~~~~ -!!! error TS2322: Type '[number, number, string]' is not assignable to type '[number, boolean, string]'. -!!! error TS2322: Type 'number' is not assignable to type 'boolean'. +!!! error TS2322: Type '[number, 2, string]' is not assignable to type '[number, boolean, string]'. +!!! error TS2322: Type '2' is not assignable to type 'boolean'. interface J extends Array { 2: number; } @@ -38,8 +37,6 @@ tests/cases/conformance/es6/destructuring/destructuringArrayBindingPatternAndAss return <[number, number, number]>[1, 2, 3]; } var [b3 = "string", b4, b5] = bar(); // Error - ~~ -!!! error TS2322: Type 'string' is not assignable to type 'Number'. // V is an array assignment pattern, S is the type Any or an array-like type (section 3.3.2), and, for each assignment element E in V, // S is not a tuple- like type and the numeric index signature type of S is assignable to the target given in E. diff --git a/tests/baselines/reference/destructuringAssignmentWithDefault.types b/tests/baselines/reference/destructuringAssignmentWithDefault.types index 1dc1fe23533..658816a36e4 100644 --- a/tests/baselines/reference/destructuringAssignmentWithDefault.types +++ b/tests/baselines/reference/destructuringAssignmentWithDefault.types @@ -6,7 +6,7 @@ const a: { x?: number } = { }; let x = 0; >x : number ->0 : number +>0 : 0 ({x = 1} = a); >({x = 1} = a) : { x?: number | undefined; } diff --git a/tests/baselines/reference/destructuringInFunctionType.types b/tests/baselines/reference/destructuringInFunctionType.types index 5292ea989dd..3f635d44568 100644 --- a/tests/baselines/reference/destructuringInFunctionType.types +++ b/tests/baselines/reference/destructuringInFunctionType.types @@ -70,7 +70,7 @@ var v1 = ([a, b, c]) => "hello"; >a : any >b : any >c : any ->"hello" : string +>"hello" : "hello" var v2: ([a, b, c]) => string; >v2 : ([a, b, c]: [any, any, any]) => string diff --git a/tests/baselines/reference/destructuringInVariableDeclarations1.types b/tests/baselines/reference/destructuringInVariableDeclarations1.types index 84a60c844a3..4da295f5dd0 100644 --- a/tests/baselines/reference/destructuringInVariableDeclarations1.types +++ b/tests/baselines/reference/destructuringInVariableDeclarations1.types @@ -1,10 +1,10 @@ === tests/cases/compiler/destructuringInVariableDeclarations1.ts === export let { toString } = 1; >toString : (radix?: number) => string ->1 : number +>1 : 1 { let { toFixed } = 1; >toFixed : (fractionDigits?: number) => string ->1 : number +>1 : 1 } diff --git a/tests/baselines/reference/destructuringInVariableDeclarations2.types b/tests/baselines/reference/destructuringInVariableDeclarations2.types index b7456d30285..7bda9c52ef2 100644 --- a/tests/baselines/reference/destructuringInVariableDeclarations2.types +++ b/tests/baselines/reference/destructuringInVariableDeclarations2.types @@ -1,11 +1,11 @@ === tests/cases/compiler/destructuringInVariableDeclarations2.ts === let { toString } = 1; >toString : (radix?: number) => string ->1 : number +>1 : 1 { let { toFixed } = 1; >toFixed : (fractionDigits?: number) => string ->1 : number +>1 : 1 } export {}; diff --git a/tests/baselines/reference/destructuringInVariableDeclarations3.types b/tests/baselines/reference/destructuringInVariableDeclarations3.types index 970d6deb1ed..222d4c76130 100644 --- a/tests/baselines/reference/destructuringInVariableDeclarations3.types +++ b/tests/baselines/reference/destructuringInVariableDeclarations3.types @@ -1,10 +1,10 @@ === tests/cases/compiler/destructuringInVariableDeclarations3.ts === export let { toString } = 1; >toString : (radix?: number) => string ->1 : number +>1 : 1 { let { toFixed } = 1; >toFixed : (fractionDigits?: number) => string ->1 : number +>1 : 1 } diff --git a/tests/baselines/reference/destructuringInVariableDeclarations4.types b/tests/baselines/reference/destructuringInVariableDeclarations4.types index 628fe7a9562..7714b78eeec 100644 --- a/tests/baselines/reference/destructuringInVariableDeclarations4.types +++ b/tests/baselines/reference/destructuringInVariableDeclarations4.types @@ -1,11 +1,11 @@ === tests/cases/compiler/destructuringInVariableDeclarations4.ts === let { toString } = 1; >toString : (radix?: number) => string ->1 : number +>1 : 1 { let { toFixed } = 1; >toFixed : (fractionDigits?: number) => string ->1 : number +>1 : 1 } export {}; diff --git a/tests/baselines/reference/destructuringInVariableDeclarations5.types b/tests/baselines/reference/destructuringInVariableDeclarations5.types index 9a890916d17..d6c4b3dee7a 100644 --- a/tests/baselines/reference/destructuringInVariableDeclarations5.types +++ b/tests/baselines/reference/destructuringInVariableDeclarations5.types @@ -1,10 +1,10 @@ === tests/cases/compiler/destructuringInVariableDeclarations5.ts === export let { toString } = 1; >toString : (radix?: number) => string ->1 : number +>1 : 1 { let { toFixed } = 1; >toFixed : (fractionDigits?: number) => string ->1 : number +>1 : 1 } diff --git a/tests/baselines/reference/destructuringInVariableDeclarations6.types b/tests/baselines/reference/destructuringInVariableDeclarations6.types index cf1105b575a..d4f94ffcd03 100644 --- a/tests/baselines/reference/destructuringInVariableDeclarations6.types +++ b/tests/baselines/reference/destructuringInVariableDeclarations6.types @@ -1,11 +1,11 @@ === tests/cases/compiler/destructuringInVariableDeclarations6.ts === let { toString } = 1; >toString : (radix?: number) => string ->1 : number +>1 : 1 { let { toFixed } = 1; >toFixed : (fractionDigits?: number) => string ->1 : number +>1 : 1 } export {}; diff --git a/tests/baselines/reference/destructuringInVariableDeclarations7.types b/tests/baselines/reference/destructuringInVariableDeclarations7.types index c0c1b571215..e4f4603567b 100644 --- a/tests/baselines/reference/destructuringInVariableDeclarations7.types +++ b/tests/baselines/reference/destructuringInVariableDeclarations7.types @@ -1,10 +1,10 @@ === tests/cases/compiler/destructuringInVariableDeclarations7.ts === export let { toString } = 1; >toString : (radix?: number) => string ->1 : number +>1 : 1 { let { toFixed } = 1; >toFixed : (fractionDigits?: number) => string ->1 : number +>1 : 1 } diff --git a/tests/baselines/reference/destructuringInVariableDeclarations8.types b/tests/baselines/reference/destructuringInVariableDeclarations8.types index ef376563551..c79650d5724 100644 --- a/tests/baselines/reference/destructuringInVariableDeclarations8.types +++ b/tests/baselines/reference/destructuringInVariableDeclarations8.types @@ -1,11 +1,11 @@ === tests/cases/compiler/destructuringInVariableDeclarations8.ts === let { toString } = 1; >toString : (radix?: number) => string ->1 : number +>1 : 1 { let { toFixed } = 1; >toFixed : (fractionDigits?: number) => string ->1 : number +>1 : 1 } export {}; diff --git a/tests/baselines/reference/destructuringObjectBindingPatternAndAssignment1ES5.types b/tests/baselines/reference/destructuringObjectBindingPatternAndAssignment1ES5.types index cb6052d93fd..e0aedcbb167 100644 --- a/tests/baselines/reference/destructuringObjectBindingPatternAndAssignment1ES5.types +++ b/tests/baselines/reference/destructuringObjectBindingPatternAndAssignment1ES5.types @@ -19,31 +19,31 @@ var { b1, } = { b1:1, }; >b1 : number >{ b1:1, } : { b1: number; } >b1 : number ->1 : number +>1 : 1 var { b2: { b21 } = { b21: "string" } } = { b2: { b21: "world" } }; >b2 : any >b21 : string >{ b21: "string" } : { b21: string; } >b21 : string ->"string" : string +>"string" : "string" >{ b2: { b21: "world" } } : { b2?: { b21: string; }; } >b2 : { b21: string; } >{ b21: "world" } : { b21: string; } >b21 : string ->"world" : string +>"world" : "world" var {1: b3} = { 1: "string" }; >b3 : string >{ 1: "string" } : { 1: string; } ->"string" : string +>"string" : "string" var {b4 = 1}: any = { b4: 100000 }; >b4 : number ->1 : number +>1 : 1 >{ b4: 100000 } : { b4: number; } >b4 : number ->100000 : number +>100000 : 100000 var {b5: { b52 } } = { b5: { b52 } }; >b5 : any @@ -69,10 +69,10 @@ function foo(): F { >F : F return { ->{ 1: true } : { 1: boolean; } +>{ 1: true } : { 1: true; } 1: true ->true : boolean +>true : true }; } @@ -82,10 +82,10 @@ function bar(): F { >F : F return { ->{ 2: true } : { 2: boolean; } +>{ 2: true } : { 2: true; } 2: true ->true : boolean +>true : true }; } @@ -117,7 +117,7 @@ function foo1(): F1 { >{ "prop1": 2 } : { "prop1": number; } "prop1": 2 ->2 : number +>2 : 2 } } diff --git a/tests/baselines/reference/destructuringObjectBindingPatternAndAssignment1ES6.types b/tests/baselines/reference/destructuringObjectBindingPatternAndAssignment1ES6.types index 2d77c20f65b..7d68d32ac51 100644 --- a/tests/baselines/reference/destructuringObjectBindingPatternAndAssignment1ES6.types +++ b/tests/baselines/reference/destructuringObjectBindingPatternAndAssignment1ES6.types @@ -19,31 +19,31 @@ var { b1, } = { b1:1, }; >b1 : number >{ b1:1, } : { b1: number; } >b1 : number ->1 : number +>1 : 1 var { b2: { b21 } = { b21: "string" } } = { b2: { b21: "world" } }; >b2 : any >b21 : string >{ b21: "string" } : { b21: string; } >b21 : string ->"string" : string +>"string" : "string" >{ b2: { b21: "world" } } : { b2?: { b21: string; }; } >b2 : { b21: string; } >{ b21: "world" } : { b21: string; } >b21 : string ->"world" : string +>"world" : "world" var {1: b3} = { 1: "string" }; >b3 : string >{ 1: "string" } : { 1: string; } ->"string" : string +>"string" : "string" var {b4 = 1}: any = { b4: 100000 }; >b4 : number ->1 : number +>1 : 1 >{ b4: 100000 } : { b4: number; } >b4 : number ->100000 : number +>100000 : 100000 var {b5: { b52 } } = { b5: { b52 } }; >b5 : any @@ -69,10 +69,10 @@ function foo(): F { >F : F return { ->{ 1: true } : { 1: boolean; } +>{ 1: true } : { 1: true; } 1: true ->true : boolean +>true : true }; } @@ -82,10 +82,10 @@ function bar(): F { >F : F return { ->{ 2: true } : { 2: boolean; } +>{ 2: true } : { 2: true; } 2: true ->true : boolean +>true : true }; } @@ -117,7 +117,7 @@ function foo1(): F1 { >{ "prop1": 2 } : { "prop1": number; } "prop1": 2 ->2 : number +>2 : 2 } } diff --git a/tests/baselines/reference/destructuringParameterDeclaration3ES5.types b/tests/baselines/reference/destructuringParameterDeclaration3ES5.types index 2ab9c9330d6..7d4662100ed 100644 --- a/tests/baselines/reference/destructuringParameterDeclaration3ES5.types +++ b/tests/baselines/reference/destructuringParameterDeclaration3ES5.types @@ -70,16 +70,16 @@ function a11([a, b, c, ...x]: number[]) { } var array = [1, 2, 3]; >array : number[] >[1, 2, 3] : number[] ->1 : number ->2 : number ->3 : number +>1 : 1 +>2 : 2 +>3 : 3 var array2 = [true, false, "hello"]; >array2 : (string | boolean)[] >[true, false, "hello"] : (string | boolean)[] ->true : boolean ->false : boolean ->"hello" : string +>true : true +>false : false +>"hello" : "hello" a2([...array]); >a2([...array]) : void @@ -98,49 +98,49 @@ a9([1, 2, [["string"]], false, true]); // Parameter type is [any, any, [[any]] >a9([1, 2, [["string"]], false, true]) : void >a9 : ([a, b, [[c]]]: [any, any, [[any]]]) => void >[1, 2, [["string"]], false, true] : [number, number, [[string]], boolean, boolean] ->1 : number ->2 : number +>1 : 1 +>2 : 2 >[["string"]] : [[string]] >["string"] : [string] ->"string" : string ->false : boolean ->true : boolean +>"string" : "string" +>false : false +>true : true a10([1, 2, [["string"]], false, true]); // Parameter type is any[] >a10([1, 2, [["string"]], false, true]) : void >a10 : ([a, b, [[c]], ...x]: Iterable) => void >[1, 2, [["string"]], false, true] : (number | boolean | string[][])[] ->1 : number ->2 : number +>1 : 1 +>2 : 2 >[["string"]] : string[][] >["string"] : string[] ->"string" : string ->false : boolean ->true : boolean +>"string" : "string" +>false : false +>true : true a10([1, 2, 3, false, true]); // Parameter type is any[] >a10([1, 2, 3, false, true]) : void >a10 : ([a, b, [[c]], ...x]: Iterable) => void >[1, 2, 3, false, true] : (number | boolean)[] ->1 : number ->2 : number ->3 : number ->false : boolean ->true : boolean +>1 : 1 +>2 : 2 +>3 : 3 +>false : false +>true : true a10([1, 2]); // Parameter type is any[] >a10([1, 2]) : void >a10 : ([a, b, [[c]], ...x]: Iterable) => void >[1, 2] : number[] ->1 : number ->2 : number +>1 : 1 +>2 : 2 a11([1, 2]); // Parameter type is number[] >a11([1, 2]) : void >a11 : ([a, b, c, ...x]: number[]) => void >[1, 2] : number[] ->1 : number ->2 : number +>1 : 1 +>2 : 2 // Rest parameter with generic function foo(...a: T[]) { } @@ -152,25 +152,25 @@ function foo(...a: T[]) { } foo("hello", 1, 2); >foo("hello", 1, 2) : void >foo : (...a: T[]) => void ->"hello" : string ->1 : number ->2 : number +>"hello" : "hello" +>1 : 1 +>2 : 2 foo("hello", "world"); >foo("hello", "world") : void >foo : (...a: T[]) => void ->"hello" : string ->"world" : string +>"hello" : "hello" +>"world" : "world" enum E { a, b } >E : E ->a : E ->b : E +>a : E.a +>b : E.b const enum E1 { a, b } >E1 : E1 ->a : E1 ->b : E1 +>a : E1.a +>b : E1.b function foo1(...a: T[]) { } >foo1 : (...a: T[]) => void @@ -182,25 +182,25 @@ function foo1(...a: T[]) { } foo1(1, 2, 3, E.a); >foo1(1, 2, 3, E.a) : void >foo1 : (...a: T[]) => void ->1 : number ->2 : number ->3 : number ->E.a : E +>1 : 1 +>2 : 2 +>3 : 3 +>E.a : E.a >E : typeof E ->a : E +>a : E.a foo1(1, 2, 3, E1.a, E.b); >foo1(1, 2, 3, E1.a, E.b) : void >foo1 : (...a: T[]) => void ->1 : number ->2 : number ->3 : number ->E1.a : E1 +>1 : 1 +>2 : 2 +>3 : 3 +>E1.a : E1.a >E1 : typeof E1 ->a : E1 ->E.b : E +>a : E1.a +>E.b : E.b >E : typeof E ->b : E +>b : E.b diff --git a/tests/baselines/reference/destructuringParameterDeclaration3ES6.types b/tests/baselines/reference/destructuringParameterDeclaration3ES6.types index 55a26cfe58e..8ec0a27850b 100644 --- a/tests/baselines/reference/destructuringParameterDeclaration3ES6.types +++ b/tests/baselines/reference/destructuringParameterDeclaration3ES6.types @@ -70,16 +70,16 @@ function a11([a, b, c, ...x]: number[]) { } var array = [1, 2, 3]; >array : number[] >[1, 2, 3] : number[] ->1 : number ->2 : number ->3 : number +>1 : 1 +>2 : 2 +>3 : 3 var array2 = [true, false, "hello"]; >array2 : (string | boolean)[] >[true, false, "hello"] : (string | boolean)[] ->true : boolean ->false : boolean ->"hello" : string +>true : true +>false : false +>"hello" : "hello" a2([...array]); >a2([...array]) : void @@ -98,49 +98,49 @@ a9([1, 2, [["string"]], false, true]); // Parameter type is [any, any, [[any]] >a9([1, 2, [["string"]], false, true]) : void >a9 : ([a, b, [[c]]]: [any, any, [[any]]]) => void >[1, 2, [["string"]], false, true] : [number, number, [[string]], boolean, boolean] ->1 : number ->2 : number +>1 : 1 +>2 : 2 >[["string"]] : [[string]] >["string"] : [string] ->"string" : string ->false : boolean ->true : boolean +>"string" : "string" +>false : false +>true : true a10([1, 2, [["string"]], false, true]); // Parameter type is any[] >a10([1, 2, [["string"]], false, true]) : void >a10 : ([a, b, [[c]], ...x]: Iterable) => void >[1, 2, [["string"]], false, true] : (number | boolean | string[][])[] ->1 : number ->2 : number +>1 : 1 +>2 : 2 >[["string"]] : string[][] >["string"] : string[] ->"string" : string ->false : boolean ->true : boolean +>"string" : "string" +>false : false +>true : true a10([1, 2, 3, false, true]); // Parameter type is any[] >a10([1, 2, 3, false, true]) : void >a10 : ([a, b, [[c]], ...x]: Iterable) => void >[1, 2, 3, false, true] : (number | boolean)[] ->1 : number ->2 : number ->3 : number ->false : boolean ->true : boolean +>1 : 1 +>2 : 2 +>3 : 3 +>false : false +>true : true a10([1, 2]); // Parameter type is any[] >a10([1, 2]) : void >a10 : ([a, b, [[c]], ...x]: Iterable) => void >[1, 2] : number[] ->1 : number ->2 : number +>1 : 1 +>2 : 2 a11([1, 2]); // Parameter type is number[] >a11([1, 2]) : void >a11 : ([a, b, c, ...x]: number[]) => void >[1, 2] : number[] ->1 : number ->2 : number +>1 : 1 +>2 : 2 // Rest parameter with generic function foo(...a: T[]) { } @@ -152,25 +152,25 @@ function foo(...a: T[]) { } foo("hello", 1, 2); >foo("hello", 1, 2) : void >foo : (...a: T[]) => void ->"hello" : string ->1 : number ->2 : number +>"hello" : "hello" +>1 : 1 +>2 : 2 foo("hello", "world"); >foo("hello", "world") : void >foo : (...a: T[]) => void ->"hello" : string ->"world" : string +>"hello" : "hello" +>"world" : "world" enum E { a, b } >E : E ->a : E ->b : E +>a : E.a +>b : E.b const enum E1 { a, b } >E1 : E1 ->a : E1 ->b : E1 +>a : E1.a +>b : E1.b function foo1(...a: T[]) { } >foo1 : (...a: T[]) => void @@ -182,25 +182,25 @@ function foo1(...a: T[]) { } foo1(1, 2, 3, E.a); >foo1(1, 2, 3, E.a) : void >foo1 : (...a: T[]) => void ->1 : number ->2 : number ->3 : number ->E.a : E +>1 : 1 +>2 : 2 +>3 : 3 +>E.a : E.a >E : typeof E ->a : E +>a : E.a foo1(1, 2, 3, E1.a, E.b); >foo1(1, 2, 3, E1.a, E.b) : void >foo1 : (...a: T[]) => void ->1 : number ->2 : number ->3 : number ->E1.a : E1 +>1 : 1 +>2 : 2 +>3 : 3 +>E1.a : E1.a >E1 : typeof E1 ->a : E1 ->E.b : E +>a : E1.a +>E.b : E.b >E : typeof E ->b : E +>b : E.b diff --git a/tests/baselines/reference/destructuringParameterDeclaration4.errors.txt b/tests/baselines/reference/destructuringParameterDeclaration4.errors.txt index c89fa97b4cd..8db71591f47 100644 --- a/tests/baselines/reference/destructuringParameterDeclaration4.errors.txt +++ b/tests/baselines/reference/destructuringParameterDeclaration4.errors.txt @@ -2,7 +2,7 @@ tests/cases/conformance/es6/destructuring/destructuringParameterDeclaration4.ts( tests/cases/conformance/es6/destructuring/destructuringParameterDeclaration4.ts(13,13): error TS2370: A rest parameter must be of an array type. tests/cases/conformance/es6/destructuring/destructuringParameterDeclaration4.ts(14,17): error TS1047: A rest parameter cannot be optional. tests/cases/conformance/es6/destructuring/destructuringParameterDeclaration4.ts(15,16): error TS1048: A rest parameter cannot have an initializer. -tests/cases/conformance/es6/destructuring/destructuringParameterDeclaration4.ts(20,19): error TS2345: Argument of type 'boolean' is not assignable to parameter of type 'string | number'. +tests/cases/conformance/es6/destructuring/destructuringParameterDeclaration4.ts(20,19): error TS2345: Argument of type 'true' is not assignable to parameter of type 'string | number'. tests/cases/conformance/es6/destructuring/destructuringParameterDeclaration4.ts(21,7): error TS2304: Cannot find name 'array2'. tests/cases/conformance/es6/destructuring/destructuringParameterDeclaration4.ts(22,4): error TS2345: Argument of type '[number, number, string, boolean, boolean]' is not assignable to parameter of type '[any, any, [[any]]]'. Types of property '2' are incompatible. @@ -47,7 +47,7 @@ tests/cases/conformance/es6/destructuring/destructuringParameterDeclaration4.ts( a1(1, 2, "hello", true); // Error, parameter type is (number|string)[] ~~~~ -!!! error TS2345: Argument of type 'boolean' is not assignable to parameter of type 'string | number'. +!!! error TS2345: Argument of type 'true' is not assignable to parameter of type 'string | number'. a1(...array2); // Error parameter type is (number|string)[] ~~~~~~ !!! error TS2304: Cannot find name 'array2'. diff --git a/tests/baselines/reference/destructuringParameterDeclaration6.errors.txt b/tests/baselines/reference/destructuringParameterDeclaration6.errors.txt index 15d25ebc60e..cecb5d473c2 100644 --- a/tests/baselines/reference/destructuringParameterDeclaration6.errors.txt +++ b/tests/baselines/reference/destructuringParameterDeclaration6.errors.txt @@ -1,7 +1,9 @@ tests/cases/conformance/es6/destructuring/destructuringParameterDeclaration6.ts(7,18): error TS1005: ':' expected. tests/cases/conformance/es6/destructuring/destructuringParameterDeclaration6.ts(9,14): error TS1181: Array element destructuring pattern expected. +tests/cases/conformance/es6/destructuring/destructuringParameterDeclaration6.ts(9,19): error TS2695: Left side of comma operator is unused and has no side effects. tests/cases/conformance/es6/destructuring/destructuringParameterDeclaration6.ts(9,19): error TS1005: '(' expected. tests/cases/conformance/es6/destructuring/destructuringParameterDeclaration6.ts(9,21): error TS1109: Expression expected. +tests/cases/conformance/es6/destructuring/destructuringParameterDeclaration6.ts(9,24): error TS2695: Left side of comma operator is unused and has no side effects. tests/cases/conformance/es6/destructuring/destructuringParameterDeclaration6.ts(9,24): error TS1005: '(' expected. tests/cases/conformance/es6/destructuring/destructuringParameterDeclaration6.ts(9,26): error TS2304: Cannot find name 'public'. tests/cases/conformance/es6/destructuring/destructuringParameterDeclaration6.ts(9,32): error TS1005: ';' expected. @@ -11,7 +13,7 @@ tests/cases/conformance/es6/destructuring/destructuringParameterDeclaration6.ts( tests/cases/conformance/es6/destructuring/destructuringParameterDeclaration6.ts(12,13): error TS2370: A rest parameter must be of an array type. -==== tests/cases/conformance/es6/destructuring/destructuringParameterDeclaration6.ts (11 errors) ==== +==== tests/cases/conformance/es6/destructuring/destructuringParameterDeclaration6.ts (13 errors) ==== // A parameter declaration may specify either an identifier or a binding pattern. // Reserved words are not allowed to be used as an identifier in parameter declaration @@ -25,10 +27,14 @@ tests/cases/conformance/es6/destructuring/destructuringParameterDeclaration6.ts( function a4([while, for, public]){ } ~~~~~ !!! error TS1181: Array element destructuring pattern expected. + +!!! error TS2695: Left side of comma operator is unused and has no side effects. ~ !!! error TS1005: '(' expected. ~~~ !!! error TS1109: Expression expected. + +!!! error TS2695: Left side of comma operator is unused and has no side effects. ~ !!! error TS1005: '(' expected. ~~~~~~ diff --git a/tests/baselines/reference/destructuringParameterProperties2.errors.txt b/tests/baselines/reference/destructuringParameterProperties2.errors.txt index deb039aa67d..d47e50db853 100644 --- a/tests/baselines/reference/destructuringParameterProperties2.errors.txt +++ b/tests/baselines/reference/destructuringParameterProperties2.errors.txt @@ -5,8 +5,8 @@ tests/cases/conformance/es6/destructuring/destructuringParameterProperties2.ts(4 tests/cases/conformance/es6/destructuring/destructuringParameterProperties2.ts(9,21): error TS2339: Property 'a' does not exist on type 'C1'. tests/cases/conformance/es6/destructuring/destructuringParameterProperties2.ts(13,21): error TS2339: Property 'b' does not exist on type 'C1'. tests/cases/conformance/es6/destructuring/destructuringParameterProperties2.ts(17,21): error TS2339: Property 'c' does not exist on type 'C1'. -tests/cases/conformance/es6/destructuring/destructuringParameterProperties2.ts(21,27): error TS2345: Argument of type '[number, undefined, string]' is not assignable to parameter of type '[number, string, boolean]'. - Type 'string' is not assignable to type 'boolean'. +tests/cases/conformance/es6/destructuring/destructuringParameterProperties2.ts(21,27): error TS2345: Argument of type '[number, undefined, ""]' is not assignable to parameter of type '[number, string, boolean]'. + Type '""' is not assignable to type 'boolean'. ==== tests/cases/conformance/es6/destructuring/destructuringParameterProperties2.ts (8 errors) ==== @@ -46,8 +46,8 @@ tests/cases/conformance/es6/destructuring/destructuringParameterProperties2.ts(2 var x = new C1(undefined, [0, undefined, ""]); ~~~~~~~~~~~~~~~~~~ -!!! error TS2345: Argument of type '[number, undefined, string]' is not assignable to parameter of type '[number, string, boolean]'. -!!! error TS2345: Type 'string' is not assignable to type 'boolean'. +!!! error TS2345: Argument of type '[number, undefined, ""]' is not assignable to parameter of type '[number, string, boolean]'. +!!! error TS2345: Type '""' is not assignable to type 'boolean'. var [x_a, x_b, x_c] = [x.getA(), x.getB(), x.getC()]; var y = new C1(10, [0, "", true]); diff --git a/tests/baselines/reference/destructuringTypeAssertionsES5_5.types b/tests/baselines/reference/destructuringTypeAssertionsES5_5.types index a7111cc4361..87c38ef7108 100644 --- a/tests/baselines/reference/destructuringTypeAssertionsES5_5.types +++ b/tests/baselines/reference/destructuringTypeAssertionsES5_5.types @@ -2,5 +2,5 @@ var { x } = 0; >x : any >0 : any ->0 : number +>0 : 0 diff --git a/tests/baselines/reference/destructuringVariableDeclaration1ES5.types b/tests/baselines/reference/destructuringVariableDeclaration1ES5.types index c4693fac23f..6f95b198434 100644 --- a/tests/baselines/reference/destructuringVariableDeclaration1ES5.types +++ b/tests/baselines/reference/destructuringVariableDeclaration1ES5.types @@ -8,20 +8,20 @@ var {a1, a2}: { a1: number, a2: string } = { a1: 10, a2: "world" } >a2 : string >{ a1: 10, a2: "world" } : { a1: number; a2: string; } >a1 : number ->10 : number +>10 : 10 >a2 : string ->"world" : string +>"world" : "world" var [a3, [[a4]], a5]: [number, [[string]], boolean] = [1, [["hello"]], true]; >a3 : number >a4 : string >a5 : boolean ->[1, [["hello"]], true] : [number, [[string]], boolean] ->1 : number +>[1, [["hello"]], true] : [number, [[string]], true] +>1 : 1 >[["hello"]] : [[string]] >["hello"] : [string] ->"hello" : string ->true : boolean +>"hello" : "hello" +>true : true // The type T associated with a destructuring variable declaration is determined as follows: // Otherwise, if the declaration includes an initializer expression, T is the type of that initializer expression. @@ -30,43 +30,43 @@ var { b1: { b11 } = { b11: "string" } } = { b1: { b11: "world" } }; >b11 : string >{ b11: "string" } : { b11: string; } >b11 : string ->"string" : string +>"string" : "string" >{ b1: { b11: "world" } } : { b1?: { b11: string; }; } >b1 : { b11: string; } >{ b11: "world" } : { b11: string; } >b11 : string ->"world" : string +>"world" : "world" var temp = { t1: true, t2: "false" }; >temp : { t1: boolean; t2: string; } >{ t1: true, t2: "false" } : { t1: boolean; t2: string; } >t1 : boolean ->true : boolean +>true : true >t2 : string ->"false" : string +>"false" : "false" var [b2 = 3, b3 = true, b4 = temp] = [3, false, { t1: false, t2: "hello" }]; >b2 : number ->3 : number +>3 : 3 >b3 : boolean ->true : boolean +>true : true >b4 : { t1: boolean; t2: string; } >temp : { t1: boolean; t2: string; } ->[3, false, { t1: false, t2: "hello" }] : [number, boolean, { t1: boolean; t2: string; }] ->3 : number ->false : boolean ->{ t1: false, t2: "hello" } : { t1: boolean; t2: string; } +>[3, false, { t1: false, t2: "hello" }] : [number, false, { t1: false; t2: string; }] +>3 : 3 +>false : false +>{ t1: false, t2: "hello" } : { t1: false; t2: string; } >t1 : boolean ->false : boolean +>false : false >t2 : string ->"hello" : string +>"hello" : "hello" var [b5 = 3, b6 = true, b7 = temp] = [undefined, undefined, undefined]; ->b5 : any ->3 : number ->b6 : any ->true : boolean ->b7 : any +>b5 : 3 +>3 : 3 +>b6 : true +>true : true +>b7 : { t1: boolean; t2: string; } >temp : { t1: boolean; t2: string; } >[undefined, undefined, undefined] : [undefined, undefined, undefined] >undefined : undefined @@ -79,17 +79,17 @@ var [b5 = 3, b6 = true, b7 = temp] = [undefined, undefined, undefined]; var [...c1] = [1,2,3]; >c1 : number[] >[1,2,3] : number[] ->1 : number ->2 : number ->3 : number +>1 : 1 +>2 : 2 +>3 : 3 var [...c2] = [1,2,3, "string"]; >c2 : (string | number)[] >[1,2,3, "string"] : (string | number)[] ->1 : number ->2 : number ->3 : number ->"string" : string +>1 : 1 +>2 : 2 +>3 : 3 +>"string" : "string" // The type T associated with a binding element is determined as follows: // Otherwise, if S is a tuple- like type (section 3.3.3): @@ -99,8 +99,8 @@ var [d1,d2] = [1,"string"] >d1 : number >d2 : string >[1,"string"] : [number, string] ->1 : number ->"string" : string +>1 : 1 +>"string" : "string" // The type T associated with a binding element is determined as follows: // Otherwise, if S is a tuple- like type (section 3.3.3): @@ -108,16 +108,16 @@ var [d1,d2] = [1,"string"] var temp1 = [true, false, true] >temp1 : boolean[] >[true, false, true] : boolean[] ->true : boolean ->false : boolean ->true : boolean +>true : true +>false : false +>true : true var [d3, d4] = [1, "string", ...temp1]; >d3 : string | number | boolean >d4 : string | number | boolean >[1, "string", ...temp1] : (string | number | boolean)[] ->1 : number ->"string" : string +>1 : 1 +>"string" : "string" >...temp1 : boolean >temp1 : boolean[] @@ -129,19 +129,19 @@ var {e: [e1, e2, e3 = { b1: 1000, b4: 200 }]} = { e: [1, 2, { b1: 4, b4: 0 }] }; >e3 : { b1: number; b4: number; } >{ b1: 1000, b4: 200 } : { b1: number; b4: number; } >b1 : number ->1000 : number +>1000 : 1000 >b4 : number ->200 : number +>200 : 200 >{ e: [1, 2, { b1: 4, b4: 0 }] } : { e: [number, number, { b1: number; b4: number; }]; } >e : [number, number, { b1: number; b4: number; }] >[1, 2, { b1: 4, b4: 0 }] : [number, number, { b1: number; b4: number; }] ->1 : number ->2 : number +>1 : 1 +>2 : 2 >{ b1: 4, b4: 0 } : { b1: number; b4: number; } >b1 : number ->4 : number +>4 : 4 >b4 : number ->0 : number +>0 : 0 var {f: [f1, f2, { f3: f4, f5 }, , ]} = { f: [1, 2, { f3: 4, f5: 0 }] }; >f : any @@ -154,13 +154,13 @@ var {f: [f1, f2, { f3: f4, f5 }, , ]} = { f: [1, 2, { f3: 4, f5: 0 }] }; >{ f: [1, 2, { f3: 4, f5: 0 }] } : { f: [number, number, { f3: number; f5: number; }, any]; } >f : [number, number, { f3: number; f5: number; }, any] >[1, 2, { f3: 4, f5: 0 }] : [number, number, { f3: number; f5: number; }, any] ->1 : number ->2 : number +>1 : 1 +>2 : 2 >{ f3: 4, f5: 0 } : { f3: number; f5: number; } >f3 : number ->4 : number +>4 : 4 >f5 : number ->0 : number +>0 : 0 // When a destructuring variable declaration, binding property, or binding element specifies // an initializer expression, the type of the initializer expression is required to be assignable @@ -178,8 +178,8 @@ var {g: {g1 = [undefined, null]}}: { g: { g1: any[] } } = { g: { g1: [1, 2] } }; >{ g1: [1, 2] } : { g1: number[]; } >g1 : number[] >[1, 2] : number[] ->1 : number ->2 : number +>1 : 1 +>2 : 2 var {h: {h1 = [undefined, null]}}: { h: { h1: number[] } } = { h: { h1: [1, 2] } }; >h : any @@ -194,7 +194,7 @@ var {h: {h1 = [undefined, null]}}: { h: { h1: number[] } } = { h: { h1: [1, 2] } >{ h1: [1, 2] } : { h1: number[]; } >h1 : number[] >[1, 2] : number[] ->1 : number ->2 : number +>1 : 1 +>2 : 2 diff --git a/tests/baselines/reference/destructuringVariableDeclaration1ES6.types b/tests/baselines/reference/destructuringVariableDeclaration1ES6.types index 847831ccc84..d01326991c0 100644 --- a/tests/baselines/reference/destructuringVariableDeclaration1ES6.types +++ b/tests/baselines/reference/destructuringVariableDeclaration1ES6.types @@ -8,20 +8,20 @@ var {a1, a2}: { a1: number, a2: string } = { a1: 10, a2: "world" } >a2 : string >{ a1: 10, a2: "world" } : { a1: number; a2: string; } >a1 : number ->10 : number +>10 : 10 >a2 : string ->"world" : string +>"world" : "world" var [a3, [[a4]], a5]: [number, [[string]], boolean] = [1, [["hello"]], true]; >a3 : number >a4 : string >a5 : boolean ->[1, [["hello"]], true] : [number, [[string]], boolean] ->1 : number +>[1, [["hello"]], true] : [number, [[string]], true] +>1 : 1 >[["hello"]] : [[string]] >["hello"] : [string] ->"hello" : string ->true : boolean +>"hello" : "hello" +>true : true // The type T associated with a destructuring variable declaration is determined as follows: // Otherwise, if the declaration includes an initializer expression, T is the type of that initializer expression. @@ -30,43 +30,43 @@ var { b1: { b11 } = { b11: "string" } } = { b1: { b11: "world" } }; >b11 : string >{ b11: "string" } : { b11: string; } >b11 : string ->"string" : string +>"string" : "string" >{ b1: { b11: "world" } } : { b1?: { b11: string; }; } >b1 : { b11: string; } >{ b11: "world" } : { b11: string; } >b11 : string ->"world" : string +>"world" : "world" var temp = { t1: true, t2: "false" }; >temp : { t1: boolean; t2: string; } >{ t1: true, t2: "false" } : { t1: boolean; t2: string; } >t1 : boolean ->true : boolean +>true : true >t2 : string ->"false" : string +>"false" : "false" var [b2 = 3, b3 = true, b4 = temp] = [3, false, { t1: false, t2: "hello" }]; >b2 : number ->3 : number +>3 : 3 >b3 : boolean ->true : boolean +>true : true >b4 : { t1: boolean; t2: string; } >temp : { t1: boolean; t2: string; } ->[3, false, { t1: false, t2: "hello" }] : [number, boolean, { t1: boolean; t2: string; }] ->3 : number ->false : boolean ->{ t1: false, t2: "hello" } : { t1: boolean; t2: string; } +>[3, false, { t1: false, t2: "hello" }] : [number, false, { t1: false; t2: string; }] +>3 : 3 +>false : false +>{ t1: false, t2: "hello" } : { t1: false; t2: string; } >t1 : boolean ->false : boolean +>false : false >t2 : string ->"hello" : string +>"hello" : "hello" var [b5 = 3, b6 = true, b7 = temp] = [undefined, undefined, undefined]; ->b5 : any ->3 : number ->b6 : any ->true : boolean ->b7 : any +>b5 : 3 +>3 : 3 +>b6 : true +>true : true +>b7 : { t1: boolean; t2: string; } >temp : { t1: boolean; t2: string; } >[undefined, undefined, undefined] : [undefined, undefined, undefined] >undefined : undefined @@ -79,17 +79,17 @@ var [b5 = 3, b6 = true, b7 = temp] = [undefined, undefined, undefined]; var [...c1] = [1,2,3]; >c1 : number[] >[1,2,3] : number[] ->1 : number ->2 : number ->3 : number +>1 : 1 +>2 : 2 +>3 : 3 var [...c2] = [1,2,3, "string"]; >c2 : (string | number)[] >[1,2,3, "string"] : (string | number)[] ->1 : number ->2 : number ->3 : number ->"string" : string +>1 : 1 +>2 : 2 +>3 : 3 +>"string" : "string" // The type T associated with a binding element is determined as follows: // Otherwise, if S is a tuple- like type (section 3.3.3): @@ -99,8 +99,8 @@ var [d1,d2] = [1,"string"] >d1 : number >d2 : string >[1,"string"] : [number, string] ->1 : number ->"string" : string +>1 : 1 +>"string" : "string" // The type T associated with a binding element is determined as follows: // Otherwise, if S is a tuple- like type (section 3.3.3): @@ -108,16 +108,16 @@ var [d1,d2] = [1,"string"] var temp1 = [true, false, true] >temp1 : boolean[] >[true, false, true] : boolean[] ->true : boolean ->false : boolean ->true : boolean +>true : true +>false : false +>true : true var [d3, d4] = [1, "string", ...temp1]; >d3 : string | number | boolean >d4 : string | number | boolean >[1, "string", ...temp1] : (string | number | boolean)[] ->1 : number ->"string" : string +>1 : 1 +>"string" : "string" >...temp1 : boolean >temp1 : boolean[] @@ -129,19 +129,19 @@ var {e: [e1, e2, e3 = { b1: 1000, b4: 200 }]} = { e: [1, 2, { b1: 4, b4: 0 }] }; >e3 : { b1: number; b4: number; } >{ b1: 1000, b4: 200 } : { b1: number; b4: number; } >b1 : number ->1000 : number +>1000 : 1000 >b4 : number ->200 : number +>200 : 200 >{ e: [1, 2, { b1: 4, b4: 0 }] } : { e: [number, number, { b1: number; b4: number; }]; } >e : [number, number, { b1: number; b4: number; }] >[1, 2, { b1: 4, b4: 0 }] : [number, number, { b1: number; b4: number; }] ->1 : number ->2 : number +>1 : 1 +>2 : 2 >{ b1: 4, b4: 0 } : { b1: number; b4: number; } >b1 : number ->4 : number +>4 : 4 >b4 : number ->0 : number +>0 : 0 var {f: [f1, f2, { f3: f4, f5 }, , ]} = { f: [1, 2, { f3: 4, f5: 0 }] }; >f : any @@ -154,13 +154,13 @@ var {f: [f1, f2, { f3: f4, f5 }, , ]} = { f: [1, 2, { f3: 4, f5: 0 }] }; >{ f: [1, 2, { f3: 4, f5: 0 }] } : { f: [number, number, { f3: number; f5: number; }, any]; } >f : [number, number, { f3: number; f5: number; }, any] >[1, 2, { f3: 4, f5: 0 }] : [number, number, { f3: number; f5: number; }, any] ->1 : number ->2 : number +>1 : 1 +>2 : 2 >{ f3: 4, f5: 0 } : { f3: number; f5: number; } >f3 : number ->4 : number +>4 : 4 >f5 : number ->0 : number +>0 : 0 // When a destructuring variable declaration, binding property, or binding element specifies // an initializer expression, the type of the initializer expression is required to be assignable @@ -178,8 +178,8 @@ var {g: {g1 = [undefined, null]}}: { g: { g1: any[] } } = { g: { g1: [1, 2] } }; >{ g1: [1, 2] } : { g1: number[]; } >g1 : number[] >[1, 2] : number[] ->1 : number ->2 : number +>1 : 1 +>2 : 2 var {h: {h1 = [undefined, null]}}: { h: { h1: number[] } } = { h: { h1: [1, 2] } }; >h : any @@ -194,7 +194,7 @@ var {h: {h1 = [undefined, null]}}: { h: { h1: number[] } } = { h: { h1: [1, 2] } >{ h1: [1, 2] } : { h1: number[]; } >h1 : number[] >[1, 2] : number[] ->1 : number ->2 : number +>1 : 1 +>2 : 2 diff --git a/tests/baselines/reference/destructuringVariableDeclaration2.errors.txt b/tests/baselines/reference/destructuringVariableDeclaration2.errors.txt index bdbda6f9a96..c831b10a467 100644 --- a/tests/baselines/reference/destructuringVariableDeclaration2.errors.txt +++ b/tests/baselines/reference/destructuringVariableDeclaration2.errors.txt @@ -1,20 +1,15 @@ tests/cases/conformance/es6/destructuring/destructuringVariableDeclaration2.ts(3,5): error TS2322: Type '{ a1: boolean; a2: number; }' is not assignable to type '{ a1: number; a2: string; }'. Types of property 'a1' are incompatible. Type 'boolean' is not assignable to type 'number'. -tests/cases/conformance/es6/destructuring/destructuringVariableDeclaration2.ts(4,5): error TS2322: Type '[number, [[boolean]], boolean]' is not assignable to type '[number, [[string]], boolean]'. +tests/cases/conformance/es6/destructuring/destructuringVariableDeclaration2.ts(4,5): error TS2322: Type '[number, [[boolean]], true]' is not assignable to type '[number, [[string]], boolean]'. Type '[[boolean]]' is not assignable to type '[[string]]'. Type '[boolean]' is not assignable to type '[string]'. Type 'boolean' is not assignable to type 'string'. -tests/cases/conformance/es6/destructuring/destructuringVariableDeclaration2.ts(9,25): error TS2322: Type '{ t1: boolean; t2: string; }' is not assignable to type '{ t1: boolean; t2: number; }'. - Types of property 't2' are incompatible. - Type 'string' is not assignable to type 'number'. tests/cases/conformance/es6/destructuring/destructuringVariableDeclaration2.ts(14,16): error TS2459: Type 'number | { c3: number; c5: number; }' has no property 'c3' and no string index signature. tests/cases/conformance/es6/destructuring/destructuringVariableDeclaration2.ts(14,24): error TS2459: Type 'number | { c3: number; c5: number; }' has no property 'c5' and no string index signature. -tests/cases/conformance/es6/destructuring/destructuringVariableDeclaration2.ts(19,10): error TS2322: Type 'string[]' is not assignable to type 'number[]'. - Type 'string' is not assignable to type 'number'. -==== tests/cases/conformance/es6/destructuring/destructuringVariableDeclaration2.ts (6 errors) ==== +==== tests/cases/conformance/es6/destructuring/destructuringVariableDeclaration2.ts (4 errors) ==== // The type T associated with a destructuring variable declaration is determined as follows: // If the declaration includes a type annotation, T is that type. var {a1, a2}: { a1: number, a2: string } = { a1: true, a2: 1 } // Error @@ -24,7 +19,7 @@ tests/cases/conformance/es6/destructuring/destructuringVariableDeclaration2.ts(1 !!! error TS2322: Type 'boolean' is not assignable to type 'number'. var [a3, [[a4]], a5]: [number, [[string]], boolean] = [1, [[false]], true]; // Error ~~~~~~~~~~~~~~~~ -!!! error TS2322: Type '[number, [[boolean]], boolean]' is not assignable to type '[number, [[string]], boolean]'. +!!! error TS2322: Type '[number, [[boolean]], true]' is not assignable to type '[number, [[string]], boolean]'. !!! error TS2322: Type '[[boolean]]' is not assignable to type '[[string]]'. !!! error TS2322: Type '[boolean]' is not assignable to type '[string]'. !!! error TS2322: Type 'boolean' is not assignable to type 'string'. @@ -33,10 +28,6 @@ tests/cases/conformance/es6/destructuring/destructuringVariableDeclaration2.ts(1 // Otherwise, if the declaration includes an initializer expression, T is the type of that initializer expression. var temp = { t1: true, t2: "false" }; var [b0 = 3, b1 = true, b2 = temp] = [3, false, { t1: false, t2: 5}]; // Error - ~~ -!!! error TS2322: Type '{ t1: boolean; t2: string; }' is not assignable to type '{ t1: boolean; t2: number; }'. -!!! error TS2322: Types of property 't2' are incompatible. -!!! error TS2322: Type 'string' is not assignable to type 'number'. // The type T associated with a binding element is determined as follows: // If the binding element is a rest element, T is an array type with @@ -50,7 +41,4 @@ tests/cases/conformance/es6/destructuring/destructuringVariableDeclaration2.ts(1 // When a destructuring variable declaration, binding property, or binding element specifies // an initializer expression, the type of the initializer expression is required to be assignable // to the widened form of the type associated with the destructuring variable declaration, binding property, or binding element. - var {d: {d1 = ["string", null]}}: { d: { d1: number[] } } = { d: { d1: [1, 2] } }; // Error - ~~ -!!! error TS2322: Type 'string[]' is not assignable to type 'number[]'. -!!! error TS2322: Type 'string' is not assignable to type 'number'. \ No newline at end of file + var {d: {d1 = ["string", null]}}: { d: { d1: number[] } } = { d: { d1: [1, 2] } }; // Error \ No newline at end of file diff --git a/tests/baselines/reference/destructuringWithLiteralInitializers.types b/tests/baselines/reference/destructuringWithLiteralInitializers.types index 9b970679f74..43391515014 100644 --- a/tests/baselines/reference/destructuringWithLiteralInitializers.types +++ b/tests/baselines/reference/destructuringWithLiteralInitializers.types @@ -10,40 +10,40 @@ f1({ x: 1, y: 1 }); >f1 : ({x, y}: { x: any; y: any; }) => void >{ x: 1, y: 1 } : { x: number; y: number; } >x : number ->1 : number +>1 : 1 >y : number ->1 : number +>1 : 1 // (arg: { x: any, y?: number }) => void function f2({ x, y = 0 }) { } >f2 : ({x, y}: { x: any; y?: number; }) => void >x : any >y : number ->0 : number +>0 : 0 f2({ x: 1 }); >f2({ x: 1 }) : void >f2 : ({x, y}: { x: any; y?: number; }) => void >{ x: 1 } : { x: number; } >x : number ->1 : number +>1 : 1 f2({ x: 1, y: 1 }); >f2({ x: 1, y: 1 }) : void >f2 : ({x, y}: { x: any; y?: number; }) => void >{ x: 1, y: 1 } : { x: number; y: number; } >x : number ->1 : number +>1 : 1 >y : number ->1 : number +>1 : 1 // (arg: { x?: number, y?: number }) => void function f3({ x = 0, y = 0 }) { } >f3 : ({x, y}: { x?: number; y?: number; }) => void >x : number ->0 : number +>0 : 0 >y : number ->0 : number +>0 : 0 f3({}); >f3({}) : void @@ -55,23 +55,23 @@ f3({ x: 1 }); >f3 : ({x, y}: { x?: number; y?: number; }) => void >{ x: 1 } : { x: number; } >x : number ->1 : number +>1 : 1 f3({ y: 1 }); >f3({ y: 1 }) : void >f3 : ({x, y}: { x?: number; y?: number; }) => void >{ y: 1 } : { y: number; } >y : number ->1 : number +>1 : 1 f3({ x: 1, y: 1 }); >f3({ x: 1, y: 1 }) : void >f3 : ({x, y}: { x?: number; y?: number; }) => void >{ x: 1, y: 1 } : { x: number; y: number; } >x : number ->1 : number +>1 : 1 >y : number ->1 : number +>1 : 1 // (arg?: { x: number, y: number }) => void function f4({ x, y } = { x: 0, y: 0 }) { } @@ -80,9 +80,9 @@ function f4({ x, y } = { x: 0, y: 0 }) { } >y : number >{ x: 0, y: 0 } : { x: number; y: number; } >x : number ->0 : number +>0 : 0 >y : number ->0 : number +>0 : 0 f4(); >f4() : void @@ -93,19 +93,19 @@ f4({ x: 1, y: 1 }); >f4 : ({x, y}?: { x: number; y: number; }) => void >{ x: 1, y: 1 } : { x: number; y: number; } >x : number ->1 : number +>1 : 1 >y : number ->1 : number +>1 : 1 // (arg?: { x: number, y?: number }) => void function f5({ x, y = 0 } = { x: 0 }) { } >f5 : ({x, y}?: { x: number; y?: number; }) => void >x : number >y : number ->0 : number +>0 : 0 >{ x: 0 } : { x: number; y?: number; } >x : number ->0 : number +>0 : 0 f5(); >f5() : void @@ -116,24 +116,24 @@ f5({ x: 1 }); >f5 : ({x, y}?: { x: number; y?: number; }) => void >{ x: 1 } : { x: number; } >x : number ->1 : number +>1 : 1 f5({ x: 1, y: 1 }); >f5({ x: 1, y: 1 }) : void >f5 : ({x, y}?: { x: number; y?: number; }) => void >{ x: 1, y: 1 } : { x: number; y: number; } >x : number ->1 : number +>1 : 1 >y : number ->1 : number +>1 : 1 // (arg?: { x?: number, y?: number }) => void function f6({ x = 0, y = 0 } = {}) { } >f6 : ({x, y}?: { x?: number; y?: number; }) => void >x : number ->0 : number +>0 : 0 >y : number ->0 : number +>0 : 0 >{} : { x?: number; y?: number; } f6(); @@ -150,32 +150,32 @@ f6({ x: 1 }); >f6 : ({x, y}?: { x?: number; y?: number; }) => void >{ x: 1 } : { x: number; } >x : number ->1 : number +>1 : 1 f6({ y: 1 }); >f6({ y: 1 }) : void >f6 : ({x, y}?: { x?: number; y?: number; }) => void >{ y: 1 } : { y: number; } >y : number ->1 : number +>1 : 1 f6({ x: 1, y: 1 }); >f6({ x: 1, y: 1 }) : void >f6 : ({x, y}?: { x?: number; y?: number; }) => void >{ x: 1, y: 1 } : { x: number; y: number; } >x : number ->1 : number +>1 : 1 >y : number ->1 : number +>1 : 1 // (arg?: { a: { x?: number, y?: number } }) => void function f7({ a: { x = 0, y = 0 } } = { a: {} }) { } >f7 : ({a: {x, y}}?: { a: { x?: number; y?: number; }; }) => void >a : any >x : number ->0 : number +>0 : 0 >y : number ->0 : number +>0 : 0 >{ a: {} } : { a: { x?: number; y?: number; }; } >a : { x?: number; y?: number; } >{} : { x?: number; y?: number; } @@ -198,7 +198,7 @@ f7({ a: { x: 1 } }); >a : { x: number; } >{ x: 1 } : { x: number; } >x : number ->1 : number +>1 : 1 f7({ a: { y: 1 } }); >f7({ a: { y: 1 } }) : void @@ -207,7 +207,7 @@ f7({ a: { y: 1 } }); >a : { y: number; } >{ y: 1 } : { y: number; } >y : number ->1 : number +>1 : 1 f7({ a: { x: 1, y: 1 } }); >f7({ a: { x: 1, y: 1 } }) : void @@ -216,9 +216,9 @@ f7({ a: { x: 1, y: 1 } }); >a : { x: number; y: number; } >{ x: 1, y: 1 } : { x: number; y: number; } >x : number ->1 : number +>1 : 1 >y : number ->1 : number +>1 : 1 // (arg: [any, any]) => void function g1([x, y]) { } @@ -230,23 +230,23 @@ g1([1, 1]); >g1([1, 1]) : void >g1 : ([x, y]: [any, any]) => void >[1, 1] : [number, number] ->1 : number ->1 : number +>1 : 1 +>1 : 1 // (arg: [number, number]) => void function g2([x = 0, y = 0]) { } >g2 : ([x, y]: [number, number]) => void >x : number ->0 : number +>0 : 0 >y : number ->0 : number +>0 : 0 g2([1, 1]); >g2([1, 1]) : void >g2 : ([x, y]: [number, number]) => void >[1, 1] : [number, number] ->1 : number ->1 : number +>1 : 1 +>1 : 1 // (arg?: [number, number]) => void function g3([x, y] = [0, 0]) { } @@ -254,8 +254,8 @@ function g3([x, y] = [0, 0]) { } >x : number >y : number >[0, 0] : [number, number] ->0 : number ->0 : number +>0 : 0 +>0 : 0 g3(); >g3() : void @@ -265,17 +265,17 @@ g3([1, 1]); >g3([1, 1]) : void >g3 : ([x, y]?: [number, number]) => void >[1, 1] : [number, number] ->1 : number ->1 : number +>1 : 1 +>1 : 1 // (arg?: [number, number]) => void function g4([x, y = 0] = [0]) { } >g4 : ([x, y]?: [number, number]) => void >x : number >y : number ->0 : number +>0 : 0 >[0] : [number, number] ->0 : number +>0 : 0 g4(); >g4() : void @@ -285,16 +285,16 @@ g4([1, 1]); >g4([1, 1]) : void >g4 : ([x, y]?: [number, number]) => void >[1, 1] : [number, number] ->1 : number ->1 : number +>1 : 1 +>1 : 1 // (arg?: [number, number]) => void function g5([x = 0, y = 0] = []) { } >g5 : ([x, y]?: [number, number]) => void >x : number ->0 : number +>0 : 0 >y : number ->0 : number +>0 : 0 >[] : [number, number] g5(); @@ -305,6 +305,6 @@ g5([1, 1]); >g5([1, 1]) : void >g5 : ([x, y]?: [number, number]) => void >[1, 1] : [number, number] ->1 : number ->1 : number +>1 : 1 +>1 : 1 diff --git a/tests/baselines/reference/destructuringWithNewExpression.types b/tests/baselines/reference/destructuringWithNewExpression.types index 1d36746a44d..2803dfd802f 100644 --- a/tests/baselines/reference/destructuringWithNewExpression.types +++ b/tests/baselines/reference/destructuringWithNewExpression.types @@ -4,7 +4,7 @@ class C { x = 0; >x : number ->0 : number +>0 : 0 } var { x } = new C; diff --git a/tests/baselines/reference/destructuringWithNumberLiteral.types b/tests/baselines/reference/destructuringWithNumberLiteral.types index 7fe902c622e..226c3fd4923 100644 --- a/tests/baselines/reference/destructuringWithNumberLiteral.types +++ b/tests/baselines/reference/destructuringWithNumberLiteral.types @@ -1,5 +1,5 @@ === tests/cases/compiler/destructuringWithNumberLiteral.ts === var { toExponential } = 0; >toExponential : (fractionDigits?: number) => string ->0 : number +>0 : 0 diff --git a/tests/baselines/reference/doNotEmitDetachedComments.types b/tests/baselines/reference/doNotEmitDetachedComments.types index d9b5f0634c2..ee361223560 100644 --- a/tests/baselines/reference/doNotEmitDetachedComments.types +++ b/tests/baselines/reference/doNotEmitDetachedComments.types @@ -7,7 +7,7 @@ var x = 10; >x : number ->10 : number +>10 : 10 // Single Line comment diff --git a/tests/baselines/reference/doNotEmitDetachedCommentsAtStartOfConstructor.types b/tests/baselines/reference/doNotEmitDetachedCommentsAtStartOfConstructor.types index c316c6403c0..b8879c4236e 100644 --- a/tests/baselines/reference/doNotEmitDetachedCommentsAtStartOfConstructor.types +++ b/tests/baselines/reference/doNotEmitDetachedCommentsAtStartOfConstructor.types @@ -7,7 +7,7 @@ class A { var x = 10; >x : number ->10 : number +>10 : 10 } } @@ -21,7 +21,7 @@ class B { var y = 10; >y : number ->10 : number +>10 : 10 } } @@ -34,7 +34,7 @@ class C { var x = 10; >x : number ->10 : number +>10 : 10 } } @@ -49,6 +49,6 @@ class D { var y = 10; >y : number ->10 : number +>10 : 10 } } diff --git a/tests/baselines/reference/doNotEmitDetachedCommentsAtStartOfFunctionBody.types b/tests/baselines/reference/doNotEmitDetachedCommentsAtStartOfFunctionBody.types index 3b4814bbbb2..78c3d946f1d 100644 --- a/tests/baselines/reference/doNotEmitDetachedCommentsAtStartOfFunctionBody.types +++ b/tests/baselines/reference/doNotEmitDetachedCommentsAtStartOfFunctionBody.types @@ -5,7 +5,7 @@ function foo1() { // Single line comment return 42; ->42 : number +>42 : 42 } function foo2() { @@ -18,7 +18,7 @@ function foo2() { */ return 42; ->42 : number +>42 : 42 } function foo3() { @@ -28,7 +28,7 @@ function foo3() { return 42; ->42 : number +>42 : 42 } function foo4() { @@ -40,7 +40,7 @@ function foo4() { */ return 42; ->42 : number +>42 : 42 } diff --git a/tests/baselines/reference/doNotEmitDetachedCommentsAtStartOfLambdaFunction.types b/tests/baselines/reference/doNotEmitDetachedCommentsAtStartOfLambdaFunction.types index d90e93d84c5..cca2ff86469 100644 --- a/tests/baselines/reference/doNotEmitDetachedCommentsAtStartOfLambdaFunction.types +++ b/tests/baselines/reference/doNotEmitDetachedCommentsAtStartOfLambdaFunction.types @@ -5,7 +5,7 @@ // Single line comment return 0; ->0 : number +>0 : 0 } () => { @@ -16,7 +16,7 @@ */ return 0; ->0 : number +>0 : 0 } () => { @@ -26,7 +26,7 @@ return 0; ->0 : number +>0 : 0 } () => { @@ -38,6 +38,6 @@ return 0; ->0 : number +>0 : 0 } diff --git a/tests/baselines/reference/doNotEmitPinnedCommentNotOnTopOfFile.types b/tests/baselines/reference/doNotEmitPinnedCommentNotOnTopOfFile.types index 3426c70dfb9..e76d9e6b8e1 100644 --- a/tests/baselines/reference/doNotEmitPinnedCommentNotOnTopOfFile.types +++ b/tests/baselines/reference/doNotEmitPinnedCommentNotOnTopOfFile.types @@ -1,7 +1,7 @@ === tests/cases/compiler/doNotEmitPinnedCommentNotOnTopOfFile.ts === var x = 10; >x : number ->10 : number +>10 : 10 /*! @@ -11,5 +11,5 @@ var x = 10; var x = 10; >x : number ->10 : number +>10 : 10 diff --git a/tests/baselines/reference/doNotEmitPinnedCommentOnNotEmittedNode.types b/tests/baselines/reference/doNotEmitPinnedCommentOnNotEmittedNode.types index 49fb8e378ba..491ccdbd0d0 100644 --- a/tests/baselines/reference/doNotEmitPinnedCommentOnNotEmittedNode.types +++ b/tests/baselines/reference/doNotEmitPinnedCommentOnNotEmittedNode.types @@ -17,7 +17,7 @@ class C { var x = 10; >x : number ->10 : number +>10 : 10 /*! remove pinned comment anywhere else */ declare var OData: any; diff --git a/tests/baselines/reference/doNotEmitPinnedDetachedComments.types b/tests/baselines/reference/doNotEmitPinnedDetachedComments.types index d9e78e2f980..f953b81a713 100644 --- a/tests/baselines/reference/doNotEmitPinnedDetachedComments.types +++ b/tests/baselines/reference/doNotEmitPinnedDetachedComments.types @@ -1,7 +1,7 @@ === tests/cases/compiler/doNotEmitPinnedDetachedComments.ts === var x = 10; >x : number ->10 : number +>10 : 10 /*! Single Line comment */ @@ -33,7 +33,7 @@ function foo() { /*! Remove this */ return 0; ->0 : number +>0 : 0 } diff --git a/tests/baselines/reference/doNotWidenAtObjectLiteralPropertyAssignment.types b/tests/baselines/reference/doNotWidenAtObjectLiteralPropertyAssignment.types index f151b5841c0..d61bd343c64 100644 --- a/tests/baselines/reference/doNotWidenAtObjectLiteralPropertyAssignment.types +++ b/tests/baselines/reference/doNotWidenAtObjectLiteralPropertyAssignment.types @@ -26,7 +26,7 @@ var test: IIntervalTreeNode[] = [{ interval: { begin: 0 }, children: null }]; // >interval : { begin: number; } >{ begin: 0 } : { begin: number; } >begin : number ->0 : number +>0 : 0 >children : null >null : null diff --git a/tests/baselines/reference/doNotemitTripleSlashComments.types b/tests/baselines/reference/doNotemitTripleSlashComments.types index edebe5687f6..8bad6e601de 100644 --- a/tests/baselines/reference/doNotemitTripleSlashComments.types +++ b/tests/baselines/reference/doNotemitTripleSlashComments.types @@ -17,12 +17,12 @@ function bar() { } /// var x = 10; >x : number ->10 : number +>10 : 10 /// var y = "hello"; >y : string ->"hello" : string +>"hello" : "hello" /// @@ -39,5 +39,5 @@ function foo() { } var z = "world"; >z : string ->"world" : string +>"world" : "world" diff --git a/tests/baselines/reference/doWhileBreakStatements.types b/tests/baselines/reference/doWhileBreakStatements.types index f143cb17d08..bc5102dc330 100644 --- a/tests/baselines/reference/doWhileBreakStatements.types +++ b/tests/baselines/reference/doWhileBreakStatements.types @@ -3,7 +3,7 @@ do { break; } while(true) ->true : boolean +>true : true ONE: >ONE : any @@ -13,7 +13,7 @@ do { >ONE : any } while (true) ->true : boolean +>true : true TWO: >TWO : any @@ -26,7 +26,7 @@ do { >THREE : any }while (true) ->true : boolean +>true : true FOUR: >FOUR : any @@ -40,10 +40,10 @@ do { >FOUR : any }while (true) ->true : boolean +>true : true }while (true) ->true : boolean +>true : true do { SIX: @@ -51,19 +51,19 @@ do { do break SIX; while(true) >SIX : any ->true : boolean +>true : true }while (true) ->true : boolean +>true : true SEVEN: >SEVEN : any do do do break SEVEN; while (true) while (true) while (true) >SEVEN : any ->true : boolean ->true : boolean ->true : boolean +>true : true +>true : true +>true : true EIGHT: >EIGHT : any @@ -77,5 +77,5 @@ do{ >EIGHT : any }while(true) ->true : boolean +>true : true diff --git a/tests/baselines/reference/doWhileContinueStatements.types b/tests/baselines/reference/doWhileContinueStatements.types index e4d3191d040..66ff052a3cd 100644 --- a/tests/baselines/reference/doWhileContinueStatements.types +++ b/tests/baselines/reference/doWhileContinueStatements.types @@ -3,7 +3,7 @@ do { continue; } while(true) ->true : boolean +>true : true ONE: >ONE : any @@ -13,7 +13,7 @@ do { >ONE : any } while (true) ->true : boolean +>true : true TWO: >TWO : any @@ -26,7 +26,7 @@ do { >THREE : any }while (true) ->true : boolean +>true : true FOUR: >FOUR : any @@ -40,10 +40,10 @@ do { >FOUR : any }while (true) ->true : boolean +>true : true }while (true) ->true : boolean +>true : true do { SIX: @@ -51,19 +51,19 @@ do { do continue SIX; while(true) >SIX : any ->true : boolean +>true : true }while (true) ->true : boolean +>true : true SEVEN: >SEVEN : any do do do continue SEVEN; while (true) while (true) while (true) >SEVEN : any ->true : boolean ->true : boolean ->true : boolean +>true : true +>true : true +>true : true EIGHT: >EIGHT : any @@ -77,5 +77,5 @@ do{ >EIGHT : any }while(true) ->true : boolean +>true : true diff --git a/tests/baselines/reference/doWhileLoop.types b/tests/baselines/reference/doWhileLoop.types index 9d1767b45aa..24d24ae4dca 100644 --- a/tests/baselines/reference/doWhileLoop.types +++ b/tests/baselines/reference/doWhileLoop.types @@ -1,6 +1,6 @@ === tests/cases/compiler/doWhileLoop.ts === do { } while (false); ->false : boolean +>false : false var n; >n : any diff --git a/tests/baselines/reference/dottedModuleName2.types b/tests/baselines/reference/dottedModuleName2.types index 869bbfb4cfc..6e58412481d 100644 --- a/tests/baselines/reference/dottedModuleName2.types +++ b/tests/baselines/reference/dottedModuleName2.types @@ -5,7 +5,7 @@ module A.B { export var x = 1; >x : number ->1 : number +>1 : 1 } @@ -17,7 +17,7 @@ module AA { export module B { export var x = 1; >x : number ->1 : number +>1 : 1 } } @@ -49,7 +49,7 @@ module A.B.C export var x = 1; >x : number ->1 : number +>1 : 1 } diff --git a/tests/baselines/reference/dottedSymbolResolution1.types b/tests/baselines/reference/dottedSymbolResolution1.types index cf5a5e3ba9d..3cc8e0db513 100644 --- a/tests/baselines/reference/dottedSymbolResolution1.types +++ b/tests/baselines/reference/dottedSymbolResolution1.types @@ -68,7 +68,7 @@ function _setBarAndText(): void { >x.find : (selector: string) => JQuery >x : JQuery >find : (selector: string) => JQuery ->" " : string +>" " : " " >function () { var $this: JQuery = $(''), thisBar = $this.find(".fx-usagebars-calloutbar-this"); // bug lead to 'could not find dotted symbol' here } : () => void var $this: JQuery = $(''), @@ -76,7 +76,7 @@ function _setBarAndText(): void { >JQuery : JQuery >$('') : JQuery >$ : JQueryStatic ->'' : string +>'' : "" thisBar = $this.find(".fx-usagebars-calloutbar-this"); // bug lead to 'could not find dotted symbol' here >thisBar : JQuery @@ -84,7 +84,7 @@ function _setBarAndText(): void { >$this.find : (selector: string) => JQuery >$this : JQuery >find : (selector: string) => JQuery ->".fx-usagebars-calloutbar-this" : string +>".fx-usagebars-calloutbar-this" : ".fx-usagebars-calloutbar-this" } ); } diff --git a/tests/baselines/reference/downlevelLetConst10.types b/tests/baselines/reference/downlevelLetConst10.types index 3d700b0694d..e94ed7e1178 100644 --- a/tests/baselines/reference/downlevelLetConst10.types +++ b/tests/baselines/reference/downlevelLetConst10.types @@ -1,5 +1,5 @@ === tests/cases/compiler/downlevelLetConst10.ts === let a: number = 1 >a : number ->1 : number +>1 : 1 diff --git a/tests/baselines/reference/downlevelLetConst13.types b/tests/baselines/reference/downlevelLetConst13.types index 0453d3a6ad3..92bb3226f94 100644 --- a/tests/baselines/reference/downlevelLetConst13.types +++ b/tests/baselines/reference/downlevelLetConst13.types @@ -1,74 +1,74 @@ === tests/cases/compiler/downlevelLetConst13.ts === 'use strict' ->'use strict' : string +>'use strict' : "use strict" // exported let\const bindings should not be renamed export let foo = 10; >foo : number ->10 : number +>10 : 10 export const bar = "123" ->bar : string ->"123" : string +>bar : "123" +>"123" : "123" export let [bar1] = [1]; >bar1 : number >[1] : [number] ->1 : number +>1 : 1 export const [bar2] = [2]; >bar2 : number >[2] : [number] ->2 : number +>2 : 2 export let {a: bar3} = { a: 1 }; >a : any >bar3 : number >{ a: 1 } : { a: number; } >a : number ->1 : number +>1 : 1 export const {a: bar4} = { a: 1 }; >a : any >bar4 : number >{ a: 1 } : { a: number; } >a : number ->1 : number +>1 : 1 export module M { >M : typeof M export let baz = 100; >baz : number ->100 : number +>100 : 100 export const baz2 = true; ->baz2 : boolean ->true : boolean +>baz2 : true +>true : true export let [bar5] = [1]; >bar5 : number >[1] : [number] ->1 : number +>1 : 1 export const [bar6] = [2]; >bar6 : number >[2] : [number] ->2 : number +>2 : 2 export let {a: bar7} = { a: 1 }; >a : any >bar7 : number >{ a: 1 } : { a: number; } >a : number ->1 : number +>1 : 1 export const {a: bar8} = { a: 1 }; >a : any >bar8 : number >{ a: 1 } : { a: number; } >a : number ->1 : number +>1 : 1 } diff --git a/tests/baselines/reference/downlevelLetConst14.types b/tests/baselines/reference/downlevelLetConst14.types index ea6aadfe2a8..29c87e76cce 100644 --- a/tests/baselines/reference/downlevelLetConst14.types +++ b/tests/baselines/reference/downlevelLetConst14.types @@ -1,6 +1,6 @@ === tests/cases/compiler/downlevelLetConst14.ts === 'use strict' ->'use strict' : string +>'use strict' : "use strict" declare function use(a: any); >use : (a: any) => any @@ -8,7 +8,7 @@ declare function use(a: any); var x = 10; >x : number ->10 : number +>10 : 10 var z0, z1, z2, z3; >z0 : any @@ -18,7 +18,7 @@ var z0, z1, z2, z3; { let x = 20; >x : number ->20 : number +>20 : 20 use(x); >use(x) : any @@ -28,7 +28,7 @@ var z0, z1, z2, z3; let [z0] = [1]; >z0 : number >[1] : [number] ->1 : number +>1 : 1 use(z0); >use(z0) : any @@ -38,7 +38,7 @@ var z0, z1, z2, z3; let [z1] = [1] >z1 : number >[1] : [number] ->1 : number +>1 : 1 use(z1); >use(z1) : any @@ -50,7 +50,7 @@ var z0, z1, z2, z3; >z2 : number >{ a: 1 } : { a: number; } >a : number ->1 : number +>1 : 1 use(z2); >use(z2) : any @@ -62,7 +62,7 @@ var z0, z1, z2, z3; >z3 : number >{ a: 1 } : { a: number; } >a : number ->1 : number +>1 : 1 use(z3); >use(z3) : any @@ -99,27 +99,27 @@ var z6; var y = true; >y : boolean ->true : boolean +>true : true { let y = ""; >y : string ->"" : string +>"" : "" let [z6] = [true] >z6 : boolean >[true] : [boolean] ->true : boolean +>true : true { let y = 1; >y : number ->1 : number +>1 : 1 let {a: z6} = {a: 1} >a : any >z6 : number >{a: 1} : { a: number; } >a : number ->1 : number +>1 : 1 use(y); >use(y) : any @@ -144,7 +144,7 @@ var y = true; use(y); >use(y) : any >use : (a: any) => any ->y : boolean +>y : true use(z6); >use(z6) : any @@ -153,31 +153,31 @@ use(z6); var z = false; >z : boolean ->false : boolean +>false : false var z5 = 1; >z5 : number ->1 : number +>1 : 1 { let z = ""; >z : string ->"" : string +>"" : "" let [z5] = [5]; >z5 : number >[5] : [number] ->5 : number +>5 : 5 { let _z = 1; >_z : number ->1 : number +>1 : 1 let {a: _z5} = { a: 1 }; >a : any >_z5 : number >{ a: 1 } : { a: number; } >a : number ->1 : number +>1 : 1 // try to step on generated name use(_z); @@ -193,5 +193,5 @@ var z5 = 1; use(y); >use(y) : any >use : (a: any) => any ->y : boolean +>y : true diff --git a/tests/baselines/reference/downlevelLetConst15.types b/tests/baselines/reference/downlevelLetConst15.types index 72b29e3fe66..9e58c648821 100644 --- a/tests/baselines/reference/downlevelLetConst15.types +++ b/tests/baselines/reference/downlevelLetConst15.types @@ -1,6 +1,6 @@ === tests/cases/compiler/downlevelLetConst15.ts === 'use strict' ->'use strict' : string +>'use strict' : "use strict" declare function use(a: any); >use : (a: any) => any @@ -8,7 +8,7 @@ declare function use(a: any); var x = 10; >x : number ->10 : number +>10 : 10 var z0, z1, z2, z3; >z0 : any @@ -17,18 +17,18 @@ var z0, z1, z2, z3; >z3 : any { const x = 20; ->x : number ->20 : number +>x : 20 +>20 : 20 use(x); >use(x) : any >use : (a: any) => any ->x : number +>x : 20 const [z0] = [1]; >z0 : number >[1] : [number] ->1 : number +>1 : 1 use(z0); >use(z0) : any @@ -41,7 +41,7 @@ var z0, z1, z2, z3; >[{a: 1}] : [{ a: number; }] >{a: 1} : { a: number; } >a : number ->1 : number +>1 : 1 use(z1); >use(z1) : any @@ -53,7 +53,7 @@ var z0, z1, z2, z3; >z2 : number >{ a: 1 } : { a: number; } >a : number ->1 : number +>1 : 1 use(z2); >use(z2) : any @@ -68,7 +68,7 @@ var z0, z1, z2, z3; >a : { b: number; } >{b: 1} : { b: number; } >b : number ->1 : number +>1 : 1 use(z3); >use(z3) : any @@ -105,32 +105,32 @@ var z6; var y = true; >y : boolean ->true : boolean +>true : true { const y = ""; ->y : string ->"" : string +>y : "" +>"" : "" const [z6] = [true] >z6 : boolean >[true] : [boolean] ->true : boolean +>true : true { const y = 1; ->y : number ->1 : number +>y : 1 +>1 : 1 const {a: z6} = { a: 1 } >a : any >z6 : number >{ a: 1 } : { a: number; } >a : number ->1 : number +>1 : 1 use(y); >use(y) : any >use : (a: any) => any ->y : number +>y : 1 use(z6); >use(z6) : any @@ -140,7 +140,7 @@ var y = true; use(y); >use(y) : any >use : (a: any) => any ->y : string +>y : "" use(z6); >use(z6) : any @@ -150,7 +150,7 @@ var y = true; use(y); >use(y) : any >use : (a: any) => any ->y : boolean +>y : true use(z6); >use(z6) : any @@ -159,45 +159,45 @@ use(z6); var z = false; >z : boolean ->false : boolean +>false : false var z5 = 1; >z5 : number ->1 : number +>1 : 1 { const z = ""; ->z : string ->"" : string +>z : "" +>"" : "" const [z5] = [5]; >z5 : number >[5] : [number] ->5 : number +>5 : 5 { const _z = 1; ->_z : number ->1 : number +>_z : 1 +>1 : 1 const {a: _z5} = { a: 1 }; >a : any >_z5 : number >{ a: 1 } : { a: number; } >a : number ->1 : number +>1 : 1 // try to step on generated name use(_z); >use(_z) : any >use : (a: any) => any ->_z : number +>_z : 1 } use(z); >use(z) : any >use : (a: any) => any ->z : string +>z : "" } use(y); >use(y) : any >use : (a: any) => any ->y : boolean +>y : true diff --git a/tests/baselines/reference/downlevelLetConst17.types b/tests/baselines/reference/downlevelLetConst17.types index 4f539835ada..56e9356556e 100644 --- a/tests/baselines/reference/downlevelLetConst17.types +++ b/tests/baselines/reference/downlevelLetConst17.types @@ -1,6 +1,6 @@ === tests/cases/compiler/downlevelLetConst17.ts === 'use strict' ->'use strict' : string +>'use strict' : "use strict" declare function use(a: any); >use : (a: any) => any @@ -11,7 +11,7 @@ var x; for (let x = 10; ;) { >x : number ->10 : number +>10 : 10 use(x); >use(x) : any @@ -24,19 +24,19 @@ use(x); >x : any for (const x = 10; ;) { ->x : number ->10 : number +>x : 10 +>10 : 10 use(x); >use(x) : any >use : (a: any) => any ->x : number +>x : 10 } for (; ;) { let x = 10; >x : number ->10 : number +>10 : 10 use(x); >use(x) : any @@ -44,20 +44,20 @@ for (; ;) { >x : number x = 1; ->x = 1 : number +>x = 1 : 1 >x : number ->1 : number +>1 : 1 } for (; ;) { const x = 10; ->x : number ->10 : number +>x : 10 +>10 : 10 use(x); >use(x) : any >use : (a: any) => any ->x : number +>x : 10 } for (let x; ;) { @@ -69,9 +69,9 @@ for (let x; ;) { >x : any x = 1; ->x = 1 : number +>x = 1 : 1 >x : any ->1 : number +>1 : 1 } for (; ;) { @@ -84,13 +84,13 @@ for (; ;) { >x : any x = 1; ->x = 1 : number +>x = 1 : 1 >x : any ->1 : number +>1 : 1 } while (true) { ->true : boolean +>true : true let x; >x : any @@ -102,16 +102,16 @@ while (true) { } while (true) { ->true : boolean +>true : true const x = true; ->x : boolean ->true : boolean +>x : true +>true : true use(x); >use(x) : any >use : (a: any) => any ->x : boolean +>x : true } do { @@ -124,7 +124,7 @@ do { >x : any } while (true); ->true : boolean +>true : true do { let x; @@ -136,7 +136,7 @@ do { >x : any } while (true); ->true : boolean +>true : true for (let x in []) { >x : string diff --git a/tests/baselines/reference/downlevelLetConst3.types b/tests/baselines/reference/downlevelLetConst3.types index cf8def45e3c..7be4e55849d 100644 --- a/tests/baselines/reference/downlevelLetConst3.types +++ b/tests/baselines/reference/downlevelLetConst3.types @@ -1,5 +1,5 @@ === tests/cases/compiler/downlevelLetConst3.ts === const a = 1 ->a : number ->1 : number +>a : 1 +>1 : 1 diff --git a/tests/baselines/reference/downlevelLetConst5.types b/tests/baselines/reference/downlevelLetConst5.types index 2cdf6ff53cc..ebb36072415 100644 --- a/tests/baselines/reference/downlevelLetConst5.types +++ b/tests/baselines/reference/downlevelLetConst5.types @@ -1,5 +1,5 @@ === tests/cases/compiler/downlevelLetConst5.ts === const a: number = 1 >a : number ->1 : number +>1 : 1 diff --git a/tests/baselines/reference/downlevelLetConst8.types b/tests/baselines/reference/downlevelLetConst8.types index c941d673503..01acafd1785 100644 --- a/tests/baselines/reference/downlevelLetConst8.types +++ b/tests/baselines/reference/downlevelLetConst8.types @@ -1,5 +1,5 @@ === tests/cases/compiler/downlevelLetConst8.ts === let a = 1 >a : number ->1 : number +>1 : 1 diff --git a/tests/baselines/reference/duplicateAnonymousInners1.types b/tests/baselines/reference/duplicateAnonymousInners1.types index 6840e5a14f6..01c2f7984cc 100644 --- a/tests/baselines/reference/duplicateAnonymousInners1.types +++ b/tests/baselines/reference/duplicateAnonymousInners1.types @@ -14,7 +14,7 @@ module Foo { export var Outer=0; >Outer : number ->0 : number +>0 : 0 } diff --git a/tests/baselines/reference/duplicateLabel3.types b/tests/baselines/reference/duplicateLabel3.types index 920a077aa9e..56af6f24088 100644 --- a/tests/baselines/reference/duplicateLabel3.types +++ b/tests/baselines/reference/duplicateLabel3.types @@ -4,7 +4,7 @@ target: >target : any while (true) { ->true : boolean +>true : true function f() { >f : () => void @@ -13,7 +13,7 @@ while (true) { >target : any while (true) { ->true : boolean +>true : true } } } diff --git a/tests/baselines/reference/duplicateLabel4.types b/tests/baselines/reference/duplicateLabel4.types index a10a06fe7a2..2f5890ae9a4 100644 --- a/tests/baselines/reference/duplicateLabel4.types +++ b/tests/baselines/reference/duplicateLabel4.types @@ -4,12 +4,12 @@ target: >target : any while (true) { ->true : boolean +>true : true } target: >target : any while (true) { ->true : boolean +>true : true } diff --git a/tests/baselines/reference/duplicateLocalVariable1.errors.txt b/tests/baselines/reference/duplicateLocalVariable1.errors.txt index b264574ea09..87bcc71cdfc 100644 --- a/tests/baselines/reference/duplicateLocalVariable1.errors.txt +++ b/tests/baselines/reference/duplicateLocalVariable1.errors.txt @@ -2,7 +2,7 @@ tests/cases/compiler/duplicateLocalVariable1.ts(2,4): error TS1005: ';' expected tests/cases/compiler/duplicateLocalVariable1.ts(2,11): error TS1146: Declaration expected. tests/cases/compiler/duplicateLocalVariable1.ts(2,13): error TS2304: Cannot find name 'commonjs'. tests/cases/compiler/duplicateLocalVariable1.ts(187,22): error TS2403: Subsequent variable declarations must have the same type. Variable 'i' must be of type 'string', but here has type 'number'. -tests/cases/compiler/duplicateLocalVariable1.ts(187,29): error TS2365: Operator '<' cannot be applied to types 'string' and 'number'. +tests/cases/compiler/duplicateLocalVariable1.ts(187,29): error TS2365: Operator '<' cannot be applied to types 'string' and '14'. tests/cases/compiler/duplicateLocalVariable1.ts(187,37): error TS2356: An arithmetic operand must be of type 'any', 'number' or an enum type. @@ -203,7 +203,7 @@ tests/cases/compiler/duplicateLocalVariable1.ts(187,37): error TS2356: An arithm ~ !!! error TS2403: Subsequent variable declarations must have the same type. Variable 'i' must be of type 'string', but here has type 'number'. ~~~~~~ -!!! error TS2365: Operator '<' cannot be applied to types 'string' and 'number'. +!!! error TS2365: Operator '<' cannot be applied to types 'string' and '14'. ~ !!! error TS2356: An arithmetic operand must be of type 'any', 'number' or an enum type. bytes.push(fb.readByte()); diff --git a/tests/baselines/reference/duplicateLocalVariable2.errors.txt b/tests/baselines/reference/duplicateLocalVariable2.errors.txt index 5e89cc422cc..466e145d28d 100644 --- a/tests/baselines/reference/duplicateLocalVariable2.errors.txt +++ b/tests/baselines/reference/duplicateLocalVariable2.errors.txt @@ -1,5 +1,5 @@ tests/cases/compiler/duplicateLocalVariable2.ts(27,22): error TS2403: Subsequent variable declarations must have the same type. Variable 'i' must be of type 'string', but here has type 'number'. -tests/cases/compiler/duplicateLocalVariable2.ts(27,29): error TS2365: Operator '<' cannot be applied to types 'string' and 'number'. +tests/cases/compiler/duplicateLocalVariable2.ts(27,29): error TS2365: Operator '<' cannot be applied to types 'string' and '14'. tests/cases/compiler/duplicateLocalVariable2.ts(27,37): error TS2356: An arithmetic operand must be of type 'any', 'number' or an enum type. @@ -34,7 +34,7 @@ tests/cases/compiler/duplicateLocalVariable2.ts(27,37): error TS2356: An arithme ~ !!! error TS2403: Subsequent variable declarations must have the same type. Variable 'i' must be of type 'string', but here has type 'number'. ~~~~~~ -!!! error TS2365: Operator '<' cannot be applied to types 'string' and 'number'. +!!! error TS2365: Operator '<' cannot be applied to types 'string' and '14'. ~ !!! error TS2356: An arithmetic operand must be of type 'any', 'number' or an enum type. bytes.push(fb.readByte()); diff --git a/tests/baselines/reference/duplicateVariablesByScope.types b/tests/baselines/reference/duplicateVariablesByScope.types index 30e68d921ca..4eec3a2054f 100644 --- a/tests/baselines/reference/duplicateVariablesByScope.types +++ b/tests/baselines/reference/duplicateVariablesByScope.types @@ -7,20 +7,20 @@ module M { for (var j = 0; j < 10; j++) { >j : number ->0 : number +>0 : 0 >j < 10 : boolean >j : number ->10 : number +>10 : 10 >j++ : number >j : number } for (var j = 0; j < 10; j++) { >j : number ->0 : number +>0 : 0 >j < 10 : boolean >j : number ->10 : number +>10 : 10 >j++ : number >j : number } @@ -31,23 +31,23 @@ function foo() { var x = 2; >x : number ->2 : number +>2 : 2 var x = 1; >x : number ->1 : number +>1 : 1 if (true) { ->true : boolean +>true : true var result = 1; >result : number ->1 : number +>1 : 1 } else { var result = 2; >result : number ->2 : number +>2 : 2 } } @@ -60,14 +60,14 @@ class C { try { var x = 1; >x : number ->1 : number +>1 : 1 } catch (e) { >e : any var x = 2; >x : number ->2 : number +>2 : 2 } } } diff --git a/tests/baselines/reference/dynamicModuleTypecheckError.types b/tests/baselines/reference/dynamicModuleTypecheckError.types index e50107f328b..d2dbc1a71d9 100644 --- a/tests/baselines/reference/dynamicModuleTypecheckError.types +++ b/tests/baselines/reference/dynamicModuleTypecheckError.types @@ -1,14 +1,14 @@ === tests/cases/compiler/dynamicModuleTypecheckError.ts === export var x = 1; >x : number ->1 : number +>1 : 1 for(var i = 0; i < 30; i++) { >i : number ->0 : number +>0 : 0 >i < 30 : boolean >i : number ->30 : number +>30 : 30 >i++ : number >i : number @@ -17,7 +17,7 @@ for(var i = 0; i < 30; i++) { >x : number >i * 1000 : number >i : number ->1000 : number +>1000 : 1000 } diff --git a/tests/baselines/reference/dynamicRequire.types b/tests/baselines/reference/dynamicRequire.types index 43eea88a05b..9b7a6c359d5 100644 --- a/tests/baselines/reference/dynamicRequire.types +++ b/tests/baselines/reference/dynamicRequire.types @@ -9,6 +9,6 @@ function foo(name) { >require("t/" + name) : any >require : any >"t/" + name : string ->"t/" : string +>"t/" : "t/" >name : any } diff --git a/tests/baselines/reference/elidingImportNames.types b/tests/baselines/reference/elidingImportNames.types index 947cd38f6d4..8dd6b315137 100644 --- a/tests/baselines/reference/elidingImportNames.types +++ b/tests/baselines/reference/elidingImportNames.types @@ -22,10 +22,10 @@ var b2 = a2; === tests/cases/compiler/elidingImportNames_main.ts === export var main = 10; >main : number ->10 : number +>10 : 10 === tests/cases/compiler/elidingImportNames_main1.ts === export var main = 10; >main : number ->10 : number +>10 : 10 diff --git a/tests/baselines/reference/emitArrowFunction.types b/tests/baselines/reference/emitArrowFunction.types index 2ac9ef07af4..aa0627632c8 100644 --- a/tests/baselines/reference/emitArrowFunction.types +++ b/tests/baselines/reference/emitArrowFunction.types @@ -22,7 +22,7 @@ var f4 = (x: string, y: number, z = 10) => { } >x : string >y : number >z : number ->10 : number +>10 : 10 function foo(func: () => boolean) { } >foo : (func: () => boolean) => void @@ -31,12 +31,12 @@ function foo(func: () => boolean) { } foo(() => true); >foo(() => true) : void >foo : (func: () => boolean) => void ->() => true : () => boolean ->true : boolean +>() => true : () => true +>true : true foo(() => { return false; }); >foo(() => { return false; }) : void >foo : (func: () => boolean) => void ->() => { return false; } : () => boolean ->false : boolean +>() => { return false; } : () => false +>false : false diff --git a/tests/baselines/reference/emitArrowFunctionES6.types b/tests/baselines/reference/emitArrowFunctionES6.types index d37c08f855c..c434e4b285a 100644 --- a/tests/baselines/reference/emitArrowFunctionES6.types +++ b/tests/baselines/reference/emitArrowFunctionES6.types @@ -22,7 +22,7 @@ var f4 = (x: string, y: number, z=10) => { } >x : string >y : number >z : number ->10 : number +>10 : 10 function foo(func: () => boolean) { } >foo : (func: () => boolean) => void @@ -31,14 +31,14 @@ function foo(func: () => boolean) { } foo(() => true); >foo(() => true) : void >foo : (func: () => boolean) => void ->() => true : () => boolean ->true : boolean +>() => true : () => true +>true : true foo(() => { return false; }); >foo(() => { return false; }) : void >foo : (func: () => boolean) => void ->() => { return false; } : () => boolean ->false : boolean +>() => { return false; } : () => false +>false : false // Binding patterns in arrow functions var p1 = ([a]) => { }; @@ -67,7 +67,7 @@ var p5 = ([a = 1]) => { }; >p5 : ([a]: [number]) => void >([a = 1]) => { } : ([a]: [number]) => void >a : number ->1 : number +>1 : 1 var p6 = ({ a }) => { }; >p6 : ({a}: { a: any; }) => void @@ -84,17 +84,17 @@ var p8 = ({ a = 1 }) => { }; >p8 : ({a}: { a?: number; }) => void >({ a = 1 }) => { } : ({a}: { a?: number; }) => void >a : number ->1 : number +>1 : 1 var p9 = ({ a: { b = 1 } = { b: 1 } }) => { }; >p9 : ({a: {b}}: { a?: { b?: number; }; }) => void >({ a: { b = 1 } = { b: 1 } }) => { } : ({a: {b}}: { a?: { b?: number; }; }) => void >a : any >b : number ->1 : number +>1 : 1 >{ b: 1 } : { b?: number; } >b : number ->1 : number +>1 : 1 var p10 = ([{ value, done }]) => { }; >p10 : ([{value, done}]: [{ value: any; done: any; }]) => void diff --git a/tests/baselines/reference/emitArrowFunctionThisCapturing.types b/tests/baselines/reference/emitArrowFunctionThisCapturing.types index 2cfe06579af..0ef27791d17 100644 --- a/tests/baselines/reference/emitArrowFunctionThisCapturing.types +++ b/tests/baselines/reference/emitArrowFunctionThisCapturing.types @@ -4,11 +4,11 @@ var f1 = () => { >() => { this.age = 10} : () => void this.age = 10 ->this.age = 10 : number +>this.age = 10 : 10 >this.age : any >this : any >age : any ->10 : number +>10 : 10 }; @@ -32,17 +32,17 @@ function foo(func: () => boolean) { } foo(() => { >foo(() => { this.age = 100; return true;}) : void >foo : (func: () => boolean) => void ->() => { this.age = 100; return true;} : () => boolean +>() => { this.age = 100; return true;} : () => true this.age = 100; ->this.age = 100 : number +>this.age = 100 : 100 >this.age : any >this : any >age : any ->100 : number +>100 : 100 return true; ->true : boolean +>true : true }); diff --git a/tests/baselines/reference/emitArrowFunctionThisCapturingES6.types b/tests/baselines/reference/emitArrowFunctionThisCapturingES6.types index cc5405cebb4..3c20bfd195c 100644 --- a/tests/baselines/reference/emitArrowFunctionThisCapturingES6.types +++ b/tests/baselines/reference/emitArrowFunctionThisCapturingES6.types @@ -4,11 +4,11 @@ var f1 = () => { >() => { this.age = 10} : () => void this.age = 10 ->this.age = 10 : number +>this.age = 10 : 10 >this.age : any >this : any >age : any ->10 : number +>10 : 10 }; @@ -32,17 +32,17 @@ function foo(func: () => boolean){ } foo(() => { >foo(() => { this.age = 100; return true;}) : void >foo : (func: () => boolean) => void ->() => { this.age = 100; return true;} : () => boolean +>() => { this.age = 100; return true;} : () => true this.age = 100; ->this.age = 100 : number +>this.age = 100 : 100 >this.age : any >this : any >age : any ->100 : number +>100 : 100 return true; ->true : boolean +>true : true }); diff --git a/tests/baselines/reference/emitArrowFunctionWhenUsingArguments01_ES6.types b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments01_ES6.types index 669bf411e63..6da6a224a6c 100644 --- a/tests/baselines/reference/emitArrowFunctionWhenUsingArguments01_ES6.types +++ b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments01_ES6.types @@ -7,7 +7,7 @@ var a = () => { >arg : any >arguments[0] : any >arguments : IArguments ->0 : number +>0 : 0 } var b = function () { @@ -22,7 +22,7 @@ var b = function () { >arg : any >arguments[0] : any >arguments : IArguments ->0 : number +>0 : 0 } } @@ -36,7 +36,7 @@ function baz() { >arg : any >arguments[0] : any >arguments : IArguments ->0 : number +>0 : 0 } } @@ -53,7 +53,7 @@ foo(() => { >arg : any >arguments[0] : any >arguments : IArguments ->0 : number +>0 : 0 }); @@ -64,7 +64,7 @@ function bar() { >arg : any >arguments[0] : any >arguments : IArguments ->0 : number +>0 : 0 } @@ -78,6 +78,6 @@ function bar() { >arg : any >arguments[0] : any >arguments : IArguments ->0 : number +>0 : 0 } } diff --git a/tests/baselines/reference/emitArrowFunctionWhenUsingArguments10_ES6.types b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments10_ES6.types index dd567d3bdca..cca81995253 100644 --- a/tests/baselines/reference/emitArrowFunctionWhenUsingArguments10_ES6.types +++ b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments10_ES6.types @@ -5,7 +5,7 @@ function f() { var _arguments = 10; >_arguments : number ->10 : number +>10 : 10 var a = () => () => arguments; >a : () => () => IArguments diff --git a/tests/baselines/reference/emitArrowFunctionWhenUsingArguments11_ES6.types b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments11_ES6.types index b977a77010c..5dddd8fba7a 100644 --- a/tests/baselines/reference/emitArrowFunctionWhenUsingArguments11_ES6.types +++ b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments11_ES6.types @@ -6,7 +6,7 @@ function f(arguments) { var _arguments = 10; >_arguments : number ->10 : number +>10 : 10 var a = () => () => arguments; >a : () => () => IArguments diff --git a/tests/baselines/reference/emitArrowFunctionWhenUsingArguments13.types b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments13.types index 6e5a7555315..82a027d2dc8 100644 --- a/tests/baselines/reference/emitArrowFunctionWhenUsingArguments13.types +++ b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments13.types @@ -5,7 +5,7 @@ function f() { var _arguments = 10; >_arguments : number ->10 : number +>10 : 10 var a = (arguments) => () => _arguments; >a : (arguments: any) => () => number diff --git a/tests/baselines/reference/emitArrowFunctionWhenUsingArguments13_ES6.types b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments13_ES6.types index 294f5c692e4..59b39a444e1 100644 --- a/tests/baselines/reference/emitArrowFunctionWhenUsingArguments13_ES6.types +++ b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments13_ES6.types @@ -5,7 +5,7 @@ function f() { var _arguments = 10; >_arguments : number ->10 : number +>10 : 10 var a = (arguments) => () => _arguments; >a : (arguments: any) => () => number diff --git a/tests/baselines/reference/emitArrowFunctionWhenUsingArguments14_ES6.types b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments14_ES6.types index 29989ea0f9c..df47ed17890 100644 --- a/tests/baselines/reference/emitArrowFunctionWhenUsingArguments14_ES6.types +++ b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments14_ES6.types @@ -11,7 +11,7 @@ function f() { let arguments = 100; >arguments : number ->100 : number +>100 : 100 return () => arguments; >() => arguments : () => IArguments diff --git a/tests/baselines/reference/emitArrowFunctionWhenUsingArguments15_ES6.types b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments15_ES6.types index 0bb34b22eef..558aada2826 100644 --- a/tests/baselines/reference/emitArrowFunctionWhenUsingArguments15_ES6.types +++ b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments15_ES6.types @@ -5,7 +5,7 @@ function f() { var arguments = "hello"; >arguments : string ->"hello" : string +>"hello" : "hello" if (Math.random()) { >Math.random() : number @@ -14,8 +14,8 @@ function f() { >random : () => number const arguments = 100; ->arguments : number ->100 : number +>arguments : 100 +>100 : 100 return () => arguments; >() => arguments : () => IArguments diff --git a/tests/baselines/reference/emitArrowFunctionWhenUsingArguments16_ES6.types b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments16_ES6.types index 41c6b87fb42..bedbe3dc8b6 100644 --- a/tests/baselines/reference/emitArrowFunctionWhenUsingArguments16_ES6.types +++ b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments16_ES6.types @@ -5,7 +5,7 @@ function f() { var arguments = "hello"; >arguments : string ->"hello" : string +>"hello" : "hello" if (Math.random()) { >Math.random() : number @@ -17,9 +17,9 @@ function f() { >() => arguments[0] : () => any >arguments[0] : any >arguments : IArguments ->0 : number +>0 : 0 } var arguments = "world"; >arguments : string ->"world" : string +>"world" : "world" } diff --git a/tests/baselines/reference/emitArrowFunctionWhenUsingArguments17_ES6.types b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments17_ES6.types index f62a2dce84c..223663bdb1b 100644 --- a/tests/baselines/reference/emitArrowFunctionWhenUsingArguments17_ES6.types +++ b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments17_ES6.types @@ -7,7 +7,7 @@ function f() { >arguments : string >{ arguments: "hello" } : { arguments: string; } >arguments : string ->"hello" : string +>"hello" : "hello" if (Math.random()) { >Math.random() : number @@ -19,9 +19,9 @@ function f() { >() => arguments[0] : () => any >arguments[0] : any >arguments : IArguments ->0 : number +>0 : 0 } var arguments = "world"; >arguments : string ->"world" : string +>"world" : "world" } diff --git a/tests/baselines/reference/emitArrowFunctionWhenUsingArguments19_ES6.types b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments19_ES6.types index a672389720a..48d6f2e2935 100644 --- a/tests/baselines/reference/emitArrowFunctionWhenUsingArguments19_ES6.types +++ b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments19_ES6.types @@ -8,7 +8,7 @@ function f() { var _arguments = 10; // No capture in 'g', so no conflict. >_arguments : number ->10 : number +>10 : 10 function h() { >h : () => void @@ -30,6 +30,6 @@ function f() { >x : any return 100; ->100 : number +>100 : 100 } } diff --git a/tests/baselines/reference/emitClassDeclarationOverloadInES6.types b/tests/baselines/reference/emitClassDeclarationOverloadInES6.types index 94cc2c88ddc..1b5397eaf63 100644 --- a/tests/baselines/reference/emitClassDeclarationOverloadInES6.types +++ b/tests/baselines/reference/emitClassDeclarationOverloadInES6.types @@ -19,5 +19,5 @@ class D { constructor(x: number, z="hello") {} >x : number >z : string ->"hello" : string +>"hello" : "hello" } diff --git a/tests/baselines/reference/emitClassDeclarationWithConstructorInES6.types b/tests/baselines/reference/emitClassDeclarationWithConstructorInES6.types index 3bdf5af2ba5..f244efc274d 100644 --- a/tests/baselines/reference/emitClassDeclarationWithConstructorInES6.types +++ b/tests/baselines/reference/emitClassDeclarationWithConstructorInES6.types @@ -24,7 +24,7 @@ class B { x: string = "hello"; >x : string ->"hello" : string +>"hello" : "hello" _bar: string; >_bar : string @@ -32,15 +32,15 @@ class B { constructor(x: number, z = "hello", ...args) { >x : number >z : string ->"hello" : string +>"hello" : "hello" >args : any[] this.y = 10; ->this.y = 10 : number +>this.y = 10 : 10 >this.y : number >this : this >y : number ->10 : number +>10 : 10 } baz(...args): string; >baz : (...args: any[]) => string diff --git a/tests/baselines/reference/emitClassDeclarationWithExtensionInES6.types b/tests/baselines/reference/emitClassDeclarationWithExtensionInES6.types index 7267af2fde0..7c95ac9b40e 100644 --- a/tests/baselines/reference/emitClassDeclarationWithExtensionInES6.types +++ b/tests/baselines/reference/emitClassDeclarationWithExtensionInES6.types @@ -6,7 +6,7 @@ class B { >baz : (a: string, y?: number) => void >a : string >y : number ->10 : number +>10 : 10 } class C extends B { >C : C @@ -57,8 +57,8 @@ class D extends C { >super.baz : (a: string, y: number) => void >super : C >baz : (a: string, y: number) => void ->"hello" : string ->10 : number +>"hello" : "hello" +>10 : 10 } } diff --git a/tests/baselines/reference/emitClassDeclarationWithGetterSetterInES6.types b/tests/baselines/reference/emitClassDeclarationWithGetterSetterInES6.types index e4f7d6c00b4..f251429937d 100644 --- a/tests/baselines/reference/emitClassDeclarationWithGetterSetterInES6.types +++ b/tests/baselines/reference/emitClassDeclarationWithGetterSetterInES6.types @@ -17,33 +17,33 @@ class C { >name2 : string return "BYE"; ->"BYE" : string +>"BYE" : "BYE" } static get ["computedname"]() { ->"computedname" : string +>"computedname" : "computedname" return ""; ->"" : string +>"" : "" } get ["computedname1"]() { ->"computedname1" : string +>"computedname1" : "computedname1" return ""; ->"" : string +>"" : "" } get ["computedname2"]() { ->"computedname2" : string +>"computedname2" : "computedname2" return ""; ->"" : string +>"" : "" } set ["computedname3"](x: any) { ->"computedname3" : string +>"computedname3" : "computedname3" >x : any } set ["computedname4"](y: string) { ->"computedname4" : string +>"computedname4" : "computedname4" >y : string } @@ -56,6 +56,6 @@ class C { >b : number static set ["computedname"](b: string) { } ->"computedname" : string +>"computedname" : "computedname" >b : string } diff --git a/tests/baselines/reference/emitClassDeclarationWithLiteralPropertyNameInES6.types b/tests/baselines/reference/emitClassDeclarationWithLiteralPropertyNameInES6.types index d4bc18539dd..203d5071a15 100644 --- a/tests/baselines/reference/emitClassDeclarationWithLiteralPropertyNameInES6.types +++ b/tests/baselines/reference/emitClassDeclarationWithLiteralPropertyNameInES6.types @@ -3,16 +3,16 @@ class B { >B : B "hello" = 10; ->10 : number +>10 : 10 0b110 = "world"; ->"world" : string +>"world" : "world" 0o23534 = "WORLD"; ->"WORLD" : string +>"WORLD" : "WORLD" 20 = "twenty"; ->"twenty" : string +>"twenty" : "twenty" "foo"() { } 0b1110() {} @@ -21,14 +21,14 @@ class B { >interface : () => void static "hi" = 10000; ->10000 : number +>10000 : 10000 static 22 = "twenty-two"; ->"twenty-two" : string +>"twenty-two" : "twenty-two" static 0b101 = "binary"; ->"binary" : string +>"binary" : "binary" static 0o3235 = "octal"; ->"octal" : string +>"octal" : "octal" } diff --git a/tests/baselines/reference/emitClassDeclarationWithMethodInES6.types b/tests/baselines/reference/emitClassDeclarationWithMethodInES6.types index 02a90729486..10f0d4d2eef 100644 --- a/tests/baselines/reference/emitClassDeclarationWithMethodInES6.types +++ b/tests/baselines/reference/emitClassDeclarationWithMethodInES6.types @@ -9,16 +9,16 @@ class D { >foo : () => void ["computedName1"]() { } ->"computedName1" : string +>"computedName1" : "computedName1" ["computedName2"](a: string) { } ->"computedName2" : string +>"computedName2" : "computedName2" >a : string ["computedName3"](a: string): number { return 1; } ->"computedName3" : string +>"computedName3" : "computedName3" >a : string ->1 : number +>1 : 1 bar(): string { >bar : () => string @@ -34,19 +34,19 @@ class D { >x : string return "HELLO"; ->"HELLO" : string +>"HELLO" : "HELLO" } static ["computedname4"]() { } ->"computedname4" : string +>"computedname4" : "computedname4" static ["computedname5"](a: string) { } ->"computedname5" : string +>"computedname5" : "computedname5" >a : string static ["computedname6"](a: string): boolean { return true; } ->"computedname6" : string +>"computedname6" : "computedname6" >a : string ->true : boolean +>true : true static staticMethod() { >staticMethod : () => number @@ -54,8 +54,8 @@ class D { var x = 1 + 2; >x : number >1 + 2 : number ->1 : number ->2 : number +>1 : 1 +>2 : 2 return x >x : number @@ -67,5 +67,5 @@ class D { static bar(a: string): number { return 1; } >bar : (a: string) => number >a : string ->1 : number +>1 : 1 } diff --git a/tests/baselines/reference/emitClassDeclarationWithPropertyAssignmentInES6.types b/tests/baselines/reference/emitClassDeclarationWithPropertyAssignmentInES6.types index ccf4ca3ca9d..3455e3e5c5d 100644 --- a/tests/baselines/reference/emitClassDeclarationWithPropertyAssignmentInES6.types +++ b/tests/baselines/reference/emitClassDeclarationWithPropertyAssignmentInES6.types @@ -4,7 +4,7 @@ class C { x: string = "Hello world"; >x : string ->"Hello world" : string +>"Hello world" : "Hello world" } class D { @@ -12,18 +12,18 @@ class D { x: string = "Hello world"; >x : string ->"Hello world" : string +>"Hello world" : "Hello world" y: number; >y : number constructor() { this.y = 10; ->this.y = 10 : number +>this.y = 10 : 10 >this.y : number >this : this >y : number ->10 : number +>10 : 10 } } @@ -33,7 +33,7 @@ class E extends D{ z: boolean = true; >z : boolean ->true : boolean +>true : true } class F extends D{ @@ -42,7 +42,7 @@ class F extends D{ z: boolean = true; >z : boolean ->true : boolean +>true : true j: string; >j : string @@ -53,10 +53,10 @@ class F extends D{ >super : typeof D this.j = "HI"; ->this.j = "HI" : string +>this.j = "HI" : "HI" >this.j : string >this : this >j : string ->"HI" : string +>"HI" : "HI" } } diff --git a/tests/baselines/reference/emitClassDeclarationWithStaticPropertyAssignmentInES6.types b/tests/baselines/reference/emitClassDeclarationWithStaticPropertyAssignmentInES6.types index 58d328e3e5d..cd287119909 100644 --- a/tests/baselines/reference/emitClassDeclarationWithStaticPropertyAssignmentInES6.types +++ b/tests/baselines/reference/emitClassDeclarationWithStaticPropertyAssignmentInES6.types @@ -4,7 +4,7 @@ class C { static z: string = "Foo"; >z : string ->"Foo" : string +>"Foo" : "Foo" } class D { @@ -12,10 +12,10 @@ class D { x = 20000; >x : number ->20000 : number +>20000 : 20000 static b = true; >b : boolean ->true : boolean +>true : true } diff --git a/tests/baselines/reference/emitClassDeclarationWithThisKeywordInES6.types b/tests/baselines/reference/emitClassDeclarationWithThisKeywordInES6.types index 7c0159fbd63..bdf57efcb0f 100644 --- a/tests/baselines/reference/emitClassDeclarationWithThisKeywordInES6.types +++ b/tests/baselines/reference/emitClassDeclarationWithThisKeywordInES6.types @@ -4,15 +4,15 @@ class B { x = 10; >x : number ->10 : number +>10 : 10 constructor() { this.x = 10; ->this.x = 10 : number +>this.x = 10 : 10 >this.x : number >this : this >x : number ->10 : number +>10 : 10 } static log(a: number) { } >log : (a: number) => void diff --git a/tests/baselines/reference/emitCompoundExponentiationAssignmentWithIndexingOnLHS1.types b/tests/baselines/reference/emitCompoundExponentiationAssignmentWithIndexingOnLHS1.types index 393499a931f..ddb10cc9447 100644 --- a/tests/baselines/reference/emitCompoundExponentiationAssignmentWithIndexingOnLHS1.types +++ b/tests/baselines/reference/emitCompoundExponentiationAssignmentWithIndexingOnLHS1.types @@ -3,13 +3,13 @@ var array0 = [1, 2, 3] >array0 : number[] >[1, 2, 3] : number[] ->1 : number ->2 : number ->3 : number +>1 : 1 +>2 : 2 +>3 : 3 var i0 = 0; >i0 : number ->0 : number +>0 : 0 array0[++i0] **= 2; >array0[++i0] **= 2 : number @@ -17,18 +17,18 @@ array0[++i0] **= 2; >array0 : number[] >++i0 : number >i0 : number ->2 : number +>2 : 2 var array1 = [1, 2, 3] >array1 : number[] >[1, 2, 3] : number[] ->1 : number ->2 : number ->3 : number +>1 : 1 +>2 : 2 +>3 : 3 var i1 = 0; >i1 : number ->0 : number +>0 : 0 array1[++i1] **= array1[++i1] **= 2; >array1[++i1] **= array1[++i1] **= 2 : number @@ -41,18 +41,18 @@ array1[++i1] **= array1[++i1] **= 2; >array1 : number[] >++i1 : number >i1 : number ->2 : number +>2 : 2 var array2 = [1, 2, 3] >array2 : number[] >[1, 2, 3] : number[] ->1 : number ->2 : number ->3 : number +>1 : 1 +>2 : 2 +>3 : 3 var i2 = 0; >i2 : number ->0 : number +>0 : 0 array2[++i2] **= array2[++i2] ** 2; >array2[++i2] **= array2[++i2] ** 2 : number @@ -65,20 +65,20 @@ array2[++i2] **= array2[++i2] ** 2; >array2 : number[] >++i2 : number >i2 : number ->2 : number +>2 : 2 var array3 = [2, 2, 3]; >array3 : number[] >[2, 2, 3] : number[] ->2 : number ->2 : number ->3 : number +>2 : 2 +>2 : 2 +>3 : 3 var j0 = 0, j1 = 1; >j0 : number ->0 : number +>0 : 0 >j1 : number ->1 : number +>1 : 1 array3[j0++] **= array3[j1++] **= array3[j0++] **= 1; >array3[j0++] **= array3[j1++] **= array3[j0++] **= 1 : number @@ -96,5 +96,5 @@ array3[j0++] **= array3[j1++] **= array3[j0++] **= 1; >array3 : number[] >j0++ : number >j0 : number ->1 : number +>1 : 1 diff --git a/tests/baselines/reference/emitCompoundExponentiationAssignmentWithIndexingOnLHS2.types b/tests/baselines/reference/emitCompoundExponentiationAssignmentWithIndexingOnLHS2.types index c47f539baf2..cd057d31390 100644 --- a/tests/baselines/reference/emitCompoundExponentiationAssignmentWithIndexingOnLHS2.types +++ b/tests/baselines/reference/emitCompoundExponentiationAssignmentWithIndexingOnLHS2.types @@ -1,7 +1,7 @@ === tests/cases/conformance/es7/exponentiationOperator/emitCompoundExponentiationAssignmentWithIndexingOnLHS2.ts === var globalCounter = 0; >globalCounter : number ->0 : number +>0 : 0 function foo() { >foo : () => { 0: number; } @@ -9,22 +9,22 @@ function foo() { globalCounter += 1; >globalCounter += 1 : number >globalCounter : number ->1 : number +>1 : 1 return { 0: 2 }; >{ 0: 2 } : { 0: number; } ->2 : number +>2 : 2 } foo()[0] **= foo()[0]; >foo()[0] **= foo()[0] : number >foo()[0] : number >foo() : { 0: number; } >foo : () => { 0: number; } ->0 : number +>0 : 0 >foo()[0] : number >foo() : { 0: number; } >foo : () => { 0: number; } ->0 : number +>0 : 0 var result_foo1 = foo()[0] **= foo()[0]; >result_foo1 : number @@ -32,24 +32,24 @@ var result_foo1 = foo()[0] **= foo()[0]; >foo()[0] : number >foo() : { 0: number; } >foo : () => { 0: number; } ->0 : number +>0 : 0 >foo()[0] : number >foo() : { 0: number; } >foo : () => { 0: number; } ->0 : number +>0 : 0 foo()[0] **= foo()[0] **= 2; >foo()[0] **= foo()[0] **= 2 : number >foo()[0] : number >foo() : { 0: number; } >foo : () => { 0: number; } ->0 : number +>0 : 0 >foo()[0] **= 2 : number >foo()[0] : number >foo() : { 0: number; } >foo : () => { 0: number; } ->0 : number ->2 : number +>0 : 0 +>2 : 2 var result_foo2 = foo()[0] **= foo()[0] **= 2; >result_foo2 : number @@ -57,26 +57,26 @@ var result_foo2 = foo()[0] **= foo()[0] **= 2; >foo()[0] : number >foo() : { 0: number; } >foo : () => { 0: number; } ->0 : number +>0 : 0 >foo()[0] **= 2 : number >foo()[0] : number >foo() : { 0: number; } >foo : () => { 0: number; } ->0 : number ->2 : number +>0 : 0 +>2 : 2 foo()[0] **= foo()[0] ** 2; >foo()[0] **= foo()[0] ** 2 : number >foo()[0] : number >foo() : { 0: number; } >foo : () => { 0: number; } ->0 : number +>0 : 0 >foo()[0] ** 2 : number >foo()[0] : number >foo() : { 0: number; } >foo : () => { 0: number; } ->0 : number ->2 : number +>0 : 0 +>2 : 2 var result_foo3 = foo()[0] **= foo()[0] ** 2; >result_foo3 : number @@ -84,11 +84,11 @@ var result_foo3 = foo()[0] **= foo()[0] ** 2; >foo()[0] : number >foo() : { 0: number; } >foo : () => { 0: number; } ->0 : number +>0 : 0 >foo()[0] ** 2 : number >foo()[0] : number >foo() : { 0: number; } >foo : () => { 0: number; } ->0 : number ->2 : number +>0 : 0 +>2 : 2 diff --git a/tests/baselines/reference/emitCompoundExponentiationAssignmentWithIndexingOnLHS3.types b/tests/baselines/reference/emitCompoundExponentiationAssignmentWithIndexingOnLHS3.types index 1877f391207..94a5f2173aa 100644 --- a/tests/baselines/reference/emitCompoundExponentiationAssignmentWithIndexingOnLHS3.types +++ b/tests/baselines/reference/emitCompoundExponentiationAssignmentWithIndexingOnLHS3.types @@ -6,7 +6,7 @@ var object = { _0: 2, >_0 : number ->2 : number +>2 : 2 get 0() { return this._0; @@ -31,30 +31,30 @@ object[0] **= object[0]; >object[0] **= object[0] : number >object[0] : number >object : { 0: number; _0: number; } ->0 : number +>0 : 0 >object[0] : number >object : { 0: number; _0: number; } ->0 : number +>0 : 0 object[0] **= object[0] **= 2; >object[0] **= object[0] **= 2 : number >object[0] : number >object : { 0: number; _0: number; } ->0 : number +>0 : 0 >object[0] **= 2 : number >object[0] : number >object : { 0: number; _0: number; } ->0 : number ->2 : number +>0 : 0 +>2 : 2 object[0] **= object[0] ** 2; >object[0] **= object[0] ** 2 : number >object[0] : number >object : { 0: number; _0: number; } ->0 : number +>0 : 0 >object[0] ** 2 : number >object[0] : number >object : { 0: number; _0: number; } ->0 : number ->2 : number +>0 : 0 +>2 : 2 diff --git a/tests/baselines/reference/emitCompoundExponentiationAssignmentWithIndexingOnLHS4.types b/tests/baselines/reference/emitCompoundExponentiationAssignmentWithIndexingOnLHS4.types index abfc69d7ca6..fec095dc696 100644 --- a/tests/baselines/reference/emitCompoundExponentiationAssignmentWithIndexingOnLHS4.types +++ b/tests/baselines/reference/emitCompoundExponentiationAssignmentWithIndexingOnLHS4.types @@ -2,7 +2,7 @@ var globalCounter = 0; >globalCounter : number ->0 : number +>0 : 0 function incrementIdx(max: number) { >incrementIdx : (max: number) => number @@ -11,7 +11,7 @@ function incrementIdx(max: number) { globalCounter += 1; >globalCounter += 1 : number >globalCounter : number ->1 : number +>1 : 1 let idx = Math.floor(Math.random() * max); >idx : number @@ -33,11 +33,11 @@ function incrementIdx(max: number) { var array1 = [1, 2, 3, 4, 5]; >array1 : number[] >[1, 2, 3, 4, 5] : number[] ->1 : number ->2 : number ->3 : number ->4 : number ->5 : number +>1 : 1 +>2 : 2 +>3 : 3 +>4 : 4 +>5 : 5 array1[incrementIdx(array1.length)] **= 3; >array1[incrementIdx(array1.length)] **= 3 : number @@ -48,7 +48,7 @@ array1[incrementIdx(array1.length)] **= 3; >array1.length : number >array1 : number[] >length : number ->3 : number +>3 : 3 array1[incrementIdx(array1.length)] **= array1[incrementIdx(array1.length)] **= 2; >array1[incrementIdx(array1.length)] **= array1[incrementIdx(array1.length)] **= 2 : number @@ -67,7 +67,7 @@ array1[incrementIdx(array1.length)] **= array1[incrementIdx(array1.length)] **= >array1.length : number >array1 : number[] >length : number ->2 : number +>2 : 2 array1[incrementIdx(array1.length)] **= array1[incrementIdx(array1.length)] ** 2; >array1[incrementIdx(array1.length)] **= array1[incrementIdx(array1.length)] ** 2 : number @@ -86,5 +86,5 @@ array1[incrementIdx(array1.length)] **= array1[incrementIdx(array1.length)] ** 2 >array1.length : number >array1 : number[] >length : number ->2 : number +>2 : 2 diff --git a/tests/baselines/reference/emitCompoundExponentiationAssignmentWithPropertyAccessingOnLHS1.types b/tests/baselines/reference/emitCompoundExponentiationAssignmentWithPropertyAccessingOnLHS1.types index b57878e9443..1a8a29bae9b 100644 --- a/tests/baselines/reference/emitCompoundExponentiationAssignmentWithPropertyAccessingOnLHS1.types +++ b/tests/baselines/reference/emitCompoundExponentiationAssignmentWithPropertyAccessingOnLHS1.types @@ -2,7 +2,7 @@ var globalCounter = 0; >globalCounter : number ->0 : number +>0 : 0 function foo() { >foo : () => { prop: number; } @@ -10,12 +10,12 @@ function foo() { globalCounter += 1; >globalCounter += 1 : number >globalCounter : number ->1 : number +>1 : 1 return { prop: 2 }; >{ prop: 2 } : { prop: number; } >prop : number ->2 : number +>2 : 2 } foo().prop **= 2; >foo().prop **= 2 : number @@ -23,7 +23,7 @@ foo().prop **= 2; >foo() : { prop: number; } >foo : () => { prop: number; } >prop : number ->2 : number +>2 : 2 var result0 = foo().prop **= 2; >result0 : number @@ -32,7 +32,7 @@ var result0 = foo().prop **= 2; >foo() : { prop: number; } >foo : () => { prop: number; } >prop : number ->2 : number +>2 : 2 foo().prop **= foo().prop **= 2; >foo().prop **= foo().prop **= 2 : number @@ -45,7 +45,7 @@ foo().prop **= foo().prop **= 2; >foo() : { prop: number; } >foo : () => { prop: number; } >prop : number ->2 : number +>2 : 2 var result1 = foo().prop **= foo().prop **= 2; >result1 : number @@ -59,7 +59,7 @@ var result1 = foo().prop **= foo().prop **= 2; >foo() : { prop: number; } >foo : () => { prop: number; } >prop : number ->2 : number +>2 : 2 foo().prop **= foo().prop ** 2; >foo().prop **= foo().prop ** 2 : number @@ -72,7 +72,7 @@ foo().prop **= foo().prop ** 2; >foo() : { prop: number; } >foo : () => { prop: number; } >prop : number ->2 : number +>2 : 2 var result2 = foo().prop **= foo().prop ** 2; >result2 : number @@ -86,5 +86,5 @@ var result2 = foo().prop **= foo().prop ** 2; >foo() : { prop: number; } >foo : () => { prop: number; } >prop : number ->2 : number +>2 : 2 diff --git a/tests/baselines/reference/emitCompoundExponentiationOperator1.types b/tests/baselines/reference/emitCompoundExponentiationOperator1.types index a1c986dbb78..6a4a5b5bab9 100644 --- a/tests/baselines/reference/emitCompoundExponentiationOperator1.types +++ b/tests/baselines/reference/emitCompoundExponentiationOperator1.types @@ -6,7 +6,7 @@ var comp: number; comp **= 1; >comp **= 1 : number >comp : number ->1 : number +>1 : 1 comp **= comp ** comp; >comp **= comp ** comp : number @@ -22,7 +22,7 @@ comp **= comp ** comp ** 2; >comp : number >comp ** 2 : number >comp : number ->2 : number +>2 : 2 comp **= comp ** comp + 2; >comp **= comp ** comp + 2 : number @@ -31,7 +31,7 @@ comp **= comp ** comp + 2; >comp ** comp : number >comp : number >comp : number ->2 : number +>2 : 2 comp **= comp ** comp - 2; >comp **= comp ** comp - 2 : number @@ -40,7 +40,7 @@ comp **= comp ** comp - 2; >comp ** comp : number >comp : number >comp : number ->2 : number +>2 : 2 comp **= comp ** comp * 2; >comp **= comp ** comp * 2 : number @@ -49,7 +49,7 @@ comp **= comp ** comp * 2; >comp ** comp : number >comp : number >comp : number ->2 : number +>2 : 2 comp **= comp ** comp / 2; >comp **= comp ** comp / 2 : number @@ -58,7 +58,7 @@ comp **= comp ** comp / 2; >comp ** comp : number >comp : number >comp : number ->2 : number +>2 : 2 comp **= comp ** comp % 2; >comp **= comp ** comp % 2 : number @@ -67,7 +67,7 @@ comp **= comp ** comp % 2; >comp ** comp : number >comp : number >comp : number ->2 : number +>2 : 2 comp **= (comp - 2) ** 5; >comp **= (comp - 2) ** 5 : number @@ -76,8 +76,8 @@ comp **= (comp - 2) ** 5; >(comp - 2) : number >comp - 2 : number >comp : number ->2 : number ->5 : number +>2 : 2 +>5 : 5 comp **= (comp + 2) ** 5; >comp **= (comp + 2) ** 5 : number @@ -86,8 +86,8 @@ comp **= (comp + 2) ** 5; >(comp + 2) : number >comp + 2 : number >comp : number ->2 : number ->5 : number +>2 : 2 +>5 : 5 comp **= (comp * 2) ** 5; >comp **= (comp * 2) ** 5 : number @@ -96,8 +96,8 @@ comp **= (comp * 2) ** 5; >(comp * 2) : number >comp * 2 : number >comp : number ->2 : number ->5 : number +>2 : 2 +>5 : 5 comp **= (comp / 2) ** 5; >comp **= (comp / 2) ** 5 : number @@ -106,8 +106,8 @@ comp **= (comp / 2) ** 5; >(comp / 2) : number >comp / 2 : number >comp : number ->2 : number ->5 : number +>2 : 2 +>5 : 5 comp **= (comp % 2) ** 5; >comp **= (comp % 2) ** 5 : number @@ -116,8 +116,8 @@ comp **= (comp % 2) ** 5; >(comp % 2) : number >comp % 2 : number >comp : number ->2 : number ->5 : number +>2 : 2 +>5 : 5 comp **= comp ** (5 + 2); >comp **= comp ** (5 + 2) : number @@ -126,8 +126,8 @@ comp **= comp ** (5 + 2); >comp : number >(5 + 2) : number >5 + 2 : number ->5 : number ->2 : number +>5 : 5 +>2 : 2 comp **= comp ** (5 - 2); >comp **= comp ** (5 - 2) : number @@ -136,8 +136,8 @@ comp **= comp ** (5 - 2); >comp : number >(5 - 2) : number >5 - 2 : number ->5 : number ->2 : number +>5 : 5 +>2 : 2 comp **= comp ** (5 * 2); >comp **= comp ** (5 * 2) : number @@ -146,8 +146,8 @@ comp **= comp ** (5 * 2); >comp : number >(5 * 2) : number >5 * 2 : number ->5 : number ->2 : number +>5 : 5 +>2 : 2 comp **= comp ** (5 / 2); >comp **= comp ** (5 / 2) : number @@ -156,8 +156,8 @@ comp **= comp ** (5 / 2); >comp : number >(5 / 2) : number >5 / 2 : number ->5 : number ->2 : number +>5 : 5 +>2 : 2 comp **= comp ** (5 % 2); >comp **= comp ** (5 % 2) : number @@ -166,6 +166,6 @@ comp **= comp ** (5 % 2); >comp : number >(5 % 2) : number >5 % 2 : number ->5 : number ->2 : number +>5 : 5 +>2 : 2 diff --git a/tests/baselines/reference/emitCompoundExponentiationOperator2.types b/tests/baselines/reference/emitCompoundExponentiationOperator2.types index 03ca9b06626..f715a9593f2 100644 --- a/tests/baselines/reference/emitCompoundExponentiationOperator2.types +++ b/tests/baselines/reference/emitCompoundExponentiationOperator2.types @@ -6,14 +6,14 @@ var comp: number; comp **= 1; >comp **= 1 : number >comp : number ->1 : number +>1 : 1 comp **= comp **= 1; >comp **= comp **= 1 : number >comp : number >comp **= 1 : number >comp : number ->1 : number +>1 : 1 comp **= comp **= 1 + 2; >comp **= comp **= 1 + 2 : number @@ -21,8 +21,8 @@ comp **= comp **= 1 + 2; >comp **= 1 + 2 : number >comp : number >1 + 2 : number ->1 : number ->2 : number +>1 : 1 +>2 : 2 comp **= comp **= 1 - 2; >comp **= comp **= 1 - 2 : number @@ -30,8 +30,8 @@ comp **= comp **= 1 - 2; >comp **= 1 - 2 : number >comp : number >1 - 2 : number ->1 : number ->2 : number +>1 : 1 +>2 : 2 comp **= comp **= 1 * 2; >comp **= comp **= 1 * 2 : number @@ -39,8 +39,8 @@ comp **= comp **= 1 * 2; >comp **= 1 * 2 : number >comp : number >1 * 2 : number ->1 : number ->2 : number +>1 : 1 +>2 : 2 comp **= comp **= 1 / 2; >comp **= comp **= 1 / 2 : number @@ -48,8 +48,8 @@ comp **= comp **= 1 / 2; >comp **= 1 / 2 : number >comp : number >1 / 2 : number ->1 : number ->2 : number +>1 : 1 +>2 : 2 comp **= comp **= (1 + 2); >comp **= comp **= (1 + 2) : number @@ -58,8 +58,8 @@ comp **= comp **= (1 + 2); >comp : number >(1 + 2) : number >1 + 2 : number ->1 : number ->2 : number +>1 : 1 +>2 : 2 comp **= comp **= (1 - 2); >comp **= comp **= (1 - 2) : number @@ -68,8 +68,8 @@ comp **= comp **= (1 - 2); >comp : number >(1 - 2) : number >1 - 2 : number ->1 : number ->2 : number +>1 : 1 +>2 : 2 comp **= comp **= (1 * 2); >comp **= comp **= (1 * 2) : number @@ -78,8 +78,8 @@ comp **= comp **= (1 * 2); >comp : number >(1 * 2) : number >1 * 2 : number ->1 : number ->2 : number +>1 : 1 +>2 : 2 comp **= comp **= (1 / 2); >comp **= comp **= (1 / 2) : number @@ -88,8 +88,8 @@ comp **= comp **= (1 / 2); >comp : number >(1 / 2) : number >1 / 2 : number ->1 : number ->2 : number +>1 : 1 +>2 : 2 comp **= comp **= 1 + 2 ** 3; >comp **= comp **= 1 + 2 ** 3 : number @@ -97,10 +97,10 @@ comp **= comp **= 1 + 2 ** 3; >comp **= 1 + 2 ** 3 : number >comp : number >1 + 2 ** 3 : number ->1 : number +>1 : 1 >2 ** 3 : number ->2 : number ->3 : number +>2 : 2 +>3 : 3 comp **= comp **= 1 - 2 ** 4; >comp **= comp **= 1 - 2 ** 4 : number @@ -108,10 +108,10 @@ comp **= comp **= 1 - 2 ** 4; >comp **= 1 - 2 ** 4 : number >comp : number >1 - 2 ** 4 : number ->1 : number +>1 : 1 >2 ** 4 : number ->2 : number ->4 : number +>2 : 2 +>4 : 4 comp **= comp **= 1 * 2 ** 5; >comp **= comp **= 1 * 2 ** 5 : number @@ -119,10 +119,10 @@ comp **= comp **= 1 * 2 ** 5; >comp **= 1 * 2 ** 5 : number >comp : number >1 * 2 ** 5 : number ->1 : number +>1 : 1 >2 ** 5 : number ->2 : number ->5 : number +>2 : 2 +>5 : 5 comp **= comp **= 1 / 2 ** 6; >comp **= comp **= 1 / 2 ** 6 : number @@ -130,10 +130,10 @@ comp **= comp **= 1 / 2 ** 6; >comp **= 1 / 2 ** 6 : number >comp : number >1 / 2 ** 6 : number ->1 : number +>1 : 1 >2 ** 6 : number ->2 : number ->6 : number +>2 : 2 +>6 : 6 comp **= comp **= (1 + 2) ** 3; >comp **= comp **= (1 + 2) ** 3 : number @@ -143,9 +143,9 @@ comp **= comp **= (1 + 2) ** 3; >(1 + 2) ** 3 : number >(1 + 2) : number >1 + 2 : number ->1 : number ->2 : number ->3 : number +>1 : 1 +>2 : 2 +>3 : 3 comp **= comp **= (1 - 2) ** 4; >comp **= comp **= (1 - 2) ** 4 : number @@ -155,9 +155,9 @@ comp **= comp **= (1 - 2) ** 4; >(1 - 2) ** 4 : number >(1 - 2) : number >1 - 2 : number ->1 : number ->2 : number ->4 : number +>1 : 1 +>2 : 2 +>4 : 4 comp **= comp **= (1 * 2) ** 5; >comp **= comp **= (1 * 2) ** 5 : number @@ -167,9 +167,9 @@ comp **= comp **= (1 * 2) ** 5; >(1 * 2) ** 5 : number >(1 * 2) : number >1 * 2 : number ->1 : number ->2 : number ->5 : number +>1 : 1 +>2 : 2 +>5 : 5 comp **= comp **= (1 / 2) ** 6; >comp **= comp **= (1 / 2) ** 6 : number @@ -179,7 +179,7 @@ comp **= comp **= (1 / 2) ** 6; >(1 / 2) ** 6 : number >(1 / 2) : number >1 / 2 : number ->1 : number ->2 : number ->6 : number +>1 : 1 +>2 : 2 +>6 : 6 diff --git a/tests/baselines/reference/emitDefaultParametersFunction.types b/tests/baselines/reference/emitDefaultParametersFunction.types index 5c27d3ddf3d..d043a6c2b2f 100644 --- a/tests/baselines/reference/emitDefaultParametersFunction.types +++ b/tests/baselines/reference/emitDefaultParametersFunction.types @@ -3,23 +3,23 @@ function foo(x: string, y = 10) { } >foo : (x: string, y?: number) => void >x : string >y : number ->10 : number +>10 : 10 function baz(x: string, y = 5, ...rest) { } >baz : (x: string, y?: number, ...rest: any[]) => void >x : string >y : number ->5 : number +>5 : 5 >rest : any[] function bar(y = 10) { } >bar : (y?: number) => void >y : number ->10 : number +>10 : 10 function bar1(y = 10, ...rest) { } >bar1 : (y?: number, ...rest: any[]) => void >y : number ->10 : number +>10 : 10 >rest : any[] diff --git a/tests/baselines/reference/emitDefaultParametersFunctionES6.types b/tests/baselines/reference/emitDefaultParametersFunctionES6.types index e3124c75333..c5a3b8d2d3f 100644 --- a/tests/baselines/reference/emitDefaultParametersFunctionES6.types +++ b/tests/baselines/reference/emitDefaultParametersFunctionES6.types @@ -3,23 +3,23 @@ function foo(x: string, y = 10) { } >foo : (x: string, y?: number) => void >x : string >y : number ->10 : number +>10 : 10 function baz(x: string, y = 5, ...rest) { } >baz : (x: string, y?: number, ...rest: any[]) => void >x : string >y : number ->5 : number +>5 : 5 >rest : any[] function bar(y = 10) { } >bar : (y?: number) => void >y : number ->10 : number +>10 : 10 function bar1(y = 10, ...rest) { } >bar1 : (y?: number, ...rest: any[]) => void >y : number ->10 : number +>10 : 10 >rest : any[] diff --git a/tests/baselines/reference/emitDefaultParametersFunctionExpression.types b/tests/baselines/reference/emitDefaultParametersFunctionExpression.types index 61ba3200e36..7546bda0d41 100644 --- a/tests/baselines/reference/emitDefaultParametersFunctionExpression.types +++ b/tests/baselines/reference/emitDefaultParametersFunctionExpression.types @@ -3,35 +3,35 @@ var lambda1 = (y = "hello") => { } >lambda1 : (y?: string) => void >(y = "hello") => { } : (y?: string) => void >y : string ->"hello" : string +>"hello" : "hello" var lambda2 = (x: number, y = "hello") => { } >lambda2 : (x: number, y?: string) => void >(x: number, y = "hello") => { } : (x: number, y?: string) => void >x : number >y : string ->"hello" : string +>"hello" : "hello" var lambda3 = (x: number, y = "hello", ...rest) => { } >lambda3 : (x: number, y?: string, ...rest: any[]) => void >(x: number, y = "hello", ...rest) => { } : (x: number, y?: string, ...rest: any[]) => void >x : number >y : string ->"hello" : string +>"hello" : "hello" >rest : any[] var lambda4 = (y = "hello", ...rest) => { } >lambda4 : (y?: string, ...rest: any[]) => void >(y = "hello", ...rest) => { } : (y?: string, ...rest: any[]) => void >y : string ->"hello" : string +>"hello" : "hello" >rest : any[] var x = function (str = "hello", ...rest) { } >x : (str?: string, ...rest: any[]) => void >function (str = "hello", ...rest) { } : (str?: string, ...rest: any[]) => void >str : string ->"hello" : string +>"hello" : "hello" >rest : any[] var y = (function (num = 10, boo = false, ...rest) { })() @@ -40,9 +40,9 @@ var y = (function (num = 10, boo = false, ...rest) { })() >(function (num = 10, boo = false, ...rest) { }) : (num?: number, boo?: boolean, ...rest: any[]) => void >function (num = 10, boo = false, ...rest) { } : (num?: number, boo?: boolean, ...rest: any[]) => void >num : number ->10 : number +>10 : 10 >boo : boolean ->false : boolean +>false : false >rest : any[] var z = (function (num: number, boo = false, ...rest) { })(10) @@ -52,7 +52,7 @@ var z = (function (num: number, boo = false, ...rest) { })(10) >function (num: number, boo = false, ...rest) { } : (num: number, boo?: boolean, ...rest: any[]) => void >num : number >boo : boolean ->false : boolean +>false : false >rest : any[] ->10 : number +>10 : 10 diff --git a/tests/baselines/reference/emitDefaultParametersFunctionExpressionES6.types b/tests/baselines/reference/emitDefaultParametersFunctionExpressionES6.types index 76f2c863a26..99ab6a48137 100644 --- a/tests/baselines/reference/emitDefaultParametersFunctionExpressionES6.types +++ b/tests/baselines/reference/emitDefaultParametersFunctionExpressionES6.types @@ -3,35 +3,35 @@ var lambda1 = (y = "hello") => { } >lambda1 : (y?: string) => void >(y = "hello") => { } : (y?: string) => void >y : string ->"hello" : string +>"hello" : "hello" var lambda2 = (x: number, y = "hello") => { } >lambda2 : (x: number, y?: string) => void >(x: number, y = "hello") => { } : (x: number, y?: string) => void >x : number >y : string ->"hello" : string +>"hello" : "hello" var lambda3 = (x: number, y = "hello", ...rest) => { } >lambda3 : (x: number, y?: string, ...rest: any[]) => void >(x: number, y = "hello", ...rest) => { } : (x: number, y?: string, ...rest: any[]) => void >x : number >y : string ->"hello" : string +>"hello" : "hello" >rest : any[] var lambda4 = (y = "hello", ...rest) => { } >lambda4 : (y?: string, ...rest: any[]) => void >(y = "hello", ...rest) => { } : (y?: string, ...rest: any[]) => void >y : string ->"hello" : string +>"hello" : "hello" >rest : any[] var x = function (str = "hello", ...rest) { } >x : (str?: string, ...rest: any[]) => void >function (str = "hello", ...rest) { } : (str?: string, ...rest: any[]) => void >str : string ->"hello" : string +>"hello" : "hello" >rest : any[] var y = (function (num = 10, boo = false, ...rest) { })() @@ -40,9 +40,9 @@ var y = (function (num = 10, boo = false, ...rest) { })() >(function (num = 10, boo = false, ...rest) { }) : (num?: number, boo?: boolean, ...rest: any[]) => void >function (num = 10, boo = false, ...rest) { } : (num?: number, boo?: boolean, ...rest: any[]) => void >num : number ->10 : number +>10 : 10 >boo : boolean ->false : boolean +>false : false >rest : any[] var z = (function (num: number, boo = false, ...rest) { })(10) @@ -52,7 +52,7 @@ var z = (function (num: number, boo = false, ...rest) { })(10) >function (num: number, boo = false, ...rest) { } : (num: number, boo?: boolean, ...rest: any[]) => void >num : number >boo : boolean ->false : boolean +>false : false >rest : any[] ->10 : number +>10 : 10 diff --git a/tests/baselines/reference/emitDefaultParametersFunctionProperty.types b/tests/baselines/reference/emitDefaultParametersFunctionProperty.types index 8a703fd114f..d26281d8eb6 100644 --- a/tests/baselines/reference/emitDefaultParametersFunctionProperty.types +++ b/tests/baselines/reference/emitDefaultParametersFunctionProperty.types @@ -6,27 +6,27 @@ var obj2 = { func1(y = 10, ...rest) { }, >func1 : (y?: number, ...rest: any[]) => void >y : number ->10 : number +>10 : 10 >rest : any[] func2(x = "hello") { }, >func2 : (x?: string) => void >x : string ->"hello" : string +>"hello" : "hello" func3(x: string, z: number, y = "hello") { }, >func3 : (x: string, z: number, y?: string) => void >x : string >z : number >y : string ->"hello" : string +>"hello" : "hello" func4(x: string, z: number, y = "hello", ...rest) { }, >func4 : (x: string, z: number, y?: string, ...rest: any[]) => void >x : string >z : number >y : string ->"hello" : string +>"hello" : "hello" >rest : any[] } diff --git a/tests/baselines/reference/emitDefaultParametersFunctionPropertyES6.types b/tests/baselines/reference/emitDefaultParametersFunctionPropertyES6.types index 1edd505c0b5..5f693b65ac5 100644 --- a/tests/baselines/reference/emitDefaultParametersFunctionPropertyES6.types +++ b/tests/baselines/reference/emitDefaultParametersFunctionPropertyES6.types @@ -6,26 +6,26 @@ var obj2 = { func1(y = 10, ...rest) { }, >func1 : (y?: number, ...rest: any[]) => void >y : number ->10 : number +>10 : 10 >rest : any[] func2(x = "hello") { }, >func2 : (x?: string) => void >x : string ->"hello" : string +>"hello" : "hello" func3(x: string, z: number, y = "hello") { }, >func3 : (x: string, z: number, y?: string) => void >x : string >z : number >y : string ->"hello" : string +>"hello" : "hello" func4(x: string, z: number, y = "hello", ...rest) { }, >func4 : (x: string, z: number, y?: string, ...rest: any[]) => void >x : string >z : number >y : string ->"hello" : string +>"hello" : "hello" >rest : any[] } diff --git a/tests/baselines/reference/emitDefaultParametersMethod.types b/tests/baselines/reference/emitDefaultParametersMethod.types index ce7dd2542fa..03193baa528 100644 --- a/tests/baselines/reference/emitDefaultParametersMethod.types +++ b/tests/baselines/reference/emitDefaultParametersMethod.types @@ -7,30 +7,30 @@ class C { >z : string >x : number >y : string ->"hello" : string +>"hello" : "hello" public foo(x: string, t = false) { } >foo : (x: string, t?: boolean) => void >x : string >t : boolean ->false : boolean +>false : false public foo1(x: string, t = false, ...rest) { } >foo1 : (x: string, t?: boolean, ...rest: any[]) => void >x : string >t : boolean ->false : boolean +>false : false >rest : any[] public bar(t = false) { } >bar : (t?: boolean) => void >t : boolean ->false : boolean +>false : false public boo(t = false, ...rest) { } >boo : (t?: boolean, ...rest: any[]) => void >t : boolean ->false : boolean +>false : false >rest : any[] } @@ -39,7 +39,7 @@ class D { constructor(y = "hello") { } >y : string ->"hello" : string +>"hello" : "hello" } class E { @@ -47,7 +47,7 @@ class E { constructor(y = "hello", ...rest) { } >y : string ->"hello" : string +>"hello" : "hello" >rest : any[] } diff --git a/tests/baselines/reference/emitDefaultParametersMethodES6.types b/tests/baselines/reference/emitDefaultParametersMethodES6.types index 09096d153bf..be54cd9b27c 100644 --- a/tests/baselines/reference/emitDefaultParametersMethodES6.types +++ b/tests/baselines/reference/emitDefaultParametersMethodES6.types @@ -7,30 +7,30 @@ class C { >z : string >x : number >y : string ->"hello" : string +>"hello" : "hello" public foo(x: string, t = false) { } >foo : (x: string, t?: boolean) => void >x : string >t : boolean ->false : boolean +>false : false public foo1(x: string, t = false, ...rest) { } >foo1 : (x: string, t?: boolean, ...rest: any[]) => void >x : string >t : boolean ->false : boolean +>false : false >rest : any[] public bar(t = false) { } >bar : (t?: boolean) => void >t : boolean ->false : boolean +>false : false public boo(t = false, ...rest) { } >boo : (t?: boolean, ...rest: any[]) => void >t : boolean ->false : boolean +>false : false >rest : any[] } @@ -39,7 +39,7 @@ class D { constructor(y = "hello") { } >y : string ->"hello" : string +>"hello" : "hello" } class E { @@ -47,6 +47,6 @@ class E { constructor(y = "hello", ...rest) { } >y : string ->"hello" : string +>"hello" : "hello" >rest : any[] } diff --git a/tests/baselines/reference/emitExponentiationOperator1.types b/tests/baselines/reference/emitExponentiationOperator1.types index a2dc4f16901..9db01d34f22 100644 --- a/tests/baselines/reference/emitExponentiationOperator1.types +++ b/tests/baselines/reference/emitExponentiationOperator1.types @@ -2,45 +2,45 @@ 1 ** -2; >1 ** -2 : number ->1 : number ->-2 : number ->2 : number +>1 : 1 +>-2 : -2 +>2 : 2 1 ** 2; >1 ** 2 : number ->1 : number ->2 : number +>1 : 1 +>2 : 2 (-1) ** 2 >(-1) ** 2 : number ->(-1) : number ->-1 : number ->1 : number ->2 : number +>(-1) : -1 +>-1 : -1 +>1 : 1 +>2 : 2 1 ** 2 ** 3; >1 ** 2 ** 3 : number ->1 : number +>1 : 1 >2 ** 3 : number ->2 : number ->3 : number +>2 : 2 +>3 : 3 1 ** 2 ** -3; >1 ** 2 ** -3 : number ->1 : number +>1 : 1 >2 ** -3 : number ->2 : number ->-3 : number ->3 : number +>2 : 2 +>-3 : -3 +>3 : 3 1 ** -(2 ** 3); >1 ** -(2 ** 3) : number ->1 : number +>1 : 1 >-(2 ** 3) : number >(2 ** 3) : number >2 ** 3 : number ->2 : number ->3 : number +>2 : 2 +>3 : 3 (-(1 ** 2)) ** 3; >(-(1 ** 2)) ** 3 : number @@ -48,9 +48,9 @@ >-(1 ** 2) : number >(1 ** 2) : number >1 ** 2 : number ->1 : number ->2 : number ->3 : number +>1 : 1 +>2 : 2 +>3 : 3 (-(1 ** 2)) ** -3; >(-(1 ** 2)) ** -3 : number @@ -58,150 +58,150 @@ >-(1 ** 2) : number >(1 ** 2) : number >1 ** 2 : number ->1 : number ->2 : number ->-3 : number ->3 : number +>1 : 1 +>2 : 2 +>-3 : -3 +>3 : 3 1 ** 2 + 3; >1 ** 2 + 3 : number >1 ** 2 : number ->1 : number ->2 : number ->3 : number +>1 : 1 +>2 : 2 +>3 : 3 1 ** 2 - 3; >1 ** 2 - 3 : number >1 ** 2 : number ->1 : number ->2 : number ->3 : number +>1 : 1 +>2 : 2 +>3 : 3 1 ** 2 * 3; >1 ** 2 * 3 : number >1 ** 2 : number ->1 : number ->2 : number ->3 : number +>1 : 1 +>2 : 2 +>3 : 3 1 ** 2 / 3; >1 ** 2 / 3 : number >1 ** 2 : number ->1 : number ->2 : number ->3 : number +>1 : 1 +>2 : 2 +>3 : 3 1 ** 2 % 3; >1 ** 2 % 3 : number >1 ** 2 : number ->1 : number ->2 : number ->3 : number +>1 : 1 +>2 : 2 +>3 : 3 1 ** -2 + 3; >1 ** -2 + 3 : number >1 ** -2 : number ->1 : number ->-2 : number ->2 : number ->3 : number +>1 : 1 +>-2 : -2 +>2 : 2 +>3 : 3 1 ** -2 - 3; >1 ** -2 - 3 : number >1 ** -2 : number ->1 : number ->-2 : number ->2 : number ->3 : number +>1 : 1 +>-2 : -2 +>2 : 2 +>3 : 3 1 ** -2 * 3; >1 ** -2 * 3 : number >1 ** -2 : number ->1 : number ->-2 : number ->2 : number ->3 : number +>1 : 1 +>-2 : -2 +>2 : 2 +>3 : 3 1 ** -2 / 3; >1 ** -2 / 3 : number >1 ** -2 : number ->1 : number ->-2 : number ->2 : number ->3 : number +>1 : 1 +>-2 : -2 +>2 : 2 +>3 : 3 1 ** -2 % 3; >1 ** -2 % 3 : number >1 ** -2 : number ->1 : number ->-2 : number ->2 : number ->3 : number +>1 : 1 +>-2 : -2 +>2 : 2 +>3 : 3 2 + 3 ** 3; >2 + 3 ** 3 : number ->2 : number +>2 : 2 >3 ** 3 : number ->3 : number ->3 : number +>3 : 3 +>3 : 3 2 - 3 ** 3; >2 - 3 ** 3 : number ->2 : number +>2 : 2 >3 ** 3 : number ->3 : number ->3 : number +>3 : 3 +>3 : 3 2 * 3 ** 3; >2 * 3 ** 3 : number ->2 : number +>2 : 2 >3 ** 3 : number ->3 : number ->3 : number +>3 : 3 +>3 : 3 2 / 3 ** 3; >2 / 3 ** 3 : number ->2 : number +>2 : 2 >3 ** 3 : number ->3 : number ->3 : number +>3 : 3 +>3 : 3 2 % 3 ** 3; >2 % 3 ** 3 : number ->2 : number +>2 : 2 >3 ** 3 : number ->3 : number ->3 : number +>3 : 3 +>3 : 3 (2 + 3) ** 4; >(2 + 3) ** 4 : number >(2 + 3) : number >2 + 3 : number ->2 : number ->3 : number ->4 : number +>2 : 2 +>3 : 3 +>4 : 4 (2 - 3) ** 4; >(2 - 3) ** 4 : number >(2 - 3) : number >2 - 3 : number ->2 : number ->3 : number ->4 : number +>2 : 2 +>3 : 3 +>4 : 4 (2 * 3) ** 4; >(2 * 3) ** 4 : number >(2 * 3) : number >2 * 3 : number ->2 : number ->3 : number ->4 : number +>2 : 2 +>3 : 3 +>4 : 4 (2 / 3) ** 4; >(2 / 3) ** 4 : number >(2 / 3) : number >2 / 3 : number ->2 : number ->3 : number ->4 : number +>2 : 2 +>3 : 3 +>4 : 4 diff --git a/tests/baselines/reference/emitExponentiationOperator2.types b/tests/baselines/reference/emitExponentiationOperator2.types index cd8773624a7..b2936f6acef 100644 --- a/tests/baselines/reference/emitExponentiationOperator2.types +++ b/tests/baselines/reference/emitExponentiationOperator2.types @@ -2,31 +2,31 @@ var temp = 10; >temp : number ->10 : number +>10 : 10 ++temp ** 3; >++temp ** 3 : number >++temp : number >temp : number ->3 : number +>3 : 3 --temp ** 3; >--temp ** 3 : number >--temp : number >temp : number ->3 : number +>3 : 3 temp++ ** 3; >temp++ ** 3 : number >temp++ : number >temp : number ->3 : number +>3 : 3 temp-- ** 3; >temp-- ** 3 : number >temp-- : number >temp : number ->3 : number +>3 : 3 --temp + temp ** 3; >--temp + temp ** 3 : number @@ -34,7 +34,7 @@ temp-- ** 3; >temp : number >temp ** 3 : number >temp : number ->3 : number +>3 : 3 --temp - temp ** 3; >--temp - temp ** 3 : number @@ -42,7 +42,7 @@ temp-- ** 3; >temp : number >temp ** 3 : number >temp : number ->3 : number +>3 : 3 --temp * temp ** 3; >--temp * temp ** 3 : number @@ -50,7 +50,7 @@ temp-- ** 3; >temp : number >temp ** 3 : number >temp : number ->3 : number +>3 : 3 --temp / temp ** 3; >--temp / temp ** 3 : number @@ -58,7 +58,7 @@ temp-- ** 3; >temp : number >temp ** 3 : number >temp : number ->3 : number +>3 : 3 --temp % temp ** 3; >--temp % temp ** 3 : number @@ -66,19 +66,19 @@ temp-- ** 3; >temp : number >temp ** 3 : number >temp : number ->3 : number +>3 : 3 temp-- ** 3; >temp-- ** 3 : number >temp-- : number >temp : number ->3 : number +>3 : 3 temp++ ** 3; >temp++ ** 3 : number >temp++ : number >temp : number ->3 : number +>3 : 3 temp-- ** -temp; >temp-- ** -temp : number @@ -100,7 +100,7 @@ temp-- + temp ** 3; >temp : number >temp ** 3 : number >temp : number ->3 : number +>3 : 3 temp-- - temp ** 3; >temp-- - temp ** 3 : number @@ -108,7 +108,7 @@ temp-- - temp ** 3; >temp : number >temp ** 3 : number >temp : number ->3 : number +>3 : 3 temp-- * temp ** 3; >temp-- * temp ** 3 : number @@ -116,7 +116,7 @@ temp-- * temp ** 3; >temp : number >temp ** 3 : number >temp : number ->3 : number +>3 : 3 temp-- / temp ** 3; >temp-- / temp ** 3 : number @@ -124,7 +124,7 @@ temp-- / temp ** 3; >temp : number >temp ** 3 : number >temp : number ->3 : number +>3 : 3 temp-- % temp ** 3; >temp-- % temp ** 3 : number @@ -132,213 +132,213 @@ temp-- % temp ** 3; >temp : number >temp ** 3 : number >temp : number ->3 : number +>3 : 3 --temp + 2 ** 3; >--temp + 2 ** 3 : number >--temp : number >temp : number >2 ** 3 : number ->2 : number ->3 : number +>2 : 2 +>3 : 3 --temp - 2 ** 3; >--temp - 2 ** 3 : number >--temp : number >temp : number >2 ** 3 : number ->2 : number ->3 : number +>2 : 2 +>3 : 3 --temp * 2 ** 3; >--temp * 2 ** 3 : number >--temp : number >temp : number >2 ** 3 : number ->2 : number ->3 : number +>2 : 2 +>3 : 3 --temp / 2 ** 3; >--temp / 2 ** 3 : number >--temp : number >temp : number >2 ** 3 : number ->2 : number ->3 : number +>2 : 2 +>3 : 3 --temp % 2 ** 3; >--temp % 2 ** 3 : number >--temp : number >temp : number >2 ** 3 : number ->2 : number ->3 : number +>2 : 2 +>3 : 3 ++temp + 2 ** 3; >++temp + 2 ** 3 : number >++temp : number >temp : number >2 ** 3 : number ->2 : number ->3 : number +>2 : 2 +>3 : 3 ++temp - 2 ** 3; >++temp - 2 ** 3 : number >++temp : number >temp : number >2 ** 3 : number ->2 : number ->3 : number +>2 : 2 +>3 : 3 ++temp * 2 ** 3; >++temp * 2 ** 3 : number >++temp : number >temp : number >2 ** 3 : number ->2 : number ->3 : number +>2 : 2 +>3 : 3 ++temp / 2 ** 3; >++temp / 2 ** 3 : number >++temp : number >temp : number >2 ** 3 : number ->2 : number ->3 : number +>2 : 2 +>3 : 3 3 ** ++temp; >3 ** ++temp : number ->3 : number +>3 : 3 >++temp : number >temp : number 3 ** --temp; >3 ** --temp : number ->3 : number +>3 : 3 >--temp : number >temp : number 3 ** temp++; >3 ** temp++ : number ->3 : number +>3 : 3 >temp++ : number >temp : number 3 ** temp--; >3 ** temp-- : number ->3 : number +>3 : 3 >temp-- : number >temp : number 3 ** ++temp ** 2; >3 ** ++temp ** 2 : number ->3 : number +>3 : 3 >++temp ** 2 : number >++temp : number >temp : number ->2 : number +>2 : 2 3 ** --temp ** 2; >3 ** --temp ** 2 : number ->3 : number +>3 : 3 >--temp ** 2 : number >--temp : number >temp : number ->2 : number +>2 : 2 3 ** temp++ ** 2; >3 ** temp++ ** 2 : number ->3 : number +>3 : 3 >temp++ ** 2 : number >temp++ : number >temp : number ->2 : number +>2 : 2 3 ** temp-- ** 2; >3 ** temp-- ** 2 : number ->3 : number +>3 : 3 >temp-- ** 2 : number >temp-- : number >temp : number ->2 : number +>2 : 2 3 ** ++temp + 2; >3 ** ++temp + 2 : number >3 ** ++temp : number ->3 : number +>3 : 3 >++temp : number >temp : number ->2 : number +>2 : 2 3 ** ++temp - 2; >3 ** ++temp - 2 : number >3 ** ++temp : number ->3 : number +>3 : 3 >++temp : number >temp : number ->2 : number +>2 : 2 3 ** ++temp * 2; >3 ** ++temp * 2 : number >3 ** ++temp : number ->3 : number +>3 : 3 >++temp : number >temp : number ->2 : number +>2 : 2 3 ** ++temp / 2; >3 ** ++temp / 2 : number >3 ** ++temp : number ->3 : number +>3 : 3 >++temp : number >temp : number ->2 : number +>2 : 2 3 ** ++temp % 2; >3 ** ++temp % 2 : number >3 ** ++temp : number ->3 : number +>3 : 3 >++temp : number >temp : number ->2 : number +>2 : 2 3 ** --temp + 2; >3 ** --temp + 2 : number >3 ** --temp : number ->3 : number +>3 : 3 >--temp : number >temp : number ->2 : number +>2 : 2 3 ** --temp - 2; >3 ** --temp - 2 : number >3 ** --temp : number ->3 : number +>3 : 3 >--temp : number >temp : number ->2 : number +>2 : 2 3 ** --temp * 2; >3 ** --temp * 2 : number >3 ** --temp : number ->3 : number +>3 : 3 >--temp : number >temp : number ->2 : number +>2 : 2 3 ** --temp / 2; >3 ** --temp / 2 : number >3 ** --temp : number ->3 : number +>3 : 3 >--temp : number >temp : number ->2 : number +>2 : 2 3 ** --temp % 2; >3 ** --temp % 2 : number >3 ** --temp : number ->3 : number +>3 : 3 >--temp : number >temp : number ->2 : number +>2 : 2 diff --git a/tests/baselines/reference/emitExponentiationOperator3.types b/tests/baselines/reference/emitExponentiationOperator3.types index cc4c5374d05..38bb5a0895c 100644 --- a/tests/baselines/reference/emitExponentiationOperator3.types +++ b/tests/baselines/reference/emitExponentiationOperator3.types @@ -2,7 +2,7 @@ var temp = 10; >temp : number ->10 : number +>10 : 10 (-++temp) ** 3; >(-++temp) ** 3 : number @@ -10,7 +10,7 @@ var temp = 10; >-++temp : number >++temp : number >temp : number ->3 : number +>3 : 3 (+--temp) ** 3; >(+--temp) ** 3 : number @@ -18,7 +18,7 @@ var temp = 10; >+--temp : number >--temp : number >temp : number ->3 : number +>3 : 3 (-temp++) ** 3; >(-temp++) ** 3 : number @@ -26,7 +26,7 @@ var temp = 10; >-temp++ : number >temp++ : number >temp : number ->3 : number +>3 : 3 (+temp--) ** 3; >(+temp--) ** 3 : number @@ -34,7 +34,7 @@ var temp = 10; >+temp-- : number >temp-- : number >temp : number ->3 : number +>3 : 3 (-(1 ** ++temp)) ** 3; >(-(1 ** ++temp)) ** 3 : number @@ -42,10 +42,10 @@ var temp = 10; >-(1 ** ++temp) : number >(1 ** ++temp) : number >1 ** ++temp : number ->1 : number +>1 : 1 >++temp : number >temp : number ->3 : number +>3 : 3 (-(1 ** --temp)) ** 3; >(-(1 ** --temp)) ** 3 : number @@ -53,10 +53,10 @@ var temp = 10; >-(1 ** --temp) : number >(1 ** --temp) : number >1 ** --temp : number ->1 : number +>1 : 1 >--temp : number >temp : number ->3 : number +>3 : 3 (-(1 ** temp++)) ** 3; >(-(1 ** temp++)) ** 3 : number @@ -64,10 +64,10 @@ var temp = 10; >-(1 ** temp++) : number >(1 ** temp++) : number >1 ** temp++ : number ->1 : number +>1 : 1 >temp++ : number >temp : number ->3 : number +>3 : 3 (-(1 ** temp--)) ** 3; >(-(1 ** temp--)) ** 3 : number @@ -75,40 +75,40 @@ var temp = 10; >-(1 ** temp--) : number >(1 ** temp--) : number >1 ** temp-- : number ->1 : number +>1 : 1 >temp-- : number >temp : number ->3 : number +>3 : 3 (-3) ** temp++; >(-3) ** temp++ : number ->(-3) : number ->-3 : number ->3 : number +>(-3) : -3 +>-3 : -3 +>3 : 3 >temp++ : number >temp : number (-3) ** temp--; >(-3) ** temp-- : number ->(-3) : number ->-3 : number ->3 : number +>(-3) : -3 +>-3 : -3 +>3 : 3 >temp-- : number >temp : number (-3) ** ++temp; >(-3) ** ++temp : number ->(-3) : number ->-3 : number ->3 : number +>(-3) : -3 +>-3 : -3 +>3 : 3 >++temp : number >temp : number (-3) ** --temp; >(-3) ** --temp : number ->(-3) : number ->-3 : number ->3 : number +>(-3) : -3 +>-3 : -3 +>3 : 3 >--temp : number >temp : number @@ -116,7 +116,7 @@ var temp = 10; >(+3) ** temp++ : number >(+3) : number >+3 : number ->3 : number +>3 : 3 >temp++ : number >temp : number @@ -124,7 +124,7 @@ var temp = 10; >(+3) ** temp-- : number >(+3) : number >+3 : number ->3 : number +>3 : 3 >temp-- : number >temp : number @@ -132,7 +132,7 @@ var temp = 10; >(+3) ** ++temp : number >(+3) : number >+3 : number ->3 : number +>3 : 3 >++temp : number >temp : number @@ -140,175 +140,175 @@ var temp = 10; >(+3) ** --temp : number >(+3) : number >+3 : number ->3 : number +>3 : 3 >--temp : number >temp : number (-3) ** temp++ ** 2; >(-3) ** temp++ ** 2 : number ->(-3) : number ->-3 : number ->3 : number +>(-3) : -3 +>-3 : -3 +>3 : 3 >temp++ ** 2 : number >temp++ : number >temp : number ->2 : number +>2 : 2 (-3) ** temp-- ** 2; >(-3) ** temp-- ** 2 : number ->(-3) : number ->-3 : number ->3 : number +>(-3) : -3 +>-3 : -3 +>3 : 3 >temp-- ** 2 : number >temp-- : number >temp : number ->2 : number +>2 : 2 (-3) ** ++temp ** 2; >(-3) ** ++temp ** 2 : number ->(-3) : number ->-3 : number ->3 : number +>(-3) : -3 +>-3 : -3 +>3 : 3 >++temp ** 2 : number >++temp : number >temp : number ->2 : number +>2 : 2 (-3) ** --temp ** 2; >(-3) ** --temp ** 2 : number ->(-3) : number ->-3 : number ->3 : number +>(-3) : -3 +>-3 : -3 +>3 : 3 >--temp ** 2 : number >--temp : number >temp : number ->2 : number +>2 : 2 (+3) ** temp++ ** 2; >(+3) ** temp++ ** 2 : number >(+3) : number >+3 : number ->3 : number +>3 : 3 >temp++ ** 2 : number >temp++ : number >temp : number ->2 : number +>2 : 2 (+3) ** temp-- ** 2; >(+3) ** temp-- ** 2 : number >(+3) : number >+3 : number ->3 : number +>3 : 3 >temp-- ** 2 : number >temp-- : number >temp : number ->2 : number +>2 : 2 (+3) ** ++temp ** 2; >(+3) ** ++temp ** 2 : number >(+3) : number >+3 : number ->3 : number +>3 : 3 >++temp ** 2 : number >++temp : number >temp : number ->2 : number +>2 : 2 (+3) ** --temp ** 2; >(+3) ** --temp ** 2 : number >(+3) : number >+3 : number ->3 : number +>3 : 3 >--temp ** 2 : number >--temp : number >temp : number ->2 : number +>2 : 2 3 ** -temp++; >3 ** -temp++ : number ->3 : number +>3 : 3 >-temp++ : number >temp++ : number >temp : number 3 ** -temp--; >3 ** -temp-- : number ->3 : number +>3 : 3 >-temp-- : number >temp-- : number >temp : number 3 ** -++temp; >3 ** -++temp : number ->3 : number +>3 : 3 >-++temp : number >++temp : number >temp : number 3 ** +--temp; >3 ** +--temp : number ->3 : number +>3 : 3 >+--temp : number >--temp : number >temp : number 3 ** (-temp++) ** 2; >3 ** (-temp++) ** 2 : number ->3 : number +>3 : 3 >(-temp++) ** 2 : number >(-temp++) : number >-temp++ : number >temp++ : number >temp : number ->2 : number +>2 : 2 3 ** (-temp--) ** 2; >3 ** (-temp--) ** 2 : number ->3 : number +>3 : 3 >(-temp--) ** 2 : number >(-temp--) : number >-temp-- : number >temp-- : number >temp : number ->2 : number +>2 : 2 3 ** (+temp++) ** 2; >3 ** (+temp++) ** 2 : number ->3 : number +>3 : 3 >(+temp++) ** 2 : number >(+temp++) : number >+temp++ : number >temp++ : number >temp : number ->2 : number +>2 : 2 3 ** (+temp--) ** 2; >3 ** (+temp--) ** 2 : number ->3 : number +>3 : 3 >(+temp--) ** 2 : number >(+temp--) : number >+temp-- : number >temp-- : number >temp : number ->2 : number +>2 : 2 3 ** (-++temp) ** 2; >3 ** (-++temp) ** 2 : number ->3 : number +>3 : 3 >(-++temp) ** 2 : number >(-++temp) : number >-++temp : number >++temp : number >temp : number ->2 : number +>2 : 2 3 ** (+--temp) ** 2; >3 ** (+--temp) ** 2 : number ->3 : number +>3 : 3 >(+--temp) ** 2 : number >(+--temp) : number >+--temp : number >--temp : number >temp : number ->2 : number +>2 : 2 diff --git a/tests/baselines/reference/emitExponentiationOperator4.types b/tests/baselines/reference/emitExponentiationOperator4.types index 36da1c32b4c..0049671228e 100644 --- a/tests/baselines/reference/emitExponentiationOperator4.types +++ b/tests/baselines/reference/emitExponentiationOperator4.types @@ -7,7 +7,7 @@ var temp: any; >(temp) : number >temp : number >temp : any ->3 : number +>3 : 3 (--temp) ** 3; >(--temp) ** 3 : number @@ -15,7 +15,7 @@ var temp: any; >--temp : number >--temp : number >temp : any ->3 : number +>3 : 3 (++temp) ** 3; >(++temp) ** 3 : number @@ -23,7 +23,7 @@ var temp: any; >++temp : number >++temp : number >temp : any ->3 : number +>3 : 3 (temp--) ** 3; >(temp--) ** 3 : number @@ -31,7 +31,7 @@ var temp: any; >temp-- : number >temp-- : number >temp : any ->3 : number +>3 : 3 (temp++) ** 3; >(temp++) ** 3 : number @@ -39,47 +39,47 @@ var temp: any; >temp++ : number >temp++ : number >temp : any ->3 : number +>3 : 3 1 ** (--temp) ** 3; >1 ** (--temp) ** 3 : number ->1 : number +>1 : 1 >(--temp) ** 3 : number >(--temp) : number >--temp : number >--temp : number >temp : any ->3 : number +>3 : 3 1 ** (++temp) ** 3; >1 ** (++temp) ** 3 : number ->1 : number +>1 : 1 >(++temp) ** 3 : number >(++temp) : number >++temp : number >++temp : number >temp : any ->3 : number +>3 : 3 1 ** (temp--) ** 3; >1 ** (temp--) ** 3 : number ->1 : number +>1 : 1 >(temp--) ** 3 : number >(temp--) : number >temp-- : number >temp-- : number >temp : any ->3 : number +>3 : 3 1 ** (temp++) ** 3; >1 ** (temp++) ** 3 : number ->1 : number +>1 : 1 >(temp++) ** 3 : number >(temp++) : number >temp++ : number >temp++ : number >temp : any ->3 : number +>3 : 3 (void --temp) ** 3; >(void --temp) ** 3 : number @@ -87,7 +87,7 @@ var temp: any; >void --temp : undefined >--temp : number >temp : any ->3 : number +>3 : 3 (void temp--) ** 3; >(void temp--) ** 3 : number @@ -95,14 +95,14 @@ var temp: any; >void temp-- : undefined >temp-- : number >temp : any ->3 : number +>3 : 3 (void 3) ** 4; >(void 3) ** 4 : number >(void 3) : undefined >void 3 : undefined ->3 : number ->4 : number +>3 : 3 +>4 : 4 (void temp++) ** 4; >(void temp++) ** 4 : number @@ -110,7 +110,7 @@ var temp: any; >void temp++ : undefined >temp++ : number >temp : any ->4 : number +>4 : 4 (void temp--) ** 4; >(void temp--) ** 4 : number @@ -118,57 +118,57 @@ var temp: any; >void temp-- : undefined >temp-- : number >temp : any ->4 : number +>4 : 4 1 ** (void --temp) ** 3; >1 ** (void --temp) ** 3 : number ->1 : number +>1 : 1 >(void --temp) ** 3 : number >(void --temp) : undefined >void --temp : undefined >--temp : number >temp : any ->3 : number +>3 : 3 1 ** (void temp--) ** 3; >1 ** (void temp--) ** 3 : number ->1 : number +>1 : 1 >(void temp--) ** 3 : number >(void temp--) : undefined >void temp-- : undefined >temp-- : number >temp : any ->3 : number +>3 : 3 1 ** (void 3) ** 4; >1 ** (void 3) ** 4 : number ->1 : number +>1 : 1 >(void 3) ** 4 : number >(void 3) : undefined >void 3 : undefined ->3 : number ->4 : number +>3 : 3 +>4 : 4 1 ** (void temp++) ** 4; >1 ** (void temp++) ** 4 : number ->1 : number +>1 : 1 >(void temp++) ** 4 : number >(void temp++) : undefined >void temp++ : undefined >temp++ : number >temp : any ->4 : number +>4 : 4 1 ** (void temp--) ** 4; >1 ** (void temp--) ** 4 : number ->1 : number +>1 : 1 >(void temp--) ** 4 : number >(void temp--) : undefined >void temp-- : undefined >temp-- : number >temp : any ->4 : number +>4 : 4 (~ --temp) ** 3; >(~ --temp) ** 3 : number @@ -176,7 +176,7 @@ var temp: any; >~ --temp : number >--temp : number >temp : any ->3 : number +>3 : 3 (~ temp--) ** 3; >(~ temp--) ** 3 : number @@ -184,14 +184,14 @@ var temp: any; >~ temp-- : number >temp-- : number >temp : any ->3 : number +>3 : 3 (~ 3) ** 4; >(~ 3) ** 4 : number >(~ 3) : number >~ 3 : number ->3 : number ->4 : number +>3 : 3 +>4 : 4 (~ temp++) ** 4; >(~ temp++) ** 4 : number @@ -199,7 +199,7 @@ var temp: any; >~ temp++ : number >temp++ : number >temp : any ->4 : number +>4 : 4 (~ temp--) ** 4; >(~ temp--) ** 4 : number @@ -207,54 +207,54 @@ var temp: any; >~ temp-- : number >temp-- : number >temp : any ->4 : number +>4 : 4 1 ** (~ --temp) ** 3; >1 ** (~ --temp) ** 3 : number ->1 : number +>1 : 1 >(~ --temp) ** 3 : number >(~ --temp) : number >~ --temp : number >--temp : number >temp : any ->3 : number +>3 : 3 1 ** (~ temp--) ** 3; >1 ** (~ temp--) ** 3 : number ->1 : number +>1 : 1 >(~ temp--) ** 3 : number >(~ temp--) : number >~ temp-- : number >temp-- : number >temp : any ->3 : number +>3 : 3 1 ** (~ 3) ** 4; >1 ** (~ 3) ** 4 : number ->1 : number +>1 : 1 >(~ 3) ** 4 : number >(~ 3) : number >~ 3 : number ->3 : number ->4 : number +>3 : 3 +>4 : 4 1 ** (~ temp++) ** 4; >1 ** (~ temp++) ** 4 : number ->1 : number +>1 : 1 >(~ temp++) ** 4 : number >(~ temp++) : number >~ temp++ : number >temp++ : number >temp : any ->4 : number +>4 : 4 1 ** (~ temp--) ** 4; >1 ** (~ temp--) ** 4 : number ->1 : number +>1 : 1 >(~ temp--) ** 4 : number >(~ temp--) : number >~ temp-- : number >temp-- : number >temp : any ->4 : number +>4 : 4 diff --git a/tests/baselines/reference/emitExponentiationOperatorInTempalteString4.types b/tests/baselines/reference/emitExponentiationOperatorInTempalteString4.types index b4d1aebd4f6..7991ef224f0 100644 --- a/tests/baselines/reference/emitExponentiationOperatorInTempalteString4.types +++ b/tests/baselines/reference/emitExponentiationOperatorInTempalteString4.types @@ -2,11 +2,11 @@ var t1 = 10; >t1 : number ->10 : number +>10 : 10 var t2 = 10; >t2 : number ->10 : number +>10 : 10 var s; >s : any diff --git a/tests/baselines/reference/emitExponentiationOperatorInTempalteString4ES6.types b/tests/baselines/reference/emitExponentiationOperatorInTempalteString4ES6.types index ed2f4b522e9..981829dd42b 100644 --- a/tests/baselines/reference/emitExponentiationOperatorInTempalteString4ES6.types +++ b/tests/baselines/reference/emitExponentiationOperatorInTempalteString4ES6.types @@ -2,11 +2,11 @@ var t1 = 10; >t1 : number ->10 : number +>10 : 10 var t2 = 10; >t2 : number ->10 : number +>10 : 10 var s; >s : any diff --git a/tests/baselines/reference/emitExponentiationOperatorInTemplateString1.types b/tests/baselines/reference/emitExponentiationOperatorInTemplateString1.types index 02ae523c168..bbfb5b88e04 100644 --- a/tests/baselines/reference/emitExponentiationOperatorInTemplateString1.types +++ b/tests/baselines/reference/emitExponentiationOperatorInTemplateString1.types @@ -2,11 +2,11 @@ var t1 = 10; >t1 : number ->10 : number +>10 : 10 var t2 = 10; >t2 : number ->10 : number +>10 : 10 var s; >s : any @@ -65,7 +65,7 @@ var s; `${1 + typeof (t1 ** t2 ** t1) }`; >`${1 + typeof (t1 ** t2 ** t1) }` : string >1 + typeof (t1 ** t2 ** t1) : string ->1 : number +>1 : 1 >typeof (t1 ** t2 ** t1) : string >(t1 ** t2 ** t1) : number >t1 ** t2 ** t1 : number diff --git a/tests/baselines/reference/emitExponentiationOperatorInTemplateString1ES6.types b/tests/baselines/reference/emitExponentiationOperatorInTemplateString1ES6.types index c2ee01ff23f..a005dd07463 100644 --- a/tests/baselines/reference/emitExponentiationOperatorInTemplateString1ES6.types +++ b/tests/baselines/reference/emitExponentiationOperatorInTemplateString1ES6.types @@ -2,11 +2,11 @@ var t1 = 10; >t1 : number ->10 : number +>10 : 10 var t2 = 10; >t2 : number ->10 : number +>10 : 10 var s; >s : any @@ -65,7 +65,7 @@ var s; `${1 + typeof (t1 ** t2 ** t1) }`; >`${1 + typeof (t1 ** t2 ** t1) }` : string >1 + typeof (t1 ** t2 ** t1) : string ->1 : number +>1 : 1 >typeof (t1 ** t2 ** t1) : string >(t1 ** t2 ** t1) : number >t1 ** t2 ** t1 : number diff --git a/tests/baselines/reference/emitExponentiationOperatorInTemplateString2.types b/tests/baselines/reference/emitExponentiationOperatorInTemplateString2.types index 05816e94c6c..156851b60b9 100644 --- a/tests/baselines/reference/emitExponentiationOperatorInTemplateString2.types +++ b/tests/baselines/reference/emitExponentiationOperatorInTemplateString2.types @@ -2,11 +2,11 @@ var t1 = 10; >t1 : number ->10 : number +>10 : 10 var t2 = 10; >t2 : number ->10 : number +>10 : 10 var s; >s : any @@ -65,7 +65,7 @@ var s; `hello ${1 + typeof (t1 ** t2 ** t1) }`; >`hello ${1 + typeof (t1 ** t2 ** t1) }` : string >1 + typeof (t1 ** t2 ** t1) : string ->1 : number +>1 : 1 >typeof (t1 ** t2 ** t1) : string >(t1 ** t2 ** t1) : number >t1 ** t2 ** t1 : number diff --git a/tests/baselines/reference/emitExponentiationOperatorInTemplateString2ES6.types b/tests/baselines/reference/emitExponentiationOperatorInTemplateString2ES6.types index b77e38587c2..dbeee05554e 100644 --- a/tests/baselines/reference/emitExponentiationOperatorInTemplateString2ES6.types +++ b/tests/baselines/reference/emitExponentiationOperatorInTemplateString2ES6.types @@ -2,11 +2,11 @@ var t1 = 10; >t1 : number ->10 : number +>10 : 10 var t2 = 10; >t2 : number ->10 : number +>10 : 10 var s; >s : any @@ -65,7 +65,7 @@ var s; `hello ${1 + typeof (t1 ** t2 ** t1) }`; >`hello ${1 + typeof (t1 ** t2 ** t1) }` : string >1 + typeof (t1 ** t2 ** t1) : string ->1 : number +>1 : 1 >typeof (t1 ** t2 ** t1) : string >(t1 ** t2 ** t1) : number >t1 ** t2 ** t1 : number diff --git a/tests/baselines/reference/emitExponentiationOperatorInTemplateString3.types b/tests/baselines/reference/emitExponentiationOperatorInTemplateString3.types index 88c23ee8a0b..d3472beac12 100644 --- a/tests/baselines/reference/emitExponentiationOperatorInTemplateString3.types +++ b/tests/baselines/reference/emitExponentiationOperatorInTemplateString3.types @@ -2,11 +2,11 @@ var t1 = 10; >t1 : number ->10 : number +>10 : 10 var t2 = 10; >t2 : number ->10 : number +>10 : 10 var s; >s : any @@ -65,7 +65,7 @@ var s; `${1 + typeof (t1 ** t2 ** t1) } world`; >`${1 + typeof (t1 ** t2 ** t1) } world` : string >1 + typeof (t1 ** t2 ** t1) : string ->1 : number +>1 : 1 >typeof (t1 ** t2 ** t1) : string >(t1 ** t2 ** t1) : number >t1 ** t2 ** t1 : number diff --git a/tests/baselines/reference/emitExponentiationOperatorInTemplateString3ES6.types b/tests/baselines/reference/emitExponentiationOperatorInTemplateString3ES6.types index e0d59cc1319..239ef02a529 100644 --- a/tests/baselines/reference/emitExponentiationOperatorInTemplateString3ES6.types +++ b/tests/baselines/reference/emitExponentiationOperatorInTemplateString3ES6.types @@ -2,11 +2,11 @@ var t1 = 10; >t1 : number ->10 : number +>10 : 10 var t2 = 10; >t2 : number ->10 : number +>10 : 10 var s; >s : any @@ -65,7 +65,7 @@ var s; `${1 + typeof (t1 ** t2 ** t1) } world`; >`${1 + typeof (t1 ** t2 ** t1) } world` : string >1 + typeof (t1 ** t2 ** t1) : string ->1 : number +>1 : 1 >typeof (t1 ** t2 ** t1) : string >(t1 ** t2 ** t1) : number >t1 ** t2 ** t1 : number diff --git a/tests/baselines/reference/emitMemberAccessExpression.types b/tests/baselines/reference/emitMemberAccessExpression.types index 7a32e452aec..c3f93e98df9 100644 --- a/tests/baselines/reference/emitMemberAccessExpression.types +++ b/tests/baselines/reference/emitMemberAccessExpression.types @@ -16,12 +16,12 @@ module Microsoft.PeopleAtWork.Model { === tests/cases/compiler/emitMemberAccessExpression_file1.ts === /// "use strict"; ->"use strict" : string +>"use strict" : "use strict" === tests/cases/compiler/emitMemberAccessExpression_file2.ts === /// "use strict"; ->"use strict" : string +>"use strict" : "use strict" module Microsoft.PeopleAtWork.Model { >Microsoft : typeof Microsoft diff --git a/tests/baselines/reference/emitPinnedCommentsOnTopOfFile.types b/tests/baselines/reference/emitPinnedCommentsOnTopOfFile.types index 0ada89e2802..5ca6aa0ead0 100644 --- a/tests/baselines/reference/emitPinnedCommentsOnTopOfFile.types +++ b/tests/baselines/reference/emitPinnedCommentsOnTopOfFile.types @@ -7,5 +7,5 @@ var x = 10; >x : number ->10 : number +>10 : 10 diff --git a/tests/baselines/reference/emitPostComments.types b/tests/baselines/reference/emitPostComments.types index 5b5a05931d4..dd73d852423 100644 --- a/tests/baselines/reference/emitPostComments.types +++ b/tests/baselines/reference/emitPostComments.types @@ -2,7 +2,7 @@ var y = 10; >y : number ->10 : number +>10 : 10 /** * @name Foo diff --git a/tests/baselines/reference/emitPreComments.types b/tests/baselines/reference/emitPreComments.types index c0378350de3..5ba8e45f721 100644 --- a/tests/baselines/reference/emitPreComments.types +++ b/tests/baselines/reference/emitPreComments.types @@ -3,7 +3,7 @@ // This is pre comment var y = 10; >y : number ->10 : number +>10 : 10 /** * @name Foo diff --git a/tests/baselines/reference/emitSuperCallBeforeEmitParameterPropertyDeclaration1.types b/tests/baselines/reference/emitSuperCallBeforeEmitParameterPropertyDeclaration1.types index cfdf0af0300..c8459efaa7c 100644 --- a/tests/baselines/reference/emitSuperCallBeforeEmitParameterPropertyDeclaration1.types +++ b/tests/baselines/reference/emitSuperCallBeforeEmitParameterPropertyDeclaration1.types @@ -4,7 +4,7 @@ class A { blub = 6; >blub : number ->6 : number +>6 : 6 } @@ -16,10 +16,10 @@ class B extends A { >x : number "use strict"; ->"use strict" : string +>"use strict" : "use strict" 'someStringForEgngInject'; ->'someStringForEgngInject' : string +>'someStringForEgngInject' : "someStringForEgngInject" super() >super() : void diff --git a/tests/baselines/reference/emitSuperCallBeforeEmitParameterPropertyDeclaration1ES6.types b/tests/baselines/reference/emitSuperCallBeforeEmitParameterPropertyDeclaration1ES6.types index 4424042c241..5d27896c940 100644 --- a/tests/baselines/reference/emitSuperCallBeforeEmitParameterPropertyDeclaration1ES6.types +++ b/tests/baselines/reference/emitSuperCallBeforeEmitParameterPropertyDeclaration1ES6.types @@ -4,7 +4,7 @@ class A { blub = 6; >blub : number ->6 : number +>6 : 6 } @@ -16,10 +16,10 @@ class B extends A { >x : number "use strict"; ->"use strict" : string +>"use strict" : "use strict" 'someStringForEgngInject'; ->'someStringForEgngInject' : string +>'someStringForEgngInject' : "someStringForEgngInject" super() >super() : void diff --git a/tests/baselines/reference/emitSuperCallBeforeEmitPropertyDeclaration1.types b/tests/baselines/reference/emitSuperCallBeforeEmitPropertyDeclaration1.types index 2d16fed121d..c96fd01740e 100644 --- a/tests/baselines/reference/emitSuperCallBeforeEmitPropertyDeclaration1.types +++ b/tests/baselines/reference/emitSuperCallBeforeEmitPropertyDeclaration1.types @@ -4,7 +4,7 @@ class A { blub = 6; >blub : number ->6 : number +>6 : 6 } @@ -14,14 +14,14 @@ class B extends A { blub = 12; >blub : number ->12 : number +>12 : 12 constructor() { "use strict"; ->"use strict" : string +>"use strict" : "use strict" 'someStringForEgngInject'; ->'someStringForEgngInject' : string +>'someStringForEgngInject' : "someStringForEgngInject" super() >super() : void diff --git a/tests/baselines/reference/emitSuperCallBeforeEmitPropertyDeclaration1ES6.types b/tests/baselines/reference/emitSuperCallBeforeEmitPropertyDeclaration1ES6.types index 39e8f885777..28b8c2d210a 100644 --- a/tests/baselines/reference/emitSuperCallBeforeEmitPropertyDeclaration1ES6.types +++ b/tests/baselines/reference/emitSuperCallBeforeEmitPropertyDeclaration1ES6.types @@ -4,7 +4,7 @@ class A { blub = 6; >blub : number ->6 : number +>6 : 6 } @@ -14,11 +14,11 @@ class B extends A { blub = 12; >blub : number ->12 : number +>12 : 12 constructor() { 'someStringForEgngInject'; ->'someStringForEgngInject' : string +>'someStringForEgngInject' : "someStringForEgngInject" super() >super() : void diff --git a/tests/baselines/reference/emitSuperCallBeforeEmitPropertyDeclarationAndParameterPropertyDeclaration1.types b/tests/baselines/reference/emitSuperCallBeforeEmitPropertyDeclarationAndParameterPropertyDeclaration1.types index acb5703581a..8604f5d94bb 100644 --- a/tests/baselines/reference/emitSuperCallBeforeEmitPropertyDeclarationAndParameterPropertyDeclaration1.types +++ b/tests/baselines/reference/emitSuperCallBeforeEmitPropertyDeclarationAndParameterPropertyDeclaration1.types @@ -4,7 +4,7 @@ class A { blub = 6; >blub : number ->6 : number +>6 : 6 } @@ -14,16 +14,16 @@ class B extends A { blah = 2; >blah : number ->2 : number +>2 : 2 constructor(public x: number) { >x : number "use strict"; ->"use strict" : string +>"use strict" : "use strict" 'someStringForEgngInject'; ->'someStringForEgngInject' : string +>'someStringForEgngInject' : "someStringForEgngInject" super() >super() : void diff --git a/tests/baselines/reference/emitSuperCallBeforeEmitPropertyDeclarationAndParameterPropertyDeclaration1ES6.types b/tests/baselines/reference/emitSuperCallBeforeEmitPropertyDeclarationAndParameterPropertyDeclaration1ES6.types index 96fc1fc2dc3..585ba8a9df9 100644 --- a/tests/baselines/reference/emitSuperCallBeforeEmitPropertyDeclarationAndParameterPropertyDeclaration1ES6.types +++ b/tests/baselines/reference/emitSuperCallBeforeEmitPropertyDeclarationAndParameterPropertyDeclaration1ES6.types @@ -4,7 +4,7 @@ class A { blub = 6; >blub : number ->6 : number +>6 : 6 } @@ -14,16 +14,16 @@ class B extends A { blah = 2; >blah : number ->2 : number +>2 : 2 constructor(public x: number) { >x : number "use strict"; ->"use strict" : string +>"use strict" : "use strict" 'someStringForEgngInject'; ->'someStringForEgngInject' : string +>'someStringForEgngInject' : "someStringForEgngInject" super() >super() : void diff --git a/tests/baselines/reference/emitTopOfFileTripleSlashCommentOnNotEmittedNodeIfRemoveCommentsIsFalse.types b/tests/baselines/reference/emitTopOfFileTripleSlashCommentOnNotEmittedNodeIfRemoveCommentsIsFalse.types index 637196fdc22..b5c1cd2b346 100644 --- a/tests/baselines/reference/emitTopOfFileTripleSlashCommentOnNotEmittedNodeIfRemoveCommentsIsFalse.types +++ b/tests/baselines/reference/emitTopOfFileTripleSlashCommentOnNotEmittedNodeIfRemoveCommentsIsFalse.types @@ -13,5 +13,5 @@ interface F { } var x = 10 >x : number ->10 : number +>10 : 10 diff --git a/tests/baselines/reference/emptyArrayBindingPatternParameter04.types b/tests/baselines/reference/emptyArrayBindingPatternParameter04.types index 834eb41b34d..f6035a6ba94 100644 --- a/tests/baselines/reference/emptyArrayBindingPatternParameter04.types +++ b/tests/baselines/reference/emptyArrayBindingPatternParameter04.types @@ -3,10 +3,10 @@ function f([] = [1,2,3,4]) { >f : ([]?: number[]) => void >[1,2,3,4] : number[] ->1 : number ->2 : number ->3 : number ->4 : number +>1 : 1 +>2 : 2 +>3 : 3 +>4 : 4 var x, y, z; >x : any diff --git a/tests/baselines/reference/emptyIndexer.types b/tests/baselines/reference/emptyIndexer.types index 5361ed4d7f4..7c7fb160b98 100644 --- a/tests/baselines/reference/emptyIndexer.types +++ b/tests/baselines/reference/emptyIndexer.types @@ -25,6 +25,6 @@ var n = x[''].m(); // should not crash compiler >x[''].m : () => number >x[''] : I1 >x : I2 ->'' : string +>'' : "" >m : () => number diff --git a/tests/baselines/reference/emptyThenWithoutWarning.types b/tests/baselines/reference/emptyThenWithoutWarning.types index 5da827deb2c..0632001736b 100644 --- a/tests/baselines/reference/emptyThenWithoutWarning.types +++ b/tests/baselines/reference/emptyThenWithoutWarning.types @@ -1,7 +1,7 @@ === tests/cases/compiler/emptyThenWithoutWarning.ts === let a = 4; >a : number ->4 : number +>4 : 4 if(a === 1 || a === 2 || a === 3) { >a === 1 || a === 2 || a === 3 : boolean @@ -19,5 +19,5 @@ if(a === 1 || a === 2 || a === 3) { else { let message = "Ooops"; >message : string ->"Ooops" : string +>"Ooops" : "Ooops" } diff --git a/tests/baselines/reference/emptyVariableDeclarationBindingPatterns01_ES5.types b/tests/baselines/reference/emptyVariableDeclarationBindingPatterns01_ES5.types index 3640d468a59..9b6112365fd 100644 --- a/tests/baselines/reference/emptyVariableDeclarationBindingPatterns01_ES5.types +++ b/tests/baselines/reference/emptyVariableDeclarationBindingPatterns01_ES5.types @@ -56,9 +56,9 @@ for (var {} = {}, {} = {}; false; void 0) { >{} : {} >{} : {} ->false : boolean +>false : false >void 0 : undefined ->0 : number +>0 : 0 } function f({} = a, [] = a, { p: {} = a} = a) { diff --git a/tests/baselines/reference/emptyVariableDeclarationBindingPatterns01_ES6.types b/tests/baselines/reference/emptyVariableDeclarationBindingPatterns01_ES6.types index 20b7d5ec2b6..ac79fe0b1b7 100644 --- a/tests/baselines/reference/emptyVariableDeclarationBindingPatterns01_ES6.types +++ b/tests/baselines/reference/emptyVariableDeclarationBindingPatterns01_ES6.types @@ -56,9 +56,9 @@ for (var {} = {}, {} = {}; false; void 0) { >{} : {} >{} : {} ->false : boolean +>false : false >void 0 : undefined ->0 : number +>0 : 0 } function f({} = a, [] = a, { p: {} = a} = a) { diff --git a/tests/baselines/reference/enumAssignmentCompat.errors.txt b/tests/baselines/reference/enumAssignmentCompat.errors.txt index f1a01247146..d0b8cb376c2 100644 --- a/tests/baselines/reference/enumAssignmentCompat.errors.txt +++ b/tests/baselines/reference/enumAssignmentCompat.errors.txt @@ -1,8 +1,8 @@ tests/cases/compiler/enumAssignmentCompat.ts(26,5): error TS2322: Type 'typeof W' is not assignable to type 'number'. -tests/cases/compiler/enumAssignmentCompat.ts(28,5): error TS2322: Type 'W' is not assignable to type 'typeof W'. -tests/cases/compiler/enumAssignmentCompat.ts(30,5): error TS2322: Type 'number' is not assignable to type 'typeof W'. -tests/cases/compiler/enumAssignmentCompat.ts(32,5): error TS2322: Type 'W' is not assignable to type 'WStatic'. -tests/cases/compiler/enumAssignmentCompat.ts(33,5): error TS2322: Type 'number' is not assignable to type 'WStatic'. +tests/cases/compiler/enumAssignmentCompat.ts(28,5): error TS2322: Type 'W.a' is not assignable to type 'typeof W'. +tests/cases/compiler/enumAssignmentCompat.ts(30,5): error TS2322: Type '3' is not assignable to type 'typeof W'. +tests/cases/compiler/enumAssignmentCompat.ts(32,5): error TS2322: Type 'W.a' is not assignable to type 'WStatic'. +tests/cases/compiler/enumAssignmentCompat.ts(33,5): error TS2322: Type '5' is not assignable to type 'WStatic'. ==== tests/cases/compiler/enumAssignmentCompat.ts (5 errors) ==== @@ -37,18 +37,18 @@ tests/cases/compiler/enumAssignmentCompat.ts(33,5): error TS2322: Type 'number' var a: number = W.a; var b: typeof W = W.a; // error ~ -!!! error TS2322: Type 'W' is not assignable to type 'typeof W'. +!!! error TS2322: Type 'W.a' is not assignable to type 'typeof W'. var c: typeof W.a = W.a; var d: typeof W = 3; // error ~ -!!! error TS2322: Type 'number' is not assignable to type 'typeof W'. +!!! error TS2322: Type '3' is not assignable to type 'typeof W'. var e: typeof W.a = 4; var f: WStatic = W.a; // error ~ -!!! error TS2322: Type 'W' is not assignable to type 'WStatic'. +!!! error TS2322: Type 'W.a' is not assignable to type 'WStatic'. var g: WStatic = 5; // error ~ -!!! error TS2322: Type 'number' is not assignable to type 'WStatic'. +!!! error TS2322: Type '5' is not assignable to type 'WStatic'. var h: W = 3; var i: W = W.a; i = W.a; diff --git a/tests/baselines/reference/enumAssignmentCompat2.errors.txt b/tests/baselines/reference/enumAssignmentCompat2.errors.txt index 4e0660eaae3..065cd35133d 100644 --- a/tests/baselines/reference/enumAssignmentCompat2.errors.txt +++ b/tests/baselines/reference/enumAssignmentCompat2.errors.txt @@ -1,8 +1,8 @@ tests/cases/compiler/enumAssignmentCompat2.ts(25,5): error TS2322: Type 'typeof W' is not assignable to type 'number'. -tests/cases/compiler/enumAssignmentCompat2.ts(27,5): error TS2322: Type 'W' is not assignable to type 'typeof W'. -tests/cases/compiler/enumAssignmentCompat2.ts(29,5): error TS2322: Type 'number' is not assignable to type 'typeof W'. -tests/cases/compiler/enumAssignmentCompat2.ts(31,5): error TS2322: Type 'W' is not assignable to type 'WStatic'. -tests/cases/compiler/enumAssignmentCompat2.ts(32,5): error TS2322: Type 'number' is not assignable to type 'WStatic'. +tests/cases/compiler/enumAssignmentCompat2.ts(27,5): error TS2322: Type 'W.a' is not assignable to type 'typeof W'. +tests/cases/compiler/enumAssignmentCompat2.ts(29,5): error TS2322: Type '3' is not assignable to type 'typeof W'. +tests/cases/compiler/enumAssignmentCompat2.ts(31,5): error TS2322: Type 'W.a' is not assignable to type 'WStatic'. +tests/cases/compiler/enumAssignmentCompat2.ts(32,5): error TS2322: Type '5' is not assignable to type 'WStatic'. ==== tests/cases/compiler/enumAssignmentCompat2.ts (5 errors) ==== @@ -36,18 +36,18 @@ tests/cases/compiler/enumAssignmentCompat2.ts(32,5): error TS2322: Type 'number' var a: number = W.a; var b: typeof W = W.a; // error ~ -!!! error TS2322: Type 'W' is not assignable to type 'typeof W'. +!!! error TS2322: Type 'W.a' is not assignable to type 'typeof W'. var c: typeof W.a = W.a; var d: typeof W = 3; // error ~ -!!! error TS2322: Type 'number' is not assignable to type 'typeof W'. +!!! error TS2322: Type '3' is not assignable to type 'typeof W'. var e: typeof W.a = 4; var f: WStatic = W.a; // error ~ -!!! error TS2322: Type 'W' is not assignable to type 'WStatic'. +!!! error TS2322: Type 'W.a' is not assignable to type 'WStatic'. var g: WStatic = 5; // error ~ -!!! error TS2322: Type 'number' is not assignable to type 'WStatic'. +!!! error TS2322: Type '5' is not assignable to type 'WStatic'. var h: W = 3; var i: W = W.a; i = W.a; diff --git a/tests/baselines/reference/enumAssignmentCompat3.errors.txt b/tests/baselines/reference/enumAssignmentCompat3.errors.txt index 02cb4314777..558540c32c8 100644 --- a/tests/baselines/reference/enumAssignmentCompat3.errors.txt +++ b/tests/baselines/reference/enumAssignmentCompat3.errors.txt @@ -1,20 +1,18 @@ -tests/cases/compiler/enumAssignmentCompat3.ts(68,1): error TS2322: Type 'Abcd.E' is not assignable to type 'First.E'. - Property 'd' is missing in type 'First.E'. +tests/cases/compiler/enumAssignmentCompat3.ts(68,1): error TS2324: Property 'd' is missing in type 'First.E'. tests/cases/compiler/enumAssignmentCompat3.ts(70,1): error TS2322: Type 'Cd.E' is not assignable to type 'First.E'. Property 'd' is missing in type 'First.E'. tests/cases/compiler/enumAssignmentCompat3.ts(71,1): error TS2322: Type 'Nope' is not assignable to type 'E'. -tests/cases/compiler/enumAssignmentCompat3.ts(75,1): error TS2322: Type 'First.E' is not assignable to type 'Ab.E'. - Property 'c' is missing in type 'Ab.E'. +tests/cases/compiler/enumAssignmentCompat3.ts(72,1): error TS2322: Type 'Decl.E' is not assignable to type 'First.E'. +tests/cases/compiler/enumAssignmentCompat3.ts(75,1): error TS2324: Property 'c' is missing in type 'Ab.E'. tests/cases/compiler/enumAssignmentCompat3.ts(76,1): error TS2322: Type 'First.E' is not assignable to type 'Cd.E'. - Property 'a' is missing in type 'Cd.E'. tests/cases/compiler/enumAssignmentCompat3.ts(77,1): error TS2322: Type 'E' is not assignable to type 'Nope'. +tests/cases/compiler/enumAssignmentCompat3.ts(78,1): error TS2322: Type 'First.E' is not assignable to type 'Decl.E'. tests/cases/compiler/enumAssignmentCompat3.ts(82,1): error TS2322: Type 'Const.E' is not assignable to type 'First.E'. tests/cases/compiler/enumAssignmentCompat3.ts(83,1): error TS2322: Type 'First.E' is not assignable to type 'Const.E'. -tests/cases/compiler/enumAssignmentCompat3.ts(86,1): error TS2322: Type 'Merged.E' is not assignable to type 'First.E'. - Property 'd' is missing in type 'First.E'. +tests/cases/compiler/enumAssignmentCompat3.ts(86,1): error TS2324: Property 'd' is missing in type 'First.E'. -==== tests/cases/compiler/enumAssignmentCompat3.ts (9 errors) ==== +==== tests/cases/compiler/enumAssignmentCompat3.ts (11 errors) ==== namespace First { export enum E { a, b, c, @@ -84,8 +82,7 @@ tests/cases/compiler/enumAssignmentCompat3.ts(86,1): error TS2322: Type 'Merged. abc = secondAbc; // ok abc = secondAbcd; // missing 'd' ~~~ -!!! error TS2322: Type 'Abcd.E' is not assignable to type 'First.E'. -!!! error TS2322: Property 'd' is missing in type 'First.E'. +!!! error TS2324: Property 'd' is missing in type 'First.E'. abc = secondAb; // ok abc = secondCd; // missing 'd' ~~~ @@ -95,20 +92,22 @@ tests/cases/compiler/enumAssignmentCompat3.ts(86,1): error TS2322: Type 'Merged. ~~~ !!! error TS2322: Type 'Nope' is not assignable to type 'E'. abc = decl; // ok + ~~~ +!!! error TS2322: Type 'Decl.E' is not assignable to type 'First.E'. secondAbc = abc; // ok secondAbcd = abc; // ok secondAb = abc; // missing 'c' ~~~~~~~~ -!!! error TS2322: Type 'First.E' is not assignable to type 'Ab.E'. -!!! error TS2322: Property 'c' is missing in type 'Ab.E'. +!!! error TS2324: Property 'c' is missing in type 'Ab.E'. secondCd = abc; // missing 'a' and 'b' ~~~~~~~~ !!! error TS2322: Type 'First.E' is not assignable to type 'Cd.E'. -!!! error TS2322: Property 'a' is missing in type 'Cd.E'. nope = abc; // nope! ~~~~ !!! error TS2322: Type 'E' is not assignable to type 'Nope'. decl = abc; // ok + ~~~~ +!!! error TS2322: Type 'First.E' is not assignable to type 'Decl.E'. // const is only assignable to itself k = k; @@ -122,8 +121,7 @@ tests/cases/compiler/enumAssignmentCompat3.ts(86,1): error TS2322: Type 'Merged. // merged enums compare all their members abc = merged; // missing 'd' ~~~ -!!! error TS2322: Type 'Merged.E' is not assignable to type 'First.E'. -!!! error TS2322: Property 'd' is missing in type 'First.E'. +!!! error TS2324: Property 'd' is missing in type 'First.E'. merged = abc; // ok abc = merged2; // ok merged2 = abc; // ok \ No newline at end of file diff --git a/tests/baselines/reference/enumAssignmentCompat5.errors.txt b/tests/baselines/reference/enumAssignmentCompat5.errors.txt new file mode 100644 index 00000000000..ef703a2ad62 --- /dev/null +++ b/tests/baselines/reference/enumAssignmentCompat5.errors.txt @@ -0,0 +1,30 @@ +tests/cases/compiler/enumAssignmentCompat5.ts(20,9): error TS2535: Enum type 'Computed' has members with initializers that are not literals. + + +==== tests/cases/compiler/enumAssignmentCompat5.ts (1 errors) ==== + enum E { + A, B, C + } + enum Computed { + A = 1 << 1, + B = 1 << 2, + C = 1 << 3, + } + let n: number; + let e: E = n; // ok because it's too inconvenient otherwise + e = 0; // ok, in range + e = 4; // ok, out of range, but allowed computed enums don't have all members + let a: E.A = 0; // ok, A === 0 + a = 2; // error, 2 !== 0 + a = n; // ok + + let c: Computed = n; // ok + c = n; // ok + c = 4; // ok + let ca: Computed.A = 1; // error, Computed.A isn't a literal type because Computed has no enum literals + ~~~~~~~~~~ +!!! error TS2535: Enum type 'Computed' has members with initializers that are not literals. + + + + \ No newline at end of file diff --git a/tests/baselines/reference/enumAssignmentCompat5.js b/tests/baselines/reference/enumAssignmentCompat5.js new file mode 100644 index 00000000000..a7c96929f08 --- /dev/null +++ b/tests/baselines/reference/enumAssignmentCompat5.js @@ -0,0 +1,50 @@ +//// [enumAssignmentCompat5.ts] +enum E { + A, B, C +} +enum Computed { + A = 1 << 1, + B = 1 << 2, + C = 1 << 3, +} +let n: number; +let e: E = n; // ok because it's too inconvenient otherwise +e = 0; // ok, in range +e = 4; // ok, out of range, but allowed computed enums don't have all members +let a: E.A = 0; // ok, A === 0 +a = 2; // error, 2 !== 0 +a = n; // ok + +let c: Computed = n; // ok +c = n; // ok +c = 4; // ok +let ca: Computed.A = 1; // error, Computed.A isn't a literal type because Computed has no enum literals + + + + + +//// [enumAssignmentCompat5.js] +var E; +(function (E) { + E[E["A"] = 0] = "A"; + E[E["B"] = 1] = "B"; + E[E["C"] = 2] = "C"; +})(E || (E = {})); +var Computed; +(function (Computed) { + Computed[Computed["A"] = 2] = "A"; + Computed[Computed["B"] = 4] = "B"; + Computed[Computed["C"] = 8] = "C"; +})(Computed || (Computed = {})); +var n; +var e = n; // ok because it's too inconvenient otherwise +e = 0; // ok, in range +e = 4; // ok, out of range, but allowed computed enums don't have all members +var a = 0; // ok, A === 0 +a = 2; // error, 2 !== 0 +a = n; // ok +var c = n; // ok +c = n; // ok +c = 4; // ok +var ca = 1; // error, Computed.A isn't a literal type because Computed has no enum literals diff --git a/tests/baselines/reference/enumBasics.errors.txt b/tests/baselines/reference/enumBasics.errors.txt new file mode 100644 index 00000000000..4d82402b8ee --- /dev/null +++ b/tests/baselines/reference/enumBasics.errors.txt @@ -0,0 +1,86 @@ +tests/cases/conformance/enums/enumBasics.ts(13,5): error TS2403: Subsequent variable declarations must have the same type. Variable 'e' must be of type 'typeof E1', but here has type '{ readonly [n: number]: string; readonly A: E1; readonly B: E1; readonly C: E1; }'. + + +==== tests/cases/conformance/enums/enumBasics.ts (1 errors) ==== + // Enum without initializers have first member = 0 and successive members = N + 1 + enum E1 { + A, + B, + C + } + + // Enum type is a subtype of Number + var x: number = E1.A; + + // Enum object type is anonymous with properties of the enum type and numeric indexer + var e = E1; + var e: { + ~ +!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'e' must be of type 'typeof E1', but here has type '{ readonly [n: number]: string; readonly A: E1; readonly B: E1; readonly C: E1; }'. + readonly A: E1; + readonly B: E1; + readonly C: E1; + readonly [n: number]: string; + }; + var e: typeof E1; + + // Reverse mapping of enum returns string name of property + var s = E1[e.A]; + var s: string; + + + // Enum with only constant members + enum E2 { + A = 1, B = 2, C = 3 + } + + // Enum with only computed members + enum E3 { + X = 'foo'.length, Y = 4 + 3, Z = +'foo' + } + + // Enum with constant members followed by computed members + enum E4 { + X = 0, Y, Z = 'foo'.length + } + + // Enum with > 2 constant members with no initializer for first member, non zero initializer for second element + enum E5 { + A, + B = 3, + C // 4 + } + + enum E6 { + A, + B = 0, + C // 1 + } + + // Enum with computed member initializer of type 'any' + enum E7 { + A = 'foo'['foo'] + } + + // Enum with computed member initializer of type number + enum E8 { + B = 'foo'['foo'] + } + + //Enum with computed member intializer of same enum type + enum E9 { + A, + B = A + } + + // (refer to .js to validate) + // Enum constant members are propagated + var doNotPropagate = [ + E8.B, E7.A, E4.Z, E3.X, E3.Y, E3.Z + ]; + // Enum computed members are not propagated + var doPropagate = [ + E9.A, E9.B, E6.B, E6.C, E6.A, E5.A, E5.B, E5.C + ]; + + \ No newline at end of file diff --git a/tests/baselines/reference/enumBasics1.errors.txt b/tests/baselines/reference/enumBasics1.errors.txt index fddca60bd99..352303def5b 100644 --- a/tests/baselines/reference/enumBasics1.errors.txt +++ b/tests/baselines/reference/enumBasics1.errors.txt @@ -1,4 +1,4 @@ -tests/cases/compiler/enumBasics1.ts(26,5): error TS2339: Property 'A' does not exist on type 'E'. +tests/cases/compiler/enumBasics1.ts(26,5): error TS2339: Property 'A' does not exist on type 'E.A'. tests/cases/compiler/enumBasics1.ts(35,2): error TS2432: In an enum with multiple declarations, only one declaration can omit an initializer for its first enum element. @@ -30,7 +30,7 @@ tests/cases/compiler/enumBasics1.ts(35,2): error TS2432: In an enum with multipl */ E.A.A; // should error ~ -!!! error TS2339: Property 'A' does not exist on type 'E'. +!!! error TS2339: Property 'A' does not exist on type 'E.A'. enum E2 { diff --git a/tests/baselines/reference/enumCodeGenNewLines1.types b/tests/baselines/reference/enumCodeGenNewLines1.types index 6321511ef2d..ec4f610df11 100644 --- a/tests/baselines/reference/enumCodeGenNewLines1.types +++ b/tests/baselines/reference/enumCodeGenNewLines1.types @@ -3,15 +3,15 @@ enum foo { >foo : foo b = 1, ->b : foo ->1 : number +>b : foo.b +>1 : 1 c = 2, ->c : foo ->2 : number +>c : foo.c +>2 : 2 d = 3 ->d : foo ->3 : number +>d : foo.d +>3 : 3 } diff --git a/tests/baselines/reference/enumConstantMembers.types b/tests/baselines/reference/enumConstantMembers.types index c99b5eeb62f..bfbf71a6c17 100644 --- a/tests/baselines/reference/enumConstantMembers.types +++ b/tests/baselines/reference/enumConstantMembers.types @@ -4,47 +4,47 @@ enum E1 { >E1 : E1 a = 1, ->a : E1 ->1 : number +>a : E1.a +>1 : 1 b ->b : E1 +>b : E1.b } enum E2 { >E2 : E2 a = - 1, ->a : E2 ->- 1 : number ->1 : number +>a : E2.a +>- 1 : -1 +>1 : 1 b ->b : E2 +>b : E2.b } enum E3 { >E3 : E3 a = 0.1, ->a : E3 ->0.1 : number +>a : E3.a +>0.1 : 0.1 b // Error because 0.1 is not a constant ->b : E3 +>b : E3.b } declare enum E4 { >E4 : E4 a = 1, ->a : E4 ->1 : number +>a : E4.a +>1 : 1 b = -1, ->b : E4 ->-1 : number ->1 : number +>b : E4.b +>-1 : -1 +>1 : 1 c = 0.1 // Not a constant ->c : E4 ->0.1 : number +>c : E4.c +>0.1 : 0.1 } diff --git a/tests/baselines/reference/enumErrors.errors.txt b/tests/baselines/reference/enumErrors.errors.txt index 14cad3cb53b..f0978df709c 100644 --- a/tests/baselines/reference/enumErrors.errors.txt +++ b/tests/baselines/reference/enumErrors.errors.txt @@ -3,7 +3,7 @@ tests/cases/conformance/enums/enumErrors.ts(3,6): error TS2431: Enum name cannot tests/cases/conformance/enums/enumErrors.ts(4,6): error TS2431: Enum name cannot be 'string' tests/cases/conformance/enums/enumErrors.ts(5,6): error TS2431: Enum name cannot be 'boolean' tests/cases/conformance/enums/enumErrors.ts(9,9): error TS2322: Type 'Number' is not assignable to type 'E5'. -tests/cases/conformance/enums/enumErrors.ts(26,9): error TS2322: Type 'string' is not assignable to type 'E11'. +tests/cases/conformance/enums/enumErrors.ts(26,9): error TS2322: Type '""' is not assignable to type 'E11'. tests/cases/conformance/enums/enumErrors.ts(27,9): error TS2322: Type 'Date' is not assignable to type 'E11'. tests/cases/conformance/enums/enumErrors.ts(28,9): error TS2304: Cannot find name 'window'. tests/cases/conformance/enums/enumErrors.ts(29,9): error TS2322: Type '{}' is not assignable to type 'E11'. @@ -47,7 +47,7 @@ tests/cases/conformance/enums/enumErrors.ts(29,9): error TS2322: Type '{}' is no enum E11 { A = '', ~~ -!!! error TS2322: Type 'string' is not assignable to type 'E11'. +!!! error TS2322: Type '""' is not assignable to type 'E11'. B = new Date(), ~~~~~~~~~~ !!! error TS2322: Type 'Date' is not assignable to type 'E11'. diff --git a/tests/baselines/reference/enumExportMergingES6.types b/tests/baselines/reference/enumExportMergingES6.types index da2fc22cb8a..6ede07d92a0 100644 --- a/tests/baselines/reference/enumExportMergingES6.types +++ b/tests/baselines/reference/enumExportMergingES6.types @@ -4,14 +4,14 @@ export enum Animals { Cat = 1 >Cat : Animals ->1 : number +>1 : 1 } export enum Animals { >Animals : Animals Dog = 2 >Dog : Animals ->2 : number +>2 : 2 } export enum Animals { >Animals : Animals diff --git a/tests/baselines/reference/enumIndexer.types b/tests/baselines/reference/enumIndexer.types index cbc43176b01..6c6e50822b5 100644 --- a/tests/baselines/reference/enumIndexer.types +++ b/tests/baselines/reference/enumIndexer.types @@ -3,24 +3,24 @@ enum MyEnumType { >MyEnumType : MyEnumType foo, bar ->foo : MyEnumType ->bar : MyEnumType +>foo : MyEnumType.foo +>bar : MyEnumType.bar } var _arr = [{ key: 'foo' }, { key: 'bar' }] >_arr : { key: string; }[] >[{ key: 'foo' }, { key: 'bar' }] : { key: string; }[] >{ key: 'foo' } : { key: string; } >key : string ->'foo' : string +>'foo' : "foo" >{ key: 'bar' } : { key: string; } >key : string ->'bar' : string +>'bar' : "bar" var enumValue = MyEnumType.foo; >enumValue : MyEnumType ->MyEnumType.foo : MyEnumType +>MyEnumType.foo : MyEnumType.foo >MyEnumType : typeof MyEnumType ->foo : MyEnumType +>foo : MyEnumType.foo var x = _arr.map(o => MyEnumType[o.key] === enumValue); // these are not same type >x : boolean[] diff --git a/tests/baselines/reference/enumInitializersWithExponents.types b/tests/baselines/reference/enumInitializersWithExponents.types index 8da208e5f87..25a36ffc5e3 100644 --- a/tests/baselines/reference/enumInitializersWithExponents.types +++ b/tests/baselines/reference/enumInitializersWithExponents.types @@ -4,26 +4,26 @@ declare enum E { >E : E a = 1e3, // ok ->a : E ->1e3 : number +>a : E.a +>1e3 : 1000 b = 1e25, // ok ->b : E ->1e25 : number +>b : E.b +>1e25 : 1e+25 c = 1e-3, // error ->c : E ->1e-3 : number +>c : E.c +>1e-3 : 0.001 d = 1e-9, // error ->d : E ->1e-9 : number +>d : E.d +>1e-9 : 1e-9 e = 1e0, // ok ->e : E ->1e0 : number +>e : E.e +>1e0 : 1 f = 1e+25 // ok ->f : E ->1e+25 : number +>f : E.b +>1e+25 : 1e+25 } diff --git a/tests/baselines/reference/enumLiteralAssignableToEnumInsideUnion.errors.txt b/tests/baselines/reference/enumLiteralAssignableToEnumInsideUnion.errors.txt new file mode 100644 index 00000000000..660e1094ae9 --- /dev/null +++ b/tests/baselines/reference/enumLiteralAssignableToEnumInsideUnion.errors.txt @@ -0,0 +1,44 @@ +tests/cases/compiler/enumLiteralAssignableToEnumInsideUnion.ts(24,7): error TS2322: Type 'Foo' is not assignable to type 'boolean | Foo'. +tests/cases/compiler/enumLiteralAssignableToEnumInsideUnion.ts(25,7): error TS2322: Type 'Foo' is not assignable to type 'boolean | Foo'. +tests/cases/compiler/enumLiteralAssignableToEnumInsideUnion.ts(26,7): error TS2322: Type 'Foo' is not assignable to type 'boolean | Foo.B'. +tests/cases/compiler/enumLiteralAssignableToEnumInsideUnion.ts(27,7): error TS2322: Type 'Foo' is not assignable to type 'boolean | Foo.A'. + + +==== tests/cases/compiler/enumLiteralAssignableToEnumInsideUnion.ts (4 errors) ==== + module X { + export enum Foo { + A, B + } + } + module Y { + export enum Foo { + A, B + } + } + module Z { + export enum Foo { + A = 1 << 1, + B = 1 << 2, + } + } + module Ka { + export enum Foo { + A = 1 << 10, + B = 1 << 11, + } + } + const e0: X.Foo | boolean = Y.Foo.A; // ok + const e1: X.Foo | boolean = Z.Foo.A; // not legal, Z is computed + ~~ +!!! error TS2322: Type 'Foo' is not assignable to type 'boolean | Foo'. + const e2: X.Foo.A | X.Foo.B | boolean = Z.Foo.A; // still not legal + ~~ +!!! error TS2322: Type 'Foo' is not assignable to type 'boolean | Foo'. + const e3: X.Foo.B | boolean = Z.Foo.A; // not legal + ~~ +!!! error TS2322: Type 'Foo' is not assignable to type 'boolean | Foo.B'. + const e4: X.Foo.A | boolean = Z.Foo.A; // not legal either because Z.Foo is computed and Z.Foo.A is not necessarily assignable to X.Foo.A + ~~ +!!! error TS2322: Type 'Foo' is not assignable to type 'boolean | Foo.A'. + const e5: Ka.Foo | boolean = Z.Foo.A; // ok + \ No newline at end of file diff --git a/tests/baselines/reference/enumLiteralAssignableToEnumInsideUnion.js b/tests/baselines/reference/enumLiteralAssignableToEnumInsideUnion.js new file mode 100644 index 00000000000..8786745a504 --- /dev/null +++ b/tests/baselines/reference/enumLiteralAssignableToEnumInsideUnion.js @@ -0,0 +1,70 @@ +//// [enumLiteralAssignableToEnumInsideUnion.ts] +module X { + export enum Foo { + A, B + } +} +module Y { + export enum Foo { + A, B + } +} +module Z { + export enum Foo { + A = 1 << 1, + B = 1 << 2, + } +} +module Ka { + export enum Foo { + A = 1 << 10, + B = 1 << 11, + } +} +const e0: X.Foo | boolean = Y.Foo.A; // ok +const e1: X.Foo | boolean = Z.Foo.A; // not legal, Z is computed +const e2: X.Foo.A | X.Foo.B | boolean = Z.Foo.A; // still not legal +const e3: X.Foo.B | boolean = Z.Foo.A; // not legal +const e4: X.Foo.A | boolean = Z.Foo.A; // not legal either because Z.Foo is computed and Z.Foo.A is not necessarily assignable to X.Foo.A +const e5: Ka.Foo | boolean = Z.Foo.A; // ok + + +//// [enumLiteralAssignableToEnumInsideUnion.js] +var X; +(function (X) { + (function (Foo) { + Foo[Foo["A"] = 0] = "A"; + Foo[Foo["B"] = 1] = "B"; + })(X.Foo || (X.Foo = {})); + var Foo = X.Foo; +})(X || (X = {})); +var Y; +(function (Y) { + (function (Foo) { + Foo[Foo["A"] = 0] = "A"; + Foo[Foo["B"] = 1] = "B"; + })(Y.Foo || (Y.Foo = {})); + var Foo = Y.Foo; +})(Y || (Y = {})); +var Z; +(function (Z) { + (function (Foo) { + Foo[Foo["A"] = 2] = "A"; + Foo[Foo["B"] = 4] = "B"; + })(Z.Foo || (Z.Foo = {})); + var Foo = Z.Foo; +})(Z || (Z = {})); +var Ka; +(function (Ka) { + (function (Foo) { + Foo[Foo["A"] = 1024] = "A"; + Foo[Foo["B"] = 2048] = "B"; + })(Ka.Foo || (Ka.Foo = {})); + var Foo = Ka.Foo; +})(Ka || (Ka = {})); +var e0 = Y.Foo.A; // ok +var e1 = Z.Foo.A; // not legal, Z is computed +var e2 = Z.Foo.A; // still not legal +var e3 = Z.Foo.A; // not legal +var e4 = Z.Foo.A; // not legal either because Z.Foo is computed and Z.Foo.A is not necessarily assignable to X.Foo.A +var e5 = Z.Foo.A; // ok diff --git a/tests/baselines/reference/enumLiteralTypes1.types b/tests/baselines/reference/enumLiteralTypes1.types index 1fe3c8dd637..754574f547c 100644 --- a/tests/baselines/reference/enumLiteralTypes1.types +++ b/tests/baselines/reference/enumLiteralTypes1.types @@ -1,9 +1,9 @@ === tests/cases/conformance/types/literal/enumLiteralTypes1.ts === const enum Choice { Unknown, Yes, No }; >Choice : Choice ->Unknown : Choice ->Yes : Choice ->No : Choice +>Unknown : Choice.Unknown +>Yes : Choice.Yes +>No : Choice.No type YesNo = Choice.Yes | Choice.No; >YesNo : YesNo @@ -284,11 +284,11 @@ function assertNever(x: never): never { throw new Error("Unexpected value"); >new Error("Unexpected value") : Error >Error : ErrorConstructor ->"Unexpected value" : string +>"Unexpected value" : "Unexpected value" } function f10(x: YesNo) { ->f10 : (x: YesNo) => string +>f10 : (x: YesNo) => "true" | "false" >x : YesNo >YesNo : YesNo @@ -299,18 +299,18 @@ function f10(x: YesNo) { >Choice.Yes : Choice.Yes >Choice : typeof Choice >Yes : Choice.Yes ->"true" : string +>"true" : "true" case Choice.No: return "false"; >Choice.No : Choice.No >Choice : typeof Choice >No : Choice.No ->"false" : string +>"false" : "false" } } function f11(x: YesNo) { ->f11 : (x: YesNo) => string +>f11 : (x: YesNo) => "true" | "false" >x : YesNo >YesNo : YesNo @@ -321,13 +321,13 @@ function f11(x: YesNo) { >Choice.Yes : Choice.Yes >Choice : typeof Choice >Yes : Choice.Yes ->"true" : string +>"true" : "true" case Choice.No: return "false"; >Choice.No : Choice.No >Choice : typeof Choice >No : Choice.No ->"false" : string +>"false" : "false" } return assertNever(x); >assertNever(x) : never diff --git a/tests/baselines/reference/enumLiteralTypes2.types b/tests/baselines/reference/enumLiteralTypes2.types index 36390865aec..e27410a4dc7 100644 --- a/tests/baselines/reference/enumLiteralTypes2.types +++ b/tests/baselines/reference/enumLiteralTypes2.types @@ -2,9 +2,9 @@ const enum Choice { Unknown, Yes, No }; >Choice : Choice ->Unknown : Choice ->Yes : Choice ->No : Choice +>Unknown : Choice.Unknown +>Yes : Choice.Yes +>No : Choice.No type YesNo = Choice.Yes | Choice.No; >YesNo : YesNo @@ -285,11 +285,11 @@ function assertNever(x: never): never { throw new Error("Unexpected value"); >new Error("Unexpected value") : Error >Error : ErrorConstructor ->"Unexpected value" : string +>"Unexpected value" : "Unexpected value" } function f10(x: YesNo) { ->f10 : (x: YesNo) => string +>f10 : (x: YesNo) => "true" | "false" >x : YesNo >YesNo : YesNo @@ -300,18 +300,18 @@ function f10(x: YesNo) { >Choice.Yes : Choice.Yes >Choice : typeof Choice >Yes : Choice.Yes ->"true" : string +>"true" : "true" case Choice.No: return "false"; >Choice.No : Choice.No >Choice : typeof Choice >No : Choice.No ->"false" : string +>"false" : "false" } } function f11(x: YesNo) { ->f11 : (x: YesNo) => string +>f11 : (x: YesNo) => "true" | "false" >x : YesNo >YesNo : YesNo @@ -322,13 +322,13 @@ function f11(x: YesNo) { >Choice.Yes : Choice.Yes >Choice : typeof Choice >Yes : Choice.Yes ->"true" : string +>"true" : "true" case Choice.No: return "false"; >Choice.No : Choice.No >Choice : typeof Choice >No : Choice.No ->"false" : string +>"false" : "false" } return assertNever(x); >assertNever(x) : never diff --git a/tests/baselines/reference/enumMapBackIntoItself.types b/tests/baselines/reference/enumMapBackIntoItself.types index ab26094512b..964f97061a1 100644 --- a/tests/baselines/reference/enumMapBackIntoItself.types +++ b/tests/baselines/reference/enumMapBackIntoItself.types @@ -3,29 +3,29 @@ enum TShirtSize { >TShirtSize : TShirtSize Small, ->Small : TShirtSize +>Small : TShirtSize.Small Medium, ->Medium : TShirtSize +>Medium : TShirtSize.Medium Large ->Large : TShirtSize +>Large : TShirtSize.Large } var mySize = TShirtSize.Large; >mySize : TShirtSize ->TShirtSize.Large : TShirtSize +>TShirtSize.Large : TShirtSize.Large >TShirtSize : typeof TShirtSize ->Large : TShirtSize +>Large : TShirtSize.Large var test = TShirtSize[mySize]; >test : string >TShirtSize[mySize] : string >TShirtSize : typeof TShirtSize ->mySize : TShirtSize +>mySize : TShirtSize.Large // specifically checking output here, bug was that test used to be undefined at runtime test + '' >test + '' : string >test : string ->'' : string +>'' : "" diff --git a/tests/baselines/reference/enumMerging.types b/tests/baselines/reference/enumMerging.types index 1ca284702c5..a70284c80ea 100644 --- a/tests/baselines/reference/enumMerging.types +++ b/tests/baselines/reference/enumMerging.types @@ -8,66 +8,66 @@ module M1 { >EImpl1 : EImpl1 A, B, C ->A : EImpl1 ->B : EImpl1 ->C : EImpl1 +>A : EImpl1.A +>B : EImpl1.B +>C : EImpl1.C } enum EImpl1 { >EImpl1 : EImpl1 D = 1, E, F ->D : EImpl1 ->1 : number ->E : EImpl1 ->F : EImpl1 +>D : EImpl1.B +>1 : 1 +>E : EImpl1.C +>F : EImpl1.F } export enum EConst1 { >EConst1 : EConst1 A = 3, B = 2, C = 1 ->A : EConst1 ->3 : number ->B : EConst1 ->2 : number ->C : EConst1 ->1 : number +>A : EConst1.A +>3 : 3 +>B : EConst1.B +>2 : 2 +>C : EConst1.C +>1 : 1 } export enum EConst1 { >EConst1 : EConst1 D = 7, E = 9, F = 8 ->D : EConst1 ->7 : number ->E : EConst1 ->9 : number ->F : EConst1 ->8 : number +>D : EConst1.D +>7 : 7 +>E : EConst1.E +>9 : 9 +>F : EConst1.F +>8 : 8 } var x = [EConst1.A, EConst1.B, EConst1.C, EConst1.D, EConst1.E, EConst1.F]; >x : EConst1[] >[EConst1.A, EConst1.B, EConst1.C, EConst1.D, EConst1.E, EConst1.F] : EConst1[] ->EConst1.A : EConst1 +>EConst1.A : EConst1.A >EConst1 : typeof EConst1 ->A : EConst1 ->EConst1.B : EConst1 +>A : EConst1.A +>EConst1.B : EConst1.B >EConst1 : typeof EConst1 ->B : EConst1 ->EConst1.C : EConst1 +>B : EConst1.B +>EConst1.C : EConst1.C >EConst1 : typeof EConst1 ->C : EConst1 ->EConst1.D : EConst1 +>C : EConst1.C +>EConst1.D : EConst1.D >EConst1 : typeof EConst1 ->D : EConst1 ->EConst1.E : EConst1 +>D : EConst1.D +>EConst1.E : EConst1.E >EConst1 : typeof EConst1 ->E : EConst1 ->EConst1.F : EConst1 +>E : EConst1.E +>EConst1.F : EConst1.F >EConst1 : typeof EConst1 ->F : EConst1 +>F : EConst1.F } // Enum with only computed members across 2 declarations with the same root module @@ -80,15 +80,15 @@ module M2 { A = 'foo'.length, B = 'foo'.length, C = 'foo'.length >A : EComp2 >'foo'.length : number ->'foo' : string +>'foo' : "foo" >length : number >B : EComp2 >'foo'.length : number ->'foo' : string +>'foo' : "foo" >length : number >C : EComp2 >'foo'.length : number ->'foo' : string +>'foo' : "foo" >length : number } @@ -98,15 +98,15 @@ module M2 { D = 'foo'.length, E = 'foo'.length, F = 'foo'.length >D : EComp2 >'foo'.length : number ->'foo' : string +>'foo' : "foo" >length : number >E : EComp2 >'foo'.length : number ->'foo' : string +>'foo' : "foo" >length : number >F : EComp2 >'foo'.length : number ->'foo' : string +>'foo' : "foo" >length : number } @@ -141,20 +141,20 @@ module M3 { >EInit : EInit A, ->A : EInit +>A : EInit.A B ->B : EInit +>B : EInit.B } enum EInit { >EInit : EInit C = 1, D, E ->C : EInit ->1 : number ->D : EInit ->E : EInit +>C : EInit.B +>1 : 1 +>D : EInit.D +>E : EInit.E } } @@ -164,18 +164,18 @@ module M4 { export enum Color { Red, Green, Blue } >Color : Color ->Red : Color ->Green : Color ->Blue : Color +>Red : Color.Red +>Green : Color.Green +>Blue : Color.Blue } module M5 { >M5 : typeof M5 export enum Color { Red, Green, Blue } >Color : Color ->Red : Color ->Green : Color ->Blue : Color +>Red : Color.Red +>Green : Color.Green +>Blue : Color.Blue } module M6.A { @@ -184,9 +184,9 @@ module M6.A { export enum Color { Red, Green, Blue } >Color : Color ->Red : Color ->Green : Color ->Blue : Color +>Red : Color.Red +>Green : Color.Green +>Blue : Color.Blue } module M6 { >M6 : typeof M6 @@ -196,16 +196,16 @@ module M6 { export enum Color { Yellow = 1 } >Color : Color ->Yellow : Color ->1 : number +>Yellow : Color.Green +>1 : 1 } var t = A.Color.Yellow; >t : A.Color ->A.Color.Yellow : A.Color +>A.Color.Yellow : A.Color.Green >A.Color : typeof A.Color >A : typeof A >Color : typeof A.Color ->Yellow : A.Color +>Yellow : A.Color.Green t = A.Color.Red; >t = A.Color.Red : A.Color.Red diff --git a/tests/baselines/reference/enumNegativeLiteral1.types b/tests/baselines/reference/enumNegativeLiteral1.types index 31ecbc11aa2..491e5b4b088 100644 --- a/tests/baselines/reference/enumNegativeLiteral1.types +++ b/tests/baselines/reference/enumNegativeLiteral1.types @@ -3,10 +3,10 @@ enum E { >E : E a = -5, b, c ->a : E ->-5 : number ->5 : number ->b : E ->c : E +>a : E.a +>-5 : -5 +>5 : 5 +>b : E.b +>c : E.c } diff --git a/tests/baselines/reference/enumNumbering1.types b/tests/baselines/reference/enumNumbering1.types index 81bb0325b7a..25f7225b96d 100644 --- a/tests/baselines/reference/enumNumbering1.types +++ b/tests/baselines/reference/enumNumbering1.types @@ -19,11 +19,11 @@ enum Test { >Math.random : () => number >Math : Math >random : () => number ->1000 : number +>1000 : 1000 D = 10, >D : Test ->10 : number +>10 : 10 E // Error but shouldn't be >E : Test diff --git a/tests/baselines/reference/enumOperations.types b/tests/baselines/reference/enumOperations.types index 232ecc5e71b..136d76558b2 100644 --- a/tests/baselines/reference/enumOperations.types +++ b/tests/baselines/reference/enumOperations.types @@ -2,7 +2,7 @@ enum Enum { None = 0 } >Enum : Enum >None : Enum ->0 : number +>0 : 0 var enumType: Enum = Enum.None; >enumType : Enum @@ -13,11 +13,11 @@ var enumType: Enum = Enum.None; var numberType: number = 0; >numberType : number ->0 : number +>0 : 0 var anyType: any = 0; >anyType : any ->0 : number +>0 : 0 enumType ^ numberType; >enumType ^ numberType : number diff --git a/tests/baselines/reference/enumPropertyAccess.errors.txt b/tests/baselines/reference/enumPropertyAccess.errors.txt index 666e9297120..fe670a3ef31 100644 --- a/tests/baselines/reference/enumPropertyAccess.errors.txt +++ b/tests/baselines/reference/enumPropertyAccess.errors.txt @@ -1,4 +1,4 @@ -tests/cases/compiler/enumPropertyAccess.ts(7,11): error TS2339: Property 'Green' does not exist on type 'Colors'. +tests/cases/compiler/enumPropertyAccess.ts(7,11): error TS2339: Property 'Green' does not exist on type 'Colors.Red'. tests/cases/compiler/enumPropertyAccess.ts(12,7): error TS2339: Property 'Green' does not exist on type 'B'. @@ -11,7 +11,7 @@ tests/cases/compiler/enumPropertyAccess.ts(12,7): error TS2339: Property 'Green' var x = Colors.Red; // type of 'x' should be 'Colors' var p = x.Green; // error ~~~~~ -!!! error TS2339: Property 'Green' does not exist on type 'Colors'. +!!! error TS2339: Property 'Green' does not exist on type 'Colors.Red'. x.toFixed(); // ok // Now with generics diff --git a/tests/baselines/reference/enumWithInfinityProperty.js b/tests/baselines/reference/enumWithInfinityProperty.js new file mode 100644 index 00000000000..2ab45fbd9be --- /dev/null +++ b/tests/baselines/reference/enumWithInfinityProperty.js @@ -0,0 +1,11 @@ +//// [enumWithInfinityProperty.ts] +enum A { + Infinity = 1 +} + + +//// [enumWithInfinityProperty.js] +var A; +(function (A) { + A[A["Infinity"] = 1] = "Infinity"; +})(A || (A = {})); diff --git a/tests/baselines/reference/enumWithInfinityProperty.symbols b/tests/baselines/reference/enumWithInfinityProperty.symbols new file mode 100644 index 00000000000..50b505ce262 --- /dev/null +++ b/tests/baselines/reference/enumWithInfinityProperty.symbols @@ -0,0 +1,8 @@ +=== tests/cases/compiler/enumWithInfinityProperty.ts === +enum A { +>A : Symbol(A, Decl(enumWithInfinityProperty.ts, 0, 0)) + + Infinity = 1 +>Infinity : Symbol(A.Infinity, Decl(enumWithInfinityProperty.ts, 0, 8)) +} + diff --git a/tests/baselines/reference/enumWithInfinityProperty.types b/tests/baselines/reference/enumWithInfinityProperty.types new file mode 100644 index 00000000000..664aa5ea2d5 --- /dev/null +++ b/tests/baselines/reference/enumWithInfinityProperty.types @@ -0,0 +1,9 @@ +=== tests/cases/compiler/enumWithInfinityProperty.ts === +enum A { +>A : A + + Infinity = 1 +>Infinity : A +>1 : 1 +} + diff --git a/tests/baselines/reference/enumWithNaNProperty.js b/tests/baselines/reference/enumWithNaNProperty.js new file mode 100644 index 00000000000..ad3e5f3a7f2 --- /dev/null +++ b/tests/baselines/reference/enumWithNaNProperty.js @@ -0,0 +1,11 @@ +//// [enumWithNaNProperty.ts] +enum A { + NaN = 1 +} + + +//// [enumWithNaNProperty.js] +var A; +(function (A) { + A[A["NaN"] = 1] = "NaN"; +})(A || (A = {})); diff --git a/tests/baselines/reference/enumWithNaNProperty.symbols b/tests/baselines/reference/enumWithNaNProperty.symbols new file mode 100644 index 00000000000..a327d74b17c --- /dev/null +++ b/tests/baselines/reference/enumWithNaNProperty.symbols @@ -0,0 +1,8 @@ +=== tests/cases/compiler/enumWithNaNProperty.ts === +enum A { +>A : Symbol(A, Decl(enumWithNaNProperty.ts, 0, 0)) + + NaN = 1 +>NaN : Symbol(A.NaN, Decl(enumWithNaNProperty.ts, 0, 8)) +} + diff --git a/tests/baselines/reference/enumWithNaNProperty.types b/tests/baselines/reference/enumWithNaNProperty.types new file mode 100644 index 00000000000..710c7554a31 --- /dev/null +++ b/tests/baselines/reference/enumWithNaNProperty.types @@ -0,0 +1,9 @@ +=== tests/cases/compiler/enumWithNaNProperty.ts === +enum A { +>A : A + + NaN = 1 +>NaN : A +>1 : 1 +} + diff --git a/tests/baselines/reference/enumWithNegativeInfinityProperty.js b/tests/baselines/reference/enumWithNegativeInfinityProperty.js new file mode 100644 index 00000000000..867545fb14a --- /dev/null +++ b/tests/baselines/reference/enumWithNegativeInfinityProperty.js @@ -0,0 +1,11 @@ +//// [enumWithNegativeInfinityProperty.ts] +enum A { + "-Infinity" = 1 +} + + +//// [enumWithNegativeInfinityProperty.js] +var A; +(function (A) { + A[A["-Infinity"] = 1] = "-Infinity"; +})(A || (A = {})); diff --git a/tests/baselines/reference/enumWithNegativeInfinityProperty.symbols b/tests/baselines/reference/enumWithNegativeInfinityProperty.symbols new file mode 100644 index 00000000000..51c61196ca6 --- /dev/null +++ b/tests/baselines/reference/enumWithNegativeInfinityProperty.symbols @@ -0,0 +1,7 @@ +=== tests/cases/compiler/enumWithNegativeInfinityProperty.ts === +enum A { +>A : Symbol(A, Decl(enumWithNegativeInfinityProperty.ts, 0, 0)) + + "-Infinity" = 1 +} + diff --git a/tests/baselines/reference/enumWithNegativeInfinityProperty.types b/tests/baselines/reference/enumWithNegativeInfinityProperty.types new file mode 100644 index 00000000000..dad61ad87cc --- /dev/null +++ b/tests/baselines/reference/enumWithNegativeInfinityProperty.types @@ -0,0 +1,8 @@ +=== tests/cases/compiler/enumWithNegativeInfinityProperty.ts === +enum A { +>A : A + + "-Infinity" = 1 +>1 : 1 +} + diff --git a/tests/baselines/reference/enumWithoutInitializerAfterComputedMember.types b/tests/baselines/reference/enumWithoutInitializerAfterComputedMember.types index 0ece7b76f1e..c558000f756 100644 --- a/tests/baselines/reference/enumWithoutInitializerAfterComputedMember.types +++ b/tests/baselines/reference/enumWithoutInitializerAfterComputedMember.types @@ -3,12 +3,12 @@ enum E { >E : E a, ->a : E +>a : E.a b = a, ->b : E ->a : E +>b : E.a +>a : E.a c ->c : E +>c : E.c } diff --git a/tests/baselines/reference/equalityWithUnionTypes01.types b/tests/baselines/reference/equalityWithUnionTypes01.types index 61e38030949..acec449dc42 100644 --- a/tests/baselines/reference/equalityWithUnionTypes01.types +++ b/tests/baselines/reference/equalityWithUnionTypes01.types @@ -18,9 +18,9 @@ var x = { p1: 10, p2: 20 }; >x : { p1: number; p2: number; } >{ p1: 10, p2: 20 } : { p1: number; p2: number; } >p1 : number ->10 : number +>10 : 10 >p2 : number ->20 : number +>20 : 20 var y: number | I2 = x; >y : number | I2 diff --git a/tests/baselines/reference/errorsOnImportedSymbol.errors.txt b/tests/baselines/reference/errorsOnImportedSymbol.errors.txt index 19839e4e544..127026a8e2c 100644 --- a/tests/baselines/reference/errorsOnImportedSymbol.errors.txt +++ b/tests/baselines/reference/errorsOnImportedSymbol.errors.txt @@ -1,15 +1,15 @@ -tests/cases/compiler/errorsOnImportedSymbol_1.ts(2,13): error TS2304: Cannot find name 'Sammy'. -tests/cases/compiler/errorsOnImportedSymbol_1.ts(3,9): error TS2304: Cannot find name 'Sammy'. +tests/cases/compiler/errorsOnImportedSymbol_1.ts(2,13): error TS2693: 'Sammy' only refers to a type, but is being used as a value here. +tests/cases/compiler/errorsOnImportedSymbol_1.ts(3,9): error TS2693: 'Sammy' only refers to a type, but is being used as a value here. ==== tests/cases/compiler/errorsOnImportedSymbol_1.ts (2 errors) ==== import Sammy = require("./errorsOnImportedSymbol_0"); var x = new Sammy.Sammy(); ~~~~~ -!!! error TS2304: Cannot find name 'Sammy'. +!!! error TS2693: 'Sammy' only refers to a type, but is being used as a value here. var y = Sammy.Sammy(); ~~~~~ -!!! error TS2304: Cannot find name 'Sammy'. +!!! error TS2693: 'Sammy' only refers to a type, but is being used as a value here. ==== tests/cases/compiler/errorsOnImportedSymbol_0.ts (0 errors) ==== diff --git a/tests/baselines/reference/es2015modulekind.types b/tests/baselines/reference/es2015modulekind.types index e77cf095aed..1b09ecb0a88 100644 --- a/tests/baselines/reference/es2015modulekind.types +++ b/tests/baselines/reference/es2015modulekind.types @@ -12,6 +12,6 @@ export default class A >B : () => number { return 42; ->42 : number +>42 : 42 } } diff --git a/tests/baselines/reference/es2015modulekindWithES6Target.types b/tests/baselines/reference/es2015modulekindWithES6Target.types index 50b85921b0e..4872566b1c2 100644 --- a/tests/baselines/reference/es2015modulekindWithES6Target.types +++ b/tests/baselines/reference/es2015modulekindWithES6Target.types @@ -12,6 +12,6 @@ export default class A >B : () => number { return 42; ->42 : number +>42 : 42 } } diff --git a/tests/baselines/reference/es3-amd.types b/tests/baselines/reference/es3-amd.types index 1e9fdbd582f..420354f364a 100644 --- a/tests/baselines/reference/es3-amd.types +++ b/tests/baselines/reference/es3-amd.types @@ -12,6 +12,6 @@ class A >B : () => number { return 42; ->42 : number +>42 : 42 } } diff --git a/tests/baselines/reference/es3-declaration-amd.types b/tests/baselines/reference/es3-declaration-amd.types index daf0bb5d74e..c174d8d0255 100644 --- a/tests/baselines/reference/es3-declaration-amd.types +++ b/tests/baselines/reference/es3-declaration-amd.types @@ -12,6 +12,6 @@ class A >B : () => number { return 42; ->42 : number +>42 : 42 } } diff --git a/tests/baselines/reference/es3-sourcemap-amd.types b/tests/baselines/reference/es3-sourcemap-amd.types index d3f712211e4..351cbe5ded9 100644 --- a/tests/baselines/reference/es3-sourcemap-amd.types +++ b/tests/baselines/reference/es3-sourcemap-amd.types @@ -12,6 +12,6 @@ class A >B : () => number { return 42; ->42 : number +>42 : 42 } } diff --git a/tests/baselines/reference/es3defaultAliasIsQuoted.types b/tests/baselines/reference/es3defaultAliasIsQuoted.types index 59ce62dff1e..b0412359660 100644 --- a/tests/baselines/reference/es3defaultAliasIsQuoted.types +++ b/tests/baselines/reference/es3defaultAliasIsQuoted.types @@ -5,7 +5,7 @@ export class Foo { static CONSTANT = "Foo"; >CONSTANT : string ->"Foo" : string +>"Foo" : "Foo" } export default function assert(value: boolean) { @@ -17,7 +17,7 @@ export default function assert(value: boolean) { >value : boolean >new Error("Assertion failed!") : Error >Error : ErrorConstructor ->"Assertion failed!" : string +>"Assertion failed!" : "Assertion failed!" } === tests/cases/compiler/es3defaultAliasQuoted_file1.ts === diff --git a/tests/baselines/reference/es5-amd.types b/tests/baselines/reference/es5-amd.types index 7dd9e8b281a..62e47b91d10 100644 --- a/tests/baselines/reference/es5-amd.types +++ b/tests/baselines/reference/es5-amd.types @@ -12,6 +12,6 @@ class A >B : () => number { return 42; ->42 : number +>42 : 42 } } diff --git a/tests/baselines/reference/es5-asyncFunction.js b/tests/baselines/reference/es5-asyncFunction.js index 9cb6f1d3674..d6cd770e454 100644 --- a/tests/baselines/reference/es5-asyncFunction.js +++ b/tests/baselines/reference/es5-asyncFunction.js @@ -18,41 +18,31 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge }); }; var __generator = (this && this.__generator) || function (thisArg, body) { - var _ = { label: 0, sent: function() { if (sent[0] === 1) throw sent[1]; return sent[1]; }, trys: [], stack: [] }, sent, f; + var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t; + return { next: verb(0), "throw": verb(1), "return": verb(2) }; + function verb(n) { return function (v) { return step([n, v]); }; } function step(op) { if (f) throw new TypeError("Generator is already executing."); - while (1) { - if (_.done) switch (op[0]) { - case 0: return { value: void 0, done: true }; - case 1: case 6: throw op[1]; - case 2: return { value: op[1], done: true }; + while (_) try { + if (f = 1, y && (t = y[op[0] & 2 ? "return" : op[0] ? "throw" : "next"]) && !(t = t.call(y, op[1])).done) return t; + if (y = 0, t) op = [0, t.value]; + switch (op[0]) { + case 0: case 1: t = op; break; + case 4: _.label++; return { value: op[1], done: false }; + case 5: _.label++; y = op[1]; op = [0]; continue; + case 7: op = _.ops.pop(); _.trys.pop(); continue; + default: + if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } + if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } + if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } + if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } + if (t[2]) _.ops.pop(); + _.trys.pop(); continue; } - try { - switch (f = 1, op[0]) { - case 0: case 1: sent = op; break; - case 4: return _.label++, { value: op[1], done: false }; - case 7: op = _.stack.pop(), _.trys.pop(); continue; - default: - var r = _.trys.length > 0 && _.trys[_.trys.length - 1]; - if (!r && (op[0] === 6 || op[0] === 2)) { _.done = 1; continue; } - if (op[0] === 3 && (!r || (op[1] > r[0] && op[1] < r[3]))) { _.label = op[1]; break; } - if (op[0] === 6 && _.label < r[1]) { _.label = r[1], sent = op; break; } - if (r && _.label < r[2]) { _.label = r[2], _.stack.push(op); break; } - if (r[2]) { _.stack.pop(); } - _.trys.pop(); - continue; - } - op = body.call(thisArg, _); - } - catch (e) { op = [6, e]; } - finally { f = 0, sent = void 0; } - } + op = body.call(thisArg, _); + } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } + if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; } - return { - next: function (v) { return step([0, v]); }, - "throw": function (v) { return step([1, v]); }, - "return": function (v) { return step([2, v]); } - }; }; function empty() { return __awaiter(this, void 0, void 0, function () { diff --git a/tests/baselines/reference/es5-asyncFunctionDoStatements.types b/tests/baselines/reference/es5-asyncFunctionDoStatements.types index cfec3eebcfb..811c3cae02a 100644 --- a/tests/baselines/reference/es5-asyncFunctionDoStatements.types +++ b/tests/baselines/reference/es5-asyncFunctionDoStatements.types @@ -53,7 +53,7 @@ async function doStatement5() { >doStatement5 : () => Promise do { if (1) continue; await x; } while (y); ->1 : number +>1 : 1 >await x : any >x : any >y : any @@ -92,7 +92,7 @@ async function doStatement9() { C: do { if (1) continue C; await x; } while (y); >C : any ->1 : number +>1 : 1 >C : any >await x : any >x : any @@ -129,7 +129,7 @@ async function doStatement13() { >doStatement13 : () => Promise do { if (1) break; await x; } while (y); ->1 : number +>1 : 1 >await x : any >x : any >y : any @@ -168,7 +168,7 @@ async function doStatement17() { G: do { if (1) break G; await x; } while (y); >G : any ->1 : number +>1 : 1 >G : any >await x : any >x : any diff --git a/tests/baselines/reference/es5-asyncFunctionHoisting.types b/tests/baselines/reference/es5-asyncFunctionHoisting.types index 04b968c571d..933f4fc5c30 100644 --- a/tests/baselines/reference/es5-asyncFunctionHoisting.types +++ b/tests/baselines/reference/es5-asyncFunctionHoisting.types @@ -8,7 +8,7 @@ async function hoisting() { var a0, a1 = 1; >a0 : any >a1 : number ->1 : number +>1 : 1 function z() { >z : () => void @@ -16,21 +16,21 @@ async function hoisting() { var b0, b1 = 1; >b0 : any >b1 : number ->1 : number +>1 : 1 } if (true) { ->true : boolean +>true : true var c0, c1 = 1; >c0 : any >c1 : number ->1 : number +>1 : 1 } for (var a = 0; y;) { >a : number ->0 : number +>0 : 0 >y : any } @@ -54,7 +54,7 @@ async function hoistingWithAwait() { var a0, a1 = 1; >a0 : any >a1 : number ->1 : number +>1 : 1 function z() { >z : () => void @@ -62,25 +62,25 @@ async function hoistingWithAwait() { var b0, b1 = 1; >b0 : any >b1 : number ->1 : number +>1 : 1 } await 0; ->await 0 : number ->0 : number +>await 0 : 0 +>0 : 0 if (true) { ->true : boolean +>true : true var c0, c1 = 1; >c0 : any >c1 : number ->1 : number +>1 : 1 } for (var a = 0; y;) { >a : number ->0 : number +>0 : 0 >y : any } diff --git a/tests/baselines/reference/es5-asyncFunctionWhileStatements.types b/tests/baselines/reference/es5-asyncFunctionWhileStatements.types index 2410befa043..5148543bf34 100644 --- a/tests/baselines/reference/es5-asyncFunctionWhileStatements.types +++ b/tests/baselines/reference/es5-asyncFunctionWhileStatements.types @@ -62,7 +62,7 @@ async function whileStatement6() { while (x) { if (1) continue; await y; } >x : any ->1 : number +>1 : 1 >await y : any >y : any } @@ -103,7 +103,7 @@ async function whileStatement10() { D: while (x) { if (1) continue D; await y; } >D : any >x : any ->1 : number +>1 : 1 >D : any >await y : any >y : any @@ -138,7 +138,7 @@ async function whileStatement14() { while (x) { if (1) break; await y; } >x : any ->1 : number +>1 : 1 >await y : any >y : any } @@ -179,7 +179,7 @@ async function whileStatement18() { H: while (x) { if (1) break H; await y; } >H : any >x : any ->1 : number +>1 : 1 >H : any >await y : any >y : any diff --git a/tests/baselines/reference/es5-commonjs.types b/tests/baselines/reference/es5-commonjs.types index 4c1bc922917..06a14af7f4f 100644 --- a/tests/baselines/reference/es5-commonjs.types +++ b/tests/baselines/reference/es5-commonjs.types @@ -12,7 +12,7 @@ export default class A >B : () => number { return 42; ->42 : number +>42 : 42 } } diff --git a/tests/baselines/reference/es5-commonjs3.types b/tests/baselines/reference/es5-commonjs3.types index facdfae00ce..6f6b9c3e499 100644 --- a/tests/baselines/reference/es5-commonjs3.types +++ b/tests/baselines/reference/es5-commonjs3.types @@ -3,5 +3,5 @@ export default "test"; export var __esModule = 1; >__esModule : number ->1 : number +>1 : 1 diff --git a/tests/baselines/reference/es5-commonjs4.types b/tests/baselines/reference/es5-commonjs4.types index d3471afbfeb..fedfe9390a2 100644 --- a/tests/baselines/reference/es5-commonjs4.types +++ b/tests/baselines/reference/es5-commonjs4.types @@ -12,10 +12,10 @@ export default class A >B : () => number { return 42; ->42 : number +>42 : 42 } } export var __esModule = 1; >__esModule : number ->1 : number +>1 : 1 diff --git a/tests/baselines/reference/es5-commonjs5.types b/tests/baselines/reference/es5-commonjs5.types index d8094e1e0ea..fb72fda8c11 100644 --- a/tests/baselines/reference/es5-commonjs5.types +++ b/tests/baselines/reference/es5-commonjs5.types @@ -2,6 +2,6 @@ export default function () { return "test"; ->"test" : string +>"test" : "test" } diff --git a/tests/baselines/reference/es5-commonjs6.types b/tests/baselines/reference/es5-commonjs6.types index 904b69dec22..cabe84e8a69 100644 --- a/tests/baselines/reference/es5-commonjs6.types +++ b/tests/baselines/reference/es5-commonjs6.types @@ -3,5 +3,5 @@ export default "test"; var __esModule = 1; >__esModule : number ->1 : number +>1 : 1 diff --git a/tests/baselines/reference/es5-declaration-amd.types b/tests/baselines/reference/es5-declaration-amd.types index ead96c35de1..ca5422fd739 100644 --- a/tests/baselines/reference/es5-declaration-amd.types +++ b/tests/baselines/reference/es5-declaration-amd.types @@ -12,6 +12,6 @@ class A >B : () => number { return 42; ->42 : number +>42 : 42 } } diff --git a/tests/baselines/reference/es5-importHelpersAsyncFunctions.js b/tests/baselines/reference/es5-importHelpersAsyncFunctions.js index 0fcd8897018..6c9a16b546f 100644 --- a/tests/baselines/reference/es5-importHelpersAsyncFunctions.js +++ b/tests/baselines/reference/es5-importHelpersAsyncFunctions.js @@ -38,41 +38,31 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge }); }; var __generator = (this && this.__generator) || function (thisArg, body) { - var _ = { label: 0, sent: function() { if (sent[0] === 1) throw sent[1]; return sent[1]; }, trys: [], stack: [] }, sent, f; + var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t; + return { next: verb(0), "throw": verb(1), "return": verb(2) }; + function verb(n) { return function (v) { return step([n, v]); }; } function step(op) { if (f) throw new TypeError("Generator is already executing."); - while (1) { - if (_.done) switch (op[0]) { - case 0: return { value: void 0, done: true }; - case 1: case 6: throw op[1]; - case 2: return { value: op[1], done: true }; + while (_) try { + if (f = 1, y && (t = y[op[0] & 2 ? "return" : op[0] ? "throw" : "next"]) && !(t = t.call(y, op[1])).done) return t; + if (y = 0, t) op = [0, t.value]; + switch (op[0]) { + case 0: case 1: t = op; break; + case 4: _.label++; return { value: op[1], done: false }; + case 5: _.label++; y = op[1]; op = [0]; continue; + case 7: op = _.ops.pop(); _.trys.pop(); continue; + default: + if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } + if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } + if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } + if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } + if (t[2]) _.ops.pop(); + _.trys.pop(); continue; } - try { - switch (f = 1, op[0]) { - case 0: case 1: sent = op; break; - case 4: return _.label++, { value: op[1], done: false }; - case 7: op = _.stack.pop(), _.trys.pop(); continue; - default: - var r = _.trys.length > 0 && _.trys[_.trys.length - 1]; - if (!r && (op[0] === 6 || op[0] === 2)) { _.done = 1; continue; } - if (op[0] === 3 && (!r || (op[1] > r[0] && op[1] < r[3]))) { _.label = op[1]; break; } - if (op[0] === 6 && _.label < r[1]) { _.label = r[1], sent = op; break; } - if (r && _.label < r[2]) { _.label = r[2], _.stack.push(op); break; } - if (r[2]) { _.stack.pop(); } - _.trys.pop(); - continue; - } - op = body.call(thisArg, _); - } - catch (e) { op = [6, e]; } - finally { f = 0, sent = void 0; } - } + op = body.call(thisArg, _); + } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } + if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; } - return { - next: function (v) { return step([0, v]); }, - "throw": function (v) { return step([1, v]); }, - "return": function (v) { return step([2, v]); } - }; }; function foo() { return __awaiter(this, void 0, void 0, function () { diff --git a/tests/baselines/reference/es5-souremap-amd.types b/tests/baselines/reference/es5-souremap-amd.types index 67606d7f1ff..d96f15b8d0e 100644 --- a/tests/baselines/reference/es5-souremap-amd.types +++ b/tests/baselines/reference/es5-souremap-amd.types @@ -12,6 +12,6 @@ class A >B : () => number { return 42; ->42 : number +>42 : 42 } } diff --git a/tests/baselines/reference/es5-system.types b/tests/baselines/reference/es5-system.types index eae884a78b4..fa6d471dbf7 100644 --- a/tests/baselines/reference/es5-system.types +++ b/tests/baselines/reference/es5-system.types @@ -12,7 +12,7 @@ export default class A >B : () => number { return 42; ->42 : number +>42 : 42 } } diff --git a/tests/baselines/reference/es5-umd.types b/tests/baselines/reference/es5-umd.types index 60987d429e0..dcee52664cc 100644 --- a/tests/baselines/reference/es5-umd.types +++ b/tests/baselines/reference/es5-umd.types @@ -12,7 +12,7 @@ class A >B : () => number { return 42; ->42 : number +>42 : 42 } } diff --git a/tests/baselines/reference/es5-umd2.types b/tests/baselines/reference/es5-umd2.types index fab4e9dfc01..2c24088c4a0 100644 --- a/tests/baselines/reference/es5-umd2.types +++ b/tests/baselines/reference/es5-umd2.types @@ -12,7 +12,7 @@ export class A >B : () => number { return 42; ->42 : number +>42 : 42 } } diff --git a/tests/baselines/reference/es5-umd3.types b/tests/baselines/reference/es5-umd3.types index b4b5f0dc366..bb4cc91af50 100644 --- a/tests/baselines/reference/es5-umd3.types +++ b/tests/baselines/reference/es5-umd3.types @@ -12,7 +12,7 @@ export default class A >B : () => number { return 42; ->42 : number +>42 : 42 } } diff --git a/tests/baselines/reference/es5-umd4.types b/tests/baselines/reference/es5-umd4.types index 59d23e6bd8d..4ce47c9e4de 100644 --- a/tests/baselines/reference/es5-umd4.types +++ b/tests/baselines/reference/es5-umd4.types @@ -12,7 +12,7 @@ class A >B : () => number { return 42; ->42 : number +>42 : 42 } } diff --git a/tests/baselines/reference/es5ExportDefaultExpression.types b/tests/baselines/reference/es5ExportDefaultExpression.types index 6b371a2fc73..db4d3a3abfd 100644 --- a/tests/baselines/reference/es5ExportDefaultExpression.types +++ b/tests/baselines/reference/es5ExportDefaultExpression.types @@ -3,6 +3,6 @@ export default (1 + 2); >(1 + 2) : number >1 + 2 : number ->1 : number ->2 : number +>1 : 1 +>2 : 2 diff --git a/tests/baselines/reference/es5ModuleWithModuleGenAmd.types b/tests/baselines/reference/es5ModuleWithModuleGenAmd.types index 4ae6698d06a..3d648a7777f 100644 --- a/tests/baselines/reference/es5ModuleWithModuleGenAmd.types +++ b/tests/baselines/reference/es5ModuleWithModuleGenAmd.types @@ -10,6 +10,6 @@ export class A >B : () => number { return 42; ->42 : number +>42 : 42 } } diff --git a/tests/baselines/reference/es5ModuleWithModuleGenCommonjs.types b/tests/baselines/reference/es5ModuleWithModuleGenCommonjs.types index 425afed82d2..d2dc36fdd8e 100644 --- a/tests/baselines/reference/es5ModuleWithModuleGenCommonjs.types +++ b/tests/baselines/reference/es5ModuleWithModuleGenCommonjs.types @@ -10,6 +10,6 @@ export class A >B : () => number { return 42; ->42 : number +>42 : 42 } } diff --git a/tests/baselines/reference/es5ModuleWithoutModuleGenTarget.types b/tests/baselines/reference/es5ModuleWithoutModuleGenTarget.types index 251e2be25a9..349ab719d78 100644 --- a/tests/baselines/reference/es5ModuleWithoutModuleGenTarget.types +++ b/tests/baselines/reference/es5ModuleWithoutModuleGenTarget.types @@ -10,6 +10,6 @@ export class A >B : () => number { return 42; ->42 : number +>42 : 42 } } diff --git a/tests/baselines/reference/es5andes6module.js b/tests/baselines/reference/es5andes6module.js index 148464a212a..ae8c0ad87e2 100644 --- a/tests/baselines/reference/es5andes6module.js +++ b/tests/baselines/reference/es5andes6module.js @@ -23,3 +23,4 @@ var A = (function () { }; return A; }()); +export default A; diff --git a/tests/baselines/reference/es5andes6module.types b/tests/baselines/reference/es5andes6module.types index 14423d87cea..44dba0eb28e 100644 --- a/tests/baselines/reference/es5andes6module.types +++ b/tests/baselines/reference/es5andes6module.types @@ -12,7 +12,7 @@ export default class A >B : () => number { return 42; ->42 : number +>42 : 42 } } diff --git a/tests/baselines/reference/es6-amd.types b/tests/baselines/reference/es6-amd.types index 7a6fb6e32f5..5ba03153627 100644 --- a/tests/baselines/reference/es6-amd.types +++ b/tests/baselines/reference/es6-amd.types @@ -12,6 +12,6 @@ class A >B : () => number { return 42; ->42 : number +>42 : 42 } } diff --git a/tests/baselines/reference/es6-declaration-amd.types b/tests/baselines/reference/es6-declaration-amd.types index a46d22c82c5..9568cedc0bd 100644 --- a/tests/baselines/reference/es6-declaration-amd.types +++ b/tests/baselines/reference/es6-declaration-amd.types @@ -12,6 +12,6 @@ class A >B : () => number { return 42; ->42 : number +>42 : 42 } } diff --git a/tests/baselines/reference/es6-sourcemap-amd.types b/tests/baselines/reference/es6-sourcemap-amd.types index 580a688afab..6cbdc98df6f 100644 --- a/tests/baselines/reference/es6-sourcemap-amd.types +++ b/tests/baselines/reference/es6-sourcemap-amd.types @@ -12,6 +12,6 @@ class A >B : () => number { return 42; ->42 : number +>42 : 42 } } diff --git a/tests/baselines/reference/es6-umd.types b/tests/baselines/reference/es6-umd.types index f43c491e003..ed3932d2e2a 100644 --- a/tests/baselines/reference/es6-umd.types +++ b/tests/baselines/reference/es6-umd.types @@ -12,6 +12,6 @@ class A >B : () => number { return 42; ->42 : number +>42 : 42 } } diff --git a/tests/baselines/reference/es6-umd2.types b/tests/baselines/reference/es6-umd2.types index eb66523c6ec..395f136add8 100644 --- a/tests/baselines/reference/es6-umd2.types +++ b/tests/baselines/reference/es6-umd2.types @@ -12,6 +12,6 @@ export class A >B : () => number { return 42; ->42 : number +>42 : 42 } } diff --git a/tests/baselines/reference/es6ClassSuperCodegenBug.types b/tests/baselines/reference/es6ClassSuperCodegenBug.types index 65269c99997..d98b1fea451 100644 --- a/tests/baselines/reference/es6ClassSuperCodegenBug.types +++ b/tests/baselines/reference/es6ClassSuperCodegenBug.types @@ -13,20 +13,20 @@ class B extends A { constructor() { if (true) { ->true : boolean +>true : true super('a1', 'b1'); >super('a1', 'b1') : void >super : typeof A ->'a1' : string ->'b1' : string +>'a1' : "a1" +>'b1' : "b1" } else { super('a2', 'b2'); >super('a2', 'b2') : void >super : typeof A ->'a2' : string ->'b2' : string +>'a2' : "a2" +>'b2' : "b2" } } } diff --git a/tests/baselines/reference/es6ClassTest3.types b/tests/baselines/reference/es6ClassTest3.types index 208d8cdf4d9..328589d76d6 100644 --- a/tests/baselines/reference/es6ClassTest3.types +++ b/tests/baselines/reference/es6ClassTest3.types @@ -22,18 +22,18 @@ module M { constructor() { this.x = 1; ->this.x = 1 : number +>this.x = 1 : 1 >this.x : number >this : this >x : number ->1 : number +>1 : 1 this.y = 2; ->this.y = 2 : number +>this.y = 2 : 2 >this.y : number >this : this >y : number ->2 : number +>2 : 2 } } } diff --git a/tests/baselines/reference/es6ClassTest5.types b/tests/baselines/reference/es6ClassTest5.types index 087a80170ed..7b3b69512f5 100644 --- a/tests/baselines/reference/es6ClassTest5.types +++ b/tests/baselines/reference/es6ClassTest5.types @@ -23,6 +23,6 @@ class bigClass { public break = 1; >break : number ->1 : number +>1 : 1 } diff --git a/tests/baselines/reference/es6ClassTest8.types b/tests/baselines/reference/es6ClassTest8.types index b12d65e595f..4dcfde53671 100644 --- a/tests/baselines/reference/es6ClassTest8.types +++ b/tests/baselines/reference/es6ClassTest8.types @@ -111,10 +111,10 @@ class Camera { >down : Vector >new Vector(0.0, -1.0, 0.0) : Vector >Vector : typeof Vector ->0.0 : number ->-1.0 : number ->1.0 : number ->0.0 : number +>0.0 : 0 +>-1.0 : -1 +>1.0 : 1 +>0.0 : 0 this.forward = Vector.norm(Vector.minus(lookAt,this.pos)); >this.forward = Vector.norm(Vector.minus(lookAt,this.pos)) : Vector diff --git a/tests/baselines/reference/es6ExportAll.types b/tests/baselines/reference/es6ExportAll.types index 876ff152e2c..b6a7056fd4a 100644 --- a/tests/baselines/reference/es6ExportAll.types +++ b/tests/baselines/reference/es6ExportAll.types @@ -11,11 +11,11 @@ export module m { export var x = 10; >x : number ->10 : number +>10 : 10 } export var x = 10; >x : number ->10 : number +>10 : 10 export module uninstantiated { >uninstantiated : any diff --git a/tests/baselines/reference/es6ExportAllInEs5.types b/tests/baselines/reference/es6ExportAllInEs5.types index 68187384602..fc3daf6685c 100644 --- a/tests/baselines/reference/es6ExportAllInEs5.types +++ b/tests/baselines/reference/es6ExportAllInEs5.types @@ -11,11 +11,11 @@ export module m { export var x = 10; >x : number ->10 : number +>10 : 10 } export var x = 10; >x : number ->10 : number +>10 : 10 export module uninstantiated { >uninstantiated : any diff --git a/tests/baselines/reference/es6ExportClause.types b/tests/baselines/reference/es6ExportClause.types index 5cab90d6a7f..22e5f9c0e0d 100644 --- a/tests/baselines/reference/es6ExportClause.types +++ b/tests/baselines/reference/es6ExportClause.types @@ -11,11 +11,11 @@ module m { export var x = 10; >x : number ->10 : number +>10 : 10 } var x = 10; >x : number ->10 : number +>10 : 10 module uninstantiated { >uninstantiated : any diff --git a/tests/baselines/reference/es6ExportClauseInEs5.types b/tests/baselines/reference/es6ExportClauseInEs5.types index 5cab90d6a7f..22e5f9c0e0d 100644 --- a/tests/baselines/reference/es6ExportClauseInEs5.types +++ b/tests/baselines/reference/es6ExportClauseInEs5.types @@ -11,11 +11,11 @@ module m { export var x = 10; >x : number ->10 : number +>10 : 10 } var x = 10; >x : number ->10 : number +>10 : 10 module uninstantiated { >uninstantiated : any diff --git a/tests/baselines/reference/es6ExportClauseWithAssignmentInEs5.types b/tests/baselines/reference/es6ExportClauseWithAssignmentInEs5.types index 3b6752d89db..f846063c7ef 100644 --- a/tests/baselines/reference/es6ExportClauseWithAssignmentInEs5.types +++ b/tests/baselines/reference/es6ExportClauseWithAssignmentInEs5.types @@ -2,34 +2,34 @@ var foo = 2; >foo : number ->2 : number +>2 : 2 foo = 3; ->foo = 3 : number +>foo = 3 : 3 >foo : number ->3 : number +>3 : 3 var baz = 3; >baz : number ->3 : number +>3 : 3 baz = 4; ->baz = 4 : number +>baz = 4 : 4 >baz : number ->4 : number +>4 : 4 var buzz = 10; >buzz : number ->10 : number +>10 : 10 buzz += 3; >buzz += 3 : number >buzz : number ->3 : number +>3 : 3 var bizz = 8; >bizz : number ->8 : number +>8 : 8 bizz++; // compiles to exports.bizz = bizz += 1 >bizz++ : number diff --git a/tests/baselines/reference/es6ExportClauseWithoutModuleSpecifier.types b/tests/baselines/reference/es6ExportClauseWithoutModuleSpecifier.types index 6b621f4c777..748f731f918 100644 --- a/tests/baselines/reference/es6ExportClauseWithoutModuleSpecifier.types +++ b/tests/baselines/reference/es6ExportClauseWithoutModuleSpecifier.types @@ -11,11 +11,11 @@ export module m { export var x = 10; >x : number ->10 : number +>10 : 10 } export var x = 10; >x : number ->10 : number +>10 : 10 export module uninstantiated { >uninstantiated : any diff --git a/tests/baselines/reference/es6ExportClauseWithoutModuleSpecifierInEs5.types b/tests/baselines/reference/es6ExportClauseWithoutModuleSpecifierInEs5.types index 4bd93b39031..496717c3a85 100644 --- a/tests/baselines/reference/es6ExportClauseWithoutModuleSpecifierInEs5.types +++ b/tests/baselines/reference/es6ExportClauseWithoutModuleSpecifierInEs5.types @@ -11,11 +11,11 @@ export module m { export var x = 10; >x : number ->10 : number +>10 : 10 } export var x = 10; >x : number ->10 : number +>10 : 10 export module uninstantiated { >uninstantiated : any diff --git a/tests/baselines/reference/es6ExportDefaultExpression.types b/tests/baselines/reference/es6ExportDefaultExpression.types index 6f7665c2800..1e6a38482b6 100644 --- a/tests/baselines/reference/es6ExportDefaultExpression.types +++ b/tests/baselines/reference/es6ExportDefaultExpression.types @@ -3,6 +3,6 @@ export default (1 + 2); >(1 + 2) : number >1 + 2 : number ->1 : number ->2 : number +>1 : 1 +>2 : 2 diff --git a/tests/baselines/reference/es6ExportEqualsInterop.errors.txt b/tests/baselines/reference/es6ExportEqualsInterop.errors.txt index 98e39cf73e7..be9aaf35fc4 100644 --- a/tests/baselines/reference/es6ExportEqualsInterop.errors.txt +++ b/tests/baselines/reference/es6ExportEqualsInterop.errors.txt @@ -1,4 +1,4 @@ -tests/cases/compiler/main.ts(15,1): error TS2304: Cannot find name 'z1'. +tests/cases/compiler/main.ts(15,1): error TS2693: 'z1' only refers to a type, but is being used as a value here. tests/cases/compiler/main.ts(21,4): error TS2339: Property 'a' does not exist on type '() => any'. tests/cases/compiler/main.ts(23,4): error TS2339: Property 'a' does not exist on type 'typeof Foo'. tests/cases/compiler/main.ts(27,8): error TS1192: Module '"interface"' has no default export. @@ -49,7 +49,7 @@ tests/cases/compiler/main.ts(106,15): error TS2498: Module '"class-module"' uses z1.a; ~~ -!!! error TS2304: Cannot find name 'z1'. +!!! error TS2693: 'z1' only refers to a type, but is being used as a value here. z2.a; z3.a; z4.a; diff --git a/tests/baselines/reference/es6ImportDefaultBinding.types b/tests/baselines/reference/es6ImportDefaultBinding.types index 6aa71ddf6ff..f538ee8127b 100644 --- a/tests/baselines/reference/es6ImportDefaultBinding.types +++ b/tests/baselines/reference/es6ImportDefaultBinding.types @@ -2,7 +2,7 @@ var a = 10; >a : number ->10 : number +>10 : 10 export default a; >a : number diff --git a/tests/baselines/reference/es6ImportDefaultBindingAmd.types b/tests/baselines/reference/es6ImportDefaultBindingAmd.types index 740ff2c0e14..824c5568b17 100644 --- a/tests/baselines/reference/es6ImportDefaultBindingAmd.types +++ b/tests/baselines/reference/es6ImportDefaultBindingAmd.types @@ -2,7 +2,7 @@ var a = 10; >a : number ->10 : number +>10 : 10 export default a; >a : number diff --git a/tests/baselines/reference/es6ImportDefaultBindingFollowedWithNamedImport.types b/tests/baselines/reference/es6ImportDefaultBindingFollowedWithNamedImport.types index fe0137403a9..0fba9c6390c 100644 --- a/tests/baselines/reference/es6ImportDefaultBindingFollowedWithNamedImport.types +++ b/tests/baselines/reference/es6ImportDefaultBindingFollowedWithNamedImport.types @@ -2,7 +2,7 @@ export var a = 10; >a : number ->10 : number +>10 : 10 export var x = a; >x : number diff --git a/tests/baselines/reference/es6ImportDefaultBindingFollowedWithNamespaceBinding1.types b/tests/baselines/reference/es6ImportDefaultBindingFollowedWithNamespaceBinding1.types index 6d3f015c783..a97100c662c 100644 --- a/tests/baselines/reference/es6ImportDefaultBindingFollowedWithNamespaceBinding1.types +++ b/tests/baselines/reference/es6ImportDefaultBindingFollowedWithNamespaceBinding1.types @@ -2,7 +2,7 @@ var a = 10; >a : number ->10 : number +>10 : 10 export default a; >a : number diff --git a/tests/baselines/reference/es6ImportDefaultBindingFollowedWithNamespaceBinding1InEs5.types b/tests/baselines/reference/es6ImportDefaultBindingFollowedWithNamespaceBinding1InEs5.types index 4f9c618f10c..18dc5efe226 100644 --- a/tests/baselines/reference/es6ImportDefaultBindingFollowedWithNamespaceBinding1InEs5.types +++ b/tests/baselines/reference/es6ImportDefaultBindingFollowedWithNamespaceBinding1InEs5.types @@ -2,7 +2,7 @@ var a = 10; >a : number ->10 : number +>10 : 10 export default a; >a : number diff --git a/tests/baselines/reference/es6ImportNameSpaceImport.types b/tests/baselines/reference/es6ImportNameSpaceImport.types index 56ee0c4d87a..6b73fb90bce 100644 --- a/tests/baselines/reference/es6ImportNameSpaceImport.types +++ b/tests/baselines/reference/es6ImportNameSpaceImport.types @@ -2,7 +2,7 @@ export var a = 10; >a : number ->10 : number +>10 : 10 === tests/cases/compiler/es6ImportNameSpaceImport_1.ts === import * as nameSpaceBinding from "./es6ImportNameSpaceImport_0"; diff --git a/tests/baselines/reference/es6ImportNameSpaceImportAmd.types b/tests/baselines/reference/es6ImportNameSpaceImportAmd.types index beb6860c73e..96cd4e603ea 100644 --- a/tests/baselines/reference/es6ImportNameSpaceImportAmd.types +++ b/tests/baselines/reference/es6ImportNameSpaceImportAmd.types @@ -2,7 +2,7 @@ export var a = 10; >a : number ->10 : number +>10 : 10 === tests/cases/compiler/es6ImportNameSpaceImportAmd_1.ts === import * as nameSpaceBinding from "es6ImportNameSpaceImportAmd_0"; diff --git a/tests/baselines/reference/es6ImportNameSpaceImportInEs5.types b/tests/baselines/reference/es6ImportNameSpaceImportInEs5.types index 13631060813..81971078849 100644 --- a/tests/baselines/reference/es6ImportNameSpaceImportInEs5.types +++ b/tests/baselines/reference/es6ImportNameSpaceImportInEs5.types @@ -2,7 +2,7 @@ export var a = 10; >a : number ->10 : number +>10 : 10 === tests/cases/compiler/es6ImportNameSpaceImportInEs5_1.ts === import * as nameSpaceBinding from "./es6ImportNameSpaceImportInEs5_0"; diff --git a/tests/baselines/reference/es6ImportNameSpaceImportNoNamedExports.types b/tests/baselines/reference/es6ImportNameSpaceImportNoNamedExports.types index 4aaf33d5930..041100c7678 100644 --- a/tests/baselines/reference/es6ImportNameSpaceImportNoNamedExports.types +++ b/tests/baselines/reference/es6ImportNameSpaceImportNoNamedExports.types @@ -2,7 +2,7 @@ var a = 10; >a : number ->10 : number +>10 : 10 export = a; >a : number diff --git a/tests/baselines/reference/es6ImportNamedImport.types b/tests/baselines/reference/es6ImportNamedImport.types index bd7c43d7031..0ac3789c5e0 100644 --- a/tests/baselines/reference/es6ImportNamedImport.types +++ b/tests/baselines/reference/es6ImportNamedImport.types @@ -2,7 +2,7 @@ export var a = 10; >a : number ->10 : number +>10 : 10 export var x = a; >x : number @@ -14,23 +14,23 @@ export var m = a; export var a1 = 10; >a1 : number ->10 : number +>10 : 10 export var x1 = 10; >x1 : number ->10 : number +>10 : 10 export var z1 = 10; >z1 : number ->10 : number +>10 : 10 export var z2 = 10; >z2 : number ->10 : number +>10 : 10 export var aaaa = 10; >aaaa : number ->10 : number +>10 : 10 === tests/cases/compiler/es6ImportNamedImport_1.ts === import { } from "./es6ImportNamedImport_0"; diff --git a/tests/baselines/reference/es6ImportNamedImportAmd.types b/tests/baselines/reference/es6ImportNamedImportAmd.types index 45ca9c08547..897187a5a0d 100644 --- a/tests/baselines/reference/es6ImportNamedImportAmd.types +++ b/tests/baselines/reference/es6ImportNamedImportAmd.types @@ -2,7 +2,7 @@ export var a = 10; >a : number ->10 : number +>10 : 10 export var x = a; >x : number @@ -14,23 +14,23 @@ export var m = a; export var a1 = 10; >a1 : number ->10 : number +>10 : 10 export var x1 = 10; >x1 : number ->10 : number +>10 : 10 export var z1 = 10; >z1 : number ->10 : number +>10 : 10 export var z2 = 10; >z2 : number ->10 : number +>10 : 10 export var aaaa = 10; >aaaa : number ->10 : number +>10 : 10 === tests/cases/compiler/es6ImportNamedImportAmd_1.ts === import { } from "es6ImportNamedImportAmd_0"; diff --git a/tests/baselines/reference/es6ImportNamedImportInEs5.types b/tests/baselines/reference/es6ImportNamedImportInEs5.types index 1d55b4bf51e..f2af5280fc2 100644 --- a/tests/baselines/reference/es6ImportNamedImportInEs5.types +++ b/tests/baselines/reference/es6ImportNamedImportInEs5.types @@ -2,7 +2,7 @@ export var a = 10; >a : number ->10 : number +>10 : 10 export var x = a; >x : number @@ -14,23 +14,23 @@ export var m = a; export var a1 = 10; >a1 : number ->10 : number +>10 : 10 export var x1 = 10; >x1 : number ->10 : number +>10 : 10 export var z1 = 10; >z1 : number ->10 : number +>10 : 10 export var z2 = 10; >z2 : number ->10 : number +>10 : 10 export var aaaa = 10; >aaaa : number ->10 : number +>10 : 10 === tests/cases/compiler/es6ImportNamedImportInEs5_1.ts === import { } from "./es6ImportNamedImportInEs5_0"; diff --git a/tests/baselines/reference/es6ImportNamedImportInExportAssignment.types b/tests/baselines/reference/es6ImportNamedImportInExportAssignment.types index 09023b6dd80..5b550c77a00 100644 --- a/tests/baselines/reference/es6ImportNamedImportInExportAssignment.types +++ b/tests/baselines/reference/es6ImportNamedImportInExportAssignment.types @@ -2,7 +2,7 @@ export var a = 10; >a : number ->10 : number +>10 : 10 === tests/cases/compiler/es6ImportNamedImportInExportAssignment_1.ts === import { a } from "./es6ImportNamedImportInExportAssignment_0"; diff --git a/tests/baselines/reference/es6ImportNamedImportWithTypesAndValues.types b/tests/baselines/reference/es6ImportNamedImportWithTypesAndValues.types index a65a2978e1b..11c6caf3dbe 100644 --- a/tests/baselines/reference/es6ImportNamedImportWithTypesAndValues.types +++ b/tests/baselines/reference/es6ImportNamedImportWithTypesAndValues.types @@ -18,7 +18,7 @@ export class C implements I { prop = "hello"; >prop : string ->"hello" : string +>"hello" : "hello" } export class C2 implements I2 { >C2 : C2 @@ -26,7 +26,7 @@ export class C2 implements I2 { prop2 = "world"; >prop2 : string ->"world" : string +>"world" : "world" } === tests/cases/compiler/client.ts === diff --git a/tests/baselines/reference/es6ImportWithoutFromClause.types b/tests/baselines/reference/es6ImportWithoutFromClause.types index d46a4a7487c..cd49acbcd0f 100644 --- a/tests/baselines/reference/es6ImportWithoutFromClause.types +++ b/tests/baselines/reference/es6ImportWithoutFromClause.types @@ -2,7 +2,7 @@ export var a = 10; >a : number ->10 : number +>10 : 10 === tests/cases/compiler/es6ImportWithoutFromClause_1.ts === import "es6ImportWithoutFromClause_0"; diff --git a/tests/baselines/reference/es6ImportWithoutFromClauseAmd.types b/tests/baselines/reference/es6ImportWithoutFromClauseAmd.types index 3314b12d189..5099dee908b 100644 --- a/tests/baselines/reference/es6ImportWithoutFromClauseAmd.types +++ b/tests/baselines/reference/es6ImportWithoutFromClauseAmd.types @@ -2,21 +2,21 @@ export var a = 10; >a : number ->10 : number +>10 : 10 === tests/cases/compiler/es6ImportWithoutFromClauseAmd_1.ts === export var b = 10; >b : number ->10 : number +>10 : 10 === tests/cases/compiler/es6ImportWithoutFromClauseAmd_2.ts === import "es6ImportWithoutFromClauseAmd_0"; import "es6ImportWithoutFromClauseAmd_2"; var _a = 10; >_a : number ->10 : number +>10 : 10 var _b = 10; >_b : number ->10 : number +>10 : 10 diff --git a/tests/baselines/reference/es6ImportWithoutFromClauseInEs5.types b/tests/baselines/reference/es6ImportWithoutFromClauseInEs5.types index ee95c07bb75..1e90de3223f 100644 --- a/tests/baselines/reference/es6ImportWithoutFromClauseInEs5.types +++ b/tests/baselines/reference/es6ImportWithoutFromClauseInEs5.types @@ -2,7 +2,7 @@ export var a = 10; >a : number ->10 : number +>10 : 10 === tests/cases/compiler/es6ImportWithoutFromClauseInEs5_1.ts === import "es6ImportWithoutFromClauseInEs5_0"; diff --git a/tests/baselines/reference/es6Module.types b/tests/baselines/reference/es6Module.types index b55b58e8883..709dcef0e89 100644 --- a/tests/baselines/reference/es6Module.types +++ b/tests/baselines/reference/es6Module.types @@ -10,6 +10,6 @@ export class A >B : () => number { return 42; ->42 : number +>42 : 42 } } diff --git a/tests/baselines/reference/es6ModuleClassDeclaration.types b/tests/baselines/reference/es6ModuleClassDeclaration.types index e354d266abe..7b8e2ba26df 100644 --- a/tests/baselines/reference/es6ModuleClassDeclaration.types +++ b/tests/baselines/reference/es6ModuleClassDeclaration.types @@ -6,19 +6,19 @@ export class c { } private x = 10; >x : number ->10 : number +>10 : 10 public y = 30; >y : number ->30 : number +>30 : 30 static k = 20; >k : number ->20 : number +>20 : 20 private static l = 30; >l : number ->30 : number +>30 : 30 private method1() { >method1 : () => void @@ -40,19 +40,19 @@ class c2 { } private x = 10; >x : number ->10 : number +>10 : 10 public y = 30; >y : number ->30 : number +>30 : 30 static k = 20; >k : number ->20 : number +>20 : 20 private static l = 30; >l : number ->30 : number +>30 : 30 private method1() { >method1 : () => void @@ -85,19 +85,19 @@ export module m1 { } private x = 10; >x : number ->10 : number +>10 : 10 public y = 30; >y : number ->30 : number +>30 : 30 static k = 20; >k : number ->20 : number +>20 : 20 private static l = 30; >l : number ->30 : number +>30 : 30 private method1() { >method1 : () => void @@ -119,19 +119,19 @@ export module m1 { } private x = 10; >x : number ->10 : number +>10 : 10 public y = 30; >y : number ->30 : number +>30 : 30 static k = 20; >k : number ->20 : number +>20 : 20 private static l = 30; >l : number ->30 : number +>30 : 30 private method1() { >method1 : () => void @@ -172,19 +172,19 @@ module m2 { } private x = 10; >x : number ->10 : number +>10 : 10 public y = 30; >y : number ->30 : number +>30 : 30 static k = 20; >k : number ->20 : number +>20 : 20 private static l = 30; >l : number ->30 : number +>30 : 30 private method1() { >method1 : () => void @@ -206,19 +206,19 @@ module m2 { } private x = 10; >x : number ->10 : number +>10 : 10 public y = 30; >y : number ->30 : number +>30 : 30 static k = 20; >k : number ->20 : number +>20 : 20 private static l = 30; >l : number ->30 : number +>30 : 30 private method1() { >method1 : () => void diff --git a/tests/baselines/reference/es6ModuleConst.types b/tests/baselines/reference/es6ModuleConst.types index 99b9f7c2980..b83e39e61ad 100644 --- a/tests/baselines/reference/es6ModuleConst.types +++ b/tests/baselines/reference/es6ModuleConst.types @@ -1,11 +1,11 @@ === tests/cases/compiler/es6ModuleConst.ts === export const a = "hello"; ->a : string ->"hello" : string +>a : "hello" +>"hello" : "hello" export const x: string = a, y = x; >x : string ->a : string +>a : "hello" >y : string >x : string @@ -23,49 +23,49 @@ export module m1 { >m1 : typeof m1 export const k = a; ->k : string ->a : string +>k : "hello" +>a : "hello" export const l: string = b, m = k; >l : string >b : string ->m : string ->k : string +>m : "hello" +>k : "hello" const n = m1.k; ->n : string ->m1.k : string +>n : "hello" +>m1.k : "hello" >m1 : typeof m1 ->k : string +>k : "hello" const o: string = n, p = k; >o : string ->n : string ->p : string ->k : string +>n : "hello" +>p : "hello" +>k : "hello" } module m2 { >m2 : typeof m2 export const k = a; ->k : string ->a : string +>k : "hello" +>a : "hello" export const l: string = b, m = k; >l : string >b : string ->m : string ->k : string +>m : "hello" +>k : "hello" const n = m1.k; ->n : string ->m1.k : string +>n : "hello" +>m1.k : "hello" >m1 : typeof m1 ->k : string +>k : "hello" const o: string = n, p = k; >o : string ->n : string ->p : string ->k : string +>n : "hello" +>p : "hello" +>k : "hello" } diff --git a/tests/baselines/reference/es6ModuleConstEnumDeclaration.types b/tests/baselines/reference/es6ModuleConstEnumDeclaration.types index fae819f93b0..1ad8f9c4615 100644 --- a/tests/baselines/reference/es6ModuleConstEnumDeclaration.types +++ b/tests/baselines/reference/es6ModuleConstEnumDeclaration.types @@ -3,37 +3,37 @@ export const enum e1 { >e1 : e1 a, ->a : e1 +>a : e1.a b, ->b : e1 +>b : e1.b c ->c : e1 +>c : e1.c } const enum e2 { >e2 : e2 x, ->x : e2 +>x : e2.x y, ->y : e2 +>y : e2.y z ->z : e2 +>z : e2.z } var x = e1.a; >x : e1 ->e1.a : e1 +>e1.a : e1.a >e1 : typeof e1 ->a : e1 +>a : e1.a var y = e2.x; >y : e2 ->e2.x : e2 +>e2.x : e2.x >e2 : typeof e2 ->x : e2 +>x : e2.x export module m1 { >m1 : typeof m1 @@ -42,49 +42,49 @@ export module m1 { >e3 : e3 a, ->a : e3 +>a : e3.a b, ->b : e3 +>b : e3.b c ->c : e3 +>c : e3.c } const enum e4 { >e4 : e4 x, ->x : e4 +>x : e4.x y, ->y : e4 +>y : e4.y z ->z : e4 +>z : e4.z } var x1 = e1.a; >x1 : e1 ->e1.a : e1 +>e1.a : e1.a >e1 : typeof e1 ->a : e1 +>a : e1.a var y1 = e2.x; >y1 : e2 ->e2.x : e2 +>e2.x : e2.x >e2 : typeof e2 ->x : e2 +>x : e2.x var x2 = e3.a; >x2 : e3 ->e3.a : e3 +>e3.a : e3.a >e3 : typeof e3 ->a : e3 +>a : e3.a var y2 = e4.x; >y2 : e4 ->e4.x : e4 +>e4.x : e4.x >e4 : typeof e4 ->x : e4 +>x : e4.x } module m2 { >m2 : typeof m2 @@ -93,55 +93,55 @@ module m2 { >e5 : e5 a, ->a : e5 +>a : e5.a b, ->b : e5 +>b : e5.b c ->c : e5 +>c : e5.c } const enum e6 { >e6 : e6 x, ->x : e6 +>x : e6.x y, ->y : e6 +>y : e6.y z ->z : e6 +>z : e6.z } var x1 = e1.a; >x1 : e1 ->e1.a : e1 +>e1.a : e1.a >e1 : typeof e1 ->a : e1 +>a : e1.a var y1 = e2.x; >y1 : e2 ->e2.x : e2 +>e2.x : e2.x >e2 : typeof e2 ->x : e2 +>x : e2.x var x2 = e5.a; >x2 : e5 ->e5.a : e5 +>e5.a : e5.a >e5 : typeof e5 ->a : e5 +>a : e5.a var y2 = e6.x; >y2 : e6 ->e6.x : e6 +>e6.x : e6.x >e6 : typeof e6 ->x : e6 +>x : e6.x var x3 = m1.e3.a; >x3 : m1.e3 ->m1.e3.a : m1.e3 +>m1.e3.a : m1.e3.a >m1.e3 : typeof m1.e3 >m1 : typeof m1 >e3 : typeof m1.e3 ->a : m1.e3 +>a : m1.e3.a } diff --git a/tests/baselines/reference/es6ModuleConstEnumDeclaration2.types b/tests/baselines/reference/es6ModuleConstEnumDeclaration2.types index c43a938c9b6..ee0cb195a1a 100644 --- a/tests/baselines/reference/es6ModuleConstEnumDeclaration2.types +++ b/tests/baselines/reference/es6ModuleConstEnumDeclaration2.types @@ -4,37 +4,37 @@ export const enum e1 { >e1 : e1 a, ->a : e1 +>a : e1.a b, ->b : e1 +>b : e1.b c ->c : e1 +>c : e1.c } const enum e2 { >e2 : e2 x, ->x : e2 +>x : e2.x y, ->y : e2 +>y : e2.y z ->z : e2 +>z : e2.z } var x = e1.a; >x : e1 ->e1.a : e1 +>e1.a : e1.a >e1 : typeof e1 ->a : e1 +>a : e1.a var y = e2.x; >y : e2 ->e2.x : e2 +>e2.x : e2.x >e2 : typeof e2 ->x : e2 +>x : e2.x export module m1 { >m1 : typeof m1 @@ -43,49 +43,49 @@ export module m1 { >e3 : e3 a, ->a : e3 +>a : e3.a b, ->b : e3 +>b : e3.b c ->c : e3 +>c : e3.c } const enum e4 { >e4 : e4 x, ->x : e4 +>x : e4.x y, ->y : e4 +>y : e4.y z ->z : e4 +>z : e4.z } var x1 = e1.a; >x1 : e1 ->e1.a : e1 +>e1.a : e1.a >e1 : typeof e1 ->a : e1 +>a : e1.a var y1 = e2.x; >y1 : e2 ->e2.x : e2 +>e2.x : e2.x >e2 : typeof e2 ->x : e2 +>x : e2.x var x2 = e3.a; >x2 : e3 ->e3.a : e3 +>e3.a : e3.a >e3 : typeof e3 ->a : e3 +>a : e3.a var y2 = e4.x; >y2 : e4 ->e4.x : e4 +>e4.x : e4.x >e4 : typeof e4 ->x : e4 +>x : e4.x } module m2 { >m2 : typeof m2 @@ -94,55 +94,55 @@ module m2 { >e5 : e5 a, ->a : e5 +>a : e5.a b, ->b : e5 +>b : e5.b c ->c : e5 +>c : e5.c } const enum e6 { >e6 : e6 x, ->x : e6 +>x : e6.x y, ->y : e6 +>y : e6.y z ->z : e6 +>z : e6.z } var x1 = e1.a; >x1 : e1 ->e1.a : e1 +>e1.a : e1.a >e1 : typeof e1 ->a : e1 +>a : e1.a var y1 = e2.x; >y1 : e2 ->e2.x : e2 +>e2.x : e2.x >e2 : typeof e2 ->x : e2 +>x : e2.x var x2 = e5.a; >x2 : e5 ->e5.a : e5 +>e5.a : e5.a >e5 : typeof e5 ->a : e5 +>a : e5.a var y2 = e6.x; >y2 : e6 ->e6.x : e6 +>e6.x : e6.x >e6 : typeof e6 ->x : e6 +>x : e6.x var x3 = m1.e3.a; >x3 : m1.e3 ->m1.e3.a : m1.e3 +>m1.e3.a : m1.e3.a >m1.e3 : typeof m1.e3 >m1 : typeof m1 >e3 : typeof m1.e3 ->a : m1.e3 +>a : m1.e3.a } diff --git a/tests/baselines/reference/es6ModuleEnumDeclaration.types b/tests/baselines/reference/es6ModuleEnumDeclaration.types index 4b856fee009..10880510758 100644 --- a/tests/baselines/reference/es6ModuleEnumDeclaration.types +++ b/tests/baselines/reference/es6ModuleEnumDeclaration.types @@ -3,37 +3,37 @@ export enum e1 { >e1 : e1 a, ->a : e1 +>a : e1.a b, ->b : e1 +>b : e1.b c ->c : e1 +>c : e1.c } enum e2 { >e2 : e2 x, ->x : e2 +>x : e2.x y, ->y : e2 +>y : e2.y z ->z : e2 +>z : e2.z } var x = e1.a; >x : e1 ->e1.a : e1 +>e1.a : e1.a >e1 : typeof e1 ->a : e1 +>a : e1.a var y = e2.x; >y : e2 ->e2.x : e2 +>e2.x : e2.x >e2 : typeof e2 ->x : e2 +>x : e2.x export module m1 { >m1 : typeof m1 @@ -42,49 +42,49 @@ export module m1 { >e3 : e3 a, ->a : e3 +>a : e3.a b, ->b : e3 +>b : e3.b c ->c : e3 +>c : e3.c } enum e4 { >e4 : e4 x, ->x : e4 +>x : e4.x y, ->y : e4 +>y : e4.y z ->z : e4 +>z : e4.z } var x1 = e1.a; >x1 : e1 ->e1.a : e1 +>e1.a : e1.a >e1 : typeof e1 ->a : e1 +>a : e1.a var y1 = e2.x; >y1 : e2 ->e2.x : e2 +>e2.x : e2.x >e2 : typeof e2 ->x : e2 +>x : e2.x var x2 = e3.a; >x2 : e3 ->e3.a : e3 +>e3.a : e3.a >e3 : typeof e3 ->a : e3 +>a : e3.a var y2 = e4.x; >y2 : e4 ->e4.x : e4 +>e4.x : e4.x >e4 : typeof e4 ->x : e4 +>x : e4.x } module m2 { >m2 : typeof m2 @@ -93,55 +93,55 @@ module m2 { >e5 : e5 a, ->a : e5 +>a : e5.a b, ->b : e5 +>b : e5.b c ->c : e5 +>c : e5.c } enum e6 { >e6 : e6 x, ->x : e6 +>x : e6.x y, ->y : e6 +>y : e6.y z ->z : e6 +>z : e6.z } var x1 = e1.a; >x1 : e1 ->e1.a : e1 +>e1.a : e1.a >e1 : typeof e1 ->a : e1 +>a : e1.a var y1 = e2.x; >y1 : e2 ->e2.x : e2 +>e2.x : e2.x >e2 : typeof e2 ->x : e2 +>x : e2.x var x2 = e5.a; >x2 : e5 ->e5.a : e5 +>e5.a : e5.a >e5 : typeof e5 ->a : e5 +>a : e5.a var y2 = e6.x; >y2 : e6 ->e6.x : e6 +>e6.x : e6.x >e6 : typeof e6 ->x : e6 +>x : e6.x var x3 = m1.e3.a; >x3 : m1.e3 ->m1.e3.a : m1.e3 +>m1.e3.a : m1.e3.a >m1.e3 : typeof m1.e3 >m1 : typeof m1 >e3 : typeof m1.e3 ->a : m1.e3 +>a : m1.e3.a } diff --git a/tests/baselines/reference/es6ModuleInternalImport.types b/tests/baselines/reference/es6ModuleInternalImport.types index 5d7fd527afd..08dc2a9bcbe 100644 --- a/tests/baselines/reference/es6ModuleInternalImport.types +++ b/tests/baselines/reference/es6ModuleInternalImport.types @@ -4,7 +4,7 @@ export module m { export var a = 10; >a : number ->10 : number +>10 : 10 } export import a1 = m.a; >a1 : number diff --git a/tests/baselines/reference/es6ModuleLet.types b/tests/baselines/reference/es6ModuleLet.types index 9e670c0a1e1..a8bfb89dd6e 100644 --- a/tests/baselines/reference/es6ModuleLet.types +++ b/tests/baselines/reference/es6ModuleLet.types @@ -1,7 +1,7 @@ === tests/cases/compiler/es6ModuleLet.ts === export let a = "hello"; >a : string ->"hello" : string +>"hello" : "hello" export let x: string = a, y = x; >x : string diff --git a/tests/baselines/reference/es6ModuleModuleDeclaration.types b/tests/baselines/reference/es6ModuleModuleDeclaration.types index 6fb5a7c98f5..4e0f309457b 100644 --- a/tests/baselines/reference/es6ModuleModuleDeclaration.types +++ b/tests/baselines/reference/es6ModuleModuleDeclaration.types @@ -4,33 +4,33 @@ export module m1 { export var a = 10; >a : number ->10 : number +>10 : 10 var b = 10; >b : number ->10 : number +>10 : 10 export module innerExportedModule { >innerExportedModule : typeof innerExportedModule export var k = 10; >k : number ->10 : number +>10 : 10 var l = 10; >l : number ->10 : number +>10 : 10 } export module innerNonExportedModule { >innerNonExportedModule : typeof innerNonExportedModule export var x = 10; >x : number ->10 : number +>10 : 10 var y = 10; >y : number ->10 : number +>10 : 10 } } module m2 { @@ -38,32 +38,32 @@ module m2 { export var a = 10; >a : number ->10 : number +>10 : 10 var b = 10; >b : number ->10 : number +>10 : 10 export module innerExportedModule { >innerExportedModule : typeof innerExportedModule export var k = 10; >k : number ->10 : number +>10 : 10 var l = 10; >l : number ->10 : number +>10 : 10 } export module innerNonExportedModule { >innerNonExportedModule : typeof innerNonExportedModule export var x = 10; >x : number ->10 : number +>10 : 10 var y = 10; >y : number ->10 : number +>10 : 10 } } diff --git a/tests/baselines/reference/es6ModuleVariableStatement.types b/tests/baselines/reference/es6ModuleVariableStatement.types index 520430199e4..00278b6511c 100644 --- a/tests/baselines/reference/es6ModuleVariableStatement.types +++ b/tests/baselines/reference/es6ModuleVariableStatement.types @@ -1,7 +1,7 @@ === tests/cases/compiler/es6ModuleVariableStatement.ts === export var a = "hello"; >a : string ->"hello" : string +>"hello" : "hello" export var x: string = a, y = x; >x : string diff --git a/tests/baselines/reference/es6ModuleWithModuleGenTargetAmd.types b/tests/baselines/reference/es6ModuleWithModuleGenTargetAmd.types index 067ceb005e8..90b9afbe02e 100644 --- a/tests/baselines/reference/es6ModuleWithModuleGenTargetAmd.types +++ b/tests/baselines/reference/es6ModuleWithModuleGenTargetAmd.types @@ -10,6 +10,6 @@ export class A >B : () => number { return 42; ->42 : number +>42 : 42 } } diff --git a/tests/baselines/reference/es6ModuleWithModuleGenTargetCommonjs.types b/tests/baselines/reference/es6ModuleWithModuleGenTargetCommonjs.types index 58f0f89f955..31fc40eeabd 100644 --- a/tests/baselines/reference/es6ModuleWithModuleGenTargetCommonjs.types +++ b/tests/baselines/reference/es6ModuleWithModuleGenTargetCommonjs.types @@ -10,6 +10,6 @@ export class A >B : () => number { return 42; ->42 : number +>42 : 42 } } diff --git a/tests/baselines/reference/es6modulekind.types b/tests/baselines/reference/es6modulekind.types index d7fde0c7d44..8994eb6657a 100644 --- a/tests/baselines/reference/es6modulekind.types +++ b/tests/baselines/reference/es6modulekind.types @@ -12,6 +12,6 @@ export default class A >B : () => number { return 42; ->42 : number +>42 : 42 } } diff --git a/tests/baselines/reference/es6modulekindWithES2015Target.types b/tests/baselines/reference/es6modulekindWithES2015Target.types index 63acdae43d1..313fb612d8e 100644 --- a/tests/baselines/reference/es6modulekindWithES2015Target.types +++ b/tests/baselines/reference/es6modulekindWithES2015Target.types @@ -12,6 +12,6 @@ export default class A >B : () => number { return 42; ->42 : number +>42 : 42 } } diff --git a/tests/baselines/reference/es6modulekindWithES5Target.js b/tests/baselines/reference/es6modulekindWithES5Target.js index 560e401b312..10d9cd2e36f 100644 --- a/tests/baselines/reference/es6modulekindWithES5Target.js +++ b/tests/baselines/reference/es6modulekindWithES5Target.js @@ -27,7 +27,7 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key, else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; return c > 3 && r && Object.defineProperty(target, key, r), r; }; -var C = (function () { +export var C = (function () { function C() { this.p = 1; } diff --git a/tests/baselines/reference/es6modulekindWithES5Target.types b/tests/baselines/reference/es6modulekindWithES5Target.types index f7232f20494..4b620fb9e17 100644 --- a/tests/baselines/reference/es6modulekindWithES5Target.types +++ b/tests/baselines/reference/es6modulekindWithES5Target.types @@ -5,11 +5,11 @@ export class C { static s = 0; >s : number ->0 : number +>0 : 0 p = 1; >p : number ->1 : number +>1 : 1 method() { } >method : () => void @@ -30,11 +30,11 @@ export class D { static s = 0; >s : number ->0 : number +>0 : 0 p = 1; >p : number ->1 : number +>1 : 1 method() { } >method : () => void diff --git a/tests/baselines/reference/es6modulekindWithES5Target11.types b/tests/baselines/reference/es6modulekindWithES5Target11.types index 51fbe371017..e3d922c0443 100644 --- a/tests/baselines/reference/es6modulekindWithES5Target11.types +++ b/tests/baselines/reference/es6modulekindWithES5Target11.types @@ -18,11 +18,11 @@ export default class C { static y = 1 >y : number ->1 : number +>1 : 1 p = 1; >p : number ->1 : number +>1 : 1 method() { } >method : () => void diff --git a/tests/baselines/reference/es6modulekindWithES5Target2.js b/tests/baselines/reference/es6modulekindWithES5Target2.js index 7025ac05105..101ead5cb56 100644 --- a/tests/baselines/reference/es6modulekindWithES5Target2.js +++ b/tests/baselines/reference/es6modulekindWithES5Target2.js @@ -15,4 +15,5 @@ var C = (function () { C.prototype.method = function () { }; return C; }()); +export default C; C.s = 0; diff --git a/tests/baselines/reference/es6modulekindWithES5Target2.types b/tests/baselines/reference/es6modulekindWithES5Target2.types index 04b5e5b9905..6ad697e0c25 100644 --- a/tests/baselines/reference/es6modulekindWithES5Target2.types +++ b/tests/baselines/reference/es6modulekindWithES5Target2.types @@ -5,11 +5,11 @@ export default class C { static s = 0; >s : number ->0 : number +>0 : 0 p = 1; >p : number ->1 : number +>1 : 1 method() { } >method : () => void diff --git a/tests/baselines/reference/es6modulekindWithES5Target3.types b/tests/baselines/reference/es6modulekindWithES5Target3.types index 5bc8c69c01a..78928f56ddd 100644 --- a/tests/baselines/reference/es6modulekindWithES5Target3.types +++ b/tests/baselines/reference/es6modulekindWithES5Target3.types @@ -13,11 +13,11 @@ export default class D { static s = 0; >s : number ->0 : number +>0 : 0 p = 1; >p : number ->1 : number +>1 : 1 method() { } >method : () => void diff --git a/tests/baselines/reference/es6modulekindWithES5Target6.types b/tests/baselines/reference/es6modulekindWithES5Target6.types index 932493ef063..de43a987d4d 100644 --- a/tests/baselines/reference/es6modulekindWithES5Target6.types +++ b/tests/baselines/reference/es6modulekindWithES5Target6.types @@ -3,7 +3,7 @@ export function f1(d = 0) { >f1 : (d?: number) => void >d : number ->0 : number +>0 : 0 } export function f2(...arg) { @@ -14,6 +14,6 @@ export function f2(...arg) { export default function f3(d = 0) { >f3 : (d?: number) => void >d : number ->0 : number +>0 : 0 } diff --git a/tests/baselines/reference/es6modulekindWithES5Target7.types b/tests/baselines/reference/es6modulekindWithES5Target7.types index f1404c7883a..1c3add3b031 100644 --- a/tests/baselines/reference/es6modulekindWithES5Target7.types +++ b/tests/baselines/reference/es6modulekindWithES5Target7.types @@ -5,7 +5,7 @@ export namespace N { var x = 0; >x : number ->0 : number +>0 : 0 } export namespace N2 { diff --git a/tests/baselines/reference/es6modulekindWithES5Target8.types b/tests/baselines/reference/es6modulekindWithES5Target8.types index 4017b02a471..754decea312 100644 --- a/tests/baselines/reference/es6modulekindWithES5Target8.types +++ b/tests/baselines/reference/es6modulekindWithES5Target8.types @@ -1,10 +1,10 @@ === tests/cases/compiler/es6modulekindWithES5Target8.ts === export const c = 0; ->c : number ->0 : number +>c : 0 +>0 : 0 export let l = 1; >l : number ->1 : number +>1 : 1 diff --git a/tests/baselines/reference/escapedIdentifiers.types b/tests/baselines/reference/escapedIdentifiers.types index 67713976bd6..e7f19d7144c 100644 --- a/tests/baselines/reference/escapedIdentifiers.types +++ b/tests/baselines/reference/escapedIdentifiers.types @@ -14,7 +14,7 @@ // var decl var \u0061 = 1; >\u0061 : number ->1 : number +>1 : 1 a ++; >a ++ : number @@ -26,7 +26,7 @@ a ++; var b = 1; >b : number ->1 : number +>1 : 1 b ++; >b ++ : number @@ -51,32 +51,32 @@ module moduleType\u0032 { } moduleType1.baz1 = 3; ->moduleType1.baz1 = 3 : number +>moduleType1.baz1 = 3 : 3 >moduleType1.baz1 : number >moduleType1 : typeof moduleType1 >baz1 : number ->3 : number +>3 : 3 moduleType\u0031.baz1 = 3; ->moduleType\u0031.baz1 = 3 : number +>moduleType\u0031.baz1 = 3 : 3 >moduleType\u0031.baz1 : number >moduleType\u0031 : typeof moduleType1 >baz1 : number ->3 : number +>3 : 3 moduleType2.baz2 = 3; ->moduleType2.baz2 = 3 : number +>moduleType2.baz2 = 3 : 3 >moduleType2.baz2 : number >moduleType2 : typeof moduleType\u0032 >baz2 : number ->3 : number +>3 : 3 moduleType\u0032.baz2 = 3; ->moduleType\u0032.baz2 = 3 : number +>moduleType\u0032.baz2 = 3 : 3 >moduleType\u0032.baz2 : number >moduleType\u0032 : typeof moduleType\u0032 >baz2 : number ->3 : number +>3 : 3 // classes @@ -99,11 +99,11 @@ var classType1Object1 = new classType1(); >classType1 : typeof classType1 classType1Object1.foo1 = 2; ->classType1Object1.foo1 = 2 : number +>classType1Object1.foo1 = 2 : 2 >classType1Object1.foo1 : number >classType1Object1 : classType1 >foo1 : number ->2 : number +>2 : 2 var classType1Object2 = new classType\u0031(); >classType1Object2 : classType1 @@ -111,11 +111,11 @@ var classType1Object2 = new classType\u0031(); >classType\u0031 : typeof classType1 classType1Object2.foo1 = 2; ->classType1Object2.foo1 = 2 : number +>classType1Object2.foo1 = 2 : 2 >classType1Object2.foo1 : number >classType1Object2 : classType1 >foo1 : number ->2 : number +>2 : 2 var classType2Object1 = new classType2(); >classType2Object1 : classType\u0032 @@ -123,11 +123,11 @@ var classType2Object1 = new classType2(); >classType2 : typeof classType\u0032 classType2Object1.foo2 = 2; ->classType2Object1.foo2 = 2 : number +>classType2Object1.foo2 = 2 : 2 >classType2Object1.foo2 : number >classType2Object1 : classType\u0032 >foo2 : number ->2 : number +>2 : 2 var classType2Object2 = new classType\u0032(); >classType2Object2 : classType\u0032 @@ -135,11 +135,11 @@ var classType2Object2 = new classType\u0032(); >classType\u0032 : typeof classType\u0032 classType2Object2.foo2 = 2; ->classType2Object2.foo2 = 2 : number +>classType2Object2.foo2 = 2 : 2 >classType2Object2.foo2 : number >classType2Object2 : classType\u0032 >foo2 : number ->2 : number +>2 : 2 // interfaces interface interfaceType1 { @@ -161,14 +161,14 @@ var interfaceType1Object1 = { bar1: 0 }; >interfaceType1 : interfaceType1 >{ bar1: 0 } : { bar1: number; } >bar1 : number ->0 : number +>0 : 0 interfaceType1Object1.bar1 = 2; ->interfaceType1Object1.bar1 = 2 : number +>interfaceType1Object1.bar1 = 2 : 2 >interfaceType1Object1.bar1 : number >interfaceType1Object1 : interfaceType1 >bar1 : number ->2 : number +>2 : 2 var interfaceType1Object2 = { bar1: 0 }; >interfaceType1Object2 : interfaceType1 @@ -176,14 +176,14 @@ var interfaceType1Object2 = { bar1: 0 }; >interfaceType\u0031 : interfaceType1 >{ bar1: 0 } : { bar1: number; } >bar1 : number ->0 : number +>0 : 0 interfaceType1Object2.bar1 = 2; ->interfaceType1Object2.bar1 = 2 : number +>interfaceType1Object2.bar1 = 2 : 2 >interfaceType1Object2.bar1 : number >interfaceType1Object2 : interfaceType1 >bar1 : number ->2 : number +>2 : 2 var interfaceType2Object1 = { bar2: 0 }; >interfaceType2Object1 : interfaceType\u0032 @@ -191,14 +191,14 @@ var interfaceType2Object1 = { bar2: 0 }; >interfaceType2 : interfaceType\u0032 >{ bar2: 0 } : { bar2: number; } >bar2 : number ->0 : number +>0 : 0 interfaceType2Object1.bar2 = 2; ->interfaceType2Object1.bar2 = 2 : number +>interfaceType2Object1.bar2 = 2 : 2 >interfaceType2Object1.bar2 : number >interfaceType2Object1 : interfaceType\u0032 >bar2 : number ->2 : number +>2 : 2 var interfaceType2Object2 = { bar2: 0 }; >interfaceType2Object2 : interfaceType\u0032 @@ -206,14 +206,14 @@ var interfaceType2Object2 = { bar2: 0 }; >interfaceType\u0032 : interfaceType\u0032 >{ bar2: 0 } : { bar2: number; } >bar2 : number ->0 : number +>0 : 0 interfaceType2Object2.bar2 = 2; ->interfaceType2Object2.bar2 = 2 : number +>interfaceType2Object2.bar2 = 2 : 2 >interfaceType2Object2.bar2 : number >interfaceType2Object2 : interfaceType\u0032 >bar2 : number ->2 : number +>2 : 2 // arguments @@ -228,24 +228,24 @@ class testClass { >arg4 : number arg\u0031 = 1; ->arg\u0031 = 1 : number +>arg\u0031 = 1 : 1 >arg\u0031 : number ->1 : number +>1 : 1 arg2 = 'string'; ->arg2 = 'string' : string +>arg2 = 'string' : "string" >arg2 : string ->'string' : string +>'string' : "string" arg\u0033 = true; ->arg\u0033 = true : boolean +>arg\u0033 = true : true >arg\u0033 : boolean ->true : boolean +>true : true arg4 = 2; ->arg4 = 2 : number +>arg4 = 2 : 2 >arg4 : number ->2 : number +>2 : 2 } } @@ -264,38 +264,38 @@ var constructorTestObject = new constructorTestClass(1, 'string', true, 2); >constructorTestObject : constructorTestClass >new constructorTestClass(1, 'string', true, 2) : constructorTestClass >constructorTestClass : typeof constructorTestClass ->1 : number ->'string' : string ->true : boolean ->2 : number +>1 : 1 +>'string' : "string" +>true : true +>2 : 2 constructorTestObject.arg\u0031 = 1; ->constructorTestObject.arg\u0031 = 1 : number +>constructorTestObject.arg\u0031 = 1 : 1 >constructorTestObject.arg\u0031 : number >constructorTestObject : constructorTestClass >arg\u0031 : number ->1 : number +>1 : 1 constructorTestObject.arg2 = 'string'; ->constructorTestObject.arg2 = 'string' : string +>constructorTestObject.arg2 = 'string' : "string" >constructorTestObject.arg2 : string >constructorTestObject : constructorTestClass >arg2 : string ->'string' : string +>'string' : "string" constructorTestObject.arg\u0033 = true; ->constructorTestObject.arg\u0033 = true : boolean +>constructorTestObject.arg\u0033 = true : true >constructorTestObject.arg\u0033 : boolean >constructorTestObject : constructorTestClass >arg\u0033 : boolean ->true : boolean +>true : true constructorTestObject.arg4 = 2; ->constructorTestObject.arg4 = 2 : number +>constructorTestObject.arg4 = 2 : 2 >constructorTestObject.arg4 : number >constructorTestObject : constructorTestClass >arg4 : number ->2 : number +>2 : 2 // Lables @@ -303,10 +303,10 @@ l\u0061bel1: >l\u0061bel1 : any while (false) ->false : boolean +>false : false { while(false) ->false : boolean +>false : false continue label1; // it will go to next iteration of outer loop >label1 : any @@ -316,10 +316,10 @@ label2: >label2 : any while (false) ->false : boolean +>false : false { while(false) ->false : boolean +>false : false continue l\u0061bel2; // it will go to next iteration of outer loop >l\u0061bel2 : any @@ -329,10 +329,10 @@ label3: >label3 : any while (false) ->false : boolean +>false : false { while(false) ->false : boolean +>false : false continue label3; // it will go to next iteration of outer loop >label3 : any @@ -342,10 +342,10 @@ l\u0061bel4: >l\u0061bel4 : any while (false) ->false : boolean +>false : false { while(false) ->false : boolean +>false : false continue l\u0061bel4; // it will go to next iteration of outer loop >l\u0061bel4 : any diff --git a/tests/baselines/reference/escapedReservedCompilerNamedIdentifier.types b/tests/baselines/reference/escapedReservedCompilerNamedIdentifier.types index 1ebbf8aedb2..1cecaaa74f0 100644 --- a/tests/baselines/reference/escapedReservedCompilerNamedIdentifier.types +++ b/tests/baselines/reference/escapedReservedCompilerNamedIdentifier.types @@ -2,21 +2,21 @@ // double underscores var __proto__ = 10; >__proto__ : number ->10 : number +>10 : 10 var o = { >o : { "__proto__": number; } >{ "__proto__": 0} : { "__proto__": number; } "__proto__": 0 ->0 : number +>0 : 0 }; var b = o["__proto__"]; >b : number >o["__proto__"] : number >o : { "__proto__": number; } ->"__proto__" : string +>"__proto__" : "___proto__" var o1 = { >o1 : { __proto__: number; } @@ -24,33 +24,33 @@ var o1 = { __proto__: 0 >__proto__ : number ->0 : number +>0 : 0 }; var b1 = o1["__proto__"]; >b1 : number >o1["__proto__"] : number >o1 : { __proto__: number; } ->"__proto__" : string +>"__proto__" : "___proto__" // Triple underscores var ___proto__ = 10; >___proto__ : number ->10 : number +>10 : 10 var o2 = { >o2 : { "___proto__": number; } >{ "___proto__": 0} : { "___proto__": number; } "___proto__": 0 ->0 : number +>0 : 0 }; var b2 = o2["___proto__"]; >b2 : number >o2["___proto__"] : number >o2 : { "___proto__": number; } ->"___proto__" : string +>"___proto__" : "____proto__" var o3 = { >o3 : { ___proto__: number; } @@ -58,33 +58,33 @@ var o3 = { ___proto__: 0 >___proto__ : number ->0 : number +>0 : 0 }; var b3 = o3["___proto__"]; >b3 : number >o3["___proto__"] : number >o3 : { ___proto__: number; } ->"___proto__" : string +>"___proto__" : "____proto__" // One underscore var _proto__ = 10; >_proto__ : number ->10 : number +>10 : 10 var o4 = { >o4 : { "_proto__": number; } >{ "_proto__": 0} : { "_proto__": number; } "_proto__": 0 ->0 : number +>0 : 0 }; var b4 = o4["_proto__"]; >b4 : number >o4["_proto__"] : number >o4 : { "_proto__": number; } ->"_proto__" : string +>"_proto__" : "_proto__" var o5 = { >o5 : { _proto__: number; } @@ -92,12 +92,12 @@ var o5 = { _proto__: 0 >_proto__ : number ->0 : number +>0 : 0 }; var b5 = o5["_proto__"]; >b5 : number >o5["_proto__"] : number >o5 : { _proto__: number; } ->"_proto__" : string +>"_proto__" : "_proto__" diff --git a/tests/baselines/reference/everyTypeWithAnnotationAndInitializer.types b/tests/baselines/reference/everyTypeWithAnnotationAndInitializer.types index 0e7059f4eed..d1843aebb1a 100644 --- a/tests/baselines/reference/everyTypeWithAnnotationAndInitializer.types +++ b/tests/baselines/reference/everyTypeWithAnnotationAndInitializer.types @@ -37,7 +37,7 @@ class D{ function F(x: string): number { return 42; } >F : (x: string) => number >x : string ->42 : number +>42 : 42 module M { >M : typeof M @@ -60,18 +60,18 @@ module M { var aNumber: number = 9.9; >aNumber : number ->9.9 : number +>9.9 : 9.9 var aString: string = 'this is a string'; >aString : string ->'this is a string' : string +>'this is a string' : "this is a string" var aDate: Date = new Date(12); >aDate : Date >Date : Date >new Date(12) : Date >Date : DateConstructor ->12 : number +>12 : 12 var anObject: Object = new Object(); >anObject : Object @@ -114,7 +114,7 @@ var anObjectLiteral: I = { id: 12 }; >I : I >{ id: 12 } : { id: number; } >id : number ->12 : number +>12 : 12 var anOtherObjectLiteral: { id: number } = new C(); >anOtherObjectLiteral : { id: number; } @@ -137,7 +137,7 @@ var aLambda: typeof F = (x) => 2; >F : (x: string) => number >(x) => 2 : (x: string) => number >x : string ->2 : number +>2 : 2 var aModule: typeof M = M; >aModule : typeof M @@ -160,6 +160,6 @@ var aFunctionInModule: typeof M.F2 = (x) => 'this is a string'; >F2 : (x: number) => string >(x) => 'this is a string' : (x: number) => string >x : number ->'this is a string' : string +>'this is a string' : "this is a string" diff --git a/tests/baselines/reference/everyTypeWithAnnotationAndInvalidInitializer.errors.txt b/tests/baselines/reference/everyTypeWithAnnotationAndInvalidInitializer.errors.txt index 13c2058b657..5302f856c6f 100644 --- a/tests/baselines/reference/everyTypeWithAnnotationAndInvalidInitializer.errors.txt +++ b/tests/baselines/reference/everyTypeWithAnnotationAndInvalidInitializer.errors.txt @@ -1,7 +1,7 @@ -tests/cases/conformance/statements/VariableStatements/everyTypeWithAnnotationAndInvalidInitializer.ts(34,5): error TS2322: Type 'string' is not assignable to type 'number'. -tests/cases/conformance/statements/VariableStatements/everyTypeWithAnnotationAndInvalidInitializer.ts(35,5): error TS2322: Type 'number' is not assignable to type 'string'. -tests/cases/conformance/statements/VariableStatements/everyTypeWithAnnotationAndInvalidInitializer.ts(36,5): error TS2322: Type 'number' is not assignable to type 'Date'. -tests/cases/conformance/statements/VariableStatements/everyTypeWithAnnotationAndInvalidInitializer.ts(38,5): error TS2322: Type 'number' is not assignable to type 'void'. +tests/cases/conformance/statements/VariableStatements/everyTypeWithAnnotationAndInvalidInitializer.ts(34,5): error TS2322: Type '"this is a string"' is not assignable to type 'number'. +tests/cases/conformance/statements/VariableStatements/everyTypeWithAnnotationAndInvalidInitializer.ts(35,5): error TS2322: Type '9.9' is not assignable to type 'string'. +tests/cases/conformance/statements/VariableStatements/everyTypeWithAnnotationAndInvalidInitializer.ts(36,5): error TS2322: Type '9.9' is not assignable to type 'Date'. +tests/cases/conformance/statements/VariableStatements/everyTypeWithAnnotationAndInvalidInitializer.ts(38,5): error TS2322: Type '9.9' is not assignable to type 'void'. tests/cases/conformance/statements/VariableStatements/everyTypeWithAnnotationAndInvalidInitializer.ts(40,5): error TS2322: Type 'D<{}>' is not assignable to type 'I'. Property 'id' is missing in type 'D<{}>'. tests/cases/conformance/statements/VariableStatements/everyTypeWithAnnotationAndInvalidInitializer.ts(41,5): error TS2322: Type 'D<{}>' is not assignable to type 'C'. @@ -68,17 +68,17 @@ tests/cases/conformance/statements/VariableStatements/everyTypeWithAnnotationAnd var aNumber: number = 'this is a string'; ~~~~~~~ -!!! error TS2322: Type 'string' is not assignable to type 'number'. +!!! error TS2322: Type '"this is a string"' is not assignable to type 'number'. var aString: string = 9.9; ~~~~~~~ -!!! error TS2322: Type 'number' is not assignable to type 'string'. +!!! error TS2322: Type '9.9' is not assignable to type 'string'. var aDate: Date = 9.9; ~~~~~ -!!! error TS2322: Type 'number' is not assignable to type 'Date'. +!!! error TS2322: Type '9.9' is not assignable to type 'Date'. var aVoid: void = 9.9; ~~~~~ -!!! error TS2322: Type 'number' is not assignable to type 'void'. +!!! error TS2322: Type '9.9' is not assignable to type 'void'. var anInterface: I = new D(); ~~~~~~~~~~~ diff --git a/tests/baselines/reference/everyTypeWithInitializer.types b/tests/baselines/reference/everyTypeWithInitializer.types index abc0e770e35..947eff14f7f 100644 --- a/tests/baselines/reference/everyTypeWithInitializer.types +++ b/tests/baselines/reference/everyTypeWithInitializer.types @@ -37,7 +37,7 @@ class D{ function F(x: string): number { return 42; } >F : (x: string) => number >x : string ->42 : number +>42 : 42 module M { >M : typeof M @@ -60,17 +60,17 @@ module M { var aNumber = 9.9; >aNumber : number ->9.9 : number +>9.9 : 9.9 var aString = 'this is a string'; >aString : string ->'this is a string' : string +>'this is a string' : "this is a string" var aDate = new Date(12); >aDate : Date >new Date(12) : Date >Date : DateConstructor ->12 : number +>12 : 12 var anObject = new Object(); >anObject : Object @@ -106,7 +106,7 @@ var anObjectLiteral = { id: 12 }; >anObjectLiteral : { id: number; } >{ id: 12 } : { id: number; } >id : number ->12 : number +>12 : 12 var aFunction = F; >aFunction : (x: string) => number @@ -116,7 +116,7 @@ var aLambda = (x) => 2; >aLambda : (x: any) => number >(x) => 2 : (x: any) => number >x : any ->2 : number +>2 : 2 var aModule = M; >aModule : typeof M diff --git a/tests/baselines/reference/excessPropertyErrorsSuppressed.types b/tests/baselines/reference/excessPropertyErrorsSuppressed.types index 47a4dbf92a9..c0b8f66d840 100644 --- a/tests/baselines/reference/excessPropertyErrorsSuppressed.types +++ b/tests/baselines/reference/excessPropertyErrorsSuppressed.types @@ -5,7 +5,7 @@ var x: { a: string } = { a: "hello", b: 42 }; // No error >a : string >{ a: "hello", b: 42 } : { a: string; b: number; } >a : string ->"hello" : string +>"hello" : "hello" >b : number ->42 : number +>42 : 42 diff --git a/tests/baselines/reference/exponentiationOperatorWithAnyAndNumber.types b/tests/baselines/reference/exponentiationOperatorWithAnyAndNumber.types index ec48b80f192..6e8b3cb3d2b 100644 --- a/tests/baselines/reference/exponentiationOperatorWithAnyAndNumber.types +++ b/tests/baselines/reference/exponentiationOperatorWithAnyAndNumber.types @@ -22,30 +22,30 @@ var r3 = a ** 0; >r3 : number >a ** 0 : number >a : any ->0 : number +>0 : 0 var r4 = 0 ** a; >r4 : number >0 ** a : number ->0 : number +>0 : 0 >a : any var r5 = 0 ** 0; >r5 : number >0 ** 0 : number ->0 : number ->0 : number +>0 : 0 +>0 : 0 var r6 = b ** 0; >r6 : number >b ** 0 : number >b : number ->0 : number +>0 : 0 var r7 = 0 ** b; >r7 : number >0 ** b : number ->0 : number +>0 : 0 >b : number var r8 = b ** b; diff --git a/tests/baselines/reference/exponentiationOperatorWithEnum.types b/tests/baselines/reference/exponentiationOperatorWithEnum.types index 037ff9d1261..9609e13000b 100644 --- a/tests/baselines/reference/exponentiationOperatorWithEnum.types +++ b/tests/baselines/reference/exponentiationOperatorWithEnum.types @@ -5,10 +5,10 @@ enum E { >E : E a, ->a : E +>a : E.a b ->b : E +>b : E.b } var a: any; @@ -55,58 +55,58 @@ var r5 = b ** c; var r6 = E.a ** a; >r6 : number >E.a ** a : number ->E.a : E +>E.a : E.a >E : typeof E ->a : E +>a : E.a >a : any var r7 = E.a ** b; >r7 : number >E.a ** b : number ->E.a : E +>E.a : E.a >E : typeof E ->a : E +>a : E.a >b : number var r8 = E.a ** E.b; >r8 : number >E.a ** E.b : number ->E.a : E +>E.a : E.a >E : typeof E ->a : E ->E.b : E +>a : E.a +>E.b : E.b >E : typeof E ->b : E +>b : E.b var r9 = E.a ** 1; >r9 : number >E.a ** 1 : number ->E.a : E +>E.a : E.a >E : typeof E ->a : E ->1 : number +>a : E.a +>1 : 1 var r10 = a ** E.b; >r10 : number >a ** E.b : number >a : any ->E.b : E +>E.b : E.b >E : typeof E ->b : E +>b : E.b var r11 = b ** E.b; >r11 : number >b ** E.b : number >b : number ->E.b : E +>E.b : E.b >E : typeof E ->b : E +>b : E.b var r12 = 1 ** E.b; >r12 : number >1 ** E.b : number ->1 : number ->E.b : E +>1 : 1 +>E.b : E.b >E : typeof E ->b : E +>b : E.b diff --git a/tests/baselines/reference/exponentiationOperatorWithEnumUnion.types b/tests/baselines/reference/exponentiationOperatorWithEnumUnion.types index 5be479b9e63..52b714d951f 100644 --- a/tests/baselines/reference/exponentiationOperatorWithEnumUnion.types +++ b/tests/baselines/reference/exponentiationOperatorWithEnumUnion.types @@ -5,19 +5,19 @@ enum E { >E : E a, ->a : E +>a : E.a b ->b : E +>b : E.b } enum F { >F : F c, ->c : F +>c : F.c d ->d : F +>d : F.d } var a: any; @@ -65,58 +65,58 @@ var r5 = b ** c; var r6 = E.a ** a; >r6 : number >E.a ** a : number ->E.a : E +>E.a : E.a >E : typeof E ->a : E +>a : E.a >a : any var r7 = E.a ** b; >r7 : number >E.a ** b : number ->E.a : E +>E.a : E.a >E : typeof E ->a : E +>a : E.a >b : number var r8 = E.a ** E.b; >r8 : number >E.a ** E.b : number ->E.a : E +>E.a : E.a >E : typeof E ->a : E ->E.b : E +>a : E.a +>E.b : E.b >E : typeof E ->b : E +>b : E.b var r9 = E.a ** 1; >r9 : number >E.a ** 1 : number ->E.a : E +>E.a : E.a >E : typeof E ->a : E ->1 : number +>a : E.a +>1 : 1 var r10 = a ** E.b; >r10 : number >a ** E.b : number >a : any ->E.b : E +>E.b : E.b >E : typeof E ->b : E +>b : E.b var r11 = b ** E.b; >r11 : number >b ** E.b : number >b : number ->E.b : E +>E.b : E.b >E : typeof E ->b : E +>b : E.b var r12 = 1 ** E.b; >r12 : number >1 ** E.b : number ->1 : number ->E.b : E +>1 : 1 +>E.b : E.b >E : typeof E ->b : E +>b : E.b diff --git a/tests/baselines/reference/exponentiationOperatorWithNullValueAndValidOperands.types b/tests/baselines/reference/exponentiationOperatorWithNullValueAndValidOperands.types index 2a3c4807763..3d9841a18ef 100644 --- a/tests/baselines/reference/exponentiationOperatorWithNullValueAndValidOperands.types +++ b/tests/baselines/reference/exponentiationOperatorWithNullValueAndValidOperands.types @@ -6,10 +6,10 @@ enum E { >E : E a, ->a : E +>a : E.a b ->b : E +>b : E.b } var a: any; @@ -35,15 +35,15 @@ var r3 = null ** 1; >r3 : number >null ** 1 : number >null : null ->1 : number +>1 : 1 var r4 = null ** E.a; >r4 : number >null ** E.a : number >null : null ->E.a : E +>E.a : E.a >E : typeof E ->a : E +>a : E.a var r5 = a ** null; >r5 : number @@ -60,14 +60,14 @@ var r6 = b ** null; var r7 = 0 ** null; >r7 : number >0 ** null : number ->0 : number +>0 : 0 >null : null var r8 = E.b ** null; >r8 : number >E.b ** null : number ->E.b : E +>E.b : E.b >E : typeof E ->b : E +>b : E.b >null : null diff --git a/tests/baselines/reference/exponentiationOperatorWithUndefinedValueAndValidOperands.types b/tests/baselines/reference/exponentiationOperatorWithUndefinedValueAndValidOperands.types index 4e44144511e..7ccc43df30c 100644 --- a/tests/baselines/reference/exponentiationOperatorWithUndefinedValueAndValidOperands.types +++ b/tests/baselines/reference/exponentiationOperatorWithUndefinedValueAndValidOperands.types @@ -6,10 +6,10 @@ enum E { >E : E a, ->a : E +>a : E.a b ->b : E +>b : E.b } var a: any; @@ -35,15 +35,15 @@ var rk3 = undefined ** 1; >rk3 : number >undefined ** 1 : number >undefined : undefined ->1 : number +>1 : 1 var rk4 = undefined ** E.a; >rk4 : number >undefined ** E.a : number >undefined : undefined ->E.a : E +>E.a : E.a >E : typeof E ->a : E +>a : E.a var rk5 = a ** undefined; >rk5 : number @@ -60,14 +60,14 @@ var rk6 = b ** undefined; var rk7 = 0 ** undefined; >rk7 : number >0 ** undefined : number ->0 : number +>0 : 0 >undefined : undefined var rk8 = E.b ** undefined; >rk8 : number >E.b ** undefined : number ->E.b : E +>E.b : E.b >E : typeof E ->b : E +>b : E.b >undefined : undefined diff --git a/tests/baselines/reference/exportArrayBindingPattern.js b/tests/baselines/reference/exportArrayBindingPattern.js new file mode 100644 index 00000000000..386419e5725 --- /dev/null +++ b/tests/baselines/reference/exportArrayBindingPattern.js @@ -0,0 +1,11 @@ +//// [exportArrayBindingPattern.ts] +// issue: https://github.com/Microsoft/TypeScript/issues/10778 +const [a, , b] = [1, 2, 3]; +export { a, b }; + +//// [exportArrayBindingPattern.js] +"use strict"; +// issue: https://github.com/Microsoft/TypeScript/issues/10778 +var _a = [1, 2, 3], a = _a[0], b = _a[2]; +exports.a = a; +exports.b = b; diff --git a/tests/baselines/reference/exportArrayBindingPattern.symbols b/tests/baselines/reference/exportArrayBindingPattern.symbols new file mode 100644 index 00000000000..96fb5cabc88 --- /dev/null +++ b/tests/baselines/reference/exportArrayBindingPattern.symbols @@ -0,0 +1,10 @@ +=== tests/cases/compiler/exportArrayBindingPattern.ts === +// issue: https://github.com/Microsoft/TypeScript/issues/10778 +const [a, , b] = [1, 2, 3]; +>a : Symbol(a, Decl(exportArrayBindingPattern.ts, 1, 7)) +>b : Symbol(b, Decl(exportArrayBindingPattern.ts, 1, 11)) + +export { a, b }; +>a : Symbol(a, Decl(exportArrayBindingPattern.ts, 2, 8)) +>b : Symbol(b, Decl(exportArrayBindingPattern.ts, 2, 11)) + diff --git a/tests/baselines/reference/exportArrayBindingPattern.types b/tests/baselines/reference/exportArrayBindingPattern.types new file mode 100644 index 00000000000..f3ea5b2592b --- /dev/null +++ b/tests/baselines/reference/exportArrayBindingPattern.types @@ -0,0 +1,15 @@ +=== tests/cases/compiler/exportArrayBindingPattern.ts === +// issue: https://github.com/Microsoft/TypeScript/issues/10778 +const [a, , b] = [1, 2, 3]; +>a : number +> : undefined +>b : number +>[1, 2, 3] : [number, number, number] +>1 : 1 +>2 : 2 +>3 : 3 + +export { a, b }; +>a : number +>b : number + diff --git a/tests/baselines/reference/exportAssignDottedName.types b/tests/baselines/reference/exportAssignDottedName.types index 6fceb21231c..a2dd681ed8a 100644 --- a/tests/baselines/reference/exportAssignDottedName.types +++ b/tests/baselines/reference/exportAssignDottedName.types @@ -12,6 +12,6 @@ export function x(){ >x : () => boolean return true; ->true : boolean +>true : true } diff --git a/tests/baselines/reference/exportAssignImportedIdentifier.types b/tests/baselines/reference/exportAssignImportedIdentifier.types index e70de693624..f07e908695e 100644 --- a/tests/baselines/reference/exportAssignImportedIdentifier.types +++ b/tests/baselines/reference/exportAssignImportedIdentifier.types @@ -12,7 +12,7 @@ export function x(){ >x : () => boolean return true; ->true : boolean +>true : true } === tests/cases/conformance/externalModules/foo2.ts === diff --git a/tests/baselines/reference/exportAssignTypes.types b/tests/baselines/reference/exportAssignTypes.types index dc99d1512f1..a25a55bfd41 100644 --- a/tests/baselines/reference/exportAssignTypes.types +++ b/tests/baselines/reference/exportAssignTypes.types @@ -57,7 +57,7 @@ var v7: {(p1: x): x} = iGeneric; === tests/cases/conformance/externalModules/expString.ts === var x = "test"; >x : string ->"test" : string +>"test" : "test" export = x; >x : string @@ -65,7 +65,7 @@ export = x; === tests/cases/conformance/externalModules/expNumber.ts === var x = 42; >x : number ->42 : number +>42 : 42 export = x; >x : number @@ -73,7 +73,7 @@ export = x; === tests/cases/conformance/externalModules/expBoolean.ts === var x = true; >x : boolean ->true : boolean +>true : true export = x; >x : boolean @@ -82,8 +82,8 @@ export = x; var x = [1,2]; >x : number[] >[1,2] : number[] ->1 : number ->2 : number +>1 : 1 +>2 : 2 export = x; >x : number[] @@ -93,9 +93,9 @@ var x = { answer: 42, when: 1776}; >x : { answer: number; when: number; } >{ answer: 42, when: 1776} : { answer: number; when: number; } >answer : number ->42 : number +>42 : 42 >when : number ->1776 : number +>1776 : 1776 export = x; >x : { answer: number; when: number; } diff --git a/tests/baselines/reference/exportAssignValueAndType.types b/tests/baselines/reference/exportAssignValueAndType.types index 2dc7442b9ac..221033220f5 100644 --- a/tests/baselines/reference/exportAssignValueAndType.types +++ b/tests/baselines/reference/exportAssignValueAndType.types @@ -21,7 +21,7 @@ interface server { var x = 5; >x : number ->5 : number +>5 : 5 var server = new Date(); >server : Date diff --git a/tests/baselines/reference/exportAssignmentClass.types b/tests/baselines/reference/exportAssignmentClass.types index b724c837244..6081d965584 100644 --- a/tests/baselines/reference/exportAssignmentClass.types +++ b/tests/baselines/reference/exportAssignmentClass.types @@ -17,7 +17,7 @@ var x = d.p; class C { public p = 0; } >C : C >p : number ->0 : number +>0 : 0 export = C; >C : C diff --git a/tests/baselines/reference/exportAssignmentConstrainedGenericType.errors.txt b/tests/baselines/reference/exportAssignmentConstrainedGenericType.errors.txt index cf63c48925f..5ba27334f5e 100644 --- a/tests/baselines/reference/exportAssignmentConstrainedGenericType.errors.txt +++ b/tests/baselines/reference/exportAssignmentConstrainedGenericType.errors.txt @@ -1,11 +1,11 @@ -tests/cases/conformance/externalModules/foo_1.ts(2,17): error TS2345: Argument of type 'boolean' is not assignable to parameter of type '{ a: string; b: number; }'. +tests/cases/conformance/externalModules/foo_1.ts(2,17): error TS2345: Argument of type 'true' is not assignable to parameter of type '{ a: string; b: number; }'. ==== tests/cases/conformance/externalModules/foo_1.ts (1 errors) ==== import foo = require("./foo_0"); var x = new foo(true); // Should error ~~~~ -!!! error TS2345: Argument of type 'boolean' is not assignable to parameter of type '{ a: string; b: number; }'. +!!! error TS2345: Argument of type 'true' is not assignable to parameter of type '{ a: string; b: number; }'. var y = new foo({a: "test", b: 42}); // Should be OK var z: number = y.test.b; ==== tests/cases/conformance/externalModules/foo_0.ts (0 errors) ==== diff --git a/tests/baselines/reference/exportAssignmentEnum.types b/tests/baselines/reference/exportAssignmentEnum.types index a186cf6f255..23a3fd4d141 100644 --- a/tests/baselines/reference/exportAssignmentEnum.types +++ b/tests/baselines/reference/exportAssignmentEnum.types @@ -4,34 +4,34 @@ import EnumE = require("./exportAssignmentEnum_A"); var a = EnumE.A; >a : EnumE ->EnumE.A : EnumE +>EnumE.A : EnumE.A >EnumE : typeof EnumE ->A : EnumE +>A : EnumE.A var b = EnumE.B; >b : EnumE ->EnumE.B : EnumE +>EnumE.B : EnumE.B >EnumE : typeof EnumE ->B : EnumE +>B : EnumE.B var c = EnumE.C; >c : EnumE ->EnumE.C : EnumE +>EnumE.C : EnumE.C >EnumE : typeof EnumE ->C : EnumE +>C : EnumE.C === tests/cases/compiler/exportAssignmentEnum_A.ts === enum E { >E : E A, ->A : E +>A : E.A B, ->B : E +>B : E.B C, ->C : E +>C : E.C } export = E; diff --git a/tests/baselines/reference/exportAssignmentFunction.types b/tests/baselines/reference/exportAssignmentFunction.types index bd10465d221..e22cb061739 100644 --- a/tests/baselines/reference/exportAssignmentFunction.types +++ b/tests/baselines/reference/exportAssignmentFunction.types @@ -10,7 +10,7 @@ var n: number = fooFunc(); === tests/cases/compiler/exportAssignmentFunction_A.ts === function foo() { return 0; } >foo : () => number ->0 : number +>0 : 0 export = foo; >foo : () => number diff --git a/tests/baselines/reference/exportAssignmentMergedInterface.types b/tests/baselines/reference/exportAssignmentMergedInterface.types index 52978783f6d..2a7449a60fb 100644 --- a/tests/baselines/reference/exportAssignmentMergedInterface.types +++ b/tests/baselines/reference/exportAssignmentMergedInterface.types @@ -9,12 +9,12 @@ var x: foo; x("test"); >x("test") : void >x : foo ->"test" : string +>"test" : "test" x(42); >x(42) : number >x : foo ->42 : number +>42 : 42 var y: string = x.b; >y : string @@ -33,9 +33,9 @@ var z = {x: 1, y: 2}; >z : { x: number; y: number; } >{x: 1, y: 2} : { x: number; y: number; } >x : number ->1 : number +>1 : 1 >y : number ->2 : number +>2 : 2 z = x.d; >z = x.d : { x: number; y: number; } diff --git a/tests/baselines/reference/exportAssignmentMergedModule.types b/tests/baselines/reference/exportAssignmentMergedModule.types index 39f0d8d859e..239b65e08ad 100644 --- a/tests/baselines/reference/exportAssignmentMergedModule.types +++ b/tests/baselines/reference/exportAssignmentMergedModule.types @@ -27,7 +27,7 @@ if(!!foo.b){ >foo.c : (a: number) => number >foo : typeof foo >c : (a: number) => number ->42 : number +>42 : 42 } === tests/cases/conformance/externalModules/foo_0.ts === module Foo { @@ -37,11 +37,11 @@ module Foo { >a : () => number return 5; ->5 : number +>5 : 5 } export var b = true; >b : boolean ->true : boolean +>true : true } module Foo { >Foo : typeof Foo @@ -58,7 +58,7 @@ module Foo { export var answer = 42; >answer : number ->42 : number +>42 : 42 } } export = Foo; diff --git a/tests/baselines/reference/exportAssignmentOfDeclaredExternalModule.errors.txt b/tests/baselines/reference/exportAssignmentOfDeclaredExternalModule.errors.txt index b0bfac0adfd..a82be89da4e 100644 --- a/tests/baselines/reference/exportAssignmentOfDeclaredExternalModule.errors.txt +++ b/tests/baselines/reference/exportAssignmentOfDeclaredExternalModule.errors.txt @@ -1,5 +1,5 @@ -tests/cases/compiler/exportAssignmentOfDeclaredExternalModule_1.ts(3,13): error TS2304: Cannot find name 'Sammy'. -tests/cases/compiler/exportAssignmentOfDeclaredExternalModule_1.ts(4,9): error TS2304: Cannot find name 'Sammy'. +tests/cases/compiler/exportAssignmentOfDeclaredExternalModule_1.ts(3,13): error TS2693: 'Sammy' only refers to a type, but is being used as a value here. +tests/cases/compiler/exportAssignmentOfDeclaredExternalModule_1.ts(4,9): error TS2693: 'Sammy' only refers to a type, but is being used as a value here. ==== tests/cases/compiler/exportAssignmentOfDeclaredExternalModule_1.ts (2 errors) ==== @@ -7,10 +7,10 @@ tests/cases/compiler/exportAssignmentOfDeclaredExternalModule_1.ts(4,9): error T import Sammy = require('./exportAssignmentOfDeclaredExternalModule_0'); var x = new Sammy(); // error to use as constructor as there is not constructor symbol ~~~~~ -!!! error TS2304: Cannot find name 'Sammy'. +!!! error TS2693: 'Sammy' only refers to a type, but is being used as a value here. var y = Sammy(); // error to use interface name as call target ~~~~~ -!!! error TS2304: Cannot find name 'Sammy'. +!!! error TS2693: 'Sammy' only refers to a type, but is being used as a value here. var z: Sammy; // no error - z is of type interface Sammy from module 'M' var a = new z(); // constructor - no error var b = z(); // call signature - no error diff --git a/tests/baselines/reference/exportAssignmentTopLevelClodule.types b/tests/baselines/reference/exportAssignmentTopLevelClodule.types index a8a827ba9c3..559514129b7 100644 --- a/tests/baselines/reference/exportAssignmentTopLevelClodule.types +++ b/tests/baselines/reference/exportAssignmentTopLevelClodule.types @@ -21,14 +21,14 @@ class Foo { test = "test"; >test : string ->"test" : string +>"test" : "test" } module Foo { >Foo : typeof Foo export var answer = 42; >answer : number ->42 : number +>42 : 42 } export = Foo; >Foo : Foo diff --git a/tests/baselines/reference/exportAssignmentTopLevelEnumdule.types b/tests/baselines/reference/exportAssignmentTopLevelEnumdule.types index fba15dc3ca8..f67a691d020 100644 --- a/tests/baselines/reference/exportAssignmentTopLevelEnumdule.types +++ b/tests/baselines/reference/exportAssignmentTopLevelEnumdule.types @@ -26,16 +26,16 @@ enum foo { >foo : foo red, green, blue ->red : foo ->green : foo ->blue : foo +>red : foo.red +>green : foo.green +>blue : foo.blue } module foo { >foo : typeof foo export var answer = 42; >answer : number ->42 : number +>42 : 42 } export = foo; >foo : foo diff --git a/tests/baselines/reference/exportAssignmentTopLevelFundule.types b/tests/baselines/reference/exportAssignmentTopLevelFundule.types index 950693dcc62..644fc086dbc 100644 --- a/tests/baselines/reference/exportAssignmentTopLevelFundule.types +++ b/tests/baselines/reference/exportAssignmentTopLevelFundule.types @@ -20,14 +20,14 @@ function foo() { >foo : typeof foo return "test"; ->"test" : string +>"test" : "test" } module foo { >foo : typeof foo export var answer = 42; >answer : number ->42 : number +>42 : 42 } export = foo; >foo : typeof foo diff --git a/tests/baselines/reference/exportAssignmentTopLevelIdentifier.types b/tests/baselines/reference/exportAssignmentTopLevelIdentifier.types index 9851eab1898..e7a35a9a69c 100644 --- a/tests/baselines/reference/exportAssignmentTopLevelIdentifier.types +++ b/tests/baselines/reference/exportAssignmentTopLevelIdentifier.types @@ -17,7 +17,7 @@ module Foo { export var answer = 42; >answer : number ->42 : number +>42 : 42 } export = Foo; >Foo : typeof Foo diff --git a/tests/baselines/reference/exportAssignmentVariable.types b/tests/baselines/reference/exportAssignmentVariable.types index 7c6d9b45cce..219a2f9f9a1 100644 --- a/tests/baselines/reference/exportAssignmentVariable.types +++ b/tests/baselines/reference/exportAssignmentVariable.types @@ -9,7 +9,7 @@ var n: number = y; === tests/cases/compiler/exportAssignmentVariable_A.ts === var x = 0; >x : number ->0 : number +>0 : 0 export = x; >x : number diff --git a/tests/baselines/reference/exportCodeGen.types b/tests/baselines/reference/exportCodeGen.types index e08678a76da..03d4ea0d977 100644 --- a/tests/baselines/reference/exportCodeGen.types +++ b/tests/baselines/reference/exportCodeGen.types @@ -7,7 +7,7 @@ module A { export var x = 12; >x : number ->12 : number +>12 : 12 function lt12() { >lt12 : () => boolean @@ -15,7 +15,7 @@ module A { return x < 12; >x < 12 : boolean >x : number ->12 : number +>12 : 12 } } @@ -25,7 +25,7 @@ module B { var x = 12; >x : number ->12 : number +>12 : 12 function lt12() { >lt12 : () => boolean @@ -33,7 +33,7 @@ module B { return x < 12; >x < 12 : boolean >x : number ->12 : number +>12 : 12 } } @@ -45,7 +45,7 @@ module C { >no : () => boolean return false; ->false : boolean +>false : false } } @@ -57,7 +57,7 @@ module D { >yes : () => boolean return true; ->true : boolean +>true : true } } @@ -85,7 +85,7 @@ module E { export var x = 42; >x : number ->42 : number +>42 : 42 } } @@ -114,6 +114,6 @@ module F { var x = 42; >x : number ->42 : number +>42 : 42 } } diff --git a/tests/baselines/reference/exportDeclarationWithModuleSpecifierNameOnNextLine1.types b/tests/baselines/reference/exportDeclarationWithModuleSpecifierNameOnNextLine1.types index 1ad841fe947..ec229047501 100644 --- a/tests/baselines/reference/exportDeclarationWithModuleSpecifierNameOnNextLine1.types +++ b/tests/baselines/reference/exportDeclarationWithModuleSpecifierNameOnNextLine1.types @@ -2,7 +2,7 @@ export var x = "x"; >x : string ->"x" : string +>"x" : "x" === tests/cases/compiler/t2.ts === export { x } from diff --git a/tests/baselines/reference/exportDefaultAsyncFunction2.types b/tests/baselines/reference/exportDefaultAsyncFunction2.types index ae66620159d..a9ff903e53a 100644 --- a/tests/baselines/reference/exportDefaultAsyncFunction2.types +++ b/tests/baselines/reference/exportDefaultAsyncFunction2.types @@ -24,12 +24,12 @@ export default async(() => await(Promise.resolve(1))); >Promise.resolve : { (value: T | PromiseLike): Promise; (): Promise; } >Promise : PromiseConstructor >resolve : { (value: T | PromiseLike): Promise; (): Promise; } ->1 : number +>1 : 1 === tests/cases/compiler/b.ts === export default async () => { return 0; }; >async () => { return 0; } : () => Promise ->0 : number +>0 : 0 === tests/cases/compiler/c.ts === import { async, await } from 'asyncawait'; diff --git a/tests/baselines/reference/exportDefaultClassWithStaticPropertyAssignmentsInES6.types b/tests/baselines/reference/exportDefaultClassWithStaticPropertyAssignmentsInES6.types index 657e0301f83..47e83523da1 100644 --- a/tests/baselines/reference/exportDefaultClassWithStaticPropertyAssignmentsInES6.types +++ b/tests/baselines/reference/exportDefaultClassWithStaticPropertyAssignmentsInES6.types @@ -2,5 +2,5 @@ export default class { static z: string = "Foo"; >z : string ->"Foo" : string +>"Foo" : "Foo" } diff --git a/tests/baselines/reference/exportDefaultProperty.types b/tests/baselines/reference/exportDefaultProperty.types index 47cfabfbc16..67de741fde4 100644 --- a/tests/baselines/reference/exportDefaultProperty.types +++ b/tests/baselines/reference/exportDefaultProperty.types @@ -39,7 +39,7 @@ import fooLength from "./b"; fooLength + 1; >fooLength + 1 : number >fooLength : number ->1 : number +>1 : 1 === tests/cases/compiler/declarations.d.ts === // This test is just like exportEqualsProperty, but with `export default`. @@ -82,7 +82,7 @@ namespace A { export namespace B { export const b: number = 0; } >B : typeof B >b : number ->0 : number +>0 : 0 } export default A.B; >A.B : typeof default @@ -92,6 +92,6 @@ export default A.B; === tests/cases/compiler/b.ts === export default "foo".length; >"foo".length : number ->"foo" : string +>"foo" : "foo" >length : number diff --git a/tests/baselines/reference/exportEqualNamespaces.types b/tests/baselines/reference/exportEqualNamespaces.types index 0e27102c015..46c6e2a5533 100644 --- a/tests/baselines/reference/exportEqualNamespaces.types +++ b/tests/baselines/reference/exportEqualNamespaces.types @@ -21,7 +21,7 @@ interface server { var x = 5; >x : number ->5 : number +>5 : 5 var server = new Date(); >server : Date diff --git a/tests/baselines/reference/exportEqualsAmd.types b/tests/baselines/reference/exportEqualsAmd.types index f5b1bb49910..e6f76b411cb 100644 --- a/tests/baselines/reference/exportEqualsAmd.types +++ b/tests/baselines/reference/exportEqualsAmd.types @@ -1,6 +1,6 @@ === tests/cases/compiler/exportEqualsAmd.ts === export = { ["hi"]: "there" }; >{ ["hi"]: "there" } : { ["hi"]: string; } ->"hi" : string ->"there" : string +>"hi" : "hi" +>"there" : "there" diff --git a/tests/baselines/reference/exportEqualsCommonJs.types b/tests/baselines/reference/exportEqualsCommonJs.types index 13b968595be..ea0c082edff 100644 --- a/tests/baselines/reference/exportEqualsCommonJs.types +++ b/tests/baselines/reference/exportEqualsCommonJs.types @@ -1,6 +1,6 @@ === tests/cases/compiler/exportEqualsCommonJs.ts === export = { ["hi"]: "there" }; >{ ["hi"]: "there" } : { ["hi"]: string; } ->"hi" : string ->"there" : string +>"hi" : "hi" +>"there" : "there" diff --git a/tests/baselines/reference/exportEqualsDefaultProperty.types b/tests/baselines/reference/exportEqualsDefaultProperty.types index 31a6c8052f9..b6e3be008a1 100644 --- a/tests/baselines/reference/exportEqualsDefaultProperty.types +++ b/tests/baselines/reference/exportEqualsDefaultProperty.types @@ -5,10 +5,10 @@ var x = { >{ "greeting": "hello, world", "default": 42} : { "greeting": string; "default": number; } "greeting": "hello, world", ->"hello, world" : string +>"hello, world" : "hello, world" "default": 42 ->42 : number +>42 : 42 }; @@ -24,5 +24,5 @@ foo.toExponential(2); >foo.toExponential : (fractionDigits?: number) => string >foo : number >toExponential : (fractionDigits?: number) => string ->2 : number +>2 : 2 diff --git a/tests/baselines/reference/exportEqualsProperty.types b/tests/baselines/reference/exportEqualsProperty.types index a92af53b12b..9386a60a7f9 100644 --- a/tests/baselines/reference/exportEqualsProperty.types +++ b/tests/baselines/reference/exportEqualsProperty.types @@ -34,7 +34,7 @@ import fooLength = require("./b"); fooLength + 1; >fooLength + 1 : number >fooLength : number ->1 : number +>1 : 1 === tests/cases/compiler/declarations.d.ts === // This test is just like exportDefaultProperty, but with `export =`. @@ -77,7 +77,7 @@ namespace A { export namespace B { export const b: number = 0; } >B : typeof B >b : number ->0 : number +>0 : 0 } export = A.B; >A.B : typeof A.B @@ -87,6 +87,6 @@ export = A.B; === tests/cases/compiler/b.ts === export = "foo".length; >"foo".length : number ->"foo" : string +>"foo" : "foo" >length : number diff --git a/tests/baselines/reference/exportEqualsUmd.types b/tests/baselines/reference/exportEqualsUmd.types index ab456f0ae48..6b3110dc2a4 100644 --- a/tests/baselines/reference/exportEqualsUmd.types +++ b/tests/baselines/reference/exportEqualsUmd.types @@ -1,6 +1,6 @@ === tests/cases/compiler/exportEqualsUmd.ts === export = { ["hi"]: "there" }; >{ ["hi"]: "there" } : { ["hi"]: string; } ->"hi" : string ->"there" : string +>"hi" : "hi" +>"there" : "there" diff --git a/tests/baselines/reference/exportImport.types b/tests/baselines/reference/exportImport.types index a6361d3cbac..decfe97a594 100644 --- a/tests/baselines/reference/exportImport.types +++ b/tests/baselines/reference/exportImport.types @@ -21,7 +21,7 @@ export = Widget1 class Widget1 { name = 'one'; } >Widget1 : Widget1 >name : string ->'one' : string +>'one' : "one" === tests/cases/compiler/exporter.ts === export import w = require('./w1'); diff --git a/tests/baselines/reference/exportImportAlias.types b/tests/baselines/reference/exportImportAlias.types index f0c21d461bc..4d79214f9b8 100644 --- a/tests/baselines/reference/exportImportAlias.types +++ b/tests/baselines/reference/exportImportAlias.types @@ -6,7 +6,7 @@ module A { export var x = 'hello world' >x : string ->'hello world' : string +>'hello world' : "hello world" export class Point { >Point : Point @@ -53,8 +53,8 @@ var b: { x: number; y: number; } = new C.a.Point(0, 0); >C : typeof C >a : typeof A >Point : typeof A.Point ->0 : number ->0 : number +>0 : 0 +>0 : 0 var c: { name: string }; >c : { name: string; } @@ -74,7 +74,7 @@ module X { >Y : typeof Y return 42; ->42 : number +>42 : 42 } export module Y { @@ -117,8 +117,8 @@ var n: { x: number; y: number; } = new Z.y.Point(0, 0); >Z : typeof Z >y : typeof X.Y >Point : typeof X.Y.Point ->0 : number ->0 : number +>0 : 0 +>0 : 0 module K { >K : typeof K @@ -135,7 +135,7 @@ module K { export var y = 12; >y : number ->12 : number +>12 : 12 export interface Point { >Point : Point @@ -168,7 +168,7 @@ var o = new M.D('Hello'); >M.D : typeof K.L >M : typeof M >D : typeof K.L ->'Hello' : string +>'Hello' : "Hello" var p: { x: number; y: number; } >p : { x: number; y: number; } diff --git a/tests/baselines/reference/exportImportAndClodule.types b/tests/baselines/reference/exportImportAndClodule.types index 36ca259666c..8f0150b0e17 100644 --- a/tests/baselines/reference/exportImportAndClodule.types +++ b/tests/baselines/reference/exportImportAndClodule.types @@ -13,7 +13,7 @@ module K { export var y = 12; >y : number ->12 : number +>12 : 12 export interface Point { >Point : Point @@ -44,7 +44,7 @@ var o = new M.D('Hello'); >M.D : typeof K.L >M : typeof M >D : typeof K.L ->'Hello' : string +>'Hello' : "Hello" var p: { x: number; y: number; } >p : { x: number; y: number; } diff --git a/tests/baselines/reference/exportImportMultipleFiles.types b/tests/baselines/reference/exportImportMultipleFiles.types index 6ac5e7641ea..c4bdce56bf0 100644 --- a/tests/baselines/reference/exportImportMultipleFiles.types +++ b/tests/baselines/reference/exportImportMultipleFiles.types @@ -9,8 +9,8 @@ lib.math.add(3, 4); // Shouldnt be error >lib : typeof lib >math : typeof lib.math >add : (a: any, b: any) => any ->3 : number ->4 : number +>3 : 3 +>4 : 4 === tests/cases/compiler/exportImportMultipleFiles_math.ts === export function add(a, b) { return a + b; } @@ -30,6 +30,6 @@ math.add(3, 4); // OK >math.add : (a: any, b: any) => any >math : typeof math >add : (a: any, b: any) => any ->3 : number ->4 : number +>3 : 3 +>4 : 4 diff --git a/tests/baselines/reference/exportImportNonInstantiatedModule.types b/tests/baselines/reference/exportImportNonInstantiatedModule.types index 0b1da72dad8..d43cd69dac7 100644 --- a/tests/baselines/reference/exportImportNonInstantiatedModule.types +++ b/tests/baselines/reference/exportImportNonInstantiatedModule.types @@ -23,5 +23,5 @@ var x: B.A1.I = { x: 1 }; >I : A.I >{ x: 1 } : { x: number; } >x : number ->1 : number +>1 : 1 diff --git a/tests/baselines/reference/exportImportNonInstantiatedModule2.types b/tests/baselines/reference/exportImportNonInstantiatedModule2.types index 34f0810c12d..01016fcc4ec 100644 --- a/tests/baselines/reference/exportImportNonInstantiatedModule2.types +++ b/tests/baselines/reference/exportImportNonInstantiatedModule2.types @@ -10,7 +10,7 @@ export function w(): e.w { // Should be OK return {name: 'value' }; >{name: 'value' } : { name: string; } >name : string ->'value' : string +>'value' : "value" } === tests/cases/compiler/w1.ts === diff --git a/tests/baselines/reference/exportNonVisibleType.types b/tests/baselines/reference/exportNonVisibleType.types index 2ad420ac531..2bb65cf05f0 100644 --- a/tests/baselines/reference/exportNonVisibleType.types +++ b/tests/baselines/reference/exportNonVisibleType.types @@ -14,9 +14,9 @@ var x: I1 = {a: "test", b: 42}; >I1 : I1 >{a: "test", b: 42} : { a: string; b: number; } >a : string ->"test" : string +>"test" : "test" >b : number ->42 : number +>42 : 42 export = x; // Should fail, I1 not exported. >x : I1 diff --git a/tests/baselines/reference/exportPrivateType.types b/tests/baselines/reference/exportPrivateType.types index a91577c2b9c..5a986f94f63 100644 --- a/tests/baselines/reference/exportPrivateType.types +++ b/tests/baselines/reference/exportPrivateType.types @@ -18,7 +18,7 @@ module foo { test() { return true; } >test : () => boolean ->true : boolean +>true : true } interface I1 { diff --git a/tests/baselines/reference/exportSpecifierReferencingOuterDeclaration3.errors.txt b/tests/baselines/reference/exportSpecifierReferencingOuterDeclaration3.errors.txt index e144c48bea4..924f3741999 100644 --- a/tests/baselines/reference/exportSpecifierReferencingOuterDeclaration3.errors.txt +++ b/tests/baselines/reference/exportSpecifierReferencingOuterDeclaration3.errors.txt @@ -1,4 +1,4 @@ -tests/cases/compiler/exportSpecifierReferencingOuterDeclaration3.ts(6,30): error TS2305: Module 'X' has no exported member 'bar'. +tests/cases/compiler/exportSpecifierReferencingOuterDeclaration3.ts(6,30): error TS2694: Namespace 'X' has no exported member 'bar'. ==== tests/cases/compiler/exportSpecifierReferencingOuterDeclaration3.ts (1 errors) ==== @@ -9,5 +9,5 @@ tests/cases/compiler/exportSpecifierReferencingOuterDeclaration3.ts(6,30): error export function foo(): X.foo; export function bar(): X.bar; // error ~~~ -!!! error TS2305: Module 'X' has no exported member 'bar'. +!!! error TS2694: Namespace 'X' has no exported member 'bar'. } \ No newline at end of file diff --git a/tests/baselines/reference/exportSpecifierReferencingOuterDeclaration4.errors.txt b/tests/baselines/reference/exportSpecifierReferencingOuterDeclaration4.errors.txt index 6ac67c70d17..a8ce33cd40e 100644 --- a/tests/baselines/reference/exportSpecifierReferencingOuterDeclaration4.errors.txt +++ b/tests/baselines/reference/exportSpecifierReferencingOuterDeclaration4.errors.txt @@ -1,4 +1,4 @@ -tests/cases/compiler/exportSpecifierReferencingOuterDeclaration2_B.ts(4,34): error TS2305: Module 'X' has no exported member 'bar'. +tests/cases/compiler/exportSpecifierReferencingOuterDeclaration2_B.ts(4,34): error TS2694: Namespace 'X' has no exported member 'bar'. ==== tests/cases/compiler/exportSpecifierReferencingOuterDeclaration2_A.ts (0 errors) ==== @@ -10,4 +10,4 @@ tests/cases/compiler/exportSpecifierReferencingOuterDeclaration2_B.ts(4,34): err export declare function foo(): X.foo; export declare function bar(): X.bar; // error ~~~ -!!! error TS2305: Module 'X' has no exported member 'bar'. \ No newline at end of file +!!! error TS2694: Namespace 'X' has no exported member 'bar'. \ No newline at end of file diff --git a/tests/baselines/reference/exportStarForValues10.types b/tests/baselines/reference/exportStarForValues10.types index 370f02318c1..2be6b0c7bfe 100644 --- a/tests/baselines/reference/exportStarForValues10.types +++ b/tests/baselines/reference/exportStarForValues10.types @@ -2,7 +2,7 @@ export var v = 1; >v : number ->1 : number +>1 : 1 === tests/cases/compiler/file1.ts === export interface Foo { x } @@ -14,5 +14,5 @@ export * from "file0"; export * from "file1"; var x = 1; >x : number ->1 : number +>1 : 1 diff --git a/tests/baselines/reference/exportStarForValues2.types b/tests/baselines/reference/exportStarForValues2.types index f1de53bd7cf..3a92d860ef8 100644 --- a/tests/baselines/reference/exportStarForValues2.types +++ b/tests/baselines/reference/exportStarForValues2.types @@ -8,11 +8,11 @@ export interface Foo { x } export * from "file1" var x = 1; >x : number ->1 : number +>1 : 1 === tests/cases/compiler/file3.ts === export * from "file2" var x = 1; >x : number ->1 : number +>1 : 1 diff --git a/tests/baselines/reference/exportStarForValues3.types b/tests/baselines/reference/exportStarForValues3.types index d2ee5ebb1d4..90d38d86703 100644 --- a/tests/baselines/reference/exportStarForValues3.types +++ b/tests/baselines/reference/exportStarForValues3.types @@ -12,7 +12,7 @@ export interface A { x } export * from "file1" var x = 1; >x : number ->1 : number +>1 : 1 === tests/cases/compiler/file3.ts === export interface B { x } @@ -22,7 +22,7 @@ export interface B { x } export * from "file1" var x = 1; >x : number ->1 : number +>1 : 1 === tests/cases/compiler/file4.ts === export interface C { x } @@ -33,11 +33,11 @@ export * from "file2" export * from "file3" var x = 1; >x : number ->1 : number +>1 : 1 === tests/cases/compiler/file5.ts === export * from "file4" var x = 1; >x : number ->1 : number +>1 : 1 diff --git a/tests/baselines/reference/exportStarForValues4.types b/tests/baselines/reference/exportStarForValues4.types index b381f9461e8..b00dd126a9c 100644 --- a/tests/baselines/reference/exportStarForValues4.types +++ b/tests/baselines/reference/exportStarForValues4.types @@ -13,7 +13,7 @@ export * from "file1" export * from "file3" var x = 1; >x : number ->1 : number +>1 : 1 === tests/cases/compiler/file3.ts === export interface B { x } @@ -23,5 +23,5 @@ export interface B { x } export * from "file2" var x = 1; >x : number ->1 : number +>1 : 1 diff --git a/tests/baselines/reference/exportStarForValues6.types b/tests/baselines/reference/exportStarForValues6.types index 4fe38a45d02..3d418e2dc24 100644 --- a/tests/baselines/reference/exportStarForValues6.types +++ b/tests/baselines/reference/exportStarForValues6.types @@ -8,5 +8,5 @@ export interface Foo { x } export * from "file1" export var x = 1; >x : number ->1 : number +>1 : 1 diff --git a/tests/baselines/reference/exportStarForValues7.types b/tests/baselines/reference/exportStarForValues7.types index d37661320d6..41927bab512 100644 --- a/tests/baselines/reference/exportStarForValues7.types +++ b/tests/baselines/reference/exportStarForValues7.types @@ -8,11 +8,11 @@ export interface Foo { x } export * from "file1" export var x = 1; >x : number ->1 : number +>1 : 1 === tests/cases/compiler/file3.ts === export * from "file2" export var x = 1; >x : number ->1 : number +>1 : 1 diff --git a/tests/baselines/reference/exportStarForValues8.types b/tests/baselines/reference/exportStarForValues8.types index 9cc1484eecb..7d06bd0d1f5 100644 --- a/tests/baselines/reference/exportStarForValues8.types +++ b/tests/baselines/reference/exportStarForValues8.types @@ -12,7 +12,7 @@ export interface A { x } export * from "file1" export var x = 1; >x : number ->1 : number +>1 : 1 === tests/cases/compiler/file3.ts === export interface B { x } @@ -22,7 +22,7 @@ export interface B { x } export * from "file1" export var x = 1; >x : number ->1 : number +>1 : 1 === tests/cases/compiler/file4.ts === export interface C { x } @@ -33,11 +33,11 @@ export * from "file2" export * from "file3" export var x = 1; >x : number ->1 : number +>1 : 1 === tests/cases/compiler/file5.ts === export * from "file4" export var x = 1; >x : number ->1 : number +>1 : 1 diff --git a/tests/baselines/reference/exportStarForValues9.types b/tests/baselines/reference/exportStarForValues9.types index 3cf250ec50b..aa09e1f12cf 100644 --- a/tests/baselines/reference/exportStarForValues9.types +++ b/tests/baselines/reference/exportStarForValues9.types @@ -13,7 +13,7 @@ export * from "file1" export * from "file3" export var x = 1; >x : number ->1 : number +>1 : 1 === tests/cases/compiler/file3.ts === export interface B { x } @@ -23,5 +23,5 @@ export interface B { x } export * from "file2" export var x = 1; >x : number ->1 : number +>1 : 1 diff --git a/tests/baselines/reference/exportStarForValuesInSystem.types b/tests/baselines/reference/exportStarForValuesInSystem.types index 36d07741e10..bbb9a5a6b15 100644 --- a/tests/baselines/reference/exportStarForValuesInSystem.types +++ b/tests/baselines/reference/exportStarForValuesInSystem.types @@ -8,5 +8,5 @@ export interface Foo { x } export * from "file1" var x = 1; >x : number ->1 : number +>1 : 1 diff --git a/tests/baselines/reference/exportToString.types b/tests/baselines/reference/exportToString.types index 17037852f3b..8c3aa782e29 100644 --- a/tests/baselines/reference/exportToString.types +++ b/tests/baselines/reference/exportToString.types @@ -1,8 +1,8 @@ === tests/cases/compiler/exportToString.ts === const toString = 0; ->toString : number ->0 : number +>toString : 0 +>0 : 0 export { toString }; ->toString : number +>toString : 0 diff --git a/tests/baselines/reference/exportVisibility.types b/tests/baselines/reference/exportVisibility.types index cf1e092473e..0249661834b 100644 --- a/tests/baselines/reference/exportVisibility.types +++ b/tests/baselines/reference/exportVisibility.types @@ -14,6 +14,6 @@ export function test(foo: Foo) { >Foo : Foo return true; ->true : boolean +>true : true } diff --git a/tests/baselines/reference/exportedVariable1.types b/tests/baselines/reference/exportedVariable1.types index fa7017fefa8..1d30c50ca3b 100644 --- a/tests/baselines/reference/exportedVariable1.types +++ b/tests/baselines/reference/exportedVariable1.types @@ -3,7 +3,7 @@ export var foo = {name: "Bill"}; >foo : { name: string; } >{name: "Bill"} : { name: string; } >name : string ->"Bill" : string +>"Bill" : "Bill" var upper = foo.name.toUpperCase(); >upper : string diff --git a/tests/baselines/reference/exportsAndImports1-amd.types b/tests/baselines/reference/exportsAndImports1-amd.types index 4ba83121541..05c8b6d7af5 100644 --- a/tests/baselines/reference/exportsAndImports1-amd.types +++ b/tests/baselines/reference/exportsAndImports1-amd.types @@ -2,7 +2,7 @@ var v = 1; >v : number ->1 : number +>1 : 1 function f() { } >f : () => void @@ -17,17 +17,17 @@ enum E { >E : E A, B, C ->A : E ->B : E ->C : E +>A : E.A +>B : E.B +>C : E.C } const enum D { >D : D A, B, C ->A : D ->B : D ->C : D +>A : D.A +>B : D.B +>C : D.C } module M { >M : typeof M diff --git a/tests/baselines/reference/exportsAndImports1-es6.types b/tests/baselines/reference/exportsAndImports1-es6.types index 4ba83121541..05c8b6d7af5 100644 --- a/tests/baselines/reference/exportsAndImports1-es6.types +++ b/tests/baselines/reference/exportsAndImports1-es6.types @@ -2,7 +2,7 @@ var v = 1; >v : number ->1 : number +>1 : 1 function f() { } >f : () => void @@ -17,17 +17,17 @@ enum E { >E : E A, B, C ->A : E ->B : E ->C : E +>A : E.A +>B : E.B +>C : E.C } const enum D { >D : D A, B, C ->A : D ->B : D ->C : D +>A : D.A +>B : D.B +>C : D.C } module M { >M : typeof M diff --git a/tests/baselines/reference/exportsAndImports1.types b/tests/baselines/reference/exportsAndImports1.types index 4ba83121541..05c8b6d7af5 100644 --- a/tests/baselines/reference/exportsAndImports1.types +++ b/tests/baselines/reference/exportsAndImports1.types @@ -2,7 +2,7 @@ var v = 1; >v : number ->1 : number +>1 : 1 function f() { } >f : () => void @@ -17,17 +17,17 @@ enum E { >E : E A, B, C ->A : E ->B : E ->C : E +>A : E.A +>B : E.B +>C : E.C } const enum D { >D : D A, B, C ->A : D ->B : D ->C : D +>A : D.A +>B : D.B +>C : D.C } module M { >M : typeof M diff --git a/tests/baselines/reference/exportsAndImports2-amd.types b/tests/baselines/reference/exportsAndImports2-amd.types index 32de763c567..46e42174a77 100644 --- a/tests/baselines/reference/exportsAndImports2-amd.types +++ b/tests/baselines/reference/exportsAndImports2-amd.types @@ -2,11 +2,11 @@ export var x = "x"; >x : string ->"x" : string +>"x" : "x" export var y = "y"; >y : string ->"y" : string +>"y" : "y" === tests/cases/conformance/es6/modules/t2.ts === export { x as y, y as x } from "./t1"; diff --git a/tests/baselines/reference/exportsAndImports2-es6.types b/tests/baselines/reference/exportsAndImports2-es6.types index 32de763c567..46e42174a77 100644 --- a/tests/baselines/reference/exportsAndImports2-es6.types +++ b/tests/baselines/reference/exportsAndImports2-es6.types @@ -2,11 +2,11 @@ export var x = "x"; >x : string ->"x" : string +>"x" : "x" export var y = "y"; >y : string ->"y" : string +>"y" : "y" === tests/cases/conformance/es6/modules/t2.ts === export { x as y, y as x } from "./t1"; diff --git a/tests/baselines/reference/exportsAndImports2.types b/tests/baselines/reference/exportsAndImports2.types index 32de763c567..46e42174a77 100644 --- a/tests/baselines/reference/exportsAndImports2.types +++ b/tests/baselines/reference/exportsAndImports2.types @@ -2,11 +2,11 @@ export var x = "x"; >x : string ->"x" : string +>"x" : "x" export var y = "y"; >y : string ->"y" : string +>"y" : "y" === tests/cases/conformance/es6/modules/t2.ts === export { x as y, y as x } from "./t1"; diff --git a/tests/baselines/reference/exportsAndImports3-amd.types b/tests/baselines/reference/exportsAndImports3-amd.types index 0b8235d969c..5292f01af0d 100644 --- a/tests/baselines/reference/exportsAndImports3-amd.types +++ b/tests/baselines/reference/exportsAndImports3-amd.types @@ -2,7 +2,7 @@ export var v = 1; >v : number ->1 : number +>1 : 1 export function f() { } >f : () => void @@ -17,17 +17,17 @@ export enum E { >E : E A, B, C ->A : E ->B : E ->C : E +>A : E.A +>B : E.B +>C : E.C } export const enum D { >D : D A, B, C ->A : D ->B : D ->C : D +>A : D.A +>B : D.B +>C : D.C } export module M { >M : typeof M diff --git a/tests/baselines/reference/exportsAndImports3-es6.types b/tests/baselines/reference/exportsAndImports3-es6.types index 0b8235d969c..5292f01af0d 100644 --- a/tests/baselines/reference/exportsAndImports3-es6.types +++ b/tests/baselines/reference/exportsAndImports3-es6.types @@ -2,7 +2,7 @@ export var v = 1; >v : number ->1 : number +>1 : 1 export function f() { } >f : () => void @@ -17,17 +17,17 @@ export enum E { >E : E A, B, C ->A : E ->B : E ->C : E +>A : E.A +>B : E.B +>C : E.C } export const enum D { >D : D A, B, C ->A : D ->B : D ->C : D +>A : D.A +>B : D.B +>C : D.C } export module M { >M : typeof M diff --git a/tests/baselines/reference/exportsAndImports3.types b/tests/baselines/reference/exportsAndImports3.types index 0b8235d969c..5292f01af0d 100644 --- a/tests/baselines/reference/exportsAndImports3.types +++ b/tests/baselines/reference/exportsAndImports3.types @@ -2,7 +2,7 @@ export var v = 1; >v : number ->1 : number +>1 : 1 export function f() { } >f : () => void @@ -17,17 +17,17 @@ export enum E { >E : E A, B, C ->A : E ->B : E ->C : E +>A : E.A +>B : E.B +>C : E.C } export const enum D { >D : D A, B, C ->A : D ->B : D ->C : D +>A : D.A +>B : D.B +>C : D.C } export module M { >M : typeof M diff --git a/tests/baselines/reference/exportsAndImports4-amd.types b/tests/baselines/reference/exportsAndImports4-amd.types index 4bd6f8c0e1e..dfddd897e59 100644 --- a/tests/baselines/reference/exportsAndImports4-amd.types +++ b/tests/baselines/reference/exportsAndImports4-amd.types @@ -3,63 +3,63 @@ import a = require("./t1"); >a : typeof a a.default; ->a.default : string +>a.default : "hello" >a : typeof a ->default : string +>default : "hello" import b from "./t1"; ->b : string +>b : "hello" b; ->b : string +>b : "hello" import * as c from "./t1"; >c : typeof a c.default; ->c.default : string +>c.default : "hello" >c : typeof a ->default : string +>default : "hello" import { default as d } from "./t1"; ->default : string ->d : string +>default : "hello" +>d : "hello" d; ->d : string +>d : "hello" import e1, * as e2 from "./t1"; ->e1 : string +>e1 : "hello" >e2 : typeof a e1; ->e1 : string +>e1 : "hello" e2.default; ->e2.default : string +>e2.default : "hello" >e2 : typeof a ->default : string +>default : "hello" import f1, { default as f2 } from "./t1"; ->f1 : string ->default : string ->f2 : string +>f1 : "hello" +>default : "hello" +>f2 : "hello" f1; ->f1 : string +>f1 : "hello" f2; ->f2 : string +>f2 : "hello" export { a, b, c, d, e1, e2, f1, f2 }; >a : typeof a ->b : string +>b : "hello" >c : typeof a ->d : string ->e1 : string +>d : "hello" +>e1 : "hello" >e2 : typeof a ->f1 : string ->f2 : string +>f1 : "hello" +>f2 : "hello" === tests/cases/conformance/es6/modules/t1.ts === diff --git a/tests/baselines/reference/exportsAndImports4-es6.types b/tests/baselines/reference/exportsAndImports4-es6.types index 4bd6f8c0e1e..dfddd897e59 100644 --- a/tests/baselines/reference/exportsAndImports4-es6.types +++ b/tests/baselines/reference/exportsAndImports4-es6.types @@ -3,63 +3,63 @@ import a = require("./t1"); >a : typeof a a.default; ->a.default : string +>a.default : "hello" >a : typeof a ->default : string +>default : "hello" import b from "./t1"; ->b : string +>b : "hello" b; ->b : string +>b : "hello" import * as c from "./t1"; >c : typeof a c.default; ->c.default : string +>c.default : "hello" >c : typeof a ->default : string +>default : "hello" import { default as d } from "./t1"; ->default : string ->d : string +>default : "hello" +>d : "hello" d; ->d : string +>d : "hello" import e1, * as e2 from "./t1"; ->e1 : string +>e1 : "hello" >e2 : typeof a e1; ->e1 : string +>e1 : "hello" e2.default; ->e2.default : string +>e2.default : "hello" >e2 : typeof a ->default : string +>default : "hello" import f1, { default as f2 } from "./t1"; ->f1 : string ->default : string ->f2 : string +>f1 : "hello" +>default : "hello" +>f2 : "hello" f1; ->f1 : string +>f1 : "hello" f2; ->f2 : string +>f2 : "hello" export { a, b, c, d, e1, e2, f1, f2 }; >a : typeof a ->b : string +>b : "hello" >c : typeof a ->d : string ->e1 : string +>d : "hello" +>e1 : "hello" >e2 : typeof a ->f1 : string ->f2 : string +>f1 : "hello" +>f2 : "hello" === tests/cases/conformance/es6/modules/t1.ts === diff --git a/tests/baselines/reference/exportsAndImports4.types b/tests/baselines/reference/exportsAndImports4.types index 4bd6f8c0e1e..dfddd897e59 100644 --- a/tests/baselines/reference/exportsAndImports4.types +++ b/tests/baselines/reference/exportsAndImports4.types @@ -3,63 +3,63 @@ import a = require("./t1"); >a : typeof a a.default; ->a.default : string +>a.default : "hello" >a : typeof a ->default : string +>default : "hello" import b from "./t1"; ->b : string +>b : "hello" b; ->b : string +>b : "hello" import * as c from "./t1"; >c : typeof a c.default; ->c.default : string +>c.default : "hello" >c : typeof a ->default : string +>default : "hello" import { default as d } from "./t1"; ->default : string ->d : string +>default : "hello" +>d : "hello" d; ->d : string +>d : "hello" import e1, * as e2 from "./t1"; ->e1 : string +>e1 : "hello" >e2 : typeof a e1; ->e1 : string +>e1 : "hello" e2.default; ->e2.default : string +>e2.default : "hello" >e2 : typeof a ->default : string +>default : "hello" import f1, { default as f2 } from "./t1"; ->f1 : string ->default : string ->f2 : string +>f1 : "hello" +>default : "hello" +>f2 : "hello" f1; ->f1 : string +>f1 : "hello" f2; ->f2 : string +>f2 : "hello" export { a, b, c, d, e1, e2, f1, f2 }; >a : typeof a ->b : string +>b : "hello" >c : typeof a ->d : string ->e1 : string +>d : "hello" +>e1 : "hello" >e2 : typeof a ->f1 : string ->f2 : string +>f1 : "hello" +>f2 : "hello" === tests/cases/conformance/es6/modules/t1.ts === diff --git a/tests/baselines/reference/exportsAndImportsWithContextualKeywordNames02.types b/tests/baselines/reference/exportsAndImportsWithContextualKeywordNames02.types index 853fa787f0a..c12e84e320b 100644 --- a/tests/baselines/reference/exportsAndImportsWithContextualKeywordNames02.types +++ b/tests/baselines/reference/exportsAndImportsWithContextualKeywordNames02.types @@ -2,7 +2,7 @@ let as = 100; >as : number ->100 : number +>100 : 100 export { as as return, as }; >as : number diff --git a/tests/baselines/reference/exportsAndImportsWithUnderscores2.types b/tests/baselines/reference/exportsAndImportsWithUnderscores2.types index a684440f5bd..3b86789cc44 100644 --- a/tests/baselines/reference/exportsAndImportsWithUnderscores2.types +++ b/tests/baselines/reference/exportsAndImportsWithUnderscores2.types @@ -9,7 +9,7 @@ export default R = { >{ "__esmodule": true, "__proto__": {}} : { "__esmodule": boolean; "__proto__": {}; } "__esmodule": true, ->true : boolean +>true : true "__proto__": {} >{} : {} diff --git a/tests/baselines/reference/exportsAndImportsWithUnderscores3.types b/tests/baselines/reference/exportsAndImportsWithUnderscores3.types index 5addb44172d..b860928aa62 100644 --- a/tests/baselines/reference/exportsAndImportsWithUnderscores3.types +++ b/tests/baselines/reference/exportsAndImportsWithUnderscores3.types @@ -9,13 +9,13 @@ export default R = { >{ "___": 30, "___hello": 21, "_hi": 40,} : { "___": number; "___hello": number; "_hi": number; } "___": 30, ->30 : number +>30 : 30 "___hello": 21, ->21 : number +>21 : 21 "_hi": 40, ->40 : number +>40 : 40 } === tests/cases/conformance/es6/modules/m2.ts === diff --git a/tests/baselines/reference/exportsAndImportsWithUnderscores4.types b/tests/baselines/reference/exportsAndImportsWithUnderscores4.types index a9042042285..cf339db5dee 100644 --- a/tests/baselines/reference/exportsAndImportsWithUnderscores4.types +++ b/tests/baselines/reference/exportsAndImportsWithUnderscores4.types @@ -11,7 +11,7 @@ export function _() { >console.log : any >console : any >log : any ->"_" : string +>"_" : "_" } export function __() { >__ : () => void @@ -21,7 +21,7 @@ export function __() { >console.log : any >console : any >log : any ->"__" : string +>"__" : "__" } export function ___() { >___ : () => void @@ -31,7 +31,7 @@ export function ___() { >console.log : any >console : any >log : any ->"___" : string +>"___" : "___" } export function _hi() { >_hi : () => void @@ -41,7 +41,7 @@ export function _hi() { >console.log : any >console : any >log : any ->"_hi" : string +>"_hi" : "_hi" } export function __proto() { >__proto : () => void @@ -51,7 +51,7 @@ export function __proto() { >console.log : any >console : any >log : any ->"__proto" : string +>"__proto" : "__proto" } export function __esmodule() { >__esmodule : () => void @@ -61,7 +61,7 @@ export function __esmodule() { >console.log : any >console : any >log : any ->"__esmodule" : string +>"__esmodule" : "__esmodule" } export function ___hello(){ >___hello : () => void @@ -71,7 +71,7 @@ export function ___hello(){ >console.log : any >console : any >log : any ->"___hello" : string +>"___hello" : "___hello" } === tests/cases/conformance/es6/modules/m2.ts === diff --git a/tests/baselines/reference/expr.errors.txt b/tests/baselines/reference/expr.errors.txt index 41d15a0835b..17e39cc80be 100644 --- a/tests/baselines/reference/expr.errors.txt +++ b/tests/baselines/reference/expr.errors.txt @@ -4,14 +4,14 @@ tests/cases/compiler/expr.ts(94,5): error TS2365: Operator '==' cannot be applie tests/cases/compiler/expr.ts(95,5): error TS2365: Operator '==' cannot be applied to types 'string' and 'boolean'. tests/cases/compiler/expr.ts(98,5): error TS2365: Operator '==' cannot be applied to types 'string' and 'E'. tests/cases/compiler/expr.ts(115,5): error TS2365: Operator '==' cannot be applied to types 'E' and 'string'. -tests/cases/compiler/expr.ts(116,5): error TS2365: Operator '==' cannot be applied to types 'E' and 'boolean'. -tests/cases/compiler/expr.ts(142,5): error TS2365: Operator '+' cannot be applied to types 'number' and 'boolean'. +tests/cases/compiler/expr.ts(116,5): error TS2365: Operator '==' cannot be applied to types 'E' and 'false'. +tests/cases/compiler/expr.ts(142,5): error TS2365: Operator '+' cannot be applied to types 'number' and 'false'. tests/cases/compiler/expr.ts(143,5): error TS2365: Operator '+' cannot be applied to types 'number' and 'I'. tests/cases/compiler/expr.ts(161,5): error TS2365: Operator '+' cannot be applied to types 'I' and 'number'. -tests/cases/compiler/expr.ts(163,5): error TS2365: Operator '+' cannot be applied to types 'I' and 'boolean'. +tests/cases/compiler/expr.ts(163,5): error TS2365: Operator '+' cannot be applied to types 'I' and 'false'. tests/cases/compiler/expr.ts(165,5): error TS2365: Operator '+' cannot be applied to types 'I' and 'I'. tests/cases/compiler/expr.ts(166,5): error TS2365: Operator '+' cannot be applied to types 'I' and 'E'. -tests/cases/compiler/expr.ts(170,5): error TS2365: Operator '+' cannot be applied to types 'E' and 'boolean'. +tests/cases/compiler/expr.ts(170,5): error TS2365: Operator '+' cannot be applied to types 'E' and 'false'. tests/cases/compiler/expr.ts(172,5): error TS2365: Operator '+' cannot be applied to types 'E' and 'I'. tests/cases/compiler/expr.ts(176,7): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. tests/cases/compiler/expr.ts(177,7): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. @@ -199,7 +199,7 @@ tests/cases/compiler/expr.ts(242,7): error TS2363: The right-hand side of an ari !!! error TS2365: Operator '==' cannot be applied to types 'E' and 'string'. e==b; ~~~~ -!!! error TS2365: Operator '==' cannot be applied to types 'E' and 'boolean'. +!!! error TS2365: Operator '==' cannot be applied to types 'E' and 'false'. e==a; e==i; e==e; @@ -227,7 +227,7 @@ tests/cases/compiler/expr.ts(242,7): error TS2363: The right-hand side of an ari n+s; n+b; ~~~ -!!! error TS2365: Operator '+' cannot be applied to types 'number' and 'boolean'. +!!! error TS2365: Operator '+' cannot be applied to types 'number' and 'false'. n+i; ~~~ !!! error TS2365: Operator '+' cannot be applied to types 'number' and 'I'. @@ -254,7 +254,7 @@ tests/cases/compiler/expr.ts(242,7): error TS2363: The right-hand side of an ari i+s; i+b; ~~~ -!!! error TS2365: Operator '+' cannot be applied to types 'I' and 'boolean'. +!!! error TS2365: Operator '+' cannot be applied to types 'I' and 'false'. i+a; i+i; ~~~ @@ -267,7 +267,7 @@ tests/cases/compiler/expr.ts(242,7): error TS2363: The right-hand side of an ari e+s; e+b; ~~~ -!!! error TS2365: Operator '+' cannot be applied to types 'E' and 'boolean'. +!!! error TS2365: Operator '+' cannot be applied to types 'E' and 'false'. e+a; e+i; ~~~ diff --git a/tests/baselines/reference/extBaseClass1.types b/tests/baselines/reference/extBaseClass1.types index 1ab2ec3ba53..7e25c832f2a 100644 --- a/tests/baselines/reference/extBaseClass1.types +++ b/tests/baselines/reference/extBaseClass1.types @@ -7,7 +7,7 @@ module M { public x=10; >x : number ->10 : number +>10 : 10 } export class C extends B { diff --git a/tests/baselines/reference/extendBooleanInterface.types b/tests/baselines/reference/extendBooleanInterface.types index 8f91deba713..03187040259 100644 --- a/tests/baselines/reference/extendBooleanInterface.types +++ b/tests/baselines/reference/extendBooleanInterface.types @@ -15,35 +15,35 @@ interface Boolean { var x = true; >x : boolean ->true : boolean +>true : true var a: string = x.doStuff(); >a : string >x.doStuff() : string >x.doStuff : () => string ->x : boolean +>x : true >doStuff : () => string var b: string = x.doOtherStuff('hm'); >b : string ->x.doOtherStuff('hm') : string +>x.doOtherStuff('hm') : "hm" >x.doOtherStuff : (x: T) => T ->x : boolean +>x : true >doOtherStuff : (x: T) => T ->'hm' : string +>'hm' : "hm" var c: string = x['doStuff'](); >c : string >x['doStuff']() : string >x['doStuff'] : () => string ->x : boolean ->'doStuff' : string +>x : true +>'doStuff' : "doStuff" var d: string = x['doOtherStuff']('hm'); >d : string ->x['doOtherStuff']('hm') : string +>x['doOtherStuff']('hm') : "hm" >x['doOtherStuff'] : (x: T) => T ->x : boolean ->'doOtherStuff' : string ->'hm' : string +>x : true +>'doOtherStuff' : "doOtherStuff" +>'hm' : "hm" diff --git a/tests/baselines/reference/extendConstructSignatureInInterface.types b/tests/baselines/reference/extendConstructSignatureInInterface.types index 363107b2e54..c89b7ca01f3 100644 --- a/tests/baselines/reference/extendConstructSignatureInInterface.types +++ b/tests/baselines/reference/extendConstructSignatureInInterface.types @@ -21,5 +21,5 @@ var e: E = new E(1); >E : E >new E(1) : E >E : typeof E ->1 : number +>1 : 1 diff --git a/tests/baselines/reference/extendNumberInterface.types b/tests/baselines/reference/extendNumberInterface.types index 97ef307bab8..a6ba453894e 100644 --- a/tests/baselines/reference/extendNumberInterface.types +++ b/tests/baselines/reference/extendNumberInterface.types @@ -15,7 +15,7 @@ interface Number { var x = 1; >x : number ->1 : number +>1 : 1 var a: string = x.doStuff(); >a : string @@ -26,24 +26,24 @@ var a: string = x.doStuff(); var b: string = x.doOtherStuff('hm'); >b : string ->x.doOtherStuff('hm') : string +>x.doOtherStuff('hm') : "hm" >x.doOtherStuff : (x: T) => T >x : number >doOtherStuff : (x: T) => T ->'hm' : string +>'hm' : "hm" var c: string = x['doStuff'](); >c : string >x['doStuff']() : string >x['doStuff'] : () => string >x : number ->'doStuff' : string +>'doStuff' : "doStuff" var d: string = x['doOtherStuff']('hm'); >d : string ->x['doOtherStuff']('hm') : string +>x['doOtherStuff']('hm') : "hm" >x['doOtherStuff'] : (x: T) => T >x : number ->'doOtherStuff' : string ->'hm' : string +>'doOtherStuff' : "doOtherStuff" +>'hm' : "hm" diff --git a/tests/baselines/reference/extendStringInterface.types b/tests/baselines/reference/extendStringInterface.types index edfd8239015..428624dc57f 100644 --- a/tests/baselines/reference/extendStringInterface.types +++ b/tests/baselines/reference/extendStringInterface.types @@ -15,7 +15,7 @@ interface String { var x = ''; >x : string ->'' : string +>'' : "" var a: string = x.doStuff(); >a : string @@ -26,24 +26,24 @@ var a: string = x.doStuff(); var b: string = x.doOtherStuff('hm'); >b : string ->x.doOtherStuff('hm') : string +>x.doOtherStuff('hm') : "hm" >x.doOtherStuff : (x: T) => T >x : string >doOtherStuff : (x: T) => T ->'hm' : string +>'hm' : "hm" var c: string = x['doStuff'](); >c : string >x['doStuff']() : string >x['doStuff'] : () => string >x : string ->'doStuff' : string +>'doStuff' : "doStuff" var d: string = x['doOtherStuff']('hm'); >d : string ->x['doOtherStuff']('hm') : string +>x['doOtherStuff']('hm') : "hm" >x['doOtherStuff'] : (x: T) => T >x : string ->'doOtherStuff' : string ->'hm' : string +>'doOtherStuff' : "doOtherStuff" +>'hm' : "hm" diff --git a/tests/baselines/reference/extendedInterfaceGenericType.types b/tests/baselines/reference/extendedInterfaceGenericType.types index a536ec75190..5235dd2f9c8 100644 --- a/tests/baselines/reference/extendedInterfaceGenericType.types +++ b/tests/baselines/reference/extendedInterfaceGenericType.types @@ -37,5 +37,5 @@ betaOfNumber.takesArgOfT(5); >betaOfNumber.takesArgOfT : (arg: number) => Alpha >betaOfNumber : Beta >takesArgOfT : (arg: number) => Alpha ->5 : number +>5 : 5 diff --git a/tests/baselines/reference/externFunc.types b/tests/baselines/reference/externFunc.types index ab417859ea5..5cda004d4cf 100644 --- a/tests/baselines/reference/externFunc.types +++ b/tests/baselines/reference/externFunc.types @@ -6,5 +6,5 @@ declare function parseInt(s:string):number; parseInt("2"); >parseInt("2") : number >parseInt : { (s: string, radix?: number): number; (s: string): number; } ->"2" : string +>"2" : "2" diff --git a/tests/baselines/reference/externModule.js b/tests/baselines/reference/externModule.js index a7f58e4f30c..ff83d07ef98 100644 --- a/tests/baselines/reference/externModule.js +++ b/tests/baselines/reference/externModule.js @@ -43,7 +43,7 @@ n=XDate.UTC(1964,2,1); declare; module; { - var XDate = (function () { + export var XDate = (function () { function XDate() { } return XDate; diff --git a/tests/baselines/reference/externalModuleQualification.types b/tests/baselines/reference/externalModuleQualification.types index a7b70697209..42f0d3579b4 100644 --- a/tests/baselines/reference/externalModuleQualification.types +++ b/tests/baselines/reference/externalModuleQualification.types @@ -1,7 +1,7 @@ === tests/cases/compiler/externalModuleQualification.ts === export var ID = "test"; >ID : string ->"test" : string +>"test" : "test" export class DiffEditor { >DiffEditor : DiffEditor diff --git a/tests/baselines/reference/externalModuleReferenceDoubleUnderscore1.types b/tests/baselines/reference/externalModuleReferenceDoubleUnderscore1.types index 8d2c9b65991..ad292656d25 100644 --- a/tests/baselines/reference/externalModuleReferenceDoubleUnderscore1.types +++ b/tests/baselines/reference/externalModuleReferenceDoubleUnderscore1.types @@ -14,31 +14,31 @@ declare module '__timezonecomplete/basics' { >TimeUnit : TimeUnit Second = 0, ->Second : TimeUnit ->0 : number +>Second : TimeUnit.Second +>0 : 0 Minute = 1, ->Minute : TimeUnit ->1 : number +>Minute : TimeUnit.Minute +>1 : 1 Hour = 2, ->Hour : TimeUnit ->2 : number +>Hour : TimeUnit.Hour +>2 : 2 Day = 3, ->Day : TimeUnit ->3 : number +>Day : TimeUnit.Day +>3 : 3 Week = 4, ->Week : TimeUnit ->4 : number +>Week : TimeUnit.Week +>4 : 4 Month = 5, ->Month : TimeUnit ->5 : number +>Month : TimeUnit.Month +>5 : 5 Year = 6, ->Year : TimeUnit ->6 : number +>Year : TimeUnit.Year +>6 : 6 } } diff --git a/tests/baselines/reference/externalModuleResolution.types b/tests/baselines/reference/externalModuleResolution.types index 45e2aef6883..1f0901dd040 100644 --- a/tests/baselines/reference/externalModuleResolution.types +++ b/tests/baselines/reference/externalModuleResolution.types @@ -13,7 +13,7 @@ module M2 { export var Y = 1; >Y : number ->1 : number +>1 : 1 } export = M2 >M2 : typeof M2 diff --git a/tests/baselines/reference/externalModuleResolution2.types b/tests/baselines/reference/externalModuleResolution2.types index 9f48b8b38f1..8eb1ae5d546 100644 --- a/tests/baselines/reference/externalModuleResolution2.types +++ b/tests/baselines/reference/externalModuleResolution2.types @@ -13,7 +13,7 @@ module M2 { export var X = 1; >X : number ->1 : number +>1 : 1 } export = M2 >M2 : typeof M2 diff --git a/tests/baselines/reference/fallFromLastCase1.types b/tests/baselines/reference/fallFromLastCase1.types index 1a21727e7a1..0353ae88387 100644 --- a/tests/baselines/reference/fallFromLastCase1.types +++ b/tests/baselines/reference/fallFromLastCase1.types @@ -17,7 +17,7 @@ function foo1(a: number) { use("1"); >use("1") : any >use : (a: string) => any ->"1" : string +>"1" : "1" break; case 2: @@ -26,7 +26,7 @@ function foo1(a: number) { use("2"); >use("2") : any >use : (a: string) => any ->"2" : string +>"2" : "2" } } @@ -44,13 +44,13 @@ function foo2(a: number) { use("1"); >use("1") : any >use : (a: string) => any ->"1" : string +>"1" : "1" break; default: use("2"); >use("2") : any >use : (a: string) => any ->"2" : string +>"2" : "2" } } diff --git a/tests/baselines/reference/fallbackToBindingPatternForTypeInference.types b/tests/baselines/reference/fallbackToBindingPatternForTypeInference.types index fc41085098a..7b1a2d8e6ff 100644 --- a/tests/baselines/reference/fallbackToBindingPatternForTypeInference.types +++ b/tests/baselines/reference/fallbackToBindingPatternForTypeInference.types @@ -19,7 +19,7 @@ trans(([b,c]) => 'foo'); >([b,c]) => 'foo' : ([b, c]: [any, any]) => string >b : any >c : any ->'foo' : string +>'foo' : "foo" trans(({d: [e,f]}) => 'foo'); >trans(({d: [e,f]}) => 'foo') : number @@ -28,7 +28,7 @@ trans(({d: [e,f]}) => 'foo'); >d : any >e : any >f : any ->'foo' : string +>'foo' : "foo" trans(([{g},{h}]) => 'foo'); >trans(([{g},{h}]) => 'foo') : number @@ -36,7 +36,7 @@ trans(([{g},{h}]) => 'foo'); >([{g},{h}]) => 'foo' : ([{g}, {h}]: [{ g: any; }, { h: any; }]) => string >g : any >h : any ->'foo' : string +>'foo' : "foo" trans(({a, b = 10}) => a); >trans(({a, b = 10}) => a) : number @@ -44,6 +44,6 @@ trans(({a, b = 10}) => a); >({a, b = 10}) => a : ({a, b}: { a: any; b?: number; }) => any >a : any >b : number ->10 : number +>10 : 10 >a : any diff --git a/tests/baselines/reference/fatArrowSelf.types b/tests/baselines/reference/fatArrowSelf.types index 574262265bc..1f9627b595e 100644 --- a/tests/baselines/reference/fatArrowSelf.types +++ b/tests/baselines/reference/fatArrowSelf.types @@ -41,7 +41,7 @@ module Consumer { >this : this >emitter : Events.EventEmitter >addListener : (type: string, listener: Events.ListenerCallback) => void ->'change' : string +>'change' : "change" >(e) => { this.changed(); } : (e: any) => void >e : any diff --git a/tests/baselines/reference/fatArrowfunctionAsType.types b/tests/baselines/reference/fatArrowfunctionAsType.types index a165048695f..82616951795 100644 --- a/tests/baselines/reference/fatArrowfunctionAsType.types +++ b/tests/baselines/reference/fatArrowfunctionAsType.types @@ -14,7 +14,7 @@ var c: (x: T) => void = function (x: T) { return 42; } >T : T >x : T >T : T ->42 : number +>42 : 42 b = c; >b = c : (x: T) => void diff --git a/tests/baselines/reference/fatarrowfunctions.types b/tests/baselines/reference/fatarrowfunctions.types index 7fd15ee29a7..304c341c916 100644 --- a/tests/baselines/reference/fatarrowfunctions.types +++ b/tests/baselines/reference/fatarrowfunctions.types @@ -79,7 +79,7 @@ foo(()=>{return 0;}); >foo(()=>{return 0;}) : any >foo : (x: any) => any >()=>{return 0;} : () => number ->0 : number +>0 : 0 foo((x:number,y,z)=>x+y+z); >foo((x:number,y,z)=>x+y+z) : any @@ -150,7 +150,7 @@ foo(()=>{return 0;}); >foo(()=>{return 0;}) : any >foo : (x: any) => any >()=>{return 0;} : () => number ->0 : number +>0 : 0 foo(((x) => x)); @@ -189,7 +189,7 @@ var z = (x:number) => x*x; var w = () => 3; >w : () => number >() => 3 : () => number ->3 : number +>3 : 3 function ternaryTest(isWhile:boolean) { >ternaryTest : (isWhile: boolean) => void @@ -203,7 +203,7 @@ function ternaryTest(isWhile:boolean) { >n : any >n > 0 : boolean >n : any ->0 : number +>0 : 0 >function (n) { return n === 0; } : (n: any) => boolean >n : any >n === 0 : boolean @@ -224,7 +224,7 @@ var messenger = { message: "Hello World", >message : string ->"Hello World" : string +>"Hello World" : "Hello World" start: function() { >start : () => void @@ -240,7 +240,7 @@ var messenger = { >this : any >message : any >toString : any ->3000 : number +>3000 : 3000 } }; diff --git a/tests/baselines/reference/fatarrowfunctionsInFunctionParameterDefaults.types b/tests/baselines/reference/fatarrowfunctionsInFunctionParameterDefaults.types index 39cd994dcc1..bc33ec4c2ff 100644 --- a/tests/baselines/reference/fatarrowfunctionsInFunctionParameterDefaults.types +++ b/tests/baselines/reference/fatarrowfunctionsInFunctionParameterDefaults.types @@ -19,5 +19,5 @@ fn.call(4); // Should be 4 >fn.call : (this: Function, thisArg: any, ...argArray: any[]) => any >fn : (x?: () => any, y?: any) => any >call : (this: Function, thisArg: any, ...argArray: any[]) => any ->4 : number +>4 : 4 diff --git a/tests/baselines/reference/fatarrowfunctionsInFunctions.types b/tests/baselines/reference/fatarrowfunctionsInFunctions.types index 00abaec9f25..8b9bd7ccd7a 100644 --- a/tests/baselines/reference/fatarrowfunctionsInFunctions.types +++ b/tests/baselines/reference/fatarrowfunctionsInFunctions.types @@ -11,7 +11,7 @@ var messenger = { message: "Hello World", >message : string ->"Hello World" : string +>"Hello World" : "Hello World" start: function() { >start : () => void @@ -35,7 +35,7 @@ var messenger = { >toString : any }, 3000); ->3000 : number +>3000 : 3000 } }; messenger.start(); diff --git a/tests/baselines/reference/fatarrowfunctionsOptionalArgsErrors2.errors.txt b/tests/baselines/reference/fatarrowfunctionsOptionalArgsErrors2.errors.txt index 6ac472e0e02..b435e7773f5 100644 --- a/tests/baselines/reference/fatarrowfunctionsOptionalArgsErrors2.errors.txt +++ b/tests/baselines/reference/fatarrowfunctionsOptionalArgsErrors2.errors.txt @@ -1,10 +1,14 @@ tests/cases/compiler/fatarrowfunctionsOptionalArgsErrors2.ts(1,12): error TS2304: Cannot find name 'a'. +tests/cases/compiler/fatarrowfunctionsOptionalArgsErrors2.ts(1,12): error TS2695: Left side of comma operator is unused and has no side effects. tests/cases/compiler/fatarrowfunctionsOptionalArgsErrors2.ts(1,16): error TS2304: Cannot find name 'b'. +tests/cases/compiler/fatarrowfunctionsOptionalArgsErrors2.ts(1,16): error TS2695: Left side of comma operator is unused and has no side effects. tests/cases/compiler/fatarrowfunctionsOptionalArgsErrors2.ts(1,19): error TS2304: Cannot find name 'c'. tests/cases/compiler/fatarrowfunctionsOptionalArgsErrors2.ts(1,23): error TS1005: ';' expected. tests/cases/compiler/fatarrowfunctionsOptionalArgsErrors2.ts(1,26): error TS2304: Cannot find name 'a'. tests/cases/compiler/fatarrowfunctionsOptionalArgsErrors2.ts(1,28): error TS2304: Cannot find name 'b'. tests/cases/compiler/fatarrowfunctionsOptionalArgsErrors2.ts(1,30): error TS2304: Cannot find name 'c'. +tests/cases/compiler/fatarrowfunctionsOptionalArgsErrors2.ts(2,12): error TS2695: Left side of comma operator is unused and has no side effects. +tests/cases/compiler/fatarrowfunctionsOptionalArgsErrors2.ts(2,12): error TS2695: Left side of comma operator is unused and has no side effects. tests/cases/compiler/fatarrowfunctionsOptionalArgsErrors2.ts(2,13): error TS2304: Cannot find name 'a'. tests/cases/compiler/fatarrowfunctionsOptionalArgsErrors2.ts(2,17): error TS2304: Cannot find name 'b'. tests/cases/compiler/fatarrowfunctionsOptionalArgsErrors2.ts(2,20): error TS2304: Cannot find name 'c'. @@ -17,12 +21,16 @@ tests/cases/compiler/fatarrowfunctionsOptionalArgsErrors2.ts(4,17): error TS1005 tests/cases/compiler/fatarrowfunctionsOptionalArgsErrors2.ts(4,20): error TS2304: Cannot find name 'a'. -==== tests/cases/compiler/fatarrowfunctionsOptionalArgsErrors2.ts (17 errors) ==== +==== tests/cases/compiler/fatarrowfunctionsOptionalArgsErrors2.ts (21 errors) ==== var tt1 = (a, (b, c)) => a+b+c; ~ !!! error TS2304: Cannot find name 'a'. + ~ +!!! error TS2695: Left side of comma operator is unused and has no side effects. ~ !!! error TS2304: Cannot find name 'b'. + ~ +!!! error TS2695: Left side of comma operator is unused and has no side effects. ~ !!! error TS2304: Cannot find name 'c'. ~~ @@ -34,6 +42,10 @@ tests/cases/compiler/fatarrowfunctionsOptionalArgsErrors2.ts(4,20): error TS2304 ~ !!! error TS2304: Cannot find name 'c'. var tt2 = ((a), b, c) => a+b+c; + ~~~ +!!! error TS2695: Left side of comma operator is unused and has no side effects. + ~~~~~~ +!!! error TS2695: Left side of comma operator is unused and has no side effects. ~ !!! error TS2304: Cannot find name 'a'. ~ diff --git a/tests/baselines/reference/fileReferencesWithNoExtensions.types b/tests/baselines/reference/fileReferencesWithNoExtensions.types index 7b56dbe0d20..380792f1b70 100644 --- a/tests/baselines/reference/fileReferencesWithNoExtensions.types +++ b/tests/baselines/reference/fileReferencesWithNoExtensions.types @@ -17,7 +17,7 @@ var c = cc; // Check that c.ts has precedence over c.d.ts === tests/cases/compiler/a.ts === var aa = 1; >aa : number ->1 : number +>1 : 1 === tests/cases/compiler/b.d.ts === declare var bb: number; @@ -26,7 +26,7 @@ declare var bb: number; === tests/cases/compiler/c.ts === var cc = 1; >cc : number ->1 : number +>1 : 1 === tests/cases/compiler/c.d.ts === declare var xx: number; diff --git a/tests/baselines/reference/fileWithNextLine1.types b/tests/baselines/reference/fileWithNextLine1.types index 2afb1f2ae37..d314fd996dd 100644 --- a/tests/baselines/reference/fileWithNextLine1.types +++ b/tests/baselines/reference/fileWithNextLine1.types @@ -3,5 +3,5 @@ // 0. It should be counted as a space and should not cause an error. var v = '…'; >v : string ->'…' : string +>'…' : "\u0085" diff --git a/tests/baselines/reference/fileWithNextLine2.types b/tests/baselines/reference/fileWithNextLine2.types index c3e1fd642cf..d7d08ef5b3f 100644 --- a/tests/baselines/reference/fileWithNextLine2.types +++ b/tests/baselines/reference/fileWithNextLine2.types @@ -3,5 +3,5 @@ // it should be treated like a space var v =…0; >v : number ->0 : number +>0 : 0 diff --git a/tests/baselines/reference/fixTypeParameterInSignatureWithRestParameters.errors.txt b/tests/baselines/reference/fixTypeParameterInSignatureWithRestParameters.errors.txt index 3666c89a0ed..e1cde0c1632 100644 --- a/tests/baselines/reference/fixTypeParameterInSignatureWithRestParameters.errors.txt +++ b/tests/baselines/reference/fixTypeParameterInSignatureWithRestParameters.errors.txt @@ -1,5 +1,5 @@ tests/cases/compiler/fixTypeParameterInSignatureWithRestParameters.ts(2,1): error TS2453: The type argument for type parameter 'T' cannot be inferred from the usage. Consider specifying the type arguments explicitly. - Type argument candidate 'number' is not a valid type argument because it is not a supertype of candidate 'string'. + Type argument candidate '1' is not a valid type argument because it is not a supertype of candidate '""'. ==== tests/cases/compiler/fixTypeParameterInSignatureWithRestParameters.ts (1 errors) ==== @@ -7,4 +7,4 @@ tests/cases/compiler/fixTypeParameterInSignatureWithRestParameters.ts(2,1): erro bar(1, ""); // Should be ok ~~~ !!! error TS2453: The type argument for type parameter 'T' cannot be inferred from the usage. Consider specifying the type arguments explicitly. -!!! error TS2453: Type argument candidate 'number' is not a valid type argument because it is not a supertype of candidate 'string'. \ No newline at end of file +!!! error TS2453: Type argument candidate '1' is not a valid type argument because it is not a supertype of candidate '""'. \ No newline at end of file diff --git a/tests/baselines/reference/fixingTypeParametersRepeatedly1.types b/tests/baselines/reference/fixingTypeParametersRepeatedly1.types index 273c66b342d..41e705ba943 100644 --- a/tests/baselines/reference/fixingTypeParametersRepeatedly1.types +++ b/tests/baselines/reference/fixingTypeParametersRepeatedly1.types @@ -17,7 +17,7 @@ declare function f(x: T, y: (p: T) => T, z: (p: T) => T): T; f("", x => null, x => x.toLowerCase()); >f("", x => null, x => x.toLowerCase()) : string >f : (x: T, y: (p: T) => T, z: (p: T) => T) => T ->"" : string +>"" : "" >x => null : (x: string) => any >x : string >null : null @@ -50,7 +50,7 @@ declare function g(); g("", x => null, x => x.toLowerCase()); >g("", x => null, x => x.toLowerCase()) : string >g : { (x: T, y: (p: T) => T, z: (p: T) => T): T; (): any; } ->"" : string +>"" : "" >x => null : (x: string) => any >x : string >null : null diff --git a/tests/baselines/reference/for-of13.types b/tests/baselines/reference/for-of13.types index e176b1bbf0c..af30e85fa17 100644 --- a/tests/baselines/reference/for-of13.types +++ b/tests/baselines/reference/for-of13.types @@ -7,6 +7,6 @@ for (v of [""].values()) { } >[""].values() : IterableIterator >[""].values : () => IterableIterator >[""] : string[] ->"" : string +>"" : "" >values : () => IterableIterator diff --git a/tests/baselines/reference/for-of18.types b/tests/baselines/reference/for-of18.types index 415f2b11568..86978b62cc7 100644 --- a/tests/baselines/reference/for-of18.types +++ b/tests/baselines/reference/for-of18.types @@ -18,11 +18,11 @@ class StringIterator { value: "", >value : string ->"" : string +>"" : "" done: false >done : boolean ->false : boolean +>false : false }; } diff --git a/tests/baselines/reference/for-of19.types b/tests/baselines/reference/for-of19.types index 5128617bf24..a2882ccf1ac 100644 --- a/tests/baselines/reference/for-of19.types +++ b/tests/baselines/reference/for-of19.types @@ -27,7 +27,7 @@ class FooIterator { done: false >done : boolean ->false : boolean +>false : false }; } diff --git a/tests/baselines/reference/for-of20.types b/tests/baselines/reference/for-of20.types index de12979c650..9274c7f4b96 100644 --- a/tests/baselines/reference/for-of20.types +++ b/tests/baselines/reference/for-of20.types @@ -27,7 +27,7 @@ class FooIterator { done: false >done : boolean ->false : boolean +>false : false }; } diff --git a/tests/baselines/reference/for-of21.types b/tests/baselines/reference/for-of21.types index cab24c525d9..1366cb1a420 100644 --- a/tests/baselines/reference/for-of21.types +++ b/tests/baselines/reference/for-of21.types @@ -27,7 +27,7 @@ class FooIterator { done: false >done : boolean ->false : boolean +>false : false }; } diff --git a/tests/baselines/reference/for-of22.types b/tests/baselines/reference/for-of22.types index f15a1d7e114..80cd42b2b33 100644 --- a/tests/baselines/reference/for-of22.types +++ b/tests/baselines/reference/for-of22.types @@ -28,7 +28,7 @@ class FooIterator { done: false >done : boolean ->false : boolean +>false : false }; } diff --git a/tests/baselines/reference/for-of23.types b/tests/baselines/reference/for-of23.types index 87f1eeabbb7..ed74156f514 100644 --- a/tests/baselines/reference/for-of23.types +++ b/tests/baselines/reference/for-of23.types @@ -5,8 +5,8 @@ for (const v of new FooIterator) { >FooIterator : typeof FooIterator const v = 0; // new scope ->v : number ->0 : number +>v : 0 +>0 : 0 } class Foo { } @@ -28,7 +28,7 @@ class FooIterator { done: false >done : boolean ->false : boolean +>false : false }; } diff --git a/tests/baselines/reference/for-of36.types b/tests/baselines/reference/for-of36.types index e23ea79d0a9..1448c212371 100644 --- a/tests/baselines/reference/for-of36.types +++ b/tests/baselines/reference/for-of36.types @@ -1,9 +1,9 @@ === tests/cases/conformance/es6/for-ofStatements/for-of36.ts === var tuple: [string, boolean] = ["", true]; >tuple : [string, boolean] ->["", true] : [string, boolean] ->"" : string ->true : boolean +>["", true] : [string, true] +>"" : "" +>true : true for (var v of tuple) { >v : string | boolean diff --git a/tests/baselines/reference/for-of37.types b/tests/baselines/reference/for-of37.types index 89272742f62..1168921596e 100644 --- a/tests/baselines/reference/for-of37.types +++ b/tests/baselines/reference/for-of37.types @@ -3,10 +3,10 @@ var map = new Map([["", true]]); >map : Map >new Map([["", true]]) : Map >Map : MapConstructor ->[["", true]] : [string, boolean][] ->["", true] : [string, boolean] ->"" : string ->true : boolean +>[["", true]] : [string, true][] +>["", true] : [string, true] +>"" : "" +>true : true for (var v of map) { >v : [string, boolean] diff --git a/tests/baselines/reference/for-of38.types b/tests/baselines/reference/for-of38.types index f8b7555781f..e2201d24394 100644 --- a/tests/baselines/reference/for-of38.types +++ b/tests/baselines/reference/for-of38.types @@ -3,10 +3,10 @@ var map = new Map([["", true]]); >map : Map >new Map([["", true]]) : Map >Map : MapConstructor ->[["", true]] : [string, boolean][] ->["", true] : [string, boolean] ->"" : string ->true : boolean +>[["", true]] : [string, true][] +>["", true] : [string, true] +>"" : "" +>true : true for (var [k, v] of map) { >k : string diff --git a/tests/baselines/reference/for-of4.types b/tests/baselines/reference/for-of4.types index 5b8990797ba..ef73afdb9d2 100644 --- a/tests/baselines/reference/for-of4.types +++ b/tests/baselines/reference/for-of4.types @@ -2,7 +2,7 @@ for (var v of [0]) { >v : number >[0] : number[] ->0 : number +>0 : 0 v; >v : number diff --git a/tests/baselines/reference/for-of40.types b/tests/baselines/reference/for-of40.types index 6693514ec53..4c690ed9ce7 100644 --- a/tests/baselines/reference/for-of40.types +++ b/tests/baselines/reference/for-of40.types @@ -3,16 +3,16 @@ var map = new Map([["", true]]); >map : Map >new Map([["", true]]) : Map >Map : MapConstructor ->[["", true]] : [string, boolean][] ->["", true] : [string, boolean] ->"" : string ->true : boolean +>[["", true]] : [string, true][] +>["", true] : [string, true] +>"" : "" +>true : true for (var [k = "", v = false] of map) { >k : string ->"" : string +>"" : "" >v : boolean ->false : boolean +>false : false >map : Map k; diff --git a/tests/baselines/reference/for-of41.types b/tests/baselines/reference/for-of41.types index 31e3e253002..70550035783 100644 --- a/tests/baselines/reference/for-of41.types +++ b/tests/baselines/reference/for-of41.types @@ -5,11 +5,11 @@ var array = [{x: [0], y: {p: ""}}] >{x: [0], y: {p: ""}} : { x: number[]; y: { p: string; }; } >x : number[] >[0] : number[] ->0 : number +>0 : 0 >y : { p: string; } >{p: ""} : { p: string; } >p : string ->"" : string +>"" : "" for (var {x: [a], y: {p}} of array) { >x : any diff --git a/tests/baselines/reference/for-of42.types b/tests/baselines/reference/for-of42.types index 64327bcc27f..c0495982a08 100644 --- a/tests/baselines/reference/for-of42.types +++ b/tests/baselines/reference/for-of42.types @@ -4,9 +4,9 @@ var array = [{ x: "", y: 0 }] >[{ x: "", y: 0 }] : { x: string; y: number; }[] >{ x: "", y: 0 } : { x: string; y: number; } >x : string ->"" : string +>"" : "" >y : number ->0 : number +>0 : 0 for (var {x: a, y: b} of array) { >x : any diff --git a/tests/baselines/reference/for-of43.errors.txt b/tests/baselines/reference/for-of43.errors.txt deleted file mode 100644 index c5790278e53..00000000000 --- a/tests/baselines/reference/for-of43.errors.txt +++ /dev/null @@ -1,11 +0,0 @@ -tests/cases/conformance/es6/for-ofStatements/for-of43.ts(2,25): error TS2322: Type 'boolean' is not assignable to type 'number'. - - -==== tests/cases/conformance/es6/for-ofStatements/for-of43.ts (1 errors) ==== - var array = [{ x: "", y: 0 }] - for (var {x: a = "", y: b = true} of array) { - ~ -!!! error TS2322: Type 'boolean' is not assignable to type 'number'. - a; - b; - } \ No newline at end of file diff --git a/tests/baselines/reference/for-of43.symbols b/tests/baselines/reference/for-of43.symbols new file mode 100644 index 00000000000..4add17ad547 --- /dev/null +++ b/tests/baselines/reference/for-of43.symbols @@ -0,0 +1,19 @@ +=== tests/cases/conformance/es6/for-ofStatements/for-of43.ts === +var array = [{ x: "", y: 0 }] +>array : Symbol(array, Decl(for-of43.ts, 0, 3)) +>x : Symbol(x, Decl(for-of43.ts, 0, 14)) +>y : Symbol(y, Decl(for-of43.ts, 0, 21)) + +for (var {x: a = "", y: b = true} of array) { +>x : Symbol(x, Decl(for-of43.ts, 0, 14)) +>a : Symbol(a, Decl(for-of43.ts, 1, 10)) +>y : Symbol(y, Decl(for-of43.ts, 0, 21)) +>b : Symbol(b, Decl(for-of43.ts, 1, 20)) +>array : Symbol(array, Decl(for-of43.ts, 0, 3)) + + a; +>a : Symbol(a, Decl(for-of43.ts, 1, 10)) + + b; +>b : Symbol(b, Decl(for-of43.ts, 1, 20)) +} diff --git a/tests/baselines/reference/for-of43.types b/tests/baselines/reference/for-of43.types new file mode 100644 index 00000000000..2327f1bafed --- /dev/null +++ b/tests/baselines/reference/for-of43.types @@ -0,0 +1,25 @@ +=== tests/cases/conformance/es6/for-ofStatements/for-of43.ts === +var array = [{ x: "", y: 0 }] +>array : { x: string; y: number; }[] +>[{ x: "", y: 0 }] : { x: string; y: number; }[] +>{ x: "", y: 0 } : { x: string; y: number; } +>x : string +>"" : "" +>y : number +>0 : 0 + +for (var {x: a = "", y: b = true} of array) { +>x : any +>a : string +>"" : "" +>y : any +>b : number | true +>true : true +>array : { x: string; y: number; }[] + + a; +>a : string + + b; +>b : number | true +} diff --git a/tests/baselines/reference/for-of44.types b/tests/baselines/reference/for-of44.types index e6f4e0450b3..42da734edb9 100644 --- a/tests/baselines/reference/for-of44.types +++ b/tests/baselines/reference/for-of44.types @@ -1,15 +1,15 @@ === tests/cases/conformance/es6/for-ofStatements/for-of44.ts === var array: [number, string | boolean | symbol][] = [[0, ""], [0, true], [1, Symbol()]] >array : [number, string | boolean | symbol][] ->[[0, ""], [0, true], [1, Symbol()]] : ([number, string] | [number, boolean] | [number, symbol])[] ->[0, ""] : [number, string] ->0 : number ->"" : string ->[0, true] : [number, boolean] ->0 : number ->true : boolean +>[[0, ""], [0, true], [1, Symbol()]] : ([number, ""] | [number, true] | [number, symbol])[] +>[0, ""] : [number, ""] +>0 : 0 +>"" : "" +>[0, true] : [number, true] +>0 : 0 +>true : true >[1, Symbol()] : [number, symbol] ->1 : number +>1 : 1 >Symbol() : symbol >Symbol : SymbolConstructor diff --git a/tests/baselines/reference/for-of45.types b/tests/baselines/reference/for-of45.types index 7c853993b0a..6e6a0a11bf4 100644 --- a/tests/baselines/reference/for-of45.types +++ b/tests/baselines/reference/for-of45.types @@ -7,19 +7,19 @@ var map = new Map([["", true]]); >map : Map >new Map([["", true]]) : Map >Map : MapConstructor ->[["", true]] : [string, boolean][] ->["", true] : [string, boolean] ->"" : string ->true : boolean +>[["", true]] : [string, true][] +>["", true] : [string, true] +>"" : "" +>true : true for ([k = "", v = false] of map) { >[k = "", v = false] : [string, boolean] ->k = "" : string +>k = "" : "" >k : string ->"" : string ->v = false : boolean +>"" : "" +>v = false : false >v : boolean ->false : boolean +>false : false >map : Map k; diff --git a/tests/baselines/reference/for-of46.errors.txt b/tests/baselines/reference/for-of46.errors.txt index 13685b122ca..c2a47bffdf6 100644 --- a/tests/baselines/reference/for-of46.errors.txt +++ b/tests/baselines/reference/for-of46.errors.txt @@ -1,5 +1,5 @@ -tests/cases/conformance/es6/for-ofStatements/for-of46.ts(3,7): error TS2322: Type 'boolean' is not assignable to type 'string'. -tests/cases/conformance/es6/for-ofStatements/for-of46.ts(3,18): error TS2322: Type 'string' is not assignable to type 'boolean'. +tests/cases/conformance/es6/for-ofStatements/for-of46.ts(3,7): error TS2322: Type 'false' is not assignable to type 'string'. +tests/cases/conformance/es6/for-ofStatements/for-of46.ts(3,18): error TS2322: Type '""' is not assignable to type 'boolean'. ==== tests/cases/conformance/es6/for-ofStatements/for-of46.ts (2 errors) ==== @@ -7,9 +7,9 @@ tests/cases/conformance/es6/for-ofStatements/for-of46.ts(3,18): error TS2322: Ty var map = new Map([["", true]]); for ([k = false, v = ""] of map) { ~ -!!! error TS2322: Type 'boolean' is not assignable to type 'string'. +!!! error TS2322: Type 'false' is not assignable to type 'string'. ~ -!!! error TS2322: Type 'string' is not assignable to type 'boolean'. +!!! error TS2322: Type '""' is not assignable to type 'boolean'. k; v; } \ No newline at end of file diff --git a/tests/baselines/reference/for-of5.types b/tests/baselines/reference/for-of5.types index 921c327c185..b5bc8f0b30a 100644 --- a/tests/baselines/reference/for-of5.types +++ b/tests/baselines/reference/for-of5.types @@ -2,7 +2,7 @@ for (let v of [0]) { >v : number >[0] : number[] ->0 : number +>0 : 0 v; >v : number diff --git a/tests/baselines/reference/for-of50.types b/tests/baselines/reference/for-of50.types index 5d5dac7abed..8da06665711 100644 --- a/tests/baselines/reference/for-of50.types +++ b/tests/baselines/reference/for-of50.types @@ -3,10 +3,10 @@ var map = new Map([["", true]]); >map : Map >new Map([["", true]]) : Map >Map : MapConstructor ->[["", true]] : [string, boolean][] ->["", true] : [string, boolean] ->"" : string ->true : boolean +>[["", true]] : [string, true][] +>["", true] : [string, true] +>"" : "" +>true : true for (const [k, v] of map) { >k : string diff --git a/tests/baselines/reference/for-of8.types b/tests/baselines/reference/for-of8.types index 36bb20ef6b0..6122cd935fe 100644 --- a/tests/baselines/reference/for-of8.types +++ b/tests/baselines/reference/for-of8.types @@ -5,5 +5,5 @@ v; for (var v of [0]) { } >v : number >[0] : number[] ->0 : number +>0 : 0 diff --git a/tests/baselines/reference/for-of9.types b/tests/baselines/reference/for-of9.types index bf06bf46034..4cd3cceb825 100644 --- a/tests/baselines/reference/for-of9.types +++ b/tests/baselines/reference/for-of9.types @@ -5,9 +5,9 @@ var v: string; for (v of ["hello"]) { } >v : string >["hello"] : string[] ->"hello" : string +>"hello" : "hello" for (v of "hello") { } >v : string ->"hello" : string +>"hello" : "hello" diff --git a/tests/baselines/reference/forInModule.types b/tests/baselines/reference/forInModule.types index d78a511206b..74bb866ec51 100644 --- a/tests/baselines/reference/forInModule.types +++ b/tests/baselines/reference/forInModule.types @@ -4,10 +4,10 @@ module Foo { for (var i = 0; i < 1; i++) { >i : number ->0 : number +>0 : 0 >i < 1 : boolean >i : number ->1 : number +>1 : 1 >i++ : number >i : number diff --git a/tests/baselines/reference/forStatements.types b/tests/baselines/reference/forStatements.types index 95b198a7fec..a6ae6ea9aa5 100644 --- a/tests/baselines/reference/forStatements.types +++ b/tests/baselines/reference/forStatements.types @@ -38,7 +38,7 @@ class D{ function F(x: string): number { return 42; } >F : (x: string) => number >x : string ->42 : number +>42 : 42 module M { >M : typeof M @@ -61,18 +61,18 @@ module M { for(var aNumber: number = 9.9;;){} >aNumber : number ->9.9 : number +>9.9 : 9.9 for(var aString: string = 'this is a string';;){} >aString : string ->'this is a string' : string +>'this is a string' : "this is a string" for(var aDate: Date = new Date(12);;){} >aDate : Date >Date : Date >new Date(12) : Date >Date : DateConstructor ->12 : number +>12 : 12 for(var anObject: Object = new Object();;){} >anObject : Object @@ -115,7 +115,7 @@ for(var anObjectLiteral: I = { id: 12 };;){} >I : I >{ id: 12 } : { id: number; } >id : number ->12 : number +>12 : 12 for(var anOtherObjectLiteral: { id: number } = new C();;){} >anOtherObjectLiteral : { id: number; } @@ -138,7 +138,7 @@ for(var aLambda: typeof F = (x) => 2;;){} >F : (x: string) => number >(x) => 2 : (x: string) => number >x : string ->2 : number +>2 : 2 for(var aModule: typeof M = M;;){} >aModule : typeof M @@ -161,5 +161,5 @@ for(var aFunctionInModule: typeof M.F2 = (x) => 'this is a string';;){} >F2 : (x: number) => string >(x) => 'this is a string' : (x: number) => string >x : number ->'this is a string' : string +>'this is a string' : "this is a string" diff --git a/tests/baselines/reference/forStatementsMultipleValidDecl.types b/tests/baselines/reference/forStatementsMultipleValidDecl.types index acb26f17312..f40f4bbbc3c 100644 --- a/tests/baselines/reference/forStatementsMultipleValidDecl.types +++ b/tests/baselines/reference/forStatementsMultipleValidDecl.types @@ -7,7 +7,7 @@ for (var x: number; ;) { } for (var x = 2; ;) { } >x : number ->2 : number +>2 : 2 for (var x = undefined; ;) { } >x : number @@ -20,7 +20,7 @@ function declSpace() { for (var x = 'this is a string'; ;) { } >x : string ->'this is a string' : string +>'this is a string' : "this is a string" } interface Point { x: number; y: number; } >Point : Point @@ -35,16 +35,16 @@ for (var p = { x: 1, y: 2 }; ;) { } >p : Point >{ x: 1, y: 2 } : { x: number; y: number; } >x : number ->1 : number +>1 : 1 >y : number ->2 : number +>2 : 2 for (var p: Point = { x: 0, y: undefined }; ;) { } >p : Point >Point : Point >{ x: 0, y: undefined } : { x: number; y: undefined; } >x : number ->0 : number +>0 : 0 >y : undefined >undefined : undefined @@ -52,7 +52,7 @@ for (var p = { x: 1, y: undefined }; ;) { } >p : Point >{ x: 1, y: undefined } : { x: number; y: number; } >x : number ->1 : number +>1 : 1 >y : number >undefined : number >undefined : undefined @@ -63,9 +63,9 @@ for (var p: { x: number; y: number; } = { x: 1, y: 2 }; ;) { } >y : number >{ x: 1, y: 2 } : { x: number; y: number; } >x : number ->1 : number +>1 : 1 >y : number ->2 : number +>2 : 2 for (var p = <{ x: number; y: number; }>{ x: 0, y: undefined }; ;) { } >p : Point @@ -74,7 +74,7 @@ for (var p = <{ x: number; y: number; }>{ x: 0, y: undefined }; ;) { } >y : number >{ x: 0, y: undefined } : { x: number; y: undefined; } >x : number ->0 : number +>0 : 0 >y : undefined >undefined : undefined @@ -86,13 +86,13 @@ for (var fn = function (s: string) { return 42; }; ;) { } >fn : (s: string) => number >function (s: string) { return 42; } : (s: string) => number >s : string ->42 : number +>42 : 42 for (var fn = (s: string) => 3; ;) { } >fn : (s: string) => number >(s: string) => 3 : (s: string) => number >s : string ->3 : number +>3 : 3 for (var fn: (s: string) => number; ;) { } >fn : (s: string) => number @@ -118,8 +118,8 @@ for (var a: string[]; ;) { } for (var a = ['a', 'b']; ;) { } >a : string[] >['a', 'b'] : string[] ->'a' : string ->'b' : string +>'a' : "a" +>'b' : "b" for (var a = []; ;) { } >a : string[] diff --git a/tests/baselines/reference/fromAsIdentifier2.types b/tests/baselines/reference/fromAsIdentifier2.types index ae605f79268..cea6974c946 100644 --- a/tests/baselines/reference/fromAsIdentifier2.types +++ b/tests/baselines/reference/fromAsIdentifier2.types @@ -1,6 +1,6 @@ === tests/cases/compiler/fromAsIdentifier2.ts === "use strict"; ->"use strict" : string +>"use strict" : "use strict" var from; >from : any diff --git a/tests/baselines/reference/funcdecl.types b/tests/baselines/reference/funcdecl.types index 94c310d7b25..8c632237ef3 100644 --- a/tests/baselines/reference/funcdecl.types +++ b/tests/baselines/reference/funcdecl.types @@ -3,7 +3,7 @@ function simpleFunc() { >simpleFunc : () => string return "this is my simple func"; ->"this is my simple func" : string +>"this is my simple func" : "this is my simple func" } var simpleFuncVar = simpleFunc; >simpleFuncVar : () => string @@ -20,7 +20,7 @@ function withReturn() : string{ >withReturn : () => string return "Hello"; ->"Hello" : string +>"Hello" : "Hello" } var withReturnVar = withReturn; >withReturnVar : () => string @@ -64,9 +64,9 @@ function withInitializedParams(a: string, b0, b = 30, c = "string value") { >a : string >b0 : any >b : number ->30 : number +>30 : 30 >c : string ->"string value" : string +>"string value" : "string value" } var withInitializedParamsVar = withInitializedParams; >withInitializedParamsVar : (a: string, b0: any, b?: number, c?: string) => void @@ -76,7 +76,7 @@ function withOptionalInitializedParams(a: string, c: string = "hello string") { >withOptionalInitializedParams : (a: string, c?: string) => void >a : string >c : string ->"hello string" : string +>"hello string" : "hello string" } var withOptionalInitializedParamsVar = withOptionalInitializedParams; >withOptionalInitializedParamsVar : (a: string, c?: string) => void @@ -139,7 +139,7 @@ m2.foo(() => { var b = 30; >b : number ->30 : number +>30 : 30 return b; >b : number @@ -164,5 +164,5 @@ var f2 = () => { >() => { return "string";} : () => string return "string"; ->"string" : string +>"string" : "string" } diff --git a/tests/baselines/reference/functionAssignment.errors.txt b/tests/baselines/reference/functionAssignment.errors.txt index 19fd0897f98..292c2804431 100644 --- a/tests/baselines/reference/functionAssignment.errors.txt +++ b/tests/baselines/reference/functionAssignment.errors.txt @@ -1,4 +1,4 @@ -tests/cases/compiler/functionAssignment.ts(22,5): error TS2322: Type 'number' is not assignable to type 'string'. +tests/cases/compiler/functionAssignment.ts(22,5): error TS2322: Type '4' is not assignable to type 'string'. tests/cases/compiler/functionAssignment.ts(34,17): error TS2339: Property 'length' does not exist on type 'number'. @@ -26,7 +26,7 @@ tests/cases/compiler/functionAssignment.ts(34,17): error TS2339: Property 'lengt var n = ''; n = 4; ~ -!!! error TS2322: Type 'number' is not assignable to type 'string'. +!!! error TS2322: Type '4' is not assignable to type 'string'. }); function f3(a: { a: number; b: number; }) { } diff --git a/tests/baselines/reference/functionAssignmentError.types b/tests/baselines/reference/functionAssignmentError.types index 6430aa10fc4..3223a7b40f8 100644 --- a/tests/baselines/reference/functionAssignmentError.types +++ b/tests/baselines/reference/functionAssignmentError.types @@ -2,11 +2,11 @@ var func = function (){return "ONE";}; >func : () => string >function (){return "ONE";} : () => string ->"ONE" : string +>"ONE" : "ONE" func = function (){return "ONE";}; >func = function (){return "ONE";} : () => string >func : () => string >function (){return "ONE";} : () => string ->"ONE" : string +>"ONE" : "ONE" diff --git a/tests/baselines/reference/functionCall1.types b/tests/baselines/reference/functionCall1.types index 777fcd79f91..9295a06982e 100644 --- a/tests/baselines/reference/functionCall1.types +++ b/tests/baselines/reference/functionCall1.types @@ -1,7 +1,7 @@ === tests/cases/compiler/functionCall1.ts === function foo():any{return ""}; >foo : () => any ->"" : string +>"" : "" var x = foo(); >x : any diff --git a/tests/baselines/reference/functionCall10.errors.txt b/tests/baselines/reference/functionCall10.errors.txt index 8352fc70a58..7891b7008cb 100644 --- a/tests/baselines/reference/functionCall10.errors.txt +++ b/tests/baselines/reference/functionCall10.errors.txt @@ -1,5 +1,5 @@ -tests/cases/compiler/functionCall10.ts(3,5): error TS2345: Argument of type 'string' is not assignable to parameter of type 'number'. -tests/cases/compiler/functionCall10.ts(5,8): error TS2345: Argument of type 'string' is not assignable to parameter of type 'number'. +tests/cases/compiler/functionCall10.ts(3,5): error TS2345: Argument of type '"foo"' is not assignable to parameter of type 'number'. +tests/cases/compiler/functionCall10.ts(5,8): error TS2345: Argument of type '"bar"' is not assignable to parameter of type 'number'. ==== tests/cases/compiler/functionCall10.ts (2 errors) ==== @@ -7,9 +7,9 @@ tests/cases/compiler/functionCall10.ts(5,8): error TS2345: Argument of type 'str foo(0, 1); foo('foo'); ~~~~~ -!!! error TS2345: Argument of type 'string' is not assignable to parameter of type 'number'. +!!! error TS2345: Argument of type '"foo"' is not assignable to parameter of type 'number'. foo(); foo(1, 'bar'); ~~~~~ -!!! error TS2345: Argument of type 'string' is not assignable to parameter of type 'number'. +!!! error TS2345: Argument of type '"bar"' is not assignable to parameter of type 'number'. \ No newline at end of file diff --git a/tests/baselines/reference/functionCall11.errors.txt b/tests/baselines/reference/functionCall11.errors.txt index a1790974bbb..f1a5949acd7 100644 --- a/tests/baselines/reference/functionCall11.errors.txt +++ b/tests/baselines/reference/functionCall11.errors.txt @@ -1,5 +1,5 @@ tests/cases/compiler/functionCall11.ts(4,1): error TS2346: Supplied parameters do not match any signature of call target. -tests/cases/compiler/functionCall11.ts(5,5): error TS2345: Argument of type 'number' is not assignable to parameter of type 'string'. +tests/cases/compiler/functionCall11.ts(5,5): error TS2345: Argument of type '1' is not assignable to parameter of type 'string'. tests/cases/compiler/functionCall11.ts(6,1): error TS2346: Supplied parameters do not match any signature of call target. @@ -12,7 +12,7 @@ tests/cases/compiler/functionCall11.ts(6,1): error TS2346: Supplied parameters d !!! error TS2346: Supplied parameters do not match any signature of call target. foo(1, 'bar'); ~ -!!! error TS2345: Argument of type 'number' is not assignable to parameter of type 'string'. +!!! error TS2345: Argument of type '1' is not assignable to parameter of type 'string'. foo('foo', 1, 'bar'); ~~~~~~~~~~~~~~~~~~~~ !!! error TS2346: Supplied parameters do not match any signature of call target. diff --git a/tests/baselines/reference/functionCall12.errors.txt b/tests/baselines/reference/functionCall12.errors.txt index eabe1131ec1..ef93a34b080 100644 --- a/tests/baselines/reference/functionCall12.errors.txt +++ b/tests/baselines/reference/functionCall12.errors.txt @@ -1,6 +1,6 @@ tests/cases/compiler/functionCall12.ts(4,1): error TS2346: Supplied parameters do not match any signature of call target. -tests/cases/compiler/functionCall12.ts(5,5): error TS2345: Argument of type 'number' is not assignable to parameter of type 'string'. -tests/cases/compiler/functionCall12.ts(7,15): error TS2345: Argument of type 'number' is not assignable to parameter of type 'string'. +tests/cases/compiler/functionCall12.ts(5,5): error TS2345: Argument of type '1' is not assignable to parameter of type 'string'. +tests/cases/compiler/functionCall12.ts(7,15): error TS2345: Argument of type '3' is not assignable to parameter of type 'string'. ==== tests/cases/compiler/functionCall12.ts (3 errors) ==== @@ -12,9 +12,9 @@ tests/cases/compiler/functionCall12.ts(7,15): error TS2345: Argument of type 'nu !!! error TS2346: Supplied parameters do not match any signature of call target. foo(1, 'bar'); ~ -!!! error TS2345: Argument of type 'number' is not assignable to parameter of type 'string'. +!!! error TS2345: Argument of type '1' is not assignable to parameter of type 'string'. foo('foo', 1, 'bar'); foo('foo', 1, 3); ~ -!!! error TS2345: Argument of type 'number' is not assignable to parameter of type 'string'. +!!! error TS2345: Argument of type '3' is not assignable to parameter of type 'string'. \ No newline at end of file diff --git a/tests/baselines/reference/functionCall13.errors.txt b/tests/baselines/reference/functionCall13.errors.txt index 31c05915aab..a89d7fc1efa 100644 --- a/tests/baselines/reference/functionCall13.errors.txt +++ b/tests/baselines/reference/functionCall13.errors.txt @@ -1,5 +1,5 @@ tests/cases/compiler/functionCall13.ts(4,1): error TS2346: Supplied parameters do not match any signature of call target. -tests/cases/compiler/functionCall13.ts(5,5): error TS2345: Argument of type 'number' is not assignable to parameter of type 'string'. +tests/cases/compiler/functionCall13.ts(5,5): error TS2345: Argument of type '1' is not assignable to parameter of type 'string'. ==== tests/cases/compiler/functionCall13.ts (2 errors) ==== @@ -11,6 +11,6 @@ tests/cases/compiler/functionCall13.ts(5,5): error TS2345: Argument of type 'num !!! error TS2346: Supplied parameters do not match any signature of call target. foo(1, 'bar'); ~ -!!! error TS2345: Argument of type 'number' is not assignable to parameter of type 'string'. +!!! error TS2345: Argument of type '1' is not assignable to parameter of type 'string'. foo('foo', 1, 3); \ No newline at end of file diff --git a/tests/baselines/reference/functionCall14.errors.txt b/tests/baselines/reference/functionCall14.errors.txt index 3b671d0252b..2de62978c84 100644 --- a/tests/baselines/reference/functionCall14.errors.txt +++ b/tests/baselines/reference/functionCall14.errors.txt @@ -1,4 +1,4 @@ -tests/cases/compiler/functionCall14.ts(5,5): error TS2345: Argument of type 'number' is not assignable to parameter of type 'string'. +tests/cases/compiler/functionCall14.ts(5,5): error TS2345: Argument of type '1' is not assignable to parameter of type 'string'. ==== tests/cases/compiler/functionCall14.ts (1 errors) ==== @@ -8,6 +8,6 @@ tests/cases/compiler/functionCall14.ts(5,5): error TS2345: Argument of type 'num foo(); foo(1, 'bar'); ~ -!!! error TS2345: Argument of type 'number' is not assignable to parameter of type 'string'. +!!! error TS2345: Argument of type '1' is not assignable to parameter of type 'string'. foo('foo', 1, 3); \ No newline at end of file diff --git a/tests/baselines/reference/functionCall16.errors.txt b/tests/baselines/reference/functionCall16.errors.txt index eb71df23eca..d338c1305dd 100644 --- a/tests/baselines/reference/functionCall16.errors.txt +++ b/tests/baselines/reference/functionCall16.errors.txt @@ -1,13 +1,13 @@ -tests/cases/compiler/functionCall16.ts(2,12): error TS2345: Argument of type 'number' is not assignable to parameter of type 'string'. +tests/cases/compiler/functionCall16.ts(2,12): error TS2345: Argument of type '1' is not assignable to parameter of type 'string'. tests/cases/compiler/functionCall16.ts(5,1): error TS2346: Supplied parameters do not match any signature of call target. -tests/cases/compiler/functionCall16.ts(6,5): error TS2345: Argument of type 'number' is not assignable to parameter of type 'string'. +tests/cases/compiler/functionCall16.ts(6,5): error TS2345: Argument of type '1' is not assignable to parameter of type 'string'. ==== tests/cases/compiler/functionCall16.ts (3 errors) ==== function foo(a:string, b?:string, ...c:number[]){} foo('foo', 1); ~ -!!! error TS2345: Argument of type 'number' is not assignable to parameter of type 'string'. +!!! error TS2345: Argument of type '1' is not assignable to parameter of type 'string'. foo('foo'); foo('foo', 'bar'); foo(); @@ -15,6 +15,6 @@ tests/cases/compiler/functionCall16.ts(6,5): error TS2345: Argument of type 'num !!! error TS2346: Supplied parameters do not match any signature of call target. foo(1, 'bar'); ~ -!!! error TS2345: Argument of type 'number' is not assignable to parameter of type 'string'. +!!! error TS2345: Argument of type '1' is not assignable to parameter of type 'string'. foo('foo', 'bar', 3); \ No newline at end of file diff --git a/tests/baselines/reference/functionCall17.errors.txt b/tests/baselines/reference/functionCall17.errors.txt index 09f36c22cfb..f266554b518 100644 --- a/tests/baselines/reference/functionCall17.errors.txt +++ b/tests/baselines/reference/functionCall17.errors.txt @@ -1,23 +1,23 @@ -tests/cases/compiler/functionCall17.ts(2,12): error TS2345: Argument of type 'number' is not assignable to parameter of type 'string'. +tests/cases/compiler/functionCall17.ts(2,12): error TS2345: Argument of type '1' is not assignable to parameter of type 'string'. tests/cases/compiler/functionCall17.ts(4,1): error TS2346: Supplied parameters do not match any signature of call target. -tests/cases/compiler/functionCall17.ts(5,5): error TS2345: Argument of type 'number' is not assignable to parameter of type 'string'. -tests/cases/compiler/functionCall17.ts(6,12): error TS2345: Argument of type 'number' is not assignable to parameter of type 'string'. +tests/cases/compiler/functionCall17.ts(5,5): error TS2345: Argument of type '1' is not assignable to parameter of type 'string'. +tests/cases/compiler/functionCall17.ts(6,12): error TS2345: Argument of type '1' is not assignable to parameter of type 'string'. ==== tests/cases/compiler/functionCall17.ts (4 errors) ==== function foo(a:string, b?:string, c?:number, ...d:number[]){} foo('foo', 1); ~ -!!! error TS2345: Argument of type 'number' is not assignable to parameter of type 'string'. +!!! error TS2345: Argument of type '1' is not assignable to parameter of type 'string'. foo('foo'); foo(); ~~~~~ !!! error TS2346: Supplied parameters do not match any signature of call target. foo(1, 'bar'); ~ -!!! error TS2345: Argument of type 'number' is not assignable to parameter of type 'string'. +!!! error TS2345: Argument of type '1' is not assignable to parameter of type 'string'. foo('foo', 1, 3); ~ -!!! error TS2345: Argument of type 'number' is not assignable to parameter of type 'string'. +!!! error TS2345: Argument of type '1' is not assignable to parameter of type 'string'. foo('foo', 'bar', 3, 4); \ No newline at end of file diff --git a/tests/baselines/reference/functionCall2.types b/tests/baselines/reference/functionCall2.types index 152d54cb186..aec991aa85f 100644 --- a/tests/baselines/reference/functionCall2.types +++ b/tests/baselines/reference/functionCall2.types @@ -1,7 +1,7 @@ === tests/cases/compiler/functionCall2.ts === function foo():number{return 1}; >foo : () => number ->1 : number +>1 : 1 var x = foo(); >x : number diff --git a/tests/baselines/reference/functionCall3.types b/tests/baselines/reference/functionCall3.types index b58803ae666..2df6de6fa74 100644 --- a/tests/baselines/reference/functionCall3.types +++ b/tests/baselines/reference/functionCall3.types @@ -2,7 +2,7 @@ function foo():any[]{return [1];} >foo : () => any[] >[1] : number[] ->1 : number +>1 : 1 var x = foo(); >x : any[] diff --git a/tests/baselines/reference/functionCall4.types b/tests/baselines/reference/functionCall4.types index ea60c759a7d..41c406ef483 100644 --- a/tests/baselines/reference/functionCall4.types +++ b/tests/baselines/reference/functionCall4.types @@ -1,7 +1,7 @@ === tests/cases/compiler/functionCall4.ts === function foo():any{return ""}; >foo : () => any ->"" : string +>"" : "" function bar():()=>any{return foo}; >bar : () => () => any diff --git a/tests/baselines/reference/functionCall6.errors.txt b/tests/baselines/reference/functionCall6.errors.txt index 4da265ea5e2..3d590d8f5c2 100644 --- a/tests/baselines/reference/functionCall6.errors.txt +++ b/tests/baselines/reference/functionCall6.errors.txt @@ -1,4 +1,4 @@ -tests/cases/compiler/functionCall6.ts(3,5): error TS2345: Argument of type 'number' is not assignable to parameter of type 'string'. +tests/cases/compiler/functionCall6.ts(3,5): error TS2345: Argument of type '2' is not assignable to parameter of type 'string'. tests/cases/compiler/functionCall6.ts(4,1): error TS2346: Supplied parameters do not match any signature of call target. tests/cases/compiler/functionCall6.ts(5,1): error TS2346: Supplied parameters do not match any signature of call target. @@ -8,7 +8,7 @@ tests/cases/compiler/functionCall6.ts(5,1): error TS2346: Supplied parameters do foo('bar'); foo(2); ~ -!!! error TS2345: Argument of type 'number' is not assignable to parameter of type 'string'. +!!! error TS2345: Argument of type '2' is not assignable to parameter of type 'string'. foo('foo', 'bar'); ~~~~~~~~~~~~~~~~~ !!! error TS2346: Supplied parameters do not match any signature of call target. diff --git a/tests/baselines/reference/functionCall7.errors.txt b/tests/baselines/reference/functionCall7.errors.txt index 576ea9c266e..138c5f62f16 100644 --- a/tests/baselines/reference/functionCall7.errors.txt +++ b/tests/baselines/reference/functionCall7.errors.txt @@ -1,5 +1,5 @@ tests/cases/compiler/functionCall7.ts(5,1): error TS2346: Supplied parameters do not match any signature of call target. -tests/cases/compiler/functionCall7.ts(6,5): error TS2345: Argument of type 'number' is not assignable to parameter of type 'c1'. +tests/cases/compiler/functionCall7.ts(6,5): error TS2345: Argument of type '4' is not assignable to parameter of type 'c1'. tests/cases/compiler/functionCall7.ts(7,1): error TS2346: Supplied parameters do not match any signature of call target. @@ -13,7 +13,7 @@ tests/cases/compiler/functionCall7.ts(7,1): error TS2346: Supplied parameters do !!! error TS2346: Supplied parameters do not match any signature of call target. foo(4); ~ -!!! error TS2345: Argument of type 'number' is not assignable to parameter of type 'c1'. +!!! error TS2345: Argument of type '4' is not assignable to parameter of type 'c1'. foo(); ~~~~~ !!! error TS2346: Supplied parameters do not match any signature of call target. diff --git a/tests/baselines/reference/functionCall8.errors.txt b/tests/baselines/reference/functionCall8.errors.txt index 0e5479c8cfd..7cf197d5812 100644 --- a/tests/baselines/reference/functionCall8.errors.txt +++ b/tests/baselines/reference/functionCall8.errors.txt @@ -1,5 +1,5 @@ tests/cases/compiler/functionCall8.ts(3,1): error TS2346: Supplied parameters do not match any signature of call target. -tests/cases/compiler/functionCall8.ts(4,5): error TS2345: Argument of type 'number' is not assignable to parameter of type 'string'. +tests/cases/compiler/functionCall8.ts(4,5): error TS2345: Argument of type '4' is not assignable to parameter of type 'string'. ==== tests/cases/compiler/functionCall8.ts (2 errors) ==== @@ -10,6 +10,6 @@ tests/cases/compiler/functionCall8.ts(4,5): error TS2345: Argument of type 'numb !!! error TS2346: Supplied parameters do not match any signature of call target. foo(4); ~ -!!! error TS2345: Argument of type 'number' is not assignable to parameter of type 'string'. +!!! error TS2345: Argument of type '4' is not assignable to parameter of type 'string'. foo(); \ No newline at end of file diff --git a/tests/baselines/reference/functionCall9.errors.txt b/tests/baselines/reference/functionCall9.errors.txt index d9d00593414..83cda64e204 100644 --- a/tests/baselines/reference/functionCall9.errors.txt +++ b/tests/baselines/reference/functionCall9.errors.txt @@ -1,4 +1,4 @@ -tests/cases/compiler/functionCall9.ts(4,11): error TS2345: Argument of type 'string' is not assignable to parameter of type 'number'. +tests/cases/compiler/functionCall9.ts(4,11): error TS2345: Argument of type '"bar"' is not assignable to parameter of type 'number'. tests/cases/compiler/functionCall9.ts(5,1): error TS2346: Supplied parameters do not match any signature of call target. @@ -8,7 +8,7 @@ tests/cases/compiler/functionCall9.ts(5,1): error TS2346: Supplied parameters do foo('foo'); foo('foo','bar'); ~~~~~ -!!! error TS2345: Argument of type 'string' is not assignable to parameter of type 'number'. +!!! error TS2345: Argument of type '"bar"' is not assignable to parameter of type 'number'. foo('foo', 1, 'bar'); ~~~~~~~~~~~~~~~~~~~~ !!! error TS2346: Supplied parameters do not match any signature of call target. diff --git a/tests/baselines/reference/functionConstraintSatisfaction2.errors.txt b/tests/baselines/reference/functionConstraintSatisfaction2.errors.txt index 7d3fa793ec8..7f3d8d90802 100644 --- a/tests/baselines/reference/functionConstraintSatisfaction2.errors.txt +++ b/tests/baselines/reference/functionConstraintSatisfaction2.errors.txt @@ -1,4 +1,4 @@ -tests/cases/conformance/types/typeParameters/typeArgumentLists/functionConstraintSatisfaction2.ts(5,5): error TS2345: Argument of type 'number' is not assignable to parameter of type 'Function'. +tests/cases/conformance/types/typeParameters/typeArgumentLists/functionConstraintSatisfaction2.ts(5,5): error TS2345: Argument of type '1' is not assignable to parameter of type 'Function'. tests/cases/conformance/types/typeParameters/typeArgumentLists/functionConstraintSatisfaction2.ts(6,1): error TS2346: Supplied parameters do not match any signature of call target. tests/cases/conformance/types/typeParameters/typeArgumentLists/functionConstraintSatisfaction2.ts(7,1): error TS2346: Supplied parameters do not match any signature of call target. tests/cases/conformance/types/typeParameters/typeArgumentLists/functionConstraintSatisfaction2.ts(23,14): error TS2345: Argument of type 'Function' is not assignable to parameter of type '(x: string) => string'. @@ -33,7 +33,7 @@ tests/cases/conformance/types/typeParameters/typeArgumentLists/functionConstrain foo(1); ~ -!!! error TS2345: Argument of type 'number' is not assignable to parameter of type 'Function'. +!!! error TS2345: Argument of type '1' is not assignable to parameter of type 'Function'. foo(() => { }, 1); ~~~~~~~~~~~~~~~~~ !!! error TS2346: Supplied parameters do not match any signature of call target. diff --git a/tests/baselines/reference/functionExpressionContextualTyping1.types b/tests/baselines/reference/functionExpressionContextualTyping1.types index 893744c4954..58265c74aa2 100644 --- a/tests/baselines/reference/functionExpressionContextualTyping1.types +++ b/tests/baselines/reference/functionExpressionContextualTyping1.types @@ -4,8 +4,8 @@ enum E { red, blue } >E : E ->red : E ->blue : E +>red : E.red +>blue : E.blue // A contextual signature S is extracted from a function type T as follows: // If T is a function type with exactly one call signature, and if that call signature is non- generic, S is that signature. @@ -25,7 +25,7 @@ var a0: (n: number, s: string) => number = (num, str) => { >toExponential : (fractionDigits?: number) => string return 0; ->0 : number +>0 : 0 } class Class { @@ -51,7 +51,7 @@ var a1: (c: Class) => number = (a1) => { >foo : () => void return 1; ->1 : number +>1 : 1 } // A contextual signature S is extracted from a function type T as follows: @@ -87,7 +87,7 @@ b2 = (foo, bar) => { return foo + 1; } >bar : string >foo + 1 : number >foo : number ->1 : number +>1 : 1 b2 = (foo, bar) => { return "hello"; } >b2 = (foo, bar) => { return "hello"; } : (foo: number, bar: string) => string @@ -95,7 +95,7 @@ b2 = (foo, bar) => { return "hello"; } >(foo, bar) => { return "hello"; } : (foo: number, bar: string) => string >foo : number >bar : string ->"hello" : string +>"hello" : "hello" var b3: (name: string, num: number, boo: boolean) => void; >b3 : (name: string, num: number, boo: boolean) => void @@ -117,15 +117,15 @@ var b4: (n: E) => string = (number = 1) => { return "hello"; }; >(number = 1) => { return "hello"; } : (number?: E) => string >number : E >1 : 1 ->"hello" : string +>"hello" : "hello" var b5: (n: {}) => string = (number = "string") => { return "hello"; }; >b5 : (n: {}) => string >n : {} >(number = "string") => { return "hello"; } : (number?: {}) => string >number : {} ->"string" : string ->"hello" : string +>"string" : "string" +>"hello" : "hello" // A contextual signature S is extracted from a function type T as follows: // Otherwise, no contextual signature can be extracted from T and S is undefined. diff --git a/tests/baselines/reference/functionExpressionShadowedByParams.errors.txt b/tests/baselines/reference/functionExpressionShadowedByParams.errors.txt index 74b4c171a57..f0d821d89c1 100644 --- a/tests/baselines/reference/functionExpressionShadowedByParams.errors.txt +++ b/tests/baselines/reference/functionExpressionShadowedByParams.errors.txt @@ -1,4 +1,4 @@ -tests/cases/compiler/functionExpressionShadowedByParams.ts(3,4): error TS2349: Cannot invoke an expression whose type lacks a call signature. +tests/cases/compiler/functionExpressionShadowedByParams.ts(3,4): error TS2349: Cannot invoke an expression whose type lacks a call signature. Type 'Number' has no compatible call signatures. tests/cases/compiler/functionExpressionShadowedByParams.ts(10,9): error TS2339: Property 'apply' does not exist on type 'number'. @@ -7,7 +7,7 @@ tests/cases/compiler/functionExpressionShadowedByParams.ts(10,9): error TS2339: b1.toPrecision(2); // should not error b1(12); // should error ~~~~~~ -!!! error TS2349: Cannot invoke an expression whose type lacks a call signature. +!!! error TS2349: Cannot invoke an expression whose type lacks a call signature. Type 'Number' has no compatible call signatures. } diff --git a/tests/baselines/reference/functionImplementationErrors.errors.txt b/tests/baselines/reference/functionImplementationErrors.errors.txt index dc5ad5a2747..224ebc7c08e 100644 --- a/tests/baselines/reference/functionImplementationErrors.errors.txt +++ b/tests/baselines/reference/functionImplementationErrors.errors.txt @@ -1,44 +1,26 @@ -tests/cases/conformance/functions/functionImplementationErrors.ts(3,10): error TS2354: No best common type exists among return expressions. -tests/cases/conformance/functions/functionImplementationErrors.ts(7,19): error TS2354: No best common type exists among return expressions. -tests/cases/conformance/functions/functionImplementationErrors.ts(11,10): error TS2354: No best common type exists among return expressions. -tests/cases/conformance/functions/functionImplementationErrors.ts(17,10): error TS2354: No best common type exists among return expressions. tests/cases/conformance/functions/functionImplementationErrors.ts(26,16): error TS2355: A function whose declared type is neither 'void' nor 'any' must return a value. tests/cases/conformance/functions/functionImplementationErrors.ts(31,17): error TS2373: Initializer of parameter 'n' cannot reference identifier 'm' declared after it. tests/cases/conformance/functions/functionImplementationErrors.ts(36,17): error TS2373: Initializer of parameter 'n' cannot reference identifier 'm' declared after it. -tests/cases/conformance/functions/functionImplementationErrors.ts(50,10): error TS2354: No best common type exists among return expressions. -tests/cases/conformance/functions/functionImplementationErrors.ts(54,10): error TS2354: No best common type exists among return expressions. -tests/cases/conformance/functions/functionImplementationErrors.ts(58,11): error TS2354: No best common type exists among return expressions. -tests/cases/conformance/functions/functionImplementationErrors.ts(62,10): error TS2354: No best common type exists among return expressions. -tests/cases/conformance/functions/functionImplementationErrors.ts(66,11): error TS2354: No best common type exists among return expressions. -tests/cases/conformance/functions/functionImplementationErrors.ts(70,11): error TS2354: No best common type exists among return expressions. -==== tests/cases/conformance/functions/functionImplementationErrors.ts (13 errors) ==== +==== tests/cases/conformance/functions/functionImplementationErrors.ts (3 errors) ==== // FunctionExpression with no return type annotation with multiple return statements with unrelated types var f1 = function () { - ~~~~~~~~ -!!! error TS2354: No best common type exists among return expressions. return ''; return 3; }; var f2 = function x() { - ~ -!!! error TS2354: No best common type exists among return expressions. return ''; return 3; }; var f3 = () => { - ~~~~~~~ -!!! error TS2354: No best common type exists among return expressions. return ''; return 3; }; // FunctionExpression with no return type annotation with return branch of number[] and other of string[] var f4 = function () { - ~~~~~~~~ -!!! error TS2354: No best common type exists among return expressions. if (true) { return ['']; } else { @@ -78,38 +60,26 @@ tests/cases/conformance/functions/functionImplementationErrors.ts(70,11): error class Derived1 extends Base { private m; } class Derived2 extends Base { private n; } function f8() { - ~~ -!!! error TS2354: No best common type exists among return expressions. return new Derived1(); return new Derived2(); } var f9 = function () { - ~~~~~~~~ -!!! error TS2354: No best common type exists among return expressions. return new Derived1(); return new Derived2(); }; var f10 = () => { - ~~~~~~~ -!!! error TS2354: No best common type exists among return expressions. return new Derived1(); return new Derived2(); }; function f11() { - ~~~ -!!! error TS2354: No best common type exists among return expressions. return new Base(); return new AnotherClass(); } var f12 = function () { - ~~~~~~~~ -!!! error TS2354: No best common type exists among return expressions. return new Base(); return new AnotherClass(); }; var f13 = () => { - ~~~~~~~ -!!! error TS2354: No best common type exists among return expressions. return new Base(); return new AnotherClass(); }; diff --git a/tests/baselines/reference/functionImplementations.types b/tests/baselines/reference/functionImplementations.types index 6cb1cde1c82..d81b02598bd 100644 --- a/tests/baselines/reference/functionImplementations.types +++ b/tests/baselines/reference/functionImplementations.types @@ -102,7 +102,7 @@ var n = function () { >function () { return 3;} : () => number return 3; ->3 : number +>3 : 3 } (); @@ -139,7 +139,7 @@ var un = function () { // FunctionExpression with no return type annotation and returns a type parameter type var n = function (x: T) { >n : number ->function (x: T) { return x;} (4) : number +>function (x: T) { return x;} (4) : 4 >function (x: T) { return x;} : (x: T) => T >T : T >x : T @@ -149,12 +149,12 @@ var n = function (x: T) { >x : T } (4); ->4 : number +>4 : 4 // FunctionExpression with no return type annotation and returns a constrained type parameter type var n = function (x: T) { >n : number ->function (x: T) { return x;} (4) : number +>function (x: T) { return x;} (4) : 4 >function (x: T) { return x;} : (x: T) => T >T : T >x : T @@ -164,19 +164,19 @@ var n = function (x: T) { >x : T } (4); ->4 : number +>4 : 4 // FunctionExpression with no return type annotation with multiple return statements with identical types var n = function () { >n : number ->function () { return 3; return 5;}() : number ->function () { return 3; return 5;} : () => number +>function () { return 3; return 5;}() : 3 | 5 +>function () { return 3; return 5;} : () => 3 | 5 return 3; ->3 : number +>3 : 3 return 5; ->5 : number +>5 : 5 }(); @@ -255,7 +255,7 @@ function thisFunc() { function opt1(n = 4) { >opt1 : (n?: number) => void >n : number ->4 : number +>4 : 4 var m = n; >m : number @@ -331,7 +331,7 @@ var f7: (x: number) => string | number = x => { // should be (x: number) => numb if (x < 0) { return x; } >x < 0 : boolean >x : number ->0 : number +>0 : 0 >x : number return x.toString(); diff --git a/tests/baselines/reference/functionInIfStatementInModule.types b/tests/baselines/reference/functionInIfStatementInModule.types index 11cdd80f0a1..48dd8f82d79 100644 --- a/tests/baselines/reference/functionInIfStatementInModule.types +++ b/tests/baselines/reference/functionInIfStatementInModule.types @@ -4,7 +4,7 @@ module Midori >Midori : typeof Midori { if (false) { ->false : boolean +>false : false function Foo(src) >Foo : (src: any) => void diff --git a/tests/baselines/reference/functionLiteral.types b/tests/baselines/reference/functionLiteral.types index 06c811093c3..69a7fc44e51 100644 --- a/tests/baselines/reference/functionLiteral.types +++ b/tests/baselines/reference/functionLiteral.types @@ -4,7 +4,7 @@ var x = () => 1; >x : () => number >() => 1 : () => number ->1 : number +>1 : 1 var x: { >x : () => number diff --git a/tests/baselines/reference/functionMergedWithModule.types b/tests/baselines/reference/functionMergedWithModule.types index ec0143f2923..1752016d5fd 100644 --- a/tests/baselines/reference/functionMergedWithModule.types +++ b/tests/baselines/reference/functionMergedWithModule.types @@ -5,7 +5,7 @@ function foo(title: string) { var x = 10; >x : number ->10 : number +>10 : 10 } module foo.Bar { diff --git a/tests/baselines/reference/functionOnlyHasThrow.types b/tests/baselines/reference/functionOnlyHasThrow.types index c4e8cce38a2..18011f10ada 100644 --- a/tests/baselines/reference/functionOnlyHasThrow.types +++ b/tests/baselines/reference/functionOnlyHasThrow.types @@ -5,5 +5,5 @@ function clone():number { throw new Error("To be implemented"); >new Error("To be implemented") : Error >Error : ErrorConstructor ->"To be implemented" : string +>"To be implemented" : "To be implemented" } diff --git a/tests/baselines/reference/functionOverloadCompatibilityWithVoid02.types b/tests/baselines/reference/functionOverloadCompatibilityWithVoid02.types index aa6fda7222b..6530f5a0a27 100644 --- a/tests/baselines/reference/functionOverloadCompatibilityWithVoid02.types +++ b/tests/baselines/reference/functionOverloadCompatibilityWithVoid02.types @@ -8,5 +8,5 @@ function f(x: string): number { >x : string return 0; ->0 : number +>0 : 0 } diff --git a/tests/baselines/reference/functionOverloads.errors.txt b/tests/baselines/reference/functionOverloads.errors.txt index bd3bab3388b..5530f813384 100644 --- a/tests/baselines/reference/functionOverloads.errors.txt +++ b/tests/baselines/reference/functionOverloads.errors.txt @@ -1,4 +1,4 @@ -tests/cases/compiler/functionOverloads.ts(4,13): error TS2345: Argument of type 'number' is not assignable to parameter of type 'string'. +tests/cases/compiler/functionOverloads.ts(4,13): error TS2345: Argument of type '5' is not assignable to parameter of type 'string'. ==== tests/cases/compiler/functionOverloads.ts (1 errors) ==== @@ -7,4 +7,4 @@ tests/cases/compiler/functionOverloads.ts(4,13): error TS2345: Argument of type function foo(bar?: string): any { return "" }; var x = foo(5); ~ -!!! error TS2345: Argument of type 'number' is not assignable to parameter of type 'string'. \ No newline at end of file +!!! error TS2345: Argument of type '5' is not assignable to parameter of type 'string'. \ No newline at end of file diff --git a/tests/baselines/reference/functionOverloads12.types b/tests/baselines/reference/functionOverloads12.types index 5db8ff68cd4..d29f6262844 100644 --- a/tests/baselines/reference/functionOverloads12.types +++ b/tests/baselines/reference/functionOverloads12.types @@ -8,7 +8,7 @@ function foo():number; function foo():any { if (true) return ""; else return 0;} >foo : { (): string; (): number; } ->true : boolean ->"" : string ->0 : number +>true : true +>"" : "" +>0 : 0 diff --git a/tests/baselines/reference/functionOverloads13.types b/tests/baselines/reference/functionOverloads13.types index f26067c7eb8..2e77cf73645 100644 --- a/tests/baselines/reference/functionOverloads13.types +++ b/tests/baselines/reference/functionOverloads13.types @@ -10,5 +10,5 @@ function foo(bar:number):number; function foo(bar?:number):any { return "" } >foo : { (bar: number): string; (bar: number): number; } >bar : number ->"" : string +>"" : "" diff --git a/tests/baselines/reference/functionOverloads14.types b/tests/baselines/reference/functionOverloads14.types index 032ed700545..3e88bd04f88 100644 --- a/tests/baselines/reference/functionOverloads14.types +++ b/tests/baselines/reference/functionOverloads14.types @@ -12,5 +12,5 @@ function foo():{a:any;} { return {a:1} } >a : any >{a:1} : { a: number; } >a : number ->1 : number +>1 : 1 diff --git a/tests/baselines/reference/functionOverloads15.types b/tests/baselines/reference/functionOverloads15.types index 8fe428e9a40..86c9fc6a665 100644 --- a/tests/baselines/reference/functionOverloads15.types +++ b/tests/baselines/reference/functionOverloads15.types @@ -16,5 +16,5 @@ function foo(foo:{a:string; b?:number;}):any { return "" } >foo : { a: string; b?: number; } >a : string >b : number ->"" : string +>"" : "" diff --git a/tests/baselines/reference/functionOverloads16.types b/tests/baselines/reference/functionOverloads16.types index e6c6ceb57a6..1d7a4184de1 100644 --- a/tests/baselines/reference/functionOverloads16.types +++ b/tests/baselines/reference/functionOverloads16.types @@ -14,5 +14,5 @@ function foo(foo:{a:string; b?:number;}):any { return "" } >foo : { a: string; b?: number; } >a : string >b : number ->"" : string +>"" : "" diff --git a/tests/baselines/reference/functionOverloads2.errors.txt b/tests/baselines/reference/functionOverloads2.errors.txt index 85a4a882487..60fbe2843d9 100644 --- a/tests/baselines/reference/functionOverloads2.errors.txt +++ b/tests/baselines/reference/functionOverloads2.errors.txt @@ -1,4 +1,4 @@ -tests/cases/compiler/functionOverloads2.ts(4,13): error TS2345: Argument of type 'boolean' is not assignable to parameter of type 'number'. +tests/cases/compiler/functionOverloads2.ts(4,13): error TS2345: Argument of type 'true' is not assignable to parameter of type 'number'. ==== tests/cases/compiler/functionOverloads2.ts (1 errors) ==== @@ -7,4 +7,4 @@ tests/cases/compiler/functionOverloads2.ts(4,13): error TS2345: Argument of type function foo(bar: any): any { return bar }; var x = foo(true); ~~~~ -!!! error TS2345: Argument of type 'boolean' is not assignable to parameter of type 'number'. \ No newline at end of file +!!! error TS2345: Argument of type 'true' is not assignable to parameter of type 'number'. \ No newline at end of file diff --git a/tests/baselines/reference/functionOverloads21.types b/tests/baselines/reference/functionOverloads21.types index 3b4cf261ea9..4d87e3a123c 100644 --- a/tests/baselines/reference/functionOverloads21.types +++ b/tests/baselines/reference/functionOverloads21.types @@ -15,5 +15,5 @@ function foo(bar:{a:any; b?:string;}[]) { return 0 } >bar : { a: any; b?: string; }[] >a : any >b : string ->0 : number +>0 : 0 diff --git a/tests/baselines/reference/functionOverloads22.types b/tests/baselines/reference/functionOverloads22.types index 7557b1c049f..ff6b30c084b 100644 --- a/tests/baselines/reference/functionOverloads22.types +++ b/tests/baselines/reference/functionOverloads22.types @@ -18,5 +18,5 @@ function foo(bar:any):{a:any;b?:any;}[] { return [{a:""}] } >[{a:""}] : { a: string; }[] >{a:""} : { a: string; } >a : string ->"" : string +>"" : "" diff --git a/tests/baselines/reference/functionOverloads23.types b/tests/baselines/reference/functionOverloads23.types index ee510a336e1..98970307672 100644 --- a/tests/baselines/reference/functionOverloads23.types +++ b/tests/baselines/reference/functionOverloads23.types @@ -13,5 +13,5 @@ function foo(bar:(a?)=>void) { return 0 } >foo : { (bar: (b: string) => void): any; (bar: (a: number) => void): any; } >bar : (a?: any) => void >a : any ->0 : number +>0 : 0 diff --git a/tests/baselines/reference/functionOverloads25.types b/tests/baselines/reference/functionOverloads25.types index 5b5c3781e74..53539cbc122 100644 --- a/tests/baselines/reference/functionOverloads25.types +++ b/tests/baselines/reference/functionOverloads25.types @@ -9,7 +9,7 @@ function foo(bar:string):number; function foo(bar?:any):any{ return '' }; >foo : { (): string; (bar: string): number; } >bar : any ->'' : string +>'' : "" var x = foo(); >x : string diff --git a/tests/baselines/reference/functionOverloads26.types b/tests/baselines/reference/functionOverloads26.types index 9345507b72e..19f11bcf3fc 100644 --- a/tests/baselines/reference/functionOverloads26.types +++ b/tests/baselines/reference/functionOverloads26.types @@ -9,11 +9,11 @@ function foo(bar:string):number; function foo(bar?:any):any{ return '' } >foo : { (): string; (bar: string): number; } >bar : any ->'' : string +>'' : "" var x = foo('baz'); >x : number >foo('baz') : number >foo : { (): string; (bar: string): number; } ->'baz' : string +>'baz' : "baz" diff --git a/tests/baselines/reference/functionOverloads27.errors.txt b/tests/baselines/reference/functionOverloads27.errors.txt index a5d16935f2f..2b21de7134b 100644 --- a/tests/baselines/reference/functionOverloads27.errors.txt +++ b/tests/baselines/reference/functionOverloads27.errors.txt @@ -1,4 +1,4 @@ -tests/cases/compiler/functionOverloads27.ts(4,13): error TS2345: Argument of type 'number' is not assignable to parameter of type 'string'. +tests/cases/compiler/functionOverloads27.ts(4,13): error TS2345: Argument of type '5' is not assignable to parameter of type 'string'. ==== tests/cases/compiler/functionOverloads27.ts (1 errors) ==== @@ -7,5 +7,5 @@ tests/cases/compiler/functionOverloads27.ts(4,13): error TS2345: Argument of typ function foo(bar?:any):any{ return '' } var x = foo(5); ~ -!!! error TS2345: Argument of type 'number' is not assignable to parameter of type 'string'. +!!! error TS2345: Argument of type '5' is not assignable to parameter of type 'string'. \ No newline at end of file diff --git a/tests/baselines/reference/functionOverloads28.types b/tests/baselines/reference/functionOverloads28.types index ae4ab6c0664..96d126adf3e 100644 --- a/tests/baselines/reference/functionOverloads28.types +++ b/tests/baselines/reference/functionOverloads28.types @@ -9,7 +9,7 @@ function foo(bar:string):number; function foo(bar?:any):any{ return '' } >foo : { (): string; (bar: string): number; } >bar : any ->'' : string +>'' : "" var t:any; var x = foo(t); >t : any diff --git a/tests/baselines/reference/functionOverloads30.types b/tests/baselines/reference/functionOverloads30.types index a97bc0bb74d..fdbefa027ef 100644 --- a/tests/baselines/reference/functionOverloads30.types +++ b/tests/baselines/reference/functionOverloads30.types @@ -16,5 +16,5 @@ var x = foo('bar'); >x : string >foo('bar') : string >foo : { (bar: string): string; (bar: number): number; } ->'bar' : string +>'bar' : "bar" diff --git a/tests/baselines/reference/functionOverloads31.types b/tests/baselines/reference/functionOverloads31.types index c85470ebd65..a80ba71153e 100644 --- a/tests/baselines/reference/functionOverloads31.types +++ b/tests/baselines/reference/functionOverloads31.types @@ -16,5 +16,5 @@ var x = foo(5); >x : number >foo(5) : number >foo : { (bar: string): string; (bar: number): number; } ->5 : number +>5 : 5 diff --git a/tests/baselines/reference/functionOverloads33.types b/tests/baselines/reference/functionOverloads33.types index 3d57c983305..99d8f429b80 100644 --- a/tests/baselines/reference/functionOverloads33.types +++ b/tests/baselines/reference/functionOverloads33.types @@ -16,5 +16,5 @@ var x = foo(5); >x : number >foo(5) : number >foo : { (bar: string): string; (bar: any): number; } ->5 : number +>5 : 5 diff --git a/tests/baselines/reference/functionOverloads35.types b/tests/baselines/reference/functionOverloads35.types index 1b811cf4246..8686bc2fdf8 100644 --- a/tests/baselines/reference/functionOverloads35.types +++ b/tests/baselines/reference/functionOverloads35.types @@ -21,5 +21,5 @@ var x = foo({a:1}); >foo : { (bar: { a: number; }): number; (bar: { a: string; }): string; } >{a:1} : { a: number; } >a : number ->1 : number +>1 : 1 diff --git a/tests/baselines/reference/functionOverloads36.types b/tests/baselines/reference/functionOverloads36.types index c8c1f7cede8..8a78f466d34 100644 --- a/tests/baselines/reference/functionOverloads36.types +++ b/tests/baselines/reference/functionOverloads36.types @@ -21,5 +21,5 @@ var x = foo({a:'foo'}); >foo : { (bar: { a: number; }): number; (bar: { a: string; }): string; } >{a:'foo'} : { a: string; } >a : string ->'foo' : string +>'foo' : "foo" diff --git a/tests/baselines/reference/functionOverloads38.types b/tests/baselines/reference/functionOverloads38.types index d718569c9bf..e8b32f78e7c 100644 --- a/tests/baselines/reference/functionOverloads38.types +++ b/tests/baselines/reference/functionOverloads38.types @@ -22,5 +22,5 @@ var x = foo([{a:1}]); >[{a:1}] : { a: number; }[] >{a:1} : { a: number; } >a : number ->1 : number +>1 : 1 diff --git a/tests/baselines/reference/functionOverloads39.types b/tests/baselines/reference/functionOverloads39.types index 78c0e78bca1..058a98680f6 100644 --- a/tests/baselines/reference/functionOverloads39.types +++ b/tests/baselines/reference/functionOverloads39.types @@ -19,8 +19,8 @@ var x = foo([{a:true}]); >x : number >foo([{a:true}]) : number >foo : { (bar: { a: number; }[]): string; (bar: { a: boolean; }[]): number; } ->[{a:true}] : { a: boolean; }[] ->{a:true} : { a: boolean; } +>[{a:true}] : { a: true; }[] +>{a:true} : { a: true; } >a : boolean ->true : boolean +>true : true diff --git a/tests/baselines/reference/functionOverloads40.errors.txt b/tests/baselines/reference/functionOverloads40.errors.txt index f965a4eb9e1..d871946cde2 100644 --- a/tests/baselines/reference/functionOverloads40.errors.txt +++ b/tests/baselines/reference/functionOverloads40.errors.txt @@ -1,7 +1,7 @@ -tests/cases/compiler/functionOverloads40.ts(4,13): error TS2345: Argument of type '{ a: string; }[]' is not assignable to parameter of type '{ a: boolean; }[]'. - Type '{ a: string; }' is not assignable to type '{ a: boolean; }'. +tests/cases/compiler/functionOverloads40.ts(4,13): error TS2345: Argument of type '{ a: "bar"; }[]' is not assignable to parameter of type '{ a: boolean; }[]'. + Type '{ a: "bar"; }' is not assignable to type '{ a: boolean; }'. Types of property 'a' are incompatible. - Type 'string' is not assignable to type 'boolean'. + Type '"bar"' is not assignable to type 'boolean'. ==== tests/cases/compiler/functionOverloads40.ts (1 errors) ==== @@ -10,8 +10,8 @@ tests/cases/compiler/functionOverloads40.ts(4,13): error TS2345: Argument of typ function foo(bar:{a:any;}[]):any{ return bar } var x = foo([{a:'bar'}]); ~~~~~~~~~~~ -!!! error TS2345: Argument of type '{ a: string; }[]' is not assignable to parameter of type '{ a: boolean; }[]'. -!!! error TS2345: Type '{ a: string; }' is not assignable to type '{ a: boolean; }'. +!!! error TS2345: Argument of type '{ a: "bar"; }[]' is not assignable to parameter of type '{ a: boolean; }[]'. +!!! error TS2345: Type '{ a: "bar"; }' is not assignable to type '{ a: boolean; }'. !!! error TS2345: Types of property 'a' are incompatible. -!!! error TS2345: Type 'string' is not assignable to type 'boolean'. +!!! error TS2345: Type '"bar"' is not assignable to type 'boolean'. \ No newline at end of file diff --git a/tests/baselines/reference/functionOverloads42.types b/tests/baselines/reference/functionOverloads42.types index 32e99d46aa1..e709ea8b7ef 100644 --- a/tests/baselines/reference/functionOverloads42.types +++ b/tests/baselines/reference/functionOverloads42.types @@ -22,5 +22,5 @@ var x = foo([{a:'s'}]); >[{a:'s'}] : { a: string; }[] >{a:'s'} : { a: string; } >a : string ->'s' : string +>'s' : "s" diff --git a/tests/baselines/reference/functionOverloads43.types b/tests/baselines/reference/functionOverloads43.types index e48ffd41f60..41a29fd0fe3 100644 --- a/tests/baselines/reference/functionOverloads43.types +++ b/tests/baselines/reference/functionOverloads43.types @@ -34,7 +34,7 @@ var x = foo([{a: "str"}]); >[{a: "str"}] : { a: string; }[] >{a: "str"} : { a: string; } >a : string ->"str" : string +>"str" : "str" var y = foo([{a: 100}]); >y : number @@ -43,5 +43,5 @@ var y = foo([{a: 100}]); >[{a: 100}] : { a: number; }[] >{a: 100} : { a: number; } >a : number ->100 : number +>100 : 100 diff --git a/tests/baselines/reference/functionOverloads44.types b/tests/baselines/reference/functionOverloads44.types index 48fcfa3371b..af046ba7206 100644 --- a/tests/baselines/reference/functionOverloads44.types +++ b/tests/baselines/reference/functionOverloads44.types @@ -66,7 +66,7 @@ var x1 = foo1([{a: "str"}]); >[{a: "str"}] : { a: string; }[] >{a: "str"} : { a: string; } >a : string ->"str" : string +>"str" : "str" var y1 = foo1([{a: 100}]); >y1 : Dog @@ -75,7 +75,7 @@ var y1 = foo1([{a: 100}]); >[{a: 100}] : { a: number; }[] >{a: 100} : { a: number; } >a : number ->100 : number +>100 : 100 var x2 = foo2([{a: "str"}]); >x2 : Dog | Cat @@ -84,7 +84,7 @@ var x2 = foo2([{a: "str"}]); >[{a: "str"}] : { a: string; }[] >{a: "str"} : { a: string; } >a : string ->"str" : string +>"str" : "str" var y2 = foo2([{a: 100}]); >y2 : Cat @@ -93,5 +93,5 @@ var y2 = foo2([{a: 100}]); >[{a: 100}] : { a: number; }[] >{a: 100} : { a: number; } >a : number ->100 : number +>100 : 100 diff --git a/tests/baselines/reference/functionOverloads45.types b/tests/baselines/reference/functionOverloads45.types index 29eb55a40ed..ca778e68056 100644 --- a/tests/baselines/reference/functionOverloads45.types +++ b/tests/baselines/reference/functionOverloads45.types @@ -66,7 +66,7 @@ var x1 = foo1([{a: "str"}]); >[{a: "str"}] : { a: string; }[] >{a: "str"} : { a: string; } >a : string ->"str" : string +>"str" : "str" var y1 = foo1([{a: 100}]); >y1 : Cat @@ -75,7 +75,7 @@ var y1 = foo1([{a: 100}]); >[{a: 100}] : { a: number; }[] >{a: 100} : { a: number; } >a : number ->100 : number +>100 : 100 var x2 = foo2([{a: "str"}]); >x2 : Dog @@ -84,7 +84,7 @@ var x2 = foo2([{a: "str"}]); >[{a: "str"}] : { a: string; }[] >{a: "str"} : { a: string; } >a : string ->"str" : string +>"str" : "str" var y2 = foo2([{a: 100}]); >y2 : Cat @@ -93,5 +93,5 @@ var y2 = foo2([{a: 100}]); >[{a: 100}] : { a: number; }[] >{a: 100} : { a: number; } >a : number ->100 : number +>100 : 100 diff --git a/tests/baselines/reference/functionOverloads7.types b/tests/baselines/reference/functionOverloads7.types index 7160068126f..5bbc25dd5e2 100644 --- a/tests/baselines/reference/functionOverloads7.types +++ b/tests/baselines/reference/functionOverloads7.types @@ -12,7 +12,7 @@ class foo { private bar(foo?: any){ return "foo" } >bar : { (): any; (foo: string): any; } >foo : any ->"foo" : string +>"foo" : "foo" public n() { >n : () => void @@ -31,7 +31,7 @@ class foo { >this.bar : { (): any; (foo: string): any; } >this : this >bar : { (): any; (foo: string): any; } ->"test" : string +>"test" : "test" } } diff --git a/tests/baselines/reference/functionOverloads8.types b/tests/baselines/reference/functionOverloads8.types index 4751533e2af..c6876cdbe8f 100644 --- a/tests/baselines/reference/functionOverloads8.types +++ b/tests/baselines/reference/functionOverloads8.types @@ -9,5 +9,5 @@ function foo(foo:string); function foo(foo?:any){ return '' } >foo : { (): any; (foo: string): any; } >foo : any ->'' : string +>'' : "" diff --git a/tests/baselines/reference/functionOverloads9.types b/tests/baselines/reference/functionOverloads9.types index 88586c32eb2..6b7e1992f99 100644 --- a/tests/baselines/reference/functionOverloads9.types +++ b/tests/baselines/reference/functionOverloads9.types @@ -6,11 +6,11 @@ function foo(foo:string); function foo(foo?:string){ return '' }; >foo : (foo: string) => any >foo : string ->'' : string +>'' : "" var x = foo('foo'); >x : any >foo('foo') : any >foo : (foo: string) => any ->'foo' : string +>'foo' : "foo" diff --git a/tests/baselines/reference/functionReturn.types b/tests/baselines/reference/functionReturn.types index f9c0b36fbc2..7b8f58de2a8 100644 --- a/tests/baselines/reference/functionReturn.types +++ b/tests/baselines/reference/functionReturn.types @@ -21,7 +21,7 @@ function f4(): string { >f4 : () => string return ''; ->'' : string +>'' : "" return; } @@ -29,7 +29,7 @@ function f5(): string { >f5 : () => string return ''; ->'' : string +>'' : "" return undefined; >undefined : undefined diff --git a/tests/baselines/reference/functionType.types b/tests/baselines/reference/functionType.types index ac3d5c9944d..985a66f435d 100644 --- a/tests/baselines/reference/functionType.types +++ b/tests/baselines/reference/functionType.types @@ -7,7 +7,7 @@ salt.apply("hello", []); >salt.apply : (this: Function, thisArg: any, argArray?: any) => any >salt : () => void >apply : (this: Function, thisArg: any, argArray?: any) => any ->"hello" : string +>"hello" : "hello" >[] : undefined[] (new Function("return 5"))(); @@ -15,7 +15,7 @@ salt.apply("hello", []); >(new Function("return 5")) : Function >new Function("return 5") : Function >Function : FunctionConstructor ->"return 5" : string +>"return 5" : "return 5" diff --git a/tests/baselines/reference/functionWithDefaultParameterWithNoStatements1.types b/tests/baselines/reference/functionWithDefaultParameterWithNoStatements1.types index d695157db40..c45eb6f59cd 100644 --- a/tests/baselines/reference/functionWithDefaultParameterWithNoStatements1.types +++ b/tests/baselines/reference/functionWithDefaultParameterWithNoStatements1.types @@ -2,5 +2,5 @@ function foo(x = 0) { } >foo : (x?: number) => void >x : number ->0 : number +>0 : 0 diff --git a/tests/baselines/reference/functionWithDefaultParameterWithNoStatements10.types b/tests/baselines/reference/functionWithDefaultParameterWithNoStatements10.types index 8f8f03fafb1..783b0f72422 100644 --- a/tests/baselines/reference/functionWithDefaultParameterWithNoStatements10.types +++ b/tests/baselines/reference/functionWithDefaultParameterWithNoStatements10.types @@ -3,11 +3,11 @@ function foo(a = [0]) { } >foo : (a?: number[]) => void >a : number[] >[0] : number[] ->0 : number +>0 : 0 function bar(a = [0]) { >bar : (a?: number[]) => void >a : number[] >[0] : number[] ->0 : number +>0 : 0 } diff --git a/tests/baselines/reference/functionWithDefaultParameterWithNoStatements11.types b/tests/baselines/reference/functionWithDefaultParameterWithNoStatements11.types index e0a87bb2656..c548b0d5e92 100644 --- a/tests/baselines/reference/functionWithDefaultParameterWithNoStatements11.types +++ b/tests/baselines/reference/functionWithDefaultParameterWithNoStatements11.types @@ -7,12 +7,12 @@ function foo(a = v[0]) { } >a : any >v[0] : any >v : any[] ->0 : number +>0 : 0 function bar(a = v[0]) { >bar : (a?: any) => void >a : any >v[0] : any >v : any[] ->0 : number +>0 : 0 } diff --git a/tests/baselines/reference/functionWithDefaultParameterWithNoStatements13.types b/tests/baselines/reference/functionWithDefaultParameterWithNoStatements13.types index 58c2009886a..63b66352e54 100644 --- a/tests/baselines/reference/functionWithDefaultParameterWithNoStatements13.types +++ b/tests/baselines/reference/functionWithDefaultParameterWithNoStatements13.types @@ -7,14 +7,14 @@ function foo(a = [1 + 1]) { } >a : number[] >[1 + 1] : number[] >1 + 1 : number ->1 : number ->1 : number +>1 : 1 +>1 : 1 function bar(a = [1 + 1]) { >bar : (a?: number[]) => void >a : number[] >[1 + 1] : number[] >1 + 1 : number ->1 : number ->1 : number +>1 : 1 +>1 : 1 } diff --git a/tests/baselines/reference/functionWithDefaultParameterWithNoStatements14.types b/tests/baselines/reference/functionWithDefaultParameterWithNoStatements14.types index 2a5fbab6919..b88e03e5cce 100644 --- a/tests/baselines/reference/functionWithDefaultParameterWithNoStatements14.types +++ b/tests/baselines/reference/functionWithDefaultParameterWithNoStatements14.types @@ -8,8 +8,8 @@ function foo(a = v[1 + 1]) { } >v[1 + 1] : any >v : any[] >1 + 1 : number ->1 : number ->1 : number +>1 : 1 +>1 : 1 function bar(a = v[1 + 1]) { >bar : (a?: any) => void @@ -17,6 +17,6 @@ function bar(a = v[1 + 1]) { >v[1 + 1] : any >v : any[] >1 + 1 : number ->1 : number ->1 : number +>1 : 1 +>1 : 1 } diff --git a/tests/baselines/reference/functionWithDefaultParameterWithNoStatements15.types b/tests/baselines/reference/functionWithDefaultParameterWithNoStatements15.types index e35f5a5f4e0..99020ba020a 100644 --- a/tests/baselines/reference/functionWithDefaultParameterWithNoStatements15.types +++ b/tests/baselines/reference/functionWithDefaultParameterWithNoStatements15.types @@ -7,14 +7,14 @@ function foo(a = (1 + 1)) { } >a : number >(1 + 1) : number >1 + 1 : number ->1 : number ->1 : number +>1 : 1 +>1 : 1 function bar(a = (1 + 1)) { >bar : (a?: number) => void >a : number >(1 + 1) : number >1 + 1 : number ->1 : number ->1 : number +>1 : 1 +>1 : 1 } diff --git a/tests/baselines/reference/functionWithDefaultParameterWithNoStatements2.types b/tests/baselines/reference/functionWithDefaultParameterWithNoStatements2.types index 76b6b56dfa4..ac34fa3ad51 100644 --- a/tests/baselines/reference/functionWithDefaultParameterWithNoStatements2.types +++ b/tests/baselines/reference/functionWithDefaultParameterWithNoStatements2.types @@ -2,5 +2,5 @@ function foo(x = 0) { >foo : (x?: number) => void >x : number ->0 : number +>0 : 0 } diff --git a/tests/baselines/reference/functionWithDefaultParameterWithNoStatements3.types b/tests/baselines/reference/functionWithDefaultParameterWithNoStatements3.types index 4254c0d28a9..6d10e3fe396 100644 --- a/tests/baselines/reference/functionWithDefaultParameterWithNoStatements3.types +++ b/tests/baselines/reference/functionWithDefaultParameterWithNoStatements3.types @@ -2,10 +2,10 @@ function foo(a = "") { } >foo : (a?: string) => void >a : string ->"" : string +>"" : "" function bar(a = "") { >bar : (a?: string) => void >a : string ->"" : string +>"" : "" } diff --git a/tests/baselines/reference/functionWithDefaultParameterWithNoStatements5.types b/tests/baselines/reference/functionWithDefaultParameterWithNoStatements5.types index 99e93927e0a..52ef4b0bca0 100644 --- a/tests/baselines/reference/functionWithDefaultParameterWithNoStatements5.types +++ b/tests/baselines/reference/functionWithDefaultParameterWithNoStatements5.types @@ -2,10 +2,10 @@ function foo(a = 0) { } >foo : (a?: number) => void >a : number ->0 : number +>0 : 0 function bar(a = 0) { >bar : (a?: number) => void >a : number ->0 : number +>0 : 0 } diff --git a/tests/baselines/reference/functionWithDefaultParameterWithNoStatements6.types b/tests/baselines/reference/functionWithDefaultParameterWithNoStatements6.types index 6100a6dedce..d47f63a0ba4 100644 --- a/tests/baselines/reference/functionWithDefaultParameterWithNoStatements6.types +++ b/tests/baselines/reference/functionWithDefaultParameterWithNoStatements6.types @@ -2,10 +2,10 @@ function foo(a = true) { } >foo : (a?: boolean) => void >a : boolean ->true : boolean +>true : true function bar(a = true) { >bar : (a?: boolean) => void >a : boolean ->true : boolean +>true : true } diff --git a/tests/baselines/reference/functionWithDefaultParameterWithNoStatements7.types b/tests/baselines/reference/functionWithDefaultParameterWithNoStatements7.types index 866087a9f9b..987691e14e4 100644 --- a/tests/baselines/reference/functionWithDefaultParameterWithNoStatements7.types +++ b/tests/baselines/reference/functionWithDefaultParameterWithNoStatements7.types @@ -2,10 +2,10 @@ function foo(a = false) { } >foo : (a?: boolean) => void >a : boolean ->false : boolean +>false : false function bar(a = false) { >bar : (a?: boolean) => void >a : boolean ->false : boolean +>false : false } diff --git a/tests/baselines/reference/functionWithMultipleReturnStatements.errors.txt b/tests/baselines/reference/functionWithMultipleReturnStatements.errors.txt deleted file mode 100644 index cc10d4c782c..00000000000 --- a/tests/baselines/reference/functionWithMultipleReturnStatements.errors.txt +++ /dev/null @@ -1,85 +0,0 @@ -tests/cases/conformance/types/typeRelationships/bestCommonType/functionWithMultipleReturnStatements.ts(5,10): error TS2354: No best common type exists among return expressions. -tests/cases/conformance/types/typeRelationships/bestCommonType/functionWithMultipleReturnStatements.ts(13,10): error TS2354: No best common type exists among return expressions. -tests/cases/conformance/types/typeRelationships/bestCommonType/functionWithMultipleReturnStatements.ts(23,10): error TS2354: No best common type exists among return expressions. -tests/cases/conformance/types/typeRelationships/bestCommonType/functionWithMultipleReturnStatements.ts(32,10): error TS2354: No best common type exists among return expressions. -tests/cases/conformance/types/typeRelationships/bestCommonType/functionWithMultipleReturnStatements.ts(44,10): error TS2354: No best common type exists among return expressions. -tests/cases/conformance/types/typeRelationships/bestCommonType/functionWithMultipleReturnStatements.ts(49,10): error TS2354: No best common type exists among return expressions. - - -==== tests/cases/conformance/types/typeRelationships/bestCommonType/functionWithMultipleReturnStatements.ts (6 errors) ==== - - // return type of a function with multiple returns is the BCT of each return statement - // it is an error if there is no single BCT, these are error cases - - function f1() { - ~~ -!!! error TS2354: No best common type exists among return expressions. - if (true) { - return 1; - } else { - return ''; - } - } - - function f2() { - ~~ -!!! error TS2354: No best common type exists among return expressions. - if (true) { - return 1; - } else if (false) { - return 2; - } else { - return ''; - } - } - - function f3() { - ~~ -!!! error TS2354: No best common type exists among return expressions. - try { - return 1; - } - catch (e) { - return ''; - } - } - - function f4() { - ~~ -!!! error TS2354: No best common type exists among return expressions. - try { - return 1; - } - catch (e) { - - } - finally { - return ''; - } - } - - function f5() { - ~~ -!!! error TS2354: No best common type exists among return expressions. - return 1; - return ''; - } - - function f6(x: T, y:U) { - ~~ -!!! error TS2354: No best common type exists among return expressions. - if (true) { - return x; - } else { - return y; - } - } - - function f8(x: T, y: U) { - if (true) { - return x; - } else { - return y; - } - } - \ No newline at end of file diff --git a/tests/baselines/reference/functionWithMultipleReturnStatements.symbols b/tests/baselines/reference/functionWithMultipleReturnStatements.symbols new file mode 100644 index 00000000000..a33db459640 --- /dev/null +++ b/tests/baselines/reference/functionWithMultipleReturnStatements.symbols @@ -0,0 +1,103 @@ +=== tests/cases/conformance/types/typeRelationships/bestCommonType/functionWithMultipleReturnStatements.ts === + +// return type of a function with multiple returns is the BCT of each return statement +// it is an error if there is no single BCT, these are error cases + +function f1() { +>f1 : Symbol(f1, Decl(functionWithMultipleReturnStatements.ts, 0, 0)) + + if (true) { + return 1; + } else { + return ''; + } +} + +function f2() { +>f2 : Symbol(f2, Decl(functionWithMultipleReturnStatements.ts, 10, 1)) + + if (true) { + return 1; + } else if (false) { + return 2; + } else { + return ''; + } +} + +function f3() { +>f3 : Symbol(f3, Decl(functionWithMultipleReturnStatements.ts, 20, 1)) + + try { + return 1; + } + catch (e) { +>e : Symbol(e, Decl(functionWithMultipleReturnStatements.ts, 26, 11)) + + return ''; + } +} + +function f4() { +>f4 : Symbol(f4, Decl(functionWithMultipleReturnStatements.ts, 29, 1)) + + try { + return 1; + } + catch (e) { +>e : Symbol(e, Decl(functionWithMultipleReturnStatements.ts, 35, 11)) + + } + finally { + return ''; + } +} + +function f5() { +>f5 : Symbol(f5, Decl(functionWithMultipleReturnStatements.ts, 41, 1)) + + return 1; + return ''; +} + +function f6(x: T, y:U) { +>f6 : Symbol(f6, Decl(functionWithMultipleReturnStatements.ts, 46, 1)) +>T : Symbol(T, Decl(functionWithMultipleReturnStatements.ts, 48, 12)) +>U : Symbol(U, Decl(functionWithMultipleReturnStatements.ts, 48, 14)) +>x : Symbol(x, Decl(functionWithMultipleReturnStatements.ts, 48, 18)) +>T : Symbol(T, Decl(functionWithMultipleReturnStatements.ts, 48, 12)) +>y : Symbol(y, Decl(functionWithMultipleReturnStatements.ts, 48, 23)) +>U : Symbol(U, Decl(functionWithMultipleReturnStatements.ts, 48, 14)) + + if (true) { + return x; +>x : Symbol(x, Decl(functionWithMultipleReturnStatements.ts, 48, 18)) + + } else { + return y; +>y : Symbol(y, Decl(functionWithMultipleReturnStatements.ts, 48, 23)) + } +} + +function f8(x: T, y: U) { +>f8 : Symbol(f8, Decl(functionWithMultipleReturnStatements.ts, 54, 1)) +>T : Symbol(T, Decl(functionWithMultipleReturnStatements.ts, 56, 12)) +>U : Symbol(U, Decl(functionWithMultipleReturnStatements.ts, 56, 24)) +>U : Symbol(U, Decl(functionWithMultipleReturnStatements.ts, 56, 24)) +>V : Symbol(V, Decl(functionWithMultipleReturnStatements.ts, 56, 37)) +>V : Symbol(V, Decl(functionWithMultipleReturnStatements.ts, 56, 37)) +>x : Symbol(x, Decl(functionWithMultipleReturnStatements.ts, 56, 41)) +>T : Symbol(T, Decl(functionWithMultipleReturnStatements.ts, 56, 12)) +>y : Symbol(y, Decl(functionWithMultipleReturnStatements.ts, 56, 46)) +>U : Symbol(U, Decl(functionWithMultipleReturnStatements.ts, 56, 24)) + + if (true) { + return x; +>x : Symbol(x, Decl(functionWithMultipleReturnStatements.ts, 56, 41)) + + } else { + return y; +>y : Symbol(y, Decl(functionWithMultipleReturnStatements.ts, 56, 46)) + } +} + diff --git a/tests/baselines/reference/functionWithMultipleReturnStatements.types b/tests/baselines/reference/functionWithMultipleReturnStatements.types new file mode 100644 index 00000000000..775ca52e1db --- /dev/null +++ b/tests/baselines/reference/functionWithMultipleReturnStatements.types @@ -0,0 +1,128 @@ +=== tests/cases/conformance/types/typeRelationships/bestCommonType/functionWithMultipleReturnStatements.ts === + +// return type of a function with multiple returns is the BCT of each return statement +// it is an error if there is no single BCT, these are error cases + +function f1() { +>f1 : () => "" | 1 + + if (true) { +>true : true + + return 1; +>1 : 1 + + } else { + return ''; +>'' : "" + } +} + +function f2() { +>f2 : () => "" | 1 | 2 + + if (true) { +>true : true + + return 1; +>1 : 1 + + } else if (false) { +>false : false + + return 2; +>2 : 2 + + } else { + return ''; +>'' : "" + } +} + +function f3() { +>f3 : () => "" | 1 + + try { + return 1; +>1 : 1 + } + catch (e) { +>e : any + + return ''; +>'' : "" + } +} + +function f4() { +>f4 : () => "" | 1 + + try { + return 1; +>1 : 1 + } + catch (e) { +>e : any + + } + finally { + return ''; +>'' : "" + } +} + +function f5() { +>f5 : () => "" | 1 + + return 1; +>1 : 1 + + return ''; +>'' : "" +} + +function f6(x: T, y:U) { +>f6 : (x: T, y: U) => T | U +>T : T +>U : U +>x : T +>T : T +>y : U +>U : U + + if (true) { +>true : true + + return x; +>x : T + + } else { + return y; +>y : U + } +} + +function f8(x: T, y: U) { +>f8 : (x: T, y: U) => U +>T : T +>U : U +>U : U +>V : V +>V : V +>x : T +>T : T +>y : U +>U : U + + if (true) { +>true : true + + return x; +>x : T + + } else { + return y; +>y : U + } +} + diff --git a/tests/baselines/reference/functionWithMultipleReturnStatements2.errors.txt b/tests/baselines/reference/functionWithMultipleReturnStatements2.errors.txt deleted file mode 100644 index 0399c7a79a6..00000000000 --- a/tests/baselines/reference/functionWithMultipleReturnStatements2.errors.txt +++ /dev/null @@ -1,101 +0,0 @@ -tests/cases/conformance/types/typeRelationships/bestCommonType/functionWithMultipleReturnStatements2.ts(59,10): error TS2354: No best common type exists among return expressions. -tests/cases/conformance/types/typeRelationships/bestCommonType/functionWithMultipleReturnStatements2.ts(68,10): error TS2354: No best common type exists among return expressions. - - -==== tests/cases/conformance/types/typeRelationships/bestCommonType/functionWithMultipleReturnStatements2.ts (2 errors) ==== - - // return type of a function with multiple returns is the BCT of each return statement - // no errors expected here - - function f1() { - if (true) { - return 1; - } else { - return null; - } - } - - function f2() { - if (true) { - return 1; - } else if (false) { - return null; - } else { - return 2; - } - } - - function f4() { - try { - return 1; - } - catch (e) { - return undefined; - } - finally { - return 1; - } - } - - function f5() { - return 1; - return new Object(); - } - - function f6(x: T) { - if (true) { - return x; - } else { - return null; - } - } - - //function f7(x: T, y: U) { - // if (true) { - // return x; - // } else { - // return y; - // } - //} - - var a: { x: number; y?: number }; - var b: { x: number; z?: number }; - // returns typeof a - function f9() { - ~~ -!!! error TS2354: No best common type exists among return expressions. - if (true) { - return a; - } else { - return b; - } - } - - // returns typeof b - function f10() { - ~~~ -!!! error TS2354: No best common type exists among return expressions. - if (true) { - return b; - } else { - return a; - } - } - - // returns number => void - function f11() { - if (true) { - return (x: number) => { } - } else { - return (x: Object) => { } - } - } - - // returns Object => void - function f12() { - if (true) { - return (x: Object) => { } - } else { - return (x: number) => { } - } - } \ No newline at end of file diff --git a/tests/baselines/reference/functionWithMultipleReturnStatements2.symbols b/tests/baselines/reference/functionWithMultipleReturnStatements2.symbols new file mode 100644 index 00000000000..39cad6bc414 --- /dev/null +++ b/tests/baselines/reference/functionWithMultipleReturnStatements2.symbols @@ -0,0 +1,142 @@ +=== tests/cases/conformance/types/typeRelationships/bestCommonType/functionWithMultipleReturnStatements2.ts === + +// return type of a function with multiple returns is the BCT of each return statement +// no errors expected here + +function f1() { +>f1 : Symbol(f1, Decl(functionWithMultipleReturnStatements2.ts, 0, 0)) + + if (true) { + return 1; + } else { + return null; + } +} + +function f2() { +>f2 : Symbol(f2, Decl(functionWithMultipleReturnStatements2.ts, 10, 1)) + + if (true) { + return 1; + } else if (false) { + return null; + } else { + return 2; + } +} + +function f4() { +>f4 : Symbol(f4, Decl(functionWithMultipleReturnStatements2.ts, 20, 1)) + + try { + return 1; + } + catch (e) { +>e : Symbol(e, Decl(functionWithMultipleReturnStatements2.ts, 26, 11)) + + return undefined; +>undefined : Symbol(undefined) + } + finally { + return 1; + } +} + +function f5() { +>f5 : Symbol(f5, Decl(functionWithMultipleReturnStatements2.ts, 32, 1)) + + return 1; + return new Object(); +>Object : Symbol(Object, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +} + +function f6(x: T) { +>f6 : Symbol(f6, Decl(functionWithMultipleReturnStatements2.ts, 37, 1)) +>T : Symbol(T, Decl(functionWithMultipleReturnStatements2.ts, 39, 12)) +>x : Symbol(x, Decl(functionWithMultipleReturnStatements2.ts, 39, 15)) +>T : Symbol(T, Decl(functionWithMultipleReturnStatements2.ts, 39, 12)) + + if (true) { + return x; +>x : Symbol(x, Decl(functionWithMultipleReturnStatements2.ts, 39, 15)) + + } else { + return null; + } +} + +//function f7(x: T, y: U) { +// if (true) { +// return x; +// } else { +// return y; +// } +//} + +var a: { x: number; y?: number }; +>a : Symbol(a, Decl(functionWithMultipleReturnStatements2.ts, 55, 3)) +>x : Symbol(x, Decl(functionWithMultipleReturnStatements2.ts, 55, 8)) +>y : Symbol(y, Decl(functionWithMultipleReturnStatements2.ts, 55, 19)) + +var b: { x: number; z?: number }; +>b : Symbol(b, Decl(functionWithMultipleReturnStatements2.ts, 56, 3)) +>x : Symbol(x, Decl(functionWithMultipleReturnStatements2.ts, 56, 8)) +>z : Symbol(z, Decl(functionWithMultipleReturnStatements2.ts, 56, 19)) + +// returns typeof a +function f9() { +>f9 : Symbol(f9, Decl(functionWithMultipleReturnStatements2.ts, 56, 33)) + + if (true) { + return a; +>a : Symbol(a, Decl(functionWithMultipleReturnStatements2.ts, 55, 3)) + + } else { + return b; +>b : Symbol(b, Decl(functionWithMultipleReturnStatements2.ts, 56, 3)) + } +} + +// returns typeof b +function f10() { +>f10 : Symbol(f10, Decl(functionWithMultipleReturnStatements2.ts, 64, 1)) + + if (true) { + return b; +>b : Symbol(b, Decl(functionWithMultipleReturnStatements2.ts, 56, 3)) + + } else { + return a; +>a : Symbol(a, Decl(functionWithMultipleReturnStatements2.ts, 55, 3)) + } +} + +// returns number => void +function f11() { +>f11 : Symbol(f11, Decl(functionWithMultipleReturnStatements2.ts, 73, 1)) + + if (true) { + return (x: number) => { } +>x : Symbol(x, Decl(functionWithMultipleReturnStatements2.ts, 78, 16)) + + } else { + return (x: Object) => { } +>x : Symbol(x, Decl(functionWithMultipleReturnStatements2.ts, 80, 16)) +>Object : Symbol(Object, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) + } +} + +// returns Object => void +function f12() { +>f12 : Symbol(f12, Decl(functionWithMultipleReturnStatements2.ts, 82, 1)) + + if (true) { + return (x: Object) => { } +>x : Symbol(x, Decl(functionWithMultipleReturnStatements2.ts, 87, 16)) +>Object : Symbol(Object, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) + + } else { + return (x: number) => { } +>x : Symbol(x, Decl(functionWithMultipleReturnStatements2.ts, 89, 16)) + } +} diff --git a/tests/baselines/reference/functionWithMultipleReturnStatements2.types b/tests/baselines/reference/functionWithMultipleReturnStatements2.types new file mode 100644 index 00000000000..4615299bbf1 --- /dev/null +++ b/tests/baselines/reference/functionWithMultipleReturnStatements2.types @@ -0,0 +1,176 @@ +=== tests/cases/conformance/types/typeRelationships/bestCommonType/functionWithMultipleReturnStatements2.ts === + +// return type of a function with multiple returns is the BCT of each return statement +// no errors expected here + +function f1() { +>f1 : () => number + + if (true) { +>true : true + + return 1; +>1 : 1 + + } else { + return null; +>null : null + } +} + +function f2() { +>f2 : () => 1 | 2 + + if (true) { +>true : true + + return 1; +>1 : 1 + + } else if (false) { +>false : false + + return null; +>null : null + + } else { + return 2; +>2 : 2 + } +} + +function f4() { +>f4 : () => number + + try { + return 1; +>1 : 1 + } + catch (e) { +>e : any + + return undefined; +>undefined : undefined + } + finally { + return 1; +>1 : 1 + } +} + +function f5() { +>f5 : () => Object + + return 1; +>1 : 1 + + return new Object(); +>new Object() : Object +>Object : ObjectConstructor +} + +function f6(x: T) { +>f6 : (x: T) => T +>T : T +>x : T +>T : T + + if (true) { +>true : true + + return x; +>x : T + + } else { + return null; +>null : null + } +} + +//function f7(x: T, y: U) { +// if (true) { +// return x; +// } else { +// return y; +// } +//} + +var a: { x: number; y?: number }; +>a : { x: number; y?: number; } +>x : number +>y : number + +var b: { x: number; z?: number }; +>b : { x: number; z?: number; } +>x : number +>z : number + +// returns typeof a +function f9() { +>f9 : () => { x: number; y?: number; } | { x: number; z?: number; } + + if (true) { +>true : true + + return a; +>a : { x: number; y?: number; } + + } else { + return b; +>b : { x: number; z?: number; } + } +} + +// returns typeof b +function f10() { +>f10 : () => { x: number; y?: number; } | { x: number; z?: number; } + + if (true) { +>true : true + + return b; +>b : { x: number; z?: number; } + + } else { + return a; +>a : { x: number; y?: number; } + } +} + +// returns number => void +function f11() { +>f11 : () => (x: number) => void + + if (true) { +>true : true + + return (x: number) => { } +>(x: number) => { } : (x: number) => void +>x : number + + } else { + return (x: Object) => { } +>(x: Object) => { } : (x: Object) => void +>x : Object +>Object : Object + } +} + +// returns Object => void +function f12() { +>f12 : () => (x: Object) => void + + if (true) { +>true : true + + return (x: Object) => { } +>(x: Object) => { } : (x: Object) => void +>x : Object +>Object : Object + + } else { + return (x: number) => { } +>(x: number) => { } : (x: number) => void +>x : number + } +} diff --git a/tests/baselines/reference/functionWithNoBestCommonType1.errors.txt b/tests/baselines/reference/functionWithNoBestCommonType1.errors.txt deleted file mode 100644 index 86234b7dd81..00000000000 --- a/tests/baselines/reference/functionWithNoBestCommonType1.errors.txt +++ /dev/null @@ -1,14 +0,0 @@ -tests/cases/compiler/functionWithNoBestCommonType1.ts(2,10): error TS2354: No best common type exists among return expressions. - - -==== tests/cases/compiler/functionWithNoBestCommonType1.ts (1 errors) ==== - - function foo() { - ~~~ -!!! error TS2354: No best common type exists among return expressions. - return true; - return bar(); - } - - function bar(): void { - } \ No newline at end of file diff --git a/tests/baselines/reference/functionWithNoBestCommonType1.symbols b/tests/baselines/reference/functionWithNoBestCommonType1.symbols new file mode 100644 index 00000000000..826b23f1b48 --- /dev/null +++ b/tests/baselines/reference/functionWithNoBestCommonType1.symbols @@ -0,0 +1,13 @@ +=== tests/cases/compiler/functionWithNoBestCommonType1.ts === + +function foo() { +>foo : Symbol(foo, Decl(functionWithNoBestCommonType1.ts, 0, 0)) + + return true; + return bar(); +>bar : Symbol(bar, Decl(functionWithNoBestCommonType1.ts, 4, 1)) +} + +function bar(): void { +>bar : Symbol(bar, Decl(functionWithNoBestCommonType1.ts, 4, 1)) +} diff --git a/tests/baselines/reference/functionWithNoBestCommonType1.types b/tests/baselines/reference/functionWithNoBestCommonType1.types new file mode 100644 index 00000000000..f93ffad3379 --- /dev/null +++ b/tests/baselines/reference/functionWithNoBestCommonType1.types @@ -0,0 +1,16 @@ +=== tests/cases/compiler/functionWithNoBestCommonType1.ts === + +function foo() { +>foo : () => true | void + + return true; +>true : true + + return bar(); +>bar() : void +>bar : () => void +} + +function bar(): void { +>bar : () => void +} diff --git a/tests/baselines/reference/functionWithNoBestCommonType2.errors.txt b/tests/baselines/reference/functionWithNoBestCommonType2.errors.txt deleted file mode 100644 index 6ce898e447c..00000000000 --- a/tests/baselines/reference/functionWithNoBestCommonType2.errors.txt +++ /dev/null @@ -1,14 +0,0 @@ -tests/cases/compiler/functionWithNoBestCommonType2.ts(2,9): error TS2354: No best common type exists among return expressions. - - -==== tests/cases/compiler/functionWithNoBestCommonType2.ts (1 errors) ==== - - var v = function () { - ~~~~~~~~ -!!! error TS2354: No best common type exists among return expressions. - return true; - return bar(); - }; - - function bar(): void { - } \ No newline at end of file diff --git a/tests/baselines/reference/functionWithNoBestCommonType2.symbols b/tests/baselines/reference/functionWithNoBestCommonType2.symbols new file mode 100644 index 00000000000..f32f86e67a9 --- /dev/null +++ b/tests/baselines/reference/functionWithNoBestCommonType2.symbols @@ -0,0 +1,14 @@ +=== tests/cases/compiler/functionWithNoBestCommonType2.ts === + +var v = function () { +>v : Symbol(v, Decl(functionWithNoBestCommonType2.ts, 1, 3)) + + return true; + return bar(); +>bar : Symbol(bar, Decl(functionWithNoBestCommonType2.ts, 4, 2)) + +}; + +function bar(): void { +>bar : Symbol(bar, Decl(functionWithNoBestCommonType2.ts, 4, 2)) +} diff --git a/tests/baselines/reference/functionWithNoBestCommonType2.types b/tests/baselines/reference/functionWithNoBestCommonType2.types new file mode 100644 index 00000000000..76fdbda535f --- /dev/null +++ b/tests/baselines/reference/functionWithNoBestCommonType2.types @@ -0,0 +1,18 @@ +=== tests/cases/compiler/functionWithNoBestCommonType2.ts === + +var v = function () { +>v : () => true | void +>function () { return true; return bar();} : () => true | void + + return true; +>true : true + + return bar(); +>bar() : void +>bar : () => void + +}; + +function bar(): void { +>bar : () => void +} diff --git a/tests/baselines/reference/functionWithThrowButNoReturn1.types b/tests/baselines/reference/functionWithThrowButNoReturn1.types index c136d8a4076..462d5b9c88a 100644 --- a/tests/baselines/reference/functionWithThrowButNoReturn1.types +++ b/tests/baselines/reference/functionWithThrowButNoReturn1.types @@ -5,7 +5,7 @@ function fn(): number { throw new Error('NYI'); >new Error('NYI') : Error >Error : ErrorConstructor ->'NYI' : string +>'NYI' : "NYI" var t; >t : any diff --git a/tests/baselines/reference/functionsInClassExpressions.types b/tests/baselines/reference/functionsInClassExpressions.types index ee4b5696cc1..b00f3df3490 100644 --- a/tests/baselines/reference/functionsInClassExpressions.types +++ b/tests/baselines/reference/functionsInClassExpressions.types @@ -12,7 +12,7 @@ let Foo = class { } bar = 0; >bar : number ->0 : number +>0 : 0 inc = () => { >inc : () => void diff --git a/tests/baselines/reference/funduleOfFunctionWithoutReturnTypeAnnotation.types b/tests/baselines/reference/funduleOfFunctionWithoutReturnTypeAnnotation.types index 2d71370c2ac..e58cf1551fa 100644 --- a/tests/baselines/reference/funduleOfFunctionWithoutReturnTypeAnnotation.types +++ b/tests/baselines/reference/funduleOfFunctionWithoutReturnTypeAnnotation.types @@ -12,6 +12,6 @@ module fn { export var n = 1; >n : number ->1 : number +>1 : 1 } diff --git a/tests/baselines/reference/generatedContextualTyping.types b/tests/baselines/reference/generatedContextualTyping.types index 2e9625cdb8b..a9b350f8564 100644 --- a/tests/baselines/reference/generatedContextualTyping.types +++ b/tests/baselines/reference/generatedContextualTyping.types @@ -2849,7 +2849,7 @@ var x285: () => Base[] = true ? () => [d1, d2] : () => [d1, d2]; >x285 : () => Base[] >Base : Base >true ? () => [d1, d2] : () => [d1, d2] : () => (Derived1 | Derived2)[] ->true : boolean +>true : true >() => [d1, d2] : () => (Derived1 | Derived2)[] >[d1, d2] : (Derived1 | Derived2)[] >d1 : Derived1 @@ -2863,7 +2863,7 @@ var x286: () => Base[] = true ? function() { return [d1, d2] } : function() { re >x286 : () => Base[] >Base : Base >true ? function() { return [d1, d2] } : function() { return [d1, d2] } : () => (Derived1 | Derived2)[] ->true : boolean +>true : true >function() { return [d1, d2] } : () => (Derived1 | Derived2)[] >[d1, d2] : (Derived1 | Derived2)[] >d1 : Derived1 @@ -2877,7 +2877,7 @@ var x287: () => Base[] = true ? function named() { return [d1, d2] } : function >x287 : () => Base[] >Base : Base >true ? function named() { return [d1, d2] } : function named() { return [d1, d2] } : () => (Derived1 | Derived2)[] ->true : boolean +>true : true >function named() { return [d1, d2] } : () => (Derived1 | Derived2)[] >named : () => (Derived1 | Derived2)[] >[d1, d2] : (Derived1 | Derived2)[] @@ -2893,7 +2893,7 @@ var x288: { (): Base[]; } = true ? () => [d1, d2] : () => [d1, d2]; >x288 : () => Base[] >Base : Base >true ? () => [d1, d2] : () => [d1, d2] : () => (Derived1 | Derived2)[] ->true : boolean +>true : true >() => [d1, d2] : () => (Derived1 | Derived2)[] >[d1, d2] : (Derived1 | Derived2)[] >d1 : Derived1 @@ -2907,7 +2907,7 @@ var x289: { (): Base[]; } = true ? function() { return [d1, d2] } : function() { >x289 : () => Base[] >Base : Base >true ? function() { return [d1, d2] } : function() { return [d1, d2] } : () => (Derived1 | Derived2)[] ->true : boolean +>true : true >function() { return [d1, d2] } : () => (Derived1 | Derived2)[] >[d1, d2] : (Derived1 | Derived2)[] >d1 : Derived1 @@ -2921,7 +2921,7 @@ var x290: { (): Base[]; } = true ? function named() { return [d1, d2] } : functi >x290 : () => Base[] >Base : Base >true ? function named() { return [d1, d2] } : function named() { return [d1, d2] } : () => (Derived1 | Derived2)[] ->true : boolean +>true : true >function named() { return [d1, d2] } : () => (Derived1 | Derived2)[] >named : () => (Derived1 | Derived2)[] >[d1, d2] : (Derived1 | Derived2)[] @@ -2937,7 +2937,7 @@ var x291: Base[] = true ? [d1, d2] : [d1, d2]; >x291 : Base[] >Base : Base >true ? [d1, d2] : [d1, d2] : (Derived1 | Derived2)[] ->true : boolean +>true : true >[d1, d2] : (Derived1 | Derived2)[] >d1 : Derived1 >d2 : Derived2 @@ -2950,7 +2950,7 @@ var x292: Array = true ? [d1, d2] : [d1, d2]; >Array : T[] >Base : Base >true ? [d1, d2] : [d1, d2] : (Derived1 | Derived2)[] ->true : boolean +>true : true >[d1, d2] : (Derived1 | Derived2)[] >d1 : Derived1 >d2 : Derived2 @@ -2963,7 +2963,7 @@ var x293: { [n: number]: Base; } = true ? [d1, d2] : [d1, d2]; >n : number >Base : Base >true ? [d1, d2] : [d1, d2] : (Derived1 | Derived2)[] ->true : boolean +>true : true >[d1, d2] : (Derived1 | Derived2)[] >d1 : Derived1 >d2 : Derived2 @@ -2976,7 +2976,7 @@ var x294: {n: Base[]; } = true ? { n: [d1, d2] } : { n: [d1, d2] }; >n : Base[] >Base : Base >true ? { n: [d1, d2] } : { n: [d1, d2] } : { n: (Derived1 | Derived2)[]; } ->true : boolean +>true : true >{ n: [d1, d2] } : { n: (Derived1 | Derived2)[]; } >n : (Derived1 | Derived2)[] >[d1, d2] : (Derived1 | Derived2)[] @@ -2993,7 +2993,7 @@ var x295: (s: Base[]) => any = true ? n => { var n: Base[]; return null; } : n = >s : Base[] >Base : Base >true ? n => { var n: Base[]; return null; } : n => { var n: Base[]; return null; } : (n: Base[]) => any ->true : boolean +>true : true >n => { var n: Base[]; return null; } : (n: Base[]) => any >n : Base[] >n : Base[] @@ -3010,7 +3010,7 @@ var x296: Genric = true ? { func: n => { return [d1, d2]; } } : { func: n >Genric : Genric >Base : Base >true ? { func: n => { return [d1, d2]; } } : { func: n => { return [d1, d2]; } } : { func: (n: Base[]) => (Derived1 | Derived2)[]; } ->true : boolean +>true : true >{ func: n => { return [d1, d2]; } } : { func: (n: Base[]) => (Derived1 | Derived2)[]; } >func : (n: Base[]) => (Derived1 | Derived2)[] >n => { return [d1, d2]; } : (n: Base[]) => (Derived1 | Derived2)[] @@ -3030,7 +3030,7 @@ var x297: () => Base[] = true ? undefined : () => [d1, d2]; >x297 : () => Base[] >Base : Base >true ? undefined : () => [d1, d2] : () => (Derived1 | Derived2)[] ->true : boolean +>true : true >undefined : undefined >() => [d1, d2] : () => (Derived1 | Derived2)[] >[d1, d2] : (Derived1 | Derived2)[] @@ -3041,7 +3041,7 @@ var x298: () => Base[] = true ? undefined : function() { return [d1, d2] }; >x298 : () => Base[] >Base : Base >true ? undefined : function() { return [d1, d2] } : () => (Derived1 | Derived2)[] ->true : boolean +>true : true >undefined : undefined >function() { return [d1, d2] } : () => (Derived1 | Derived2)[] >[d1, d2] : (Derived1 | Derived2)[] @@ -3052,7 +3052,7 @@ var x299: () => Base[] = true ? undefined : function named() { return [d1, d2] } >x299 : () => Base[] >Base : Base >true ? undefined : function named() { return [d1, d2] } : () => (Derived1 | Derived2)[] ->true : boolean +>true : true >undefined : undefined >function named() { return [d1, d2] } : () => (Derived1 | Derived2)[] >named : () => (Derived1 | Derived2)[] @@ -3064,7 +3064,7 @@ var x300: { (): Base[]; } = true ? undefined : () => [d1, d2]; >x300 : () => Base[] >Base : Base >true ? undefined : () => [d1, d2] : () => (Derived1 | Derived2)[] ->true : boolean +>true : true >undefined : undefined >() => [d1, d2] : () => (Derived1 | Derived2)[] >[d1, d2] : (Derived1 | Derived2)[] @@ -3075,7 +3075,7 @@ var x301: { (): Base[]; } = true ? undefined : function() { return [d1, d2] }; >x301 : () => Base[] >Base : Base >true ? undefined : function() { return [d1, d2] } : () => (Derived1 | Derived2)[] ->true : boolean +>true : true >undefined : undefined >function() { return [d1, d2] } : () => (Derived1 | Derived2)[] >[d1, d2] : (Derived1 | Derived2)[] @@ -3086,7 +3086,7 @@ var x302: { (): Base[]; } = true ? undefined : function named() { return [d1, d2 >x302 : () => Base[] >Base : Base >true ? undefined : function named() { return [d1, d2] } : () => (Derived1 | Derived2)[] ->true : boolean +>true : true >undefined : undefined >function named() { return [d1, d2] } : () => (Derived1 | Derived2)[] >named : () => (Derived1 | Derived2)[] @@ -3098,7 +3098,7 @@ var x303: Base[] = true ? undefined : [d1, d2]; >x303 : Base[] >Base : Base >true ? undefined : [d1, d2] : (Derived1 | Derived2)[] ->true : boolean +>true : true >undefined : undefined >[d1, d2] : (Derived1 | Derived2)[] >d1 : Derived1 @@ -3109,7 +3109,7 @@ var x304: Array = true ? undefined : [d1, d2]; >Array : T[] >Base : Base >true ? undefined : [d1, d2] : (Derived1 | Derived2)[] ->true : boolean +>true : true >undefined : undefined >[d1, d2] : (Derived1 | Derived2)[] >d1 : Derived1 @@ -3120,7 +3120,7 @@ var x305: { [n: number]: Base; } = true ? undefined : [d1, d2]; >n : number >Base : Base >true ? undefined : [d1, d2] : (Derived1 | Derived2)[] ->true : boolean +>true : true >undefined : undefined >[d1, d2] : (Derived1 | Derived2)[] >d1 : Derived1 @@ -3131,7 +3131,7 @@ var x306: {n: Base[]; } = true ? undefined : { n: [d1, d2] }; >n : Base[] >Base : Base >true ? undefined : { n: [d1, d2] } : { n: (Derived1 | Derived2)[]; } ->true : boolean +>true : true >undefined : undefined >{ n: [d1, d2] } : { n: (Derived1 | Derived2)[]; } >n : (Derived1 | Derived2)[] @@ -3144,7 +3144,7 @@ var x307: (s: Base[]) => any = true ? undefined : n => { var n: Base[]; return n >s : Base[] >Base : Base >true ? undefined : n => { var n: Base[]; return null; } : (n: Base[]) => any ->true : boolean +>true : true >undefined : undefined >n => { var n: Base[]; return null; } : (n: Base[]) => any >n : Base[] @@ -3157,7 +3157,7 @@ var x308: Genric = true ? undefined : { func: n => { return [d1, d2]; } }; >Genric : Genric >Base : Base >true ? undefined : { func: n => { return [d1, d2]; } } : { func: (n: Base[]) => (Derived1 | Derived2)[]; } ->true : boolean +>true : true >undefined : undefined >{ func: n => { return [d1, d2]; } } : { func: (n: Base[]) => (Derived1 | Derived2)[]; } >func : (n: Base[]) => (Derived1 | Derived2)[] @@ -3171,7 +3171,7 @@ var x309: () => Base[] = true ? () => [d1, d2] : undefined; >x309 : () => Base[] >Base : Base >true ? () => [d1, d2] : undefined : () => (Derived1 | Derived2)[] ->true : boolean +>true : true >() => [d1, d2] : () => (Derived1 | Derived2)[] >[d1, d2] : (Derived1 | Derived2)[] >d1 : Derived1 @@ -3182,7 +3182,7 @@ var x310: () => Base[] = true ? function() { return [d1, d2] } : undefined; >x310 : () => Base[] >Base : Base >true ? function() { return [d1, d2] } : undefined : () => (Derived1 | Derived2)[] ->true : boolean +>true : true >function() { return [d1, d2] } : () => (Derived1 | Derived2)[] >[d1, d2] : (Derived1 | Derived2)[] >d1 : Derived1 @@ -3193,7 +3193,7 @@ var x311: () => Base[] = true ? function named() { return [d1, d2] } : undefined >x311 : () => Base[] >Base : Base >true ? function named() { return [d1, d2] } : undefined : () => (Derived1 | Derived2)[] ->true : boolean +>true : true >function named() { return [d1, d2] } : () => (Derived1 | Derived2)[] >named : () => (Derived1 | Derived2)[] >[d1, d2] : (Derived1 | Derived2)[] @@ -3205,7 +3205,7 @@ var x312: { (): Base[]; } = true ? () => [d1, d2] : undefined; >x312 : () => Base[] >Base : Base >true ? () => [d1, d2] : undefined : () => (Derived1 | Derived2)[] ->true : boolean +>true : true >() => [d1, d2] : () => (Derived1 | Derived2)[] >[d1, d2] : (Derived1 | Derived2)[] >d1 : Derived1 @@ -3216,7 +3216,7 @@ var x313: { (): Base[]; } = true ? function() { return [d1, d2] } : undefined; >x313 : () => Base[] >Base : Base >true ? function() { return [d1, d2] } : undefined : () => (Derived1 | Derived2)[] ->true : boolean +>true : true >function() { return [d1, d2] } : () => (Derived1 | Derived2)[] >[d1, d2] : (Derived1 | Derived2)[] >d1 : Derived1 @@ -3227,7 +3227,7 @@ var x314: { (): Base[]; } = true ? function named() { return [d1, d2] } : undefi >x314 : () => Base[] >Base : Base >true ? function named() { return [d1, d2] } : undefined : () => (Derived1 | Derived2)[] ->true : boolean +>true : true >function named() { return [d1, d2] } : () => (Derived1 | Derived2)[] >named : () => (Derived1 | Derived2)[] >[d1, d2] : (Derived1 | Derived2)[] @@ -3239,7 +3239,7 @@ var x315: Base[] = true ? [d1, d2] : undefined; >x315 : Base[] >Base : Base >true ? [d1, d2] : undefined : (Derived1 | Derived2)[] ->true : boolean +>true : true >[d1, d2] : (Derived1 | Derived2)[] >d1 : Derived1 >d2 : Derived2 @@ -3250,7 +3250,7 @@ var x316: Array = true ? [d1, d2] : undefined; >Array : T[] >Base : Base >true ? [d1, d2] : undefined : (Derived1 | Derived2)[] ->true : boolean +>true : true >[d1, d2] : (Derived1 | Derived2)[] >d1 : Derived1 >d2 : Derived2 @@ -3261,7 +3261,7 @@ var x317: { [n: number]: Base; } = true ? [d1, d2] : undefined; >n : number >Base : Base >true ? [d1, d2] : undefined : (Derived1 | Derived2)[] ->true : boolean +>true : true >[d1, d2] : (Derived1 | Derived2)[] >d1 : Derived1 >d2 : Derived2 @@ -3272,7 +3272,7 @@ var x318: {n: Base[]; } = true ? { n: [d1, d2] } : undefined; >n : Base[] >Base : Base >true ? { n: [d1, d2] } : undefined : { n: (Derived1 | Derived2)[]; } ->true : boolean +>true : true >{ n: [d1, d2] } : { n: (Derived1 | Derived2)[]; } >n : (Derived1 | Derived2)[] >[d1, d2] : (Derived1 | Derived2)[] @@ -3285,7 +3285,7 @@ var x319: (s: Base[]) => any = true ? n => { var n: Base[]; return null; } : und >s : Base[] >Base : Base >true ? n => { var n: Base[]; return null; } : undefined : (n: Base[]) => any ->true : boolean +>true : true >n => { var n: Base[]; return null; } : (n: Base[]) => any >n : Base[] >n : Base[] @@ -3298,7 +3298,7 @@ var x320: Genric = true ? { func: n => { return [d1, d2]; } } : undefined; >Genric : Genric >Base : Base >true ? { func: n => { return [d1, d2]; } } : undefined : { func: (n: Base[]) => (Derived1 | Derived2)[]; } ->true : boolean +>true : true >{ func: n => { return [d1, d2]; } } : { func: (n: Base[]) => (Derived1 | Derived2)[]; } >func : (n: Base[]) => (Derived1 | Derived2)[] >n => { return [d1, d2]; } : (n: Base[]) => (Derived1 | Derived2)[] diff --git a/tests/baselines/reference/generatorES6InAMDModule.js b/tests/baselines/reference/generatorES6InAMDModule.js new file mode 100644 index 00000000000..594d2c3263c --- /dev/null +++ b/tests/baselines/reference/generatorES6InAMDModule.js @@ -0,0 +1,13 @@ +//// [generatorES6InAMDModule.ts] +export function* foo() { + yield +} + +//// [generatorES6InAMDModule.js] +define(["require", "exports"], function (require, exports) { + "use strict"; + function* foo() { + yield; + } + exports.foo = foo; +}); diff --git a/tests/baselines/reference/generatorES6InAMDModule.symbols b/tests/baselines/reference/generatorES6InAMDModule.symbols new file mode 100644 index 00000000000..aafd2a4f79f --- /dev/null +++ b/tests/baselines/reference/generatorES6InAMDModule.symbols @@ -0,0 +1,6 @@ +=== tests/cases/compiler/generatorES6InAMDModule.ts === +export function* foo() { +>foo : Symbol(foo, Decl(generatorES6InAMDModule.ts, 0, 0)) + + yield +} diff --git a/tests/baselines/reference/generatorES6InAMDModule.types b/tests/baselines/reference/generatorES6InAMDModule.types new file mode 100644 index 00000000000..9a12a72f005 --- /dev/null +++ b/tests/baselines/reference/generatorES6InAMDModule.types @@ -0,0 +1,7 @@ +=== tests/cases/compiler/generatorES6InAMDModule.ts === +export function* foo() { +>foo : () => IterableIterator + + yield +>yield : any +} diff --git a/tests/baselines/reference/generatorES6_2.types b/tests/baselines/reference/generatorES6_2.types index 9c9c8692757..61a2adbc697 100644 --- a/tests/baselines/reference/generatorES6_2.types +++ b/tests/baselines/reference/generatorES6_2.types @@ -3,10 +3,10 @@ class C { >C : C public * foo() { ->foo : () => IterableIterator +>foo : () => IterableIterator<1> yield 1 >yield 1 : any ->1 : number +>1 : 1 } } diff --git a/tests/baselines/reference/generatorES6_3.types b/tests/baselines/reference/generatorES6_3.types index e87ad23ba77..9ecd01d6e23 100644 --- a/tests/baselines/reference/generatorES6_3.types +++ b/tests/baselines/reference/generatorES6_3.types @@ -1,9 +1,9 @@ === tests/cases/compiler/generatorES6_3.ts === var v = function*() { ->v : () => IterableIterator ->function*() { yield 0} : () => IterableIterator +>v : () => IterableIterator<0> +>function*() { yield 0} : () => IterableIterator<0> yield 0 >yield 0 : any ->0 : number +>0 : 0 } diff --git a/tests/baselines/reference/generatorES6_4.types b/tests/baselines/reference/generatorES6_4.types index 64b0924919b..786e7b64020 100644 --- a/tests/baselines/reference/generatorES6_4.types +++ b/tests/baselines/reference/generatorES6_4.types @@ -1,13 +1,13 @@ === tests/cases/compiler/generatorES6_4.ts === var v = { ->v : { foo(): IterableIterator; } ->{ *foo() { yield 0 }} : { foo(): IterableIterator; } +>v : { foo(): IterableIterator<0>; } +>{ *foo() { yield 0 }} : { foo(): IterableIterator<0>; } *foo() { ->foo : () => IterableIterator +>foo : () => IterableIterator<0> yield 0 >yield 0 : any ->0 : number +>0 : 0 } } diff --git a/tests/baselines/reference/generatorES6_6.types b/tests/baselines/reference/generatorES6_6.types index 4e3de8cea1e..6f50181d0ef 100644 --- a/tests/baselines/reference/generatorES6_6.types +++ b/tests/baselines/reference/generatorES6_6.types @@ -10,6 +10,6 @@ class C { let a = yield 1; >a : any >yield 1 : any ->1 : number +>1 : 1 } } diff --git a/tests/baselines/reference/generatorTransformFinalLabel.js b/tests/baselines/reference/generatorTransformFinalLabel.js new file mode 100644 index 00000000000..32272ae0748 --- /dev/null +++ b/tests/baselines/reference/generatorTransformFinalLabel.js @@ -0,0 +1,28 @@ +//// [generatorTransformFinalLabel.ts] +async function test(skip: boolean) { + if (!skip) { + await 1 + } + else { + throw Error('test') + } +} + +//// [generatorTransformFinalLabel.js] +function test(skip) { + return __awaiter(this, void 0, void 0, function () { + return __generator(this, function (_a) { + switch (_a.label) { + case 0: + if (!!skip) + return [3 /*break*/, 2]; + return [4 /*yield*/, 1]; + case 1: + _a.sent(); + return [3 /*break*/, 3]; + case 2: throw Error('test'); + case 3: return [2 /*return*/]; + } + }); + }); +} diff --git a/tests/baselines/reference/generatorTransformFinalLabel.symbols b/tests/baselines/reference/generatorTransformFinalLabel.symbols new file mode 100644 index 00000000000..8f6fd791476 --- /dev/null +++ b/tests/baselines/reference/generatorTransformFinalLabel.symbols @@ -0,0 +1,15 @@ +=== tests/cases/compiler/generatorTransformFinalLabel.ts === +async function test(skip: boolean) { +>test : Symbol(test, Decl(generatorTransformFinalLabel.ts, 0, 0)) +>skip : Symbol(skip, Decl(generatorTransformFinalLabel.ts, 0, 20)) + + if (!skip) { +>skip : Symbol(skip, Decl(generatorTransformFinalLabel.ts, 0, 20)) + + await 1 + } + else { + throw Error('test') +>Error : Symbol(Error, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) + } +} diff --git a/tests/baselines/reference/generatorTransformFinalLabel.types b/tests/baselines/reference/generatorTransformFinalLabel.types new file mode 100644 index 00000000000..988428ad1d1 --- /dev/null +++ b/tests/baselines/reference/generatorTransformFinalLabel.types @@ -0,0 +1,20 @@ +=== tests/cases/compiler/generatorTransformFinalLabel.ts === +async function test(skip: boolean) { +>test : (skip: boolean) => Promise +>skip : boolean + + if (!skip) { +>!skip : boolean +>skip : boolean + + await 1 +>await 1 : 1 +>1 : 1 + } + else { + throw Error('test') +>Error('test') : Error +>Error : ErrorConstructor +>'test' : "test" + } +} diff --git a/tests/baselines/reference/generatorTypeCheck11.types b/tests/baselines/reference/generatorTypeCheck11.types index ce47d497851..7613cc189a9 100644 --- a/tests/baselines/reference/generatorTypeCheck11.types +++ b/tests/baselines/reference/generatorTypeCheck11.types @@ -4,5 +4,5 @@ function* g(): IterableIterator { >IterableIterator : IterableIterator return 0; ->0 : number +>0 : 0 } diff --git a/tests/baselines/reference/generatorTypeCheck12.types b/tests/baselines/reference/generatorTypeCheck12.types index 3dd3c20f18d..ef5b3564e18 100644 --- a/tests/baselines/reference/generatorTypeCheck12.types +++ b/tests/baselines/reference/generatorTypeCheck12.types @@ -4,5 +4,5 @@ function* g(): IterableIterator { >IterableIterator : IterableIterator return ""; ->"" : string +>"" : "" } diff --git a/tests/baselines/reference/generatorTypeCheck13.types b/tests/baselines/reference/generatorTypeCheck13.types index d77b630ae72..8dfafd89884 100644 --- a/tests/baselines/reference/generatorTypeCheck13.types +++ b/tests/baselines/reference/generatorTypeCheck13.types @@ -5,8 +5,8 @@ function* g(): IterableIterator { yield 0; >yield 0 : any ->0 : number +>0 : 0 return ""; ->"" : string +>"" : "" } diff --git a/tests/baselines/reference/generatorTypeCheck14.types b/tests/baselines/reference/generatorTypeCheck14.types index db1b5bde19a..48565fe2be0 100644 --- a/tests/baselines/reference/generatorTypeCheck14.types +++ b/tests/baselines/reference/generatorTypeCheck14.types @@ -1,11 +1,11 @@ === tests/cases/conformance/es6/yieldExpressions/generatorTypeCheck14.ts === function* g() { ->g : () => IterableIterator +>g : () => IterableIterator<0> yield 0; >yield 0 : any ->0 : number +>0 : 0 return ""; ->"" : string +>"" : "" } diff --git a/tests/baselines/reference/generatorTypeCheck15.types b/tests/baselines/reference/generatorTypeCheck15.types index 4437d78572d..eb14208009a 100644 --- a/tests/baselines/reference/generatorTypeCheck15.types +++ b/tests/baselines/reference/generatorTypeCheck15.types @@ -3,5 +3,5 @@ function* g() { >g : () => IterableIterator return ""; ->"" : string +>"" : "" } diff --git a/tests/baselines/reference/generatorTypeCheck22.errors.txt b/tests/baselines/reference/generatorTypeCheck22.errors.txt deleted file mode 100644 index ab2b3de4f42..00000000000 --- a/tests/baselines/reference/generatorTypeCheck22.errors.txt +++ /dev/null @@ -1,16 +0,0 @@ -tests/cases/conformance/es6/yieldExpressions/generatorTypeCheck22.ts(4,11): error TS2504: No best common type exists among yield expressions. - - -==== tests/cases/conformance/es6/yieldExpressions/generatorTypeCheck22.ts (1 errors) ==== - class Foo { x: number } - class Bar extends Foo { y: string } - class Baz { z: number } - function* g3() { - ~~ -!!! error TS2504: No best common type exists among yield expressions. - yield; - yield new Bar; - yield new Baz; - yield *[new Bar]; - yield *[new Baz]; - } \ No newline at end of file diff --git a/tests/baselines/reference/generatorTypeCheck22.symbols b/tests/baselines/reference/generatorTypeCheck22.symbols new file mode 100644 index 00000000000..ae3bdac88f3 --- /dev/null +++ b/tests/baselines/reference/generatorTypeCheck22.symbols @@ -0,0 +1,30 @@ +=== tests/cases/conformance/es6/yieldExpressions/generatorTypeCheck22.ts === +class Foo { x: number } +>Foo : Symbol(Foo, Decl(generatorTypeCheck22.ts, 0, 0)) +>x : Symbol(Foo.x, Decl(generatorTypeCheck22.ts, 0, 11)) + +class Bar extends Foo { y: string } +>Bar : Symbol(Bar, Decl(generatorTypeCheck22.ts, 0, 23)) +>Foo : Symbol(Foo, Decl(generatorTypeCheck22.ts, 0, 0)) +>y : Symbol(Bar.y, Decl(generatorTypeCheck22.ts, 1, 23)) + +class Baz { z: number } +>Baz : Symbol(Baz, Decl(generatorTypeCheck22.ts, 1, 35)) +>z : Symbol(Baz.z, Decl(generatorTypeCheck22.ts, 2, 11)) + +function* g3() { +>g3 : Symbol(g3, Decl(generatorTypeCheck22.ts, 2, 23)) + + yield; + yield new Bar; +>Bar : Symbol(Bar, Decl(generatorTypeCheck22.ts, 0, 23)) + + yield new Baz; +>Baz : Symbol(Baz, Decl(generatorTypeCheck22.ts, 1, 35)) + + yield *[new Bar]; +>Bar : Symbol(Bar, Decl(generatorTypeCheck22.ts, 0, 23)) + + yield *[new Baz]; +>Baz : Symbol(Baz, Decl(generatorTypeCheck22.ts, 1, 35)) +} diff --git a/tests/baselines/reference/generatorTypeCheck22.types b/tests/baselines/reference/generatorTypeCheck22.types new file mode 100644 index 00000000000..e46e73874e6 --- /dev/null +++ b/tests/baselines/reference/generatorTypeCheck22.types @@ -0,0 +1,42 @@ +=== tests/cases/conformance/es6/yieldExpressions/generatorTypeCheck22.ts === +class Foo { x: number } +>Foo : Foo +>x : number + +class Bar extends Foo { y: string } +>Bar : Bar +>Foo : Foo +>y : string + +class Baz { z: number } +>Baz : Baz +>z : number + +function* g3() { +>g3 : () => IterableIterator + + yield; +>yield : any + + yield new Bar; +>yield new Bar : any +>new Bar : Bar +>Bar : typeof Bar + + yield new Baz; +>yield new Baz : any +>new Baz : Baz +>Baz : typeof Baz + + yield *[new Bar]; +>yield *[new Bar] : any +>[new Bar] : Bar[] +>new Bar : Bar +>Bar : typeof Bar + + yield *[new Baz]; +>yield *[new Baz] : any +>[new Baz] : Baz[] +>new Baz : Baz +>Baz : typeof Baz +} diff --git a/tests/baselines/reference/generatorTypeCheck23.errors.txt b/tests/baselines/reference/generatorTypeCheck23.errors.txt deleted file mode 100644 index 9e85117a0a8..00000000000 --- a/tests/baselines/reference/generatorTypeCheck23.errors.txt +++ /dev/null @@ -1,17 +0,0 @@ -tests/cases/conformance/es6/yieldExpressions/generatorTypeCheck23.ts(4,11): error TS2504: No best common type exists among yield expressions. - - -==== tests/cases/conformance/es6/yieldExpressions/generatorTypeCheck23.ts (1 errors) ==== - class Foo { x: number } - class Bar extends Foo { y: string } - class Baz { z: number } - function* g3() { - ~~ -!!! error TS2504: No best common type exists among yield expressions. - yield; - yield new Foo; - yield new Bar; - yield new Baz; - yield *[new Bar]; - yield *[new Baz]; - } \ No newline at end of file diff --git a/tests/baselines/reference/generatorTypeCheck23.symbols b/tests/baselines/reference/generatorTypeCheck23.symbols new file mode 100644 index 00000000000..507906f500b --- /dev/null +++ b/tests/baselines/reference/generatorTypeCheck23.symbols @@ -0,0 +1,33 @@ +=== tests/cases/conformance/es6/yieldExpressions/generatorTypeCheck23.ts === +class Foo { x: number } +>Foo : Symbol(Foo, Decl(generatorTypeCheck23.ts, 0, 0)) +>x : Symbol(Foo.x, Decl(generatorTypeCheck23.ts, 0, 11)) + +class Bar extends Foo { y: string } +>Bar : Symbol(Bar, Decl(generatorTypeCheck23.ts, 0, 23)) +>Foo : Symbol(Foo, Decl(generatorTypeCheck23.ts, 0, 0)) +>y : Symbol(Bar.y, Decl(generatorTypeCheck23.ts, 1, 23)) + +class Baz { z: number } +>Baz : Symbol(Baz, Decl(generatorTypeCheck23.ts, 1, 35)) +>z : Symbol(Baz.z, Decl(generatorTypeCheck23.ts, 2, 11)) + +function* g3() { +>g3 : Symbol(g3, Decl(generatorTypeCheck23.ts, 2, 23)) + + yield; + yield new Foo; +>Foo : Symbol(Foo, Decl(generatorTypeCheck23.ts, 0, 0)) + + yield new Bar; +>Bar : Symbol(Bar, Decl(generatorTypeCheck23.ts, 0, 23)) + + yield new Baz; +>Baz : Symbol(Baz, Decl(generatorTypeCheck23.ts, 1, 35)) + + yield *[new Bar]; +>Bar : Symbol(Bar, Decl(generatorTypeCheck23.ts, 0, 23)) + + yield *[new Baz]; +>Baz : Symbol(Baz, Decl(generatorTypeCheck23.ts, 1, 35)) +} diff --git a/tests/baselines/reference/generatorTypeCheck23.types b/tests/baselines/reference/generatorTypeCheck23.types new file mode 100644 index 00000000000..1d5d294503a --- /dev/null +++ b/tests/baselines/reference/generatorTypeCheck23.types @@ -0,0 +1,47 @@ +=== tests/cases/conformance/es6/yieldExpressions/generatorTypeCheck23.ts === +class Foo { x: number } +>Foo : Foo +>x : number + +class Bar extends Foo { y: string } +>Bar : Bar +>Foo : Foo +>y : string + +class Baz { z: number } +>Baz : Baz +>z : number + +function* g3() { +>g3 : () => IterableIterator + + yield; +>yield : any + + yield new Foo; +>yield new Foo : any +>new Foo : Foo +>Foo : typeof Foo + + yield new Bar; +>yield new Bar : any +>new Bar : Bar +>Bar : typeof Bar + + yield new Baz; +>yield new Baz : any +>new Baz : Baz +>Baz : typeof Baz + + yield *[new Bar]; +>yield *[new Bar] : any +>[new Bar] : Bar[] +>new Bar : Bar +>Bar : typeof Bar + + yield *[new Baz]; +>yield *[new Baz] : any +>[new Baz] : Baz[] +>new Baz : Baz +>Baz : typeof Baz +} diff --git a/tests/baselines/reference/generatorTypeCheck24.errors.txt b/tests/baselines/reference/generatorTypeCheck24.errors.txt deleted file mode 100644 index b4ca13c14c2..00000000000 --- a/tests/baselines/reference/generatorTypeCheck24.errors.txt +++ /dev/null @@ -1,17 +0,0 @@ -tests/cases/conformance/es6/yieldExpressions/generatorTypeCheck24.ts(4,11): error TS2504: No best common type exists among yield expressions. - - -==== tests/cases/conformance/es6/yieldExpressions/generatorTypeCheck24.ts (1 errors) ==== - class Foo { x: number } - class Bar extends Foo { y: string } - class Baz { z: number } - function* g3() { - ~~ -!!! error TS2504: No best common type exists among yield expressions. - yield; - yield * [new Foo]; - yield new Bar; - yield new Baz; - yield *[new Bar]; - yield *[new Baz]; - } \ No newline at end of file diff --git a/tests/baselines/reference/generatorTypeCheck24.symbols b/tests/baselines/reference/generatorTypeCheck24.symbols new file mode 100644 index 00000000000..b0bc5307b89 --- /dev/null +++ b/tests/baselines/reference/generatorTypeCheck24.symbols @@ -0,0 +1,33 @@ +=== tests/cases/conformance/es6/yieldExpressions/generatorTypeCheck24.ts === +class Foo { x: number } +>Foo : Symbol(Foo, Decl(generatorTypeCheck24.ts, 0, 0)) +>x : Symbol(Foo.x, Decl(generatorTypeCheck24.ts, 0, 11)) + +class Bar extends Foo { y: string } +>Bar : Symbol(Bar, Decl(generatorTypeCheck24.ts, 0, 23)) +>Foo : Symbol(Foo, Decl(generatorTypeCheck24.ts, 0, 0)) +>y : Symbol(Bar.y, Decl(generatorTypeCheck24.ts, 1, 23)) + +class Baz { z: number } +>Baz : Symbol(Baz, Decl(generatorTypeCheck24.ts, 1, 35)) +>z : Symbol(Baz.z, Decl(generatorTypeCheck24.ts, 2, 11)) + +function* g3() { +>g3 : Symbol(g3, Decl(generatorTypeCheck24.ts, 2, 23)) + + yield; + yield * [new Foo]; +>Foo : Symbol(Foo, Decl(generatorTypeCheck24.ts, 0, 0)) + + yield new Bar; +>Bar : Symbol(Bar, Decl(generatorTypeCheck24.ts, 0, 23)) + + yield new Baz; +>Baz : Symbol(Baz, Decl(generatorTypeCheck24.ts, 1, 35)) + + yield *[new Bar]; +>Bar : Symbol(Bar, Decl(generatorTypeCheck24.ts, 0, 23)) + + yield *[new Baz]; +>Baz : Symbol(Baz, Decl(generatorTypeCheck24.ts, 1, 35)) +} diff --git a/tests/baselines/reference/generatorTypeCheck24.types b/tests/baselines/reference/generatorTypeCheck24.types new file mode 100644 index 00000000000..e3c369bfce1 --- /dev/null +++ b/tests/baselines/reference/generatorTypeCheck24.types @@ -0,0 +1,48 @@ +=== tests/cases/conformance/es6/yieldExpressions/generatorTypeCheck24.ts === +class Foo { x: number } +>Foo : Foo +>x : number + +class Bar extends Foo { y: string } +>Bar : Bar +>Foo : Foo +>y : string + +class Baz { z: number } +>Baz : Baz +>z : number + +function* g3() { +>g3 : () => IterableIterator + + yield; +>yield : any + + yield * [new Foo]; +>yield * [new Foo] : any +>[new Foo] : Foo[] +>new Foo : Foo +>Foo : typeof Foo + + yield new Bar; +>yield new Bar : any +>new Bar : Bar +>Bar : typeof Bar + + yield new Baz; +>yield new Baz : any +>new Baz : Baz +>Baz : typeof Baz + + yield *[new Bar]; +>yield *[new Bar] : any +>[new Bar] : Bar[] +>new Bar : Bar +>Bar : typeof Bar + + yield *[new Baz]; +>yield *[new Baz] : any +>[new Baz] : Baz[] +>new Baz : Baz +>Baz : typeof Baz +} diff --git a/tests/baselines/reference/generatorTypeCheck33.types b/tests/baselines/reference/generatorTypeCheck33.types index f3b8af225d1..707bf7beccd 100644 --- a/tests/baselines/reference/generatorTypeCheck33.types +++ b/tests/baselines/reference/generatorTypeCheck33.types @@ -1,16 +1,16 @@ === tests/cases/conformance/es6/yieldExpressions/generatorTypeCheck33.ts === function* g() { ->g : () => IterableIterator +>g : () => IterableIterator<0> yield 0; >yield 0 : any ->0 : number +>0 : 0 function* g2() { ->g2 : () => IterableIterator +>g2 : () => IterableIterator<""> yield ""; >yield "" : any ->"" : string +>"" : "" } } diff --git a/tests/baselines/reference/generatorTypeCheck34.types b/tests/baselines/reference/generatorTypeCheck34.types index 35063e988eb..2ca11177218 100644 --- a/tests/baselines/reference/generatorTypeCheck34.types +++ b/tests/baselines/reference/generatorTypeCheck34.types @@ -1,15 +1,15 @@ === tests/cases/conformance/es6/yieldExpressions/generatorTypeCheck34.ts === function* g() { ->g : () => IterableIterator +>g : () => IterableIterator<0> yield 0; >yield 0 : any ->0 : number +>0 : 0 function* g2() { >g2 : () => IterableIterator return ""; ->"" : string +>"" : "" } } diff --git a/tests/baselines/reference/generatorTypeCheck35.types b/tests/baselines/reference/generatorTypeCheck35.types index 0bfc22ab3f0..dcd5ab4be84 100644 --- a/tests/baselines/reference/generatorTypeCheck35.types +++ b/tests/baselines/reference/generatorTypeCheck35.types @@ -1,15 +1,15 @@ === tests/cases/conformance/es6/yieldExpressions/generatorTypeCheck35.ts === function* g() { ->g : () => IterableIterator +>g : () => IterableIterator<0> yield 0; >yield 0 : any ->0 : number +>0 : 0 function g2() { >g2 : () => string return ""; ->"" : string +>"" : "" } } diff --git a/tests/baselines/reference/generatorTypeCheck36.types b/tests/baselines/reference/generatorTypeCheck36.types index 110a4d3e02e..318a46c25fb 100644 --- a/tests/baselines/reference/generatorTypeCheck36.types +++ b/tests/baselines/reference/generatorTypeCheck36.types @@ -5,5 +5,5 @@ function* g() { yield yield 0; >yield yield 0 : any >yield 0 : any ->0 : number +>0 : 0 } diff --git a/tests/baselines/reference/generatorTypeCheck37.types b/tests/baselines/reference/generatorTypeCheck37.types index e8611ec167a..aaa790c8094 100644 --- a/tests/baselines/reference/generatorTypeCheck37.types +++ b/tests/baselines/reference/generatorTypeCheck37.types @@ -5,5 +5,5 @@ function* g() { return yield yield 0; >yield yield 0 : any >yield 0 : any ->0 : number +>0 : 0 } diff --git a/tests/baselines/reference/generatorTypeCheck38.types b/tests/baselines/reference/generatorTypeCheck38.types index 08503e8640f..31fe452e656 100644 --- a/tests/baselines/reference/generatorTypeCheck38.types +++ b/tests/baselines/reference/generatorTypeCheck38.types @@ -3,11 +3,11 @@ var yield; >yield : any function* g() { ->g : () => IterableIterator +>g : () => IterableIterator<0> yield 0; >yield 0 : any ->0 : number +>0 : 0 var v: typeof yield; >v : any diff --git a/tests/baselines/reference/generatorTypeCheck41.types b/tests/baselines/reference/generatorTypeCheck41.types index 0bed082dc43..1a9ea21f978 100644 --- a/tests/baselines/reference/generatorTypeCheck41.types +++ b/tests/baselines/reference/generatorTypeCheck41.types @@ -1,6 +1,6 @@ === tests/cases/conformance/es6/yieldExpressions/generatorTypeCheck41.ts === function* g() { ->g : () => IterableIterator +>g : () => IterableIterator<0> let x = { >x : { [x: number]: number; } @@ -8,7 +8,7 @@ function* g() { [yield 0]: 0 >yield 0 : any ->0 : number ->0 : number +>0 : 0 +>0 : 0 } } diff --git a/tests/baselines/reference/generatorTypeCheck42.types b/tests/baselines/reference/generatorTypeCheck42.types index 7538b8f2499..79b2516051e 100644 --- a/tests/baselines/reference/generatorTypeCheck42.types +++ b/tests/baselines/reference/generatorTypeCheck42.types @@ -1,6 +1,6 @@ === tests/cases/conformance/es6/yieldExpressions/generatorTypeCheck42.ts === function* g() { ->g : () => IterableIterator +>g : () => IterableIterator<0> let x = { >x : { [x: number]: () => void; } @@ -8,7 +8,7 @@ function* g() { [yield 0]() { >yield 0 : any ->0 : number +>0 : 0 } } diff --git a/tests/baselines/reference/generatorTypeCheck43.types b/tests/baselines/reference/generatorTypeCheck43.types index a132dfcb015..754d3fee814 100644 --- a/tests/baselines/reference/generatorTypeCheck43.types +++ b/tests/baselines/reference/generatorTypeCheck43.types @@ -1,6 +1,6 @@ === tests/cases/conformance/es6/yieldExpressions/generatorTypeCheck43.ts === function* g() { ->g : () => IterableIterator +>g : () => IterableIterator<0> let x = { >x : { [x: number]: () => IterableIterator; } @@ -8,7 +8,7 @@ function* g() { *[yield 0]() { >yield 0 : any ->0 : number +>0 : 0 } } diff --git a/tests/baselines/reference/generatorTypeCheck44.types b/tests/baselines/reference/generatorTypeCheck44.types index 5c432e41cbe..e06b8961ca0 100644 --- a/tests/baselines/reference/generatorTypeCheck44.types +++ b/tests/baselines/reference/generatorTypeCheck44.types @@ -1,6 +1,6 @@ === tests/cases/conformance/es6/yieldExpressions/generatorTypeCheck44.ts === function* g() { ->g : () => IterableIterator +>g : () => IterableIterator<0> let x = { >x : { [x: number]: number; } @@ -8,10 +8,10 @@ function* g() { get [yield 0]() { >yield 0 : any ->0 : number +>0 : 0 return 0; ->0 : number +>0 : 0 } } } diff --git a/tests/baselines/reference/generatorTypeCheck45.types b/tests/baselines/reference/generatorTypeCheck45.types index 7ea442420d6..96895acde0f 100644 --- a/tests/baselines/reference/generatorTypeCheck45.types +++ b/tests/baselines/reference/generatorTypeCheck45.types @@ -19,7 +19,7 @@ declare function foo(x: T, fun: () => Iterator<(x: T) => U>, fun2: (y: U) foo("", function* () { yield x => x.length }, p => undefined); // T is fixed, should be string >foo("", function* () { yield x => x.length }, p => undefined) : string >foo : (x: T, fun: () => Iterator<(x: T) => U>, fun2: (y: U) => T) => T ->"" : string +>"" : "" >function* () { yield x => x.length } : () => IterableIterator<(x: string) => number> >yield x => x.length : any >x => x.length : (x: string) => number diff --git a/tests/baselines/reference/generatorTypeCheck46.types b/tests/baselines/reference/generatorTypeCheck46.types index daf0d67b6ec..c69ae0881da 100644 --- a/tests/baselines/reference/generatorTypeCheck46.types +++ b/tests/baselines/reference/generatorTypeCheck46.types @@ -19,7 +19,7 @@ declare function foo(x: T, fun: () => Iterable<(x: T) => U>, fun2: (y: U) foo("", function* () { >foo("", function* () { yield* { *[Symbol.iterator]() { yield x => x.length } }}, p => undefined) : string >foo : (x: T, fun: () => Iterable<(x: T) => U>, fun2: (y: U) => T) => T ->"" : string +>"" : "" >function* () { yield* { *[Symbol.iterator]() { yield x => x.length } }} : () => IterableIterator<(x: string) => number> yield* { diff --git a/tests/baselines/reference/generatorTypeCheck49.types b/tests/baselines/reference/generatorTypeCheck49.types index f56cca33438..cd9f3e82d09 100644 --- a/tests/baselines/reference/generatorTypeCheck49.types +++ b/tests/baselines/reference/generatorTypeCheck49.types @@ -1,9 +1,9 @@ === tests/cases/conformance/es6/yieldExpressions/generatorTypeCheck49.ts === function* g() { ->g : () => IterableIterator +>g : () => IterableIterator<0> yield 0; >yield 0 : any ->0 : number +>0 : 0 } diff --git a/tests/baselines/reference/generatorTypeCheck52.errors.txt b/tests/baselines/reference/generatorTypeCheck52.errors.txt deleted file mode 100644 index 8dc280bb8c9..00000000000 --- a/tests/baselines/reference/generatorTypeCheck52.errors.txt +++ /dev/null @@ -1,12 +0,0 @@ -tests/cases/conformance/es6/yieldExpressions/generatorTypeCheck52.ts(3,11): error TS2504: No best common type exists among yield expressions. - - -==== tests/cases/conformance/es6/yieldExpressions/generatorTypeCheck52.ts (1 errors) ==== - class Foo { x: number } - class Baz { z: number } - function* g() { - ~ -!!! error TS2504: No best common type exists among yield expressions. - yield new Foo; - yield new Baz; - } \ No newline at end of file diff --git a/tests/baselines/reference/generatorTypeCheck52.symbols b/tests/baselines/reference/generatorTypeCheck52.symbols new file mode 100644 index 00000000000..64c29f98438 --- /dev/null +++ b/tests/baselines/reference/generatorTypeCheck52.symbols @@ -0,0 +1,18 @@ +=== tests/cases/conformance/es6/yieldExpressions/generatorTypeCheck52.ts === +class Foo { x: number } +>Foo : Symbol(Foo, Decl(generatorTypeCheck52.ts, 0, 0)) +>x : Symbol(Foo.x, Decl(generatorTypeCheck52.ts, 0, 11)) + +class Baz { z: number } +>Baz : Symbol(Baz, Decl(generatorTypeCheck52.ts, 0, 23)) +>z : Symbol(Baz.z, Decl(generatorTypeCheck52.ts, 1, 11)) + +function* g() { +>g : Symbol(g, Decl(generatorTypeCheck52.ts, 1, 23)) + + yield new Foo; +>Foo : Symbol(Foo, Decl(generatorTypeCheck52.ts, 0, 0)) + + yield new Baz; +>Baz : Symbol(Baz, Decl(generatorTypeCheck52.ts, 0, 23)) +} diff --git a/tests/baselines/reference/generatorTypeCheck52.types b/tests/baselines/reference/generatorTypeCheck52.types new file mode 100644 index 00000000000..97ac442aa0e --- /dev/null +++ b/tests/baselines/reference/generatorTypeCheck52.types @@ -0,0 +1,22 @@ +=== tests/cases/conformance/es6/yieldExpressions/generatorTypeCheck52.ts === +class Foo { x: number } +>Foo : Foo +>x : number + +class Baz { z: number } +>Baz : Baz +>z : number + +function* g() { +>g : () => IterableIterator + + yield new Foo; +>yield new Foo : any +>new Foo : Foo +>Foo : typeof Foo + + yield new Baz; +>yield new Baz : any +>new Baz : Baz +>Baz : typeof Baz +} diff --git a/tests/baselines/reference/generatorTypeCheck53.errors.txt b/tests/baselines/reference/generatorTypeCheck53.errors.txt deleted file mode 100644 index ee3512f34c5..00000000000 --- a/tests/baselines/reference/generatorTypeCheck53.errors.txt +++ /dev/null @@ -1,12 +0,0 @@ -tests/cases/conformance/es6/yieldExpressions/generatorTypeCheck53.ts(3,11): error TS2504: No best common type exists among yield expressions. - - -==== tests/cases/conformance/es6/yieldExpressions/generatorTypeCheck53.ts (1 errors) ==== - class Foo { x: number } - class Baz { z: number } - function* g() { - ~ -!!! error TS2504: No best common type exists among yield expressions. - yield new Foo; - yield* [new Baz]; - } \ No newline at end of file diff --git a/tests/baselines/reference/generatorTypeCheck53.symbols b/tests/baselines/reference/generatorTypeCheck53.symbols new file mode 100644 index 00000000000..ce573dbf422 --- /dev/null +++ b/tests/baselines/reference/generatorTypeCheck53.symbols @@ -0,0 +1,18 @@ +=== tests/cases/conformance/es6/yieldExpressions/generatorTypeCheck53.ts === +class Foo { x: number } +>Foo : Symbol(Foo, Decl(generatorTypeCheck53.ts, 0, 0)) +>x : Symbol(Foo.x, Decl(generatorTypeCheck53.ts, 0, 11)) + +class Baz { z: number } +>Baz : Symbol(Baz, Decl(generatorTypeCheck53.ts, 0, 23)) +>z : Symbol(Baz.z, Decl(generatorTypeCheck53.ts, 1, 11)) + +function* g() { +>g : Symbol(g, Decl(generatorTypeCheck53.ts, 1, 23)) + + yield new Foo; +>Foo : Symbol(Foo, Decl(generatorTypeCheck53.ts, 0, 0)) + + yield* [new Baz]; +>Baz : Symbol(Baz, Decl(generatorTypeCheck53.ts, 0, 23)) +} diff --git a/tests/baselines/reference/generatorTypeCheck53.types b/tests/baselines/reference/generatorTypeCheck53.types new file mode 100644 index 00000000000..b91974e9807 --- /dev/null +++ b/tests/baselines/reference/generatorTypeCheck53.types @@ -0,0 +1,23 @@ +=== tests/cases/conformance/es6/yieldExpressions/generatorTypeCheck53.ts === +class Foo { x: number } +>Foo : Foo +>x : number + +class Baz { z: number } +>Baz : Baz +>z : number + +function* g() { +>g : () => IterableIterator + + yield new Foo; +>yield new Foo : any +>new Foo : Foo +>Foo : typeof Foo + + yield* [new Baz]; +>yield* [new Baz] : any +>[new Baz] : Baz[] +>new Baz : Baz +>Baz : typeof Baz +} diff --git a/tests/baselines/reference/generatorTypeCheck54.errors.txt b/tests/baselines/reference/generatorTypeCheck54.errors.txt deleted file mode 100644 index de22dbfc6e8..00000000000 --- a/tests/baselines/reference/generatorTypeCheck54.errors.txt +++ /dev/null @@ -1,12 +0,0 @@ -tests/cases/conformance/es6/yieldExpressions/generatorTypeCheck54.ts(3,11): error TS2504: No best common type exists among yield expressions. - - -==== tests/cases/conformance/es6/yieldExpressions/generatorTypeCheck54.ts (1 errors) ==== - class Foo { x: number } - class Baz { z: number } - function* g() { - ~ -!!! error TS2504: No best common type exists among yield expressions. - yield* [new Foo]; - yield* [new Baz]; - } \ No newline at end of file diff --git a/tests/baselines/reference/generatorTypeCheck54.symbols b/tests/baselines/reference/generatorTypeCheck54.symbols new file mode 100644 index 00000000000..f6230b634f1 --- /dev/null +++ b/tests/baselines/reference/generatorTypeCheck54.symbols @@ -0,0 +1,18 @@ +=== tests/cases/conformance/es6/yieldExpressions/generatorTypeCheck54.ts === +class Foo { x: number } +>Foo : Symbol(Foo, Decl(generatorTypeCheck54.ts, 0, 0)) +>x : Symbol(Foo.x, Decl(generatorTypeCheck54.ts, 0, 11)) + +class Baz { z: number } +>Baz : Symbol(Baz, Decl(generatorTypeCheck54.ts, 0, 23)) +>z : Symbol(Baz.z, Decl(generatorTypeCheck54.ts, 1, 11)) + +function* g() { +>g : Symbol(g, Decl(generatorTypeCheck54.ts, 1, 23)) + + yield* [new Foo]; +>Foo : Symbol(Foo, Decl(generatorTypeCheck54.ts, 0, 0)) + + yield* [new Baz]; +>Baz : Symbol(Baz, Decl(generatorTypeCheck54.ts, 0, 23)) +} diff --git a/tests/baselines/reference/generatorTypeCheck54.types b/tests/baselines/reference/generatorTypeCheck54.types new file mode 100644 index 00000000000..1cdbde67498 --- /dev/null +++ b/tests/baselines/reference/generatorTypeCheck54.types @@ -0,0 +1,24 @@ +=== tests/cases/conformance/es6/yieldExpressions/generatorTypeCheck54.ts === +class Foo { x: number } +>Foo : Foo +>x : number + +class Baz { z: number } +>Baz : Baz +>z : number + +function* g() { +>g : () => IterableIterator + + yield* [new Foo]; +>yield* [new Foo] : any +>[new Foo] : Foo[] +>new Foo : Foo +>Foo : typeof Foo + + yield* [new Baz]; +>yield* [new Baz] : any +>[new Baz] : Baz[] +>new Baz : Baz +>Baz : typeof Baz +} diff --git a/tests/baselines/reference/genericAndNonGenericOverload1.types b/tests/baselines/reference/genericAndNonGenericOverload1.types index 28eeb2d4da0..f7d0d4b35f8 100644 --- a/tests/baselines/reference/genericAndNonGenericOverload1.types +++ b/tests/baselines/reference/genericAndNonGenericOverload1.types @@ -21,5 +21,5 @@ var c2: callable2; c2(1); >c2(1) : string >c2 : callable2 ->1 : number +>1 : 1 diff --git a/tests/baselines/reference/genericArgumentCallSigAssignmentCompat.types b/tests/baselines/reference/genericArgumentCallSigAssignmentCompat.types index c5fd984d327..086c6e23a8e 100644 --- a/tests/baselines/reference/genericArgumentCallSigAssignmentCompat.types +++ b/tests/baselines/reference/genericArgumentCallSigAssignmentCompat.types @@ -49,11 +49,11 @@ _.all([true, 1, null, 'yes'], _.identity); >_.all : (list: T[], iterator?: Underscore.Iterator, context?: any) => boolean >_ : Underscore.Static >all : (list: T[], iterator?: Underscore.Iterator, context?: any) => boolean ->[true, 1, null, 'yes'] : (string | number | boolean)[] ->true : boolean ->1 : number +>[true, 1, null, 'yes'] : (true | 1 | "yes")[] +>true : true +>1 : 1 >null : null ->'yes' : string +>'yes' : "yes" >_.identity : (value: T) => T >_ : Underscore.Static >identity : (value: T) => T @@ -64,8 +64,8 @@ _.all([true], _.identity); >_.all : (list: T[], iterator?: Underscore.Iterator, context?: any) => boolean >_ : Underscore.Static >all : (list: T[], iterator?: Underscore.Iterator, context?: any) => boolean ->[true] : boolean[] ->true : boolean +>[true] : true[] +>true : true >_.identity : (value: T) => T >_ : Underscore.Static >identity : (value: T) => T diff --git a/tests/baselines/reference/genericArray1.types b/tests/baselines/reference/genericArray1.types index bf44c88f518..baa2ec8a9cf 100644 --- a/tests/baselines/reference/genericArray1.types +++ b/tests/baselines/reference/genericArray1.types @@ -16,9 +16,9 @@ var lengths = ["a", "b", "c"].map(x => x.length); >["a", "b", "c"].map(x => x.length) : number[] >["a", "b", "c"].map : (callbackfn: (value: string, index: number, array: string[]) => U, thisArg?: any) => U[] >["a", "b", "c"] : string[] ->"a" : string ->"b" : string ->"c" : string +>"a" : "a" +>"b" : "b" +>"c" : "c" >map : (callbackfn: (value: string, index: number, array: string[]) => U, thisArg?: any) => U[] >x => x.length : (x: string) => number >x : string diff --git a/tests/baselines/reference/genericBaseClassLiteralProperty2.types b/tests/baselines/reference/genericBaseClassLiteralProperty2.types index 3e320824925..01740426935 100644 --- a/tests/baselines/reference/genericBaseClassLiteralProperty2.types +++ b/tests/baselines/reference/genericBaseClassLiteralProperty2.types @@ -38,7 +38,7 @@ class DataView2 extends BaseCollection2 { >this._itemsByKey : { [key: string]: CollectionItem2; } >this : this >_itemsByKey : { [key: string]: CollectionItem2; } ->'dummy' : string +>'dummy' : "dummy" >item : CollectionItem2 } } diff --git a/tests/baselines/reference/genericCallTypeArgumentInference.types b/tests/baselines/reference/genericCallTypeArgumentInference.types index 0208ec74f1e..33c38b0dd48 100644 --- a/tests/baselines/reference/genericCallTypeArgumentInference.types +++ b/tests/baselines/reference/genericCallTypeArgumentInference.types @@ -13,9 +13,9 @@ function foo(t: T) { var r = foo(''); // string >r : string ->foo('') : string +>foo('') : "" >foo : (t: T) => T ->'' : string +>'' : "" function foo2(t: T, u: U) { >foo2 : (t: T, u: U) => U @@ -47,16 +47,16 @@ function foo2b(u: U) { var r2 = foo2('', 1); // number >r2 : number ->foo2('', 1) : number +>foo2('', 1) : 1 >foo2 : (t: T, u: U) => U ->'' : string ->1 : number +>'' : "" +>1 : 1 var r3 = foo2b(1); // {} >r3 : {} >foo2b(1) : {} >foo2b : (u: U) => T ->1 : number +>1 : 1 class C { >C : C @@ -175,8 +175,8 @@ var c = new C('', 1); >c : C >new C('', 1) : C >C : typeof C ->'' : string ->1 : number +>'' : "" +>1 : 1 var r4 = c.foo('', 1); // string >r4 : string @@ -184,8 +184,8 @@ var r4 = c.foo('', 1); // string >c.foo : (t: string, u: number) => string >c : C >foo : (t: string, u: number) => string ->'' : string ->1 : number +>'' : "" +>1 : 1 var r5 = c.foo2('', 1); // number >r5 : number @@ -193,17 +193,17 @@ var r5 = c.foo2('', 1); // number >c.foo2 : (t: string, u: number) => number >c : C >foo2 : (t: string, u: number) => number ->'' : string ->1 : number +>'' : "" +>1 : 1 var r6 = c.foo3(true, 1); // boolean >r6 : boolean ->c.foo3(true, 1) : boolean +>c.foo3(true, 1) : true >c.foo3 : (t: T, u: number) => T >c : C >foo3 : (t: T, u: number) => T ->true : boolean ->1 : number +>true : true +>1 : 1 var r7 = c.foo4('', true); // string >r7 : string @@ -211,17 +211,17 @@ var r7 = c.foo4('', true); // string >c.foo4 : (t: string, u: U) => string >c : C >foo4 : (t: string, u: U) => string ->'' : string ->true : boolean +>'' : "" +>true : true var r8 = c.foo5(true, 1); // boolean >r8 : boolean ->c.foo5(true, 1) : boolean +>c.foo5(true, 1) : true >c.foo5 : (t: T, u: U) => T >c : C >foo5 : (t: T, u: U) => T ->true : boolean ->1 : number +>true : true +>1 : 1 var r9 = c.foo6(); // {} >r9 : {} @@ -236,7 +236,7 @@ var r10 = c.foo7(''); // {} >c.foo7 : (u: U) => T >c : C >foo7 : (u: U) => T ->'' : string +>'' : "" var r11 = c.foo8(); // {} >r11 : {} @@ -331,8 +331,8 @@ var r4 = i.foo('', 1); // string >i.foo : (t: string, u: number) => string >i : I >foo : (t: string, u: number) => string ->'' : string ->1 : number +>'' : "" +>1 : 1 var r5 = i.foo2('', 1); // number >r5 : number @@ -340,17 +340,17 @@ var r5 = i.foo2('', 1); // number >i.foo2 : (t: string, u: number) => number >i : I >foo2 : (t: string, u: number) => number ->'' : string ->1 : number +>'' : "" +>1 : 1 var r6 = i.foo3(true, 1); // boolean >r6 : boolean ->i.foo3(true, 1) : boolean +>i.foo3(true, 1) : true >i.foo3 : (t: T, u: number) => T >i : I >foo3 : (t: T, u: number) => T ->true : boolean ->1 : number +>true : true +>1 : 1 var r7 = i.foo4('', true); // string >r7 : string @@ -358,17 +358,17 @@ var r7 = i.foo4('', true); // string >i.foo4 : (t: string, u: U) => string >i : I >foo4 : (t: string, u: U) => string ->'' : string ->true : boolean +>'' : "" +>true : true var r8 = i.foo5(true, 1); // boolean >r8 : boolean ->i.foo5(true, 1) : boolean +>i.foo5(true, 1) : true >i.foo5 : (t: T, u: U) => T >i : I >foo5 : (t: T, u: U) => T ->true : boolean ->1 : number +>true : true +>1 : 1 var r9 = i.foo6(); // {} >r9 : {} @@ -383,7 +383,7 @@ var r10 = i.foo7(''); // {} >i.foo7 : (u: U) => T >i : I >foo7 : (u: U) => T ->'' : string +>'' : "" var r11 = i.foo8(); // {} >r11 : {} diff --git a/tests/baselines/reference/genericCallWithArrayLiteralArgs.types b/tests/baselines/reference/genericCallWithArrayLiteralArgs.types index 48a7150ef44..2727f0c1ece 100644 --- a/tests/baselines/reference/genericCallWithArrayLiteralArgs.types +++ b/tests/baselines/reference/genericCallWithArrayLiteralArgs.types @@ -14,24 +14,24 @@ var r = foo([1, 2]); // number[] >foo([1, 2]) : number[] >foo : (t: T) => T >[1, 2] : number[] ->1 : number ->2 : number +>1 : 1 +>2 : 2 var r = foo([1, 2]); // number[] >r : number[] >foo([1, 2]) : number[] >foo : (t: T) => T >[1, 2] : number[] ->1 : number ->2 : number +>1 : 1 +>2 : 2 var ra = foo([1, 2]); // any[] >ra : any[] >foo([1, 2]) : any[] >foo : (t: T) => T >[1, 2] : number[] ->1 : number ->2 : number +>1 : 1 +>2 : 2 var r2 = foo([]); // any[] >r2 : any[] @@ -50,16 +50,16 @@ var r4 = foo([1, '']); // {}[] >foo([1, '']) : (string | number)[] >foo : (t: T) => T >[1, ''] : (string | number)[] ->1 : number ->'' : string +>1 : 1 +>'' : "" var r5 = foo([1, '']); // any[] >r5 : any[] >foo([1, '']) : any[] >foo : (t: T) => T >[1, ''] : (string | number)[] ->1 : number ->'' : string +>1 : 1 +>'' : "" var r6 = foo([1, '']); // Object[] >r6 : Object[] @@ -67,6 +67,6 @@ var r6 = foo([1, '']); // Object[] >foo : (t: T) => T >Object : Object >[1, ''] : (string | number)[] ->1 : number ->'' : string +>1 : 1 +>'' : "" diff --git a/tests/baselines/reference/genericCallWithConstraintsTypeArgumentInference2.errors.txt b/tests/baselines/reference/genericCallWithConstraintsTypeArgumentInference2.errors.txt index 805bde82b64..6982031c9ba 100644 --- a/tests/baselines/reference/genericCallWithConstraintsTypeArgumentInference2.errors.txt +++ b/tests/baselines/reference/genericCallWithConstraintsTypeArgumentInference2.errors.txt @@ -1,4 +1,4 @@ -tests/cases/conformance/types/typeRelationships/typeInference/genericCallWithConstraintsTypeArgumentInference2.ts(11,26): error TS2345: Argument of type 'number' is not assignable to parameter of type 'Date'. +tests/cases/conformance/types/typeRelationships/typeInference/genericCallWithConstraintsTypeArgumentInference2.ts(11,26): error TS2345: Argument of type '1' is not assignable to parameter of type 'Date'. ==== tests/cases/conformance/types/typeRelationships/typeInference/genericCallWithConstraintsTypeArgumentInference2.ts (1 errors) ==== @@ -14,5 +14,5 @@ tests/cases/conformance/types/typeRelationships/typeInference/genericCallWithCon var r3 = foo(new Object()); // {} var r4 = foo(1); // error ~ -!!! error TS2345: Argument of type 'number' is not assignable to parameter of type 'Date'. +!!! error TS2345: Argument of type '1' is not assignable to parameter of type 'Date'. var r5 = foo(new Date()); // no error \ No newline at end of file diff --git a/tests/baselines/reference/genericCallWithFixedArguments.types b/tests/baselines/reference/genericCallWithFixedArguments.types index f22dbc01252..e10bbb9dd35 100644 --- a/tests/baselines/reference/genericCallWithFixedArguments.types +++ b/tests/baselines/reference/genericCallWithFixedArguments.types @@ -18,6 +18,6 @@ g(7) // the parameter list is fixed, so this should not error >g : (x: any) => void >A : A >B : B ->7 : number +>7 : 7 diff --git a/tests/baselines/reference/genericCallWithFunctionTypedArguments.errors.txt b/tests/baselines/reference/genericCallWithFunctionTypedArguments.errors.txt index 093c4bed545..80b04c069d5 100644 --- a/tests/baselines/reference/genericCallWithFunctionTypedArguments.errors.txt +++ b/tests/baselines/reference/genericCallWithFunctionTypedArguments.errors.txt @@ -1,13 +1,13 @@ tests/cases/conformance/types/typeRelationships/typeInference/genericCallWithFunctionTypedArguments.ts(26,10): error TS2453: The type argument for type parameter 'U' cannot be inferred from the usage. Consider specifying the type arguments explicitly. - Type argument candidate 'number' is not a valid type argument because it is not a supertype of candidate 'string'. + Type argument candidate '1' is not a valid type argument because it is not a supertype of candidate 'string'. tests/cases/conformance/types/typeRelationships/typeInference/genericCallWithFunctionTypedArguments.ts(30,15): error TS2453: The type argument for type parameter 'T' cannot be inferred from the usage. Consider specifying the type arguments explicitly. - Type argument candidate 'number' is not a valid type argument because it is not a supertype of candidate 'T'. + Type argument candidate '1' is not a valid type argument because it is not a supertype of candidate 'T'. tests/cases/conformance/types/typeRelationships/typeInference/genericCallWithFunctionTypedArguments.ts(33,15): error TS2453: The type argument for type parameter 'T' cannot be inferred from the usage. Consider specifying the type arguments explicitly. - Type argument candidate 'number' is not a valid type argument because it is not a supertype of candidate 'T'. + Type argument candidate '1' is not a valid type argument because it is not a supertype of candidate 'T'. tests/cases/conformance/types/typeRelationships/typeInference/genericCallWithFunctionTypedArguments.ts(34,16): error TS2453: The type argument for type parameter 'T' cannot be inferred from the usage. Consider specifying the type arguments explicitly. - Type argument candidate 'number' is not a valid type argument because it is not a supertype of candidate 'T'. + Type argument candidate '1' is not a valid type argument because it is not a supertype of candidate 'T'. tests/cases/conformance/types/typeRelationships/typeInference/genericCallWithFunctionTypedArguments.ts(35,15): error TS2453: The type argument for type parameter 'U' cannot be inferred from the usage. Consider specifying the type arguments explicitly. - Type argument candidate 'number' is not a valid type argument because it is not a supertype of candidate 'string'. + Type argument candidate '1' is not a valid type argument because it is not a supertype of candidate 'string'. ==== tests/cases/conformance/types/typeRelationships/typeInference/genericCallWithFunctionTypedArguments.ts (5 errors) ==== @@ -39,26 +39,26 @@ tests/cases/conformance/types/typeRelationships/typeInference/genericCallWithFun var r8 = foo3(1, function (a) { return '' }, 1); // error ~~~~ !!! error TS2453: The type argument for type parameter 'U' cannot be inferred from the usage. Consider specifying the type arguments explicitly. -!!! error TS2453: Type argument candidate 'number' is not a valid type argument because it is not a supertype of candidate 'string'. +!!! error TS2453: Type argument candidate '1' is not a valid type argument because it is not a supertype of candidate 'string'. var r9 = foo3(1, (a) => '', ''); // string function other(t: T, u: U) { var r10 = foo2(1, (x: T) => ''); // error ~~~~ !!! error TS2453: The type argument for type parameter 'T' cannot be inferred from the usage. Consider specifying the type arguments explicitly. -!!! error TS2453: Type argument candidate 'number' is not a valid type argument because it is not a supertype of candidate 'T'. +!!! error TS2453: Type argument candidate '1' is not a valid type argument because it is not a supertype of candidate 'T'. var r10 = foo2(1, (x) => ''); // string var r11 = foo3(1, (x: T) => '', ''); // error ~~~~ !!! error TS2453: The type argument for type parameter 'T' cannot be inferred from the usage. Consider specifying the type arguments explicitly. -!!! error TS2453: Type argument candidate 'number' is not a valid type argument because it is not a supertype of candidate 'T'. +!!! error TS2453: Type argument candidate '1' is not a valid type argument because it is not a supertype of candidate 'T'. var r11b = foo3(1, (x: T) => '', 1); // error ~~~~ !!! error TS2453: The type argument for type parameter 'T' cannot be inferred from the usage. Consider specifying the type arguments explicitly. -!!! error TS2453: Type argument candidate 'number' is not a valid type argument because it is not a supertype of candidate 'T'. +!!! error TS2453: Type argument candidate '1' is not a valid type argument because it is not a supertype of candidate 'T'. var r12 = foo3(1, function (a) { return '' }, 1); // error ~~~~ !!! error TS2453: The type argument for type parameter 'U' cannot be inferred from the usage. Consider specifying the type arguments explicitly. -!!! error TS2453: Type argument candidate 'number' is not a valid type argument because it is not a supertype of candidate 'string'. +!!! error TS2453: Type argument candidate '1' is not a valid type argument because it is not a supertype of candidate 'string'. } \ No newline at end of file diff --git a/tests/baselines/reference/genericCallWithFunctionTypedArguments2.errors.txt b/tests/baselines/reference/genericCallWithFunctionTypedArguments2.errors.txt index 3a397a66eba..90f87de070d 100644 --- a/tests/baselines/reference/genericCallWithFunctionTypedArguments2.errors.txt +++ b/tests/baselines/reference/genericCallWithFunctionTypedArguments2.errors.txt @@ -1,7 +1,7 @@ tests/cases/conformance/types/typeRelationships/typeInference/genericCallWithFunctionTypedArguments2.ts(29,10): error TS2453: The type argument for type parameter 'T' cannot be inferred from the usage. Consider specifying the type arguments explicitly. - Type argument candidate 'number' is not a valid type argument because it is not a supertype of candidate 'string'. + Type argument candidate '1' is not a valid type argument because it is not a supertype of candidate 'string'. tests/cases/conformance/types/typeRelationships/typeInference/genericCallWithFunctionTypedArguments2.ts(40,10): error TS2453: The type argument for type parameter 'T' cannot be inferred from the usage. Consider specifying the type arguments explicitly. - Type argument candidate 'number' is not a valid type argument because it is not a supertype of candidate 'string'. + Type argument candidate '1' is not a valid type argument because it is not a supertype of candidate 'string'. ==== tests/cases/conformance/types/typeRelationships/typeInference/genericCallWithFunctionTypedArguments2.ts (2 errors) ==== @@ -36,7 +36,7 @@ tests/cases/conformance/types/typeRelationships/typeInference/genericCallWithFun var r4 = foo2(1, i2); // error ~~~~ !!! error TS2453: The type argument for type parameter 'T' cannot be inferred from the usage. Consider specifying the type arguments explicitly. -!!! error TS2453: Type argument candidate 'number' is not a valid type argument because it is not a supertype of candidate 'string'. +!!! error TS2453: Type argument candidate '1' is not a valid type argument because it is not a supertype of candidate 'string'. var r4b = foo2(1, a); // any var r5 = foo2(1, i); // any var r6 = foo2('', i2); // string @@ -50,5 +50,5 @@ tests/cases/conformance/types/typeRelationships/typeInference/genericCallWithFun var r8 = foo3(1, i2, 1); // error ~~~~ !!! error TS2453: The type argument for type parameter 'T' cannot be inferred from the usage. Consider specifying the type arguments explicitly. -!!! error TS2453: Type argument candidate 'number' is not a valid type argument because it is not a supertype of candidate 'string'. +!!! error TS2453: Type argument candidate '1' is not a valid type argument because it is not a supertype of candidate 'string'. var r9 = foo3('', i2, ''); // string \ No newline at end of file diff --git a/tests/baselines/reference/genericCallWithGenericSignatureArguments2.errors.txt b/tests/baselines/reference/genericCallWithGenericSignatureArguments2.errors.txt index e3da7eaeaec..714fe32d31a 100644 --- a/tests/baselines/reference/genericCallWithGenericSignatureArguments2.errors.txt +++ b/tests/baselines/reference/genericCallWithGenericSignatureArguments2.errors.txt @@ -1,14 +1,14 @@ tests/cases/conformance/types/typeRelationships/typeInference/genericCallWithGenericSignatureArguments2.ts(10,29): error TS2453: The type argument for type parameter 'T' cannot be inferred from the usage. Consider specifying the type arguments explicitly. Type argument candidate 'number' is not a valid type argument because it is not a supertype of candidate 'string'. tests/cases/conformance/types/typeRelationships/typeInference/genericCallWithGenericSignatureArguments2.ts(15,21): error TS2345: Argument of type 'Date' is not assignable to parameter of type 'T'. -tests/cases/conformance/types/typeRelationships/typeInference/genericCallWithGenericSignatureArguments2.ts(16,22): error TS2345: Argument of type 'number' is not assignable to parameter of type 'T'. +tests/cases/conformance/types/typeRelationships/typeInference/genericCallWithGenericSignatureArguments2.ts(16,22): error TS2345: Argument of type '1' is not assignable to parameter of type 'T'. tests/cases/conformance/types/typeRelationships/typeInference/genericCallWithGenericSignatureArguments2.ts(25,23): error TS2345: Argument of type '(a: T) => T' is not assignable to parameter of type '(x: Date) => Date'. Types of parameters 'a' and 'x' are incompatible. Type 'Date' is not assignable to type 'T'. tests/cases/conformance/types/typeRelationships/typeInference/genericCallWithGenericSignatureArguments2.ts(37,36): error TS2345: Argument of type '(x: E) => F' is not assignable to parameter of type '(x: E) => E'. Type 'F' is not assignable to type 'E'. tests/cases/conformance/types/typeRelationships/typeInference/genericCallWithGenericSignatureArguments2.ts(50,21): error TS2345: Argument of type 'Date' is not assignable to parameter of type 'T'. -tests/cases/conformance/types/typeRelationships/typeInference/genericCallWithGenericSignatureArguments2.ts(51,22): error TS2345: Argument of type 'number' is not assignable to parameter of type 'T'. +tests/cases/conformance/types/typeRelationships/typeInference/genericCallWithGenericSignatureArguments2.ts(51,22): error TS2345: Argument of type '1' is not assignable to parameter of type 'T'. tests/cases/conformance/types/typeRelationships/typeInference/genericCallWithGenericSignatureArguments2.ts(60,23): error TS2345: Argument of type '(a: T) => T' is not assignable to parameter of type '(x: Date) => Date'. Types of parameters 'a' and 'x' are incompatible. Type 'Date' is not assignable to type 'T'. @@ -39,7 +39,7 @@ tests/cases/conformance/types/typeRelationships/typeInference/genericCallWithGen !!! error TS2345: Argument of type 'Date' is not assignable to parameter of type 'T'. var r10 = r7(1); // error ~ -!!! error TS2345: Argument of type 'number' is not assignable to parameter of type 'T'. +!!! error TS2345: Argument of type '1' is not assignable to parameter of type 'T'. } function foo2(a: (x: T) => T, b: (x: T) => T) { @@ -85,7 +85,7 @@ tests/cases/conformance/types/typeRelationships/typeInference/genericCallWithGen !!! error TS2345: Argument of type 'Date' is not assignable to parameter of type 'T'. var r10 = r7(1); ~ -!!! error TS2345: Argument of type 'number' is not assignable to parameter of type 'T'. +!!! error TS2345: Argument of type '1' is not assignable to parameter of type 'T'. } function foo2(a: (x: T) => T, b: (x: U) => U) { diff --git a/tests/baselines/reference/genericCallWithObjectTypeArgsAndIndexers.types b/tests/baselines/reference/genericCallWithObjectTypeArgsAndIndexers.types index e1659323033..26e19e68577 100644 --- a/tests/baselines/reference/genericCallWithObjectTypeArgsAndIndexers.types +++ b/tests/baselines/reference/genericCallWithObjectTypeArgsAndIndexers.types @@ -58,11 +58,11 @@ function other(arg: T) { >d : T >r2[1] : T >r2 : { [x: string]: Object; [x: number]: T; } ->1 : number +>1 : 1 var e = r2['1']; >e : Object >r2['1'] : Object >r2 : { [x: string]: Object; [x: number]: T; } ->'1' : string +>'1' : "1" } diff --git a/tests/baselines/reference/genericCallWithObjectTypeArgsAndIndexersErrors.types b/tests/baselines/reference/genericCallWithObjectTypeArgsAndIndexersErrors.types index bde72409edc..4141caac617 100644 --- a/tests/baselines/reference/genericCallWithObjectTypeArgsAndIndexersErrors.types +++ b/tests/baselines/reference/genericCallWithObjectTypeArgsAndIndexersErrors.types @@ -67,18 +67,18 @@ function other3(arg: T) { >d : T >r2[1] : T >r2 : { [x: string]: Object; [x: number]: T; } ->1 : number +>1 : 1 var e = r2['1']; >e : Object >r2['1'] : Object >r2 : { [x: string]: Object; [x: number]: T; } ->'1' : string +>'1' : "1" var u: U = r2[1]; // ok >u : U >U : U >r2[1] : T >r2 : { [x: string]: Object; [x: number]: T; } ->1 : number +>1 : 1 } diff --git a/tests/baselines/reference/genericCallWithObjectTypeArgsAndInitializers.errors.txt b/tests/baselines/reference/genericCallWithObjectTypeArgsAndInitializers.errors.txt index 9795248e2f7..b65b21e127b 100644 --- a/tests/baselines/reference/genericCallWithObjectTypeArgsAndInitializers.errors.txt +++ b/tests/baselines/reference/genericCallWithObjectTypeArgsAndInitializers.errors.txt @@ -1,4 +1,4 @@ -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/genericCallWithObjectTypeArgsAndInitializers.ts(5,33): error TS2322: Type 'number' is not assignable to type 'T'. +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/genericCallWithObjectTypeArgsAndInitializers.ts(5,33): error TS2322: Type '1' is not assignable to type 'T'. tests/cases/conformance/types/typeRelationships/assignmentCompatibility/genericCallWithObjectTypeArgsAndInitializers.ts(6,37): error TS2322: Type 'T' is not assignable to type 'U'. tests/cases/conformance/types/typeRelationships/assignmentCompatibility/genericCallWithObjectTypeArgsAndInitializers.ts(8,56): error TS2322: Type 'U' is not assignable to type 'V'. Type 'T' is not assignable to type 'V'. @@ -11,7 +11,7 @@ tests/cases/conformance/types/typeRelationships/assignmentCompatibility/genericC function foo2(x: T = undefined) { return x; } // ok function foo3(x: T = 1) { } // error ~~~~~~~~ -!!! error TS2322: Type 'number' is not assignable to type 'T'. +!!! error TS2322: Type '1' is not assignable to type 'T'. function foo4(x: T, y: U = x) { } // error ~~~~~~~~ !!! error TS2322: Type 'T' is not assignable to type 'U'. diff --git a/tests/baselines/reference/genericCallWithObjectTypeArgsAndNumericIndexer.types b/tests/baselines/reference/genericCallWithObjectTypeArgsAndNumericIndexer.types index 71e943c1ad3..e7676596c07 100644 --- a/tests/baselines/reference/genericCallWithObjectTypeArgsAndNumericIndexer.types +++ b/tests/baselines/reference/genericCallWithObjectTypeArgsAndNumericIndexer.types @@ -62,7 +62,7 @@ function other2(arg: T) { >d : T >r2[1] : T >r2 : { [x: number]: T; } ->1 : number +>1 : 1 } function other3(arg: T) { @@ -89,7 +89,7 @@ function other3(arg: T) { >d : T >r2[1] : T >r2 : { [x: number]: T; } ->1 : number +>1 : 1 // BUG 821629 //var u: U = r2[1]; // ok diff --git a/tests/baselines/reference/genericCallWithObjectTypeArgsAndStringIndexer.types b/tests/baselines/reference/genericCallWithObjectTypeArgsAndStringIndexer.types index 196103f422b..a0b6e89c70a 100644 --- a/tests/baselines/reference/genericCallWithObjectTypeArgsAndStringIndexer.types +++ b/tests/baselines/reference/genericCallWithObjectTypeArgsAndStringIndexer.types @@ -63,7 +63,7 @@ function other2(arg: T) { >Date : Date >r2['hm'] : T >r2 : { [x: string]: T; } ->'hm' : string +>'hm' : "hm" } function other3(arg: T) { @@ -91,7 +91,7 @@ function other3(arg: T) { >Date : Date >r2['hm'] : T >r2 : { [x: string]: T; } ->'hm' : string +>'hm' : "hm" // BUG 821629 //var u: U = r2['hm']; // ok diff --git a/tests/baselines/reference/genericCallWithOverloadedFunctionTypedArguments.types b/tests/baselines/reference/genericCallWithOverloadedFunctionTypedArguments.types index dbdecbec3e4..ab07e9c880a 100644 --- a/tests/baselines/reference/genericCallWithOverloadedFunctionTypedArguments.types +++ b/tests/baselines/reference/genericCallWithOverloadedFunctionTypedArguments.types @@ -119,7 +119,7 @@ module GenericParameter { >T : T >x : T >T : T ->'' : string +>'' : "" var r11 = foo6((x: T, y?: T) => ''); // any => string (+1 overload) >r11 : { (x: any): string; (x: any, y?: any): string; } @@ -131,7 +131,7 @@ module GenericParameter { >T : T >y : T >T : T ->'' : string +>'' : "" function foo7(x:T, cb: { (x: T): string; (x: T, y?: T): string }) { >foo7 : (x: T, cb: { (x: T): string; (x: T, y?: T): string; }) => { (x: T): string; (x: T, y?: T): string; } @@ -154,7 +154,7 @@ module GenericParameter { >r12 : { (x: any): string; (x: any, y?: any): string; } >foo7(1, (x) => x) : { (x: any): string; (x: any, y?: any): string; } >foo7 : (x: T, cb: { (x: T): string; (x: T, y?: T): string; }) => { (x: T): string; (x: T, y?: T): string; } ->1 : number +>1 : 1 >(x) => x : (x: any) => any >x : any >x : any @@ -163,12 +163,12 @@ module GenericParameter { >r13 : { (x: any): string; (x: any, y?: any): string; } >foo7(1, (x: T) => '') : { (x: any): string; (x: any, y?: any): string; } >foo7 : (x: T, cb: { (x: T): string; (x: T, y?: T): string; }) => { (x: T): string; (x: T, y?: T): string; } ->1 : number +>1 : 1 >(x: T) => '' : (x: T) => string >T : T >x : T >T : T ->'' : string +>'' : "" var a: { (x: T): string; (x: number): T; } >a : { (x: T): string; (x: number): T; } @@ -183,6 +183,6 @@ module GenericParameter { >r14 : { (x: any): string; (x: any, y?: any): string; } >foo7(1, a) : { (x: any): string; (x: any, y?: any): string; } >foo7 : (x: T, cb: { (x: T): string; (x: T, y?: T): string; }) => { (x: T): string; (x: T, y?: T): string; } ->1 : number +>1 : 1 >a : { (x: T): string; (x: number): T; } } diff --git a/tests/baselines/reference/genericCallbackInvokedInsideItsContainingFunction1.errors.txt b/tests/baselines/reference/genericCallbackInvokedInsideItsContainingFunction1.errors.txt index af5d92f4e3c..aec6b9c34b7 100644 --- a/tests/baselines/reference/genericCallbackInvokedInsideItsContainingFunction1.errors.txt +++ b/tests/baselines/reference/genericCallbackInvokedInsideItsContainingFunction1.errors.txt @@ -1,5 +1,5 @@ tests/cases/compiler/genericCallbackInvokedInsideItsContainingFunction1.ts(2,14): error TS2346: Supplied parameters do not match any signature of call target. -tests/cases/compiler/genericCallbackInvokedInsideItsContainingFunction1.ts(3,16): error TS2345: Argument of type 'number' is not assignable to parameter of type 'T'. +tests/cases/compiler/genericCallbackInvokedInsideItsContainingFunction1.ts(3,16): error TS2345: Argument of type '1' is not assignable to parameter of type 'T'. tests/cases/compiler/genericCallbackInvokedInsideItsContainingFunction1.ts(4,14): error TS2346: Supplied parameters do not match any signature of call target. tests/cases/compiler/genericCallbackInvokedInsideItsContainingFunction1.ts(8,15): error TS2346: Supplied parameters do not match any signature of call target. tests/cases/compiler/genericCallbackInvokedInsideItsContainingFunction1.ts(9,15): error TS2346: Supplied parameters do not match any signature of call target. @@ -15,7 +15,7 @@ tests/cases/compiler/genericCallbackInvokedInsideItsContainingFunction1.ts(14,15 !!! error TS2346: Supplied parameters do not match any signature of call target. var r2 = f(1); ~ -!!! error TS2345: Argument of type 'number' is not assignable to parameter of type 'T'. +!!! error TS2345: Argument of type '1' is not assignable to parameter of type 'T'. var r3 = f(null); ~~~~~~~~~~~~ !!! error TS2346: Supplied parameters do not match any signature of call target. diff --git a/tests/baselines/reference/genericClassExpressionInFunction.types b/tests/baselines/reference/genericClassExpressionInFunction.types index 943391fdd59..e5e85fb8bf0 100644 --- a/tests/baselines/reference/genericClassExpressionInFunction.types +++ b/tests/baselines/reference/genericClassExpressionInFunction.types @@ -86,23 +86,23 @@ var s = new S(); >S : typeof S c.genericVar = 12; ->c.genericVar = 12 : number +>c.genericVar = 12 : 12 >c.genericVar : number >c : C >genericVar : number ->12 : number +>12 : 12 k.genericVar = 12; ->k.genericVar = 12 : number +>k.genericVar = 12 : 12 >k.genericVar : number >k : K >genericVar : number ->12 : number +>12 : 12 s.genericVar = 12; ->s.genericVar = 12 : number +>s.genericVar = 12 : 12 >s.genericVar : number >s : S >genericVar : number ->12 : number +>12 : 12 diff --git a/tests/baselines/reference/genericClassPropertyInheritanceSpecialization.types b/tests/baselines/reference/genericClassPropertyInheritanceSpecialization.types index 88ef74283ae..3db47b0e479 100644 --- a/tests/baselines/reference/genericClassPropertyInheritanceSpecialization.types +++ b/tests/baselines/reference/genericClassPropertyInheritanceSpecialization.types @@ -179,7 +179,7 @@ module Portal.Controls.Validators { >_validate : (value: TValue) => number >value : TValue >TValue : TValue ->0 : number +>0 : 0 } } diff --git a/tests/baselines/reference/genericClassWithFunctionTypedMemberArguments.errors.txt b/tests/baselines/reference/genericClassWithFunctionTypedMemberArguments.errors.txt index 149a20e92a5..bcfa8d8fbf9 100644 --- a/tests/baselines/reference/genericClassWithFunctionTypedMemberArguments.errors.txt +++ b/tests/baselines/reference/genericClassWithFunctionTypedMemberArguments.errors.txt @@ -1,11 +1,11 @@ tests/cases/conformance/types/typeRelationships/typeInference/genericClassWithFunctionTypedMemberArguments.ts(57,19): error TS2453: The type argument for type parameter 'T' cannot be inferred from the usage. Consider specifying the type arguments explicitly. - Type argument candidate 'number' is not a valid type argument because it is not a supertype of candidate 'T'. + Type argument candidate '1' is not a valid type argument because it is not a supertype of candidate 'T'. tests/cases/conformance/types/typeRelationships/typeInference/genericClassWithFunctionTypedMemberArguments.ts(60,19): error TS2453: The type argument for type parameter 'T' cannot be inferred from the usage. Consider specifying the type arguments explicitly. - Type argument candidate 'number' is not a valid type argument because it is not a supertype of candidate 'T'. + Type argument candidate '1' is not a valid type argument because it is not a supertype of candidate 'T'. tests/cases/conformance/types/typeRelationships/typeInference/genericClassWithFunctionTypedMemberArguments.ts(61,20): error TS2453: The type argument for type parameter 'T' cannot be inferred from the usage. Consider specifying the type arguments explicitly. - Type argument candidate 'number' is not a valid type argument because it is not a supertype of candidate 'T'. + Type argument candidate '1' is not a valid type argument because it is not a supertype of candidate 'T'. tests/cases/conformance/types/typeRelationships/typeInference/genericClassWithFunctionTypedMemberArguments.ts(62,19): error TS2453: The type argument for type parameter 'U' cannot be inferred from the usage. Consider specifying the type arguments explicitly. - Type argument candidate 'number' is not a valid type argument because it is not a supertype of candidate 'string'. + Type argument candidate '1' is not a valid type argument because it is not a supertype of candidate 'string'. ==== tests/cases/conformance/types/typeRelationships/typeInference/genericClassWithFunctionTypedMemberArguments.ts (4 errors) ==== @@ -68,20 +68,20 @@ tests/cases/conformance/types/typeRelationships/typeInference/genericClassWithFu var r10 = c.foo2(1, (x: T) => ''); // error ~~~~~~ !!! error TS2453: The type argument for type parameter 'T' cannot be inferred from the usage. Consider specifying the type arguments explicitly. -!!! error TS2453: Type argument candidate 'number' is not a valid type argument because it is not a supertype of candidate 'T'. +!!! error TS2453: Type argument candidate '1' is not a valid type argument because it is not a supertype of candidate 'T'. var r10 = c.foo2(1, (x) => ''); // string var r11 = c3.foo3(1, (x: T) => '', ''); // error ~~~~~~~ !!! error TS2453: The type argument for type parameter 'T' cannot be inferred from the usage. Consider specifying the type arguments explicitly. -!!! error TS2453: Type argument candidate 'number' is not a valid type argument because it is not a supertype of candidate 'T'. +!!! error TS2453: Type argument candidate '1' is not a valid type argument because it is not a supertype of candidate 'T'. var r11b = c3.foo3(1, (x: T) => '', 1); // error ~~~~~~~ !!! error TS2453: The type argument for type parameter 'T' cannot be inferred from the usage. Consider specifying the type arguments explicitly. -!!! error TS2453: Type argument candidate 'number' is not a valid type argument because it is not a supertype of candidate 'T'. +!!! error TS2453: Type argument candidate '1' is not a valid type argument because it is not a supertype of candidate 'T'. var r12 = c3.foo3(1, function (a) { return '' }, 1); // error ~~~~~~~ !!! error TS2453: The type argument for type parameter 'U' cannot be inferred from the usage. Consider specifying the type arguments explicitly. -!!! error TS2453: Type argument candidate 'number' is not a valid type argument because it is not a supertype of candidate 'string'. +!!! error TS2453: Type argument candidate '1' is not a valid type argument because it is not a supertype of candidate 'string'. } } \ No newline at end of file diff --git a/tests/baselines/reference/genericClassWithStaticFactory.types b/tests/baselines/reference/genericClassWithStaticFactory.types index 2daad9003eb..1c09fcd493e 100644 --- a/tests/baselines/reference/genericClassWithStaticFactory.types +++ b/tests/baselines/reference/genericClassWithStaticFactory.types @@ -109,9 +109,9 @@ module Editor { >next : List for (i = 0; !(entry.isHead); i++) { ->i = 0 : number +>i = 0 : 0 >i : number ->0 : number +>0 : 0 >!(entry.isHead) : boolean >(entry.isHead) : boolean >entry.isHead : boolean @@ -175,11 +175,11 @@ module Editor { >T : T entry.isHead = false; ->entry.isHead = false : boolean +>entry.isHead = false : false >entry.isHead : boolean >entry : List >isHead : boolean ->false : boolean +>false : false entry.next = this.next; >entry.next = this.next : List @@ -237,11 +237,11 @@ module Editor { >data : T entry.isHead = false; ->entry.isHead = false : boolean +>entry.isHead = false : false >entry.isHead : boolean >entry : List >isHead : boolean ->false : boolean +>false : false entry.next = this.next; >entry.next = this.next : List @@ -317,11 +317,11 @@ module Editor { >T : T entry.isHead = false; ->entry.isHead = false : boolean +>entry.isHead = false : false >entry.isHead : boolean >entry : List >isHead : boolean ->false : boolean +>false : false this.prev.next = entry; >this.prev.next = entry : List @@ -501,7 +501,7 @@ module Editor { >new List(true, null) : List >List : typeof List >T : T ->true : boolean +>true : true >null : null entry.prev = entry; @@ -537,7 +537,7 @@ module Editor { >new List(false, data) : List >List : typeof List >T : T ->false : boolean +>false : false >data : T entry.prev = entry; diff --git a/tests/baselines/reference/genericCloduleInModule.types b/tests/baselines/reference/genericCloduleInModule.types index 3ae3a8cf06d..97ef24ff49b 100644 --- a/tests/baselines/reference/genericCloduleInModule.types +++ b/tests/baselines/reference/genericCloduleInModule.types @@ -17,7 +17,7 @@ module A { export var x = 1; >x : number ->1 : number +>1 : 1 } } diff --git a/tests/baselines/reference/genericConstructInvocationWithNoTypeArg.errors.txt b/tests/baselines/reference/genericConstructInvocationWithNoTypeArg.errors.txt index f155140f4dc..5a4f710ed6d 100644 --- a/tests/baselines/reference/genericConstructInvocationWithNoTypeArg.errors.txt +++ b/tests/baselines/reference/genericConstructInvocationWithNoTypeArg.errors.txt @@ -1,4 +1,4 @@ -tests/cases/compiler/genericConstructInvocationWithNoTypeArg.ts(4,27): error TS2304: Cannot find name 'Foo'. +tests/cases/compiler/genericConstructInvocationWithNoTypeArg.ts(4,27): error TS2693: 'Foo' only refers to a type, but is being used as a value here. ==== tests/cases/compiler/genericConstructInvocationWithNoTypeArg.ts (1 errors) ==== @@ -7,5 +7,5 @@ tests/cases/compiler/genericConstructInvocationWithNoTypeArg.ts(4,27): error TS2 } var f2: Foo = new Foo(3); ~~~ -!!! error TS2304: Cannot find name 'Foo'. +!!! error TS2693: 'Foo' only refers to a type, but is being used as a value here. \ No newline at end of file diff --git a/tests/baselines/reference/genericConstructSignatureInInterface.types b/tests/baselines/reference/genericConstructSignatureInInterface.types index c6653a0d90d..d1d7646e945 100644 --- a/tests/baselines/reference/genericConstructSignatureInInterface.types +++ b/tests/baselines/reference/genericConstructSignatureInInterface.types @@ -16,5 +16,5 @@ var r = new v(1); >r : any >new v(1) : any >v : C ->1 : number +>1 : 1 diff --git a/tests/baselines/reference/genericContextualTypingSpecialization.types b/tests/baselines/reference/genericContextualTypingSpecialization.types index 561370a6a32..82255020347 100644 --- a/tests/baselines/reference/genericContextualTypingSpecialization.types +++ b/tests/baselines/reference/genericContextualTypingSpecialization.types @@ -13,5 +13,5 @@ b.reduce((c, d) => c + d, 0); // should not error on '+' >c + d : number >c : number >d : number ->0 : number +>0 : 0 diff --git a/tests/baselines/reference/genericFunctions0.types b/tests/baselines/reference/genericFunctions0.types index aac759af092..58256739dd4 100644 --- a/tests/baselines/reference/genericFunctions0.types +++ b/tests/baselines/reference/genericFunctions0.types @@ -10,5 +10,5 @@ var x = foo(5); // 'x' should be number >x : number >foo(5) : number >foo : (x: T) => T ->5 : number +>5 : 5 diff --git a/tests/baselines/reference/genericFunctions1.types b/tests/baselines/reference/genericFunctions1.types index 602ee6b81a4..cd649a2177d 100644 --- a/tests/baselines/reference/genericFunctions1.types +++ b/tests/baselines/reference/genericFunctions1.types @@ -8,7 +8,7 @@ function foo (x: T) { return x; } var x = foo(5); // 'x' should be number >x : number ->foo(5) : number +>foo(5) : 5 >foo : (x: T) => T ->5 : number +>5 : 5 diff --git a/tests/baselines/reference/genericFunctionsWithOptionalParameters3.types b/tests/baselines/reference/genericFunctionsWithOptionalParameters3.types index 627181e5d05..133c5cc2063 100644 --- a/tests/baselines/reference/genericFunctionsWithOptionalParameters3.types +++ b/tests/baselines/reference/genericFunctionsWithOptionalParameters3.types @@ -65,7 +65,7 @@ var r3 = utils.mapReduce(c, (x) => { return 1 }, (y) => { return new Date() }); >c : Collection >(x) => { return 1 } : (x: string) => number >x : string ->1 : number +>1 : 1 >(y) => { return new Date() } : (y: number) => Date >y : number >new Date() : Date @@ -80,7 +80,7 @@ var r4 = utils.mapReduce(c, (x: string) => { return 1 }, (y: number) => { return >c : Collection >(x: string) => { return 1 } : (x: string) => number >x : string ->1 : number +>1 : 1 >(y: number) => { return new Date() } : (y: number) => Date >y : number >new Date() : Date @@ -90,7 +90,7 @@ var f1 = (x: string) => { return 1 }; >f1 : (x: string) => number >(x: string) => { return 1 } : (x: string) => number >x : string ->1 : number +>1 : 1 var f2 = (y: number) => { return new Date() }; >f2 : (y: number) => Date diff --git a/tests/baselines/reference/genericFunduleInModule.errors.txt b/tests/baselines/reference/genericFunduleInModule.errors.txt index 752517667b0..c3c9f024744 100644 --- a/tests/baselines/reference/genericFunduleInModule.errors.txt +++ b/tests/baselines/reference/genericFunduleInModule.errors.txt @@ -1,4 +1,4 @@ -tests/cases/compiler/genericFunduleInModule.ts(8,10): error TS2305: Module 'A' has no exported member 'B'. +tests/cases/compiler/genericFunduleInModule.ts(8,10): error TS2694: Namespace 'A' has no exported member 'B'. ==== tests/cases/compiler/genericFunduleInModule.ts (1 errors) ==== @@ -11,5 +11,5 @@ tests/cases/compiler/genericFunduleInModule.ts(8,10): error TS2305: Module 'A' h var b: A.B; ~ -!!! error TS2305: Module 'A' has no exported member 'B'. +!!! error TS2694: Namespace 'A' has no exported member 'B'. A.B(1); \ No newline at end of file diff --git a/tests/baselines/reference/genericFunduleInModule2.errors.txt b/tests/baselines/reference/genericFunduleInModule2.errors.txt index 156549e8190..3184d02f723 100644 --- a/tests/baselines/reference/genericFunduleInModule2.errors.txt +++ b/tests/baselines/reference/genericFunduleInModule2.errors.txt @@ -1,4 +1,4 @@ -tests/cases/compiler/genericFunduleInModule2.ts(11,10): error TS2305: Module 'A' has no exported member 'B'. +tests/cases/compiler/genericFunduleInModule2.ts(11,10): error TS2694: Namespace 'A' has no exported member 'B'. ==== tests/cases/compiler/genericFunduleInModule2.ts (1 errors) ==== @@ -14,5 +14,5 @@ tests/cases/compiler/genericFunduleInModule2.ts(11,10): error TS2305: Module 'A' var b: A.B; ~ -!!! error TS2305: Module 'A' has no exported member 'B'. +!!! error TS2694: Namespace 'A' has no exported member 'B'. A.B(1); \ No newline at end of file diff --git a/tests/baselines/reference/genericInference1.types b/tests/baselines/reference/genericInference1.types index eeed8aa9f3e..30b7279ebc0 100644 --- a/tests/baselines/reference/genericInference1.types +++ b/tests/baselines/reference/genericInference1.types @@ -3,9 +3,9 @@ >['a', 'b', 'c'].map(x => x.length) : number[] >['a', 'b', 'c'].map : (callbackfn: (value: string, index: number, array: string[]) => U, thisArg?: any) => U[] >['a', 'b', 'c'] : string[] ->'a' : string ->'b' : string ->'c' : string +>'a' : "a" +>'b' : "b" +>'c' : "c" >map : (callbackfn: (value: string, index: number, array: string[]) => U, thisArg?: any) => U[] >x => x.length : (x: string) => number >x : string diff --git a/tests/baselines/reference/genericInference2.types b/tests/baselines/reference/genericInference2.types index e5c7052b0db..54006dba419 100644 --- a/tests/baselines/reference/genericInference2.types +++ b/tests/baselines/reference/genericInference2.types @@ -41,7 +41,7 @@ >ko.observable : (value: T) => ko.Observable >ko : typeof ko >observable : (value: T) => ko.Observable ->"Bob" : string +>"Bob" : "Bob" age: ko.observable(37) >age : ko.Observable @@ -49,7 +49,7 @@ >ko.observable : (value: T) => ko.Observable >ko : typeof ko >observable : (value: T) => ko.Observable ->37 : number +>37 : 37 }; var x_v = o.name().length; // should be 'number' @@ -74,7 +74,7 @@ >o.name : ko.Observable >o : { name: ko.Observable; age: ko.Observable; } >name : ko.Observable ->"Robert" : string +>"Robert" : "Robert" var zz_v = o.name.N; // should be 'number' >zz_v : number diff --git a/tests/baselines/reference/genericMethodOverspecialization.types b/tests/baselines/reference/genericMethodOverspecialization.types index 375eefaa86c..268943a9723 100644 --- a/tests/baselines/reference/genericMethodOverspecialization.types +++ b/tests/baselines/reference/genericMethodOverspecialization.types @@ -2,11 +2,11 @@ var names = ["list", "table1", "table2", "table3", "summary"]; >names : string[] >["list", "table1", "table2", "table3", "summary"] : string[] ->"list" : string ->"table1" : string ->"table2" : string ->"table3" : string ->"summary" : string +>"list" : "list" +>"table1" : "table1" +>"table2" : "table2" +>"table3" : "table3" +>"summary" : "summary" interface HTMLElement { >HTMLElement : HTMLElement diff --git a/tests/baselines/reference/genericNewInterface.errors.txt b/tests/baselines/reference/genericNewInterface.errors.txt index f489b72c1b6..7754d5749fd 100644 --- a/tests/baselines/reference/genericNewInterface.errors.txt +++ b/tests/baselines/reference/genericNewInterface.errors.txt @@ -1,12 +1,12 @@ -tests/cases/compiler/genericNewInterface.ts(2,21): error TS2345: Argument of type 'number' is not assignable to parameter of type 'string'. -tests/cases/compiler/genericNewInterface.ts(10,21): error TS2345: Argument of type 'number' is not assignable to parameter of type 'string'. +tests/cases/compiler/genericNewInterface.ts(2,21): error TS2345: Argument of type '42' is not assignable to parameter of type 'string'. +tests/cases/compiler/genericNewInterface.ts(10,21): error TS2345: Argument of type '1024' is not assignable to parameter of type 'string'. ==== tests/cases/compiler/genericNewInterface.ts (2 errors) ==== function createInstance(ctor: new (s: string) => T): T { return new ctor(42); //should be an error ~~ -!!! error TS2345: Argument of type 'number' is not assignable to parameter of type 'string'. +!!! error TS2345: Argument of type '42' is not assignable to parameter of type 'string'. } interface INewable { @@ -16,5 +16,5 @@ tests/cases/compiler/genericNewInterface.ts(10,21): error TS2345: Argument of ty function createInstance2(ctor: INewable): T { return new ctor(1024); //should be an error ~~~~ -!!! error TS2345: Argument of type 'number' is not assignable to parameter of type 'string'. +!!! error TS2345: Argument of type '1024' is not assignable to parameter of type 'string'. } \ No newline at end of file diff --git a/tests/baselines/reference/genericObjectLitReturnType.types b/tests/baselines/reference/genericObjectLitReturnType.types index 6bdc352cbc7..0b54e9f8e35 100644 --- a/tests/baselines/reference/genericObjectLitReturnType.types +++ b/tests/baselines/reference/genericObjectLitReturnType.types @@ -23,13 +23,13 @@ var t1 = x.f(5); >x.f : (t: number) => { a: number; } >x : X >f : (t: number) => { a: number; } ->5 : number +>5 : 5 t1.a = 5; // Should not error: t1 should have type {a: number}, instead has type {a: T} ->t1.a = 5 : number +>t1.a = 5 : 5 >t1.a : number >t1 : { a: number; } >a : number ->5 : number +>5 : 5 diff --git a/tests/baselines/reference/genericRecursiveImplicitConstructorErrors2.types b/tests/baselines/reference/genericRecursiveImplicitConstructorErrors2.types index 2f62a20c415..834f071659e 100644 --- a/tests/baselines/reference/genericRecursiveImplicitConstructorErrors2.types +++ b/tests/baselines/reference/genericRecursiveImplicitConstructorErrors2.types @@ -15,10 +15,10 @@ module TypeScript2 { >PullSymbolVisibility : PullSymbolVisibility Private, ->Private : PullSymbolVisibility +>Private : PullSymbolVisibility.Private Public ->Public : PullSymbolVisibility +>Public : PullSymbolVisibility.Public }   export class PullSymbol { diff --git a/tests/baselines/reference/genericRestArgs.errors.txt b/tests/baselines/reference/genericRestArgs.errors.txt index 8a977452958..2297277fe8d 100644 --- a/tests/baselines/reference/genericRestArgs.errors.txt +++ b/tests/baselines/reference/genericRestArgs.errors.txt @@ -1,9 +1,9 @@ tests/cases/compiler/genericRestArgs.ts(2,12): error TS2453: The type argument for type parameter 'T' cannot be inferred from the usage. Consider specifying the type arguments explicitly. - Type argument candidate 'number' is not a valid type argument because it is not a supertype of candidate 'string'. -tests/cases/compiler/genericRestArgs.ts(5,34): error TS2345: Argument of type 'string' is not assignable to parameter of type 'number'. + Type argument candidate '1' is not a valid type argument because it is not a supertype of candidate '""'. +tests/cases/compiler/genericRestArgs.ts(5,34): error TS2345: Argument of type '""' is not assignable to parameter of type 'number'. tests/cases/compiler/genericRestArgs.ts(10,12): error TS2453: The type argument for type parameter 'T' cannot be inferred from the usage. Consider specifying the type arguments explicitly. - Type argument candidate 'number' is not a valid type argument because it is not a supertype of candidate 'string'. -tests/cases/compiler/genericRestArgs.ts(12,30): error TS2345: Argument of type 'number' is not assignable to parameter of type 'any[]'. + Type argument candidate '1' is not a valid type argument because it is not a supertype of candidate '""'. +tests/cases/compiler/genericRestArgs.ts(12,30): error TS2345: Argument of type '1' is not assignable to parameter of type 'any[]'. ==== tests/cases/compiler/genericRestArgs.ts (4 errors) ==== @@ -11,12 +11,12 @@ tests/cases/compiler/genericRestArgs.ts(12,30): error TS2345: Argument of type ' var a1Ga = makeArrayG(1, ""); // no error ~~~~~~~~~~ !!! error TS2453: The type argument for type parameter 'T' cannot be inferred from the usage. Consider specifying the type arguments explicitly. -!!! error TS2453: Type argument candidate 'number' is not a valid type argument because it is not a supertype of candidate 'string'. +!!! error TS2453: Type argument candidate '1' is not a valid type argument because it is not a supertype of candidate '""'. var a1Gb = makeArrayG(1, ""); var a1Gc = makeArrayG(1, ""); var a1Gd = makeArrayG(1, ""); // error ~~ -!!! error TS2345: Argument of type 'string' is not assignable to parameter of type 'number'. +!!! error TS2345: Argument of type '""' is not assignable to parameter of type 'number'. function makeArrayGOpt(item1?: T, item2?: T, item3?: T) { return [item1, item2, item3]; @@ -24,8 +24,8 @@ tests/cases/compiler/genericRestArgs.ts(12,30): error TS2345: Argument of type ' var a2Ga = makeArrayGOpt(1, ""); ~~~~~~~~~~~~~ !!! error TS2453: The type argument for type parameter 'T' cannot be inferred from the usage. Consider specifying the type arguments explicitly. -!!! error TS2453: Type argument candidate 'number' is not a valid type argument because it is not a supertype of candidate 'string'. +!!! error TS2453: Type argument candidate '1' is not a valid type argument because it is not a supertype of candidate '""'. var a2Gb = makeArrayG(1, ""); var a2Gc = makeArrayG(1, ""); // error ~ -!!! error TS2345: Argument of type 'number' is not assignable to parameter of type 'any[]'. \ No newline at end of file +!!! error TS2345: Argument of type '1' is not assignable to parameter of type 'any[]'. \ No newline at end of file diff --git a/tests/baselines/reference/genericReversingTypeParameters.types b/tests/baselines/reference/genericReversingTypeParameters.types index 524a2ebba03..daab3c0248f 100644 --- a/tests/baselines/reference/genericReversingTypeParameters.types +++ b/tests/baselines/reference/genericReversingTypeParameters.types @@ -36,7 +36,7 @@ var r1 = b.get(''); >b.get : (key: string) => number >b : BiMap >get : (key: string) => number ->'' : string +>'' : "" var i = b.inverse(); // used to get the type wrong here. >i : BiMap @@ -51,5 +51,5 @@ var r2b = i.get(1); >i.get : (key: number) => string >i : BiMap >get : (key: number) => string ->1 : number +>1 : 1 diff --git a/tests/baselines/reference/genericReversingTypeParameters2.types b/tests/baselines/reference/genericReversingTypeParameters2.types index 28c1f40ce9f..d64c135cf20 100644 --- a/tests/baselines/reference/genericReversingTypeParameters2.types +++ b/tests/baselines/reference/genericReversingTypeParameters2.types @@ -43,5 +43,5 @@ var r2b = i.get(1); >i.get : (key: number) => string >i : BiMap >get : (key: number) => string ->1 : number +>1 : 1 diff --git a/tests/baselines/reference/genericStaticAnyTypeFunction.types b/tests/baselines/reference/genericStaticAnyTypeFunction.types index 38b3c3708e7..3a6a182b08a 100644 --- a/tests/baselines/reference/genericStaticAnyTypeFunction.types +++ b/tests/baselines/reference/genericStaticAnyTypeFunction.types @@ -16,7 +16,7 @@ class A { } static goo() { return 0; } >goo : () => number ->0 : number +>0 : 0 static two(source: T): T { >two : (source: T) => T @@ -32,7 +32,7 @@ class A { >one : (source: T, value: number) => T >T : T >source : T ->42 : number +>42 : 42 } diff --git a/tests/baselines/reference/genericTypeAliases.types b/tests/baselines/reference/genericTypeAliases.types index 929ecf7d7e1..1cabaa8caa0 100644 --- a/tests/baselines/reference/genericTypeAliases.types +++ b/tests/baselines/reference/genericTypeAliases.types @@ -21,7 +21,7 @@ var tree: Tree = { left: 0, >left : number ->0 : number +>0 : 0 right: { >right : { left: number; right: number; } @@ -29,17 +29,17 @@ var tree: Tree = { left: 1, >left : number ->1 : number +>1 : 1 right: 2 >right : number ->2 : number +>2 : 2 }, }, right: 3 >right : number ->3 : number +>3 : 3 }; @@ -54,15 +54,15 @@ var ls: Lazy; >Lazy : Lazy ls = "eager"; ->ls = "eager" : string +>ls = "eager" : "eager" >ls : Lazy ->"eager" : string +>"eager" : "eager" ls = () => "lazy"; >ls = () => "lazy" : () => string >ls : Lazy >() => "lazy" : () => string ->"lazy" : string +>"lazy" : "lazy" type Foo = T | { x: Foo }; >Foo : Foo @@ -100,16 +100,16 @@ y = x; >x : Foo x = "string"; ->x = "string" : string +>x = "string" : "string" >x : Foo ->"string" : string +>"string" : "string" x = { x: "hello" }; >x = { x: "hello" } : { x: string; } >x : Foo >{ x: "hello" } : { x: string; } >x : string ->"hello" : string +>"hello" : "hello" x = { x: { x: "world" } }; >x = { x: { x: "world" } } : { x: { x: string; }; } @@ -118,23 +118,23 @@ x = { x: { x: "world" } }; >x : { x: string; } >{ x: "world" } : { x: string; } >x : string ->"world" : string +>"world" : "world" var z: Foo; >z : Foo >Foo : Foo z = 42; ->z = 42 : number +>z = 42 : 42 >z : Foo ->42 : number +>42 : 42 z = { x: 42 }; >z = { x: 42 } : { x: number; } >z : Foo >{ x: 42 } : { x: number; } >x : number ->42 : number +>42 : 42 z = { x: { x: 42 } }; >z = { x: { x: 42 } } : { x: { x: number; }; } @@ -143,7 +143,7 @@ z = { x: { x: 42 } }; >x : { x: number; } >{ x: 42 } : { x: number; } >x : number ->42 : number +>42 : 42 type Strange = string; // Type parameter not used >Strange : string @@ -154,9 +154,9 @@ var s: Strange; >Strange : string s = "hello"; ->s = "hello" : string +>s = "hello" : "hello" >s : string ->"hello" : string +>"hello" : "hello" interface Tuple { >Tuple : Tuple @@ -194,25 +194,25 @@ var p: TaggedPair; >TaggedPair : TaggedPair p.a = 1; ->p.a = 1 : number +>p.a = 1 : 1 >p.a : number >p : TaggedPair >a : number ->1 : number +>1 : 1 p.b = 2; ->p.b = 2 : number +>p.b = 2 : 2 >p.b : number >p : TaggedPair >b : number ->2 : number +>2 : 2 p.tag = "test"; ->p.tag = "test" : string +>p.tag = "test" : "test" >p.tag : string >p : TaggedPair >tag : string ->"test" : string +>"test" : "test" function f() { >f : () => Foo diff --git a/tests/baselines/reference/genericTypeArgumentInference1.types b/tests/baselines/reference/genericTypeArgumentInference1.types index 2d64c8f5c58..2dc6e51ff0f 100644 --- a/tests/baselines/reference/genericTypeArgumentInference1.types +++ b/tests/baselines/reference/genericTypeArgumentInference1.types @@ -47,11 +47,11 @@ var r = _.all([true, 1, null, 'yes'], _.identity); >_.all : (list: T[], iterator?: Underscore.Iterator, context?: any) => T >_ : Underscore.Static >all : (list: T[], iterator?: Underscore.Iterator, context?: any) => T ->[true, 1, null, 'yes'] : (string | number | boolean)[] ->true : boolean ->1 : number +>[true, 1, null, 'yes'] : (true | 1 | "yes")[] +>true : true +>1 : 1 >null : null ->'yes' : string +>'yes' : "yes" >_.identity : (value: T) => T >_ : Underscore.Static >identity : (value: T) => T @@ -62,8 +62,8 @@ var r2 = _.all([true], _.identity); >_.all : (list: T[], iterator?: Underscore.Iterator, context?: any) => T >_ : Underscore.Static >all : (list: T[], iterator?: Underscore.Iterator, context?: any) => T ->[true] : boolean[] ->true : boolean +>[true] : true[] +>true : true >_.identity : (value: T) => T >_ : Underscore.Static >identity : (value: T) => T @@ -87,7 +87,7 @@ var r4 = _.all([true], _.identity); >all : (list: T[], iterator?: Underscore.Iterator, context?: any) => T >[true] : any[] >true : any ->true : boolean +>true : true >_.identity : (value: T) => T >_ : Underscore.Static >identity : (value: T) => T diff --git a/tests/baselines/reference/genericTypeParameterEquivalence2.types b/tests/baselines/reference/genericTypeParameterEquivalence2.types index 44e495088bc..6ab297fe32c 100644 --- a/tests/baselines/reference/genericTypeParameterEquivalence2.types +++ b/tests/baselines/reference/genericTypeParameterEquivalence2.types @@ -49,7 +49,7 @@ function forEach(list: A[], f: (a: A, n?: number) => void ): void { for (var i = 0; i < list.length; ++i) { >i : number ->0 : number +>0 : 0 >i < list.length : boolean >i : number >list.length : number diff --git a/tests/baselines/reference/genericTypeReferenceWithoutTypeArgument2.errors.txt b/tests/baselines/reference/genericTypeReferenceWithoutTypeArgument2.errors.txt index b6767a3b938..7635608f58e 100644 --- a/tests/baselines/reference/genericTypeReferenceWithoutTypeArgument2.errors.txt +++ b/tests/baselines/reference/genericTypeReferenceWithoutTypeArgument2.errors.txt @@ -17,7 +17,7 @@ tests/cases/conformance/types/specifyingTypes/typeReferences/genericTypeReferenc tests/cases/conformance/types/specifyingTypes/typeReferences/genericTypeReferenceWithoutTypeArgument2.ts(23,21): error TS2314: Generic type 'I' requires 1 type argument(s). tests/cases/conformance/types/specifyingTypes/typeReferences/genericTypeReferenceWithoutTypeArgument2.ts(29,18): error TS2304: Cannot find name 'M'. tests/cases/conformance/types/specifyingTypes/typeReferences/genericTypeReferenceWithoutTypeArgument2.ts(30,24): error TS2314: Generic type 'E' requires 1 type argument(s). -tests/cases/conformance/types/specifyingTypes/typeReferences/genericTypeReferenceWithoutTypeArgument2.ts(31,24): error TS2305: Module 'M' has no exported member 'C'. +tests/cases/conformance/types/specifyingTypes/typeReferences/genericTypeReferenceWithoutTypeArgument2.ts(31,24): error TS2694: Namespace 'M' has no exported member 'C'. tests/cases/conformance/types/specifyingTypes/typeReferences/genericTypeReferenceWithoutTypeArgument2.ts(33,22): error TS2314: Generic type 'I' requires 1 type argument(s). tests/cases/conformance/types/specifyingTypes/typeReferences/genericTypeReferenceWithoutTypeArgument2.ts(34,22): error TS2314: Generic type 'E' requires 1 type argument(s). tests/cases/conformance/types/specifyingTypes/typeReferences/genericTypeReferenceWithoutTypeArgument2.ts(36,10): error TS2304: Cannot find name 'C'. @@ -95,7 +95,7 @@ tests/cases/conformance/types/specifyingTypes/typeReferences/genericTypeReferenc !!! error TS2314: Generic type 'E' requires 1 type argument(s). interface I2 extends M.C { } ~ -!!! error TS2305: Module 'M' has no exported member 'C'. +!!! error TS2694: Namespace 'M' has no exported member 'C'. function h(x: T) { } ~ diff --git a/tests/baselines/reference/genericWithCallSignatureReturningSpecialization.types b/tests/baselines/reference/genericWithCallSignatureReturningSpecialization.types index c58d56e3a75..b314839a97e 100644 --- a/tests/baselines/reference/genericWithCallSignatureReturningSpecialization.types +++ b/tests/baselines/reference/genericWithCallSignatureReturningSpecialization.types @@ -18,5 +18,5 @@ var x: B; x(true); // was error >x(true) : void >x : B ->true : boolean +>true : true diff --git a/tests/baselines/reference/genericWithIndexerOfTypeParameterType1.types b/tests/baselines/reference/genericWithIndexerOfTypeParameterType1.types index a316773e5c8..c7c11a42743 100644 --- a/tests/baselines/reference/genericWithIndexerOfTypeParameterType1.types +++ b/tests/baselines/reference/genericWithIndexerOfTypeParameterType1.types @@ -31,5 +31,5 @@ var value: string = lazyArray.array()["test"]; // used to be an error >lazyArray.array : () => { [objectId: string]: string; } >lazyArray : LazyArray >array : () => { [objectId: string]: string; } ->"test" : string +>"test" : "test" diff --git a/tests/baselines/reference/genericWithOpenTypeParameters1.errors.txt b/tests/baselines/reference/genericWithOpenTypeParameters1.errors.txt index 98db4282244..ba9ec881f99 100644 --- a/tests/baselines/reference/genericWithOpenTypeParameters1.errors.txt +++ b/tests/baselines/reference/genericWithOpenTypeParameters1.errors.txt @@ -1,4 +1,4 @@ -tests/cases/compiler/genericWithOpenTypeParameters1.ts(7,40): error TS2345: Argument of type 'number' is not assignable to parameter of type 'T'. +tests/cases/compiler/genericWithOpenTypeParameters1.ts(7,40): error TS2345: Argument of type '1' is not assignable to parameter of type 'T'. tests/cases/compiler/genericWithOpenTypeParameters1.ts(8,35): error TS2346: Supplied parameters do not match any signature of call target. tests/cases/compiler/genericWithOpenTypeParameters1.ts(9,35): error TS2346: Supplied parameters do not match any signature of call target. @@ -12,7 +12,7 @@ tests/cases/compiler/genericWithOpenTypeParameters1.ts(9,35): error TS2346: Supp x.foo(1); // no error var f = (x: B) => { return x.foo(1); } // error ~ -!!! error TS2345: Argument of type 'number' is not assignable to parameter of type 'T'. +!!! error TS2345: Argument of type '1' is not assignable to parameter of type 'T'. var f2 = (x: B) => { return x.foo(1); } // error ~~~~~~~~~~~ !!! error TS2346: Supplied parameters do not match any signature of call target. diff --git a/tests/baselines/reference/getSetAccessorContextualTyping.errors.txt b/tests/baselines/reference/getSetAccessorContextualTyping.errors.txt index 5b076b078c5..845a4011d9f 100644 --- a/tests/baselines/reference/getSetAccessorContextualTyping.errors.txt +++ b/tests/baselines/reference/getSetAccessorContextualTyping.errors.txt @@ -1,4 +1,4 @@ -tests/cases/conformance/expressions/contextualTyping/getSetAccessorContextualTyping.ts(8,16): error TS2322: Type 'string' is not assignable to type 'number'. +tests/cases/conformance/expressions/contextualTyping/getSetAccessorContextualTyping.ts(8,16): error TS2322: Type '"string"' is not assignable to type 'number'. ==== tests/cases/conformance/expressions/contextualTyping/getSetAccessorContextualTyping.ts (1 errors) ==== @@ -11,7 +11,7 @@ tests/cases/conformance/expressions/contextualTyping/getSetAccessorContextualTyp get X() { return "string"; // Error; get contextual type by set accessor parameter type annotation ~~~~~~~~ -!!! error TS2322: Type 'string' is not assignable to type 'number'. +!!! error TS2322: Type '"string"' is not assignable to type 'number'. } set Y(y) { } diff --git a/tests/baselines/reference/getterSetterNonAccessor.types b/tests/baselines/reference/getterSetterNonAccessor.types index 48d9f9c85e0..f5eb22296f3 100644 --- a/tests/baselines/reference/getterSetterNonAccessor.types +++ b/tests/baselines/reference/getterSetterNonAccessor.types @@ -1,7 +1,7 @@ === tests/cases/compiler/getterSetterNonAccessor.ts === function getFunc():any{return 0;} >getFunc : () => any ->0 : number +>0 : 0 function setFunc(v){} >setFunc : (v: any) => void @@ -13,11 +13,11 @@ Object.defineProperty({}, "0", ({ >Object : ObjectConstructor >defineProperty : (o: any, p: string, attributes: PropertyDescriptor) => any >{} : {} ->"0" : string +>"0" : "0" >({ get: getFunc, set: setFunc, configurable: true }) : PropertyDescriptor >PropertyDescriptor : PropertyDescriptor ->({ get: getFunc, set: setFunc, configurable: true }) : { get: () => any; set: (v: any) => void; configurable: boolean; } ->{ get: getFunc, set: setFunc, configurable: true } : { get: () => any; set: (v: any) => void; configurable: boolean; } +>({ get: getFunc, set: setFunc, configurable: true }) : { get: () => any; set: (v: any) => void; configurable: true; } +>{ get: getFunc, set: setFunc, configurable: true } : { get: () => any; set: (v: any) => void; configurable: true; } get: getFunc, >get : () => any @@ -29,7 +29,7 @@ Object.defineProperty({}, "0", ({ configurable: true >configurable : boolean ->true : boolean +>true : true })); diff --git a/tests/baselines/reference/global.types b/tests/baselines/reference/global.types index f866f062068..c56e039f230 100644 --- a/tests/baselines/reference/global.types +++ b/tests/baselines/reference/global.types @@ -15,13 +15,13 @@ module M { var x=10; >x : number ->10 : number +>10 : 10 M.f(3); >M.f(3) : number >M.f : (y: number) => number >M : typeof M >f : (y: number) => number ->3 : number +>3 : 3 diff --git a/tests/baselines/reference/globalIsContextualKeyword.types b/tests/baselines/reference/globalIsContextualKeyword.types index d0bf624af6d..371c05c2183 100644 --- a/tests/baselines/reference/globalIsContextualKeyword.types +++ b/tests/baselines/reference/globalIsContextualKeyword.types @@ -4,7 +4,7 @@ function a() { let global = 1; >global : number ->1 : number +>1 : 1 } function b() { >b : () => void @@ -28,5 +28,5 @@ let obj = { global: "123" >global : string ->"123" : string +>"123" : "123" } diff --git a/tests/baselines/reference/globalThisCapture.types b/tests/baselines/reference/globalThisCapture.types index b8ed146d8c4..063100ff78e 100644 --- a/tests/baselines/reference/globalThisCapture.types +++ b/tests/baselines/reference/globalThisCapture.types @@ -15,5 +15,5 @@ var parts = []; parts[0]; >parts[0] : any >parts : any[] ->0 : number +>0 : 0 diff --git a/tests/baselines/reference/grammarAmbiguities1.errors.txt b/tests/baselines/reference/grammarAmbiguities1.errors.txt index 12df5f3c1e0..8809c4aa334 100644 --- a/tests/baselines/reference/grammarAmbiguities1.errors.txt +++ b/tests/baselines/reference/grammarAmbiguities1.errors.txt @@ -1,6 +1,6 @@ tests/cases/compiler/grammarAmbiguities1.ts(8,1): error TS2346: Supplied parameters do not match any signature of call target. tests/cases/compiler/grammarAmbiguities1.ts(8,3): error TS2365: Operator '<' cannot be applied to types '(x: any) => any' and 'typeof A'. -tests/cases/compiler/grammarAmbiguities1.ts(8,10): error TS2365: Operator '>' cannot be applied to types 'typeof B' and 'number'. +tests/cases/compiler/grammarAmbiguities1.ts(8,10): error TS2365: Operator '>' cannot be applied to types 'typeof B' and '7'. tests/cases/compiler/grammarAmbiguities1.ts(9,1): error TS2346: Supplied parameters do not match any signature of call target. tests/cases/compiler/grammarAmbiguities1.ts(9,3): error TS2365: Operator '<' cannot be applied to types '(x: any) => any' and 'typeof A'. tests/cases/compiler/grammarAmbiguities1.ts(9,10): error TS2365: Operator '>' cannot be applied to types 'typeof B' and 'number'. @@ -20,7 +20,7 @@ tests/cases/compiler/grammarAmbiguities1.ts(9,10): error TS2365: Operator '>' ca ~~~~~ !!! error TS2365: Operator '<' cannot be applied to types '(x: any) => any' and 'typeof A'. ~~~~~ -!!! error TS2365: Operator '>' cannot be applied to types 'typeof B' and 'number'. +!!! error TS2365: Operator '>' cannot be applied to types 'typeof B' and '7'. f(g < A, B > +(7)); ~~~~~~~~~~~~~~~~~~ !!! error TS2346: Supplied parameters do not match any signature of call target. diff --git a/tests/baselines/reference/heterogeneousArrayLiterals.types b/tests/baselines/reference/heterogeneousArrayLiterals.types index 026e9c26bae..f1c5b6b8dfc 100644 --- a/tests/baselines/reference/heterogeneousArrayLiterals.types +++ b/tests/baselines/reference/heterogeneousArrayLiterals.types @@ -4,27 +4,27 @@ var a = [1, '']; // {}[] >a : (string | number)[] >[1, ''] : (string | number)[] ->1 : number ->'' : string +>1 : 1 +>'' : "" var b = [1, null]; // number[] >b : number[] >[1, null] : number[] ->1 : number +>1 : 1 >null : null var c = [1, '', null]; // {}[] >c : (string | number)[] >[1, '', null] : (string | number)[] ->1 : number ->'' : string +>1 : 1 +>'' : "" >null : null var d = [{}, 1]; // {}[] >d : {}[] >[{}, 1] : {}[] >{} : {} ->1 : number +>1 : 1 var e = [{}, Object]; // {}[] >e : {}[] @@ -37,61 +37,61 @@ var f = [[], [1]]; // number[][] >[[], [1]] : number[][] >[] : undefined[] >[1] : number[] ->1 : number +>1 : 1 var g = [[1], ['']]; // {}[] >g : (number[] | string[])[] >[[1], ['']] : (number[] | string[])[] >[1] : number[] ->1 : number +>1 : 1 >[''] : string[] ->'' : string +>'' : "" var h = [{ foo: 1, bar: '' }, { foo: 2 }]; // {foo: number}[] >h : ({ foo: number; bar: string; } | { foo: number; })[] >[{ foo: 1, bar: '' }, { foo: 2 }] : ({ foo: number; bar: string; } | { foo: number; })[] >{ foo: 1, bar: '' } : { foo: number; bar: string; } >foo : number ->1 : number +>1 : 1 >bar : string ->'' : string +>'' : "" >{ foo: 2 } : { foo: number; } >foo : number ->2 : number +>2 : 2 var i = [{ foo: 1, bar: '' }, { foo: '' }]; // {}[] >i : ({ foo: number; bar: string; } | { foo: string; })[] >[{ foo: 1, bar: '' }, { foo: '' }] : ({ foo: number; bar: string; } | { foo: string; })[] >{ foo: 1, bar: '' } : { foo: number; bar: string; } >foo : number ->1 : number +>1 : 1 >bar : string ->'' : string +>'' : "" >{ foo: '' } : { foo: string; } >foo : string ->'' : string +>'' : "" var j = [() => 1, () => '']; // {}[] >j : ((() => number) | (() => string))[] >[() => 1, () => ''] : ((() => number) | (() => string))[] >() => 1 : () => number ->1 : number +>1 : 1 >() => '' : () => string ->'' : string +>'' : "" var k = [() => 1, () => 1]; // { (): number }[] >k : (() => number)[] >[() => 1, () => 1] : (() => number)[] >() => 1 : () => number ->1 : number +>1 : 1 >() => 1 : () => number ->1 : number +>1 : 1 var l = [() => 1, () => null]; // { (): any }[] >l : (() => any)[] >[() => 1, () => null] : (() => any)[] >() => 1 : () => number ->1 : number +>1 : 1 >() => null : () => any >null : null @@ -99,9 +99,9 @@ var m = [() => 1, () => '', () => null]; // { (): any }[] >m : (() => any)[] >[() => 1, () => '', () => null] : (() => any)[] >() => 1 : () => number ->1 : number +>1 : 1 >() => '' : () => string ->'' : string +>'' : "" >() => null : () => any >null : null @@ -110,10 +110,10 @@ var n = [[() => 1], [() => '']]; // {}[] >[[() => 1], [() => '']] : ((() => number)[] | (() => string)[])[] >[() => 1] : (() => number)[] >() => 1 : () => number ->1 : number +>1 : 1 >[() => ''] : (() => string)[] >() => '' : () => string ->'' : string +>'' : "" class Base { foo: string; } >Base : Base @@ -182,7 +182,7 @@ module Derived { >() => base : () => Base >base : Base >() => 1 : () => number ->1 : number +>1 : 1 var l = [() => base, () => null]; // { (): any }[] >l : (() => any)[] @@ -299,7 +299,7 @@ function foo(t: T, u: U) { >d : (number | T)[] >[t, 1] : (number | T)[] >t : T ->1 : number +>1 : 1 var e = [() => t, () => u]; // {}[] >e : ((() => T) | (() => U))[] @@ -353,7 +353,7 @@ function foo2(t: T, u: U) { >d : (number | T)[] >[t, 1] : (number | T)[] >t : T ->1 : number +>1 : 1 var e = [() => t, () => u]; // {}[] >e : ((() => T) | (() => U))[] @@ -431,7 +431,7 @@ function foo3(t: T, u: U) { >d : (number | T)[] >[t, 1] : (number | T)[] >t : T ->1 : number +>1 : 1 var e = [() => t, () => u]; // {}[] >e : ((() => T) | (() => U))[] @@ -509,7 +509,7 @@ function foo4(t: T, u: U) { >d : (number | T)[] >[t, 1] : (number | T)[] >t : T ->1 : number +>1 : 1 var e = [() => t, () => u]; // {}[] >e : ((() => T) | (() => U))[] diff --git a/tests/baselines/reference/hidingCallSignatures.types b/tests/baselines/reference/hidingCallSignatures.types index c45cab69d8a..87285361f99 100644 --- a/tests/baselines/reference/hidingCallSignatures.types +++ b/tests/baselines/reference/hidingCallSignatures.types @@ -36,12 +36,12 @@ var d: D; d(""); // number >d("") : number >d : D ->"" : string +>"" : "" new d(""); // should be string >new d("") : string >d : D ->"" : string +>"" : "" var f: F; >f : F @@ -50,7 +50,7 @@ var f: F; f(""); // string >f("") : string >f : F ->"" : string +>"" : "" var e: E; >e : E @@ -59,5 +59,5 @@ var e: E; e(""); // {} >e("") : {} >e : E ->"" : string +>"" : "" diff --git a/tests/baselines/reference/hidingConstructSignatures.types b/tests/baselines/reference/hidingConstructSignatures.types index 0fd9860de25..7432732277f 100644 --- a/tests/baselines/reference/hidingConstructSignatures.types +++ b/tests/baselines/reference/hidingConstructSignatures.types @@ -36,12 +36,12 @@ var d: D; d(""); // string >d("") : string >d : D ->"" : string +>"" : "" new d(""); // should be number >new d("") : number >d : D ->"" : string +>"" : "" var f: F; >f : F @@ -50,7 +50,7 @@ var f: F; new f(""); // string >new f("") : string >f : F ->"" : string +>"" : "" var e: E; >e : E @@ -59,5 +59,5 @@ var e: E; new e(""); // {} >new e("") : {} >e : E ->"" : string +>"" : "" diff --git a/tests/baselines/reference/hidingIndexSignatures.types b/tests/baselines/reference/hidingIndexSignatures.types index 9a6346ace7b..a6609aa75c8 100644 --- a/tests/baselines/reference/hidingIndexSignatures.types +++ b/tests/baselines/reference/hidingIndexSignatures.types @@ -21,7 +21,7 @@ var b: B; b[""]; // Should be number >b[""] : number >b : B ->"" : string +>"" : "" var a: A; >a : A @@ -30,5 +30,5 @@ var a: A; a[""]; // Should be {} >a[""] : {} >a : A ->"" : string +>"" : "" diff --git a/tests/baselines/reference/ifDoWhileStatements.types b/tests/baselines/reference/ifDoWhileStatements.types index 660eaa4fb63..eee459391c5 100644 --- a/tests/baselines/reference/ifDoWhileStatements.types +++ b/tests/baselines/reference/ifDoWhileStatements.types @@ -49,14 +49,14 @@ class D{ function F(x: string): number { return 42; } >F : (x: string) => number >x : string ->42 : number +>42 : 42 function F2(x: number): boolean { return x < 42; } >F2 : (x: number) => boolean >x : number >x < 42 : boolean >x : number ->42 : number +>42 : 42 module M { >M : typeof M @@ -98,13 +98,13 @@ module N { // literals if (true) { } ->true : boolean +>true : true while (true) { } ->true : boolean +>true : true do { }while(true) ->true : boolean +>true : true if (null) { } >null : null @@ -125,31 +125,31 @@ do { }while(undefined) >undefined : undefined if (0.0) { } ->0.0 : number +>0.0 : 0 while (0.0) { } ->0.0 : number +>0.0 : 0 do { }while(0.0) ->0.0 : number +>0.0 : 0 if ('a string') { } ->'a string' : string +>'a string' : "a string" while ('a string') { } ->'a string' : string +>'a string' : "a string" do { }while('a string') ->'a string' : string +>'a string' : "a string" if ('') { } ->'' : string +>'' : "" while ('') { } ->'' : string +>'' : "" do { }while('') ->'' : string +>'' : "" if (/[a-z]/) { } >/[a-z]/ : RegExp @@ -171,18 +171,18 @@ do { }while([]) if ([1, 2]) { } >[1, 2] : number[] ->1 : number ->2 : number +>1 : 1 +>2 : 2 while ([1, 2]) { } >[1, 2] : number[] ->1 : number ->2 : number +>1 : 1 +>2 : 2 do { }while([1, 2]) >[1, 2] : number[] ->1 : number ->2 : number +>1 : 1 +>2 : 2 if ({}) { } >{} : {} @@ -196,35 +196,35 @@ do { }while({}) if ({ x: 1, y: 'a' }) { } >{ x: 1, y: 'a' } : { x: number; y: string; } >x : number ->1 : number +>1 : 1 >y : string ->'a' : string +>'a' : "a" while ({ x: 1, y: 'a' }) { } >{ x: 1, y: 'a' } : { x: number; y: string; } >x : number ->1 : number +>1 : 1 >y : string ->'a' : string +>'a' : "a" do { }while({ x: 1, y: 'a' }) >{ x: 1, y: 'a' } : { x: number; y: string; } >x : number ->1 : number +>1 : 1 >y : string ->'a' : string +>'a' : "a" if (() => 43) { } >() => 43 : () => number ->43 : number +>43 : 43 while (() => 43) { } >() => 43 : () => number ->43 : number +>43 : 43 do { }while(() => 43) >() => 43 : () => number ->43 : number +>43 : 43 if (new C()) { } >new C() : C @@ -256,7 +256,7 @@ do { }while(new D()) // references var a = true; >a : boolean ->true : boolean +>true : true if (a) { } >a : boolean @@ -295,7 +295,7 @@ do { }while(c) var d = 0.0; >d : number ->0.0 : number +>0.0 : 0 if (d) { } >d : number @@ -308,7 +308,7 @@ do { }while(d) var e = 'a string'; >e : string ->'a string' : string +>'a string' : "a string" if (e) { } >e : string @@ -321,7 +321,7 @@ do { }while(e) var f = ''; >f : string ->'' : string +>'' : "" if (f) { } >f : string @@ -361,8 +361,8 @@ do { }while(h) var i = [1, 2]; >i : number[] >[1, 2] : number[] ->1 : number ->2 : number +>1 : 1 +>2 : 2 if (i) { } >i : number[] @@ -390,9 +390,9 @@ var k = { x: 1, y: 'a' }; >k : { x: number; y: string; } >{ x: 1, y: 'a' } : { x: number; y: string; } >x : number ->1 : number +>1 : 1 >y : string ->'a' : string +>'a' : "a" if (k) { } >k : { x: number; y: string; } diff --git a/tests/baselines/reference/implicitAnyAnyReturningFunction.types b/tests/baselines/reference/implicitAnyAnyReturningFunction.types index 66f9cf49cb0..73b90b76a0b 100644 --- a/tests/baselines/reference/implicitAnyAnyReturningFunction.types +++ b/tests/baselines/reference/implicitAnyAnyReturningFunction.types @@ -4,7 +4,7 @@ function A() { return ""; >"" : any ->"" : string +>"" : "" } function B() { @@ -26,7 +26,7 @@ class C { return ""; >"" : any ->"" : string +>"" : "" } public B() { diff --git a/tests/baselines/reference/implicitAnyGenerics.types b/tests/baselines/reference/implicitAnyGenerics.types index e335c958fe9..2d43ecbbdbe 100644 --- a/tests/baselines/reference/implicitAnyGenerics.types +++ b/tests/baselines/reference/implicitAnyGenerics.types @@ -49,20 +49,20 @@ var d2 = new D(1); >d2 : D >new D(1) : D >D : typeof D ->1 : number +>1 : 1 var d3 = new D(1); >d3 : D >new D(1) : D >D : typeof D ->1 : number +>1 : 1 var d4 = new D(1); >d4 : D >new D(1) : D >D : typeof D >1 : any ->1 : number +>1 : 1 var d5: D = new D(null); >d5 : D diff --git a/tests/baselines/reference/implicitAnyInCatch.types b/tests/baselines/reference/implicitAnyInCatch.types index 6dda46fd3ca..d2a1be4a910 100644 --- a/tests/baselines/reference/implicitAnyInCatch.types +++ b/tests/baselines/reference/implicitAnyInCatch.types @@ -9,7 +9,7 @@ try { } catch (error) { >error : any >number : any >-2147024809 : -2147024809 ->2147024809 : number +>2147024809 : 2147024809 } for (var key in this) { } >key : string diff --git a/tests/baselines/reference/implicitIndexSignatures.types b/tests/baselines/reference/implicitIndexSignatures.types index 6d670c6341b..ac8da0c7b6c 100644 --- a/tests/baselines/reference/implicitIndexSignatures.types +++ b/tests/baselines/reference/implicitIndexSignatures.types @@ -14,9 +14,9 @@ const names1 = { a: "foo", b: "bar" }; >names1 : { a: string; b: string; } >{ a: "foo", b: "bar" } : { a: string; b: string; } >a : string ->"foo" : string +>"foo" : "foo" >b : string ->"bar" : string +>"bar" : "bar" let names2: { a: string, b: string }; >names2 : { a: string; b: string; } @@ -32,9 +32,9 @@ map = { x: "xxx", y: "yyy" }; >map : { [x: string]: string; } >{ x: "xxx", y: "yyy" } : { x: string; y: string; } >x : string ->"xxx" : string +>"xxx" : "xxx" >y : string ->"yyy" : string +>"yyy" : "yyy" map = empty1; >map = empty1 : {} @@ -79,9 +79,9 @@ function f1() { >o1 : { a: number; b: number; } >{ a: 1, b: 2 } : { a: number; b: number; } >a : number ->1 : number +>1 : 1 >b : number ->2 : number +>2 : 2 let o2: { a: number, b: number }; >o2 : { a: number; b: number; } @@ -108,9 +108,9 @@ function f2() { >o1 : { a: string; b: string; } >{ a: "1", b: "2" } : { a: string; b: string; } >a : string ->"1" : string +>"1" : "1" >b : string ->"2" : string +>"2" : "2" let o2: { a: string, b: string }; >o2 : { a: string; b: string; } @@ -137,9 +137,9 @@ function f3() { >o1 : { a: number; b: string; } >{ a: 1, b: "2" } : { a: number; b: string; } >a : number ->1 : number +>1 : 1 >b : string ->"2" : string +>"2" : "2" let o2: { a: number, b: string }; >o2 : { a: number; b: string; } @@ -165,10 +165,10 @@ function f4() { const o1 = { 0: "0", 1: "1", count: 2 }; >o1 : { 0: string; 1: string; count: number; } >{ 0: "0", 1: "1", count: 2 } : { 0: string; 1: string; count: number; } ->"0" : string ->"1" : string +>"0" : "0" +>"1" : "1" >count : number ->2 : number +>2 : 2 let o2: { 0: string, 1: string, count: number }; >o2 : { 0: string; 1: string; count: number; } diff --git a/tests/baselines/reference/importAliasIdentifiers.types b/tests/baselines/reference/importAliasIdentifiers.types index 6746a5b3af7..4c9701ded10 100644 --- a/tests/baselines/reference/importAliasIdentifiers.types +++ b/tests/baselines/reference/importAliasIdentifiers.types @@ -52,9 +52,9 @@ module clodule { >Point : Point >{ x: 0, y: 0 } : { x: number; y: number; } >x : number ->0 : number +>0 : 0 >y : number ->0 : number +>0 : 0 } import clolias = clodule; @@ -83,9 +83,9 @@ function fundule() { return { x: 0, y: 0 }; >{ x: 0, y: 0 } : { x: number; y: number; } >x : number ->0 : number +>0 : 0 >y : number ->0 : number +>0 : 0 } module fundule { @@ -103,9 +103,9 @@ module fundule { >Point : Point >{ x: 0, y: 0 } : { x: number; y: number; } >x : number ->0 : number +>0 : 0 >y : number ->0 : number +>0 : 0 } import funlias = fundule; diff --git a/tests/baselines/reference/importAliasWithDottedName.types b/tests/baselines/reference/importAliasWithDottedName.types index 24ec5d1b0bb..b5882fce117 100644 --- a/tests/baselines/reference/importAliasWithDottedName.types +++ b/tests/baselines/reference/importAliasWithDottedName.types @@ -4,14 +4,14 @@ module M { export var x = 1; >x : number ->1 : number +>1 : 1 export module N { >N : typeof N export var y = 2; >y : number ->2 : number +>2 : 2 } } diff --git a/tests/baselines/reference/importAnImport.errors.txt b/tests/baselines/reference/importAnImport.errors.txt index 5f79b21f375..c8b9c6557f3 100644 --- a/tests/baselines/reference/importAnImport.errors.txt +++ b/tests/baselines/reference/importAnImport.errors.txt @@ -1,4 +1,4 @@ -tests/cases/compiler/importAnImport.ts(6,23): error TS2305: Module 'c.a.b' has no exported member 'ma'. +tests/cases/compiler/importAnImport.ts(6,23): error TS2694: Namespace 'c.a.b' has no exported member 'ma'. ==== tests/cases/compiler/importAnImport.ts (1 errors) ==== @@ -9,5 +9,5 @@ tests/cases/compiler/importAnImport.ts(6,23): error TS2305: Module 'c.a.b' has n module m0 { import m8 = c.a.b.ma; ~~ -!!! error TS2305: Module 'c.a.b' has no exported member 'ma'. +!!! error TS2694: Namespace 'c.a.b' has no exported member 'ma'. } \ No newline at end of file diff --git a/tests/baselines/reference/importAndVariableDeclarationConflict2.types b/tests/baselines/reference/importAndVariableDeclarationConflict2.types index eafc7be6deb..4b6e9acec06 100644 --- a/tests/baselines/reference/importAndVariableDeclarationConflict2.types +++ b/tests/baselines/reference/importAndVariableDeclarationConflict2.types @@ -4,7 +4,7 @@ module m { export var m = ''; >m : string ->'' : string +>'' : "" } import x = m.m; @@ -20,6 +20,6 @@ class C { var x = ''; >x : string ->'' : string +>'' : "" } } diff --git a/tests/baselines/reference/importDeclWithClassModifiers.errors.txt b/tests/baselines/reference/importDeclWithClassModifiers.errors.txt index 1116741818b..e1b8867d069 100644 --- a/tests/baselines/reference/importDeclWithClassModifiers.errors.txt +++ b/tests/baselines/reference/importDeclWithClassModifiers.errors.txt @@ -1,12 +1,12 @@ tests/cases/compiler/importDeclWithClassModifiers.ts(5,8): error TS1044: 'public' modifier cannot appear on a module or namespace element. tests/cases/compiler/importDeclWithClassModifiers.ts(5,26): error TS2304: Cannot find name 'x'. -tests/cases/compiler/importDeclWithClassModifiers.ts(5,28): error TS2305: Module 'x' has no exported member 'c'. +tests/cases/compiler/importDeclWithClassModifiers.ts(5,28): error TS2694: Namespace 'x' has no exported member 'c'. tests/cases/compiler/importDeclWithClassModifiers.ts(6,8): error TS1044: 'private' modifier cannot appear on a module or namespace element. tests/cases/compiler/importDeclWithClassModifiers.ts(6,27): error TS2304: Cannot find name 'x'. -tests/cases/compiler/importDeclWithClassModifiers.ts(6,29): error TS2305: Module 'x' has no exported member 'c'. +tests/cases/compiler/importDeclWithClassModifiers.ts(6,29): error TS2694: Namespace 'x' has no exported member 'c'. tests/cases/compiler/importDeclWithClassModifiers.ts(7,8): error TS1044: 'static' modifier cannot appear on a module or namespace element. tests/cases/compiler/importDeclWithClassModifiers.ts(7,26): error TS2304: Cannot find name 'x'. -tests/cases/compiler/importDeclWithClassModifiers.ts(7,28): error TS2305: Module 'x' has no exported member 'c'. +tests/cases/compiler/importDeclWithClassModifiers.ts(7,28): error TS2694: Namespace 'x' has no exported member 'c'. ==== tests/cases/compiler/importDeclWithClassModifiers.ts (9 errors) ==== @@ -20,20 +20,20 @@ tests/cases/compiler/importDeclWithClassModifiers.ts(7,28): error TS2305: Module ~ !!! error TS2304: Cannot find name 'x'. ~ -!!! error TS2305: Module 'x' has no exported member 'c'. +!!! error TS2694: Namespace 'x' has no exported member 'c'. export private import b = x.c; ~~~~~~~ !!! error TS1044: 'private' modifier cannot appear on a module or namespace element. ~ !!! error TS2304: Cannot find name 'x'. ~ -!!! error TS2305: Module 'x' has no exported member 'c'. +!!! error TS2694: Namespace 'x' has no exported member 'c'. export static import c = x.c; ~~~~~~ !!! error TS1044: 'static' modifier cannot appear on a module or namespace element. ~ !!! error TS2304: Cannot find name 'x'. ~ -!!! error TS2305: Module 'x' has no exported member 'c'. +!!! error TS2694: Namespace 'x' has no exported member 'c'. var b: a; \ No newline at end of file diff --git a/tests/baselines/reference/importDeclWithDeclareModifier.errors.txt b/tests/baselines/reference/importDeclWithDeclareModifier.errors.txt index 8de1a1cea68..d69a88964cc 100644 --- a/tests/baselines/reference/importDeclWithDeclareModifier.errors.txt +++ b/tests/baselines/reference/importDeclWithDeclareModifier.errors.txt @@ -1,6 +1,6 @@ tests/cases/compiler/importDeclWithDeclareModifier.ts(5,9): error TS1029: 'export' modifier must precede 'declare' modifier. tests/cases/compiler/importDeclWithDeclareModifier.ts(5,27): error TS2304: Cannot find name 'x'. -tests/cases/compiler/importDeclWithDeclareModifier.ts(5,29): error TS2305: Module 'x' has no exported member 'c'. +tests/cases/compiler/importDeclWithDeclareModifier.ts(5,29): error TS2694: Namespace 'x' has no exported member 'c'. ==== tests/cases/compiler/importDeclWithDeclareModifier.ts (3 errors) ==== @@ -14,6 +14,6 @@ tests/cases/compiler/importDeclWithDeclareModifier.ts(5,29): error TS2305: Modul ~ !!! error TS2304: Cannot find name 'x'. ~ -!!! error TS2305: Module 'x' has no exported member 'c'. +!!! error TS2694: Namespace 'x' has no exported member 'c'. var b: a; \ No newline at end of file diff --git a/tests/baselines/reference/importDeclWithExportModifier.errors.txt b/tests/baselines/reference/importDeclWithExportModifier.errors.txt index b20896ec6e7..56e9a159afb 100644 --- a/tests/baselines/reference/importDeclWithExportModifier.errors.txt +++ b/tests/baselines/reference/importDeclWithExportModifier.errors.txt @@ -1,5 +1,5 @@ tests/cases/compiler/importDeclWithExportModifier.ts(5,19): error TS2304: Cannot find name 'x'. -tests/cases/compiler/importDeclWithExportModifier.ts(5,21): error TS2305: Module 'x' has no exported member 'c'. +tests/cases/compiler/importDeclWithExportModifier.ts(5,21): error TS2694: Namespace 'x' has no exported member 'c'. ==== tests/cases/compiler/importDeclWithExportModifier.ts (2 errors) ==== @@ -11,6 +11,6 @@ tests/cases/compiler/importDeclWithExportModifier.ts(5,21): error TS2305: Module ~ !!! error TS2304: Cannot find name 'x'. ~ -!!! error TS2305: Module 'x' has no exported member 'c'. +!!! error TS2694: Namespace 'x' has no exported member 'c'. var b: a; \ No newline at end of file diff --git a/tests/baselines/reference/importDeclWithExportModifierAndExportAssignment.errors.txt b/tests/baselines/reference/importDeclWithExportModifierAndExportAssignment.errors.txt index d5c2f2b9712..ff3c47e9f33 100644 --- a/tests/baselines/reference/importDeclWithExportModifierAndExportAssignment.errors.txt +++ b/tests/baselines/reference/importDeclWithExportModifierAndExportAssignment.errors.txt @@ -1,5 +1,5 @@ tests/cases/compiler/importDeclWithExportModifierAndExportAssignment.ts(5,19): error TS2304: Cannot find name 'x'. -tests/cases/compiler/importDeclWithExportModifierAndExportAssignment.ts(5,21): error TS2305: Module 'x' has no exported member 'c'. +tests/cases/compiler/importDeclWithExportModifierAndExportAssignment.ts(5,21): error TS2694: Namespace 'x' has no exported member 'c'. tests/cases/compiler/importDeclWithExportModifierAndExportAssignment.ts(6,1): error TS2309: An export assignment cannot be used in a module with other exported elements. @@ -12,7 +12,7 @@ tests/cases/compiler/importDeclWithExportModifierAndExportAssignment.ts(6,1): er ~ !!! error TS2304: Cannot find name 'x'. ~ -!!! error TS2305: Module 'x' has no exported member 'c'. +!!! error TS2694: Namespace 'x' has no exported member 'c'. export = x; ~~~~~~~~~~~ !!! error TS2309: An export assignment cannot be used in a module with other exported elements. \ No newline at end of file diff --git a/tests/baselines/reference/importImportOnlyModule.types b/tests/baselines/reference/importImportOnlyModule.types index c1275bed511..d02cdb3353f 100644 --- a/tests/baselines/reference/importImportOnlyModule.types +++ b/tests/baselines/reference/importImportOnlyModule.types @@ -12,11 +12,11 @@ export class C1 { m1 = 42; >m1 : number ->42 : number +>42 : 42 static s1 = true; >s1 : boolean ->true : boolean +>true : true } === tests/cases/conformance/externalModules/foo_1.ts === @@ -25,5 +25,5 @@ import c1 = require('./foo_0'); // Makes this an external module var answer = 42; // No exports >answer : number ->42 : number +>42 : 42 diff --git a/tests/baselines/reference/importInTypePosition.types b/tests/baselines/reference/importInTypePosition.types index 7360416e4b3..22802728fd0 100644 --- a/tests/baselines/reference/importInTypePosition.types +++ b/tests/baselines/reference/importInTypePosition.types @@ -13,8 +13,8 @@ module A { >Origin : Point >new Point(0, 0) : Point >Point : typeof Point ->0 : number ->0 : number +>0 : 0 +>0 : 0 } // no code gen expected @@ -46,8 +46,8 @@ module C { >p : a.Point >{ x: 0, y: 0 } : { x: number; y: number; } >x : number ->0 : number +>0 : 0 >y : number ->0 : number +>0 : 0 } diff --git a/tests/baselines/reference/importStatements.types b/tests/baselines/reference/importStatements.types index ecf4453b360..53509ceb70c 100644 --- a/tests/baselines/reference/importStatements.types +++ b/tests/baselines/reference/importStatements.types @@ -14,8 +14,8 @@ module A { >Origin : Point >new Point(0, 0) : Point >Point : typeof Point ->0 : number ->0 : number +>0 : 0 +>0 : 0 } // no code gen expected @@ -48,9 +48,9 @@ module C { >p : a.Point >{x:0, y:0 } : { x: number; y: number; } >x : number ->0 : number +>0 : 0 >y : number ->0 : number +>0 : 0 } // code gen expected @@ -67,8 +67,8 @@ module D { >a.Point : typeof a.Point >a : typeof a >Point : typeof a.Point ->1 : number ->1 : number +>1 : 1 +>1 : 1 } module E { diff --git a/tests/baselines/reference/relativeModuleWithoutSlash.js b/tests/baselines/reference/importWithTrailingSlash.js similarity index 70% rename from tests/baselines/reference/relativeModuleWithoutSlash.js rename to tests/baselines/reference/importWithTrailingSlash.js index f83406499d4..7118dd95bb8 100644 --- a/tests/baselines/reference/relativeModuleWithoutSlash.js +++ b/tests/baselines/reference/importWithTrailingSlash.js @@ -1,4 +1,4 @@ -//// [tests/cases/compiler/relativeModuleWithoutSlash.ts] //// +//// [tests/cases/compiler/importWithTrailingSlash.ts] //// //// [a.ts] @@ -11,13 +11,13 @@ export default { aIndex: 0 }; import a from "."; import aIndex from "./"; a.a; -aIndex.a; //aIndex.aIndex; See GH#9690 +aIndex.aIndex; //// [test.ts] import a from ".."; import aIndex from "../"; a.a; -aIndex.a; //aIndex.aIndex; +aIndex.aIndex; //// [a.js] @@ -33,10 +33,10 @@ exports["default"] = { aIndex: 0 }; var _1 = require("."); var _2 = require("./"); _1["default"].a; -_2["default"].a; //aIndex.aIndex; See GH#9690 +_2["default"].aIndex; //// [test.js] "use strict"; var __1 = require(".."); var _1 = require("../"); __1["default"].a; -_1["default"].a; //aIndex.aIndex; +_1["default"].aIndex; diff --git a/tests/baselines/reference/relativeModuleWithoutSlash.trace.json b/tests/baselines/reference/importWithTrailingSlash.json similarity index 71% rename from tests/baselines/reference/relativeModuleWithoutSlash.trace.json rename to tests/baselines/reference/importWithTrailingSlash.json index cee5b060676..3c99d4eb6a0 100644 --- a/tests/baselines/reference/relativeModuleWithoutSlash.trace.json +++ b/tests/baselines/reference/importWithTrailingSlash.json @@ -7,10 +7,11 @@ "======== Module name '.' was successfully resolved to '/a.ts'. ========", "======== Resolving module './' from '/a/test.ts'. ========", "Explicitly specified module resolution kind: 'NodeJs'.", - "Loading module as file / folder, candidate module location '/a'.", - "File '/a.ts' exist - use it as a name resolution result.", - "Resolving real path for '/a.ts', result '/a.ts'", - "======== Module name './' was successfully resolved to '/a.ts'. ========", + "Loading module as file / folder, candidate module location '/a/'.", + "File '/a/package.json' does not exist.", + "File '/a/index.ts' exist - use it as a name resolution result.", + "Resolving real path for '/a/index.ts', result '/a/index.ts'", + "======== Module name './' was successfully resolved to '/a/index.ts'. ========", "======== Resolving module '..' from '/a/b/test.ts'. ========", "Explicitly specified module resolution kind: 'NodeJs'.", "Loading module as file / folder, candidate module location '/a'.", @@ -19,8 +20,9 @@ "======== Module name '..' was successfully resolved to '/a.ts'. ========", "======== Resolving module '../' from '/a/b/test.ts'. ========", "Explicitly specified module resolution kind: 'NodeJs'.", - "Loading module as file / folder, candidate module location '/a'.", - "File '/a.ts' exist - use it as a name resolution result.", - "Resolving real path for '/a.ts', result '/a.ts'", - "======== Module name '../' was successfully resolved to '/a.ts'. ========" + "Loading module as file / folder, candidate module location '/a/'.", + "File '/a/package.json' does not exist.", + "File '/a/index.ts' exist - use it as a name resolution result.", + "Resolving real path for '/a/index.ts', result '/a/index.ts'", + "======== Module name '../' was successfully resolved to '/a/index.ts'. ========" ] \ No newline at end of file diff --git a/tests/baselines/reference/relativeModuleWithoutSlash.symbols b/tests/baselines/reference/importWithTrailingSlash.symbols similarity index 73% rename from tests/baselines/reference/relativeModuleWithoutSlash.symbols rename to tests/baselines/reference/importWithTrailingSlash.symbols index 8c54a0682c7..4a9f8b41569 100644 --- a/tests/baselines/reference/relativeModuleWithoutSlash.symbols +++ b/tests/baselines/reference/importWithTrailingSlash.symbols @@ -19,10 +19,10 @@ a.a; >a : Symbol(a, Decl(test.ts, 0, 6)) >a : Symbol(a, Decl(a.ts, 1, 16)) -aIndex.a; //aIndex.aIndex; See GH#9690 ->aIndex.a : Symbol(a, Decl(a.ts, 1, 16)) +aIndex.aIndex; +>aIndex.aIndex : Symbol(aIndex, Decl(index.ts, 0, 16)) >aIndex : Symbol(aIndex, Decl(test.ts, 1, 6)) ->a : Symbol(a, Decl(a.ts, 1, 16)) +>aIndex : Symbol(aIndex, Decl(index.ts, 0, 16)) === /a/b/test.ts === import a from ".."; @@ -36,8 +36,8 @@ a.a; >a : Symbol(a, Decl(test.ts, 0, 6)) >a : Symbol(a, Decl(a.ts, 1, 16)) -aIndex.a; //aIndex.aIndex; ->aIndex.a : Symbol(a, Decl(a.ts, 1, 16)) +aIndex.aIndex; +>aIndex.aIndex : Symbol(aIndex, Decl(index.ts, 0, 16)) >aIndex : Symbol(aIndex, Decl(test.ts, 1, 6)) ->a : Symbol(a, Decl(a.ts, 1, 16)) +>aIndex : Symbol(aIndex, Decl(index.ts, 0, 16)) diff --git a/tests/baselines/reference/importWithTrailingSlash.trace.json b/tests/baselines/reference/importWithTrailingSlash.trace.json new file mode 100644 index 00000000000..3c99d4eb6a0 --- /dev/null +++ b/tests/baselines/reference/importWithTrailingSlash.trace.json @@ -0,0 +1,28 @@ +[ + "======== Resolving module '.' from '/a/test.ts'. ========", + "Explicitly specified module resolution kind: 'NodeJs'.", + "Loading module as file / folder, candidate module location '/a'.", + "File '/a.ts' exist - use it as a name resolution result.", + "Resolving real path for '/a.ts', result '/a.ts'", + "======== Module name '.' was successfully resolved to '/a.ts'. ========", + "======== Resolving module './' from '/a/test.ts'. ========", + "Explicitly specified module resolution kind: 'NodeJs'.", + "Loading module as file / folder, candidate module location '/a/'.", + "File '/a/package.json' does not exist.", + "File '/a/index.ts' exist - use it as a name resolution result.", + "Resolving real path for '/a/index.ts', result '/a/index.ts'", + "======== Module name './' was successfully resolved to '/a/index.ts'. ========", + "======== Resolving module '..' from '/a/b/test.ts'. ========", + "Explicitly specified module resolution kind: 'NodeJs'.", + "Loading module as file / folder, candidate module location '/a'.", + "File '/a.ts' exist - use it as a name resolution result.", + "Resolving real path for '/a.ts', result '/a.ts'", + "======== Module name '..' was successfully resolved to '/a.ts'. ========", + "======== Resolving module '../' from '/a/b/test.ts'. ========", + "Explicitly specified module resolution kind: 'NodeJs'.", + "Loading module as file / folder, candidate module location '/a/'.", + "File '/a/package.json' does not exist.", + "File '/a/index.ts' exist - use it as a name resolution result.", + "Resolving real path for '/a/index.ts', result '/a/index.ts'", + "======== Module name '../' was successfully resolved to '/a/index.ts'. ========" +] \ No newline at end of file diff --git a/tests/baselines/reference/relativeModuleWithoutSlash.types b/tests/baselines/reference/importWithTrailingSlash.types similarity index 60% rename from tests/baselines/reference/relativeModuleWithoutSlash.types rename to tests/baselines/reference/importWithTrailingSlash.types index 796ef714dd9..7429dcdf42e 100644 --- a/tests/baselines/reference/relativeModuleWithoutSlash.types +++ b/tests/baselines/reference/importWithTrailingSlash.types @@ -3,45 +3,45 @@ export default { a: 0 }; >{ a: 0 } : { a: number; } >a : number ->0 : number +>0 : 0 === /a/index.ts === export default { aIndex: 0 }; >{ aIndex: 0 } : { aIndex: number; } >aIndex : number ->0 : number +>0 : 0 === /a/test.ts === import a from "."; >a : { a: number; } import aIndex from "./"; ->aIndex : { a: number; } +>aIndex : { aIndex: number; } a.a; >a.a : number >a : { a: number; } >a : number -aIndex.a; //aIndex.aIndex; See GH#9690 ->aIndex.a : number ->aIndex : { a: number; } ->a : number +aIndex.aIndex; +>aIndex.aIndex : number +>aIndex : { aIndex: number; } +>aIndex : number === /a/b/test.ts === import a from ".."; >a : { a: number; } import aIndex from "../"; ->aIndex : { a: number; } +>aIndex : { aIndex: number; } a.a; >a.a : number >a : { a: number; } >a : number -aIndex.a; //aIndex.aIndex; ->aIndex.a : number ->aIndex : { a: number; } ->a : number +aIndex.aIndex; +>aIndex.aIndex : number +>aIndex : { aIndex: number; } +>aIndex : number diff --git a/tests/baselines/reference/importWithTrailingSlash_noResolve.errors.txt b/tests/baselines/reference/importWithTrailingSlash_noResolve.errors.txt new file mode 100644 index 00000000000..780e1d2f1bc --- /dev/null +++ b/tests/baselines/reference/importWithTrailingSlash_noResolve.errors.txt @@ -0,0 +1,9 @@ +/a.ts(2,17): error TS2307: Cannot find module './foo/'. + + +==== /a.ts (1 errors) ==== + + import foo from "./foo/"; + ~~~~~~~~ +!!! error TS2307: Cannot find module './foo/'. + \ No newline at end of file diff --git a/tests/baselines/reference/importWithTrailingSlash_noResolve.js b/tests/baselines/reference/importWithTrailingSlash_noResolve.js new file mode 100644 index 00000000000..b523c76af3b --- /dev/null +++ b/tests/baselines/reference/importWithTrailingSlash_noResolve.js @@ -0,0 +1,7 @@ +//// [a.ts] + +import foo from "./foo/"; + + +//// [a.js] +"use strict"; diff --git a/tests/baselines/reference/importWithTrailingSlash_noResolve.trace.json b/tests/baselines/reference/importWithTrailingSlash_noResolve.trace.json new file mode 100644 index 00000000000..e010603106f --- /dev/null +++ b/tests/baselines/reference/importWithTrailingSlash_noResolve.trace.json @@ -0,0 +1,10 @@ +[ + "======== Resolving module './foo/' from '/a.ts'. ========", + "Explicitly specified module resolution kind: 'NodeJs'.", + "Loading module as file / folder, candidate module location '/foo/'.", + "File '/foo/package.json' does not exist.", + "File '/foo/index.ts' does not exist.", + "File '/foo/index.tsx' does not exist.", + "File '/foo/index.d.ts' does not exist.", + "======== Module name './foo/' was not resolved. ========" +] \ No newline at end of file diff --git a/tests/baselines/reference/import_reference-exported-alias.types b/tests/baselines/reference/import_reference-exported-alias.types index 3f9c34f62dc..2f2496a7b77 100644 --- a/tests/baselines/reference/import_reference-exported-alias.types +++ b/tests/baselines/reference/import_reference-exported-alias.types @@ -34,7 +34,7 @@ module App { >getUserName : () => string return "Bill Gates"; ->"Bill Gates" : string +>"Bill Gates" : "Bill Gates" } } } diff --git a/tests/baselines/reference/import_reference-to-type-alias.types b/tests/baselines/reference/import_reference-to-type-alias.types index 53c7dabcd5f..e2327650f1a 100644 --- a/tests/baselines/reference/import_reference-to-type-alias.types +++ b/tests/baselines/reference/import_reference-to-type-alias.types @@ -32,7 +32,7 @@ export module App { >getUserName : () => string return "Bill Gates"; ->"Bill Gates" : string +>"Bill Gates" : "Bill Gates" } } } diff --git a/tests/baselines/reference/import_unneeded-require-when-referenecing-aliased-type-throug-array.types b/tests/baselines/reference/import_unneeded-require-when-referenecing-aliased-type-throug-array.types index 2fda99dc064..0449bfd16bf 100644 --- a/tests/baselines/reference/import_unneeded-require-when-referenecing-aliased-type-throug-array.types +++ b/tests/baselines/reference/import_unneeded-require-when-referenecing-aliased-type-throug-array.types @@ -12,7 +12,7 @@ var p = testData[0].name; >testData[0].name : string >testData[0] : ITest >testData : ITest[] ->0 : number +>0 : 0 >name : string === tests/cases/compiler/b.ts === diff --git a/tests/baselines/reference/inOperatorWithFunction.types b/tests/baselines/reference/inOperatorWithFunction.types index e85a86632c7..21e9da3f040 100644 --- a/tests/baselines/reference/inOperatorWithFunction.types +++ b/tests/baselines/reference/inOperatorWithFunction.types @@ -9,7 +9,7 @@ fn("a" in { "a": true }); >fn("a" in { "a": true }) : boolean >fn : (val: boolean) => boolean >"a" in { "a": true } : boolean ->"a" : string +>"a" : "a" >{ "a": true } : { "a": boolean; } ->true : boolean +>true : true diff --git a/tests/baselines/reference/inOperatorWithValidOperands.types b/tests/baselines/reference/inOperatorWithValidOperands.types index 0cca583e683..7e121e54146 100644 --- a/tests/baselines/reference/inOperatorWithValidOperands.types +++ b/tests/baselines/reference/inOperatorWithValidOperands.types @@ -31,13 +31,13 @@ var ra3 = a2 in x; var ra4 = '' in x; >ra4 : boolean >'' in x : boolean ->'' : string +>'' : "" >x : any var ra5 = 0 in x; >ra5 : boolean >0 in x : boolean ->0 : number +>0 : 0 >x : any // valid right operands diff --git a/tests/baselines/reference/incompatibleTypes.errors.txt b/tests/baselines/reference/incompatibleTypes.errors.txt index cb6de6576b2..4cd68470007 100644 --- a/tests/baselines/reference/incompatibleTypes.errors.txt +++ b/tests/baselines/reference/incompatibleTypes.errors.txt @@ -22,7 +22,7 @@ tests/cases/compiler/incompatibleTypes.ts(49,7): error TS2345: Argument of type Object literal may only specify known properties, and 'e' does not exist in type '{ c: { b: string; }; d: string; }'. tests/cases/compiler/incompatibleTypes.ts(66,47): error TS2322: Type '{ e: number; f: number; }' is not assignable to type '{ a: { a: string; }; b: string; }'. Object literal may only specify known properties, and 'e' does not exist in type '{ a: { a: string; }; b: string; }'. -tests/cases/compiler/incompatibleTypes.ts(72,5): error TS2322: Type 'number' is not assignable to type '() => string'. +tests/cases/compiler/incompatibleTypes.ts(72,5): error TS2322: Type '5' is not assignable to type '() => string'. tests/cases/compiler/incompatibleTypes.ts(74,5): error TS2322: Type '(a: any) => number' is not assignable to type '() => any'. @@ -131,7 +131,7 @@ tests/cases/compiler/incompatibleTypes.ts(74,5): error TS2322: Type '(a: any) => var i1c1: { (): string; } = 5; ~~~~ -!!! error TS2322: Type 'number' is not assignable to type '() => string'. +!!! error TS2322: Type '5' is not assignable to type '() => string'. var fp1: () =>any = a => 0; ~~~ diff --git a/tests/baselines/reference/incrementOperatorWithAnyOtherType.types b/tests/baselines/reference/incrementOperatorWithAnyOtherType.types index 3643b646ace..715de620bff 100644 --- a/tests/baselines/reference/incrementOperatorWithAnyOtherType.types +++ b/tests/baselines/reference/incrementOperatorWithAnyOtherType.types @@ -10,14 +10,14 @@ var ANY1; var ANY2: any[] = ["", ""]; >ANY2 : any[] >["", ""] : string[] ->"" : string ->"" : string +>"" : "" +>"" : "" var obj = {x:1,y:null}; >obj : { x: number; y: any; } >{x:1,y:null} : { x: number; y: null; } >x : number ->1 : number +>1 : 1 >y : null >null : null @@ -65,7 +65,7 @@ var ResultIsNumber5 = ++ANY2[0]; >++ANY2[0] : number >ANY2[0] : any >ANY2 : any[] ->0 : number +>0 : 0 var ResultIsNumber6 = ++obj.x; >ResultIsNumber6 : number @@ -100,7 +100,7 @@ var ResultIsNumber9 = ANY2[0]++; >ANY2[0]++ : number >ANY2[0] : any >ANY2 : any[] ->0 : number +>0 : 0 var ResultIsNumber10 = obj.x++; >ResultIsNumber10 : number @@ -143,7 +143,7 @@ var ResultIsNumber13 = M.n++; >++ANY2[0] : number >ANY2[0] : any >ANY2 : any[] ->0 : number +>0 : 0 ++ANY, ++ANY1; >++ANY, ++ANY1 : number @@ -176,7 +176,7 @@ ANY2[0]++; >ANY2[0]++ : number >ANY2[0] : any >ANY2 : any[] ->0 : number +>0 : 0 ANY++, ANY1++; >ANY++, ANY1++ : number diff --git a/tests/baselines/reference/incrementOperatorWithNumberType.types b/tests/baselines/reference/incrementOperatorWithNumberType.types index 21211a3848c..03030289a77 100644 --- a/tests/baselines/reference/incrementOperatorWithNumberType.types +++ b/tests/baselines/reference/incrementOperatorWithNumberType.types @@ -6,8 +6,8 @@ var NUMBER: number; var NUMBER1: number[] = [1, 2]; >NUMBER1 : number[] >[1, 2] : number[] ->1 : number ->2 : number +>1 : 1 +>2 : 2 class A { >A : A @@ -72,7 +72,7 @@ var ResultIsNumber7 = NUMBER1[0]++; >NUMBER1[0]++ : number >NUMBER1[0] : number >NUMBER1 : number[] ->0 : number +>0 : 0 // miss assignment operators ++NUMBER; @@ -83,7 +83,7 @@ var ResultIsNumber7 = NUMBER1[0]++; >++NUMBER1[0] : number >NUMBER1[0] : number >NUMBER1 : number[] ->0 : number +>0 : 0 ++objA.a; >++objA.a : number @@ -115,7 +115,7 @@ NUMBER1[0]++; >NUMBER1[0]++ : number >NUMBER1[0] : number >NUMBER1 : number[] ->0 : number +>0 : 0 objA.a++; >objA.a++ : number diff --git a/tests/baselines/reference/indexClassByNumber.types b/tests/baselines/reference/indexClassByNumber.types index b1fb79f256a..dfd27305ba9 100644 --- a/tests/baselines/reference/indexClassByNumber.types +++ b/tests/baselines/reference/indexClassByNumber.types @@ -10,9 +10,9 @@ var f = new foo(); >foo : typeof foo f[0] = 4; // Shouldn't be allowed ->f[0] = 4 : number +>f[0] = 4 : 4 >f[0] : any >f : foo ->0 : number ->4 : number +>0 : 0 +>4 : 4 diff --git a/tests/baselines/reference/indexIntoArraySubclass.errors.txt b/tests/baselines/reference/indexIntoArraySubclass.errors.txt index 1628e12d22f..bbcf259fb33 100644 --- a/tests/baselines/reference/indexIntoArraySubclass.errors.txt +++ b/tests/baselines/reference/indexIntoArraySubclass.errors.txt @@ -1,4 +1,4 @@ -tests/cases/compiler/indexIntoArraySubclass.ts(4,1): error TS2322: Type 'number' is not assignable to type 'string'. +tests/cases/compiler/indexIntoArraySubclass.ts(4,1): error TS2322: Type '0' is not assignable to type 'string'. ==== tests/cases/compiler/indexIntoArraySubclass.ts (1 errors) ==== @@ -7,4 +7,4 @@ tests/cases/compiler/indexIntoArraySubclass.ts(4,1): error TS2322: Type 'number' var r = x2[0]; // string r = 0; //error ~ -!!! error TS2322: Type 'number' is not assignable to type 'string'. \ No newline at end of file +!!! error TS2322: Type '0' is not assignable to type 'string'. \ No newline at end of file diff --git a/tests/baselines/reference/indexIntoEnum.types b/tests/baselines/reference/indexIntoEnum.types index 3c0d91cd240..9a22174d9bc 100644 --- a/tests/baselines/reference/indexIntoEnum.types +++ b/tests/baselines/reference/indexIntoEnum.types @@ -9,5 +9,5 @@ module M { >x : string >E[0] : string >E : typeof E ->0 : number +>0 : 0 } diff --git a/tests/baselines/reference/indexSignaturesInferentialTyping.types b/tests/baselines/reference/indexSignaturesInferentialTyping.types index 47c7aa21388..202e1489818 100644 --- a/tests/baselines/reference/indexSignaturesInferentialTyping.types +++ b/tests/baselines/reference/indexSignaturesInferentialTyping.types @@ -22,16 +22,16 @@ var x1 = foo({ 0: 0, 1: 1 }); // type should be number >foo({ 0: 0, 1: 1 }) : number >foo : (items: { [index: number]: T; }) => T >{ 0: 0, 1: 1 } : { 0: number; 1: number; } ->0 : number ->1 : number +>0 : 0 +>1 : 1 var x2 = bar({ 0: 0, 1: 1 }); >x2 : number >bar({ 0: 0, 1: 1 }) : number >bar : (items: { [index: string]: T; }) => T >{ 0: 0, 1: 1 } : { 0: number; 1: number; } ->0 : number ->1 : number +>0 : 0 +>1 : 1 var x3 = bar({ zero: 0, one: 1 }); // type should be number >x3 : number @@ -39,7 +39,7 @@ var x3 = bar({ zero: 0, one: 1 }); // type should be number >bar : (items: { [index: string]: T; }) => T >{ zero: 0, one: 1 } : { zero: number; one: number; } >zero : number ->0 : number +>0 : 0 >one : number ->1 : number +>1 : 1 diff --git a/tests/baselines/reference/indexer.types b/tests/baselines/reference/indexer.types index f24c90f6ea1..6f648d8d232 100644 --- a/tests/baselines/reference/indexer.types +++ b/tests/baselines/reference/indexer.types @@ -20,15 +20,15 @@ var jq:JQuery={ 0: { id : "a" }, 1: { id : "b" } }; >{ 0: { id : "a" }, 1: { id : "b" } } : { 0: { id: string; }; 1: { id: string; }; } >{ id : "a" } : { id: string; } >id : string ->"a" : string +>"a" : "a" >{ id : "b" } : { id: string; } >id : string ->"b" : string +>"b" : "b" jq[0].id; >jq[0].id : string >jq[0] : JQueryElement >jq : JQuery ->0 : number +>0 : 0 >id : string diff --git a/tests/baselines/reference/indexer3.types b/tests/baselines/reference/indexer3.types index 28bcd9cab0c..58bf9b51f2e 100644 --- a/tests/baselines/reference/indexer3.types +++ b/tests/baselines/reference/indexer3.types @@ -10,5 +10,5 @@ var r: Date = dateMap["hello"] // result type includes indexer using BCT >Date : Date >dateMap["hello"] : Date >dateMap : { [x: string]: Date; } ->"hello" : string +>"hello" : "hello" diff --git a/tests/baselines/reference/indexerA.types b/tests/baselines/reference/indexerA.types index ee6351eae33..e0eadbc06b4 100644 --- a/tests/baselines/reference/indexerA.types +++ b/tests/baselines/reference/indexerA.types @@ -20,15 +20,15 @@ var jq:JQuery={ 0: { id : "a" }, 1: { id : "b" } }; >{ 0: { id : "a" }, 1: { id : "b" } } : { 0: { id: string; }; 1: { id: string; }; } >{ id : "a" } : { id: string; } >id : string ->"a" : string +>"a" : "a" >{ id : "b" } : { id: string; } >id : string ->"b" : string +>"b" : "b" jq[0].id; >jq[0].id : string >jq[0] : JQueryElement >jq : JQuery ->0 : number +>0 : 0 >id : string diff --git a/tests/baselines/reference/indexerWithTuple.types b/tests/baselines/reference/indexerWithTuple.types index 4faae2cda29..8a14fa9816e 100644 --- a/tests/baselines/reference/indexerWithTuple.types +++ b/tests/baselines/reference/indexerWithTuple.types @@ -2,55 +2,55 @@ var strNumTuple: [string, number] = ["foo", 10]; >strNumTuple : [string, number] >["foo", 10] : [string, number] ->"foo" : string ->10 : number +>"foo" : "foo" +>10 : 10 var numTupleTuple: [number, [string, number]] = [10, ["bar", 20]]; >numTupleTuple : [number, [string, number]] >[10, ["bar", 20]] : [number, [string, number]] ->10 : number +>10 : 10 >["bar", 20] : [string, number] ->"bar" : string ->20 : number +>"bar" : "bar" +>20 : 20 var unionTuple1: [number, string| number] = [10, "foo"]; >unionTuple1 : [number, string | number] >[10, "foo"] : [number, string] ->10 : number ->"foo" : string +>10 : 10 +>"foo" : "foo" var unionTuple2: [boolean, string| number] = [true, "foo"]; >unionTuple2 : [boolean, string | number] ->[true, "foo"] : [boolean, string] ->true : boolean ->"foo" : string +>[true, "foo"] : [true, string] +>true : true +>"foo" : "foo" // no error var idx0 = 0; >idx0 : number ->0 : number +>0 : 0 var idx1 = 1; >idx1 : number ->1 : number +>1 : 1 var ele10 = strNumTuple[0]; // string >ele10 : string >strNumTuple[0] : string >strNumTuple : [string, number] ->0 : number +>0 : 0 var ele11 = strNumTuple[1]; // number >ele11 : number >strNumTuple[1] : number >strNumTuple : [string, number] ->1 : number +>1 : 1 var ele12 = strNumTuple[2]; // string | number >ele12 : string | number >strNumTuple[2] : string | number >strNumTuple : [string, number] ->2 : number +>2 : 2 var ele13 = strNumTuple[idx0]; // string | number >ele13 : string | number @@ -68,43 +68,43 @@ var ele15 = strNumTuple["0"]; // string >ele15 : string >strNumTuple["0"] : string >strNumTuple : [string, number] ->"0" : string +>"0" : "0" var ele16 = strNumTuple["1"]; // number >ele16 : number >strNumTuple["1"] : number >strNumTuple : [string, number] ->"1" : string +>"1" : "1" var strNumTuple1 = numTupleTuple[1]; //[string, number]; >strNumTuple1 : [string, number] >numTupleTuple[1] : [string, number] >numTupleTuple : [number, [string, number]] ->1 : number +>1 : 1 var ele17 = numTupleTuple[2]; // number | [string, number] >ele17 : number | [string, number] >numTupleTuple[2] : number | [string, number] >numTupleTuple : [number, [string, number]] ->2 : number +>2 : 2 var eleUnion10 = unionTuple1[0]; // number >eleUnion10 : number >unionTuple1[0] : number >unionTuple1 : [number, string | number] ->0 : number +>0 : 0 var eleUnion11 = unionTuple1[1]; // string | number >eleUnion11 : string | number >unionTuple1[1] : string | number >unionTuple1 : [number, string | number] ->1 : number +>1 : 1 var eleUnion12 = unionTuple1[2]; // string | number >eleUnion12 : string | number >unionTuple1[2] : string | number >unionTuple1 : [number, string | number] ->2 : number +>2 : 2 var eleUnion13 = unionTuple1[idx0]; // string | number >eleUnion13 : string | number @@ -122,31 +122,31 @@ var eleUnion15 = unionTuple1["0"]; // number >eleUnion15 : number >unionTuple1["0"] : number >unionTuple1 : [number, string | number] ->"0" : string +>"0" : "0" var eleUnion16 = unionTuple1["1"]; // string | number >eleUnion16 : string | number >unionTuple1["1"] : string | number >unionTuple1 : [number, string | number] ->"1" : string +>"1" : "1" var eleUnion20 = unionTuple2[0]; // boolean >eleUnion20 : boolean >unionTuple2[0] : boolean >unionTuple2 : [boolean, string | number] ->0 : number +>0 : 0 var eleUnion21 = unionTuple2[1]; // string | number >eleUnion21 : string | number >unionTuple2[1] : string | number >unionTuple2 : [boolean, string | number] ->1 : number +>1 : 1 var eleUnion22 = unionTuple2[2]; // string | number | boolean >eleUnion22 : string | number | boolean >unionTuple2[2] : string | number | boolean >unionTuple2 : [boolean, string | number] ->2 : number +>2 : 2 var eleUnion23 = unionTuple2[idx0]; // string | number | boolean >eleUnion23 : string | number | boolean @@ -164,11 +164,11 @@ var eleUnion25 = unionTuple2["0"]; // boolean >eleUnion25 : boolean >unionTuple2["0"] : boolean >unionTuple2 : [boolean, string | number] ->"0" : string +>"0" : "0" var eleUnion26 = unionTuple2["1"]; // string | number >eleUnion26 : string | number >unionTuple2["1"] : string | number >unionTuple2 : [boolean, string | number] ->"1" : string +>"1" : "1" diff --git a/tests/baselines/reference/indexersInClassType.types b/tests/baselines/reference/indexersInClassType.types index 496526776d9..02316d810b9 100644 --- a/tests/baselines/reference/indexersInClassType.types +++ b/tests/baselines/reference/indexersInClassType.types @@ -39,7 +39,7 @@ var r2 = r[1]; >r2 : Date >r[1] : Date >r : C ->1 : number +>1 : 1 var r3 = r.a >r3 : {} diff --git a/tests/baselines/reference/inferParameterWithMethodCallInitializer.types b/tests/baselines/reference/inferParameterWithMethodCallInitializer.types index 9aeccb2b2e0..41c01808ae0 100644 --- a/tests/baselines/reference/inferParameterWithMethodCallInitializer.types +++ b/tests/baselines/reference/inferParameterWithMethodCallInitializer.types @@ -3,7 +3,7 @@ function getNumber(): number { >getNumber : () => number return 1; ->1 : number +>1 : 1 } class Example { >Example : Example @@ -12,7 +12,7 @@ class Example { >getNumber : () => number return 1; ->1 : number +>1 : 1 } doSomething(a = this.getNumber()): typeof a { >doSomething : (a?: number) => number diff --git a/tests/baselines/reference/inferSecondaryParameter.types b/tests/baselines/reference/inferSecondaryParameter.types index 34dbb14ea66..c4d827bb3c5 100644 --- a/tests/baselines/reference/inferSecondaryParameter.types +++ b/tests/baselines/reference/inferSecondaryParameter.types @@ -23,7 +23,7 @@ b.m("test", function (bug) { >b.m : (test: string, fn: Function) => any >b : Ib >m : (test: string, fn: Function) => any ->"test" : string +>"test" : "test" >function (bug) { var a: number = bug;} : (bug: any) => void >bug : any diff --git a/tests/baselines/reference/inferSetterParamType.errors.txt b/tests/baselines/reference/inferSetterParamType.errors.txt index 2ae2a16f9d2..02c02ba69d5 100644 --- a/tests/baselines/reference/inferSetterParamType.errors.txt +++ b/tests/baselines/reference/inferSetterParamType.errors.txt @@ -1,7 +1,7 @@ tests/cases/compiler/inferSetterParamType.ts(3,9): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. tests/cases/compiler/inferSetterParamType.ts(6,9): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. tests/cases/compiler/inferSetterParamType.ts(12,9): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. -tests/cases/compiler/inferSetterParamType.ts(13,16): error TS2322: Type 'number' is not assignable to type 'string'. +tests/cases/compiler/inferSetterParamType.ts(13,16): error TS2322: Type '0' is not assignable to type 'string'. tests/cases/compiler/inferSetterParamType.ts(15,9): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. @@ -26,7 +26,7 @@ tests/cases/compiler/inferSetterParamType.ts(15,9): error TS1056: Accessors are !!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. return 0; // should be an error - can't coerce infered return type to match setter annotated type ~ -!!! error TS2322: Type 'number' is not assignable to type 'string'. +!!! error TS2322: Type '0' is not assignable to type 'string'. } set bar(n:string) { ~~~ diff --git a/tests/baselines/reference/inferTypeArgumentsInSignatureWithRestParameters.types b/tests/baselines/reference/inferTypeArgumentsInSignatureWithRestParameters.types index f4d94388f42..24cecbfd183 100644 --- a/tests/baselines/reference/inferTypeArgumentsInSignatureWithRestParameters.types +++ b/tests/baselines/reference/inferTypeArgumentsInSignatureWithRestParameters.types @@ -28,11 +28,11 @@ function i(array: T[], opt?: any[]) { } var a = [1, 2, 3, 4, 5]; >a : number[] >[1, 2, 3, 4, 5] : number[] ->1 : number ->2 : number ->3 : number ->4 : number ->5 : number +>1 : 1 +>2 : 2 +>3 : 3 +>4 : 4 +>5 : 5 f(a); // OK >f(a) : void diff --git a/tests/baselines/reference/inferenceFromParameterlessLambda.types b/tests/baselines/reference/inferenceFromParameterlessLambda.types index 57747d881f6..1adf508226b 100644 --- a/tests/baselines/reference/inferenceFromParameterlessLambda.types +++ b/tests/baselines/reference/inferenceFromParameterlessLambda.types @@ -34,5 +34,5 @@ foo(n => n.length, () => 'hi'); >n : string >length : number >() => 'hi' : () => string ->'hi' : string +>'hi' : "hi" diff --git a/tests/baselines/reference/inferenceLimit.types b/tests/baselines/reference/inferenceLimit.types index 37b51e49644..3801388f343 100644 --- a/tests/baselines/reference/inferenceLimit.types +++ b/tests/baselines/reference/inferenceLimit.types @@ -1,6 +1,6 @@ === tests/cases/compiler/file1.ts === "use strict"; ->"use strict" : string +>"use strict" : "use strict" import * as MyModule from "./mymodule"; >MyModule : typeof MyModule @@ -46,7 +46,7 @@ export class BrokenClass { this.doStuff(order.id) >this.doStuff(order.id) .then((items) => { order.items = items; resolve(order); }) : Promise ->this.doStuff(order.id) .then : { (onfulfilled: (value: void) => TResult1 | PromiseLike, onrejected: (reason: any) => TResult2 | PromiseLike): Promise; (onfulfilled: (value: void) => TResult | PromiseLike, onrejected: (reason: any) => TResult | PromiseLike): Promise; (onfulfilled: (value: void) => TResult | PromiseLike): Promise; (): Promise; } +>this.doStuff(order.id) .then : { (onfulfilled?: (value: void) => void | PromiseLike, onrejected?: (reason: any) => void | PromiseLike): Promise; (onfulfilled: (value: void) => void | PromiseLike, onrejected: (reason: any) => TResult | PromiseLike): Promise; (onfulfilled: (value: void) => TResult | PromiseLike, onrejected?: (reason: any) => TResult | PromiseLike): Promise; (onfulfilled: (value: void) => TResult1 | PromiseLike, onrejected: (reason: any) => TResult2 | PromiseLike): Promise; } >this.doStuff(order.id) : Promise >this.doStuff : (id: number) => Promise >this : this @@ -56,7 +56,7 @@ export class BrokenClass { >id : any .then((items) => { ->then : { (onfulfilled: (value: void) => TResult1 | PromiseLike, onrejected: (reason: any) => TResult2 | PromiseLike): Promise; (onfulfilled: (value: void) => TResult | PromiseLike, onrejected: (reason: any) => TResult | PromiseLike): Promise; (onfulfilled: (value: void) => TResult | PromiseLike): Promise; (): Promise; } +>then : { (onfulfilled?: (value: void) => void | PromiseLike, onrejected?: (reason: any) => void | PromiseLike): Promise; (onfulfilled: (value: void) => void | PromiseLike, onrejected: (reason: any) => TResult | PromiseLike): Promise; (onfulfilled: (value: void) => TResult | PromiseLike, onrejected?: (reason: any) => TResult | PromiseLike): Promise; (onfulfilled: (value: void) => TResult1 | PromiseLike, onrejected: (reason: any) => TResult2 | PromiseLike): Promise; } >(items) => { order.items = items; resolve(order); } : (items: void) => void >items : void @@ -78,7 +78,7 @@ export class BrokenClass { return Promise.all(result.map(populateItems)) >Promise.all(result.map(populateItems)) .then((orders: Array) => { resolve(orders); }) : Promise ->Promise.all(result.map(populateItems)) .then : { (onfulfilled: (value: {}[]) => TResult1 | PromiseLike, onrejected: (reason: any) => TResult2 | PromiseLike): Promise; (onfulfilled: (value: {}[]) => TResult | PromiseLike, onrejected: (reason: any) => TResult | PromiseLike): Promise; (onfulfilled: (value: {}[]) => TResult | PromiseLike): Promise; (): Promise<{}[]>; } +>Promise.all(result.map(populateItems)) .then : { (onfulfilled?: (value: {}[]) => {}[] | PromiseLike<{}[]>, onrejected?: (reason: any) => {}[] | PromiseLike<{}[]>): Promise<{}[]>; (onfulfilled: (value: {}[]) => {}[] | PromiseLike<{}[]>, onrejected: (reason: any) => TResult | PromiseLike): Promise<{}[] | TResult>; (onfulfilled: (value: {}[]) => TResult | PromiseLike, onrejected?: (reason: any) => TResult | PromiseLike): Promise; (onfulfilled: (value: {}[]) => TResult1 | PromiseLike, onrejected: (reason: any) => TResult2 | PromiseLike): Promise; } >Promise.all(result.map(populateItems)) : Promise<{}[]> >Promise.all : { (values: [T1 | PromiseLike, T2 | PromiseLike, T3 | PromiseLike, T4 | PromiseLike, T5 | PromiseLike, T6 | PromiseLike, T7 | PromiseLike, T8 | PromiseLike, T9 | PromiseLike, T10 | PromiseLike]): Promise<[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10]>; (values: [T1 | PromiseLike, T2 | PromiseLike, T3 | PromiseLike, T4 | PromiseLike, T5 | PromiseLike, T6 | PromiseLike, T7 | PromiseLike, T8 | PromiseLike, T9 | PromiseLike]): Promise<[T1, T2, T3, T4, T5, T6, T7, T8, T9]>; (values: [T1 | PromiseLike, T2 | PromiseLike, T3 | PromiseLike, T4 | PromiseLike, T5 | PromiseLike, T6 | PromiseLike, T7 | PromiseLike, T8 | PromiseLike]): Promise<[T1, T2, T3, T4, T5, T6, T7, T8]>; (values: [T1 | PromiseLike, T2 | PromiseLike, T3 | PromiseLike, T4 | PromiseLike, T5 | PromiseLike, T6 | PromiseLike, T7 | PromiseLike]): Promise<[T1, T2, T3, T4, T5, T6, T7]>; (values: [T1 | PromiseLike, T2 | PromiseLike, T3 | PromiseLike, T4 | PromiseLike, T5 | PromiseLike, T6 | PromiseLike]): Promise<[T1, T2, T3, T4, T5, T6]>; (values: [T1 | PromiseLike, T2 | PromiseLike, T3 | PromiseLike, T4 | PromiseLike, T5 | PromiseLike]): Promise<[T1, T2, T3, T4, T5]>; (values: [T1 | PromiseLike, T2 | PromiseLike, T3 | PromiseLike, T4 | PromiseLike]): Promise<[T1, T2, T3, T4]>; (values: [T1 | PromiseLike, T2 | PromiseLike, T3 | PromiseLike]): Promise<[T1, T2, T3]>; (values: [T1 | PromiseLike, T2 | PromiseLike]): Promise<[T1, T2]>; (values: (T | PromiseLike)[]): Promise; (values: Iterable>): Promise; } >Promise : PromiseConstructor @@ -90,7 +90,7 @@ export class BrokenClass { >populateItems : (order: any) => Promise<{}> .then((orders: Array) => { ->then : { (onfulfilled: (value: {}[]) => TResult1 | PromiseLike, onrejected: (reason: any) => TResult2 | PromiseLike): Promise; (onfulfilled: (value: {}[]) => TResult | PromiseLike, onrejected: (reason: any) => TResult | PromiseLike): Promise; (onfulfilled: (value: {}[]) => TResult | PromiseLike): Promise; (): Promise<{}[]>; } +>then : { (onfulfilled?: (value: {}[]) => {}[] | PromiseLike<{}[]>, onrejected?: (reason: any) => {}[] | PromiseLike<{}[]>): Promise<{}[]>; (onfulfilled: (value: {}[]) => {}[] | PromiseLike<{}[]>, onrejected: (reason: any) => TResult | PromiseLike): Promise<{}[] | TResult>; (onfulfilled: (value: {}[]) => TResult | PromiseLike, onrejected?: (reason: any) => TResult | PromiseLike): Promise; (onfulfilled: (value: {}[]) => TResult1 | PromiseLike, onrejected: (reason: any) => TResult2 | PromiseLike): Promise; } >(orders: Array) => { resolve(orders); } : (orders: MyModule.MyModel[]) => void >orders : MyModule.MyModel[] >Array : T[] diff --git a/tests/baselines/reference/inferentialTypingObjectLiteralMethod1.types b/tests/baselines/reference/inferentialTypingObjectLiteralMethod1.types index da2fa24060f..9365013f050 100644 --- a/tests/baselines/reference/inferentialTypingObjectLiteralMethod1.types +++ b/tests/baselines/reference/inferentialTypingObjectLiteralMethod1.types @@ -29,7 +29,7 @@ declare function foo(x: T, y: Int, z: Int): T; foo("", { method(p1) { return p1.length } }, { method(p2) { return undefined } }); >foo("", { method(p1) { return p1.length } }, { method(p2) { return undefined } }) : string >foo : (x: T, y: Int, z: Int) => T ->"" : string +>"" : "" >{ method(p1) { return p1.length } } : { method(p1: string): number; } >method : (p1: string) => number >p1 : string diff --git a/tests/baselines/reference/inferentialTypingObjectLiteralMethod2.types b/tests/baselines/reference/inferentialTypingObjectLiteralMethod2.types index f70305739b8..2ee813193a2 100644 --- a/tests/baselines/reference/inferentialTypingObjectLiteralMethod2.types +++ b/tests/baselines/reference/inferentialTypingObjectLiteralMethod2.types @@ -29,7 +29,7 @@ declare function foo(x: T, y: Int, z: Int): T; foo("", { method(p1) { return p1.length } }, { method(p2) { return undefined } }); >foo("", { method(p1) { return p1.length } }, { method(p2) { return undefined } }) : string >foo : (x: T, y: Int, z: Int) => T ->"" : string +>"" : "" >{ method(p1) { return p1.length } } : { method(p1: string): number; } >method : (p1: string) => number >p1 : string diff --git a/tests/baselines/reference/inferentialTypingUsingApparentType3.types b/tests/baselines/reference/inferentialTypingUsingApparentType3.types index e375fe981e8..1738eff89a8 100644 --- a/tests/baselines/reference/inferentialTypingUsingApparentType3.types +++ b/tests/baselines/reference/inferentialTypingUsingApparentType3.types @@ -19,7 +19,7 @@ class CharField implements Field { >input : string return "Yup"; ->"Yup" : string +>"Yup" : "Yup" } } @@ -32,7 +32,7 @@ class NumberField implements Field { >input : number return 123; ->123 : number +>123 : 123 } } diff --git a/tests/baselines/reference/inferentialTypingWithFunctionType.types b/tests/baselines/reference/inferentialTypingWithFunctionType.types index 460156c91ea..0360adefd7c 100644 --- a/tests/baselines/reference/inferentialTypingWithFunctionType.types +++ b/tests/baselines/reference/inferentialTypingWithFunctionType.types @@ -22,6 +22,6 @@ var s = map("", identity); >s : string >map("", identity) : string >map : (x: T, f: (s: T) => U) => U ->"" : string +>"" : "" >identity : (y: V) => V diff --git a/tests/baselines/reference/inferentialTypingWithFunctionType2.types b/tests/baselines/reference/inferentialTypingWithFunctionType2.types index 6dc4cda3b68..2c4bb2542fb 100644 --- a/tests/baselines/reference/inferentialTypingWithFunctionType2.types +++ b/tests/baselines/reference/inferentialTypingWithFunctionType2.types @@ -15,10 +15,10 @@ var x = [1, 2, 3].map(identity)[0]; >[1, 2, 3].map(identity) : number[] >[1, 2, 3].map : (callbackfn: (value: number, index: number, array: number[]) => U, thisArg?: any) => U[] >[1, 2, 3] : number[] ->1 : number ->2 : number ->3 : number +>1 : 1 +>2 : 2 +>3 : 3 >map : (callbackfn: (value: number, index: number, array: number[]) => U, thisArg?: any) => U[] >identity : (a: A) => A ->0 : number +>0 : 0 diff --git a/tests/baselines/reference/inferentialTypingWithFunctionTypeNested.types b/tests/baselines/reference/inferentialTypingWithFunctionTypeNested.types index a83379b4c73..86219faf537 100644 --- a/tests/baselines/reference/inferentialTypingWithFunctionTypeNested.types +++ b/tests/baselines/reference/inferentialTypingWithFunctionTypeNested.types @@ -23,7 +23,7 @@ var s = map("", () => { return { x: identity }; }); >s : string >map("", () => { return { x: identity }; }) : string >map : (x: T, f: () => { x: (s: T) => U; }) => U ->"" : string +>"" : "" >() => { return { x: identity }; } : () => { x: (y: string) => string; } >{ x: identity } : { x: (y: V) => V; } >x : (y: V) => V diff --git a/tests/baselines/reference/inferentialTypingWithFunctionTypeSyntacticScenarios.js b/tests/baselines/reference/inferentialTypingWithFunctionTypeSyntacticScenarios.js index 2f5eea63a8a..018726f5549 100644 --- a/tests/baselines/reference/inferentialTypingWithFunctionTypeSyntacticScenarios.js +++ b/tests/baselines/reference/inferentialTypingWithFunctionTypeSyntacticScenarios.js @@ -1,4 +1,5 @@ //// [inferentialTypingWithFunctionTypeSyntacticScenarios.ts] + declare function map(array: T, func: (x: T) => U): U; declare function identity(y: V): V; var s: string; diff --git a/tests/baselines/reference/inferentialTypingWithFunctionTypeSyntacticScenarios.symbols b/tests/baselines/reference/inferentialTypingWithFunctionTypeSyntacticScenarios.symbols index a9571bc8a38..1ad418cb599 100644 --- a/tests/baselines/reference/inferentialTypingWithFunctionTypeSyntacticScenarios.symbols +++ b/tests/baselines/reference/inferentialTypingWithFunctionTypeSyntacticScenarios.symbols @@ -1,94 +1,95 @@ === tests/cases/compiler/inferentialTypingWithFunctionTypeSyntacticScenarios.ts === + declare function map(array: T, func: (x: T) => U): U; >map : Symbol(map, Decl(inferentialTypingWithFunctionTypeSyntacticScenarios.ts, 0, 0)) ->T : Symbol(T, Decl(inferentialTypingWithFunctionTypeSyntacticScenarios.ts, 0, 21)) ->U : Symbol(U, Decl(inferentialTypingWithFunctionTypeSyntacticScenarios.ts, 0, 23)) ->array : Symbol(array, Decl(inferentialTypingWithFunctionTypeSyntacticScenarios.ts, 0, 27)) ->T : Symbol(T, Decl(inferentialTypingWithFunctionTypeSyntacticScenarios.ts, 0, 21)) ->func : Symbol(func, Decl(inferentialTypingWithFunctionTypeSyntacticScenarios.ts, 0, 36)) ->x : Symbol(x, Decl(inferentialTypingWithFunctionTypeSyntacticScenarios.ts, 0, 44)) ->T : Symbol(T, Decl(inferentialTypingWithFunctionTypeSyntacticScenarios.ts, 0, 21)) ->U : Symbol(U, Decl(inferentialTypingWithFunctionTypeSyntacticScenarios.ts, 0, 23)) ->U : Symbol(U, Decl(inferentialTypingWithFunctionTypeSyntacticScenarios.ts, 0, 23)) +>T : Symbol(T, Decl(inferentialTypingWithFunctionTypeSyntacticScenarios.ts, 1, 21)) +>U : Symbol(U, Decl(inferentialTypingWithFunctionTypeSyntacticScenarios.ts, 1, 23)) +>array : Symbol(array, Decl(inferentialTypingWithFunctionTypeSyntacticScenarios.ts, 1, 27)) +>T : Symbol(T, Decl(inferentialTypingWithFunctionTypeSyntacticScenarios.ts, 1, 21)) +>func : Symbol(func, Decl(inferentialTypingWithFunctionTypeSyntacticScenarios.ts, 1, 36)) +>x : Symbol(x, Decl(inferentialTypingWithFunctionTypeSyntacticScenarios.ts, 1, 44)) +>T : Symbol(T, Decl(inferentialTypingWithFunctionTypeSyntacticScenarios.ts, 1, 21)) +>U : Symbol(U, Decl(inferentialTypingWithFunctionTypeSyntacticScenarios.ts, 1, 23)) +>U : Symbol(U, Decl(inferentialTypingWithFunctionTypeSyntacticScenarios.ts, 1, 23)) declare function identity(y: V): V; ->identity : Symbol(identity, Decl(inferentialTypingWithFunctionTypeSyntacticScenarios.ts, 0, 59)) ->V : Symbol(V, Decl(inferentialTypingWithFunctionTypeSyntacticScenarios.ts, 1, 26)) ->y : Symbol(y, Decl(inferentialTypingWithFunctionTypeSyntacticScenarios.ts, 1, 29)) ->V : Symbol(V, Decl(inferentialTypingWithFunctionTypeSyntacticScenarios.ts, 1, 26)) ->V : Symbol(V, Decl(inferentialTypingWithFunctionTypeSyntacticScenarios.ts, 1, 26)) +>identity : Symbol(identity, Decl(inferentialTypingWithFunctionTypeSyntacticScenarios.ts, 1, 59)) +>V : Symbol(V, Decl(inferentialTypingWithFunctionTypeSyntacticScenarios.ts, 2, 26)) +>y : Symbol(y, Decl(inferentialTypingWithFunctionTypeSyntacticScenarios.ts, 2, 29)) +>V : Symbol(V, Decl(inferentialTypingWithFunctionTypeSyntacticScenarios.ts, 2, 26)) +>V : Symbol(V, Decl(inferentialTypingWithFunctionTypeSyntacticScenarios.ts, 2, 26)) var s: string; ->s : Symbol(s, Decl(inferentialTypingWithFunctionTypeSyntacticScenarios.ts, 2, 3)) +>s : Symbol(s, Decl(inferentialTypingWithFunctionTypeSyntacticScenarios.ts, 3, 3)) // dotted name var dottedIdentity = { x: identity }; ->dottedIdentity : Symbol(dottedIdentity, Decl(inferentialTypingWithFunctionTypeSyntacticScenarios.ts, 5, 3)) ->x : Symbol(x, Decl(inferentialTypingWithFunctionTypeSyntacticScenarios.ts, 5, 22)) ->identity : Symbol(identity, Decl(inferentialTypingWithFunctionTypeSyntacticScenarios.ts, 0, 59)) +>dottedIdentity : Symbol(dottedIdentity, Decl(inferentialTypingWithFunctionTypeSyntacticScenarios.ts, 6, 3)) +>x : Symbol(x, Decl(inferentialTypingWithFunctionTypeSyntacticScenarios.ts, 6, 22)) +>identity : Symbol(identity, Decl(inferentialTypingWithFunctionTypeSyntacticScenarios.ts, 1, 59)) s = map("", dottedIdentity.x); ->s : Symbol(s, Decl(inferentialTypingWithFunctionTypeSyntacticScenarios.ts, 2, 3)) +>s : Symbol(s, Decl(inferentialTypingWithFunctionTypeSyntacticScenarios.ts, 3, 3)) >map : Symbol(map, Decl(inferentialTypingWithFunctionTypeSyntacticScenarios.ts, 0, 0)) ->dottedIdentity.x : Symbol(x, Decl(inferentialTypingWithFunctionTypeSyntacticScenarios.ts, 5, 22)) ->dottedIdentity : Symbol(dottedIdentity, Decl(inferentialTypingWithFunctionTypeSyntacticScenarios.ts, 5, 3)) ->x : Symbol(x, Decl(inferentialTypingWithFunctionTypeSyntacticScenarios.ts, 5, 22)) +>dottedIdentity.x : Symbol(x, Decl(inferentialTypingWithFunctionTypeSyntacticScenarios.ts, 6, 22)) +>dottedIdentity : Symbol(dottedIdentity, Decl(inferentialTypingWithFunctionTypeSyntacticScenarios.ts, 6, 3)) +>x : Symbol(x, Decl(inferentialTypingWithFunctionTypeSyntacticScenarios.ts, 6, 22)) // index expression s = map("", dottedIdentity['x']); ->s : Symbol(s, Decl(inferentialTypingWithFunctionTypeSyntacticScenarios.ts, 2, 3)) +>s : Symbol(s, Decl(inferentialTypingWithFunctionTypeSyntacticScenarios.ts, 3, 3)) >map : Symbol(map, Decl(inferentialTypingWithFunctionTypeSyntacticScenarios.ts, 0, 0)) ->dottedIdentity : Symbol(dottedIdentity, Decl(inferentialTypingWithFunctionTypeSyntacticScenarios.ts, 5, 3)) ->'x' : Symbol(x, Decl(inferentialTypingWithFunctionTypeSyntacticScenarios.ts, 5, 22)) +>dottedIdentity : Symbol(dottedIdentity, Decl(inferentialTypingWithFunctionTypeSyntacticScenarios.ts, 6, 3)) +>'x' : Symbol(x, Decl(inferentialTypingWithFunctionTypeSyntacticScenarios.ts, 6, 22)) // function call s = map("", (() => identity)()); ->s : Symbol(s, Decl(inferentialTypingWithFunctionTypeSyntacticScenarios.ts, 2, 3)) +>s : Symbol(s, Decl(inferentialTypingWithFunctionTypeSyntacticScenarios.ts, 3, 3)) >map : Symbol(map, Decl(inferentialTypingWithFunctionTypeSyntacticScenarios.ts, 0, 0)) ->identity : Symbol(identity, Decl(inferentialTypingWithFunctionTypeSyntacticScenarios.ts, 0, 59)) +>identity : Symbol(identity, Decl(inferentialTypingWithFunctionTypeSyntacticScenarios.ts, 1, 59)) // construct interface IdentityConstructor { ->IdentityConstructor : Symbol(IdentityConstructor, Decl(inferentialTypingWithFunctionTypeSyntacticScenarios.ts, 12, 32)) +>IdentityConstructor : Symbol(IdentityConstructor, Decl(inferentialTypingWithFunctionTypeSyntacticScenarios.ts, 13, 32)) new (): typeof identity; ->identity : Symbol(identity, Decl(inferentialTypingWithFunctionTypeSyntacticScenarios.ts, 0, 59)) +>identity : Symbol(identity, Decl(inferentialTypingWithFunctionTypeSyntacticScenarios.ts, 1, 59)) } var ic: IdentityConstructor; ->ic : Symbol(ic, Decl(inferentialTypingWithFunctionTypeSyntacticScenarios.ts, 18, 3)) ->IdentityConstructor : Symbol(IdentityConstructor, Decl(inferentialTypingWithFunctionTypeSyntacticScenarios.ts, 12, 32)) +>ic : Symbol(ic, Decl(inferentialTypingWithFunctionTypeSyntacticScenarios.ts, 19, 3)) +>IdentityConstructor : Symbol(IdentityConstructor, Decl(inferentialTypingWithFunctionTypeSyntacticScenarios.ts, 13, 32)) s = map("", new ic()); ->s : Symbol(s, Decl(inferentialTypingWithFunctionTypeSyntacticScenarios.ts, 2, 3)) +>s : Symbol(s, Decl(inferentialTypingWithFunctionTypeSyntacticScenarios.ts, 3, 3)) >map : Symbol(map, Decl(inferentialTypingWithFunctionTypeSyntacticScenarios.ts, 0, 0)) ->ic : Symbol(ic, Decl(inferentialTypingWithFunctionTypeSyntacticScenarios.ts, 18, 3)) +>ic : Symbol(ic, Decl(inferentialTypingWithFunctionTypeSyntacticScenarios.ts, 19, 3)) // assignment var t; ->t : Symbol(t, Decl(inferentialTypingWithFunctionTypeSyntacticScenarios.ts, 22, 3)) +>t : Symbol(t, Decl(inferentialTypingWithFunctionTypeSyntacticScenarios.ts, 23, 3)) s = map("", t = identity); ->s : Symbol(s, Decl(inferentialTypingWithFunctionTypeSyntacticScenarios.ts, 2, 3)) +>s : Symbol(s, Decl(inferentialTypingWithFunctionTypeSyntacticScenarios.ts, 3, 3)) >map : Symbol(map, Decl(inferentialTypingWithFunctionTypeSyntacticScenarios.ts, 0, 0)) ->t : Symbol(t, Decl(inferentialTypingWithFunctionTypeSyntacticScenarios.ts, 22, 3)) ->identity : Symbol(identity, Decl(inferentialTypingWithFunctionTypeSyntacticScenarios.ts, 0, 59)) +>t : Symbol(t, Decl(inferentialTypingWithFunctionTypeSyntacticScenarios.ts, 23, 3)) +>identity : Symbol(identity, Decl(inferentialTypingWithFunctionTypeSyntacticScenarios.ts, 1, 59)) // type assertion s = map("", identity); ->s : Symbol(s, Decl(inferentialTypingWithFunctionTypeSyntacticScenarios.ts, 2, 3)) +>s : Symbol(s, Decl(inferentialTypingWithFunctionTypeSyntacticScenarios.ts, 3, 3)) >map : Symbol(map, Decl(inferentialTypingWithFunctionTypeSyntacticScenarios.ts, 0, 0)) ->identity : Symbol(identity, Decl(inferentialTypingWithFunctionTypeSyntacticScenarios.ts, 0, 59)) ->identity : Symbol(identity, Decl(inferentialTypingWithFunctionTypeSyntacticScenarios.ts, 0, 59)) +>identity : Symbol(identity, Decl(inferentialTypingWithFunctionTypeSyntacticScenarios.ts, 1, 59)) +>identity : Symbol(identity, Decl(inferentialTypingWithFunctionTypeSyntacticScenarios.ts, 1, 59)) // parenthesized expression s = map("", (identity)); ->s : Symbol(s, Decl(inferentialTypingWithFunctionTypeSyntacticScenarios.ts, 2, 3)) +>s : Symbol(s, Decl(inferentialTypingWithFunctionTypeSyntacticScenarios.ts, 3, 3)) >map : Symbol(map, Decl(inferentialTypingWithFunctionTypeSyntacticScenarios.ts, 0, 0)) ->identity : Symbol(identity, Decl(inferentialTypingWithFunctionTypeSyntacticScenarios.ts, 0, 59)) +>identity : Symbol(identity, Decl(inferentialTypingWithFunctionTypeSyntacticScenarios.ts, 1, 59)) // comma s = map("", ("", identity)); ->s : Symbol(s, Decl(inferentialTypingWithFunctionTypeSyntacticScenarios.ts, 2, 3)) +>s : Symbol(s, Decl(inferentialTypingWithFunctionTypeSyntacticScenarios.ts, 3, 3)) >map : Symbol(map, Decl(inferentialTypingWithFunctionTypeSyntacticScenarios.ts, 0, 0)) ->identity : Symbol(identity, Decl(inferentialTypingWithFunctionTypeSyntacticScenarios.ts, 0, 59)) +>identity : Symbol(identity, Decl(inferentialTypingWithFunctionTypeSyntacticScenarios.ts, 1, 59)) diff --git a/tests/baselines/reference/inferentialTypingWithFunctionTypeSyntacticScenarios.types b/tests/baselines/reference/inferentialTypingWithFunctionTypeSyntacticScenarios.types index 5a4decef4dc..258b4cbfa46 100644 --- a/tests/baselines/reference/inferentialTypingWithFunctionTypeSyntacticScenarios.types +++ b/tests/baselines/reference/inferentialTypingWithFunctionTypeSyntacticScenarios.types @@ -1,4 +1,5 @@ === tests/cases/compiler/inferentialTypingWithFunctionTypeSyntacticScenarios.ts === + declare function map(array: T, func: (x: T) => U): U; >map : (array: T, func: (x: T) => U) => U >T : T @@ -33,7 +34,7 @@ s = map("", dottedIdentity.x); >s : string >map("", dottedIdentity.x) : string >map : (array: T, func: (x: T) => U) => U ->"" : string +>"" : "" >dottedIdentity.x : (y: V) => V >dottedIdentity : { x: (y: V) => V; } >x : (y: V) => V @@ -44,10 +45,10 @@ s = map("", dottedIdentity['x']); >s : string >map("", dottedIdentity['x']) : string >map : (array: T, func: (x: T) => U) => U ->"" : string +>"" : "" >dottedIdentity['x'] : (y: V) => V >dottedIdentity : { x: (y: V) => V; } ->'x' : string +>'x' : "x" // function call s = map("", (() => identity)()); @@ -55,7 +56,7 @@ s = map("", (() => identity)()); >s : string >map("", (() => identity)()) : string >map : (array: T, func: (x: T) => U) => U ->"" : string +>"" : "" >(() => identity)() : (y: V) => V >(() => identity) : () => (y: V) => V >() => identity : () => (y: V) => V @@ -77,7 +78,7 @@ s = map("", new ic()); >s : string >map("", new ic()) : string >map : (array: T, func: (x: T) => U) => U ->"" : string +>"" : "" >new ic() : (y: V) => V >ic : IdentityConstructor @@ -90,7 +91,7 @@ s = map("", t = identity); >s : string >map("", t = identity) : string >map : (array: T, func: (x: T) => U) => U ->"" : string +>"" : "" >t = identity : (y: V) => V >t : any >identity : (y: V) => V @@ -101,7 +102,7 @@ s = map("", identity); >s : string >map("", identity) : string >map : (array: T, func: (x: T) => U) => U ->"" : string +>"" : "" >identity : (y: V) => V >identity : (y: V) => V >identity : (y: V) => V @@ -112,7 +113,7 @@ s = map("", (identity)); >s : string >map("", (identity)) : string >map : (array: T, func: (x: T) => U) => U ->"" : string +>"" : "" >(identity) : (y: V) => V >identity : (y: V) => V @@ -122,9 +123,9 @@ s = map("", ("", identity)); >s : string >map("", ("", identity)) : string >map : (array: T, func: (x: T) => U) => U ->"" : string +>"" : "" >("", identity) : (y: V) => V >"", identity : (y: V) => V ->"" : string +>"" : "" >identity : (y: V) => V diff --git a/tests/baselines/reference/inferentialTypingWithFunctionTypeZip.types b/tests/baselines/reference/inferentialTypingWithFunctionTypeZip.types index cc9d8790bd4..58d51e48987 100644 --- a/tests/baselines/reference/inferentialTypingWithFunctionTypeZip.types +++ b/tests/baselines/reference/inferentialTypingWithFunctionTypeZip.types @@ -34,11 +34,11 @@ var result = zipWith([1, 2], ['a', 'b'], pair); >zipWith([1, 2], ['a', 'b'], pair) : { x: number; y: {}; }[] >zipWith : (a: T[], b: S[], f: (x: T) => (y: S) => U) => U[] >[1, 2] : number[] ->1 : number ->2 : number +>1 : 1 +>2 : 2 >['a', 'b'] : string[] ->'a' : string ->'b' : string +>'a' : "a" +>'b' : "b" >pair : (x: T) => (y: S) => { x: T; y: S; } var i = result[0].x; // number @@ -46,6 +46,6 @@ var i = result[0].x; // number >result[0].x : number >result[0] : { x: number; y: {}; } >result : { x: number; y: {}; }[] ->0 : number +>0 : 0 >x : number diff --git a/tests/baselines/reference/inferentialTypingWithObjectLiteralProperties.errors.txt b/tests/baselines/reference/inferentialTypingWithObjectLiteralProperties.errors.txt index 9dfb41c0fac..69f21589670 100644 --- a/tests/baselines/reference/inferentialTypingWithObjectLiteralProperties.errors.txt +++ b/tests/baselines/reference/inferentialTypingWithObjectLiteralProperties.errors.txt @@ -1,5 +1,5 @@ -tests/cases/compiler/inferentialTypingWithObjectLiteralProperties.ts(4,1): error TS2322: Type 'string' is not assignable to type 'number'. -tests/cases/compiler/inferentialTypingWithObjectLiteralProperties.ts(5,1): error TS2322: Type 'string' is not assignable to type 'number'. +tests/cases/compiler/inferentialTypingWithObjectLiteralProperties.ts(4,1): error TS2322: Type '""' is not assignable to type 'number'. +tests/cases/compiler/inferentialTypingWithObjectLiteralProperties.ts(5,1): error TS2322: Type '""' is not assignable to type 'number'. ==== tests/cases/compiler/inferentialTypingWithObjectLiteralProperties.ts (2 errors) ==== @@ -8,8 +8,8 @@ tests/cases/compiler/inferentialTypingWithObjectLiteralProperties.ts(5,1): error } f({ x: [null] }, { x: [1] }).x[0] = "" // ok ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2322: Type 'string' is not assignable to type 'number'. +!!! error TS2322: Type '""' is not assignable to type 'number'. f({ x: [1] }, { x: [null] }).x[0] = "" // was error TS2011: Cannot convert 'string' to 'number'. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2322: Type 'string' is not assignable to type 'number'. +!!! error TS2322: Type '""' is not assignable to type 'number'. \ No newline at end of file diff --git a/tests/baselines/reference/inferredFunctionReturnTypeIsEmptyType.errors.txt b/tests/baselines/reference/inferredFunctionReturnTypeIsEmptyType.errors.txt deleted file mode 100644 index bab58d0e4cf..00000000000 --- a/tests/baselines/reference/inferredFunctionReturnTypeIsEmptyType.errors.txt +++ /dev/null @@ -1,16 +0,0 @@ -tests/cases/compiler/inferredFunctionReturnTypeIsEmptyType.ts(2,10): error TS2354: No best common type exists among return expressions. - - -==== tests/cases/compiler/inferredFunctionReturnTypeIsEmptyType.ts (1 errors) ==== - - function foo() { - ~~~ -!!! error TS2354: No best common type exists among return expressions. - if (true) { - return 42; - } - else { - return "42"; - } - }; - \ No newline at end of file diff --git a/tests/baselines/reference/inferredFunctionReturnTypeIsEmptyType.symbols b/tests/baselines/reference/inferredFunctionReturnTypeIsEmptyType.symbols new file mode 100644 index 00000000000..059a992c3f3 --- /dev/null +++ b/tests/baselines/reference/inferredFunctionReturnTypeIsEmptyType.symbols @@ -0,0 +1,13 @@ +=== tests/cases/compiler/inferredFunctionReturnTypeIsEmptyType.ts === + +function foo() { +>foo : Symbol(foo, Decl(inferredFunctionReturnTypeIsEmptyType.ts, 0, 0)) + + if (true) { + return 42; + } + else { + return "42"; + } +}; + diff --git a/tests/baselines/reference/inferredFunctionReturnTypeIsEmptyType.types b/tests/baselines/reference/inferredFunctionReturnTypeIsEmptyType.types new file mode 100644 index 00000000000..3775ffd2faa --- /dev/null +++ b/tests/baselines/reference/inferredFunctionReturnTypeIsEmptyType.types @@ -0,0 +1,17 @@ +=== tests/cases/compiler/inferredFunctionReturnTypeIsEmptyType.ts === + +function foo() { +>foo : () => 42 | "42" + + if (true) { +>true : true + + return 42; +>42 : 42 + } + else { + return "42"; +>"42" : "42" + } +}; + diff --git a/tests/baselines/reference/inheritFromGenericTypeParameter.errors.txt b/tests/baselines/reference/inheritFromGenericTypeParameter.errors.txt index c043e37575c..08d138f2e5d 100644 --- a/tests/baselines/reference/inheritFromGenericTypeParameter.errors.txt +++ b/tests/baselines/reference/inheritFromGenericTypeParameter.errors.txt @@ -1,11 +1,11 @@ -tests/cases/compiler/inheritFromGenericTypeParameter.ts(1,20): error TS2304: Cannot find name 'T'. +tests/cases/compiler/inheritFromGenericTypeParameter.ts(1,20): error TS2693: 'T' only refers to a type, but is being used as a value here. tests/cases/compiler/inheritFromGenericTypeParameter.ts(2,24): error TS2312: An interface may only extend a class or another interface. ==== tests/cases/compiler/inheritFromGenericTypeParameter.ts (2 errors) ==== class C extends T { } ~ -!!! error TS2304: Cannot find name 'T'. +!!! error TS2693: 'T' only refers to a type, but is being used as a value here. interface I extends T { } ~ !!! error TS2312: An interface may only extend a class or another interface. \ No newline at end of file diff --git a/tests/baselines/reference/inheritanceMemberFuncOverridingMethod.types b/tests/baselines/reference/inheritanceMemberFuncOverridingMethod.types index 3f170d1a6ec..444c9b77069 100644 --- a/tests/baselines/reference/inheritanceMemberFuncOverridingMethod.types +++ b/tests/baselines/reference/inheritanceMemberFuncOverridingMethod.types @@ -6,7 +6,7 @@ class a { >x : () => string return "10"; ->"10" : string +>"10" : "10" } } @@ -18,6 +18,6 @@ class b extends a { >x : () => string return "20"; ->"20" : string +>"20" : "20" } } diff --git a/tests/baselines/reference/inheritanceStaticFuncOverridingMethod.types b/tests/baselines/reference/inheritanceStaticFuncOverridingMethod.types index 22fa0a6660f..5a1320cd666 100644 --- a/tests/baselines/reference/inheritanceStaticFuncOverridingMethod.types +++ b/tests/baselines/reference/inheritanceStaticFuncOverridingMethod.types @@ -6,7 +6,7 @@ class a { >x : () => string return "10"; ->"10" : string +>"10" : "10" } } @@ -18,6 +18,6 @@ class b extends a { >x : () => string return "20"; ->"20" : string +>"20" : "20" } } diff --git a/tests/baselines/reference/inheritanceStaticFuncOverridingPropertyOfFuncType.types b/tests/baselines/reference/inheritanceStaticFuncOverridingPropertyOfFuncType.types index a7df20382ec..3b6741770a4 100644 --- a/tests/baselines/reference/inheritanceStaticFuncOverridingPropertyOfFuncType.types +++ b/tests/baselines/reference/inheritanceStaticFuncOverridingPropertyOfFuncType.types @@ -14,6 +14,6 @@ class b extends a { >x : () => string return "20"; ->"20" : string +>"20" : "20" } } diff --git a/tests/baselines/reference/inheritedConstructorWithRestParams.errors.txt b/tests/baselines/reference/inheritedConstructorWithRestParams.errors.txt index fd63eafbaf7..5e9775b81d9 100644 --- a/tests/baselines/reference/inheritedConstructorWithRestParams.errors.txt +++ b/tests/baselines/reference/inheritedConstructorWithRestParams.errors.txt @@ -1,5 +1,5 @@ -tests/cases/compiler/inheritedConstructorWithRestParams.ts(13,17): error TS2345: Argument of type 'number' is not assignable to parameter of type 'string'. -tests/cases/compiler/inheritedConstructorWithRestParams.ts(14,13): error TS2345: Argument of type 'number' is not assignable to parameter of type 'string'. +tests/cases/compiler/inheritedConstructorWithRestParams.ts(13,17): error TS2345: Argument of type '3' is not assignable to parameter of type 'string'. +tests/cases/compiler/inheritedConstructorWithRestParams.ts(14,13): error TS2345: Argument of type '3' is not assignable to parameter of type 'string'. ==== tests/cases/compiler/inheritedConstructorWithRestParams.ts (2 errors) ==== @@ -17,7 +17,7 @@ tests/cases/compiler/inheritedConstructorWithRestParams.ts(14,13): error TS2345: // Errors new Derived("", 3); ~ -!!! error TS2345: Argument of type 'number' is not assignable to parameter of type 'string'. +!!! error TS2345: Argument of type '3' is not assignable to parameter of type 'string'. new Derived(3); ~ -!!! error TS2345: Argument of type 'number' is not assignable to parameter of type 'string'. \ No newline at end of file +!!! error TS2345: Argument of type '3' is not assignable to parameter of type 'string'. \ No newline at end of file diff --git a/tests/baselines/reference/inheritedConstructorWithRestParams2.errors.txt b/tests/baselines/reference/inheritedConstructorWithRestParams2.errors.txt index 514d0d8941f..9249e9512bc 100644 --- a/tests/baselines/reference/inheritedConstructorWithRestParams2.errors.txt +++ b/tests/baselines/reference/inheritedConstructorWithRestParams2.errors.txt @@ -1,6 +1,6 @@ -tests/cases/compiler/inheritedConstructorWithRestParams2.ts(32,13): error TS2345: Argument of type 'number' is not assignable to parameter of type 'string'. -tests/cases/compiler/inheritedConstructorWithRestParams2.ts(33,17): error TS2345: Argument of type 'number' is not assignable to parameter of type 'string'. -tests/cases/compiler/inheritedConstructorWithRestParams2.ts(34,17): error TS2345: Argument of type 'number' is not assignable to parameter of type 'string'. +tests/cases/compiler/inheritedConstructorWithRestParams2.ts(32,13): error TS2345: Argument of type '3' is not assignable to parameter of type 'string'. +tests/cases/compiler/inheritedConstructorWithRestParams2.ts(33,17): error TS2345: Argument of type '3' is not assignable to parameter of type 'string'. +tests/cases/compiler/inheritedConstructorWithRestParams2.ts(34,17): error TS2345: Argument of type '3' is not assignable to parameter of type 'string'. ==== tests/cases/compiler/inheritedConstructorWithRestParams2.ts (3 errors) ==== @@ -37,10 +37,10 @@ tests/cases/compiler/inheritedConstructorWithRestParams2.ts(34,17): error TS2345 // Errors new Derived(3); ~ -!!! error TS2345: Argument of type 'number' is not assignable to parameter of type 'string'. +!!! error TS2345: Argument of type '3' is not assignable to parameter of type 'string'. new Derived("", 3, "", 3); ~ -!!! error TS2345: Argument of type 'number' is not assignable to parameter of type 'string'. +!!! error TS2345: Argument of type '3' is not assignable to parameter of type 'string'. new Derived("", 3, "", ""); ~ -!!! error TS2345: Argument of type 'number' is not assignable to parameter of type 'string'. \ No newline at end of file +!!! error TS2345: Argument of type '3' is not assignable to parameter of type 'string'. \ No newline at end of file diff --git a/tests/baselines/reference/inheritedFunctionAssignmentCompatibility.types b/tests/baselines/reference/inheritedFunctionAssignmentCompatibility.types index b13fde1189a..ce918d27e9f 100644 --- a/tests/baselines/reference/inheritedFunctionAssignmentCompatibility.types +++ b/tests/baselines/reference/inheritedFunctionAssignmentCompatibility.types @@ -14,7 +14,7 @@ fn((a, b) => true); >(a, b) => true : (a: any, b: any) => boolean >a : any >b : any ->true : boolean +>true : true fn(function (a, b) { return true; }) >fn(function (a, b) { return true; }) : void @@ -22,6 +22,6 @@ fn(function (a, b) { return true; }) >function (a, b) { return true; } : (a: any, b: any) => boolean >a : any >b : any ->true : boolean +>true : true diff --git a/tests/baselines/reference/inheritedOverloadedSpecializedSignatures.types b/tests/baselines/reference/inheritedOverloadedSpecializedSignatures.types index 563cb58a755..d15aab73b04 100644 --- a/tests/baselines/reference/inheritedOverloadedSpecializedSignatures.types +++ b/tests/baselines/reference/inheritedOverloadedSpecializedSignatures.types @@ -26,7 +26,7 @@ b('foo').charAt(0); >b : B >'foo' : "foo" >charAt : (pos: number) => string ->0 : number +>0 : 0 interface A { >A : A @@ -118,7 +118,7 @@ var x5: void = c('A0'); >x5 : void >c('A0') : void >c : C ->'A0' : string +>'A0' : "A0" var x6: number[] = c('C1'); >x6 : number[] @@ -142,5 +142,5 @@ var x9: void = c('generic'); >x9 : void >c('generic') : void >c : C ->'generic' : string +>'generic' : "generic" diff --git a/tests/baselines/reference/initializePropertiesWithRenamedLet.types b/tests/baselines/reference/initializePropertiesWithRenamedLet.types index 3c6938cd643..65ea68059a7 100644 --- a/tests/baselines/reference/initializePropertiesWithRenamedLet.types +++ b/tests/baselines/reference/initializePropertiesWithRenamedLet.types @@ -4,7 +4,7 @@ var x0; >x0 : any if (true) { ->true : boolean +>true : true let x0; >x0 : any @@ -27,20 +27,20 @@ var x, y, z; >z : any if (true) { ->true : boolean +>true : true let { x: x } = { x: 0 }; >x : any >x : number >{ x: 0 } : { x: number; } >x : number ->0 : number +>0 : 0 let { y } = { y: 0 }; >y : number >{ y: 0 } : { y: number; } >y : number ->0 : number +>0 : 0 let z; >z : any @@ -53,7 +53,7 @@ if (true) { >z : any >{ z: 0 } : { z: number; } >z : number ->0 : number +>0 : 0 ({ z } = { z: 0 }); >({ z } = { z: 0 }) : { z: number; } @@ -62,5 +62,5 @@ if (true) { >z : any >{ z: 0 } : { z: number; } >z : number ->0 : number +>0 : 0 } diff --git a/tests/baselines/reference/initializersInAmbientEnums.types b/tests/baselines/reference/initializersInAmbientEnums.types index 40996e9b40a..042ddbc50c9 100644 --- a/tests/baselines/reference/initializersInAmbientEnums.types +++ b/tests/baselines/reference/initializersInAmbientEnums.types @@ -4,7 +4,7 @@ declare enum E { a = 10, >a : E ->10 : number +>10 : 10 b = a, >b : E @@ -13,8 +13,8 @@ declare enum E { e = 10 << 2 * 8, >e : E >10 << 2 * 8 : number ->10 : number +>10 : 10 >2 * 8 : number ->2 : number ->8 : number +>2 : 2 +>8 : 8 } diff --git a/tests/baselines/reference/initializersWidened.types b/tests/baselines/reference/initializersWidened.types index 766f859029a..17de14e9e94 100644 --- a/tests/baselines/reference/initializersWidened.types +++ b/tests/baselines/reference/initializersWidened.types @@ -12,7 +12,7 @@ var y1 = undefined; var z1 = void 0; >z1 : any >void 0 : undefined ->0 : number +>0 : 0 // these are not widened @@ -35,7 +35,7 @@ var y3: undefined = undefined; var z3: undefined = void 0; >z3 : undefined >void 0 : undefined ->0 : number +>0 : 0 // widen only when all constituents of union are widening @@ -55,9 +55,9 @@ var z4 = void 0 || void 0; >z4 : any >void 0 || void 0 : undefined >void 0 : undefined ->0 : number +>0 : 0 >void 0 : undefined ->0 : number +>0 : 0 var x5 = null || x2; >x5 : null @@ -75,6 +75,6 @@ var z5 = void 0 || y2; >z5 : undefined >void 0 || y2 : undefined >void 0 : undefined ->0 : number +>0 : 0 >y2 : undefined diff --git a/tests/baselines/reference/innerAliases.errors.txt b/tests/baselines/reference/innerAliases.errors.txt index e4699c0825b..874ef98ccce 100644 --- a/tests/baselines/reference/innerAliases.errors.txt +++ b/tests/baselines/reference/innerAliases.errors.txt @@ -1,4 +1,4 @@ -tests/cases/compiler/innerAliases.ts(19,10): error TS2305: Module 'D' has no exported member 'inner'. +tests/cases/compiler/innerAliases.ts(19,10): error TS2694: Namespace 'D' has no exported member 'inner'. tests/cases/compiler/innerAliases.ts(21,11): error TS2339: Property 'inner' does not exist on type 'typeof D'. @@ -23,7 +23,7 @@ tests/cases/compiler/innerAliases.ts(21,11): error TS2339: Property 'inner' does var c: D.inner.Class1; ~~~~~ -!!! error TS2305: Module 'D' has no exported member 'inner'. +!!! error TS2694: Namespace 'D' has no exported member 'inner'. c = new D.inner.Class1(); ~~~~~ diff --git a/tests/baselines/reference/innerFunc.types b/tests/baselines/reference/innerFunc.types index 48d98ae42e1..700ca630233 100644 --- a/tests/baselines/reference/innerFunc.types +++ b/tests/baselines/reference/innerFunc.types @@ -4,7 +4,7 @@ function salt() { function pepper() { return 5;} >pepper : () => number ->5 : number +>5 : 5 return pepper(); >pepper() : number @@ -19,7 +19,7 @@ module M { function oxygen() { return 6; }; >oxygen : () => number ->6 : number +>6 : 6 return oxygen(); >oxygen() : number diff --git a/tests/baselines/reference/innerOverloads.types b/tests/baselines/reference/innerOverloads.types index 68af57b3bea..b15f9e5bf22 100644 --- a/tests/baselines/reference/innerOverloads.types +++ b/tests/baselines/reference/innerOverloads.types @@ -19,7 +19,7 @@ function outer() { return inner(0); >inner(0) : any >inner : { (x: number): any; (x: string): any; } ->0 : number +>0 : 0 } var x = outer(); // should work diff --git a/tests/baselines/reference/innerTypeCheckOfLambdaArgument.errors.txt b/tests/baselines/reference/innerTypeCheckOfLambdaArgument.errors.txt index b5e56d2f4e3..0e0bcde70de 100644 --- a/tests/baselines/reference/innerTypeCheckOfLambdaArgument.errors.txt +++ b/tests/baselines/reference/innerTypeCheckOfLambdaArgument.errors.txt @@ -1,4 +1,4 @@ -tests/cases/compiler/innerTypeCheckOfLambdaArgument.ts(10,7): error TS2322: Type 'number' is not assignable to type 'string'. +tests/cases/compiler/innerTypeCheckOfLambdaArgument.ts(10,7): error TS2322: Type '10' is not assignable to type 'string'. ==== tests/cases/compiler/innerTypeCheckOfLambdaArgument.ts (1 errors) ==== @@ -13,7 +13,7 @@ tests/cases/compiler/innerTypeCheckOfLambdaArgument.ts(10,7): error TS2322: Type // otherwise, there's a bug in overload resolution / partial typechecking var k: string = 10; ~ -!!! error TS2322: Type 'number' is not assignable to type 'string'. +!!! error TS2322: Type '10' is not assignable to type 'string'. } ); \ No newline at end of file diff --git a/tests/baselines/reference/instanceAndStaticDeclarations1.types b/tests/baselines/reference/instanceAndStaticDeclarations1.types index cbed990690d..91bd5e7eb52 100644 --- a/tests/baselines/reference/instanceAndStaticDeclarations1.types +++ b/tests/baselines/reference/instanceAndStaticDeclarations1.types @@ -50,8 +50,8 @@ class Point { >origin : Point >new Point(0, 0) : Point >Point : typeof Point ->0 : number ->0 : number +>0 : 0 +>0 : 0 static distance(p1: Point, p2: Point) { return p1.distance(p2); } >distance : (p1: Point, p2: Point) => number diff --git a/tests/baselines/reference/instanceMemberInitialization.types b/tests/baselines/reference/instanceMemberInitialization.types index 4d65c62aa49..ca97ccac333 100644 --- a/tests/baselines/reference/instanceMemberInitialization.types +++ b/tests/baselines/reference/instanceMemberInitialization.types @@ -4,7 +4,7 @@ class C { x = 1; >x : number ->1 : number +>1 : 1 } var c = new C(); @@ -13,11 +13,11 @@ var c = new C(); >C : typeof C c.x = 3; ->c.x = 3 : number +>c.x = 3 : 3 >c.x : number >c : C >x : number ->3 : number +>3 : 3 var c2 = new C(); >c2 : C diff --git a/tests/baselines/reference/instancePropertiesInheritedIntoClassType.errors.txt b/tests/baselines/reference/instancePropertiesInheritedIntoClassType.errors.txt index 340b5081866..21aaa938093 100644 --- a/tests/baselines/reference/instancePropertiesInheritedIntoClassType.errors.txt +++ b/tests/baselines/reference/instancePropertiesInheritedIntoClassType.errors.txt @@ -1,9 +1,9 @@ tests/cases/conformance/classes/members/classTypes/instancePropertiesInheritedIntoClassType.ts(4,13): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. tests/cases/conformance/classes/members/classTypes/instancePropertiesInheritedIntoClassType.ts(7,13): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. -tests/cases/conformance/classes/members/classTypes/instancePropertiesInheritedIntoClassType.ts(19,14): error TS2349: Cannot invoke an expression whose type lacks a call signature. +tests/cases/conformance/classes/members/classTypes/instancePropertiesInheritedIntoClassType.ts(19,14): error TS2349: Cannot invoke an expression whose type lacks a call signature. Type 'Number' has no compatible call signatures. tests/cases/conformance/classes/members/classTypes/instancePropertiesInheritedIntoClassType.ts(26,13): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. tests/cases/conformance/classes/members/classTypes/instancePropertiesInheritedIntoClassType.ts(29,13): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. -tests/cases/conformance/classes/members/classTypes/instancePropertiesInheritedIntoClassType.ts(41,14): error TS2349: Cannot invoke an expression whose type lacks a call signature. +tests/cases/conformance/classes/members/classTypes/instancePropertiesInheritedIntoClassType.ts(41,14): error TS2349: Cannot invoke an expression whose type lacks a call signature. Type 'String' has no compatible call signatures. ==== tests/cases/conformance/classes/members/classTypes/instancePropertiesInheritedIntoClassType.ts (6 errors) ==== @@ -31,7 +31,7 @@ tests/cases/conformance/classes/members/classTypes/instancePropertiesInheritedIn r.y = 4; var r6 = d.y(); // error ~~~~~ -!!! error TS2349: Cannot invoke an expression whose type lacks a call signature. +!!! error TS2349: Cannot invoke an expression whose type lacks a call signature. Type 'Number' has no compatible call signatures. } @@ -59,5 +59,5 @@ tests/cases/conformance/classes/members/classTypes/instancePropertiesInheritedIn r.y = ''; var r6 = d.y(); // error ~~~~~ -!!! error TS2349: Cannot invoke an expression whose type lacks a call signature. +!!! error TS2349: Cannot invoke an expression whose type lacks a call signature. Type 'String' has no compatible call signatures. } \ No newline at end of file diff --git a/tests/baselines/reference/instancePropertyInClassType.errors.txt b/tests/baselines/reference/instancePropertyInClassType.errors.txt index d14607d81bc..bb0047880cb 100644 --- a/tests/baselines/reference/instancePropertyInClassType.errors.txt +++ b/tests/baselines/reference/instancePropertyInClassType.errors.txt @@ -1,9 +1,9 @@ tests/cases/conformance/classes/members/classTypes/instancePropertyInClassType.ts(4,13): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. tests/cases/conformance/classes/members/classTypes/instancePropertyInClassType.ts(7,13): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. -tests/cases/conformance/classes/members/classTypes/instancePropertyInClassType.ts(17,14): error TS2349: Cannot invoke an expression whose type lacks a call signature. +tests/cases/conformance/classes/members/classTypes/instancePropertyInClassType.ts(17,14): error TS2349: Cannot invoke an expression whose type lacks a call signature. Type 'Number' has no compatible call signatures. tests/cases/conformance/classes/members/classTypes/instancePropertyInClassType.ts(24,13): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. tests/cases/conformance/classes/members/classTypes/instancePropertyInClassType.ts(27,13): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. -tests/cases/conformance/classes/members/classTypes/instancePropertyInClassType.ts(37,14): error TS2349: Cannot invoke an expression whose type lacks a call signature. +tests/cases/conformance/classes/members/classTypes/instancePropertyInClassType.ts(37,14): error TS2349: Cannot invoke an expression whose type lacks a call signature. Type 'String' has no compatible call signatures. ==== tests/cases/conformance/classes/members/classTypes/instancePropertyInClassType.ts (6 errors) ==== @@ -29,7 +29,7 @@ tests/cases/conformance/classes/members/classTypes/instancePropertyInClassType.t r.y = 4; var r6 = c.y(); // error ~~~~~ -!!! error TS2349: Cannot invoke an expression whose type lacks a call signature. +!!! error TS2349: Cannot invoke an expression whose type lacks a call signature. Type 'Number' has no compatible call signatures. } @@ -55,5 +55,5 @@ tests/cases/conformance/classes/members/classTypes/instancePropertyInClassType.t r.y = ''; var r6 = c.y(); // error ~~~~~ -!!! error TS2349: Cannot invoke an expression whose type lacks a call signature. +!!! error TS2349: Cannot invoke an expression whose type lacks a call signature. Type 'String' has no compatible call signatures. } \ No newline at end of file diff --git a/tests/baselines/reference/instanceofWithStructurallyIdenticalTypes.types b/tests/baselines/reference/instanceofWithStructurallyIdenticalTypes.types index d98a6025796..e9048af2e34 100644 --- a/tests/baselines/reference/instanceofWithStructurallyIdenticalTypes.types +++ b/tests/baselines/reference/instanceofWithStructurallyIdenticalTypes.types @@ -40,7 +40,7 @@ function foo1(x: C1 | C2 | C3): string { >x.item : string[] >x : C2 >item : string[] ->0 : number +>0 : 0 } else if (x instanceof C3) { >x instanceof C3 : boolean @@ -53,7 +53,7 @@ function foo1(x: C1 | C2 | C3): string { >item : string } return "error"; ->"error" : string +>"error" : "error" } function isC1(c: C1 | C2 | C3): c is C1 { return c instanceof C1 } @@ -119,7 +119,7 @@ function foo2(x: C1 | C2 | C3): string { >x.item : string[] >x : C2 >item : string[] ->0 : number +>0 : 0 } else if (isC3(x)) { >isC3(x) : boolean @@ -132,7 +132,7 @@ function foo2(x: C1 | C2 | C3): string { >item : string } return "error"; ->"error" : string +>"error" : "error" } // More tests diff --git a/tests/baselines/reference/instantiateContextuallyTypedGenericThis.types b/tests/baselines/reference/instantiateContextuallyTypedGenericThis.types index 5cdce6b99fe..11be8be8252 100644 --- a/tests/baselines/reference/instantiateContextuallyTypedGenericThis.types +++ b/tests/baselines/reference/instantiateContextuallyTypedGenericThis.types @@ -42,12 +42,12 @@ $.each(lines, function(dit) { >dit.charAt : (pos: number) => string >dit : string >charAt : (pos: number) => string ->0 : number +>0 : 0 >this.charAt(1) : string >this.charAt : (pos: number) => string >this : string >charAt : (pos: number) => string ->1 : number +>1 : 1 }); diff --git a/tests/baselines/reference/instantiateCrossFileMerge.types b/tests/baselines/reference/instantiateCrossFileMerge.types index 8fbeaab3d1f..2da25e6b138 100644 --- a/tests/baselines/reference/instantiateCrossFileMerge.types +++ b/tests/baselines/reference/instantiateCrossFileMerge.types @@ -22,5 +22,5 @@ new P(r => { r('foo') }); >r : (value: string) => void >r('foo') : void >r : (value: string) => void ->'foo' : string +>'foo' : "foo" diff --git a/tests/baselines/reference/instantiatedModule.types b/tests/baselines/reference/instantiatedModule.types index 743c6561161..b7072d6bb73 100644 --- a/tests/baselines/reference/instantiatedModule.types +++ b/tests/baselines/reference/instantiatedModule.types @@ -11,7 +11,7 @@ module M { export var Point = 1; >Point : number ->1 : number +>1 : 1 } // primary expression @@ -69,9 +69,9 @@ module M2 { return { x: 0, y: 0 }; >{ x: 0, y: 0 } : { x: number; y: number; } >x : number ->0 : number +>0 : 0 >y : number ->0 : number +>0 : 0 } } } @@ -141,8 +141,8 @@ module M3 { export enum Color { Blue, Red } >Color : Color ->Blue : Color ->Red : Color +>Blue : Color.Blue +>Red : Color.Red } var m3: typeof M3; @@ -186,17 +186,17 @@ var p3: M3.Color; var p3 = M3.Color.Red; >p3 : M3.Color ->M3.Color.Red : M3.Color +>M3.Color.Red : M3.Color.Red >M3.Color : typeof M3.Color >M3 : typeof M3 >Color : typeof M3.Color ->Red : M3.Color +>Red : M3.Color.Red var p3 = m3.Color.Blue; >p3 : M3.Color ->m3.Color.Blue : M3.Color +>m3.Color.Blue : M3.Color.Blue >m3.Color : typeof M3.Color >m3 : typeof M3 >Color : typeof M3.Color ->Blue : M3.Color +>Blue : M3.Color.Blue diff --git a/tests/baselines/reference/intTypeCheck.errors.txt b/tests/baselines/reference/intTypeCheck.errors.txt index 0d19c6b2b6e..2214c685956 100644 --- a/tests/baselines/reference/intTypeCheck.errors.txt +++ b/tests/baselines/reference/intTypeCheck.errors.txt @@ -10,7 +10,7 @@ tests/cases/compiler/intTypeCheck.ts(103,5): error TS2322: Type '() => void' is Property 'p' is missing in type '() => void'. tests/cases/compiler/intTypeCheck.ts(106,5): error TS2322: Type 'boolean' is not assignable to type 'i1'. tests/cases/compiler/intTypeCheck.ts(106,20): error TS1109: Expression expected. -tests/cases/compiler/intTypeCheck.ts(106,21): error TS2304: Cannot find name 'i1'. +tests/cases/compiler/intTypeCheck.ts(106,21): error TS2693: 'i1' only refers to a type, but is being used as a value here. tests/cases/compiler/intTypeCheck.ts(107,17): error TS2351: Cannot use 'new' with an expression whose type lacks a call or construct signature. tests/cases/compiler/intTypeCheck.ts(112,5): error TS2322: Type '{}' is not assignable to type 'i2'. Type '{}' provides no match for the signature '(): any' @@ -21,7 +21,7 @@ tests/cases/compiler/intTypeCheck.ts(115,5): error TS2322: Type 'Base' is not as Type 'Base' provides no match for the signature '(): any' tests/cases/compiler/intTypeCheck.ts(120,5): error TS2322: Type 'boolean' is not assignable to type 'i2'. tests/cases/compiler/intTypeCheck.ts(120,21): error TS1109: Expression expected. -tests/cases/compiler/intTypeCheck.ts(120,22): error TS2304: Cannot find name 'i2'. +tests/cases/compiler/intTypeCheck.ts(120,22): error TS2693: 'i2' only refers to a type, but is being used as a value here. tests/cases/compiler/intTypeCheck.ts(121,17): error TS2351: Cannot use 'new' with an expression whose type lacks a call or construct signature. tests/cases/compiler/intTypeCheck.ts(126,5): error TS2322: Type '{}' is not assignable to type 'i3'. Type '{}' provides no match for the signature 'new (): any' @@ -33,12 +33,12 @@ tests/cases/compiler/intTypeCheck.ts(131,5): error TS2322: Type '() => void' is Type '() => void' provides no match for the signature 'new (): any' tests/cases/compiler/intTypeCheck.ts(134,5): error TS2322: Type 'boolean' is not assignable to type 'i3'. tests/cases/compiler/intTypeCheck.ts(134,21): error TS1109: Expression expected. -tests/cases/compiler/intTypeCheck.ts(134,22): error TS2304: Cannot find name 'i3'. +tests/cases/compiler/intTypeCheck.ts(134,22): error TS2693: 'i3' only refers to a type, but is being used as a value here. tests/cases/compiler/intTypeCheck.ts(135,17): error TS2351: Cannot use 'new' with an expression whose type lacks a call or construct signature. tests/cases/compiler/intTypeCheck.ts(142,17): error TS2351: Cannot use 'new' with an expression whose type lacks a call or construct signature. tests/cases/compiler/intTypeCheck.ts(148,5): error TS2322: Type 'boolean' is not assignable to type 'i4'. tests/cases/compiler/intTypeCheck.ts(148,21): error TS1109: Expression expected. -tests/cases/compiler/intTypeCheck.ts(148,22): error TS2304: Cannot find name 'i4'. +tests/cases/compiler/intTypeCheck.ts(148,22): error TS2693: 'i4' only refers to a type, but is being used as a value here. tests/cases/compiler/intTypeCheck.ts(149,17): error TS2351: Cannot use 'new' with an expression whose type lacks a call or construct signature. tests/cases/compiler/intTypeCheck.ts(154,5): error TS2322: Type '{}' is not assignable to type 'i5'. Property 'p' is missing in type '{}'. @@ -51,7 +51,7 @@ tests/cases/compiler/intTypeCheck.ts(159,5): error TS2322: Type '() => void' is Property 'p' is missing in type '() => void'. tests/cases/compiler/intTypeCheck.ts(162,5): error TS2322: Type 'boolean' is not assignable to type 'i5'. tests/cases/compiler/intTypeCheck.ts(162,21): error TS1109: Expression expected. -tests/cases/compiler/intTypeCheck.ts(162,22): error TS2304: Cannot find name 'i5'. +tests/cases/compiler/intTypeCheck.ts(162,22): error TS2693: 'i5' only refers to a type, but is being used as a value here. tests/cases/compiler/intTypeCheck.ts(163,17): error TS2351: Cannot use 'new' with an expression whose type lacks a call or construct signature. tests/cases/compiler/intTypeCheck.ts(168,5): error TS2322: Type '{}' is not assignable to type 'i6'. Type '{}' provides no match for the signature '(): any' @@ -64,7 +64,7 @@ tests/cases/compiler/intTypeCheck.ts(173,5): error TS2322: Type '() => void' is Type 'void' is not assignable to type 'number'. tests/cases/compiler/intTypeCheck.ts(176,5): error TS2322: Type 'boolean' is not assignable to type 'i6'. tests/cases/compiler/intTypeCheck.ts(176,21): error TS1109: Expression expected. -tests/cases/compiler/intTypeCheck.ts(176,22): error TS2304: Cannot find name 'i6'. +tests/cases/compiler/intTypeCheck.ts(176,22): error TS2693: 'i6' only refers to a type, but is being used as a value here. tests/cases/compiler/intTypeCheck.ts(177,17): error TS2351: Cannot use 'new' with an expression whose type lacks a call or construct signature. tests/cases/compiler/intTypeCheck.ts(182,5): error TS2322: Type '{}' is not assignable to type 'i7'. Type '{}' provides no match for the signature 'new (): any' @@ -76,12 +76,12 @@ tests/cases/compiler/intTypeCheck.ts(187,5): error TS2322: Type '() => void' is Type '() => void' provides no match for the signature 'new (): any' tests/cases/compiler/intTypeCheck.ts(190,5): error TS2322: Type 'boolean' is not assignable to type 'i7'. tests/cases/compiler/intTypeCheck.ts(190,21): error TS1109: Expression expected. -tests/cases/compiler/intTypeCheck.ts(190,22): error TS2304: Cannot find name 'i7'. +tests/cases/compiler/intTypeCheck.ts(190,22): error TS2693: 'i7' only refers to a type, but is being used as a value here. tests/cases/compiler/intTypeCheck.ts(191,17): error TS2351: Cannot use 'new' with an expression whose type lacks a call or construct signature. tests/cases/compiler/intTypeCheck.ts(198,17): error TS2351: Cannot use 'new' with an expression whose type lacks a call or construct signature. tests/cases/compiler/intTypeCheck.ts(204,5): error TS2322: Type 'boolean' is not assignable to type 'i8'. tests/cases/compiler/intTypeCheck.ts(204,21): error TS1109: Expression expected. -tests/cases/compiler/intTypeCheck.ts(204,22): error TS2304: Cannot find name 'i8'. +tests/cases/compiler/intTypeCheck.ts(204,22): error TS2693: 'i8' only refers to a type, but is being used as a value here. tests/cases/compiler/intTypeCheck.ts(205,17): error TS2351: Cannot use 'new' with an expression whose type lacks a call or construct signature. @@ -214,7 +214,7 @@ tests/cases/compiler/intTypeCheck.ts(205,17): error TS2351: Cannot use 'new' wit ~ !!! error TS1109: Expression expected. ~~ -!!! error TS2304: Cannot find name 'i1'. +!!! error TS2693: 'i1' only refers to a type, but is being used as a value here. var obj10: i1 = new {}; ~~~~~~ !!! error TS2351: Cannot use 'new' with an expression whose type lacks a call or construct signature. @@ -247,7 +247,7 @@ tests/cases/compiler/intTypeCheck.ts(205,17): error TS2351: Cannot use 'new' wit ~ !!! error TS1109: Expression expected. ~~ -!!! error TS2304: Cannot find name 'i2'. +!!! error TS2693: 'i2' only refers to a type, but is being used as a value here. var obj21: i2 = new {}; ~~~~~~ !!! error TS2351: Cannot use 'new' with an expression whose type lacks a call or construct signature. @@ -281,7 +281,7 @@ tests/cases/compiler/intTypeCheck.ts(205,17): error TS2351: Cannot use 'new' wit ~ !!! error TS1109: Expression expected. ~~ -!!! error TS2304: Cannot find name 'i3'. +!!! error TS2693: 'i3' only refers to a type, but is being used as a value here. var obj32: i3 = new {}; ~~~~~~ !!! error TS2351: Cannot use 'new' with an expression whose type lacks a call or construct signature. @@ -305,7 +305,7 @@ tests/cases/compiler/intTypeCheck.ts(205,17): error TS2351: Cannot use 'new' wit ~ !!! error TS1109: Expression expected. ~~ -!!! error TS2304: Cannot find name 'i4'. +!!! error TS2693: 'i4' only refers to a type, but is being used as a value here. var obj43: i4 = new {}; ~~~~~~ !!! error TS2351: Cannot use 'new' with an expression whose type lacks a call or construct signature. @@ -341,7 +341,7 @@ tests/cases/compiler/intTypeCheck.ts(205,17): error TS2351: Cannot use 'new' wit ~ !!! error TS1109: Expression expected. ~~ -!!! error TS2304: Cannot find name 'i5'. +!!! error TS2693: 'i5' only refers to a type, but is being used as a value here. var obj54: i5 = new {}; ~~~~~~ !!! error TS2351: Cannot use 'new' with an expression whose type lacks a call or construct signature. @@ -377,7 +377,7 @@ tests/cases/compiler/intTypeCheck.ts(205,17): error TS2351: Cannot use 'new' wit ~ !!! error TS1109: Expression expected. ~~ -!!! error TS2304: Cannot find name 'i6'. +!!! error TS2693: 'i6' only refers to a type, but is being used as a value here. var obj65: i6 = new {}; ~~~~~~ !!! error TS2351: Cannot use 'new' with an expression whose type lacks a call or construct signature. @@ -411,7 +411,7 @@ tests/cases/compiler/intTypeCheck.ts(205,17): error TS2351: Cannot use 'new' wit ~ !!! error TS1109: Expression expected. ~~ -!!! error TS2304: Cannot find name 'i7'. +!!! error TS2693: 'i7' only refers to a type, but is being used as a value here. var obj76: i7 = new {}; ~~~~~~ !!! error TS2351: Cannot use 'new' with an expression whose type lacks a call or construct signature. @@ -435,7 +435,7 @@ tests/cases/compiler/intTypeCheck.ts(205,17): error TS2351: Cannot use 'new' wit ~ !!! error TS1109: Expression expected. ~~ -!!! error TS2304: Cannot find name 'i8'. +!!! error TS2693: 'i8' only refers to a type, but is being used as a value here. var obj87: i8 = new {}; ~~~~~~ !!! error TS2351: Cannot use 'new' with an expression whose type lacks a call or construct signature. \ No newline at end of file diff --git a/tests/baselines/reference/interface0.types b/tests/baselines/reference/interface0.types index 8fd04eea83c..9a70cf066b1 100644 --- a/tests/baselines/reference/interface0.types +++ b/tests/baselines/reference/interface0.types @@ -13,5 +13,5 @@ var y: Generic = { x: 3 }; >Generic : Generic >{ x: 3 } : { x: number; } >x : number ->3 : number +>3 : 3 diff --git a/tests/baselines/reference/interfaceClassMerging.types b/tests/baselines/reference/interfaceClassMerging.types index 0b17005c868..60712d226a4 100644 --- a/tests/baselines/reference/interfaceClassMerging.types +++ b/tests/baselines/reference/interfaceClassMerging.types @@ -32,7 +32,7 @@ class Foo { >this.method : (a: number) => string >this : this >method : (a: number) => string ->0 : number +>0 : 0 } } @@ -62,14 +62,14 @@ bar.method(0); >bar.method : (a: number) => string >bar : Bar >method : (a: number) => string ->0 : number +>0 : 0 bar.optionalMethod(1); >bar.optionalMethod(1) : string >bar.optionalMethod : (a: number) => string >bar : Bar >optionalMethod : (a: number) => string ->1 : number +>1 : 1 bar.property; >bar.property : string @@ -91,7 +91,7 @@ bar.additionalMethod(2); >bar.additionalMethod : (a: number) => string >bar : Bar >additionalMethod : (a: number) => string ->2 : number +>2 : 2 var obj: { >obj : { method(a: number): string; property: string; additionalProperty: string; additionalMethod(a: number): string; } diff --git a/tests/baselines/reference/interfaceContextualType.types b/tests/baselines/reference/interfaceContextualType.types index 0e835a2f1f9..65dda5b737f 100644 --- a/tests/baselines/reference/interfaceContextualType.types +++ b/tests/baselines/reference/interfaceContextualType.types @@ -34,31 +34,31 @@ class Bug { >{} : {} this.values['comments'] = { italic: true }; ->this.values['comments'] = { italic: true } : { italic: boolean; } +>this.values['comments'] = { italic: true } : { italic: true; } >this.values['comments'] : IOptions >this.values : IMap >this : this >values : IMap ->'comments' : string ->{ italic: true } : { italic: boolean; } +>'comments' : "comments" +>{ italic: true } : { italic: true; } >italic : boolean ->true : boolean +>true : true } shouldBeOK() { >shouldBeOK : () => void this.values = { ->this.values = { comments: { italic: true } } : { comments: { italic: boolean; }; } +>this.values = { comments: { italic: true } } : { comments: { italic: true; }; } >this.values : IMap >this : this >values : IMap ->{ comments: { italic: true } } : { comments: { italic: boolean; }; } +>{ comments: { italic: true } } : { comments: { italic: true; }; } comments: { italic: true } ->comments : { italic: boolean; } ->{ italic: true } : { italic: boolean; } +>comments : { italic: true; } +>{ italic: true } : { italic: true; } >italic : boolean ->true : boolean +>true : true }; } diff --git a/tests/baselines/reference/interfaceDoesNotDependOnBaseTypes.types b/tests/baselines/reference/interfaceDoesNotDependOnBaseTypes.types index 65a7ec60168..4f60c5d36cc 100644 --- a/tests/baselines/reference/interfaceDoesNotDependOnBaseTypes.types +++ b/tests/baselines/reference/interfaceDoesNotDependOnBaseTypes.types @@ -14,7 +14,7 @@ if (typeof x !== "string") { >x.push : (...items: StringTree[]) => number >x : StringTreeArray >push : (...items: StringTree[]) => number ->"" : string +>"" : "" x.push([""]); >x.push([""]) : number @@ -22,7 +22,7 @@ if (typeof x !== "string") { >x : StringTreeArray >push : (...items: StringTree[]) => number >[""] : string[] ->"" : string +>"" : "" } type StringTree = string | StringTreeArray; diff --git a/tests/baselines/reference/interfaceNameAsIdentifier.errors.txt b/tests/baselines/reference/interfaceNameAsIdentifier.errors.txt index 4be4d858d7b..5be40b5b7b6 100644 --- a/tests/baselines/reference/interfaceNameAsIdentifier.errors.txt +++ b/tests/baselines/reference/interfaceNameAsIdentifier.errors.txt @@ -1,4 +1,4 @@ -tests/cases/compiler/interfaceNameAsIdentifier.ts(4,1): error TS2304: Cannot find name 'C'. +tests/cases/compiler/interfaceNameAsIdentifier.ts(4,1): error TS2693: 'C' only refers to a type, but is being used as a value here. tests/cases/compiler/interfaceNameAsIdentifier.ts(12,1): error TS2304: Cannot find name 'm2'. @@ -8,7 +8,7 @@ tests/cases/compiler/interfaceNameAsIdentifier.ts(12,1): error TS2304: Cannot fi } C(); ~ -!!! error TS2304: Cannot find name 'C'. +!!! error TS2693: 'C' only refers to a type, but is being used as a value here. module m2 { export interface C { diff --git a/tests/baselines/reference/interfaceNaming1.errors.txt b/tests/baselines/reference/interfaceNaming1.errors.txt index 99e0b5c02fa..5efeea8c5e9 100644 --- a/tests/baselines/reference/interfaceNaming1.errors.txt +++ b/tests/baselines/reference/interfaceNaming1.errors.txt @@ -1,19 +1,19 @@ -tests/cases/compiler/interfaceNaming1.ts(1,1): error TS2304: Cannot find name 'interface'. +tests/cases/compiler/interfaceNaming1.ts(1,1): error TS2693: 'interface' only refers to a type, but is being used as a value here. tests/cases/compiler/interfaceNaming1.ts(1,11): error TS1005: ';' expected. -tests/cases/compiler/interfaceNaming1.ts(3,1): error TS2304: Cannot find name 'interface'. +tests/cases/compiler/interfaceNaming1.ts(3,1): error TS2693: 'interface' only refers to a type, but is being used as a value here. tests/cases/compiler/interfaceNaming1.ts(3,13): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. ==== tests/cases/compiler/interfaceNaming1.ts (4 errors) ==== interface { } ~~~~~~~~~ -!!! error TS2304: Cannot find name 'interface'. +!!! error TS2693: 'interface' only refers to a type, but is being used as a value here. ~ !!! error TS1005: ';' expected. interface interface{ } interface & { } ~~~~~~~~~ -!!! error TS2304: Cannot find name 'interface'. +!!! error TS2693: 'interface' only refers to a type, but is being used as a value here. ~~~ !!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. \ No newline at end of file diff --git a/tests/baselines/reference/interfaceSubtyping.types b/tests/baselines/reference/interfaceSubtyping.types index 26a900a56b2..07c0d6446b5 100644 --- a/tests/baselines/reference/interfaceSubtyping.types +++ b/tests/baselines/reference/interfaceSubtyping.types @@ -14,6 +14,6 @@ class Camera implements iface{ } foo() { return "s"; } >foo : () => string ->"s" : string +>"s" : "s" } diff --git a/tests/baselines/reference/interfaceWithOverloadedCallAndConstructSignatures.types b/tests/baselines/reference/interfaceWithOverloadedCallAndConstructSignatures.types index 1110992fd52..755514680d2 100644 --- a/tests/baselines/reference/interfaceWithOverloadedCallAndConstructSignatures.types +++ b/tests/baselines/reference/interfaceWithOverloadedCallAndConstructSignatures.types @@ -25,7 +25,7 @@ var r2 = f(''); >r2 : number >f('') : number >f : Foo ->'' : string +>'' : "" var r3 = new f(); >r3 : any @@ -36,5 +36,5 @@ var r4 = new f(''); >r4 : Object >new f('') : Object >f : Foo ->'' : string +>'' : "" diff --git a/tests/baselines/reference/interfaceWithPropertyOfEveryType.types b/tests/baselines/reference/interfaceWithPropertyOfEveryType.types index 7428ee73aa1..07832f23fc3 100644 --- a/tests/baselines/reference/interfaceWithPropertyOfEveryType.types +++ b/tests/baselines/reference/interfaceWithPropertyOfEveryType.types @@ -11,7 +11,7 @@ module M { export var y = 1; >y : number ->1 : number +>1 : 1 } enum E { A } >E : E @@ -80,19 +80,19 @@ interface Foo { var a: Foo = { >a : Foo >Foo : Foo ->{ a: 1, b: '', c: true, d: {}, e: null , f: [1], g: {}, h: (x: number) => 1, i: (x: T) => x, j: null, k: new C(), l: f1, m: M, n: {}, o: E.A} : { a: number; b: string; c: boolean; d: {}; e: null; f: number[]; g: {}; h: (x: number) => number; i: (x: T) => T; j: Foo; k: C; l: () => void; m: typeof M; n: {}; o: E; } +>{ a: 1, b: '', c: true, d: {}, e: null , f: [1], g: {}, h: (x: number) => 1, i: (x: T) => x, j: null, k: new C(), l: f1, m: M, n: {}, o: E.A} : { a: number; b: string; c: true; d: {}; e: null; f: number[]; g: {}; h: (x: number) => number; i: (x: T) => T; j: Foo; k: C; l: () => void; m: typeof M; n: {}; o: E; } a: 1, >a : number ->1 : number +>1 : 1 b: '', >b : string ->'' : string +>'' : "" c: true, >c : boolean ->true : boolean +>true : true d: {}, >d : {} @@ -105,7 +105,7 @@ var a: Foo = { f: [1], >f : number[] >[1] : number[] ->1 : number +>1 : 1 g: {}, >g : {} @@ -115,7 +115,7 @@ var a: Foo = { >h : (x: number) => number >(x: number) => 1 : (x: number) => number >x : number ->1 : number +>1 : 1 i: (x: T) => x, >i : (x: T) => T diff --git a/tests/baselines/reference/interfaceWithSpecializedCallAndConstructSignatures.types b/tests/baselines/reference/interfaceWithSpecializedCallAndConstructSignatures.types index 5288d9f15a4..b6c658e10dc 100644 --- a/tests/baselines/reference/interfaceWithSpecializedCallAndConstructSignatures.types +++ b/tests/baselines/reference/interfaceWithSpecializedCallAndConstructSignatures.types @@ -30,7 +30,7 @@ var r2 = f('A'); >r2 : any >f('A') : any >f : Foo ->'A' : string +>'A' : "A" var r3 = new f('a'); >r3 : any @@ -42,5 +42,5 @@ var r4 = new f('A'); >r4 : Object >new f('A') : Object >f : Foo ->'A' : string +>'A' : "A" diff --git a/tests/baselines/reference/internalAliasClassInsideLocalModuleWithExport.types b/tests/baselines/reference/internalAliasClassInsideLocalModuleWithExport.types index 58afd2071fe..155f035c6c7 100644 --- a/tests/baselines/reference/internalAliasClassInsideLocalModuleWithExport.types +++ b/tests/baselines/reference/internalAliasClassInsideLocalModuleWithExport.types @@ -37,7 +37,7 @@ export module m2 { >cProp.foo : (a: number) => number >cProp : c >foo : (a: number) => number ->10 : number +>10 : 10 } } diff --git a/tests/baselines/reference/internalAliasClassInsideLocalModuleWithoutExport.types b/tests/baselines/reference/internalAliasClassInsideLocalModuleWithoutExport.types index 43f612d3f44..6a0ee6fa986 100644 --- a/tests/baselines/reference/internalAliasClassInsideLocalModuleWithoutExport.types +++ b/tests/baselines/reference/internalAliasClassInsideLocalModuleWithoutExport.types @@ -37,6 +37,6 @@ export module m2 { >cProp.foo : (a: number) => number >cProp : c >foo : (a: number) => number ->10 : number +>10 : 10 } } diff --git a/tests/baselines/reference/internalAliasClassInsideTopLevelModuleWithExport.types b/tests/baselines/reference/internalAliasClassInsideTopLevelModuleWithExport.types index 3d72c04aad6..407d0602de6 100644 --- a/tests/baselines/reference/internalAliasClassInsideTopLevelModuleWithExport.types +++ b/tests/baselines/reference/internalAliasClassInsideTopLevelModuleWithExport.types @@ -31,5 +31,5 @@ var cReturnVal = cProp.foo(10); >cProp.foo : (a: number) => number >cProp : xc >foo : (a: number) => number ->10 : number +>10 : 10 diff --git a/tests/baselines/reference/internalAliasClassInsideTopLevelModuleWithoutExport.types b/tests/baselines/reference/internalAliasClassInsideTopLevelModuleWithoutExport.types index f816fdce7af..405232d72b7 100644 --- a/tests/baselines/reference/internalAliasClassInsideTopLevelModuleWithoutExport.types +++ b/tests/baselines/reference/internalAliasClassInsideTopLevelModuleWithoutExport.types @@ -31,5 +31,5 @@ var cReturnVal = cProp.foo(10); >cProp.foo : (a: number) => number >cProp : xc >foo : (a: number) => number ->10 : number +>10 : 10 diff --git a/tests/baselines/reference/internalAliasEnum.types b/tests/baselines/reference/internalAliasEnum.types index 3f86d63c879..0465dbc8841 100644 --- a/tests/baselines/reference/internalAliasEnum.types +++ b/tests/baselines/reference/internalAliasEnum.types @@ -6,13 +6,13 @@ module a { >weekend : weekend Friday, ->Friday : weekend +>Friday : weekend.Friday Saturday, ->Saturday : weekend +>Saturday : weekend.Saturday Sunday ->Sunday : weekend +>Sunday : weekend.Sunday } } diff --git a/tests/baselines/reference/internalAliasEnumInsideLocalModuleWithExport.types b/tests/baselines/reference/internalAliasEnumInsideLocalModuleWithExport.types index 66d946e47b3..e35e5db5b47 100644 --- a/tests/baselines/reference/internalAliasEnumInsideLocalModuleWithExport.types +++ b/tests/baselines/reference/internalAliasEnumInsideLocalModuleWithExport.types @@ -6,13 +6,13 @@ export module a { >weekend : weekend Friday, ->Friday : weekend +>Friday : weekend.Friday Saturday, ->Saturday : weekend +>Saturday : weekend.Saturday Sunday ->Sunday : weekend +>Sunday : weekend.Sunday } } diff --git a/tests/baselines/reference/internalAliasEnumInsideLocalModuleWithoutExport.types b/tests/baselines/reference/internalAliasEnumInsideLocalModuleWithoutExport.types index f53a6fa355b..f063bb24352 100644 --- a/tests/baselines/reference/internalAliasEnumInsideLocalModuleWithoutExport.types +++ b/tests/baselines/reference/internalAliasEnumInsideLocalModuleWithoutExport.types @@ -6,13 +6,13 @@ export module a { >weekend : weekend Friday, ->Friday : weekend +>Friday : weekend.Friday Saturday, ->Saturday : weekend +>Saturday : weekend.Saturday Sunday ->Sunday : weekend +>Sunday : weekend.Sunday } } diff --git a/tests/baselines/reference/internalAliasEnumInsideTopLevelModuleWithExport.types b/tests/baselines/reference/internalAliasEnumInsideTopLevelModuleWithExport.types index 437e211bf16..f49f4c74215 100644 --- a/tests/baselines/reference/internalAliasEnumInsideTopLevelModuleWithExport.types +++ b/tests/baselines/reference/internalAliasEnumInsideTopLevelModuleWithExport.types @@ -6,13 +6,13 @@ export module a { >weekend : weekend Friday, ->Friday : weekend +>Friday : weekend.Friday Saturday, ->Saturday : weekend +>Saturday : weekend.Saturday Sunday ->Sunday : weekend +>Sunday : weekend.Sunday } } diff --git a/tests/baselines/reference/internalAliasEnumInsideTopLevelModuleWithoutExport.types b/tests/baselines/reference/internalAliasEnumInsideTopLevelModuleWithoutExport.types index c9b75f84266..209dba7aed1 100644 --- a/tests/baselines/reference/internalAliasEnumInsideTopLevelModuleWithoutExport.types +++ b/tests/baselines/reference/internalAliasEnumInsideTopLevelModuleWithoutExport.types @@ -6,13 +6,13 @@ export module a { >weekend : weekend Friday, ->Friday : weekend +>Friday : weekend.Friday Saturday, ->Saturday : weekend +>Saturday : weekend.Saturday Sunday ->Sunday : weekend +>Sunday : weekend.Sunday } } diff --git a/tests/baselines/reference/internalAliasFunction.types b/tests/baselines/reference/internalAliasFunction.types index d67535c76f7..92e0fd11aa8 100644 --- a/tests/baselines/reference/internalAliasFunction.types +++ b/tests/baselines/reference/internalAliasFunction.types @@ -23,7 +23,7 @@ module c { >bVal : number >b(10) : number >b : (x: number) => number ->10 : number +>10 : 10 export var bVal2 = b; >bVal2 : (x: number) => number diff --git a/tests/baselines/reference/internalAliasFunctionInsideLocalModuleWithExport.types b/tests/baselines/reference/internalAliasFunctionInsideLocalModuleWithExport.types index 928d8530228..275d7467ca5 100644 --- a/tests/baselines/reference/internalAliasFunctionInsideLocalModuleWithExport.types +++ b/tests/baselines/reference/internalAliasFunctionInsideLocalModuleWithExport.types @@ -23,7 +23,7 @@ export module c { >bVal : number >b(10) : number >b : (x: number) => number ->10 : number +>10 : 10 export var bVal2 = b; >bVal2 : (x: number) => number diff --git a/tests/baselines/reference/internalAliasFunctionInsideLocalModuleWithoutExport.types b/tests/baselines/reference/internalAliasFunctionInsideLocalModuleWithoutExport.types index 630be11c71e..45e72ff89c5 100644 --- a/tests/baselines/reference/internalAliasFunctionInsideLocalModuleWithoutExport.types +++ b/tests/baselines/reference/internalAliasFunctionInsideLocalModuleWithoutExport.types @@ -23,7 +23,7 @@ export module c { >bVal : number >b(10) : number >b : (x: number) => number ->10 : number +>10 : 10 export var bVal2 = b; >bVal2 : (x: number) => number diff --git a/tests/baselines/reference/internalAliasFunctionInsideTopLevelModuleWithExport.types b/tests/baselines/reference/internalAliasFunctionInsideTopLevelModuleWithExport.types index c1e9f9af3d7..078b595651d 100644 --- a/tests/baselines/reference/internalAliasFunctionInsideTopLevelModuleWithExport.types +++ b/tests/baselines/reference/internalAliasFunctionInsideTopLevelModuleWithExport.types @@ -20,7 +20,7 @@ export var bVal = b(10); >bVal : number >b(10) : number >b : (x: number) => number ->10 : number +>10 : 10 export var bVal2 = b; >bVal2 : (x: number) => number diff --git a/tests/baselines/reference/internalAliasFunctionInsideTopLevelModuleWithoutExport.types b/tests/baselines/reference/internalAliasFunctionInsideTopLevelModuleWithoutExport.types index bca35e33dec..2bab16ff814 100644 --- a/tests/baselines/reference/internalAliasFunctionInsideTopLevelModuleWithoutExport.types +++ b/tests/baselines/reference/internalAliasFunctionInsideTopLevelModuleWithoutExport.types @@ -20,7 +20,7 @@ export var bVal = b(10); >bVal : number >b(10) : number >b : (x: number) => number ->10 : number +>10 : 10 export var bVal2 = b; >bVal2 : (x: number) => number diff --git a/tests/baselines/reference/internalAliasInterfaceInsideLocalModuleWithoutExportAccessError.errors.txt b/tests/baselines/reference/internalAliasInterfaceInsideLocalModuleWithoutExportAccessError.errors.txt index 7bd34f1d5d3..2bf1f34d30d 100644 --- a/tests/baselines/reference/internalAliasInterfaceInsideLocalModuleWithoutExportAccessError.errors.txt +++ b/tests/baselines/reference/internalAliasInterfaceInsideLocalModuleWithoutExportAccessError.errors.txt @@ -1,4 +1,4 @@ -tests/cases/compiler/internalAliasInterfaceInsideLocalModuleWithoutExportAccessError.ts(11,10): error TS2305: Module '"tests/cases/compiler/internalAliasInterfaceInsideLocalModuleWithoutExportAccessError".c' has no exported member 'b'. +tests/cases/compiler/internalAliasInterfaceInsideLocalModuleWithoutExportAccessError.ts(11,10): error TS2694: Namespace '"tests/cases/compiler/internalAliasInterfaceInsideLocalModuleWithoutExportAccessError".c' has no exported member 'b'. ==== tests/cases/compiler/internalAliasInterfaceInsideLocalModuleWithoutExportAccessError.ts (1 errors) ==== @@ -14,4 +14,4 @@ tests/cases/compiler/internalAliasInterfaceInsideLocalModuleWithoutExportAccessE var x: c.b; ~ -!!! error TS2305: Module '"tests/cases/compiler/internalAliasInterfaceInsideLocalModuleWithoutExportAccessError".c' has no exported member 'b'. \ No newline at end of file +!!! error TS2694: Namespace '"tests/cases/compiler/internalAliasInterfaceInsideLocalModuleWithoutExportAccessError".c' has no exported member 'b'. \ No newline at end of file diff --git a/tests/baselines/reference/internalAliasUninitializedModuleInsideLocalModuleWithoutExportAccessError.errors.txt b/tests/baselines/reference/internalAliasUninitializedModuleInsideLocalModuleWithoutExportAccessError.errors.txt index 865929890c0..fef43dc4ded 100644 --- a/tests/baselines/reference/internalAliasUninitializedModuleInsideLocalModuleWithoutExportAccessError.errors.txt +++ b/tests/baselines/reference/internalAliasUninitializedModuleInsideLocalModuleWithoutExportAccessError.errors.txt @@ -1,4 +1,4 @@ -tests/cases/compiler/internalAliasUninitializedModuleInsideLocalModuleWithoutExportAccessError.ts(16,17): error TS2305: Module '"tests/cases/compiler/internalAliasUninitializedModuleInsideLocalModuleWithoutExportAccessError".c' has no exported member 'b'. +tests/cases/compiler/internalAliasUninitializedModuleInsideLocalModuleWithoutExportAccessError.ts(16,17): error TS2694: Namespace '"tests/cases/compiler/internalAliasUninitializedModuleInsideLocalModuleWithoutExportAccessError".c' has no exported member 'b'. ==== tests/cases/compiler/internalAliasUninitializedModuleInsideLocalModuleWithoutExportAccessError.ts (1 errors) ==== @@ -19,4 +19,4 @@ tests/cases/compiler/internalAliasUninitializedModuleInsideLocalModuleWithoutExp export var z: c.b.I; ~ -!!! error TS2305: Module '"tests/cases/compiler/internalAliasUninitializedModuleInsideLocalModuleWithoutExportAccessError".c' has no exported member 'b'. \ No newline at end of file +!!! error TS2694: Namespace '"tests/cases/compiler/internalAliasUninitializedModuleInsideLocalModuleWithoutExportAccessError".c' has no exported member 'b'. \ No newline at end of file diff --git a/tests/baselines/reference/internalAliasVar.types b/tests/baselines/reference/internalAliasVar.types index 59da851b569..40897b403f0 100644 --- a/tests/baselines/reference/internalAliasVar.types +++ b/tests/baselines/reference/internalAliasVar.types @@ -4,7 +4,7 @@ module a { export var x = 10; >x : number ->10 : number +>10 : 10 } module c { diff --git a/tests/baselines/reference/internalAliasVarInsideLocalModuleWithExport.types b/tests/baselines/reference/internalAliasVarInsideLocalModuleWithExport.types index 995c24bc382..5527b00e47e 100644 --- a/tests/baselines/reference/internalAliasVarInsideLocalModuleWithExport.types +++ b/tests/baselines/reference/internalAliasVarInsideLocalModuleWithExport.types @@ -4,7 +4,7 @@ export module a { export var x = 10; >x : number ->10 : number +>10 : 10 } export module c { diff --git a/tests/baselines/reference/internalAliasVarInsideLocalModuleWithoutExport.types b/tests/baselines/reference/internalAliasVarInsideLocalModuleWithoutExport.types index 5e322f8483c..fe8f6fb54ea 100644 --- a/tests/baselines/reference/internalAliasVarInsideLocalModuleWithoutExport.types +++ b/tests/baselines/reference/internalAliasVarInsideLocalModuleWithoutExport.types @@ -4,7 +4,7 @@ export module a { export var x = 10; >x : number ->10 : number +>10 : 10 } export module c { diff --git a/tests/baselines/reference/internalAliasVarInsideTopLevelModuleWithExport.types b/tests/baselines/reference/internalAliasVarInsideTopLevelModuleWithExport.types index 199de9cae51..41245f5b05e 100644 --- a/tests/baselines/reference/internalAliasVarInsideTopLevelModuleWithExport.types +++ b/tests/baselines/reference/internalAliasVarInsideTopLevelModuleWithExport.types @@ -4,7 +4,7 @@ export module a { export var x = 10; >x : number ->10 : number +>10 : 10 } export import b = a.x; diff --git a/tests/baselines/reference/internalAliasVarInsideTopLevelModuleWithoutExport.types b/tests/baselines/reference/internalAliasVarInsideTopLevelModuleWithoutExport.types index d7a7309ccb4..e05e20108b2 100644 --- a/tests/baselines/reference/internalAliasVarInsideTopLevelModuleWithoutExport.types +++ b/tests/baselines/reference/internalAliasVarInsideTopLevelModuleWithoutExport.types @@ -4,7 +4,7 @@ export module a { export var x = 10; >x : number ->10 : number +>10 : 10 } import b = a.x; diff --git a/tests/baselines/reference/internalImportInstantiatedModuleMergedWithClassNotReferencingInstanceNoConflict.types b/tests/baselines/reference/internalImportInstantiatedModuleMergedWithClassNotReferencingInstanceNoConflict.types index e0548f1f867..f7949e5a3fe 100644 --- a/tests/baselines/reference/internalImportInstantiatedModuleMergedWithClassNotReferencingInstanceNoConflict.types +++ b/tests/baselines/reference/internalImportInstantiatedModuleMergedWithClassNotReferencingInstanceNoConflict.types @@ -14,7 +14,7 @@ module A { export var a = 10; >a : number ->10 : number +>10 : 10 } module B { diff --git a/tests/baselines/reference/internalImportUnInstantiatedModuleNotReferencingInstanceNoConflict.types b/tests/baselines/reference/internalImportUnInstantiatedModuleNotReferencingInstanceNoConflict.types index 1226ca3cbc4..856b61b66d7 100644 --- a/tests/baselines/reference/internalImportUnInstantiatedModuleNotReferencingInstanceNoConflict.types +++ b/tests/baselines/reference/internalImportUnInstantiatedModuleNotReferencingInstanceNoConflict.types @@ -12,7 +12,7 @@ module B { var A = 1; >A : number ->1 : number +>1 : 1 import Y = A; >Y : any diff --git a/tests/baselines/reference/intersectionTypeInference1.types b/tests/baselines/reference/intersectionTypeInference1.types index b74b2d2a453..9417f633361 100644 --- a/tests/baselines/reference/intersectionTypeInference1.types +++ b/tests/baselines/reference/intersectionTypeInference1.types @@ -37,5 +37,5 @@ export const Form3 = brokenFunction(parameterFn)({store: "hello"}) >parameterFn : (props: { store: string; }) => void >{store: "hello"} : { store: string; } >store : string ->"hello" : string +>"hello" : "hello" diff --git a/tests/baselines/reference/intersectionTypeMembers.types b/tests/baselines/reference/intersectionTypeMembers.types index 6c3217698b8..4d1da7eab73 100644 --- a/tests/baselines/reference/intersectionTypeMembers.types +++ b/tests/baselines/reference/intersectionTypeMembers.types @@ -21,25 +21,25 @@ var abc: A & B & C; >C : C abc.a = "hello"; ->abc.a = "hello" : string +>abc.a = "hello" : "hello" >abc.a : string >abc : A & B & C >a : string ->"hello" : string +>"hello" : "hello" abc.b = "hello"; ->abc.b = "hello" : string +>abc.b = "hello" : "hello" >abc.b : string >abc : A & B & C >b : string ->"hello" : string +>"hello" : "hello" abc.c = "hello"; ->abc.c = "hello" : string +>abc.c = "hello" : "hello" >abc.c : string >abc : A & B & C >c : string ->"hello" : string +>"hello" : "hello" interface X { x: A } >X : X @@ -63,31 +63,31 @@ var xyz: X & Y & Z; >Z : Z xyz.x.a = "hello"; ->xyz.x.a = "hello" : string +>xyz.x.a = "hello" : "hello" >xyz.x.a : string >xyz.x : A & B & C >xyz : X & Y & Z >x : A & B & C >a : string ->"hello" : string +>"hello" : "hello" xyz.x.b = "hello"; ->xyz.x.b = "hello" : string +>xyz.x.b = "hello" : "hello" >xyz.x.b : string >xyz.x : A & B & C >xyz : X & Y & Z >x : A & B & C >b : string ->"hello" : string +>"hello" : "hello" xyz.x.c = "hello"; ->xyz.x.c = "hello" : string +>xyz.x.c = "hello" : "hello" >xyz.x.c : string >xyz.x : A & B & C >xyz : X & Y & Z >x : A & B & C >c : string ->"hello" : string +>"hello" : "hello" type F1 = (x: string) => string; >F1 : F1 @@ -106,13 +106,13 @@ var s = f("hello"); >s : string >f("hello") : string >f : F1 & F2 ->"hello" : string +>"hello" : "hello" var n = f(42); >n : number >f(42) : number >f : F1 & F2 ->42 : number +>42 : 42 interface D { >D : D @@ -150,24 +150,24 @@ const de: D & E = { d: 'yes', >d : string ->'yes' : string +>'yes' : "yes" f: 'no' >f : string ->'no' : string +>'no' : "no" }, different: { e: 12 }, >different : { e: number; } >{ e: 12 } : { e: number; } >e : number ->12 : number +>12 : 12 other: { g: 101 } >other : { g: number; } >{ g: 101 } : { g: number; } >g : number ->101 : number +>101 : 101 } } diff --git a/tests/baselines/reference/intersectionTypeOverloading.types b/tests/baselines/reference/intersectionTypeOverloading.types index f301ef6e4b7..8afa23ecb29 100644 --- a/tests/baselines/reference/intersectionTypeOverloading.types +++ b/tests/baselines/reference/intersectionTypeOverloading.types @@ -24,7 +24,7 @@ var x = fg("abc"); >x : string >fg("abc") : string >fg : F & G ->"abc" : string +>"abc" : "abc" var x: string; >x : string @@ -33,7 +33,7 @@ var y = gf("abc"); >y : any >gf("abc") : any >gf : G & F ->"abc" : string +>"abc" : "abc" var y: any; >y : any diff --git a/tests/baselines/reference/invalidAssignmentsToVoid.errors.txt b/tests/baselines/reference/invalidAssignmentsToVoid.errors.txt index 3ac4f122e58..4b9b316e010 100644 --- a/tests/baselines/reference/invalidAssignmentsToVoid.errors.txt +++ b/tests/baselines/reference/invalidAssignmentsToVoid.errors.txt @@ -1,6 +1,6 @@ -tests/cases/conformance/types/primitives/void/invalidAssignmentsToVoid.ts(2,1): error TS2322: Type 'number' is not assignable to type 'void'. -tests/cases/conformance/types/primitives/void/invalidAssignmentsToVoid.ts(3,1): error TS2322: Type 'boolean' is not assignable to type 'void'. -tests/cases/conformance/types/primitives/void/invalidAssignmentsToVoid.ts(4,1): error TS2322: Type 'string' is not assignable to type 'void'. +tests/cases/conformance/types/primitives/void/invalidAssignmentsToVoid.ts(2,1): error TS2322: Type '1' is not assignable to type 'void'. +tests/cases/conformance/types/primitives/void/invalidAssignmentsToVoid.ts(3,1): error TS2322: Type 'true' is not assignable to type 'void'. +tests/cases/conformance/types/primitives/void/invalidAssignmentsToVoid.ts(4,1): error TS2322: Type '""' is not assignable to type 'void'. tests/cases/conformance/types/primitives/void/invalidAssignmentsToVoid.ts(5,1): error TS2322: Type '{}' is not assignable to type 'void'. tests/cases/conformance/types/primitives/void/invalidAssignmentsToVoid.ts(9,1): error TS2322: Type 'typeof C' is not assignable to type 'void'. tests/cases/conformance/types/primitives/void/invalidAssignmentsToVoid.ts(10,1): error TS2322: Type 'C' is not assignable to type 'void'. @@ -14,13 +14,13 @@ tests/cases/conformance/types/primitives/void/invalidAssignmentsToVoid.ts(22,1): var x: void; x = 1; ~ -!!! error TS2322: Type 'number' is not assignable to type 'void'. +!!! error TS2322: Type '1' is not assignable to type 'void'. x = true; ~ -!!! error TS2322: Type 'boolean' is not assignable to type 'void'. +!!! error TS2322: Type 'true' is not assignable to type 'void'. x = ''; ~ -!!! error TS2322: Type 'string' is not assignable to type 'void'. +!!! error TS2322: Type '""' is not assignable to type 'void'. x = {} ~ !!! error TS2322: Type '{}' is not assignable to type 'void'. diff --git a/tests/baselines/reference/invalidBooleanAssignments.errors.txt b/tests/baselines/reference/invalidBooleanAssignments.errors.txt index 99d32aff9bc..7963197a003 100644 --- a/tests/baselines/reference/invalidBooleanAssignments.errors.txt +++ b/tests/baselines/reference/invalidBooleanAssignments.errors.txt @@ -1,10 +1,10 @@ -tests/cases/conformance/types/primitives/boolean/invalidBooleanAssignments.ts(3,5): error TS2322: Type 'boolean' is not assignable to type 'number'. -tests/cases/conformance/types/primitives/boolean/invalidBooleanAssignments.ts(4,5): error TS2322: Type 'boolean' is not assignable to type 'string'. -tests/cases/conformance/types/primitives/boolean/invalidBooleanAssignments.ts(5,5): error TS2322: Type 'boolean' is not assignable to type 'void'. -tests/cases/conformance/types/primitives/boolean/invalidBooleanAssignments.ts(9,5): error TS2322: Type 'boolean' is not assignable to type 'E'. -tests/cases/conformance/types/primitives/boolean/invalidBooleanAssignments.ts(12,5): error TS2322: Type 'boolean' is not assignable to type 'C'. -tests/cases/conformance/types/primitives/boolean/invalidBooleanAssignments.ts(15,5): error TS2322: Type 'boolean' is not assignable to type 'I'. -tests/cases/conformance/types/primitives/boolean/invalidBooleanAssignments.ts(17,5): error TS2322: Type 'boolean' is not assignable to type '() => string'. +tests/cases/conformance/types/primitives/boolean/invalidBooleanAssignments.ts(3,5): error TS2322: Type 'true' is not assignable to type 'number'. +tests/cases/conformance/types/primitives/boolean/invalidBooleanAssignments.ts(4,5): error TS2322: Type 'true' is not assignable to type 'string'. +tests/cases/conformance/types/primitives/boolean/invalidBooleanAssignments.ts(5,5): error TS2322: Type 'true' is not assignable to type 'void'. +tests/cases/conformance/types/primitives/boolean/invalidBooleanAssignments.ts(9,5): error TS2322: Type 'true' is not assignable to type 'E'. +tests/cases/conformance/types/primitives/boolean/invalidBooleanAssignments.ts(12,5): error TS2322: Type 'true' is not assignable to type 'C'. +tests/cases/conformance/types/primitives/boolean/invalidBooleanAssignments.ts(15,5): error TS2322: Type 'true' is not assignable to type 'I'. +tests/cases/conformance/types/primitives/boolean/invalidBooleanAssignments.ts(17,5): error TS2322: Type 'true' is not assignable to type '() => string'. tests/cases/conformance/types/primitives/boolean/invalidBooleanAssignments.ts(21,1): error TS2364: Invalid left-hand side of assignment expression. tests/cases/conformance/types/primitives/boolean/invalidBooleanAssignments.ts(24,5): error TS2322: Type 'boolean' is not assignable to type 'T'. tests/cases/conformance/types/primitives/boolean/invalidBooleanAssignments.ts(26,1): error TS2364: Invalid left-hand side of assignment expression. @@ -15,33 +15,33 @@ tests/cases/conformance/types/primitives/boolean/invalidBooleanAssignments.ts(26 var a: number = x; ~ -!!! error TS2322: Type 'boolean' is not assignable to type 'number'. +!!! error TS2322: Type 'true' is not assignable to type 'number'. var b: string = x; ~ -!!! error TS2322: Type 'boolean' is not assignable to type 'string'. +!!! error TS2322: Type 'true' is not assignable to type 'string'. var c: void = x; ~ -!!! error TS2322: Type 'boolean' is not assignable to type 'void'. +!!! error TS2322: Type 'true' is not assignable to type 'void'. var d: typeof undefined = x; enum E { A } var e: E = x; ~ -!!! error TS2322: Type 'boolean' is not assignable to type 'E'. +!!! error TS2322: Type 'true' is not assignable to type 'E'. class C { foo: string } var f: C = x; ~ -!!! error TS2322: Type 'boolean' is not assignable to type 'C'. +!!! error TS2322: Type 'true' is not assignable to type 'C'. interface I { bar: string } var g: I = x; ~ -!!! error TS2322: Type 'boolean' is not assignable to type 'I'. +!!! error TS2322: Type 'true' is not assignable to type 'I'. var h: { (): string } = x; ~ -!!! error TS2322: Type 'boolean' is not assignable to type '() => string'. +!!! error TS2322: Type 'true' is not assignable to type '() => string'. var h2: { toString(): string } = x; // no error module M { export var a = 1; } diff --git a/tests/baselines/reference/invalidEnumAssignments.errors.txt b/tests/baselines/reference/invalidEnumAssignments.errors.txt index 962e4bf62d5..e769a829c97 100644 --- a/tests/baselines/reference/invalidEnumAssignments.errors.txt +++ b/tests/baselines/reference/invalidEnumAssignments.errors.txt @@ -1,8 +1,8 @@ -tests/cases/conformance/types/primitives/enum/invalidEnumAssignments.ts(14,1): error TS2322: Type 'E2' is not assignable to type 'E'. -tests/cases/conformance/types/primitives/enum/invalidEnumAssignments.ts(15,1): error TS2322: Type 'E' is not assignable to type 'E2'. +tests/cases/conformance/types/primitives/enum/invalidEnumAssignments.ts(14,1): error TS2322: Type 'E2.A' is not assignable to type 'E'. +tests/cases/conformance/types/primitives/enum/invalidEnumAssignments.ts(15,1): error TS2322: Type 'E.A' is not assignable to type 'E2'. tests/cases/conformance/types/primitives/enum/invalidEnumAssignments.ts(16,1): error TS2322: Type 'void' is not assignable to type 'E'. tests/cases/conformance/types/primitives/enum/invalidEnumAssignments.ts(17,1): error TS2322: Type '{}' is not assignable to type 'E'. -tests/cases/conformance/types/primitives/enum/invalidEnumAssignments.ts(18,1): error TS2322: Type 'string' is not assignable to type 'E'. +tests/cases/conformance/types/primitives/enum/invalidEnumAssignments.ts(18,1): error TS2322: Type '""' is not assignable to type 'E'. tests/cases/conformance/types/primitives/enum/invalidEnumAssignments.ts(21,5): error TS2322: Type 'T' is not assignable to type 'E'. @@ -22,10 +22,10 @@ tests/cases/conformance/types/primitives/enum/invalidEnumAssignments.ts(21,5): e e = E2.A; ~ -!!! error TS2322: Type 'E2' is not assignable to type 'E'. +!!! error TS2322: Type 'E2.A' is not assignable to type 'E'. e2 = E.A; ~~ -!!! error TS2322: Type 'E' is not assignable to type 'E2'. +!!! error TS2322: Type 'E.A' is not assignable to type 'E2'. e = null; ~ !!! error TS2322: Type 'void' is not assignable to type 'E'. @@ -34,7 +34,7 @@ tests/cases/conformance/types/primitives/enum/invalidEnumAssignments.ts(21,5): e !!! error TS2322: Type '{}' is not assignable to type 'E'. e = ''; ~ -!!! error TS2322: Type 'string' is not assignable to type 'E'. +!!! error TS2322: Type '""' is not assignable to type 'E'. function f(a: T) { e = a; diff --git a/tests/baselines/reference/invalidImportAliasIdentifiers.errors.txt b/tests/baselines/reference/invalidImportAliasIdentifiers.errors.txt index afe7472570d..bf5cf5c0f12 100644 --- a/tests/baselines/reference/invalidImportAliasIdentifiers.errors.txt +++ b/tests/baselines/reference/invalidImportAliasIdentifiers.errors.txt @@ -1,6 +1,6 @@ tests/cases/conformance/internalModules/importDeclarations/invalidImportAliasIdentifiers.ts(5,12): error TS2503: Cannot find namespace 'V'. tests/cases/conformance/internalModules/importDeclarations/invalidImportAliasIdentifiers.ts(11,12): error TS2503: Cannot find namespace 'C'. -tests/cases/conformance/internalModules/importDeclarations/invalidImportAliasIdentifiers.ts(23,12): error TS2503: Cannot find namespace 'I'. +tests/cases/conformance/internalModules/importDeclarations/invalidImportAliasIdentifiers.ts(23,12): error TS2693: 'I' only refers to a type, but is being used as a value here. ==== tests/cases/conformance/internalModules/importDeclarations/invalidImportAliasIdentifiers.ts (3 errors) ==== @@ -32,5 +32,5 @@ tests/cases/conformance/internalModules/importDeclarations/invalidImportAliasIde import i = I; ~ -!!! error TS2503: Cannot find namespace 'I'. +!!! error TS2693: 'I' only refers to a type, but is being used as a value here. \ No newline at end of file diff --git a/tests/baselines/reference/invalidNumberAssignments.errors.txt b/tests/baselines/reference/invalidNumberAssignments.errors.txt index fd8acaba032..23f308830ff 100644 --- a/tests/baselines/reference/invalidNumberAssignments.errors.txt +++ b/tests/baselines/reference/invalidNumberAssignments.errors.txt @@ -3,8 +3,8 @@ tests/cases/conformance/types/primitives/number/invalidNumberAssignments.ts(4,5) tests/cases/conformance/types/primitives/number/invalidNumberAssignments.ts(5,5): error TS2322: Type 'number' is not assignable to type 'void'. tests/cases/conformance/types/primitives/number/invalidNumberAssignments.ts(9,5): error TS2322: Type 'number' is not assignable to type 'C'. tests/cases/conformance/types/primitives/number/invalidNumberAssignments.ts(12,5): error TS2322: Type 'number' is not assignable to type 'I'. -tests/cases/conformance/types/primitives/number/invalidNumberAssignments.ts(14,5): error TS2322: Type 'number' is not assignable to type '{ baz: string; }'. -tests/cases/conformance/types/primitives/number/invalidNumberAssignments.ts(15,5): error TS2322: Type 'number' is not assignable to type '{ 0: number; }'. +tests/cases/conformance/types/primitives/number/invalidNumberAssignments.ts(14,5): error TS2322: Type '1' is not assignable to type '{ baz: string; }'. +tests/cases/conformance/types/primitives/number/invalidNumberAssignments.ts(15,5): error TS2322: Type '1' is not assignable to type '{ 0: number; }'. tests/cases/conformance/types/primitives/number/invalidNumberAssignments.ts(18,1): error TS2364: Invalid left-hand side of assignment expression. tests/cases/conformance/types/primitives/number/invalidNumberAssignments.ts(21,5): error TS2322: Type 'number' is not assignable to type 'T'. tests/cases/conformance/types/primitives/number/invalidNumberAssignments.ts(23,1): error TS2364: Invalid left-hand side of assignment expression. @@ -36,10 +36,10 @@ tests/cases/conformance/types/primitives/number/invalidNumberAssignments.ts(23,1 var g: { baz: string } = 1; ~ -!!! error TS2322: Type 'number' is not assignable to type '{ baz: string; }'. +!!! error TS2322: Type '1' is not assignable to type '{ baz: string; }'. var g2: { 0: number } = 1; ~~ -!!! error TS2322: Type 'number' is not assignable to type '{ 0: number; }'. +!!! error TS2322: Type '1' is not assignable to type '{ 0: number; }'. module M { export var x = 1; } M = x; diff --git a/tests/baselines/reference/invalidSplice.types b/tests/baselines/reference/invalidSplice.types index 1e3b42ff551..876846d3da9 100644 --- a/tests/baselines/reference/invalidSplice.types +++ b/tests/baselines/reference/invalidSplice.types @@ -5,8 +5,8 @@ var arr = [].splice(0,3,4,5); >[].splice : { (start: number): any[]; (start: number, deleteCount: number, ...items: any[]): any[]; } >[] : undefined[] >splice : { (start: number): any[]; (start: number, deleteCount: number, ...items: any[]): any[]; } ->0 : number ->3 : number ->4 : number ->5 : number +>0 : 0 +>3 : 3 +>4 : 4 +>5 : 5 diff --git a/tests/baselines/reference/invalidStringAssignments.errors.txt b/tests/baselines/reference/invalidStringAssignments.errors.txt index d7ac2134dc1..b37c56e8a40 100644 --- a/tests/baselines/reference/invalidStringAssignments.errors.txt +++ b/tests/baselines/reference/invalidStringAssignments.errors.txt @@ -3,8 +3,8 @@ tests/cases/conformance/types/primitives/string/invalidStringAssignments.ts(4,5) tests/cases/conformance/types/primitives/string/invalidStringAssignments.ts(5,5): error TS2322: Type 'string' is not assignable to type 'void'. tests/cases/conformance/types/primitives/string/invalidStringAssignments.ts(9,5): error TS2322: Type 'string' is not assignable to type 'C'. tests/cases/conformance/types/primitives/string/invalidStringAssignments.ts(12,5): error TS2322: Type 'string' is not assignable to type 'I'. -tests/cases/conformance/types/primitives/string/invalidStringAssignments.ts(14,5): error TS2322: Type 'number' is not assignable to type '{ baz: string; }'. -tests/cases/conformance/types/primitives/string/invalidStringAssignments.ts(15,5): error TS2322: Type 'number' is not assignable to type '{ 0: number; }'. +tests/cases/conformance/types/primitives/string/invalidStringAssignments.ts(14,5): error TS2322: Type '1' is not assignable to type '{ baz: string; }'. +tests/cases/conformance/types/primitives/string/invalidStringAssignments.ts(15,5): error TS2322: Type '1' is not assignable to type '{ 0: number; }'. tests/cases/conformance/types/primitives/string/invalidStringAssignments.ts(18,1): error TS2364: Invalid left-hand side of assignment expression. tests/cases/conformance/types/primitives/string/invalidStringAssignments.ts(21,5): error TS2322: Type 'string' is not assignable to type 'T'. tests/cases/conformance/types/primitives/string/invalidStringAssignments.ts(23,1): error TS2364: Invalid left-hand side of assignment expression. @@ -37,10 +37,10 @@ tests/cases/conformance/types/primitives/string/invalidStringAssignments.ts(26,5 var g: { baz: string } = 1; ~ -!!! error TS2322: Type 'number' is not assignable to type '{ baz: string; }'. +!!! error TS2322: Type '1' is not assignable to type '{ baz: string; }'. var g2: { 0: number } = 1; ~~ -!!! error TS2322: Type 'number' is not assignable to type '{ 0: number; }'. +!!! error TS2322: Type '1' is not assignable to type '{ 0: number; }'. module M { export var x = 1; } M = x; diff --git a/tests/baselines/reference/invalidSwitchBreakStatement.errors.txt b/tests/baselines/reference/invalidSwitchBreakStatement.errors.txt new file mode 100644 index 00000000000..31715e3fc0b --- /dev/null +++ b/tests/baselines/reference/invalidSwitchBreakStatement.errors.txt @@ -0,0 +1,13 @@ +tests/cases/conformance/statements/breakStatements/invalidSwitchBreakStatement.ts(4,10): error TS2678: Type '5' is not comparable to type '12'. + + +==== tests/cases/conformance/statements/breakStatements/invalidSwitchBreakStatement.ts (1 errors) ==== + // break is not allowed in a switch statement + + switch (12) { + case 5: + ~ +!!! error TS2678: Type '5' is not comparable to type '12'. + break; + } + \ No newline at end of file diff --git a/tests/baselines/reference/invalidSwitchContinueStatement.errors.txt b/tests/baselines/reference/invalidSwitchContinueStatement.errors.txt index 9b86b019a7c..b5231d5948b 100644 --- a/tests/baselines/reference/invalidSwitchContinueStatement.errors.txt +++ b/tests/baselines/reference/invalidSwitchContinueStatement.errors.txt @@ -1,11 +1,14 @@ +tests/cases/conformance/statements/continueStatements/invalidSwitchContinueStatement.ts(4,10): error TS2678: Type '5' is not comparable to type '12'. tests/cases/conformance/statements/continueStatements/invalidSwitchContinueStatement.ts(5,9): error TS1104: A 'continue' statement can only be used within an enclosing iteration statement. -==== tests/cases/conformance/statements/continueStatements/invalidSwitchContinueStatement.ts (1 errors) ==== +==== tests/cases/conformance/statements/continueStatements/invalidSwitchContinueStatement.ts (2 errors) ==== // continue is not allowed in a switch statement switch (12) { case 5: + ~ +!!! error TS2678: Type '5' is not comparable to type '12'. continue; ~~~~~~~~~ !!! error TS1104: A 'continue' statement can only be used within an enclosing iteration statement. diff --git a/tests/baselines/reference/invalidUndefinedAssignments.errors.txt b/tests/baselines/reference/invalidUndefinedAssignments.errors.txt index 5eff2e7ff1a..05921e9433f 100644 --- a/tests/baselines/reference/invalidUndefinedAssignments.errors.txt +++ b/tests/baselines/reference/invalidUndefinedAssignments.errors.txt @@ -1,7 +1,7 @@ tests/cases/conformance/types/primitives/undefined/invalidUndefinedAssignments.ts(4,1): error TS2364: Invalid left-hand side of assignment expression. tests/cases/conformance/types/primitives/undefined/invalidUndefinedAssignments.ts(5,1): error TS2450: Left-hand side of assignment expression cannot be a constant or a read-only property. tests/cases/conformance/types/primitives/undefined/invalidUndefinedAssignments.ts(9,1): error TS2364: Invalid left-hand side of assignment expression. -tests/cases/conformance/types/primitives/undefined/invalidUndefinedAssignments.ts(14,1): error TS2304: Cannot find name 'I'. +tests/cases/conformance/types/primitives/undefined/invalidUndefinedAssignments.ts(14,1): error TS2693: 'I' only refers to a type, but is being used as a value here. tests/cases/conformance/types/primitives/undefined/invalidUndefinedAssignments.ts(17,1): error TS2364: Invalid left-hand side of assignment expression. tests/cases/conformance/types/primitives/undefined/invalidUndefinedAssignments.ts(21,1): error TS2364: Invalid left-hand side of assignment expression. @@ -28,7 +28,7 @@ tests/cases/conformance/types/primitives/undefined/invalidUndefinedAssignments.t g = x; I = x; ~ -!!! error TS2304: Cannot find name 'I'. +!!! error TS2693: 'I' only refers to a type, but is being used as a value here. module M { export var x = 1; } M = x; diff --git a/tests/baselines/reference/invalidUndefinedValues.types b/tests/baselines/reference/invalidUndefinedValues.types index b88c2021618..b873f575263 100644 --- a/tests/baselines/reference/invalidUndefinedValues.types +++ b/tests/baselines/reference/invalidUndefinedValues.types @@ -4,19 +4,19 @@ var x: typeof undefined; >undefined : undefined x = 1; ->x = 1 : number +>x = 1 : 1 >x : any ->1 : number +>1 : 1 x = ''; ->x = '' : string +>x = '' : "" >x : any ->'' : string +>'' : "" x = true; ->x = true : boolean +>x = true : true >x : any ->true : boolean +>true : true var a: void; >a : void @@ -65,7 +65,7 @@ x = c; module M { export var x = 1; } >M : typeof M >x : number ->1 : number +>1 : 1 x = M; >x = M : typeof M diff --git a/tests/baselines/reference/invalidVoidAssignments.errors.txt b/tests/baselines/reference/invalidVoidAssignments.errors.txt index af8cec62672..de19fc3a218 100644 --- a/tests/baselines/reference/invalidVoidAssignments.errors.txt +++ b/tests/baselines/reference/invalidVoidAssignments.errors.txt @@ -3,8 +3,8 @@ tests/cases/conformance/types/primitives/void/invalidVoidAssignments.ts(4,5): er tests/cases/conformance/types/primitives/void/invalidVoidAssignments.ts(5,5): error TS2322: Type 'void' is not assignable to type 'number'. tests/cases/conformance/types/primitives/void/invalidVoidAssignments.ts(9,5): error TS2322: Type 'void' is not assignable to type 'C'. tests/cases/conformance/types/primitives/void/invalidVoidAssignments.ts(12,5): error TS2322: Type 'void' is not assignable to type 'I'. -tests/cases/conformance/types/primitives/void/invalidVoidAssignments.ts(14,5): error TS2322: Type 'number' is not assignable to type '{ baz: string; }'. -tests/cases/conformance/types/primitives/void/invalidVoidAssignments.ts(15,5): error TS2322: Type 'number' is not assignable to type '{ 0: number; }'. +tests/cases/conformance/types/primitives/void/invalidVoidAssignments.ts(14,5): error TS2322: Type '1' is not assignable to type '{ baz: string; }'. +tests/cases/conformance/types/primitives/void/invalidVoidAssignments.ts(15,5): error TS2322: Type '1' is not assignable to type '{ 0: number; }'. tests/cases/conformance/types/primitives/void/invalidVoidAssignments.ts(18,1): error TS2364: Invalid left-hand side of assignment expression. tests/cases/conformance/types/primitives/void/invalidVoidAssignments.ts(21,5): error TS2322: Type 'void' is not assignable to type 'T'. tests/cases/conformance/types/primitives/void/invalidVoidAssignments.ts(23,1): error TS2364: Invalid left-hand side of assignment expression. @@ -39,10 +39,10 @@ tests/cases/conformance/types/primitives/void/invalidVoidAssignments.ts(29,1): e var g: { baz: string } = 1; ~ -!!! error TS2322: Type 'number' is not assignable to type '{ baz: string; }'. +!!! error TS2322: Type '1' is not assignable to type '{ baz: string; }'. var g2: { 0: number } = 1; ~~ -!!! error TS2322: Type 'number' is not assignable to type '{ 0: number; }'. +!!! error TS2322: Type '1' is not assignable to type '{ 0: number; }'. module M { export var x = 1; } M = x; diff --git a/tests/baselines/reference/invalidVoidValues.errors.txt b/tests/baselines/reference/invalidVoidValues.errors.txt index eb5ddd02259..8fc015f692f 100644 --- a/tests/baselines/reference/invalidVoidValues.errors.txt +++ b/tests/baselines/reference/invalidVoidValues.errors.txt @@ -1,6 +1,6 @@ -tests/cases/conformance/types/primitives/void/invalidVoidValues.ts(2,1): error TS2322: Type 'number' is not assignable to type 'void'. -tests/cases/conformance/types/primitives/void/invalidVoidValues.ts(3,1): error TS2322: Type 'string' is not assignable to type 'void'. -tests/cases/conformance/types/primitives/void/invalidVoidValues.ts(4,1): error TS2322: Type 'boolean' is not assignable to type 'void'. +tests/cases/conformance/types/primitives/void/invalidVoidValues.ts(2,1): error TS2322: Type '1' is not assignable to type 'void'. +tests/cases/conformance/types/primitives/void/invalidVoidValues.ts(3,1): error TS2322: Type '""' is not assignable to type 'void'. +tests/cases/conformance/types/primitives/void/invalidVoidValues.ts(4,1): error TS2322: Type 'true' is not assignable to type 'void'. tests/cases/conformance/types/primitives/void/invalidVoidValues.ts(7,1): error TS2322: Type 'typeof E' is not assignable to type 'void'. tests/cases/conformance/types/primitives/void/invalidVoidValues.ts(8,1): error TS2322: Type 'E' is not assignable to type 'void'. tests/cases/conformance/types/primitives/void/invalidVoidValues.ts(12,1): error TS2322: Type 'C' is not assignable to type 'void'. @@ -15,13 +15,13 @@ tests/cases/conformance/types/primitives/void/invalidVoidValues.ts(26,1): error var x: void; x = 1; ~ -!!! error TS2322: Type 'number' is not assignable to type 'void'. +!!! error TS2322: Type '1' is not assignable to type 'void'. x = ''; ~ -!!! error TS2322: Type 'string' is not assignable to type 'void'. +!!! error TS2322: Type '""' is not assignable to type 'void'. x = true; ~ -!!! error TS2322: Type 'boolean' is not assignable to type 'void'. +!!! error TS2322: Type 'true' is not assignable to type 'void'. enum E { A } x = E; diff --git a/tests/baselines/reference/invocationExpressionInFunctionParameter.errors.txt b/tests/baselines/reference/invocationExpressionInFunctionParameter.errors.txt index b38ed09f47e..e887d564df4 100644 --- a/tests/baselines/reference/invocationExpressionInFunctionParameter.errors.txt +++ b/tests/baselines/reference/invocationExpressionInFunctionParameter.errors.txt @@ -1,4 +1,4 @@ -tests/cases/compiler/invocationExpressionInFunctionParameter.ts(3,24): error TS2345: Argument of type 'number' is not assignable to parameter of type 'string'. +tests/cases/compiler/invocationExpressionInFunctionParameter.ts(3,24): error TS2345: Argument of type '123' is not assignable to parameter of type 'string'. ==== tests/cases/compiler/invocationExpressionInFunctionParameter.ts (1 errors) ==== @@ -6,5 +6,5 @@ tests/cases/compiler/invocationExpressionInFunctionParameter.ts(3,24): error TS2 } function foo3(x = foo1(123)) { //should error, 123 is not string ~~~ -!!! error TS2345: Argument of type 'number' is not assignable to parameter of type 'string'. +!!! error TS2345: Argument of type '123' is not assignable to parameter of type 'string'. } \ No newline at end of file diff --git a/tests/baselines/reference/ipromise2.types b/tests/baselines/reference/ipromise2.types index b52c3460dd4..e643bd7da4b 100644 --- a/tests/baselines/reference/ipromise2.types +++ b/tests/baselines/reference/ipromise2.types @@ -112,7 +112,7 @@ var p2 = p.then(function (s) { >s : string return 34; ->34 : number +>34 : 34 } ); diff --git a/tests/baselines/reference/ipromise4.types b/tests/baselines/reference/ipromise4.types index b12c47c7ed5..32461326c56 100644 --- a/tests/baselines/reference/ipromise4.types +++ b/tests/baselines/reference/ipromise4.types @@ -116,7 +116,7 @@ p.then(function (x) { return "hello"; } ).then(function (x) { return x } ); // s >then : { (success?: (value: number) => Windows.Foundation.IPromise, error?: (error: any) => Windows.Foundation.IPromise, progress?: (progress: any) => void): Windows.Foundation.IPromise; (success?: (value: number) => Windows.Foundation.IPromise, error?: (error: any) => U, progress?: (progress: any) => void): Windows.Foundation.IPromise; (success?: (value: number) => U, error?: (error: any) => Windows.Foundation.IPromise, progress?: (progress: any) => void): Windows.Foundation.IPromise; (success?: (value: number) => U, error?: (error: any) => U, progress?: (progress: any) => void): Windows.Foundation.IPromise; } >function (x) { return "hello"; } : (x: number) => string >x : number ->"hello" : string +>"hello" : "hello" >then : { (success?: (value: string) => Windows.Foundation.IPromise, error?: (error: any) => Windows.Foundation.IPromise, progress?: (progress: any) => void): Windows.Foundation.IPromise; (success?: (value: string) => Windows.Foundation.IPromise, error?: (error: any) => U, progress?: (progress: any) => void): Windows.Foundation.IPromise; (success?: (value: string) => U, error?: (error: any) => Windows.Foundation.IPromise, progress?: (progress: any) => void): Windows.Foundation.IPromise; (success?: (value: string) => U, error?: (error: any) => U, progress?: (progress: any) => void): Windows.Foundation.IPromise; } >function (x) { return x } : (x: string) => string >x : string diff --git a/tests/baselines/reference/isLiteral1.types b/tests/baselines/reference/isLiteral1.types index 7ef84568f86..ae512e8bcb1 100644 --- a/tests/baselines/reference/isLiteral1.types +++ b/tests/baselines/reference/isLiteral1.types @@ -1,5 +1,5 @@ === tests/cases/compiler/isLiteral1.ts === var x: number = 02343; >x : number ->02343 : number +>02343 : 2343 diff --git a/tests/baselines/reference/isLiteral2.types b/tests/baselines/reference/isLiteral2.types index ab62993fab6..7ee40a96272 100644 --- a/tests/baselines/reference/isLiteral2.types +++ b/tests/baselines/reference/isLiteral2.types @@ -1,5 +1,5 @@ === tests/cases/compiler/isLiteral2.ts === var x: number = 02343 >x : number ->02343 : number +>02343 : 2343 diff --git a/tests/baselines/reference/isolatedModulesNonAmbientConstEnum.types b/tests/baselines/reference/isolatedModulesNonAmbientConstEnum.types index 4583a1c0730..0412a79c479 100644 --- a/tests/baselines/reference/isolatedModulesNonAmbientConstEnum.types +++ b/tests/baselines/reference/isolatedModulesNonAmbientConstEnum.types @@ -3,7 +3,7 @@ const enum E { X = 100 }; >E : E >X : E ->100 : number +>100 : 100 var e = E.X; >e : E diff --git a/tests/baselines/reference/isolatedModulesSourceMap.types b/tests/baselines/reference/isolatedModulesSourceMap.types index d2a474c023d..2ac7b1f2f65 100644 --- a/tests/baselines/reference/isolatedModulesSourceMap.types +++ b/tests/baselines/reference/isolatedModulesSourceMap.types @@ -2,5 +2,5 @@ export var x = 1; >x : number ->1 : number +>1 : 1 diff --git a/tests/baselines/reference/iterableArrayPattern1.types b/tests/baselines/reference/iterableArrayPattern1.types index a2c9807d26a..816ce7ac6cf 100644 --- a/tests/baselines/reference/iterableArrayPattern1.types +++ b/tests/baselines/reference/iterableArrayPattern1.types @@ -21,7 +21,7 @@ class SymbolIterator { done: false >done : boolean ->false : boolean +>false : false }; } diff --git a/tests/baselines/reference/iterableArrayPattern11.types b/tests/baselines/reference/iterableArrayPattern11.types index 5ec182ec397..0acadd7cfc8 100644 --- a/tests/baselines/reference/iterableArrayPattern11.types +++ b/tests/baselines/reference/iterableArrayPattern11.types @@ -37,7 +37,7 @@ class FooIterator { done: false >done : boolean ->false : boolean +>false : false }; } diff --git a/tests/baselines/reference/iterableArrayPattern12.types b/tests/baselines/reference/iterableArrayPattern12.types index 89af4d47d01..c00e1daae81 100644 --- a/tests/baselines/reference/iterableArrayPattern12.types +++ b/tests/baselines/reference/iterableArrayPattern12.types @@ -37,7 +37,7 @@ class FooIterator { done: false >done : boolean ->false : boolean +>false : false }; } diff --git a/tests/baselines/reference/iterableArrayPattern13.types b/tests/baselines/reference/iterableArrayPattern13.types index e8873a74b72..04dab57748d 100644 --- a/tests/baselines/reference/iterableArrayPattern13.types +++ b/tests/baselines/reference/iterableArrayPattern13.types @@ -35,7 +35,7 @@ class FooIterator { done: false >done : boolean ->false : boolean +>false : false }; } diff --git a/tests/baselines/reference/iterableArrayPattern2.types b/tests/baselines/reference/iterableArrayPattern2.types index 48f44443591..63786a1d351 100644 --- a/tests/baselines/reference/iterableArrayPattern2.types +++ b/tests/baselines/reference/iterableArrayPattern2.types @@ -21,7 +21,7 @@ class SymbolIterator { done: false >done : boolean ->false : boolean +>false : false }; } diff --git a/tests/baselines/reference/iterableArrayPattern3.types b/tests/baselines/reference/iterableArrayPattern3.types index dd001d46376..a21e702526b 100644 --- a/tests/baselines/reference/iterableArrayPattern3.types +++ b/tests/baselines/reference/iterableArrayPattern3.types @@ -38,7 +38,7 @@ class FooIterator { done: false >done : boolean ->false : boolean +>false : false }; } diff --git a/tests/baselines/reference/iterableArrayPattern30.types b/tests/baselines/reference/iterableArrayPattern30.types index d27db2e7544..1abdba039ed 100644 --- a/tests/baselines/reference/iterableArrayPattern30.types +++ b/tests/baselines/reference/iterableArrayPattern30.types @@ -6,11 +6,11 @@ const [[k1, v1], [k2, v2]] = new Map([["", true], ["hello", true]]) >v2 : boolean >new Map([["", true], ["hello", true]]) : Map >Map : MapConstructor ->[["", true], ["hello", true]] : [string, boolean][] ->["", true] : [string, boolean] ->"" : string ->true : boolean ->["hello", true] : [string, boolean] ->"hello" : string ->true : boolean +>[["", true], ["hello", true]] : [string, true][] +>["", true] : [string, true] +>"" : "" +>true : true +>["hello", true] : [string, true] +>"hello" : "hello" +>true : true diff --git a/tests/baselines/reference/iterableArrayPattern4.types b/tests/baselines/reference/iterableArrayPattern4.types index 2d6531494a4..a3be4114498 100644 --- a/tests/baselines/reference/iterableArrayPattern4.types +++ b/tests/baselines/reference/iterableArrayPattern4.types @@ -39,7 +39,7 @@ class FooIterator { done: false >done : boolean ->false : boolean +>false : false }; } diff --git a/tests/baselines/reference/iterableArrayPattern9.types b/tests/baselines/reference/iterableArrayPattern9.types index e9e342e7775..b24d057f4a7 100644 --- a/tests/baselines/reference/iterableArrayPattern9.types +++ b/tests/baselines/reference/iterableArrayPattern9.types @@ -31,7 +31,7 @@ class FooIterator { done: false >done : boolean ->false : boolean +>false : false }; } diff --git a/tests/baselines/reference/iteratorSpreadInArray.types b/tests/baselines/reference/iteratorSpreadInArray.types index 780acf32fab..4b5a63e5d57 100644 --- a/tests/baselines/reference/iteratorSpreadInArray.types +++ b/tests/baselines/reference/iteratorSpreadInArray.types @@ -22,7 +22,7 @@ class SymbolIterator { done: false >done : boolean ->false : boolean +>false : false }; } diff --git a/tests/baselines/reference/iteratorSpreadInArray2.types b/tests/baselines/reference/iteratorSpreadInArray2.types index f2e64e5282e..19bf5eab004 100644 --- a/tests/baselines/reference/iteratorSpreadInArray2.types +++ b/tests/baselines/reference/iteratorSpreadInArray2.types @@ -25,7 +25,7 @@ class SymbolIterator { done: false >done : boolean ->false : boolean +>false : false }; } @@ -51,11 +51,11 @@ class NumberIterator { value: 0, >value : number ->0 : number +>0 : 0 done: false >done : boolean ->false : boolean +>false : false }; } diff --git a/tests/baselines/reference/iteratorSpreadInArray3.types b/tests/baselines/reference/iteratorSpreadInArray3.types index a59da81e157..1fd29bb2381 100644 --- a/tests/baselines/reference/iteratorSpreadInArray3.types +++ b/tests/baselines/reference/iteratorSpreadInArray3.types @@ -4,8 +4,8 @@ var array = [...[0, 1], ...new SymbolIterator]; >[...[0, 1], ...new SymbolIterator] : (number | symbol)[] >...[0, 1] : number >[0, 1] : number[] ->0 : number ->1 : number +>0 : 0 +>1 : 1 >...new SymbolIterator : symbol >new SymbolIterator : SymbolIterator >SymbolIterator : typeof SymbolIterator @@ -26,7 +26,7 @@ class SymbolIterator { done: false >done : boolean ->false : boolean +>false : false }; } diff --git a/tests/baselines/reference/iteratorSpreadInArray4.types b/tests/baselines/reference/iteratorSpreadInArray4.types index 0e16758acf4..6024e79dee5 100644 --- a/tests/baselines/reference/iteratorSpreadInArray4.types +++ b/tests/baselines/reference/iteratorSpreadInArray4.types @@ -2,8 +2,8 @@ var array = [0, 1, ...new SymbolIterator]; >array : (number | symbol)[] >[0, 1, ...new SymbolIterator] : (number | symbol)[] ->0 : number ->1 : number +>0 : 0 +>1 : 1 >...new SymbolIterator : symbol >new SymbolIterator : SymbolIterator >SymbolIterator : typeof SymbolIterator @@ -24,7 +24,7 @@ class SymbolIterator { done: false >done : boolean ->false : boolean +>false : false }; } diff --git a/tests/baselines/reference/iteratorSpreadInArray7.types b/tests/baselines/reference/iteratorSpreadInArray7.types index 38549a606ab..ef0e3898e0f 100644 --- a/tests/baselines/reference/iteratorSpreadInArray7.types +++ b/tests/baselines/reference/iteratorSpreadInArray7.types @@ -28,7 +28,7 @@ class SymbolIterator { done: false >done : boolean ->false : boolean +>false : false }; } diff --git a/tests/baselines/reference/iteratorSpreadInCall11.types b/tests/baselines/reference/iteratorSpreadInCall11.types index dd440a1b4ac..5990b26df64 100644 --- a/tests/baselines/reference/iteratorSpreadInCall11.types +++ b/tests/baselines/reference/iteratorSpreadInCall11.types @@ -13,7 +13,7 @@ function foo(...s: T[]) { return s[0] } >T : T >s[0] : T >s : T[] ->0 : number +>0 : 0 class SymbolIterator { >SymbolIterator : SymbolIterator @@ -31,7 +31,7 @@ class SymbolIterator { done: false >done : boolean ->false : boolean +>false : false }; } diff --git a/tests/baselines/reference/iteratorSpreadInCall12.types b/tests/baselines/reference/iteratorSpreadInCall12.types index 8543e59f55f..b614fdde16b 100644 --- a/tests/baselines/reference/iteratorSpreadInCall12.types +++ b/tests/baselines/reference/iteratorSpreadInCall12.types @@ -38,7 +38,7 @@ class SymbolIterator { done: false >done : boolean ->false : boolean +>false : false }; } @@ -64,11 +64,11 @@ class StringIterator { value: "", >value : string ->"" : string +>"" : "" done: false >done : boolean ->false : boolean +>false : false }; } diff --git a/tests/baselines/reference/iteratorSpreadInCall3.types b/tests/baselines/reference/iteratorSpreadInCall3.types index 54857755b55..56b7f6db6d1 100644 --- a/tests/baselines/reference/iteratorSpreadInCall3.types +++ b/tests/baselines/reference/iteratorSpreadInCall3.types @@ -26,7 +26,7 @@ class SymbolIterator { done: false >done : boolean ->false : boolean +>false : false }; } diff --git a/tests/baselines/reference/iteratorSpreadInCall5.types b/tests/baselines/reference/iteratorSpreadInCall5.types index bf4a0f7ad65..9542a76daf1 100644 --- a/tests/baselines/reference/iteratorSpreadInCall5.types +++ b/tests/baselines/reference/iteratorSpreadInCall5.types @@ -29,7 +29,7 @@ class SymbolIterator { done: false >done : boolean ->false : boolean +>false : false }; } @@ -55,11 +55,11 @@ class StringIterator { value: "", >value : string ->"" : string +>"" : "" done: false >done : boolean ->false : boolean +>false : false }; } diff --git a/tests/baselines/reference/iteratorsAndStrictNullChecks.types b/tests/baselines/reference/iteratorsAndStrictNullChecks.types index ce1d7430f77..43efed86ed4 100644 --- a/tests/baselines/reference/iteratorsAndStrictNullChecks.types +++ b/tests/baselines/reference/iteratorsAndStrictNullChecks.types @@ -4,8 +4,8 @@ for (const x of ["a", "b"]) { >x : string >["a", "b"] : string[] ->"a" : string ->"b" : string +>"a" : "a" +>"b" : "b" x.substring; >x.substring : (start: number, end?: number | undefined) => string @@ -17,15 +17,15 @@ for (const x of ["a", "b"]) { const xs = [1, 2, 3]; >xs : number[] >[1, 2, 3] : number[] ->1 : number ->2 : number ->3 : number +>1 : 1 +>2 : 2 +>3 : 3 const ys = [4, 5]; >ys : number[] >[4, 5] : number[] ->4 : number ->5 : number +>4 : 4 +>5 : 5 xs.push(...ys); >xs.push(...ys) : number diff --git a/tests/baselines/reference/jsFileCompilationExternalPackageError.types b/tests/baselines/reference/jsFileCompilationExternalPackageError.types index ae2eb085f28..d3a696d7bfe 100644 --- a/tests/baselines/reference/jsFileCompilationExternalPackageError.types +++ b/tests/baselines/reference/jsFileCompilationExternalPackageError.types @@ -17,18 +17,18 @@ c++; === tests/cases/compiler/node_modules/b.ts === var a = 10; >a : number ->10 : number +>10 : 10 === tests/cases/compiler/node_modules/c.js === exports.a = 10; ->exports.a = 10 : number +>exports.a = 10 : 10 >exports.a : any >exports : any >a : any ->10 : number +>10 : 10 c = 10; ->c = 10 : number +>c = 10 : 10 >c : any ->10 : number +>10 : 10 diff --git a/tests/baselines/reference/jsFileCompilationLetBeingRenamed.types b/tests/baselines/reference/jsFileCompilationLetBeingRenamed.types index 094f59d2022..3cac906f5d7 100644 --- a/tests/baselines/reference/jsFileCompilationLetBeingRenamed.types +++ b/tests/baselines/reference/jsFileCompilationLetBeingRenamed.types @@ -6,10 +6,10 @@ function foo(a) { for (let a = 0; a < 10; a++) { >a : number ->0 : number +>0 : 0 >a < 10 : boolean >a : number ->10 : number +>10 : 10 >a++ : number >a : number diff --git a/tests/baselines/reference/jsFileCompilationRestParamJsDocFunction.types b/tests/baselines/reference/jsFileCompilationRestParamJsDocFunction.types index 443ed739828..c420454b8cf 100644 --- a/tests/baselines/reference/jsFileCompilationRestParamJsDocFunction.types +++ b/tests/baselines/reference/jsFileCompilationRestParamJsDocFunction.types @@ -42,7 +42,7 @@ function apply(func, thisArg, args) { >thisArg : any >args[0] : any >args : any[] ->0 : number +>0 : 0 case 2: return func.call(thisArg, args[0], args[1]); >2 : 2 @@ -53,10 +53,10 @@ function apply(func, thisArg, args) { >thisArg : any >args[0] : any >args : any[] ->0 : number +>0 : 0 >args[1] : any >args : any[] ->1 : number +>1 : 1 case 3: return func.call(thisArg, args[0], args[1], args[2]); >3 : 3 @@ -67,13 +67,13 @@ function apply(func, thisArg, args) { >thisArg : any >args[0] : any >args : any[] ->0 : number +>0 : 0 >args[1] : any >args : any[] ->1 : number +>1 : 1 >args[2] : any >args : any[] ->2 : number +>2 : 2 } return func.apply(thisArg, args); >func.apply(thisArg, args) : any diff --git a/tests/baselines/reference/jsFileCompilationShortHandProperty.types b/tests/baselines/reference/jsFileCompilationShortHandProperty.types index e4dd1755ceb..d6badf44909 100644 --- a/tests/baselines/reference/jsFileCompilationShortHandProperty.types +++ b/tests/baselines/reference/jsFileCompilationShortHandProperty.types @@ -5,11 +5,11 @@ function foo() { var a = 10; >a : number ->10 : number +>10 : 10 var b = "Hello"; >b : string ->"Hello" : string +>"Hello" : "Hello" return { >{ a, b } : { a: number; b: string; } diff --git a/tests/baselines/reference/jsdocLiteral.types b/tests/baselines/reference/jsdocLiteral.types index b6c9e522ac3..c0a17c9bad1 100644 --- a/tests/baselines/reference/jsdocLiteral.types +++ b/tests/baselines/reference/jsdocLiteral.types @@ -25,6 +25,6 @@ function f(p1, p2, p3, p4, p5) { >p3 : "literal" | "other" >p4 : number | "literal" >p5 : true | 12 | "str" ->'.' : string +>'.' : "." } diff --git a/tests/baselines/reference/json.stringify.types b/tests/baselines/reference/json.stringify.types index aaf92a17c0a..b063b06d8d0 100644 --- a/tests/baselines/reference/json.stringify.types +++ b/tests/baselines/reference/json.stringify.types @@ -11,7 +11,7 @@ JSON.stringify(value, undefined, 2); >stringify : { (value: any, replacer?: ((key: string, value: any) => any) | undefined, space?: string | number | undefined): string; (value: any, replacer?: (string | number)[] | null | undefined, space?: string | number | undefined): string; } >value : null >undefined : undefined ->2 : number +>2 : 2 JSON.stringify(value, null, 2); >JSON.stringify(value, null, 2) : string @@ -20,7 +20,7 @@ JSON.stringify(value, null, 2); >stringify : { (value: any, replacer?: ((key: string, value: any) => any) | undefined, space?: string | number | undefined): string; (value: any, replacer?: (string | number)[] | null | undefined, space?: string | number | undefined): string; } >value : null >null : null ->2 : number +>2 : 2 JSON.stringify(value, ["a", 1], 2); >JSON.stringify(value, ["a", 1], 2) : string @@ -29,9 +29,9 @@ JSON.stringify(value, ["a", 1], 2); >stringify : { (value: any, replacer?: ((key: string, value: any) => any) | undefined, space?: string | number | undefined): string; (value: any, replacer?: (string | number)[] | null | undefined, space?: string | number | undefined): string; } >value : null >["a", 1] : (string | number)[] ->"a" : string ->1 : number ->2 : number +>"a" : "a" +>1 : 1 +>2 : 2 JSON.stringify(value, (k) => undefined, 2); >JSON.stringify(value, (k) => undefined, 2) : string @@ -42,7 +42,7 @@ JSON.stringify(value, (k) => undefined, 2); >(k) => undefined : (k: string) => undefined >k : string >undefined : undefined ->2 : number +>2 : 2 JSON.stringify(value, undefined, 2); >JSON.stringify(value, undefined, 2) : string @@ -51,5 +51,5 @@ JSON.stringify(value, undefined, 2); >stringify : { (value: any, replacer?: ((key: string, value: any) => any) | undefined, space?: string | number | undefined): string; (value: any, replacer?: (string | number)[] | null | undefined, space?: string | number | undefined): string; } >value : null >undefined : undefined ->2 : number +>2 : 2 diff --git a/tests/baselines/reference/jsxEsprimaFbTestSuite.errors.txt b/tests/baselines/reference/jsxEsprimaFbTestSuite.errors.txt index 3a6059d8d07..23b14a25cd2 100644 --- a/tests/baselines/reference/jsxEsprimaFbTestSuite.errors.txt +++ b/tests/baselines/reference/jsxEsprimaFbTestSuite.errors.txt @@ -1,3 +1,4 @@ +tests/cases/conformance/jsx/jsxEsprimaFbTestSuite.tsx(39,1): error TS2695: Left side of comma operator is unused and has no side effects. tests/cases/conformance/jsx/jsxEsprimaFbTestSuite.tsx(39,17): error TS1005: '{' expected. tests/cases/conformance/jsx/jsxEsprimaFbTestSuite.tsx(39,23): error TS1005: '}' expected. tests/cases/conformance/jsx/jsxEsprimaFbTestSuite.tsx(39,29): error TS1005: '{' expected. @@ -7,7 +8,7 @@ tests/cases/conformance/jsx/jsxEsprimaFbTestSuite.tsx(41,1): error TS1003: Ident tests/cases/conformance/jsx/jsxEsprimaFbTestSuite.tsx(41,12): error TS2657: JSX expressions must have one parent element -==== tests/cases/conformance/jsx/jsxEsprimaFbTestSuite.tsx (7 errors) ==== +==== tests/cases/conformance/jsx/jsxEsprimaFbTestSuite.tsx (8 errors) ==== declare var React: any; declare var 日本語; declare var AbC_def; @@ -47,6 +48,8 @@ tests/cases/conformance/jsx/jsxEsprimaFbTestSuite.tsx(41,12): error TS2657: JSX

7x invalid-js-identifier
; right=monkeys /> gorillas />; + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS2695: Left side of comma operator is unused and has no side effects. ~ !!! error TS1005: '{' expected. ~~~~~ diff --git a/tests/baselines/reference/jsxHash.types b/tests/baselines/reference/jsxHash.types index 6d413141ca6..41f89c4b087 100644 --- a/tests/baselines/reference/jsxHash.types +++ b/tests/baselines/reference/jsxHash.types @@ -3,21 +3,21 @@ var t02 =
{0}#; >t02 : any >{0}# : any >a : any ->0 : number +>0 : 0 >a : any var t03 = #{0}; >t03 : any >#{0} : any >a : any ->0 : number +>0 : 0 >a : any var t04 = #{0}#; >t04 : any >#{0}# : any >a : any ->0 : number +>0 : 0 >a : any var t05 = #; diff --git a/tests/baselines/reference/jsxInvalidEsprimaTestSuite.errors.txt b/tests/baselines/reference/jsxInvalidEsprimaTestSuite.errors.txt index 237c3399e88..4b415154c6b 100644 --- a/tests/baselines/reference/jsxInvalidEsprimaTestSuite.errors.txt +++ b/tests/baselines/reference/jsxInvalidEsprimaTestSuite.errors.txt @@ -7,6 +7,7 @@ tests/cases/conformance/jsx/jsxInvalidEsprimaTestSuite.tsx(5,2): error TS1109: E tests/cases/conformance/jsx/jsxInvalidEsprimaTestSuite.tsx(5,3): error TS2304: Cannot find name 'a'. tests/cases/conformance/jsx/jsxInvalidEsprimaTestSuite.tsx(5,6): error TS1109: Expression expected. tests/cases/conformance/jsx/jsxInvalidEsprimaTestSuite.tsx(5,7): error TS1109: Expression expected. +tests/cases/conformance/jsx/jsxInvalidEsprimaTestSuite.tsx(6,1): error TS2695: Left side of comma operator is unused and has no side effects. tests/cases/conformance/jsx/jsxInvalidEsprimaTestSuite.tsx(6,6): error TS1005: '{' expected. tests/cases/conformance/jsx/jsxInvalidEsprimaTestSuite.tsx(6,6): error TS2304: Cannot find name 'd'. tests/cases/conformance/jsx/jsxInvalidEsprimaTestSuite.tsx(6,9): error TS1109: Expression expected. @@ -69,7 +70,7 @@ tests/cases/conformance/jsx/jsxInvalidEsprimaTestSuite.tsx(35,4): error TS1003: tests/cases/conformance/jsx/jsxInvalidEsprimaTestSuite.tsx(35,21): error TS1005: '; @@ -94,6 +95,8 @@ tests/cases/conformance/jsx/jsxInvalidEsprimaTestSuite.tsx(35,21): error TS1005: ~ !!! error TS1109: Expression expected. ; + ~~~~~~~~~~ +!!! error TS2695: Left side of comma operator is unused and has no side effects. ~ !!! error TS1005: '{' expected. ~ diff --git a/tests/baselines/reference/jsxPreserveWithJsInput.types b/tests/baselines/reference/jsxPreserveWithJsInput.types index 7f4ed6daa2b..4ae5c6aeed4 100644 --- a/tests/baselines/reference/jsxPreserveWithJsInput.types +++ b/tests/baselines/reference/jsxPreserveWithJsInput.types @@ -2,14 +2,14 @@ var elemA = 42; >elemA : number ->42 : number +>42 : 42 === tests/cases/compiler/b.jsx === var elemB = {"test"}; >elemB : any >{"test"} : any >b : any ->"test" : string +>"test" : "test" >b : any === tests/cases/compiler/c.js === @@ -17,19 +17,19 @@ var elemC = {42}; >elemC : any >{42} : any >c : any ->42 : number +>42 : 42 >c : any === tests/cases/compiler/d.ts === var elemD = 42; >elemD : number ->42 : number +>42 : 42 === tests/cases/compiler/e.tsx === var elemE = {true}; >elemE : any >{true} : any >e : any ->true : boolean +>true : true >e : any diff --git a/tests/baselines/reference/jsxReactTestSuite.types b/tests/baselines/reference/jsxReactTestSuite.types index 8bab7ce6e7d..712a7368a62 100644 --- a/tests/baselines/reference/jsxReactTestSuite.types +++ b/tests/baselines/reference/jsxReactTestSuite.types @@ -120,8 +120,8 @@ var x = "foo" + "bar" >"foo" + "bar" : string ->"foo" : string ->"bar" : string +>"foo" : "foo" +>"bar" : "bar" } attr2={ >attr2 : any @@ -130,12 +130,12 @@ var x = >"foo" + "bar" + "baz" + "bug" : string >"foo" + "bar" + "baz" : string >"foo" + "bar" : string ->"foo" : string ->"bar" : string +>"foo" : "foo" +>"bar" : "bar" "baz" + "bug" ->"baz" : string ->"bug" : string +>"baz" : "baz" +>"bug" : "bug" } attr3={ >attr3 : any @@ -144,12 +144,12 @@ var x = >"foo" + "bar" + "baz" + "bug" : string >"foo" + "bar" + "baz" : string >"foo" + "bar" : string ->"foo" : string ->"bar" : string +>"foo" : "foo" +>"bar" : "bar" "baz" + "bug" ->"baz" : string ->"bug" : string +>"baz" : "baz" +>"bug" : "bug" // Extra line here. } @@ -254,7 +254,7 @@ var x = >y : any ={2 } z />; ->2 : number +>2 : 2 >z : any Component : any >x : any >y : any ->2 : number +>2 : 2 ; > : any >Component : any >x : any >y : any ->2 : number +>2 : 2 >z : any ; > : any >Component : any >x : any ->1 : number +>1 : 1 >y : any @@ -313,7 +313,7 @@ var x = > : any >Component : any >x : any ->1 : number +>1 : 1 >y : any >z : any >z : any @@ -331,10 +331,10 @@ var x = >z : any >{ y: 2 } : { y: number; } >y : number ->2 : number +>2 : 2 >z : any >z : any ->3 : number +>3 : 3 >Component : any diff --git a/tests/baselines/reference/keywordField.types b/tests/baselines/reference/keywordField.types index 8bc977edd74..b5e90e627ed 100644 --- a/tests/baselines/reference/keywordField.types +++ b/tests/baselines/reference/keywordField.types @@ -4,17 +4,17 @@ var obj:any = {}; >{} : {} obj.if = 1; ->obj.if = 1 : number +>obj.if = 1 : 1 >obj.if : any >obj : any >if : any ->1 : number +>1 : 1 var a = { if: "test" } >a : { if: string; } >{ if: "test" } : { if: string; } >if : string ->"test" : string +>"test" : "test" var n = a.if >n : string @@ -26,5 +26,5 @@ var q = a["if"]; >q : string >a["if"] : string >a : { if: string; } ->"if" : string +>"if" : "if" diff --git a/tests/baselines/reference/lambdaASIEmit.types b/tests/baselines/reference/lambdaASIEmit.types index 8ea881c4cd5..381e45c5fd2 100644 --- a/tests/baselines/reference/lambdaASIEmit.types +++ b/tests/baselines/reference/lambdaASIEmit.types @@ -13,5 +13,5 @@ Foo(() => // do something 127); ->127 : number +>127 : 127 diff --git a/tests/baselines/reference/lambdaExpression.types b/tests/baselines/reference/lambdaExpression.types index 714cd851d63..fc60097b6b0 100644 --- a/tests/baselines/reference/lambdaExpression.types +++ b/tests/baselines/reference/lambdaExpression.types @@ -1,18 +1,18 @@ === tests/cases/compiler/lambdaExpression.ts === () => 0; // Needs to be wrapped in parens to be a valid expression (not declaration) >() => 0 : () => number ->0 : number +>0 : 0 var y = 0; >y : number ->0 : number +>0 : 0 (()=>0); >(()=>0) : () => number >()=>0 : () => number ->0 : number +>0 : 0 var x = 0; >x : number ->0 : number +>0 : 0 diff --git a/tests/baselines/reference/letConstInCaseClauses.errors.txt b/tests/baselines/reference/letConstInCaseClauses.errors.txt index af0777d56a4..754da95d367 100644 --- a/tests/baselines/reference/letConstInCaseClauses.errors.txt +++ b/tests/baselines/reference/letConstInCaseClauses.errors.txt @@ -1,8 +1,10 @@ tests/cases/compiler/letConstInCaseClauses.ts(7,5): error TS2304: Cannot find name 'console'. tests/cases/compiler/letConstInCaseClauses.ts(21,5): error TS2304: Cannot find name 'console'. +tests/cases/compiler/letConstInCaseClauses.ts(23,14): error TS2678: Type '10' is not comparable to type '1'. +tests/cases/compiler/letConstInCaseClauses.ts(27,14): error TS2678: Type '10' is not comparable to type '2'. -==== tests/cases/compiler/letConstInCaseClauses.ts (2 errors) ==== +==== tests/cases/compiler/letConstInCaseClauses.ts (4 errors) ==== var x = 10; var y = 20; @@ -30,10 +32,14 @@ tests/cases/compiler/letConstInCaseClauses.ts(21,5): error TS2304: Cannot find n !!! error TS2304: Cannot find name 'console'. switch (x) { case 10: + ~~ +!!! error TS2678: Type '10' is not comparable to type '1'. const x = 20; } switch (y) { case 10: + ~~ +!!! error TS2678: Type '10' is not comparable to type '2'. const y = 20; } } \ No newline at end of file diff --git a/tests/baselines/reference/letConstMatchingParameterNames.types b/tests/baselines/reference/letConstMatchingParameterNames.types index 2e29dff289b..acf508f77a3 100644 --- a/tests/baselines/reference/letConstMatchingParameterNames.types +++ b/tests/baselines/reference/letConstMatchingParameterNames.types @@ -1,11 +1,11 @@ === tests/cases/compiler/letConstMatchingParameterNames.ts === let parent = true; >parent : boolean ->true : boolean +>true : true const parent2 = true; ->parent2 : boolean ->true : boolean +>parent2 : true +>true : true declare function use(a: any); >use : (a: any) => any @@ -16,11 +16,11 @@ function a() { let parent = 1; >parent : number ->1 : number +>1 : 1 const parent2 = 2; ->parent2 : number ->2 : number +>parent2 : 2 +>2 : 2 function b(parent: string, parent2: number) { >b : (parent: string, parent2: number) => void diff --git a/tests/baselines/reference/letDeclarations-access.types b/tests/baselines/reference/letDeclarations-access.types index 673fc97f80b..b2f984a4956 100644 --- a/tests/baselines/reference/letDeclarations-access.types +++ b/tests/baselines/reference/letDeclarations-access.types @@ -2,69 +2,69 @@ let x = 0 >x : number ->0 : number +>0 : 0 // No errors x = 1; ->x = 1 : number +>x = 1 : 1 >x : number ->1 : number +>1 : 1 x += 2; >x += 2 : number >x : number ->2 : number +>2 : 2 x -= 3; >x -= 3 : number >x : number ->3 : number +>3 : 3 x *= 4; >x *= 4 : number >x : number ->4 : number +>4 : 4 x /= 5; >x /= 5 : number >x : number ->5 : number +>5 : 5 x %= 6; >x %= 6 : number >x : number ->6 : number +>6 : 6 x <<= 7; >x <<= 7 : number >x : number ->7 : number +>7 : 7 x >>= 8; >x >>= 8 : number >x : number ->8 : number +>8 : 8 x >>>= 9; >x >>>= 9 : number >x : number ->9 : number +>9 : 9 x &= 10; >x &= 10 : number >x : number ->10 : number +>10 : 10 x |= 11; >x |= 11 : number >x : number ->11 : number +>11 : 11 x ^= 12; >x ^= 12 : number >x : number ->12 : number +>12 : 12 x++; >x++ : number @@ -86,7 +86,7 @@ var a = x + 1; >a : number >x + 1 : number >x : number ->1 : number +>1 : 1 function f(v: number) { } >f : (v: number) => void diff --git a/tests/baselines/reference/letDeclarations-es5-1.types b/tests/baselines/reference/letDeclarations-es5-1.types index b088677cd0a..31506b717a9 100644 --- a/tests/baselines/reference/letDeclarations-es5-1.types +++ b/tests/baselines/reference/letDeclarations-es5-1.types @@ -13,17 +13,17 @@ let l7 = false; >l7 : boolean ->false : boolean +>false : false let l8: number = 23; >l8 : number ->23 : number +>23 : 23 let l9 = 0, l10 :string = "", l11 = null; >l9 : number ->0 : number +>0 : 0 >l10 : string ->"" : string +>"" : "" >l11 : any >null : null diff --git a/tests/baselines/reference/letDeclarations-es5.types b/tests/baselines/reference/letDeclarations-es5.types index f6e8d418632..9756951e705 100644 --- a/tests/baselines/reference/letDeclarations-es5.types +++ b/tests/baselines/reference/letDeclarations-es5.types @@ -14,17 +14,17 @@ let l3, l4, l5 :string, l6; let l7 = false; >l7 : boolean ->false : boolean +>false : false let l8: number = 23; >l8 : number ->23 : number +>23 : 23 let l9 = 0, l10 :string = "", l11 = null; >l9 : number ->0 : number +>0 : 0 >l10 : string ->"" : string +>"" : "" >l11 : any >null : null @@ -34,10 +34,10 @@ for(let l11 in {}) { } for(let l12 = 0; l12 < 9; l12++) { } >l12 : number ->0 : number +>0 : 0 >l12 < 9 : boolean >l12 : number ->9 : number +>9 : 9 >l12++ : number >l12 : number diff --git a/tests/baselines/reference/letDeclarations.types b/tests/baselines/reference/letDeclarations.types index bb20f895a14..b1548f788ef 100644 --- a/tests/baselines/reference/letDeclarations.types +++ b/tests/baselines/reference/letDeclarations.types @@ -14,17 +14,17 @@ let l3, l4, l5 :string, l6; let l7 = false; >l7 : boolean ->false : boolean +>false : false let l8: number = 23; >l8 : number ->23 : number +>23 : 23 let l9 = 0, l10 :string = "", l11 = null; >l9 : number ->0 : number +>0 : 0 >l10 : string ->"" : string +>"" : "" >l11 : any >null : null @@ -34,10 +34,10 @@ for(let l11 in {}) { } for(let l12 = 0; l12 < 9; l12++) { } >l12 : number ->0 : number +>0 : 0 >l12 < 9 : boolean >l12 : number ->9 : number +>9 : 9 >l12++ : number >l12 : number diff --git a/tests/baselines/reference/letDeclarations2.types b/tests/baselines/reference/letDeclarations2.types index eeb66838a6a..893514adb3f 100644 --- a/tests/baselines/reference/letDeclarations2.types +++ b/tests/baselines/reference/letDeclarations2.types @@ -5,9 +5,9 @@ module M { let l1 = "s"; >l1 : string ->"s" : string +>"s" : "s" export let l2 = 0; >l2 : number ->0 : number +>0 : 0 } diff --git a/tests/baselines/reference/letIdentifierInElementAccess01.types b/tests/baselines/reference/letIdentifierInElementAccess01.types index 187fd7e221c..d169daa0307 100644 --- a/tests/baselines/reference/letIdentifierInElementAccess01.types +++ b/tests/baselines/reference/letIdentifierInElementAccess01.types @@ -4,10 +4,10 @@ var let: any = {}; >{} : {} (let[0] = 100); ->(let[0] = 100) : number ->let[0] = 100 : number +>(let[0] = 100) : 100 +>let[0] = 100 : 100 >let[0] : any >let : any ->0 : number ->100 : number +>0 : 0 +>100 : 100 diff --git a/tests/baselines/reference/letInNonStrictMode.types b/tests/baselines/reference/letInNonStrictMode.types index ceb59dba6a3..d37f7fe20a3 100644 --- a/tests/baselines/reference/letInNonStrictMode.types +++ b/tests/baselines/reference/letInNonStrictMode.types @@ -2,12 +2,12 @@ let [x] = [1]; >x : number >[1] : [number] ->1 : number +>1 : 1 let {a: y} = {a: 1}; >a : any >y : number >{a: 1} : { a: number; } >a : number ->1 : number +>1 : 1 diff --git a/tests/baselines/reference/letInVarDeclOfForIn_ES5.types b/tests/baselines/reference/letInVarDeclOfForIn_ES5.types index 095ae16b91e..d3751f58959 100644 --- a/tests/baselines/reference/letInVarDeclOfForIn_ES5.types +++ b/tests/baselines/reference/letInVarDeclOfForIn_ES5.types @@ -4,16 +4,16 @@ for (var let in [1,2,3]) {} >let : string >[1,2,3] : number[] ->1 : number ->2 : number ->3 : number +>1 : 1 +>2 : 2 +>3 : 3 { for (var let in [1,2,3]) {} >let : string >[1,2,3] : number[] ->1 : number ->2 : number ->3 : number +>1 : 1 +>2 : 2 +>3 : 3 } diff --git a/tests/baselines/reference/letInVarDeclOfForIn_ES6.types b/tests/baselines/reference/letInVarDeclOfForIn_ES6.types index a5e2ce108db..1d672c12ea6 100644 --- a/tests/baselines/reference/letInVarDeclOfForIn_ES6.types +++ b/tests/baselines/reference/letInVarDeclOfForIn_ES6.types @@ -4,16 +4,16 @@ for (var let in [1,2,3]) {} >let : string >[1,2,3] : number[] ->1 : number ->2 : number ->3 : number +>1 : 1 +>2 : 2 +>3 : 3 { for (var let in [1,2,3]) {} >let : string >[1,2,3] : number[] ->1 : number ->2 : number ->3 : number +>1 : 1 +>2 : 2 +>3 : 3 } diff --git a/tests/baselines/reference/letInVarDeclOfForOf_ES5.types b/tests/baselines/reference/letInVarDeclOfForOf_ES5.types index a1000df8bed..6b1648dcaf3 100644 --- a/tests/baselines/reference/letInVarDeclOfForOf_ES5.types +++ b/tests/baselines/reference/letInVarDeclOfForOf_ES5.types @@ -4,16 +4,16 @@ for (var let of [1,2,3]) {} >let : number >[1,2,3] : number[] ->1 : number ->2 : number ->3 : number +>1 : 1 +>2 : 2 +>3 : 3 { for (var let of [1,2,3]) {} >let : number >[1,2,3] : number[] ->1 : number ->2 : number ->3 : number +>1 : 1 +>2 : 2 +>3 : 3 } diff --git a/tests/baselines/reference/letInVarDeclOfForOf_ES6.types b/tests/baselines/reference/letInVarDeclOfForOf_ES6.types index 1515895feda..3231dbc0b2c 100644 --- a/tests/baselines/reference/letInVarDeclOfForOf_ES6.types +++ b/tests/baselines/reference/letInVarDeclOfForOf_ES6.types @@ -4,16 +4,16 @@ for (var let of [1,2,3]) {} >let : number >[1,2,3] : number[] ->1 : number ->2 : number ->3 : number +>1 : 1 +>2 : 2 +>3 : 3 { for (var let of [1,2,3]) {} >let : number >[1,2,3] : number[] ->1 : number ->2 : number ->3 : number +>1 : 1 +>2 : 2 +>3 : 3 } diff --git a/tests/baselines/reference/library_ArraySlice.types b/tests/baselines/reference/library_ArraySlice.types index b92d9254390..5fe3858628a 100644 --- a/tests/baselines/reference/library_ArraySlice.types +++ b/tests/baselines/reference/library_ArraySlice.types @@ -15,7 +15,7 @@ Array.prototype.slice(0); >Array : ArrayConstructor >prototype : any[] >slice : (start?: number, end?: number) => any[] ->0 : number +>0 : 0 Array.prototype.slice(0, 1); >Array.prototype.slice(0, 1) : any[] @@ -24,6 +24,6 @@ Array.prototype.slice(0, 1); >Array : ArrayConstructor >prototype : any[] >slice : (start?: number, end?: number) => any[] ->0 : number ->1 : number +>0 : 0 +>1 : 1 diff --git a/tests/baselines/reference/library_DatePrototypeProperties.symbols b/tests/baselines/reference/library_DatePrototypeProperties.symbols index 4601adcde18..1b725fbf84c 100644 --- a/tests/baselines/reference/library_DatePrototypeProperties.symbols +++ b/tests/baselines/reference/library_DatePrototypeProperties.symbols @@ -30,25 +30,25 @@ Date.prototype.toTimeString(); >toTimeString : Symbol(Date.toTimeString, Decl(lib.d.ts, --, --)) Date.prototype.toLocaleString(); ->Date.prototype.toLocaleString : Symbol(Date.toLocaleString, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>Date.prototype.toLocaleString : Symbol(Date.toLocaleString, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) >Date.prototype : Symbol(DateConstructor.prototype, Decl(lib.d.ts, --, --)) >Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) >prototype : Symbol(DateConstructor.prototype, Decl(lib.d.ts, --, --)) ->toLocaleString : Symbol(Date.toLocaleString, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>toLocaleString : Symbol(Date.toLocaleString, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) Date.prototype.toLocaleDateString(); ->Date.prototype.toLocaleDateString : Symbol(Date.toLocaleDateString, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>Date.prototype.toLocaleDateString : Symbol(Date.toLocaleDateString, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) >Date.prototype : Symbol(DateConstructor.prototype, Decl(lib.d.ts, --, --)) >Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) >prototype : Symbol(DateConstructor.prototype, Decl(lib.d.ts, --, --)) ->toLocaleDateString : Symbol(Date.toLocaleDateString, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>toLocaleDateString : Symbol(Date.toLocaleDateString, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) Date.prototype.toLocaleTimeString(); ->Date.prototype.toLocaleTimeString : Symbol(Date.toLocaleTimeString, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>Date.prototype.toLocaleTimeString : Symbol(Date.toLocaleTimeString, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) >Date.prototype : Symbol(DateConstructor.prototype, Decl(lib.d.ts, --, --)) >Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) >prototype : Symbol(DateConstructor.prototype, Decl(lib.d.ts, --, --)) ->toLocaleTimeString : Symbol(Date.toLocaleTimeString, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>toLocaleTimeString : Symbol(Date.toLocaleTimeString, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) Date.prototype.valueOf(); >Date.prototype.valueOf : Symbol(Date.valueOf, Decl(lib.d.ts, --, --)) diff --git a/tests/baselines/reference/library_DatePrototypeProperties.types b/tests/baselines/reference/library_DatePrototypeProperties.types index c048b9833d6..a32482e6c9d 100644 --- a/tests/baselines/reference/library_DatePrototypeProperties.types +++ b/tests/baselines/reference/library_DatePrototypeProperties.types @@ -34,27 +34,27 @@ Date.prototype.toTimeString(); Date.prototype.toLocaleString(); >Date.prototype.toLocaleString() : string ->Date.prototype.toLocaleString : { (): string; (locales?: string[], options?: Intl.DateTimeFormatOptions): string; (locale?: string, options?: Intl.DateTimeFormatOptions): string; } +>Date.prototype.toLocaleString : { (): string; (locales?: string | string[], options?: Intl.DateTimeFormatOptions): string; } >Date.prototype : Date >Date : DateConstructor >prototype : Date ->toLocaleString : { (): string; (locales?: string[], options?: Intl.DateTimeFormatOptions): string; (locale?: string, options?: Intl.DateTimeFormatOptions): string; } +>toLocaleString : { (): string; (locales?: string | string[], options?: Intl.DateTimeFormatOptions): string; } Date.prototype.toLocaleDateString(); >Date.prototype.toLocaleDateString() : string ->Date.prototype.toLocaleDateString : { (): string; (locales?: string[], options?: Intl.DateTimeFormatOptions): string; (locale?: string, options?: Intl.DateTimeFormatOptions): string; } +>Date.prototype.toLocaleDateString : { (): string; (locales?: string | string[], options?: Intl.DateTimeFormatOptions): string; } >Date.prototype : Date >Date : DateConstructor >prototype : Date ->toLocaleDateString : { (): string; (locales?: string[], options?: Intl.DateTimeFormatOptions): string; (locale?: string, options?: Intl.DateTimeFormatOptions): string; } +>toLocaleDateString : { (): string; (locales?: string | string[], options?: Intl.DateTimeFormatOptions): string; } Date.prototype.toLocaleTimeString(); >Date.prototype.toLocaleTimeString() : string ->Date.prototype.toLocaleTimeString : { (): string; (locale?: string[], options?: Intl.DateTimeFormatOptions): string; (locale?: string, options?: Intl.DateTimeFormatOptions): string; } +>Date.prototype.toLocaleTimeString : { (): string; (locales?: string | string[], options?: Intl.DateTimeFormatOptions): string; } >Date.prototype : Date >Date : DateConstructor >prototype : Date ->toLocaleTimeString : { (): string; (locale?: string[], options?: Intl.DateTimeFormatOptions): string; (locale?: string, options?: Intl.DateTimeFormatOptions): string; } +>toLocaleTimeString : { (): string; (locales?: string | string[], options?: Intl.DateTimeFormatOptions): string; } Date.prototype.valueOf(); >Date.prototype.valueOf() : number @@ -215,7 +215,7 @@ Date.prototype.setTime(0); >Date : DateConstructor >prototype : Date >setTime : (time: number) => number ->0 : number +>0 : 0 Date.prototype.setMilliseconds(0); >Date.prototype.setMilliseconds(0) : number @@ -224,7 +224,7 @@ Date.prototype.setMilliseconds(0); >Date : DateConstructor >prototype : Date >setMilliseconds : (ms: number) => number ->0 : number +>0 : 0 Date.prototype.setUTCMilliseconds(0); >Date.prototype.setUTCMilliseconds(0) : number @@ -233,7 +233,7 @@ Date.prototype.setUTCMilliseconds(0); >Date : DateConstructor >prototype : Date >setUTCMilliseconds : (ms: number) => number ->0 : number +>0 : 0 Date.prototype.setSeconds(0); >Date.prototype.setSeconds(0) : number @@ -242,7 +242,7 @@ Date.prototype.setSeconds(0); >Date : DateConstructor >prototype : Date >setSeconds : (sec: number, ms?: number) => number ->0 : number +>0 : 0 Date.prototype.setUTCSeconds(0); >Date.prototype.setUTCSeconds(0) : number @@ -251,7 +251,7 @@ Date.prototype.setUTCSeconds(0); >Date : DateConstructor >prototype : Date >setUTCSeconds : (sec: number, ms?: number) => number ->0 : number +>0 : 0 Date.prototype.setMinutes(0); >Date.prototype.setMinutes(0) : number @@ -260,7 +260,7 @@ Date.prototype.setMinutes(0); >Date : DateConstructor >prototype : Date >setMinutes : (min: number, sec?: number, ms?: number) => number ->0 : number +>0 : 0 Date.prototype.setUTCMinutes(0); >Date.prototype.setUTCMinutes(0) : number @@ -269,7 +269,7 @@ Date.prototype.setUTCMinutes(0); >Date : DateConstructor >prototype : Date >setUTCMinutes : (min: number, sec?: number, ms?: number) => number ->0 : number +>0 : 0 Date.prototype.setHours(0); >Date.prototype.setHours(0) : number @@ -278,7 +278,7 @@ Date.prototype.setHours(0); >Date : DateConstructor >prototype : Date >setHours : (hours: number, min?: number, sec?: number, ms?: number) => number ->0 : number +>0 : 0 Date.prototype.setUTCHours(0); >Date.prototype.setUTCHours(0) : number @@ -287,7 +287,7 @@ Date.prototype.setUTCHours(0); >Date : DateConstructor >prototype : Date >setUTCHours : (hours: number, min?: number, sec?: number, ms?: number) => number ->0 : number +>0 : 0 Date.prototype.setDate(0); >Date.prototype.setDate(0) : number @@ -296,7 +296,7 @@ Date.prototype.setDate(0); >Date : DateConstructor >prototype : Date >setDate : (date: number) => number ->0 : number +>0 : 0 Date.prototype.setUTCDate(0); >Date.prototype.setUTCDate(0) : number @@ -305,7 +305,7 @@ Date.prototype.setUTCDate(0); >Date : DateConstructor >prototype : Date >setUTCDate : (date: number) => number ->0 : number +>0 : 0 Date.prototype.setMonth(0); >Date.prototype.setMonth(0) : number @@ -314,7 +314,7 @@ Date.prototype.setMonth(0); >Date : DateConstructor >prototype : Date >setMonth : (month: number, date?: number) => number ->0 : number +>0 : 0 Date.prototype.setUTCMonth(0); >Date.prototype.setUTCMonth(0) : number @@ -323,7 +323,7 @@ Date.prototype.setUTCMonth(0); >Date : DateConstructor >prototype : Date >setUTCMonth : (month: number, date?: number) => number ->0 : number +>0 : 0 Date.prototype.setFullYear(0); >Date.prototype.setFullYear(0) : number @@ -332,7 +332,7 @@ Date.prototype.setFullYear(0); >Date : DateConstructor >prototype : Date >setFullYear : (year: number, month?: number, date?: number) => number ->0 : number +>0 : 0 Date.prototype.setUTCFullYear(0); >Date.prototype.setUTCFullYear(0) : number @@ -341,7 +341,7 @@ Date.prototype.setUTCFullYear(0); >Date : DateConstructor >prototype : Date >setUTCFullYear : (year: number, month?: number, date?: number) => number ->0 : number +>0 : 0 Date.prototype.toUTCString(); >Date.prototype.toUTCString() : string diff --git a/tests/baselines/reference/library_ObjectPrototypeProperties.types b/tests/baselines/reference/library_ObjectPrototypeProperties.types index 616a9da633b..2f41dd7c1eb 100644 --- a/tests/baselines/reference/library_ObjectPrototypeProperties.types +++ b/tests/baselines/reference/library_ObjectPrototypeProperties.types @@ -39,7 +39,7 @@ Object.prototype.hasOwnProperty("string"); >Object : ObjectConstructor >prototype : Object >hasOwnProperty : (v: string) => boolean ->"string" : string +>"string" : "string" Object.prototype.isPrototypeOf(Object); >Object.prototype.isPrototypeOf(Object) : boolean @@ -57,5 +57,5 @@ Object.prototype.propertyIsEnumerable("string"); >Object : ObjectConstructor >prototype : Object >propertyIsEnumerable : (v: string) => boolean ->"string" : string +>"string" : "string" diff --git a/tests/baselines/reference/library_RegExpExecArraySlice.types b/tests/baselines/reference/library_RegExpExecArraySlice.types index b4673adb988..0fd2a319833 100644 --- a/tests/baselines/reference/library_RegExpExecArraySlice.types +++ b/tests/baselines/reference/library_RegExpExecArraySlice.types @@ -15,13 +15,13 @@ regExpExecArrayValue.slice(0); >regExpExecArrayValue.slice : (start?: number, end?: number) => string[] >regExpExecArrayValue : RegExpExecArray >slice : (start?: number, end?: number) => string[] ->0 : number +>0 : 0 regExpExecArrayValue.slice(0,1); >regExpExecArrayValue.slice(0,1) : string[] >regExpExecArrayValue.slice : (start?: number, end?: number) => string[] >regExpExecArrayValue : RegExpExecArray >slice : (start?: number, end?: number) => string[] ->0 : number ->1 : number +>0 : 0 +>1 : 1 diff --git a/tests/baselines/reference/library_StringSlice.types b/tests/baselines/reference/library_StringSlice.types index 09b2a0b3995..a4f8e2e98e9 100644 --- a/tests/baselines/reference/library_StringSlice.types +++ b/tests/baselines/reference/library_StringSlice.types @@ -15,7 +15,7 @@ String.prototype.slice(0); >String : StringConstructor >prototype : String >slice : (start?: number, end?: number) => string ->0 : number +>0 : 0 String.prototype.slice(0,1); >String.prototype.slice(0,1) : string @@ -24,6 +24,6 @@ String.prototype.slice(0,1); >String : StringConstructor >prototype : String >slice : (start?: number, end?: number) => string ->0 : number ->1 : number +>0 : 0 +>1 : 1 diff --git a/tests/baselines/reference/literalTypes2.js b/tests/baselines/reference/literalTypes2.js new file mode 100644 index 00000000000..415129b2d9b --- /dev/null +++ b/tests/baselines/reference/literalTypes2.js @@ -0,0 +1,348 @@ +//// [literalTypes2.ts] +enum E { + A, B, C +} + +let cond: boolean; + +function f1(p1 = 1, p2 = "abc", p3 = true, p4 = E.A) { + var v1 = 1; + var v2 = -123; + var v3 = 3 + 4; + var v4 = "abc"; + var v5 = ""; + var v6 = "abc" + "def"; + var v7 = true; + var v8 = E.A; + let x1 = 1; + let x2 = -123; + let x3 = 3 + 4; + let x4 = "abc"; + let x5 = ""; + let x6 = "abc" + "def"; + let x7 = true; + var x8 = E.A; + const c1 = 1; + const c2 = -123; + const c3 = 3 + 4; + const c4 = "abc"; + const c5 = ""; + const c6 = "abc" + "def"; + const c7 = true; + const c8 = E.A; +} + +function f2(p1: 1 = 1, p2: "abc" = "abc", p3: true = true, p4: E.A = E.A) { + var v1: 1 = 1; + var v2: -123 = -123; + var v3: "abc" = "abc"; + var v4: true = true; + var v5: E.A = E.A; + let x1: 1 = 1; + let x2: -123 = -123; + let x3: "abc" = "abc"; + let x4: true = true; + let x5: E.A = E.A; +} + +function f3() { + const c1 = cond ? 1 : 2; + const c2 = cond ? 1 : "two"; + const c3 = cond ? E.A : cond ? true : 123; + const c4 = cond ? "abc" : null; + const c5 = cond ? 456 : undefined; + const c6: { kind: 123 } = { kind: 123 }; + const c7: [1 | 2, "foo" | "bar"] = [1, "bar"]; + const c8 = cond ? c6 : cond ? c7 : "hello"; + let x1 = c1; + let x2 = c2; + let x3 = c3; + let x4 = c4; + let x5 = c5; + let x6 = c6; + let x7 = c7; + let x8 = c8; +} + +class C1 { + x1 = 1; + x2 = -123; + x3 = 3 + 4; + x4 = "abc"; + x5 = ""; + x6 = "abc" + "def"; + x7 = true; + x8 = E.A; + readonly c1 = 1; + readonly c2 = -123; + readonly c3 = 3 + 4; + readonly c4 = "abc"; + readonly c5 = ""; + readonly c6 = "abc" + "def"; + readonly c7 = true; + readonly c8 = E.A; +} + +function f4() { + const c1 = { a: 1, b: "foo" }; + const c2: { a : 0 | 1, b: "foo" | "bar" } = { a: 1, b: "foo" }; + let x1 = { a: 1, b: "foo" }; + let x2: { a : 0 | 1, b: "foo" | "bar" } = { a: 1, b: "foo" }; +} + +function f5() { + const c1 = [1, "foo"]; + const c2: (1 | "foo")[] = [1, "foo"]; + const c3: [1, "foo"] = [1, "foo"]; + let x1 = [1, "foo"]; + let x2: (1 | "foo")[] = [1, "foo"]; + let x3: [1, "foo"] = [1, "foo"]; +} + +function f6() { + const { c1 = true, c2 = 0, c3 = "foo" } = { c1: false, c2: 1, c3: "bar" }; + let { x1 = true, x2 = 0, x3 = "foo" } = { x1: false, x2: 1, x3: "bar" }; +} + +function f10() { + return "hello"; +} + +function f11() { + return cond ? 1 : "two"; +} + +function f12() { + if (cond) { + return 1; + } + else { + return "two"; + } +} + +class C2 { + foo() { + return 0; + } + bar() { + return cond ? 0 : 1; + } +} + +function f20() { + const f1 = () => 0; + const f2 = () => "hello"; + const f3 = () => true; + const f4 = () => E.C; + const f5 = (): "foo" => "foo"; + const f6: () => "foo" | "bar" = () => "bar"; + const f7: (() => "foo") | (() => "bar") = () => "bar"; +} + +declare function g1(x: T): T; +declare function g2(x: T, y: T): T; +declare function g3(x: T, y: U): T | U; +declare function g4(x: T): T[]; +declare function g5(x: T, y: T): T[]; +declare function g6(x: T[]): T; +declare function g7(x: T[]): T[]; +declare function g8(x: T, f: (p: T) => T): T; + +const a: (1 | 2)[] = [1, 2]; + +const x1 = g1(1); // Type 1 +const x2 = g2(1, 1); // Type 1 +const x3 = g2(1, 2); // Type 1 | 2 +const x4 = g3(1, "two"); // Type 1 | "two" +const x5 = g4(1); // Type number[] +const x6 = g5(1, 2); // Type (1 | 2)[] +const x7 = g6([1, 2]); // Type number +const x8 = g6(a); // Type 1 | 2 +const x9 = g7(a); // Type (1 | 2)[] +const x10 = g8(1, x => x); // Type number +const x11 = g8(1, x => x + 1); // Type number + +function makeArray(x: T): T[] { + return [x]; +} + +function append(a: T[], x: T): T[] { + let result = a.slice(); + result.push(x); + return result; +} + +type Bit = 0 | 1; + +let aa = makeArray(0); +aa = append(aa, 1); + + +//// [literalTypes2.js] +var E; +(function (E) { + E[E["A"] = 0] = "A"; + E[E["B"] = 1] = "B"; + E[E["C"] = 2] = "C"; +})(E || (E = {})); +var cond; +function f1(p1, p2, p3, p4) { + if (p1 === void 0) { p1 = 1; } + if (p2 === void 0) { p2 = "abc"; } + if (p3 === void 0) { p3 = true; } + if (p4 === void 0) { p4 = E.A; } + var v1 = 1; + var v2 = -123; + var v3 = 3 + 4; + var v4 = "abc"; + var v5 = ""; + var v6 = "abc" + "def"; + var v7 = true; + var v8 = E.A; + var x1 = 1; + var x2 = -123; + var x3 = 3 + 4; + var x4 = "abc"; + var x5 = ""; + var x6 = "abc" + "def"; + var x7 = true; + var x8 = E.A; + var c1 = 1; + var c2 = -123; + var c3 = 3 + 4; + var c4 = "abc"; + var c5 = ""; + var c6 = "abc" + "def"; + var c7 = true; + var c8 = E.A; +} +function f2(p1, p2, p3, p4) { + if (p1 === void 0) { p1 = 1; } + if (p2 === void 0) { p2 = "abc"; } + if (p3 === void 0) { p3 = true; } + if (p4 === void 0) { p4 = E.A; } + var v1 = 1; + var v2 = -123; + var v3 = "abc"; + var v4 = true; + var v5 = E.A; + var x1 = 1; + var x2 = -123; + var x3 = "abc"; + var x4 = true; + var x5 = E.A; +} +function f3() { + var c1 = cond ? 1 : 2; + var c2 = cond ? 1 : "two"; + var c3 = cond ? E.A : cond ? true : 123; + var c4 = cond ? "abc" : null; + var c5 = cond ? 456 : undefined; + var c6 = { kind: 123 }; + var c7 = [1, "bar"]; + var c8 = cond ? c6 : cond ? c7 : "hello"; + var x1 = c1; + var x2 = c2; + var x3 = c3; + var x4 = c4; + var x5 = c5; + var x6 = c6; + var x7 = c7; + var x8 = c8; +} +var C1 = (function () { + function C1() { + this.x1 = 1; + this.x2 = -123; + this.x3 = 3 + 4; + this.x4 = "abc"; + this.x5 = ""; + this.x6 = "abc" + "def"; + this.x7 = true; + this.x8 = E.A; + this.c1 = 1; + this.c2 = -123; + this.c3 = 3 + 4; + this.c4 = "abc"; + this.c5 = ""; + this.c6 = "abc" + "def"; + this.c7 = true; + this.c8 = E.A; + } + return C1; +}()); +function f4() { + var c1 = { a: 1, b: "foo" }; + var c2 = { a: 1, b: "foo" }; + var x1 = { a: 1, b: "foo" }; + var x2 = { a: 1, b: "foo" }; +} +function f5() { + var c1 = [1, "foo"]; + var c2 = [1, "foo"]; + var c3 = [1, "foo"]; + var x1 = [1, "foo"]; + var x2 = [1, "foo"]; + var x3 = [1, "foo"]; +} +function f6() { + var _a = { c1: false, c2: 1, c3: "bar" }, _b = _a.c1, c1 = _b === void 0 ? true : _b, _c = _a.c2, c2 = _c === void 0 ? 0 : _c, _d = _a.c3, c3 = _d === void 0 ? "foo" : _d; + var _e = { x1: false, x2: 1, x3: "bar" }, _f = _e.x1, x1 = _f === void 0 ? true : _f, _g = _e.x2, x2 = _g === void 0 ? 0 : _g, _h = _e.x3, x3 = _h === void 0 ? "foo" : _h; +} +function f10() { + return "hello"; +} +function f11() { + return cond ? 1 : "two"; +} +function f12() { + if (cond) { + return 1; + } + else { + return "two"; + } +} +var C2 = (function () { + function C2() { + } + C2.prototype.foo = function () { + return 0; + }; + C2.prototype.bar = function () { + return cond ? 0 : 1; + }; + return C2; +}()); +function f20() { + var f1 = function () { return 0; }; + var f2 = function () { return "hello"; }; + var f3 = function () { return true; }; + var f4 = function () { return E.C; }; + var f5 = function () { return "foo"; }; + var f6 = function () { return "bar"; }; + var f7 = function () { return "bar"; }; +} +var a = [1, 2]; +var x1 = g1(1); // Type 1 +var x2 = g2(1, 1); // Type 1 +var x3 = g2(1, 2); // Type 1 | 2 +var x4 = g3(1, "two"); // Type 1 | "two" +var x5 = g4(1); // Type number[] +var x6 = g5(1, 2); // Type (1 | 2)[] +var x7 = g6([1, 2]); // Type number +var x8 = g6(a); // Type 1 | 2 +var x9 = g7(a); // Type (1 | 2)[] +var x10 = g8(1, function (x) { return x; }); // Type number +var x11 = g8(1, function (x) { return x + 1; }); // Type number +function makeArray(x) { + return [x]; +} +function append(a, x) { + var result = a.slice(); + result.push(x); + return result; +} +var aa = makeArray(0); +aa = append(aa, 1); diff --git a/tests/baselines/reference/literalTypes2.symbols b/tests/baselines/reference/literalTypes2.symbols new file mode 100644 index 00000000000..a59a91eeb1a --- /dev/null +++ b/tests/baselines/reference/literalTypes2.symbols @@ -0,0 +1,602 @@ +=== tests/cases/conformance/types/literal/literalTypes2.ts === +enum E { +>E : Symbol(E, Decl(literalTypes2.ts, 0, 0)) + + A, B, C +>A : Symbol(E.A, Decl(literalTypes2.ts, 0, 8)) +>B : Symbol(E.B, Decl(literalTypes2.ts, 1, 6)) +>C : Symbol(E.C, Decl(literalTypes2.ts, 1, 9)) +} + +let cond: boolean; +>cond : Symbol(cond, Decl(literalTypes2.ts, 4, 3)) + +function f1(p1 = 1, p2 = "abc", p3 = true, p4 = E.A) { +>f1 : Symbol(f1, Decl(literalTypes2.ts, 4, 18)) +>p1 : Symbol(p1, Decl(literalTypes2.ts, 6, 12)) +>p2 : Symbol(p2, Decl(literalTypes2.ts, 6, 19)) +>p3 : Symbol(p3, Decl(literalTypes2.ts, 6, 31)) +>p4 : Symbol(p4, Decl(literalTypes2.ts, 6, 42)) +>E.A : Symbol(E.A, Decl(literalTypes2.ts, 0, 8)) +>E : Symbol(E, Decl(literalTypes2.ts, 0, 0)) +>A : Symbol(E.A, Decl(literalTypes2.ts, 0, 8)) + + var v1 = 1; +>v1 : Symbol(v1, Decl(literalTypes2.ts, 7, 7)) + + var v2 = -123; +>v2 : Symbol(v2, Decl(literalTypes2.ts, 8, 7)) + + var v3 = 3 + 4; +>v3 : Symbol(v3, Decl(literalTypes2.ts, 9, 7)) + + var v4 = "abc"; +>v4 : Symbol(v4, Decl(literalTypes2.ts, 10, 7)) + + var v5 = ""; +>v5 : Symbol(v5, Decl(literalTypes2.ts, 11, 7)) + + var v6 = "abc" + "def"; +>v6 : Symbol(v6, Decl(literalTypes2.ts, 12, 7)) + + var v7 = true; +>v7 : Symbol(v7, Decl(literalTypes2.ts, 13, 7)) + + var v8 = E.A; +>v8 : Symbol(v8, Decl(literalTypes2.ts, 14, 7)) +>E.A : Symbol(E.A, Decl(literalTypes2.ts, 0, 8)) +>E : Symbol(E, Decl(literalTypes2.ts, 0, 0)) +>A : Symbol(E.A, Decl(literalTypes2.ts, 0, 8)) + + let x1 = 1; +>x1 : Symbol(x1, Decl(literalTypes2.ts, 15, 7)) + + let x2 = -123; +>x2 : Symbol(x2, Decl(literalTypes2.ts, 16, 7)) + + let x3 = 3 + 4; +>x3 : Symbol(x3, Decl(literalTypes2.ts, 17, 7)) + + let x4 = "abc"; +>x4 : Symbol(x4, Decl(literalTypes2.ts, 18, 7)) + + let x5 = ""; +>x5 : Symbol(x5, Decl(literalTypes2.ts, 19, 7)) + + let x6 = "abc" + "def"; +>x6 : Symbol(x6, Decl(literalTypes2.ts, 20, 7)) + + let x7 = true; +>x7 : Symbol(x7, Decl(literalTypes2.ts, 21, 7)) + + var x8 = E.A; +>x8 : Symbol(x8, Decl(literalTypes2.ts, 22, 7)) +>E.A : Symbol(E.A, Decl(literalTypes2.ts, 0, 8)) +>E : Symbol(E, Decl(literalTypes2.ts, 0, 0)) +>A : Symbol(E.A, Decl(literalTypes2.ts, 0, 8)) + + const c1 = 1; +>c1 : Symbol(c1, Decl(literalTypes2.ts, 23, 9)) + + const c2 = -123; +>c2 : Symbol(c2, Decl(literalTypes2.ts, 24, 9)) + + const c3 = 3 + 4; +>c3 : Symbol(c3, Decl(literalTypes2.ts, 25, 9)) + + const c4 = "abc"; +>c4 : Symbol(c4, Decl(literalTypes2.ts, 26, 9)) + + const c5 = ""; +>c5 : Symbol(c5, Decl(literalTypes2.ts, 27, 9)) + + const c6 = "abc" + "def"; +>c6 : Symbol(c6, Decl(literalTypes2.ts, 28, 9)) + + const c7 = true; +>c7 : Symbol(c7, Decl(literalTypes2.ts, 29, 9)) + + const c8 = E.A; +>c8 : Symbol(c8, Decl(literalTypes2.ts, 30, 9)) +>E.A : Symbol(E.A, Decl(literalTypes2.ts, 0, 8)) +>E : Symbol(E, Decl(literalTypes2.ts, 0, 0)) +>A : Symbol(E.A, Decl(literalTypes2.ts, 0, 8)) +} + +function f2(p1: 1 = 1, p2: "abc" = "abc", p3: true = true, p4: E.A = E.A) { +>f2 : Symbol(f2, Decl(literalTypes2.ts, 31, 1)) +>p1 : Symbol(p1, Decl(literalTypes2.ts, 33, 12)) +>p2 : Symbol(p2, Decl(literalTypes2.ts, 33, 22)) +>p3 : Symbol(p3, Decl(literalTypes2.ts, 33, 41)) +>p4 : Symbol(p4, Decl(literalTypes2.ts, 33, 58)) +>E : Symbol(E, Decl(literalTypes2.ts, 0, 0)) +>A : Symbol(E.A, Decl(literalTypes2.ts, 0, 8)) +>E.A : Symbol(E.A, Decl(literalTypes2.ts, 0, 8)) +>E : Symbol(E, Decl(literalTypes2.ts, 0, 0)) +>A : Symbol(E.A, Decl(literalTypes2.ts, 0, 8)) + + var v1: 1 = 1; +>v1 : Symbol(v1, Decl(literalTypes2.ts, 34, 7)) + + var v2: -123 = -123; +>v2 : Symbol(v2, Decl(literalTypes2.ts, 35, 7)) + + var v3: "abc" = "abc"; +>v3 : Symbol(v3, Decl(literalTypes2.ts, 36, 7)) + + var v4: true = true; +>v4 : Symbol(v4, Decl(literalTypes2.ts, 37, 7)) + + var v5: E.A = E.A; +>v5 : Symbol(v5, Decl(literalTypes2.ts, 38, 7)) +>E : Symbol(E, Decl(literalTypes2.ts, 0, 0)) +>A : Symbol(E.A, Decl(literalTypes2.ts, 0, 8)) +>E.A : Symbol(E.A, Decl(literalTypes2.ts, 0, 8)) +>E : Symbol(E, Decl(literalTypes2.ts, 0, 0)) +>A : Symbol(E.A, Decl(literalTypes2.ts, 0, 8)) + + let x1: 1 = 1; +>x1 : Symbol(x1, Decl(literalTypes2.ts, 39, 7)) + + let x2: -123 = -123; +>x2 : Symbol(x2, Decl(literalTypes2.ts, 40, 7)) + + let x3: "abc" = "abc"; +>x3 : Symbol(x3, Decl(literalTypes2.ts, 41, 7)) + + let x4: true = true; +>x4 : Symbol(x4, Decl(literalTypes2.ts, 42, 7)) + + let x5: E.A = E.A; +>x5 : Symbol(x5, Decl(literalTypes2.ts, 43, 7)) +>E : Symbol(E, Decl(literalTypes2.ts, 0, 0)) +>A : Symbol(E.A, Decl(literalTypes2.ts, 0, 8)) +>E.A : Symbol(E.A, Decl(literalTypes2.ts, 0, 8)) +>E : Symbol(E, Decl(literalTypes2.ts, 0, 0)) +>A : Symbol(E.A, Decl(literalTypes2.ts, 0, 8)) +} + +function f3() { +>f3 : Symbol(f3, Decl(literalTypes2.ts, 44, 1)) + + const c1 = cond ? 1 : 2; +>c1 : Symbol(c1, Decl(literalTypes2.ts, 47, 9)) +>cond : Symbol(cond, Decl(literalTypes2.ts, 4, 3)) + + const c2 = cond ? 1 : "two"; +>c2 : Symbol(c2, Decl(literalTypes2.ts, 48, 9)) +>cond : Symbol(cond, Decl(literalTypes2.ts, 4, 3)) + + const c3 = cond ? E.A : cond ? true : 123; +>c3 : Symbol(c3, Decl(literalTypes2.ts, 49, 9)) +>cond : Symbol(cond, Decl(literalTypes2.ts, 4, 3)) +>E.A : Symbol(E.A, Decl(literalTypes2.ts, 0, 8)) +>E : Symbol(E, Decl(literalTypes2.ts, 0, 0)) +>A : Symbol(E.A, Decl(literalTypes2.ts, 0, 8)) +>cond : Symbol(cond, Decl(literalTypes2.ts, 4, 3)) + + const c4 = cond ? "abc" : null; +>c4 : Symbol(c4, Decl(literalTypes2.ts, 50, 9)) +>cond : Symbol(cond, Decl(literalTypes2.ts, 4, 3)) + + const c5 = cond ? 456 : undefined; +>c5 : Symbol(c5, Decl(literalTypes2.ts, 51, 9)) +>cond : Symbol(cond, Decl(literalTypes2.ts, 4, 3)) +>undefined : Symbol(undefined) + + const c6: { kind: 123 } = { kind: 123 }; +>c6 : Symbol(c6, Decl(literalTypes2.ts, 52, 9)) +>kind : Symbol(kind, Decl(literalTypes2.ts, 52, 15)) +>kind : Symbol(kind, Decl(literalTypes2.ts, 52, 31)) + + const c7: [1 | 2, "foo" | "bar"] = [1, "bar"]; +>c7 : Symbol(c7, Decl(literalTypes2.ts, 53, 9)) + + const c8 = cond ? c6 : cond ? c7 : "hello"; +>c8 : Symbol(c8, Decl(literalTypes2.ts, 54, 9)) +>cond : Symbol(cond, Decl(literalTypes2.ts, 4, 3)) +>c6 : Symbol(c6, Decl(literalTypes2.ts, 52, 9)) +>cond : Symbol(cond, Decl(literalTypes2.ts, 4, 3)) +>c7 : Symbol(c7, Decl(literalTypes2.ts, 53, 9)) + + let x1 = c1; +>x1 : Symbol(x1, Decl(literalTypes2.ts, 55, 7)) +>c1 : Symbol(c1, Decl(literalTypes2.ts, 47, 9)) + + let x2 = c2; +>x2 : Symbol(x2, Decl(literalTypes2.ts, 56, 7)) +>c2 : Symbol(c2, Decl(literalTypes2.ts, 48, 9)) + + let x3 = c3; +>x3 : Symbol(x3, Decl(literalTypes2.ts, 57, 7)) +>c3 : Symbol(c3, Decl(literalTypes2.ts, 49, 9)) + + let x4 = c4; +>x4 : Symbol(x4, Decl(literalTypes2.ts, 58, 7)) +>c4 : Symbol(c4, Decl(literalTypes2.ts, 50, 9)) + + let x5 = c5; +>x5 : Symbol(x5, Decl(literalTypes2.ts, 59, 7)) +>c5 : Symbol(c5, Decl(literalTypes2.ts, 51, 9)) + + let x6 = c6; +>x6 : Symbol(x6, Decl(literalTypes2.ts, 60, 7)) +>c6 : Symbol(c6, Decl(literalTypes2.ts, 52, 9)) + + let x7 = c7; +>x7 : Symbol(x7, Decl(literalTypes2.ts, 61, 7)) +>c7 : Symbol(c7, Decl(literalTypes2.ts, 53, 9)) + + let x8 = c8; +>x8 : Symbol(x8, Decl(literalTypes2.ts, 62, 7)) +>c8 : Symbol(c8, Decl(literalTypes2.ts, 54, 9)) +} + +class C1 { +>C1 : Symbol(C1, Decl(literalTypes2.ts, 63, 1)) + + x1 = 1; +>x1 : Symbol(C1.x1, Decl(literalTypes2.ts, 65, 10)) + + x2 = -123; +>x2 : Symbol(C1.x2, Decl(literalTypes2.ts, 66, 11)) + + x3 = 3 + 4; +>x3 : Symbol(C1.x3, Decl(literalTypes2.ts, 67, 14)) + + x4 = "abc"; +>x4 : Symbol(C1.x4, Decl(literalTypes2.ts, 68, 15)) + + x5 = ""; +>x5 : Symbol(C1.x5, Decl(literalTypes2.ts, 69, 15)) + + x6 = "abc" + "def"; +>x6 : Symbol(C1.x6, Decl(literalTypes2.ts, 70, 12)) + + x7 = true; +>x7 : Symbol(C1.x7, Decl(literalTypes2.ts, 71, 23)) + + x8 = E.A; +>x8 : Symbol(C1.x8, Decl(literalTypes2.ts, 72, 14)) +>E.A : Symbol(E.A, Decl(literalTypes2.ts, 0, 8)) +>E : Symbol(E, Decl(literalTypes2.ts, 0, 0)) +>A : Symbol(E.A, Decl(literalTypes2.ts, 0, 8)) + + readonly c1 = 1; +>c1 : Symbol(C1.c1, Decl(literalTypes2.ts, 73, 13)) + + readonly c2 = -123; +>c2 : Symbol(C1.c2, Decl(literalTypes2.ts, 74, 20)) + + readonly c3 = 3 + 4; +>c3 : Symbol(C1.c3, Decl(literalTypes2.ts, 75, 23)) + + readonly c4 = "abc"; +>c4 : Symbol(C1.c4, Decl(literalTypes2.ts, 76, 24)) + + readonly c5 = ""; +>c5 : Symbol(C1.c5, Decl(literalTypes2.ts, 77, 24)) + + readonly c6 = "abc" + "def"; +>c6 : Symbol(C1.c6, Decl(literalTypes2.ts, 78, 21)) + + readonly c7 = true; +>c7 : Symbol(C1.c7, Decl(literalTypes2.ts, 79, 32)) + + readonly c8 = E.A; +>c8 : Symbol(C1.c8, Decl(literalTypes2.ts, 80, 23)) +>E.A : Symbol(E.A, Decl(literalTypes2.ts, 0, 8)) +>E : Symbol(E, Decl(literalTypes2.ts, 0, 0)) +>A : Symbol(E.A, Decl(literalTypes2.ts, 0, 8)) +} + +function f4() { +>f4 : Symbol(f4, Decl(literalTypes2.ts, 82, 1)) + + const c1 = { a: 1, b: "foo" }; +>c1 : Symbol(c1, Decl(literalTypes2.ts, 85, 9)) +>a : Symbol(a, Decl(literalTypes2.ts, 85, 16)) +>b : Symbol(b, Decl(literalTypes2.ts, 85, 22)) + + const c2: { a : 0 | 1, b: "foo" | "bar" } = { a: 1, b: "foo" }; +>c2 : Symbol(c2, Decl(literalTypes2.ts, 86, 9)) +>a : Symbol(a, Decl(literalTypes2.ts, 86, 15)) +>b : Symbol(b, Decl(literalTypes2.ts, 86, 26)) +>a : Symbol(a, Decl(literalTypes2.ts, 86, 49)) +>b : Symbol(b, Decl(literalTypes2.ts, 86, 55)) + + let x1 = { a: 1, b: "foo" }; +>x1 : Symbol(x1, Decl(literalTypes2.ts, 87, 7)) +>a : Symbol(a, Decl(literalTypes2.ts, 87, 14)) +>b : Symbol(b, Decl(literalTypes2.ts, 87, 20)) + + let x2: { a : 0 | 1, b: "foo" | "bar" } = { a: 1, b: "foo" }; +>x2 : Symbol(x2, Decl(literalTypes2.ts, 88, 7)) +>a : Symbol(a, Decl(literalTypes2.ts, 88, 13)) +>b : Symbol(b, Decl(literalTypes2.ts, 88, 24)) +>a : Symbol(a, Decl(literalTypes2.ts, 88, 47)) +>b : Symbol(b, Decl(literalTypes2.ts, 88, 53)) +} + +function f5() { +>f5 : Symbol(f5, Decl(literalTypes2.ts, 89, 1)) + + const c1 = [1, "foo"]; +>c1 : Symbol(c1, Decl(literalTypes2.ts, 92, 9)) + + const c2: (1 | "foo")[] = [1, "foo"]; +>c2 : Symbol(c2, Decl(literalTypes2.ts, 93, 9)) + + const c3: [1, "foo"] = [1, "foo"]; +>c3 : Symbol(c3, Decl(literalTypes2.ts, 94, 9)) + + let x1 = [1, "foo"]; +>x1 : Symbol(x1, Decl(literalTypes2.ts, 95, 7)) + + let x2: (1 | "foo")[] = [1, "foo"]; +>x2 : Symbol(x2, Decl(literalTypes2.ts, 96, 7)) + + let x3: [1, "foo"] = [1, "foo"]; +>x3 : Symbol(x3, Decl(literalTypes2.ts, 97, 7)) +} + +function f6() { +>f6 : Symbol(f6, Decl(literalTypes2.ts, 98, 1)) + + const { c1 = true, c2 = 0, c3 = "foo" } = { c1: false, c2: 1, c3: "bar" }; +>c1 : Symbol(c1, Decl(literalTypes2.ts, 101, 11)) +>c2 : Symbol(c2, Decl(literalTypes2.ts, 101, 22)) +>c3 : Symbol(c3, Decl(literalTypes2.ts, 101, 30)) +>c1 : Symbol(c1, Decl(literalTypes2.ts, 101, 47)) +>c2 : Symbol(c2, Decl(literalTypes2.ts, 101, 58)) +>c3 : Symbol(c3, Decl(literalTypes2.ts, 101, 65)) + + let { x1 = true, x2 = 0, x3 = "foo" } = { x1: false, x2: 1, x3: "bar" }; +>x1 : Symbol(x1, Decl(literalTypes2.ts, 102, 9)) +>x2 : Symbol(x2, Decl(literalTypes2.ts, 102, 20)) +>x3 : Symbol(x3, Decl(literalTypes2.ts, 102, 28)) +>x1 : Symbol(x1, Decl(literalTypes2.ts, 102, 45)) +>x2 : Symbol(x2, Decl(literalTypes2.ts, 102, 56)) +>x3 : Symbol(x3, Decl(literalTypes2.ts, 102, 63)) +} + +function f10() { +>f10 : Symbol(f10, Decl(literalTypes2.ts, 103, 1)) + + return "hello"; +} + +function f11() { +>f11 : Symbol(f11, Decl(literalTypes2.ts, 107, 1)) + + return cond ? 1 : "two"; +>cond : Symbol(cond, Decl(literalTypes2.ts, 4, 3)) +} + +function f12() { +>f12 : Symbol(f12, Decl(literalTypes2.ts, 111, 1)) + + if (cond) { +>cond : Symbol(cond, Decl(literalTypes2.ts, 4, 3)) + + return 1; + } + else { + return "two"; + } +} + +class C2 { +>C2 : Symbol(C2, Decl(literalTypes2.ts, 120, 1)) + + foo() { +>foo : Symbol(C2.foo, Decl(literalTypes2.ts, 122, 10)) + + return 0; + } + bar() { +>bar : Symbol(C2.bar, Decl(literalTypes2.ts, 125, 5)) + + return cond ? 0 : 1; +>cond : Symbol(cond, Decl(literalTypes2.ts, 4, 3)) + } +} + +function f20() { +>f20 : Symbol(f20, Decl(literalTypes2.ts, 129, 1)) + + const f1 = () => 0; +>f1 : Symbol(f1, Decl(literalTypes2.ts, 132, 9)) + + const f2 = () => "hello"; +>f2 : Symbol(f2, Decl(literalTypes2.ts, 133, 9)) + + const f3 = () => true; +>f3 : Symbol(f3, Decl(literalTypes2.ts, 134, 9)) + + const f4 = () => E.C; +>f4 : Symbol(f4, Decl(literalTypes2.ts, 135, 9)) +>E.C : Symbol(E.C, Decl(literalTypes2.ts, 1, 9)) +>E : Symbol(E, Decl(literalTypes2.ts, 0, 0)) +>C : Symbol(E.C, Decl(literalTypes2.ts, 1, 9)) + + const f5 = (): "foo" => "foo"; +>f5 : Symbol(f5, Decl(literalTypes2.ts, 136, 9)) + + const f6: () => "foo" | "bar" = () => "bar"; +>f6 : Symbol(f6, Decl(literalTypes2.ts, 137, 9)) + + const f7: (() => "foo") | (() => "bar") = () => "bar"; +>f7 : Symbol(f7, Decl(literalTypes2.ts, 138, 9)) +} + +declare function g1(x: T): T; +>g1 : Symbol(g1, Decl(literalTypes2.ts, 139, 1)) +>T : Symbol(T, Decl(literalTypes2.ts, 141, 20)) +>x : Symbol(x, Decl(literalTypes2.ts, 141, 23)) +>T : Symbol(T, Decl(literalTypes2.ts, 141, 20)) +>T : Symbol(T, Decl(literalTypes2.ts, 141, 20)) + +declare function g2(x: T, y: T): T; +>g2 : Symbol(g2, Decl(literalTypes2.ts, 141, 32)) +>T : Symbol(T, Decl(literalTypes2.ts, 142, 20)) +>x : Symbol(x, Decl(literalTypes2.ts, 142, 23)) +>T : Symbol(T, Decl(literalTypes2.ts, 142, 20)) +>y : Symbol(y, Decl(literalTypes2.ts, 142, 28)) +>T : Symbol(T, Decl(literalTypes2.ts, 142, 20)) +>T : Symbol(T, Decl(literalTypes2.ts, 142, 20)) + +declare function g3(x: T, y: U): T | U; +>g3 : Symbol(g3, Decl(literalTypes2.ts, 142, 38)) +>T : Symbol(T, Decl(literalTypes2.ts, 143, 20)) +>U : Symbol(U, Decl(literalTypes2.ts, 143, 22)) +>x : Symbol(x, Decl(literalTypes2.ts, 143, 26)) +>T : Symbol(T, Decl(literalTypes2.ts, 143, 20)) +>y : Symbol(y, Decl(literalTypes2.ts, 143, 31)) +>U : Symbol(U, Decl(literalTypes2.ts, 143, 22)) +>T : Symbol(T, Decl(literalTypes2.ts, 143, 20)) +>U : Symbol(U, Decl(literalTypes2.ts, 143, 22)) + +declare function g4(x: T): T[]; +>g4 : Symbol(g4, Decl(literalTypes2.ts, 143, 45)) +>T : Symbol(T, Decl(literalTypes2.ts, 144, 20)) +>x : Symbol(x, Decl(literalTypes2.ts, 144, 23)) +>T : Symbol(T, Decl(literalTypes2.ts, 144, 20)) +>T : Symbol(T, Decl(literalTypes2.ts, 144, 20)) + +declare function g5(x: T, y: T): T[]; +>g5 : Symbol(g5, Decl(literalTypes2.ts, 144, 34)) +>T : Symbol(T, Decl(literalTypes2.ts, 145, 20)) +>x : Symbol(x, Decl(literalTypes2.ts, 145, 38)) +>T : Symbol(T, Decl(literalTypes2.ts, 145, 20)) +>y : Symbol(y, Decl(literalTypes2.ts, 145, 43)) +>T : Symbol(T, Decl(literalTypes2.ts, 145, 20)) +>T : Symbol(T, Decl(literalTypes2.ts, 145, 20)) + +declare function g6(x: T[]): T; +>g6 : Symbol(g6, Decl(literalTypes2.ts, 145, 55)) +>T : Symbol(T, Decl(literalTypes2.ts, 146, 20)) +>x : Symbol(x, Decl(literalTypes2.ts, 146, 23)) +>T : Symbol(T, Decl(literalTypes2.ts, 146, 20)) +>T : Symbol(T, Decl(literalTypes2.ts, 146, 20)) + +declare function g7(x: T[]): T[]; +>g7 : Symbol(g7, Decl(literalTypes2.ts, 146, 34)) +>T : Symbol(T, Decl(literalTypes2.ts, 147, 20)) +>x : Symbol(x, Decl(literalTypes2.ts, 147, 23)) +>T : Symbol(T, Decl(literalTypes2.ts, 147, 20)) +>T : Symbol(T, Decl(literalTypes2.ts, 147, 20)) + +declare function g8(x: T, f: (p: T) => T): T; +>g8 : Symbol(g8, Decl(literalTypes2.ts, 147, 36)) +>T : Symbol(T, Decl(literalTypes2.ts, 148, 20)) +>x : Symbol(x, Decl(literalTypes2.ts, 148, 23)) +>T : Symbol(T, Decl(literalTypes2.ts, 148, 20)) +>f : Symbol(f, Decl(literalTypes2.ts, 148, 28)) +>p : Symbol(p, Decl(literalTypes2.ts, 148, 33)) +>T : Symbol(T, Decl(literalTypes2.ts, 148, 20)) +>T : Symbol(T, Decl(literalTypes2.ts, 148, 20)) +>T : Symbol(T, Decl(literalTypes2.ts, 148, 20)) + +const a: (1 | 2)[] = [1, 2]; +>a : Symbol(a, Decl(literalTypes2.ts, 150, 5)) + +const x1 = g1(1); // Type 1 +>x1 : Symbol(x1, Decl(literalTypes2.ts, 152, 5)) +>g1 : Symbol(g1, Decl(literalTypes2.ts, 139, 1)) + +const x2 = g2(1, 1); // Type 1 +>x2 : Symbol(x2, Decl(literalTypes2.ts, 153, 5)) +>g2 : Symbol(g2, Decl(literalTypes2.ts, 141, 32)) + +const x3 = g2(1, 2); // Type 1 | 2 +>x3 : Symbol(x3, Decl(literalTypes2.ts, 154, 5)) +>g2 : Symbol(g2, Decl(literalTypes2.ts, 141, 32)) + +const x4 = g3(1, "two"); // Type 1 | "two" +>x4 : Symbol(x4, Decl(literalTypes2.ts, 155, 5)) +>g3 : Symbol(g3, Decl(literalTypes2.ts, 142, 38)) + +const x5 = g4(1); // Type number[] +>x5 : Symbol(x5, Decl(literalTypes2.ts, 156, 5)) +>g4 : Symbol(g4, Decl(literalTypes2.ts, 143, 45)) + +const x6 = g5(1, 2); // Type (1 | 2)[] +>x6 : Symbol(x6, Decl(literalTypes2.ts, 157, 5)) +>g5 : Symbol(g5, Decl(literalTypes2.ts, 144, 34)) + +const x7 = g6([1, 2]); // Type number +>x7 : Symbol(x7, Decl(literalTypes2.ts, 158, 5)) +>g6 : Symbol(g6, Decl(literalTypes2.ts, 145, 55)) + +const x8 = g6(a); // Type 1 | 2 +>x8 : Symbol(x8, Decl(literalTypes2.ts, 159, 5)) +>g6 : Symbol(g6, Decl(literalTypes2.ts, 145, 55)) +>a : Symbol(a, Decl(literalTypes2.ts, 150, 5)) + +const x9 = g7(a); // Type (1 | 2)[] +>x9 : Symbol(x9, Decl(literalTypes2.ts, 160, 5)) +>g7 : Symbol(g7, Decl(literalTypes2.ts, 146, 34)) +>a : Symbol(a, Decl(literalTypes2.ts, 150, 5)) + +const x10 = g8(1, x => x); // Type number +>x10 : Symbol(x10, Decl(literalTypes2.ts, 161, 5)) +>g8 : Symbol(g8, Decl(literalTypes2.ts, 147, 36)) +>x : Symbol(x, Decl(literalTypes2.ts, 161, 17)) +>x : Symbol(x, Decl(literalTypes2.ts, 161, 17)) + +const x11 = g8(1, x => x + 1); // Type number +>x11 : Symbol(x11, Decl(literalTypes2.ts, 162, 5)) +>g8 : Symbol(g8, Decl(literalTypes2.ts, 147, 36)) +>x : Symbol(x, Decl(literalTypes2.ts, 162, 17)) +>x : Symbol(x, Decl(literalTypes2.ts, 162, 17)) + +function makeArray(x: T): T[] { +>makeArray : Symbol(makeArray, Decl(literalTypes2.ts, 162, 30)) +>T : Symbol(T, Decl(literalTypes2.ts, 164, 19)) +>x : Symbol(x, Decl(literalTypes2.ts, 164, 22)) +>T : Symbol(T, Decl(literalTypes2.ts, 164, 19)) +>T : Symbol(T, Decl(literalTypes2.ts, 164, 19)) + + return [x]; +>x : Symbol(x, Decl(literalTypes2.ts, 164, 22)) +} + +function append(a: T[], x: T): T[] { +>append : Symbol(append, Decl(literalTypes2.ts, 166, 1)) +>T : Symbol(T, Decl(literalTypes2.ts, 168, 16)) +>a : Symbol(a, Decl(literalTypes2.ts, 168, 19)) +>T : Symbol(T, Decl(literalTypes2.ts, 168, 16)) +>x : Symbol(x, Decl(literalTypes2.ts, 168, 26)) +>T : Symbol(T, Decl(literalTypes2.ts, 168, 16)) +>T : Symbol(T, Decl(literalTypes2.ts, 168, 16)) + + let result = a.slice(); +>result : Symbol(result, Decl(literalTypes2.ts, 169, 7)) +>a.slice : Symbol(Array.slice, Decl(lib.d.ts, --, --)) +>a : Symbol(a, Decl(literalTypes2.ts, 168, 19)) +>slice : Symbol(Array.slice, Decl(lib.d.ts, --, --)) + + result.push(x); +>result.push : Symbol(Array.push, Decl(lib.d.ts, --, --)) +>result : Symbol(result, Decl(literalTypes2.ts, 169, 7)) +>push : Symbol(Array.push, Decl(lib.d.ts, --, --)) +>x : Symbol(x, Decl(literalTypes2.ts, 168, 26)) + + return result; +>result : Symbol(result, Decl(literalTypes2.ts, 169, 7)) +} + +type Bit = 0 | 1; +>Bit : Symbol(Bit, Decl(literalTypes2.ts, 172, 1)) + +let aa = makeArray(0); +>aa : Symbol(aa, Decl(literalTypes2.ts, 176, 3)) +>makeArray : Symbol(makeArray, Decl(literalTypes2.ts, 162, 30)) +>Bit : Symbol(Bit, Decl(literalTypes2.ts, 172, 1)) + +aa = append(aa, 1); +>aa : Symbol(aa, Decl(literalTypes2.ts, 176, 3)) +>append : Symbol(append, Decl(literalTypes2.ts, 166, 1)) +>aa : Symbol(aa, Decl(literalTypes2.ts, 176, 3)) + diff --git a/tests/baselines/reference/literalTypes2.types b/tests/baselines/reference/literalTypes2.types new file mode 100644 index 00000000000..ba12ada644b --- /dev/null +++ b/tests/baselines/reference/literalTypes2.types @@ -0,0 +1,816 @@ +=== tests/cases/conformance/types/literal/literalTypes2.ts === +enum E { +>E : E + + A, B, C +>A : E.A +>B : E.B +>C : E.C +} + +let cond: boolean; +>cond : boolean + +function f1(p1 = 1, p2 = "abc", p3 = true, p4 = E.A) { +>f1 : (p1?: number, p2?: string, p3?: boolean, p4?: E) => void +>p1 : number +>1 : 1 +>p2 : string +>"abc" : "abc" +>p3 : boolean +>true : true +>p4 : E +>E.A : E.A +>E : typeof E +>A : E.A + + var v1 = 1; +>v1 : number +>1 : 1 + + var v2 = -123; +>v2 : number +>-123 : -123 +>123 : 123 + + var v3 = 3 + 4; +>v3 : number +>3 + 4 : number +>3 : 3 +>4 : 4 + + var v4 = "abc"; +>v4 : string +>"abc" : "abc" + + var v5 = ""; +>v5 : string +>"" : "" + + var v6 = "abc" + "def"; +>v6 : string +>"abc" + "def" : string +>"abc" : "abc" +>"def" : "def" + + var v7 = true; +>v7 : boolean +>true : true + + var v8 = E.A; +>v8 : E +>E.A : E.A +>E : typeof E +>A : E.A + + let x1 = 1; +>x1 : number +>1 : 1 + + let x2 = -123; +>x2 : number +>-123 : -123 +>123 : 123 + + let x3 = 3 + 4; +>x3 : number +>3 + 4 : number +>3 : 3 +>4 : 4 + + let x4 = "abc"; +>x4 : string +>"abc" : "abc" + + let x5 = ""; +>x5 : string +>"" : "" + + let x6 = "abc" + "def"; +>x6 : string +>"abc" + "def" : string +>"abc" : "abc" +>"def" : "def" + + let x7 = true; +>x7 : boolean +>true : true + + var x8 = E.A; +>x8 : E +>E.A : E.A +>E : typeof E +>A : E.A + + const c1 = 1; +>c1 : 1 +>1 : 1 + + const c2 = -123; +>c2 : -123 +>-123 : -123 +>123 : 123 + + const c3 = 3 + 4; +>c3 : number +>3 + 4 : number +>3 : 3 +>4 : 4 + + const c4 = "abc"; +>c4 : "abc" +>"abc" : "abc" + + const c5 = ""; +>c5 : "" +>"" : "" + + const c6 = "abc" + "def"; +>c6 : string +>"abc" + "def" : string +>"abc" : "abc" +>"def" : "def" + + const c7 = true; +>c7 : true +>true : true + + const c8 = E.A; +>c8 : E.A +>E.A : E.A +>E : typeof E +>A : E.A +} + +function f2(p1: 1 = 1, p2: "abc" = "abc", p3: true = true, p4: E.A = E.A) { +>f2 : (p1?: 1, p2?: "abc", p3?: true, p4?: E.A) => void +>p1 : 1 +>1 : 1 +>p2 : "abc" +>"abc" : "abc" +>p3 : true +>true : true +>true : true +>p4 : E.A +>E : any +>A : E.A +>E.A : E.A +>E : typeof E +>A : E.A + + var v1: 1 = 1; +>v1 : 1 +>1 : 1 + + var v2: -123 = -123; +>v2 : -123 +>-123 : -123 +>123 : 123 +>-123 : -123 +>123 : 123 + + var v3: "abc" = "abc"; +>v3 : "abc" +>"abc" : "abc" + + var v4: true = true; +>v4 : true +>true : true +>true : true + + var v5: E.A = E.A; +>v5 : E.A +>E : any +>A : E.A +>E.A : E.A +>E : typeof E +>A : E.A + + let x1: 1 = 1; +>x1 : 1 +>1 : 1 + + let x2: -123 = -123; +>x2 : -123 +>-123 : -123 +>123 : 123 +>-123 : -123 +>123 : 123 + + let x3: "abc" = "abc"; +>x3 : "abc" +>"abc" : "abc" + + let x4: true = true; +>x4 : true +>true : true +>true : true + + let x5: E.A = E.A; +>x5 : E.A +>E : any +>A : E.A +>E.A : E.A +>E : typeof E +>A : E.A +} + +function f3() { +>f3 : () => void + + const c1 = cond ? 1 : 2; +>c1 : 1 | 2 +>cond ? 1 : 2 : 1 | 2 +>cond : boolean +>1 : 1 +>2 : 2 + + const c2 = cond ? 1 : "two"; +>c2 : 1 | "two" +>cond ? 1 : "two" : 1 | "two" +>cond : boolean +>1 : 1 +>"two" : "two" + + const c3 = cond ? E.A : cond ? true : 123; +>c3 : true | E.A | 123 +>cond ? E.A : cond ? true : 123 : true | E.A | 123 +>cond : boolean +>E.A : E.A +>E : typeof E +>A : E.A +>cond ? true : 123 : true | 123 +>cond : boolean +>true : true +>123 : 123 + + const c4 = cond ? "abc" : null; +>c4 : "abc" +>cond ? "abc" : null : "abc" +>cond : boolean +>"abc" : "abc" +>null : null + + const c5 = cond ? 456 : undefined; +>c5 : 456 +>cond ? 456 : undefined : 456 +>cond : boolean +>456 : 456 +>undefined : undefined + + const c6: { kind: 123 } = { kind: 123 }; +>c6 : { kind: 123; } +>kind : 123 +>{ kind: 123 } : { kind: 123; } +>kind : number +>123 : 123 + + const c7: [1 | 2, "foo" | "bar"] = [1, "bar"]; +>c7 : [1 | 2, "foo" | "bar"] +>[1, "bar"] : [1, "bar"] +>1 : 1 +>"bar" : "bar" + + const c8 = cond ? c6 : cond ? c7 : "hello"; +>c8 : { kind: 123; } | [1 | 2, "foo" | "bar"] | "hello" +>cond ? c6 : cond ? c7 : "hello" : { kind: 123; } | [1 | 2, "foo" | "bar"] | "hello" +>cond : boolean +>c6 : { kind: 123; } +>cond ? c7 : "hello" : [1 | 2, "foo" | "bar"] | "hello" +>cond : boolean +>c7 : [1 | 2, "foo" | "bar"] +>"hello" : "hello" + + let x1 = c1; +>x1 : number +>c1 : 1 | 2 + + let x2 = c2; +>x2 : string | number +>c2 : 1 | "two" + + let x3 = c3; +>x3 : number | boolean | E +>c3 : true | E.A | 123 + + let x4 = c4; +>x4 : string +>c4 : "abc" + + let x5 = c5; +>x5 : number +>c5 : 456 + + let x6 = c6; +>x6 : { kind: 123; } +>c6 : { kind: 123; } + + let x7 = c7; +>x7 : [1 | 2, "foo" | "bar"] +>c7 : [1 | 2, "foo" | "bar"] + + let x8 = c8; +>x8 : string | { kind: 123; } | [1 | 2, "foo" | "bar"] +>c8 : { kind: 123; } | [1 | 2, "foo" | "bar"] | "hello" +} + +class C1 { +>C1 : C1 + + x1 = 1; +>x1 : number +>1 : 1 + + x2 = -123; +>x2 : number +>-123 : -123 +>123 : 123 + + x3 = 3 + 4; +>x3 : number +>3 + 4 : number +>3 : 3 +>4 : 4 + + x4 = "abc"; +>x4 : string +>"abc" : "abc" + + x5 = ""; +>x5 : string +>"" : "" + + x6 = "abc" + "def"; +>x6 : string +>"abc" + "def" : string +>"abc" : "abc" +>"def" : "def" + + x7 = true; +>x7 : boolean +>true : true + + x8 = E.A; +>x8 : E +>E.A : E.A +>E : typeof E +>A : E.A + + readonly c1 = 1; +>c1 : 1 +>1 : 1 + + readonly c2 = -123; +>c2 : -123 +>-123 : -123 +>123 : 123 + + readonly c3 = 3 + 4; +>c3 : number +>3 + 4 : number +>3 : 3 +>4 : 4 + + readonly c4 = "abc"; +>c4 : "abc" +>"abc" : "abc" + + readonly c5 = ""; +>c5 : "" +>"" : "" + + readonly c6 = "abc" + "def"; +>c6 : string +>"abc" + "def" : string +>"abc" : "abc" +>"def" : "def" + + readonly c7 = true; +>c7 : true +>true : true + + readonly c8 = E.A; +>c8 : E.A +>E.A : E.A +>E : typeof E +>A : E.A +} + +function f4() { +>f4 : () => void + + const c1 = { a: 1, b: "foo" }; +>c1 : { a: number; b: string; } +>{ a: 1, b: "foo" } : { a: number; b: string; } +>a : number +>1 : 1 +>b : string +>"foo" : "foo" + + const c2: { a : 0 | 1, b: "foo" | "bar" } = { a: 1, b: "foo" }; +>c2 : { a: 0 | 1; b: "foo" | "bar"; } +>a : 0 | 1 +>b : "foo" | "bar" +>{ a: 1, b: "foo" } : { a: 1; b: "foo"; } +>a : number +>1 : 1 +>b : string +>"foo" : "foo" + + let x1 = { a: 1, b: "foo" }; +>x1 : { a: number; b: string; } +>{ a: 1, b: "foo" } : { a: number; b: string; } +>a : number +>1 : 1 +>b : string +>"foo" : "foo" + + let x2: { a : 0 | 1, b: "foo" | "bar" } = { a: 1, b: "foo" }; +>x2 : { a: 0 | 1; b: "foo" | "bar"; } +>a : 0 | 1 +>b : "foo" | "bar" +>{ a: 1, b: "foo" } : { a: 1; b: "foo"; } +>a : number +>1 : 1 +>b : string +>"foo" : "foo" +} + +function f5() { +>f5 : () => void + + const c1 = [1, "foo"]; +>c1 : (string | number)[] +>[1, "foo"] : (string | number)[] +>1 : 1 +>"foo" : "foo" + + const c2: (1 | "foo")[] = [1, "foo"]; +>c2 : (1 | "foo")[] +>[1, "foo"] : (1 | "foo")[] +>1 : 1 +>"foo" : "foo" + + const c3: [1, "foo"] = [1, "foo"]; +>c3 : [1, "foo"] +>[1, "foo"] : [1, "foo"] +>1 : 1 +>"foo" : "foo" + + let x1 = [1, "foo"]; +>x1 : (string | number)[] +>[1, "foo"] : (string | number)[] +>1 : 1 +>"foo" : "foo" + + let x2: (1 | "foo")[] = [1, "foo"]; +>x2 : (1 | "foo")[] +>[1, "foo"] : (1 | "foo")[] +>1 : 1 +>"foo" : "foo" + + let x3: [1, "foo"] = [1, "foo"]; +>x3 : [1, "foo"] +>[1, "foo"] : [1, "foo"] +>1 : 1 +>"foo" : "foo" +} + +function f6() { +>f6 : () => void + + const { c1 = true, c2 = 0, c3 = "foo" } = { c1: false, c2: 1, c3: "bar" }; +>c1 : boolean +>true : true +>c2 : 0 | 1 +>0 : 0 +>c3 : "foo" | "bar" +>"foo" : "foo" +>{ c1: false, c2: 1, c3: "bar" } : { c1?: false; c2?: 1; c3?: "bar"; } +>c1 : boolean +>false : false +>c2 : number +>1 : 1 +>c3 : string +>"bar" : "bar" + + let { x1 = true, x2 = 0, x3 = "foo" } = { x1: false, x2: 1, x3: "bar" }; +>x1 : boolean +>true : true +>x2 : number +>0 : 0 +>x3 : string +>"foo" : "foo" +>{ x1: false, x2: 1, x3: "bar" } : { x1?: false; x2?: number; x3?: string; } +>x1 : boolean +>false : false +>x2 : number +>1 : 1 +>x3 : string +>"bar" : "bar" +} + +function f10() { +>f10 : () => string + + return "hello"; +>"hello" : "hello" +} + +function f11() { +>f11 : () => 1 | "two" + + return cond ? 1 : "two"; +>cond ? 1 : "two" : 1 | "two" +>cond : boolean +>1 : 1 +>"two" : "two" +} + +function f12() { +>f12 : () => 1 | "two" + + if (cond) { +>cond : boolean + + return 1; +>1 : 1 + } + else { + return "two"; +>"two" : "two" + } +} + +class C2 { +>C2 : C2 + + foo() { +>foo : () => number + + return 0; +>0 : 0 + } + bar() { +>bar : () => 0 | 1 + + return cond ? 0 : 1; +>cond ? 0 : 1 : 0 | 1 +>cond : boolean +>0 : 0 +>1 : 1 + } +} + +function f20() { +>f20 : () => void + + const f1 = () => 0; +>f1 : () => number +>() => 0 : () => number +>0 : 0 + + const f2 = () => "hello"; +>f2 : () => string +>() => "hello" : () => string +>"hello" : "hello" + + const f3 = () => true; +>f3 : () => boolean +>() => true : () => boolean +>true : true + + const f4 = () => E.C; +>f4 : () => E +>() => E.C : () => E +>E.C : E.C +>E : typeof E +>C : E.C + + const f5 = (): "foo" => "foo"; +>f5 : () => "foo" +>(): "foo" => "foo" : () => "foo" +>"foo" : "foo" + + const f6: () => "foo" | "bar" = () => "bar"; +>f6 : () => "foo" | "bar" +>() => "bar" : () => "bar" +>"bar" : "bar" + + const f7: (() => "foo") | (() => "bar") = () => "bar"; +>f7 : (() => "foo") | (() => "bar") +>() => "bar" : () => "bar" +>"bar" : "bar" +} + +declare function g1(x: T): T; +>g1 : (x: T) => T +>T : T +>x : T +>T : T +>T : T + +declare function g2(x: T, y: T): T; +>g2 : (x: T, y: T) => T +>T : T +>x : T +>T : T +>y : T +>T : T +>T : T + +declare function g3(x: T, y: U): T | U; +>g3 : (x: T, y: U) => T | U +>T : T +>U : U +>x : T +>T : T +>y : U +>U : U +>T : T +>U : U + +declare function g4(x: T): T[]; +>g4 : (x: T) => T[] +>T : T +>x : T +>T : T +>T : T + +declare function g5(x: T, y: T): T[]; +>g5 : (x: T, y: T) => T[] +>T : T +>x : T +>T : T +>y : T +>T : T +>T : T + +declare function g6(x: T[]): T; +>g6 : (x: T[]) => T +>T : T +>x : T[] +>T : T +>T : T + +declare function g7(x: T[]): T[]; +>g7 : (x: T[]) => T[] +>T : T +>x : T[] +>T : T +>T : T + +declare function g8(x: T, f: (p: T) => T): T; +>g8 : (x: T, f: (p: T) => T) => T +>T : T +>x : T +>T : T +>f : (p: T) => T +>p : T +>T : T +>T : T +>T : T + +const a: (1 | 2)[] = [1, 2]; +>a : (1 | 2)[] +>[1, 2] : (1 | 2)[] +>1 : 1 +>2 : 2 + +const x1 = g1(1); // Type 1 +>x1 : 1 +>g1(1) : 1 +>g1 : (x: T) => T +>1 : 1 + +const x2 = g2(1, 1); // Type 1 +>x2 : 1 +>g2(1, 1) : 1 +>g2 : (x: T, y: T) => T +>1 : 1 +>1 : 1 + +const x3 = g2(1, 2); // Type 1 | 2 +>x3 : 1 | 2 +>g2(1, 2) : 1 | 2 +>g2 : (x: T, y: T) => T +>1 : 1 +>2 : 2 + +const x4 = g3(1, "two"); // Type 1 | "two" +>x4 : 1 | "two" +>g3(1, "two") : 1 | "two" +>g3 : (x: T, y: U) => T | U +>1 : 1 +>"two" : "two" + +const x5 = g4(1); // Type number[] +>x5 : number[] +>g4(1) : number[] +>g4 : (x: T) => T[] +>1 : 1 + +const x6 = g5(1, 2); // Type (1 | 2)[] +>x6 : (1 | 2)[] +>g5(1, 2) : (1 | 2)[] +>g5 : (x: T, y: T) => T[] +>1 : 1 +>2 : 2 + +const x7 = g6([1, 2]); // Type number +>x7 : number +>g6([1, 2]) : number +>g6 : (x: T[]) => T +>[1, 2] : number[] +>1 : 1 +>2 : 2 + +const x8 = g6(a); // Type 1 | 2 +>x8 : 1 | 2 +>g6(a) : 1 | 2 +>g6 : (x: T[]) => T +>a : (1 | 2)[] + +const x9 = g7(a); // Type (1 | 2)[] +>x9 : (1 | 2)[] +>g7(a) : (1 | 2)[] +>g7 : (x: T[]) => T[] +>a : (1 | 2)[] + +const x10 = g8(1, x => x); // Type number +>x10 : number +>g8(1, x => x) : number +>g8 : (x: T, f: (p: T) => T) => T +>1 : 1 +>x => x : (x: number) => number +>x : number +>x : number + +const x11 = g8(1, x => x + 1); // Type number +>x11 : number +>g8(1, x => x + 1) : number +>g8 : (x: T, f: (p: T) => T) => T +>1 : 1 +>x => x + 1 : (x: number) => number +>x : number +>x + 1 : number +>x : number +>1 : 1 + +function makeArray(x: T): T[] { +>makeArray : (x: T) => T[] +>T : T +>x : T +>T : T +>T : T + + return [x]; +>[x] : T[] +>x : T +} + +function append(a: T[], x: T): T[] { +>append : (a: T[], x: T) => T[] +>T : T +>a : T[] +>T : T +>x : T +>T : T +>T : T + + let result = a.slice(); +>result : T[] +>a.slice() : T[] +>a.slice : (start?: number, end?: number) => T[] +>a : T[] +>slice : (start?: number, end?: number) => T[] + + result.push(x); +>result.push(x) : number +>result.push : (...items: T[]) => number +>result : T[] +>push : (...items: T[]) => number +>x : T + + return result; +>result : T[] +} + +type Bit = 0 | 1; +>Bit : 0 | 1 + +let aa = makeArray(0); +>aa : (0 | 1)[] +>makeArray(0) : (0 | 1)[] +>makeArray : (x: T) => T[] +>Bit : 0 | 1 +>0 : 0 + +aa = append(aa, 1); +>aa = append(aa, 1) : (0 | 1)[] +>aa : (0 | 1)[] +>append(aa, 1) : (0 | 1)[] +>append : (a: T[], x: T) => T[] +>aa : (0 | 1)[] +>1 : 1 + diff --git a/tests/baselines/reference/literalTypesAndTypeAssertions.js b/tests/baselines/reference/literalTypesAndTypeAssertions.js new file mode 100644 index 00000000000..ab6a82852a5 --- /dev/null +++ b/tests/baselines/reference/literalTypesAndTypeAssertions.js @@ -0,0 +1,28 @@ +//// [literalTypesAndTypeAssertions.ts] +const obj = { + a: "foo" as "foo", + b: <"foo">"foo", + c: "foo" +}; + +let x1 = 1 as (0 | 1); +let x2 = 1; + +let { a = "foo" } = { a: "foo" }; +let { b = "foo" as "foo" } = { b: "bar" }; +let { c = "foo" } = { c: "bar" as "bar" }; +let { d = "foo" as "foo" } = { d: "bar" as "bar" }; + + +//// [literalTypesAndTypeAssertions.js] +var obj = { + a: "foo", + b: "foo", + c: "foo" +}; +var x1 = 1; +var x2 = 1; +var _a = { a: "foo" }.a, a = _a === void 0 ? "foo" : _a; +var _b = { b: "bar" }.b, b = _b === void 0 ? "foo" : _b; +var _c = { c: "bar" }.c, c = _c === void 0 ? "foo" : _c; +var _d = { d: "bar" }.d, d = _d === void 0 ? "foo" : _d; diff --git a/tests/baselines/reference/literalTypesAndTypeAssertions.symbols b/tests/baselines/reference/literalTypesAndTypeAssertions.symbols new file mode 100644 index 00000000000..6a8f879060b --- /dev/null +++ b/tests/baselines/reference/literalTypesAndTypeAssertions.symbols @@ -0,0 +1,37 @@ +=== tests/cases/conformance/types/literal/literalTypesAndTypeAssertions.ts === +const obj = { +>obj : Symbol(obj, Decl(literalTypesAndTypeAssertions.ts, 0, 5)) + + a: "foo" as "foo", +>a : Symbol(a, Decl(literalTypesAndTypeAssertions.ts, 0, 13)) + + b: <"foo">"foo", +>b : Symbol(b, Decl(literalTypesAndTypeAssertions.ts, 1, 22)) + + c: "foo" +>c : Symbol(c, Decl(literalTypesAndTypeAssertions.ts, 2, 20)) + +}; + +let x1 = 1 as (0 | 1); +>x1 : Symbol(x1, Decl(literalTypesAndTypeAssertions.ts, 6, 3)) + +let x2 = 1; +>x2 : Symbol(x2, Decl(literalTypesAndTypeAssertions.ts, 7, 3)) + +let { a = "foo" } = { a: "foo" }; +>a : Symbol(a, Decl(literalTypesAndTypeAssertions.ts, 9, 5)) +>a : Symbol(a, Decl(literalTypesAndTypeAssertions.ts, 9, 21)) + +let { b = "foo" as "foo" } = { b: "bar" }; +>b : Symbol(b, Decl(literalTypesAndTypeAssertions.ts, 10, 5)) +>b : Symbol(b, Decl(literalTypesAndTypeAssertions.ts, 10, 30)) + +let { c = "foo" } = { c: "bar" as "bar" }; +>c : Symbol(c, Decl(literalTypesAndTypeAssertions.ts, 11, 5)) +>c : Symbol(c, Decl(literalTypesAndTypeAssertions.ts, 11, 21)) + +let { d = "foo" as "foo" } = { d: "bar" as "bar" }; +>d : Symbol(d, Decl(literalTypesAndTypeAssertions.ts, 12, 5)) +>d : Symbol(d, Decl(literalTypesAndTypeAssertions.ts, 12, 30)) + diff --git a/tests/baselines/reference/literalTypesAndTypeAssertions.types b/tests/baselines/reference/literalTypesAndTypeAssertions.types new file mode 100644 index 00000000000..4c38f74fd72 --- /dev/null +++ b/tests/baselines/reference/literalTypesAndTypeAssertions.types @@ -0,0 +1,62 @@ +=== tests/cases/conformance/types/literal/literalTypesAndTypeAssertions.ts === +const obj = { +>obj : { a: "foo"; b: "foo"; c: string; } +>{ a: "foo" as "foo", b: <"foo">"foo", c: "foo"} : { a: "foo"; b: "foo"; c: string; } + + a: "foo" as "foo", +>a : "foo" +>"foo" as "foo" : "foo" +>"foo" : "foo" + + b: <"foo">"foo", +>b : "foo" +><"foo">"foo" : "foo" +>"foo" : "foo" + + c: "foo" +>c : string +>"foo" : "foo" + +}; + +let x1 = 1 as (0 | 1); +>x1 : 0 | 1 +>1 as (0 | 1) : 0 | 1 +>1 : 1 + +let x2 = 1; +>x2 : number +>1 : 1 + +let { a = "foo" } = { a: "foo" }; +>a : string +>"foo" : "foo" +>{ a: "foo" } : { a?: string; } +>a : string +>"foo" : "foo" + +let { b = "foo" as "foo" } = { b: "bar" }; +>b : "foo" | "bar" +>"foo" as "foo" : "foo" +>"foo" : "foo" +>{ b: "bar" } : { b?: "bar"; } +>b : string +>"bar" : "bar" + +let { c = "foo" } = { c: "bar" as "bar" }; +>c : "foo" | "bar" +>"foo" : "foo" +>{ c: "bar" as "bar" } : { c?: "bar"; } +>c : "bar" +>"bar" as "bar" : "bar" +>"bar" : "bar" + +let { d = "foo" as "foo" } = { d: "bar" as "bar" }; +>d : "foo" | "bar" +>"foo" as "foo" : "foo" +>"foo" : "foo" +>{ d: "bar" as "bar" } : { d?: "bar"; } +>d : "bar" +>"bar" as "bar" : "bar" +>"bar" : "bar" + diff --git a/tests/baselines/reference/literals1.types b/tests/baselines/reference/literals1.types index 69e50c22f4a..5b1a5c9cd68 100644 --- a/tests/baselines/reference/literals1.types +++ b/tests/baselines/reference/literals1.types @@ -1,47 +1,47 @@ === tests/cases/compiler/literals1.ts === var a = 42; >a : number ->42 : number +>42 : 42 var b = 0xFA34; >b : number ->0xFA34 : number +>0xFA34 : 64052 var c = 0.1715; >c : number ->0.1715 : number +>0.1715 : 0.1715 var d = 3.14E5; >d : number ->3.14E5 : number +>3.14E5 : 314000 var e = 8.14e-5; >e : number ->8.14e-5 : number +>8.14e-5 : 0.0000814 var f = true; >f : boolean ->true : boolean +>true : true var g = false; >g : boolean ->false : boolean +>false : false var h = ""; >h : string ->"" : string +>"" : "" var i = "hi"; >i : string ->"hi" : string +>"hi" : "hi" var j = ''; >j : string ->'' : string +>'' : "" var k = 'q\tq'; >k : string ->'q\tq' : string +>'q\tq' : "q\tq" var m = /q/; >m : RegExp diff --git a/tests/baselines/reference/localClassesInLoop.types b/tests/baselines/reference/localClassesInLoop.types index f1c06f93463..c88bfc0435d 100644 --- a/tests/baselines/reference/localClassesInLoop.types +++ b/tests/baselines/reference/localClassesInLoop.types @@ -4,7 +4,7 @@ declare function use(a: any); >a : any "use strict" ->"use strict" : string +>"use strict" : "use strict" var data = []; >data : any[] @@ -12,10 +12,10 @@ var data = []; for (let x = 0; x < 2; ++x) { >x : number ->0 : number +>0 : 0 >x < 2 : boolean >x : number ->2 : number +>2 : 2 >++x : number >x : number @@ -38,9 +38,9 @@ use(data[0]() === data[1]()); >data[0]() : any >data[0] : any >data : any[] ->0 : number +>0 : 0 >data[1]() : any >data[1] : any >data : any[] ->1 : number +>1 : 1 diff --git a/tests/baselines/reference/localClassesInLoop_ES6.types b/tests/baselines/reference/localClassesInLoop_ES6.types index 518e75f4afa..9d487f6c600 100644 --- a/tests/baselines/reference/localClassesInLoop_ES6.types +++ b/tests/baselines/reference/localClassesInLoop_ES6.types @@ -5,7 +5,7 @@ declare function use(a: any); >a : any "use strict" ->"use strict" : string +>"use strict" : "use strict" var data = []; >data : any[] @@ -13,10 +13,10 @@ var data = []; for (let x = 0; x < 2; ++x) { >x : number ->0 : number +>0 : 0 >x < 2 : boolean >x : number ->2 : number +>2 : 2 >++x : number >x : number @@ -39,9 +39,9 @@ use(data[0]() === data[1]()); >data[0]() : any >data[0] : any >data : any[] ->0 : number +>0 : 0 >data[1]() : any >data[1] : any >data : any[] ->1 : number +>1 : 1 diff --git a/tests/baselines/reference/localImportNameVsGlobalName.types b/tests/baselines/reference/localImportNameVsGlobalName.types index dd7f05fc8dd..d70cac65adf 100644 --- a/tests/baselines/reference/localImportNameVsGlobalName.types +++ b/tests/baselines/reference/localImportNameVsGlobalName.types @@ -4,10 +4,10 @@ module Keyboard { export enum Key { UP, DOWN, LEFT, RIGHT } >Key : Key ->UP : Key ->DOWN : Key ->LEFT : Key ->RIGHT : Key +>UP : Key.UP +>DOWN : Key.DOWN +>LEFT : Key.LEFT +>RIGHT : Key.RIGHT } module App { diff --git a/tests/baselines/reference/localTypes1.types b/tests/baselines/reference/localTypes1.types index 78e92fd8324..7ac6896b9f3 100644 --- a/tests/baselines/reference/localTypes1.types +++ b/tests/baselines/reference/localTypes1.types @@ -7,9 +7,9 @@ function f1() { >E : E A, B, C ->A : E ->B : E ->C : E +>A : E.A +>B : E.B +>C : E.C } class C { >C : C @@ -41,7 +41,7 @@ function f1() { >a[0].x : E >a[0] : I >a : I[] ->0 : number +>0 : 0 >x : E >E.B : E.B >E : typeof E @@ -61,9 +61,9 @@ function f2() { >E : E A, B, C ->A : E ->B : E ->C : E +>A : E.A +>B : E.B +>C : E.C } class C { >C : C @@ -95,7 +95,7 @@ function f2() { >a[0].x : E >a[0] : I >a : I[] ->0 : number +>0 : 0 >x : E >E.B : E.B >E : typeof E @@ -114,15 +114,15 @@ function f3(b: boolean) { >b : boolean if (true) { ->true : boolean +>true : true enum E { >E : E A, B, C ->A : E ->B : E ->C : E +>A : E.A +>B : E.B +>C : E.C } if (b) { >b : boolean @@ -157,7 +157,7 @@ function f3(b: boolean) { >a[0].x : E >a[0] : I >a : I[] ->0 : number +>0 : 0 >x : E >E.B : E.B >E : typeof E @@ -197,7 +197,7 @@ function f3(b: boolean) { >c[0].x : E >c[0] : J >c : J[] ->0 : number +>0 : 0 >x : E >E.B : E.B >E : typeof E @@ -220,9 +220,9 @@ function f5() { >E : E A, B, C ->A : E ->B : E ->C : E +>A : E.A +>B : E.B +>C : E.C } class C { >C : C @@ -243,9 +243,9 @@ function f5() { >E : E A, B, C ->A : E ->B : E ->C : E +>A : E.A +>B : E.B +>C : E.C } class C { >C : C @@ -268,9 +268,9 @@ class A { >E : E A, B, C ->A : E ->B : E ->C : E +>A : E.A +>B : E.B +>C : E.C } class C { >C : C @@ -287,9 +287,9 @@ class A { >E : E A, B, C ->A : E ->B : E ->C : E +>A : E.A +>B : E.B +>C : E.C } class C { >C : C @@ -309,9 +309,9 @@ class A { >E : E A, B, C ->A : E ->B : E ->C : E +>A : E.A +>B : E.B +>C : E.C } class C { >C : C @@ -361,25 +361,25 @@ function f6() { >C : typeof C x.a = "a"; ->x.a = "a" : string +>x.a = "a" : "a" >x.a : string >x : C >a : string ->"a" : string +>"a" : "a" x.b = "b"; ->x.b = "b" : string +>x.b = "b" : "b" >x.b : string >x : C >b : string ->"b" : string +>"b" : "b" x.c = "c"; ->x.c = "c" : string +>x.c = "c" : "c" >x.c : string >x : C >c : string ->"c" : string +>"c" : "c" return x; >x : C diff --git a/tests/baselines/reference/localTypes2.types b/tests/baselines/reference/localTypes2.types index a6b85b7bb14..e661b9fc0bf 100644 --- a/tests/baselines/reference/localTypes2.types +++ b/tests/baselines/reference/localTypes2.types @@ -24,8 +24,8 @@ function f1() { >v : C >new C(10, 20) : C >C : typeof C ->10 : number ->20 : number +>10 : 10 +>20 : 20 let x = v.x; >x : number @@ -64,13 +64,13 @@ function f2() { >C : typeof C >f(10) : typeof C >f : (x: number) => typeof C ->10 : number +>10 : 10 let v = new C(20); >v : C >new C(20) : C >C : typeof C ->20 : number +>20 : 20 let x = v.x; >x : number @@ -111,8 +111,8 @@ function f3() { >C : typeof C >f(10, 20) : typeof C >f : (x: number, y: number) => typeof C ->10 : number ->20 : number +>10 : 10 +>20 : 20 let v = new C(); >v : C diff --git a/tests/baselines/reference/localTypes3.types b/tests/baselines/reference/localTypes3.types index 551096468c5..3ce32fef9e6 100644 --- a/tests/baselines/reference/localTypes3.types +++ b/tests/baselines/reference/localTypes3.types @@ -28,8 +28,8 @@ function f1() { >v : C >new C(10, "hello") : C >C : typeof C ->10 : number ->"hello" : string +>10 : 10 +>"hello" : "hello" let x = v.x; >x : number @@ -72,13 +72,13 @@ function f2() { >C : typeof C >f(10) : typeof C >f : (x: X) => typeof C ->10 : number +>10 : 10 let v = new C("hello"); >v : f.C >new C("hello") : f.C >C : typeof C ->"hello" : string +>"hello" : "hello" let x = v.x; >x : number @@ -123,8 +123,8 @@ function f3() { >C : typeof C >f(10, "hello") : typeof C >f : (x: X, y: Y) => typeof C ->10 : number ->"hello" : string +>10 : 10 +>"hello" : "hello" let v = new C(); >v : f.C diff --git a/tests/baselines/reference/logicalAndOperatorStrictMode.types b/tests/baselines/reference/logicalAndOperatorStrictMode.types index a2321b06958..892da985120 100644 --- a/tests/baselines/reference/logicalAndOperatorStrictMode.types +++ b/tests/baselines/reference/logicalAndOperatorStrictMode.types @@ -3,19 +3,19 @@ const a = [0]; >a : number[] >[0] : number[] ->0 : number +>0 : 0 const s = ""; ->s : string ->"" : string +>s : "" +>"" : "" const x = 0; ->x : number ->0 : number +>x : 0 +>0 : 0 const b = false; ->b : boolean ->false : boolean +>b : false +>false : false const v: void = undefined; >v : void @@ -30,11 +30,11 @@ const n = null; >null : null const z = s || x || u; ->z : string | number | undefined ->s || x || u : string | number | undefined ->s || x : string | number ->s : string ->x : number +>z : undefined +>s || x || u : undefined +>s || x : 0 +>s : "" +>x : 0 >u : undefined const a1 = a && a; @@ -44,22 +44,22 @@ const a1 = a && a; >a : number[] const a2 = a && s; ->a2 : string ->a && s : string +>a2 : "" +>a && s : "" >a : number[] ->s : string +>s : "" const a3 = a && x; ->a3 : number ->a && x : number +>a3 : 0 +>a && x : 0 >a : number[] ->x : number +>x : 0 const a4 = a && b; ->a4 : boolean ->a && b : boolean +>a4 : false +>a && b : false >a : number[] ->b : boolean +>b : false const a5 = a && v; >a5 : void @@ -80,154 +80,154 @@ const a7 = a && n; >n : null const a8 = a && z; ->a8 : string | number | undefined ->a && z : string | number | undefined +>a8 : undefined +>a && z : undefined >a : number[] ->z : string | number | undefined +>z : undefined const s1 = s && a; ->s1 : "" | number[] ->s && a : "" | number[] ->s : string +>s1 : "" +>s && a : "" +>s : "" >a : number[] const s2 = s && s; ->s2 : string ->s && s : string ->s : string ->s : string +>s2 : "" +>s && s : "" +>s : "" +>s : never const s3 = s && x; ->s3 : number | "" ->s && x : number | "" ->s : string ->x : number +>s3 : "" +>s && x : "" +>s : "" +>x : 0 const s4 = s && b; ->s4 : boolean | "" ->s && b : boolean | "" ->s : string ->b : boolean +>s4 : "" +>s && b : "" +>s : "" +>b : false const s5 = s && v; ->s5 : void | "" ->s && v : void | "" ->s : string +>s5 : "" +>s && v : "" +>s : "" >v : void const s6 = s && u; ->s6 : "" | undefined ->s && u : "" | undefined ->s : string +>s6 : "" +>s && u : "" +>s : "" >u : undefined const s7 = s && n; ->s7 : "" | null ->s && n : "" | null ->s : string +>s7 : "" +>s && n : "" +>s : "" >n : null const s8 = s && z; ->s8 : string | number | undefined ->s && z : string | number | undefined ->s : string ->z : string | number | undefined +>s8 : "" +>s && z : "" +>s : "" +>z : undefined const x1 = x && a; ->x1 : 0 | number[] ->x && a : 0 | number[] ->x : number +>x1 : 0 +>x && a : 0 +>x : 0 >a : number[] const x2 = x && s; ->x2 : string | 0 ->x && s : string | 0 ->x : number ->s : string +>x2 : 0 +>x && s : 0 +>x : 0 +>s : "" const x3 = x && x; ->x3 : number ->x && x : number ->x : number ->x : number +>x3 : 0 +>x && x : 0 +>x : 0 +>x : never const x4 = x && b; ->x4 : boolean | 0 ->x && b : boolean | 0 ->x : number ->b : boolean +>x4 : 0 +>x && b : 0 +>x : 0 +>b : false const x5 = x && v; ->x5 : void | 0 ->x && v : void | 0 ->x : number +>x5 : 0 +>x && v : 0 +>x : 0 >v : void const x6 = x && u; ->x6 : 0 | undefined ->x && u : 0 | undefined ->x : number +>x6 : 0 +>x && u : 0 +>x : 0 >u : undefined const x7 = x && n; ->x7 : 0 | null ->x && n : 0 | null ->x : number +>x7 : 0 +>x && n : 0 +>x : 0 >n : null const x8 = x && z; ->x8 : string | number | undefined ->x && z : string | number | undefined ->x : number ->z : string | number | undefined +>x8 : 0 +>x && z : 0 +>x : 0 +>z : undefined const b1 = b && a; ->b1 : false | number[] ->b && a : false | number[] ->b : boolean +>b1 : false +>b && a : false +>b : false >a : number[] const b2 = b && s; ->b2 : string | false ->b && s : string | false ->b : boolean ->s : string +>b2 : false +>b && s : false +>b : false +>s : "" const b3 = b && x; ->b3 : number | false ->b && x : number | false ->b : boolean ->x : number +>b3 : false +>b && x : false +>b : false +>x : 0 const b4 = b && b; ->b4 : boolean ->b && b : boolean ->b : boolean ->b : true +>b4 : false +>b && b : false +>b : false +>b : never const b5 = b && v; ->b5 : false | void ->b && v : false | void ->b : boolean +>b5 : false +>b && v : false +>b : false >v : void const b6 = b && u; ->b6 : false | undefined ->b && u : false | undefined ->b : boolean +>b6 : false +>b && u : false +>b : false >u : undefined const b7 = b && n; ->b7 : false | null ->b && n : false | null ->b : boolean +>b7 : false +>b && n : false +>b : false >n : null const b8 = b && z; ->b8 : string | number | false | undefined ->b && z : string | number | false | undefined ->b : boolean ->z : string | number | undefined +>b8 : false +>b && z : false +>b : false +>z : undefined const v1 = v && a; >v1 : void @@ -239,19 +239,19 @@ const v2 = v && s; >v2 : void >v && s : void >v : void ->s : string +>s : "" const v3 = v && x; >v3 : void >v && x : void >v : void ->x : number +>x : 0 const v4 = v && b; >v4 : void >v && b : void >v : void ->b : boolean +>b : false const v5 = v && v; >v5 : void @@ -275,7 +275,7 @@ const v8 = v && z; >v8 : void >v && z : void >v : void ->z : string | number | undefined +>z : undefined const u1 = u && a; >u1 : undefined @@ -287,19 +287,19 @@ const u2 = u && s; >u2 : undefined >u && s : undefined >u : undefined ->s : string +>s : "" const u3 = u && x; >u3 : undefined >u && x : undefined >u : undefined ->x : number +>x : 0 const u4 = u && b; >u4 : undefined >u && b : undefined >u : undefined ->b : boolean +>b : false const u5 = u && v; >u5 : undefined @@ -323,7 +323,7 @@ const u8 = u && z; >u8 : undefined >u && z : undefined >u : undefined ->z : string | number | undefined +>z : undefined const n1 = n && a; >n1 : null @@ -335,19 +335,19 @@ const n2 = n && s; >n2 : null >n && s : null >n : null ->s : string +>s : "" const n3 = n && x; >n3 : null >n && x : null >n : null ->x : number +>x : 0 const n4 = n && b; >n4 : null >n && b : null >n : null ->b : boolean +>b : false const n5 = n && v; >n5 : null @@ -371,53 +371,53 @@ const n8 = n && z; >n8 : null >n && z : null >n : null ->z : string | number | undefined +>z : undefined const z1 = z && a; ->z1 : "" | 0 | number[] | undefined ->z && a : "" | 0 | number[] | undefined ->z : string | number | undefined +>z1 : undefined +>z && a : undefined +>z : undefined >a : number[] const z2 = z && s; ->z2 : string | 0 | undefined ->z && s : string | 0 | undefined ->z : string | number | undefined ->s : string +>z2 : undefined +>z && s : undefined +>z : undefined +>s : "" const z3 = z && x; ->z3 : number | "" | undefined ->z && x : number | "" | undefined ->z : string | number | undefined ->x : number +>z3 : undefined +>z && x : undefined +>z : undefined +>x : 0 const z4 = z && b; ->z4 : boolean | "" | 0 | undefined ->z && b : boolean | "" | 0 | undefined ->z : string | number | undefined ->b : boolean +>z4 : undefined +>z && b : undefined +>z : undefined +>b : false const z5 = z && v; ->z5 : void | "" | 0 ->z && v : void | "" | 0 ->z : string | number | undefined +>z5 : undefined +>z && v : undefined +>z : undefined >v : void const z6 = z && u; ->z6 : "" | 0 | undefined ->z && u : "" | 0 | undefined ->z : string | number | undefined +>z6 : undefined +>z && u : undefined +>z : undefined >u : undefined const z7 = z && n; ->z7 : "" | 0 | null | undefined ->z && n : "" | 0 | null | undefined ->z : string | number | undefined +>z7 : undefined +>z && n : undefined +>z : undefined >n : null const z8 = z && z; ->z8 : string | number | undefined ->z && z : string | number | undefined ->z : string | number | undefined ->z : string | number +>z8 : undefined +>z && z : undefined +>z : undefined +>z : never diff --git a/tests/baselines/reference/logicalAndOperatorWithEveryType.types b/tests/baselines/reference/logicalAndOperatorWithEveryType.types index 22187bb16a9..54770acfab4 100644 --- a/tests/baselines/reference/logicalAndOperatorWithEveryType.types +++ b/tests/baselines/reference/logicalAndOperatorWithEveryType.types @@ -4,9 +4,9 @@ enum E { a, b, c } >E : E ->a : E ->b : E ->c : E +>a : E.a +>b : E.b +>c : E.c var a1: any; >a1 : any @@ -364,7 +364,7 @@ var rf5 = a5 && a6; >a6 : E var rf6 = a6 && a6; ->rf6 : E.b | E.c +>rf6 : E >a6 && a6 : E.b | E.c >a6 : E >a6 : E.b | E.c diff --git a/tests/baselines/reference/logicalNotOperatorWithAnyOtherType.errors.txt b/tests/baselines/reference/logicalNotOperatorWithAnyOtherType.errors.txt index 883f2ee5861..02b4bf16fd2 100644 --- a/tests/baselines/reference/logicalNotOperatorWithAnyOtherType.errors.txt +++ b/tests/baselines/reference/logicalNotOperatorWithAnyOtherType.errors.txt @@ -1,9 +1,10 @@ tests/cases/conformance/expressions/unaryOperators/logicalNotOperator/logicalNotOperatorWithAnyOtherType.ts(45,27): error TS2365: Operator '+' cannot be applied to types 'undefined' and 'undefined'. tests/cases/conformance/expressions/unaryOperators/logicalNotOperator/logicalNotOperatorWithAnyOtherType.ts(46,27): error TS2365: Operator '+' cannot be applied to types 'null' and 'null'. tests/cases/conformance/expressions/unaryOperators/logicalNotOperator/logicalNotOperatorWithAnyOtherType.ts(47,27): error TS2365: Operator '+' cannot be applied to types 'undefined' and 'undefined'. +tests/cases/conformance/expressions/unaryOperators/logicalNotOperator/logicalNotOperatorWithAnyOtherType.ts(57,1): error TS2695: Left side of comma operator is unused and has no side effects. -==== tests/cases/conformance/expressions/unaryOperators/logicalNotOperator/logicalNotOperatorWithAnyOtherType.ts (3 errors) ==== +==== tests/cases/conformance/expressions/unaryOperators/logicalNotOperator/logicalNotOperatorWithAnyOtherType.ts (4 errors) ==== // ! operator on any type var ANY: any; @@ -67,5 +68,7 @@ tests/cases/conformance/expressions/unaryOperators/logicalNotOperator/logicalNot !ANY1; !ANY2[0]; !ANY, ANY1; + ~~~~ +!!! error TS2695: Left side of comma operator is unused and has no side effects. !objA.a; !M.n; \ No newline at end of file diff --git a/tests/baselines/reference/logicalNotOperatorWithBooleanType.errors.txt b/tests/baselines/reference/logicalNotOperatorWithBooleanType.errors.txt new file mode 100644 index 00000000000..51666e4ea25 --- /dev/null +++ b/tests/baselines/reference/logicalNotOperatorWithBooleanType.errors.txt @@ -0,0 +1,44 @@ +tests/cases/conformance/expressions/unaryOperators/logicalNotOperator/logicalNotOperatorWithBooleanType.ts(36,1): error TS2695: Left side of comma operator is unused and has no side effects. + + +==== tests/cases/conformance/expressions/unaryOperators/logicalNotOperator/logicalNotOperatorWithBooleanType.ts (1 errors) ==== + // ! operator on boolean type + var BOOLEAN: boolean; + + function foo(): boolean { return true; } + + class A { + public a: boolean; + static foo() { return false; } + } + module M { + export var n: boolean; + } + + var objA = new A(); + + // boolean type var + var ResultIsBoolean1 = !BOOLEAN; + + // boolean type literal + var ResultIsBoolean2 = !true; + var ResultIsBoolean3 = !{ x: true, y: false }; + + // boolean type expressions + var ResultIsBoolean4 = !objA.a; + var ResultIsBoolean5 = !M.n; + var ResultIsBoolean6 = !foo(); + var ResultIsBoolean7 = !A.foo(); + + // multiple ! operators + var ResultIsBoolean = !!BOOLEAN; + + // miss assignment operators + !true; + !BOOLEAN; + !foo(); + !true, false; + ~~~~~ +!!! error TS2695: Left side of comma operator is unused and has no side effects. + !objA.a; + !M.n; \ No newline at end of file diff --git a/tests/baselines/reference/logicalNotOperatorWithBooleanType.types b/tests/baselines/reference/logicalNotOperatorWithBooleanType.types index b8aa6feac4c..93fdea731f1 100644 --- a/tests/baselines/reference/logicalNotOperatorWithBooleanType.types +++ b/tests/baselines/reference/logicalNotOperatorWithBooleanType.types @@ -5,7 +5,7 @@ var BOOLEAN: boolean; function foo(): boolean { return true; } >foo : () => boolean ->true : boolean +>true : true class A { >A : A @@ -15,7 +15,7 @@ class A { static foo() { return false; } >foo : () => boolean ->false : boolean +>false : false } module M { >M : typeof M @@ -39,16 +39,16 @@ var ResultIsBoolean1 = !BOOLEAN; var ResultIsBoolean2 = !true; >ResultIsBoolean2 : boolean >!true : boolean ->true : boolean +>true : true var ResultIsBoolean3 = !{ x: true, y: false }; >ResultIsBoolean3 : boolean >!{ x: true, y: false } : boolean >{ x: true, y: false } : { x: boolean; y: boolean; } >x : boolean ->true : boolean +>true : true >y : boolean ->false : boolean +>false : false // boolean type expressions var ResultIsBoolean4 = !objA.a; @@ -89,7 +89,7 @@ var ResultIsBoolean = !!BOOLEAN; // miss assignment operators !true; >!true : boolean ->true : boolean +>true : true !BOOLEAN; >!BOOLEAN : boolean @@ -101,10 +101,10 @@ var ResultIsBoolean = !!BOOLEAN; >foo : () => boolean !true, false; ->!true, false : boolean +>!true, false : false >!true : boolean ->true : boolean ->false : boolean +>true : true +>false : false !objA.a; >!objA.a : boolean diff --git a/tests/baselines/reference/logicalNotOperatorWithEnumType.errors.txt b/tests/baselines/reference/logicalNotOperatorWithEnumType.errors.txt new file mode 100644 index 00000000000..25298f1bd44 --- /dev/null +++ b/tests/baselines/reference/logicalNotOperatorWithEnumType.errors.txt @@ -0,0 +1,27 @@ +tests/cases/conformance/expressions/unaryOperators/logicalNotOperator/logicalNotOperatorWithEnumType.ts(21,1): error TS2695: Left side of comma operator is unused and has no side effects. + + +==== tests/cases/conformance/expressions/unaryOperators/logicalNotOperator/logicalNotOperatorWithEnumType.ts (1 errors) ==== + // ! operator on enum type + + enum ENUM { A, B, C }; + enum ENUM1 { }; + + // enum type var + var ResultIsBoolean1 = !ENUM; + + // enum type expressions + var ResultIsBoolean2 = !ENUM["B"]; + var ResultIsBoolean3 = !(ENUM.B + ENUM["C"]); + + // multiple ! operators + var ResultIsBoolean4 = !!ENUM; + var ResultIsBoolean5 = !!!(ENUM["B"] + ENUM.C); + + // miss assignment operators + !ENUM; + !ENUM1; + !ENUM.B; + !ENUM, ENUM1; + ~~~~~ +!!! error TS2695: Left side of comma operator is unused and has no side effects. \ No newline at end of file diff --git a/tests/baselines/reference/logicalNotOperatorWithEnumType.types b/tests/baselines/reference/logicalNotOperatorWithEnumType.types index 5d57916ceaa..4495038eb85 100644 --- a/tests/baselines/reference/logicalNotOperatorWithEnumType.types +++ b/tests/baselines/reference/logicalNotOperatorWithEnumType.types @@ -3,9 +3,9 @@ enum ENUM { A, B, C }; >ENUM : ENUM ->A : ENUM ->B : ENUM ->C : ENUM +>A : ENUM.A +>B : ENUM.B +>C : ENUM.C enum ENUM1 { }; >ENUM1 : ENUM1 @@ -20,21 +20,21 @@ var ResultIsBoolean1 = !ENUM; var ResultIsBoolean2 = !ENUM["B"]; >ResultIsBoolean2 : boolean >!ENUM["B"] : boolean ->ENUM["B"] : ENUM +>ENUM["B"] : ENUM.B >ENUM : typeof ENUM ->"B" : string +>"B" : "B" var ResultIsBoolean3 = !(ENUM.B + ENUM["C"]); >ResultIsBoolean3 : boolean >!(ENUM.B + ENUM["C"]) : boolean >(ENUM.B + ENUM["C"]) : number >ENUM.B + ENUM["C"] : number ->ENUM.B : ENUM +>ENUM.B : ENUM.B >ENUM : typeof ENUM ->B : ENUM ->ENUM["C"] : ENUM +>B : ENUM.B +>ENUM["C"] : ENUM.C >ENUM : typeof ENUM ->"C" : string +>"C" : "C" // multiple ! operators var ResultIsBoolean4 = !!ENUM; @@ -50,12 +50,12 @@ var ResultIsBoolean5 = !!!(ENUM["B"] + ENUM.C); >!(ENUM["B"] + ENUM.C) : boolean >(ENUM["B"] + ENUM.C) : number >ENUM["B"] + ENUM.C : number ->ENUM["B"] : ENUM +>ENUM["B"] : ENUM.B >ENUM : typeof ENUM ->"B" : string ->ENUM.C : ENUM +>"B" : "B" +>ENUM.C : ENUM.C >ENUM : typeof ENUM ->C : ENUM +>C : ENUM.C // miss assignment operators !ENUM; @@ -68,9 +68,9 @@ var ResultIsBoolean5 = !!!(ENUM["B"] + ENUM.C); !ENUM.B; >!ENUM.B : boolean ->ENUM.B : ENUM +>ENUM.B : ENUM.B >ENUM : typeof ENUM ->B : ENUM +>B : ENUM.B !ENUM, ENUM1; >!ENUM, ENUM1 : typeof ENUM1 diff --git a/tests/baselines/reference/logicalNotOperatorWithNumberType.errors.txt b/tests/baselines/reference/logicalNotOperatorWithNumberType.errors.txt new file mode 100644 index 00000000000..e1c1d5da153 --- /dev/null +++ b/tests/baselines/reference/logicalNotOperatorWithNumberType.errors.txt @@ -0,0 +1,51 @@ +tests/cases/conformance/expressions/unaryOperators/logicalNotOperator/logicalNotOperatorWithNumberType.ts(45,1): error TS2695: Left side of comma operator is unused and has no side effects. + + +==== tests/cases/conformance/expressions/unaryOperators/logicalNotOperator/logicalNotOperatorWithNumberType.ts (1 errors) ==== + // ! operator on number type + var NUMBER: number; + var NUMBER1: number[] = [1, 2]; + + function foo(): number { return 1; } + + class A { + public a: number; + static foo() { return 1; } + } + module M { + export var n: number; + } + + var objA = new A(); + + // number type var + var ResultIsBoolean1 = !NUMBER; + var ResultIsBoolean2 = !NUMBER1; + + // number type literal + var ResultIsBoolean3 = !1; + var ResultIsBoolean4 = !{ x: 1, y: 2}; + var ResultIsBoolean5 = !{ x: 1, y: (n: number) => { return n; } }; + + // number type expressions + var ResultIsBoolean6 = !objA.a; + var ResultIsBoolean7 = !M.n; + var ResultIsBoolean8 = !NUMBER1[0]; + var ResultIsBoolean9 = !foo(); + var ResultIsBoolean10 = !A.foo(); + var ResultIsBoolean11 = !(NUMBER + NUMBER); + + // multiple ! operator + var ResultIsBoolean12 = !!NUMBER; + var ResultIsBoolean13 = !!!(NUMBER + NUMBER); + + // miss assignment operators + !1; + !NUMBER; + !NUMBER1; + !foo(); + !objA.a; + !M.n; + !objA.a, M.n; + ~~~~~~~ +!!! error TS2695: Left side of comma operator is unused and has no side effects. \ No newline at end of file diff --git a/tests/baselines/reference/logicalNotOperatorWithNumberType.types b/tests/baselines/reference/logicalNotOperatorWithNumberType.types index 6b7ce5b6088..f66f878c3be 100644 --- a/tests/baselines/reference/logicalNotOperatorWithNumberType.types +++ b/tests/baselines/reference/logicalNotOperatorWithNumberType.types @@ -6,12 +6,12 @@ var NUMBER: number; var NUMBER1: number[] = [1, 2]; >NUMBER1 : number[] >[1, 2] : number[] ->1 : number ->2 : number +>1 : 1 +>2 : 2 function foo(): number { return 1; } >foo : () => number ->1 : number +>1 : 1 class A { >A : A @@ -21,7 +21,7 @@ class A { static foo() { return 1; } >foo : () => number ->1 : number +>1 : 1 } module M { >M : typeof M @@ -50,23 +50,23 @@ var ResultIsBoolean2 = !NUMBER1; var ResultIsBoolean3 = !1; >ResultIsBoolean3 : boolean >!1 : boolean ->1 : number +>1 : 1 var ResultIsBoolean4 = !{ x: 1, y: 2}; >ResultIsBoolean4 : boolean >!{ x: 1, y: 2} : boolean >{ x: 1, y: 2} : { x: number; y: number; } >x : number ->1 : number +>1 : 1 >y : number ->2 : number +>2 : 2 var ResultIsBoolean5 = !{ x: 1, y: (n: number) => { return n; } }; >ResultIsBoolean5 : boolean >!{ x: 1, y: (n: number) => { return n; } } : boolean >{ x: 1, y: (n: number) => { return n; } } : { x: number; y: (n: number) => number; } >x : number ->1 : number +>1 : 1 >y : (n: number) => number >(n: number) => { return n; } : (n: number) => number >n : number @@ -92,7 +92,7 @@ var ResultIsBoolean8 = !NUMBER1[0]; >!NUMBER1[0] : boolean >NUMBER1[0] : number >NUMBER1 : number[] ->0 : number +>0 : 0 var ResultIsBoolean9 = !foo(); >ResultIsBoolean9 : boolean @@ -136,7 +136,7 @@ var ResultIsBoolean13 = !!!(NUMBER + NUMBER); // miss assignment operators !1; >!1 : boolean ->1 : number +>1 : 1 !NUMBER; >!NUMBER : boolean diff --git a/tests/baselines/reference/logicalNotOperatorWithStringType.errors.txt b/tests/baselines/reference/logicalNotOperatorWithStringType.errors.txt new file mode 100644 index 00000000000..2eb70642fc2 --- /dev/null +++ b/tests/baselines/reference/logicalNotOperatorWithStringType.errors.txt @@ -0,0 +1,50 @@ +tests/cases/conformance/expressions/unaryOperators/logicalNotOperator/logicalNotOperatorWithStringType.ts(44,1): error TS2695: Left side of comma operator is unused and has no side effects. + + +==== tests/cases/conformance/expressions/unaryOperators/logicalNotOperator/logicalNotOperatorWithStringType.ts (1 errors) ==== + // ! operator on string type + var STRING: string; + var STRING1: string[] = ["", "abc"]; + + function foo(): string { return "abc"; } + + class A { + public a: string; + static foo() { return ""; } + } + module M { + export var n: string; + } + + var objA = new A(); + + // string type var + var ResultIsBoolean1 = !STRING; + var ResultIsBoolean2 = !STRING1; + + // string type literal + var ResultIsBoolean3 = !""; + var ResultIsBoolean4 = !{ x: "", y: "" }; + var ResultIsBoolean5 = !{ x: "", y: (s: string) => { return s; } }; + + // string type expressions + var ResultIsBoolean6 = !objA.a; + var ResultIsBoolean7 = !M.n; + var ResultIsBoolean8 = !STRING1[0]; + var ResultIsBoolean9 = !foo(); + var ResultIsBoolean10 = !A.foo(); + var ResultIsBoolean11 = !(STRING + STRING); + var ResultIsBoolean12 = !STRING.charAt(0); + + // multiple ! operator + var ResultIsBoolean13 = !!STRING; + var ResultIsBoolean14 = !!!(STRING + STRING); + + // miss assignment operators + !""; + !STRING; + !STRING1; + !foo(); + !objA.a,M.n; + ~~~~~~~ +!!! error TS2695: Left side of comma operator is unused and has no side effects. \ No newline at end of file diff --git a/tests/baselines/reference/logicalNotOperatorWithStringType.types b/tests/baselines/reference/logicalNotOperatorWithStringType.types index 5ca820ea6d0..0d3c1e88fd1 100644 --- a/tests/baselines/reference/logicalNotOperatorWithStringType.types +++ b/tests/baselines/reference/logicalNotOperatorWithStringType.types @@ -6,12 +6,12 @@ var STRING: string; var STRING1: string[] = ["", "abc"]; >STRING1 : string[] >["", "abc"] : string[] ->"" : string ->"abc" : string +>"" : "" +>"abc" : "abc" function foo(): string { return "abc"; } >foo : () => string ->"abc" : string +>"abc" : "abc" class A { >A : A @@ -21,7 +21,7 @@ class A { static foo() { return ""; } >foo : () => string ->"" : string +>"" : "" } module M { >M : typeof M @@ -49,24 +49,24 @@ var ResultIsBoolean2 = !STRING1; // string type literal var ResultIsBoolean3 = !""; >ResultIsBoolean3 : boolean ->!"" : boolean ->"" : string +>!"" : true +>"" : "" var ResultIsBoolean4 = !{ x: "", y: "" }; >ResultIsBoolean4 : boolean >!{ x: "", y: "" } : boolean >{ x: "", y: "" } : { x: string; y: string; } >x : string ->"" : string +>"" : "" >y : string ->"" : string +>"" : "" var ResultIsBoolean5 = !{ x: "", y: (s: string) => { return s; } }; >ResultIsBoolean5 : boolean >!{ x: "", y: (s: string) => { return s; } } : boolean >{ x: "", y: (s: string) => { return s; } } : { x: string; y: (s: string) => string; } >x : string ->"" : string +>"" : "" >y : (s: string) => string >(s: string) => { return s; } : (s: string) => string >s : string @@ -92,7 +92,7 @@ var ResultIsBoolean8 = !STRING1[0]; >!STRING1[0] : boolean >STRING1[0] : string >STRING1 : string[] ->0 : number +>0 : 0 var ResultIsBoolean9 = !foo(); >ResultIsBoolean9 : boolean @@ -123,7 +123,7 @@ var ResultIsBoolean12 = !STRING.charAt(0); >STRING.charAt : (pos: number) => string >STRING : string >charAt : (pos: number) => string ->0 : number +>0 : 0 // multiple ! operator var ResultIsBoolean13 = !!STRING; @@ -144,8 +144,8 @@ var ResultIsBoolean14 = !!!(STRING + STRING); // miss assignment operators !""; ->!"" : boolean ->"" : string +>!"" : true +>"" : "" !STRING; >!STRING : boolean diff --git a/tests/baselines/reference/logicalOrOperatorWithEveryType.types b/tests/baselines/reference/logicalOrOperatorWithEveryType.types index 8f2f4af0698..327ae64cf07 100644 --- a/tests/baselines/reference/logicalOrOperatorWithEveryType.types +++ b/tests/baselines/reference/logicalOrOperatorWithEveryType.types @@ -6,9 +6,9 @@ enum E { a, b, c } >E : E ->a : E ->b : E ->c : E +>a : E.a +>b : E.b +>c : E.c var a1: any; >a1 : any @@ -163,7 +163,7 @@ var rc1 = a1 || a3; // any || number is any >a3 : number var rc2 = a2 || a3; // boolean || number is boolean | number ->rc2 : number | true +>rc2 : number | boolean >a2 || a3 : number | true >a2 : boolean >a3 : number @@ -223,7 +223,7 @@ var rd1 = a1 || a4; // any || string is any >a4 : string var rd2 = a2 || a4; // boolean || string is boolean | string ->rd2 : string | true +>rd2 : string | boolean >a2 || a4 : string | true >a2 : boolean >a4 : string @@ -283,7 +283,7 @@ var re1 = a1 || a5; // any || void is any >a5 : void var re2 = a2 || a5; // boolean || void is boolean | void ->re2 : true | void +>re2 : boolean | void >a2 || a5 : true | void >a2 : boolean >a5 : void @@ -343,7 +343,7 @@ var rg1 = a1 || a6; // any || enum is any >a6 : E var rg2 = a2 || a6; // boolean || enum is boolean | enum ->rg2 : true | E +>rg2 : boolean | E >a2 || a6 : true | E >a2 : boolean >a6 : E @@ -403,7 +403,7 @@ var rh1 = a1 || a7; // any || object is any >a7 : { a: string; } var rh2 = a2 || a7; // boolean || object is boolean | object ->rh2 : true | { a: string; } +>rh2 : boolean | { a: string; } >a2 || a7 : true | { a: string; } >a2 : boolean >a7 : { a: string; } @@ -463,7 +463,7 @@ var ri1 = a1 || a8; // any || array is any >a8 : string[] var ri2 = a2 || a8; // boolean || array is boolean | array ->ri2 : true | string[] +>ri2 : boolean | string[] >a2 || a8 : true | string[] >a2 : boolean >a8 : string[] @@ -523,7 +523,7 @@ var rj1 = a1 || null; // any || null is any >null : null var rj2 = a2 || null; // boolean || null is boolean ->rj2 : true +>rj2 : boolean >a2 || null : true >a2 : boolean >null : null @@ -583,7 +583,7 @@ var rf1 = a1 || undefined; // any || undefined is any >undefined : undefined var rf2 = a2 || undefined; // boolean || undefined is boolean ->rf2 : true +>rf2 : boolean >a2 || undefined : true >a2 : boolean >undefined : undefined diff --git a/tests/baselines/reference/logicalOrOperatorWithTypeParameters.types b/tests/baselines/reference/logicalOrOperatorWithTypeParameters.types index f887ad7ae14..ecd3fc52709 100644 --- a/tests/baselines/reference/logicalOrOperatorWithTypeParameters.types +++ b/tests/baselines/reference/logicalOrOperatorWithTypeParameters.types @@ -112,7 +112,7 @@ function fn3t : T >{ a: '' } : { a: string; } >a : string ->'' : string +>'' : "" var r4: { a: string } = t || u; >r4 : { a: string; } diff --git a/tests/baselines/reference/matchReturnTypeInAllBranches.errors.txt b/tests/baselines/reference/matchReturnTypeInAllBranches.errors.txt index 744ebed7d08..405fa4d2036 100644 --- a/tests/baselines/reference/matchReturnTypeInAllBranches.errors.txt +++ b/tests/baselines/reference/matchReturnTypeInAllBranches.errors.txt @@ -1,4 +1,4 @@ -tests/cases/compiler/matchReturnTypeInAllBranches.ts(30,20): error TS2322: Type 'number' is not assignable to type 'boolean'. +tests/cases/compiler/matchReturnTypeInAllBranches.ts(30,20): error TS2322: Type '12345' is not assignable to type 'boolean'. ==== tests/cases/compiler/matchReturnTypeInAllBranches.ts (1 errors) ==== @@ -33,7 +33,7 @@ tests/cases/compiler/matchReturnTypeInAllBranches.ts(30,20): error TS2322: Type { return 12345; ~~~~~ -!!! error TS2322: Type 'number' is not assignable to type 'boolean'. +!!! error TS2322: Type '12345' is not assignable to type 'boolean'. } } } diff --git a/tests/baselines/reference/matchingOfObjectLiteralConstraints.types b/tests/baselines/reference/matchingOfObjectLiteralConstraints.types index f694571c727..76f61c978a8 100644 --- a/tests/baselines/reference/matchingOfObjectLiteralConstraints.types +++ b/tests/baselines/reference/matchingOfObjectLiteralConstraints.types @@ -15,7 +15,7 @@ foo2({ y: "foo" }, "foo"); >foo2 : (x: U, z: T) => void >{ y: "foo" } : { y: string; } >y : string ->"foo" : string ->"foo" : string +>"foo" : "foo" +>"foo" : "foo" diff --git a/tests/baselines/reference/maxConstraints.errors.txt b/tests/baselines/reference/maxConstraints.errors.txt index a7d07a5b5f2..ad8ba7f3539 100644 --- a/tests/baselines/reference/maxConstraints.errors.txt +++ b/tests/baselines/reference/maxConstraints.errors.txt @@ -1,4 +1,4 @@ -tests/cases/compiler/maxConstraints.ts(8,22): error TS2345: Argument of type 'number' is not assignable to parameter of type 'Comparable'. +tests/cases/compiler/maxConstraints.ts(8,22): error TS2345: Argument of type '1' is not assignable to parameter of type 'Comparable<1 | 2>'. ==== tests/cases/compiler/maxConstraints.ts (1 errors) ==== @@ -11,4 +11,4 @@ tests/cases/compiler/maxConstraints.ts(8,22): error TS2345: Argument of type 'nu var max2: Comparer = (x, y) => { return (x.compareTo(y) > 0) ? x : y }; var maxResult = max2(1, 2); ~ -!!! error TS2345: Argument of type 'number' is not assignable to parameter of type 'Comparable'. \ No newline at end of file +!!! error TS2345: Argument of type '1' is not assignable to parameter of type 'Comparable<1 | 2>'. \ No newline at end of file diff --git a/tests/baselines/reference/memberAccessMustUseModuleInstances.types b/tests/baselines/reference/memberAccessMustUseModuleInstances.types index b1848660dac..43291fdf8ca 100644 --- a/tests/baselines/reference/memberAccessMustUseModuleInstances.types +++ b/tests/baselines/reference/memberAccessMustUseModuleInstances.types @@ -10,7 +10,7 @@ WinJS.Promise.timeout(10); >WinJS : typeof WinJS >Promise : typeof WinJS.Promise >timeout : (delay: number) => WinJS.Promise ->10 : number +>10 : 10 === tests/cases/compiler/memberAccessMustUseModuleInstances_0.ts === export class Promise { diff --git a/tests/baselines/reference/memberVariableDeclarations1.types b/tests/baselines/reference/memberVariableDeclarations1.types index b7ec0fbaba0..b0c316ced68 100644 --- a/tests/baselines/reference/memberVariableDeclarations1.types +++ b/tests/baselines/reference/memberVariableDeclarations1.types @@ -12,7 +12,7 @@ class Employee { public retired = false; >retired : boolean ->false : boolean +>false : false public manager: Employee = null; >manager : Employee @@ -47,11 +47,11 @@ class Employee2 { constructor() { this.retired = false; ->this.retired = false : boolean +>this.retired = false : false >this.retired : boolean >this : this >retired : boolean ->false : boolean +>false : false this.manager = null; >this.manager = null : null diff --git a/tests/baselines/reference/mergeWithImportedNamespace.types b/tests/baselines/reference/mergeWithImportedNamespace.types index d6c1df3b609..b4cd2bf4e6d 100644 --- a/tests/baselines/reference/mergeWithImportedNamespace.types +++ b/tests/baselines/reference/mergeWithImportedNamespace.types @@ -2,7 +2,7 @@ export namespace N { export var x = 1; } >N : typeof N >x : number ->1 : number +>1 : 1 === tests/cases/compiler/f2.ts === import {N} from "./f1"; diff --git a/tests/baselines/reference/mergedDeclarations1.types b/tests/baselines/reference/mergedDeclarations1.types index 2a4f18947ce..09eaa2a7ca2 100644 --- a/tests/baselines/reference/mergedDeclarations1.types +++ b/tests/baselines/reference/mergedDeclarations1.types @@ -28,8 +28,8 @@ module point { >origin : Point >point(0, 0) : Point >point : typeof point ->0 : number ->0 : number +>0 : 0 +>0 : 0 export function equals(p1: Point, p2: Point) { >equals : (p1: Point, p2: Point) => boolean @@ -60,8 +60,8 @@ var p1 = point(0, 0); >p1 : Point >point(0, 0) : Point >point : typeof point ->0 : number ->0 : number +>0 : 0 +>0 : 0 var p2 = point.origin; >p2 : Point diff --git a/tests/baselines/reference/mergedDeclarations4.types b/tests/baselines/reference/mergedDeclarations4.types index 9c55747c6f6..4bf9f3b896e 100644 --- a/tests/baselines/reference/mergedDeclarations4.types +++ b/tests/baselines/reference/mergedDeclarations4.types @@ -30,7 +30,7 @@ module M { export var hello = 1; >hello : number ->1 : number +>1 : 1 } f(); >f() : void diff --git a/tests/baselines/reference/mergedInterfacesWithIndexers.types b/tests/baselines/reference/mergedInterfacesWithIndexers.types index b228931660a..947c47f6ed7 100644 --- a/tests/baselines/reference/mergedInterfacesWithIndexers.types +++ b/tests/baselines/reference/mergedInterfacesWithIndexers.types @@ -25,17 +25,17 @@ var r = a[1]; >r : string >a[1] : string >a : A ->1 : number +>1 : 1 var r2 = a['1']; >r2 : { length: number; } >a['1'] : { length: number; } >a : A ->'1' : string +>'1' : "1" var r3 = a['hi']; >r3 : { length: number; } >a['hi'] : { length: number; } >a : A ->'hi' : string +>'hi' : "hi" diff --git a/tests/baselines/reference/mergedModuleDeclarationWithSharedExportedVar.types b/tests/baselines/reference/mergedModuleDeclarationWithSharedExportedVar.types index 484cee0b0af..641778fe9bb 100644 --- a/tests/baselines/reference/mergedModuleDeclarationWithSharedExportedVar.types +++ b/tests/baselines/reference/mergedModuleDeclarationWithSharedExportedVar.types @@ -4,7 +4,7 @@ module M { export var v = 10; >v : number ->10 : number +>10 : 10 v; >v : number diff --git a/tests/baselines/reference/methodContainingLocalFunction.types b/tests/baselines/reference/methodContainingLocalFunction.types index 8b6d102ade8..313b457ae70 100644 --- a/tests/baselines/reference/methodContainingLocalFunction.types +++ b/tests/baselines/reference/methodContainingLocalFunction.types @@ -129,7 +129,7 @@ enum E { >localFunction : () => void return 0; ->0 : number +>0 : 0 })() } diff --git a/tests/baselines/reference/missingSemicolonInModuleSpecifier.types b/tests/baselines/reference/missingSemicolonInModuleSpecifier.types index b68c68b62e0..f7730558b68 100644 --- a/tests/baselines/reference/missingSemicolonInModuleSpecifier.types +++ b/tests/baselines/reference/missingSemicolonInModuleSpecifier.types @@ -1,16 +1,16 @@ === tests/cases/compiler/a.ts === export const x = 1; ->x : number ->1 : number +>x : 1 +>1 : 1 === tests/cases/compiler/b.ts === import {x} from "./a" ->x : number +>x : 1 (function() { return 1; }()) >(function() { return 1; }()) : number >function() { return 1; }() : number >function() { return 1; } : () => number ->1 : number +>1 : 1 diff --git a/tests/baselines/reference/modifierOnClassDeclarationMemberInFunction.types b/tests/baselines/reference/modifierOnClassDeclarationMemberInFunction.types index dfd482a6bc8..097383ee75e 100644 --- a/tests/baselines/reference/modifierOnClassDeclarationMemberInFunction.types +++ b/tests/baselines/reference/modifierOnClassDeclarationMemberInFunction.types @@ -8,7 +8,7 @@ function f() { public baz = 1; >baz : number ->1 : number +>1 : 1 static foo() { } >foo : () => void diff --git a/tests/baselines/reference/modifierOnClassExpressionMemberInFunction.types b/tests/baselines/reference/modifierOnClassExpressionMemberInFunction.types index 87a200ee56e..4f454754b2b 100644 --- a/tests/baselines/reference/modifierOnClassExpressionMemberInFunction.types +++ b/tests/baselines/reference/modifierOnClassExpressionMemberInFunction.types @@ -10,13 +10,13 @@ function g() { public prop1 = 1; >prop1 : number ->1 : number +>1 : 1 private foo() { } >foo : () => void static prop2 = 43; >prop2 : number ->43 : number +>43 : 43 } } diff --git a/tests/baselines/reference/modularizeLibrary_ErrorFromUsingES6ArrayWithOnlyES6ArrayLib.errors.txt b/tests/baselines/reference/modularizeLibrary_ErrorFromUsingES6ArrayWithOnlyES6ArrayLib.errors.txt index f796092fb14..3668e7080fd 100644 --- a/tests/baselines/reference/modularizeLibrary_ErrorFromUsingES6ArrayWithOnlyES6ArrayLib.errors.txt +++ b/tests/baselines/reference/modularizeLibrary_ErrorFromUsingES6ArrayWithOnlyES6ArrayLib.errors.txt @@ -1,7 +1,7 @@ error TS2318: Cannot find global type 'Boolean'. error TS2318: Cannot find global type 'IArguments'. error TS2318: Cannot find global type 'Number'. -tests/cases/compiler/modularizeLibrary_ErrorFromUsingES6ArrayWithOnlyES6ArrayLib.ts(4,12): error TS2304: Cannot find name 'Array'. +tests/cases/compiler/modularizeLibrary_ErrorFromUsingES6ArrayWithOnlyES6ArrayLib.ts(4,12): error TS2693: 'Array' only refers to a type, but is being used as a value here. !!! error TS2318: Cannot find global type 'Boolean'. @@ -13,7 +13,7 @@ tests/cases/compiler/modularizeLibrary_ErrorFromUsingES6ArrayWithOnlyES6ArrayLib function f(x: number, y: number, z: number) { return Array.from(arguments); ~~~~~ -!!! error TS2304: Cannot find name 'Array'. +!!! error TS2693: 'Array' only refers to a type, but is being used as a value here. } f(1, 2, 3); diff --git a/tests/baselines/reference/modularizeLibrary_ErrorFromUsingWellknownSymbolWithOutES6WellknownSymbolLib.errors.txt b/tests/baselines/reference/modularizeLibrary_ErrorFromUsingWellknownSymbolWithOutES6WellknownSymbolLib.errors.txt index b5da9f97867..f5a8b84ac29 100644 --- a/tests/baselines/reference/modularizeLibrary_ErrorFromUsingWellknownSymbolWithOutES6WellknownSymbolLib.errors.txt +++ b/tests/baselines/reference/modularizeLibrary_ErrorFromUsingWellknownSymbolWithOutES6WellknownSymbolLib.errors.txt @@ -1,4 +1,4 @@ -tests/cases/compiler/modularizeLibrary_ErrorFromUsingWellknownSymbolWithOutES6WellknownSymbolLib.ts(8,1): error TS2322: Type 'boolean' is not assignable to type 'string'. +tests/cases/compiler/modularizeLibrary_ErrorFromUsingWellknownSymbolWithOutES6WellknownSymbolLib.ts(8,1): error TS2322: Type 'false' is not assignable to type 'string'. tests/cases/compiler/modularizeLibrary_ErrorFromUsingWellknownSymbolWithOutES6WellknownSymbolLib.ts(8,3): error TS2304: Cannot find name 'Symbol'. @@ -12,6 +12,6 @@ tests/cases/compiler/modularizeLibrary_ErrorFromUsingWellknownSymbolWithOutES6We let a = ['c', 'd']; a[Symbol.isConcatSpreadable] = false; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2322: Type 'boolean' is not assignable to type 'string'. +!!! error TS2322: Type 'false' is not assignable to type 'string'. ~~~~~~ !!! error TS2304: Cannot find name 'Symbol'. \ No newline at end of file diff --git a/tests/baselines/reference/modularizeLibrary_NoErrorDuplicateLibOptions1.types b/tests/baselines/reference/modularizeLibrary_NoErrorDuplicateLibOptions1.types index 3851714cad8..40b299d63a0 100644 --- a/tests/baselines/reference/modularizeLibrary_NoErrorDuplicateLibOptions1.types +++ b/tests/baselines/reference/modularizeLibrary_NoErrorDuplicateLibOptions1.types @@ -18,9 +18,9 @@ function f(x: number, y: number, z: number) { f(1, 2, 3); // no error >f(1, 2, 3) : any[] >f : (x: number, y: number, z: number) => any[] ->1 : number ->2 : number ->3 : number +>1 : 1 +>2 : 2 +>3 : 3 // Using ES6 collection var m = new Map(); @@ -56,12 +56,12 @@ function* gen() { let i = 0; >i : number ->0 : number +>0 : 0 while (i < 10) { >i < 10 : boolean >i : number ->10 : number +>10 : 10 yield i; >yield i : any @@ -78,12 +78,12 @@ function* gen2() { let i = 0; >i : number ->0 : number +>0 : 0 while (i < 10) { >i < 10 : boolean >i : number ->10 : number +>10 : 10 yield i; >yield i : any @@ -101,7 +101,7 @@ Math.sign(1); >Math.sign : (x: number) => number >Math : Math >sign : (x: number) => number ->1 : number +>1 : 1 // Using ES6 object var o = { @@ -110,7 +110,7 @@ var o = { a: 2, >a : number ->2 : number +>2 : 2 [Symbol.hasInstance](value: any) { >Symbol.hasInstance : symbol @@ -119,7 +119,7 @@ var o = { >value : any return false; ->false : boolean +>false : false } }; o.hasOwnProperty(Symbol.hasInstance); @@ -148,10 +148,10 @@ declare var console: any; out().then(() => { >out().then(() => { console.log("Yea!");}) : Promise ->out().then : { (onfulfilled: (value: {}) => TResult1 | PromiseLike, onrejected: (reason: any) => TResult2 | PromiseLike): Promise; (onfulfilled: (value: {}) => TResult | PromiseLike, onrejected: (reason: any) => TResult | PromiseLike): Promise; (onfulfilled: (value: {}) => TResult | PromiseLike): Promise; (): Promise<{}>; } +>out().then : { (onfulfilled?: (value: {}) => {} | PromiseLike<{}>, onrejected?: (reason: any) => {} | PromiseLike<{}>): Promise<{}>; (onfulfilled: (value: {}) => {} | PromiseLike<{}>, onrejected: (reason: any) => TResult | PromiseLike): Promise<{} | TResult>; (onfulfilled: (value: {}) => TResult | PromiseLike, onrejected?: (reason: any) => TResult | PromiseLike): Promise; (onfulfilled: (value: {}) => TResult1 | PromiseLike, onrejected: (reason: any) => TResult2 | PromiseLike): Promise; } >out() : Promise<{}> >out : () => Promise<{}> ->then : { (onfulfilled: (value: {}) => TResult1 | PromiseLike, onrejected: (reason: any) => TResult2 | PromiseLike): Promise; (onfulfilled: (value: {}) => TResult | PromiseLike, onrejected: (reason: any) => TResult | PromiseLike): Promise; (onfulfilled: (value: {}) => TResult | PromiseLike): Promise; (): Promise<{}>; } +>then : { (onfulfilled?: (value: {}) => {} | PromiseLike<{}>, onrejected?: (reason: any) => {} | PromiseLike<{}>): Promise<{}>; (onfulfilled: (value: {}) => {} | PromiseLike<{}>, onrejected: (reason: any) => TResult | PromiseLike): Promise<{} | TResult>; (onfulfilled: (value: {}) => TResult | PromiseLike, onrejected?: (reason: any) => TResult | PromiseLike): Promise; (onfulfilled: (value: {}) => TResult1 | PromiseLike, onrejected: (reason: any) => TResult2 | PromiseLike): Promise; } >() => { console.log("Yea!");} : () => void console.log("Yea!"); @@ -159,7 +159,7 @@ out().then(() => { >console.log : any >console : any >log : any ->"Yea!" : string +>"Yea!" : "Yea!" }); @@ -188,7 +188,7 @@ var reg = new RegExp("/s"); >reg : RegExp >new RegExp("/s") : RegExp >RegExp : RegExpConstructor ->"/s" : string +>"/s" : "/s" reg.flags; >reg.flags : string @@ -198,15 +198,15 @@ reg.flags; // Using ES6 string var str = "Hello world"; >str : string ->"Hello world" : string +>"Hello world" : "Hello world" str.includes("hello", 0); >str.includes("hello", 0) : boolean >str.includes : (searchString: string, position?: number) => boolean >str : string >includes : (searchString: string, position?: number) => boolean ->"hello" : string ->0 : number +>"hello" : "hello" +>0 : 0 // Using ES6 symbol var s = Symbol(); @@ -226,6 +226,6 @@ const o1 = { >value : any return false; ->false : boolean +>false : false } } diff --git a/tests/baselines/reference/modularizeLibrary_NoErrorDuplicateLibOptions2.types b/tests/baselines/reference/modularizeLibrary_NoErrorDuplicateLibOptions2.types index f9c1894f86f..3022a0ce8b1 100644 --- a/tests/baselines/reference/modularizeLibrary_NoErrorDuplicateLibOptions2.types +++ b/tests/baselines/reference/modularizeLibrary_NoErrorDuplicateLibOptions2.types @@ -18,9 +18,9 @@ function f(x: number, y: number, z: number) { f(1, 2, 3); // no error >f(1, 2, 3) : any[] >f : (x: number, y: number, z: number) => any[] ->1 : number ->2 : number ->3 : number +>1 : 1 +>2 : 2 +>3 : 3 // Using ES6 collection var m = new Map(); @@ -56,12 +56,12 @@ function* gen() { let i = 0; >i : number ->0 : number +>0 : 0 while (i < 10) { >i < 10 : boolean >i : number ->10 : number +>10 : 10 yield i; >yield i : any @@ -78,12 +78,12 @@ function* gen2() { let i = 0; >i : number ->0 : number +>0 : 0 while (i < 10) { >i < 10 : boolean >i : number ->10 : number +>10 : 10 yield i; >yield i : any @@ -101,7 +101,7 @@ Math.sign(1); >Math.sign : (x: number) => number >Math : Math >sign : (x: number) => number ->1 : number +>1 : 1 // Using ES6 object var o = { @@ -110,7 +110,7 @@ var o = { a: 2, >a : number ->2 : number +>2 : 2 [Symbol.hasInstance](value: any) { >Symbol.hasInstance : symbol @@ -119,7 +119,7 @@ var o = { >value : any return false; ->false : boolean +>false : false } }; o.hasOwnProperty(Symbol.hasInstance); @@ -148,10 +148,10 @@ declare var console: any; out().then(() => { >out().then(() => { console.log("Yea!");}) : Promise ->out().then : { (onfulfilled: (value: {}) => TResult1 | PromiseLike, onrejected: (reason: any) => TResult2 | PromiseLike): Promise; (onfulfilled: (value: {}) => TResult | PromiseLike, onrejected: (reason: any) => TResult | PromiseLike): Promise; (onfulfilled: (value: {}) => TResult | PromiseLike): Promise; (): Promise<{}>; } +>out().then : { (onfulfilled?: (value: {}) => {} | PromiseLike<{}>, onrejected?: (reason: any) => {} | PromiseLike<{}>): Promise<{}>; (onfulfilled: (value: {}) => {} | PromiseLike<{}>, onrejected: (reason: any) => TResult | PromiseLike): Promise<{} | TResult>; (onfulfilled: (value: {}) => TResult | PromiseLike, onrejected?: (reason: any) => TResult | PromiseLike): Promise; (onfulfilled: (value: {}) => TResult1 | PromiseLike, onrejected: (reason: any) => TResult2 | PromiseLike): Promise; } >out() : Promise<{}> >out : () => Promise<{}> ->then : { (onfulfilled: (value: {}) => TResult1 | PromiseLike, onrejected: (reason: any) => TResult2 | PromiseLike): Promise; (onfulfilled: (value: {}) => TResult | PromiseLike, onrejected: (reason: any) => TResult | PromiseLike): Promise; (onfulfilled: (value: {}) => TResult | PromiseLike): Promise; (): Promise<{}>; } +>then : { (onfulfilled?: (value: {}) => {} | PromiseLike<{}>, onrejected?: (reason: any) => {} | PromiseLike<{}>): Promise<{}>; (onfulfilled: (value: {}) => {} | PromiseLike<{}>, onrejected: (reason: any) => TResult | PromiseLike): Promise<{} | TResult>; (onfulfilled: (value: {}) => TResult | PromiseLike, onrejected?: (reason: any) => TResult | PromiseLike): Promise; (onfulfilled: (value: {}) => TResult1 | PromiseLike, onrejected: (reason: any) => TResult2 | PromiseLike): Promise; } >() => { console.log("Yea!");} : () => void console.log("Yea!"); @@ -159,7 +159,7 @@ out().then(() => { >console.log : any >console : any >log : any ->"Yea!" : string +>"Yea!" : "Yea!" }); @@ -188,7 +188,7 @@ var reg = new RegExp("/s"); >reg : RegExp >new RegExp("/s") : RegExp >RegExp : RegExpConstructor ->"/s" : string +>"/s" : "/s" reg.flags; >reg.flags : string @@ -198,15 +198,15 @@ reg.flags; // Using ES6 string var str = "Hello world"; >str : string ->"Hello world" : string +>"Hello world" : "Hello world" str.includes("hello", 0); >str.includes("hello", 0) : boolean >str.includes : (searchString: string, position?: number) => boolean >str : string >includes : (searchString: string, position?: number) => boolean ->"hello" : string ->0 : number +>"hello" : "hello" +>0 : 0 // Using ES6 symbol var s = Symbol(); @@ -226,6 +226,6 @@ const o1 = { >value : any return false; ->false : boolean +>false : false } } diff --git a/tests/baselines/reference/modularizeLibrary_TargetES5UsingES6Lib.types b/tests/baselines/reference/modularizeLibrary_TargetES5UsingES6Lib.types index 8728176c2c1..d98ee870295 100644 --- a/tests/baselines/reference/modularizeLibrary_TargetES5UsingES6Lib.types +++ b/tests/baselines/reference/modularizeLibrary_TargetES5UsingES6Lib.types @@ -18,9 +18,9 @@ function f(x: number, y: number, z: number) { f(1, 2, 3); // no error >f(1, 2, 3) : any[] >f : (x: number, y: number, z: number) => any[] ->1 : number ->2 : number ->3 : number +>1 : 1 +>2 : 2 +>3 : 3 // Using ES6 collection var m = new Map(); @@ -56,12 +56,12 @@ function* gen() { let i = 0; >i : number ->0 : number +>0 : 0 while (i < 10) { >i < 10 : boolean >i : number ->10 : number +>10 : 10 yield i; >yield i : any @@ -78,12 +78,12 @@ function* gen2() { let i = 0; >i : number ->0 : number +>0 : 0 while (i < 10) { >i < 10 : boolean >i : number ->10 : number +>10 : 10 yield i; >yield i : any @@ -101,7 +101,7 @@ Math.sign(1); >Math.sign : (x: number) => number >Math : Math >sign : (x: number) => number ->1 : number +>1 : 1 // Using ES6 object var o = { @@ -110,7 +110,7 @@ var o = { a: 2, >a : number ->2 : number +>2 : 2 [Symbol.hasInstance](value: any) { >Symbol.hasInstance : symbol @@ -119,7 +119,7 @@ var o = { >value : any return false; ->false : boolean +>false : false } }; o.hasOwnProperty(Symbol.hasInstance); @@ -148,10 +148,10 @@ declare var console: any; out().then(() => { >out().then(() => { console.log("Yea!");}) : Promise ->out().then : { (onfulfilled: (value: {}) => TResult1 | PromiseLike, onrejected: (reason: any) => TResult2 | PromiseLike): Promise; (onfulfilled: (value: {}) => TResult | PromiseLike, onrejected: (reason: any) => TResult | PromiseLike): Promise; (onfulfilled: (value: {}) => TResult | PromiseLike): Promise; (): Promise<{}>; } +>out().then : { (onfulfilled?: (value: {}) => {} | PromiseLike<{}>, onrejected?: (reason: any) => {} | PromiseLike<{}>): Promise<{}>; (onfulfilled: (value: {}) => {} | PromiseLike<{}>, onrejected: (reason: any) => TResult | PromiseLike): Promise<{} | TResult>; (onfulfilled: (value: {}) => TResult | PromiseLike, onrejected?: (reason: any) => TResult | PromiseLike): Promise; (onfulfilled: (value: {}) => TResult1 | PromiseLike, onrejected: (reason: any) => TResult2 | PromiseLike): Promise; } >out() : Promise<{}> >out : () => Promise<{}> ->then : { (onfulfilled: (value: {}) => TResult1 | PromiseLike, onrejected: (reason: any) => TResult2 | PromiseLike): Promise; (onfulfilled: (value: {}) => TResult | PromiseLike, onrejected: (reason: any) => TResult | PromiseLike): Promise; (onfulfilled: (value: {}) => TResult | PromiseLike): Promise; (): Promise<{}>; } +>then : { (onfulfilled?: (value: {}) => {} | PromiseLike<{}>, onrejected?: (reason: any) => {} | PromiseLike<{}>): Promise<{}>; (onfulfilled: (value: {}) => {} | PromiseLike<{}>, onrejected: (reason: any) => TResult | PromiseLike): Promise<{} | TResult>; (onfulfilled: (value: {}) => TResult | PromiseLike, onrejected?: (reason: any) => TResult | PromiseLike): Promise; (onfulfilled: (value: {}) => TResult1 | PromiseLike, onrejected: (reason: any) => TResult2 | PromiseLike): Promise; } >() => { console.log("Yea!");} : () => void console.log("Yea!"); @@ -159,7 +159,7 @@ out().then(() => { >console.log : any >console : any >log : any ->"Yea!" : string +>"Yea!" : "Yea!" }); @@ -188,7 +188,7 @@ var reg = new RegExp("/s"); >reg : RegExp >new RegExp("/s") : RegExp >RegExp : RegExpConstructor ->"/s" : string +>"/s" : "/s" reg.flags; >reg.flags : string @@ -198,15 +198,15 @@ reg.flags; // Using ES6 string var str = "Hello world"; >str : string ->"Hello world" : string +>"Hello world" : "Hello world" str.includes("hello", 0); >str.includes("hello", 0) : boolean >str.includes : (searchString: string, position?: number) => boolean >str : string >includes : (searchString: string, position?: number) => boolean ->"hello" : string ->0 : number +>"hello" : "hello" +>0 : 0 // Using ES6 symbol var s = Symbol(); @@ -226,6 +226,6 @@ const o1 = { >value : any return false; ->false : boolean +>false : false } } diff --git a/tests/baselines/reference/modularizeLibrary_TargetES6UsingES6Lib.types b/tests/baselines/reference/modularizeLibrary_TargetES6UsingES6Lib.types index 248364f8d55..5b96ce987bc 100644 --- a/tests/baselines/reference/modularizeLibrary_TargetES6UsingES6Lib.types +++ b/tests/baselines/reference/modularizeLibrary_TargetES6UsingES6Lib.types @@ -18,9 +18,9 @@ function f(x: number, y: number, z: number) { f(1, 2, 3); // no error >f(1, 2, 3) : any[] >f : (x: number, y: number, z: number) => any[] ->1 : number ->2 : number ->3 : number +>1 : 1 +>2 : 2 +>3 : 3 // Using ES6 collection var m = new Map(); @@ -56,7 +56,7 @@ Math.sign(1); >Math.sign : (x: number) => number >Math : Math >sign : (x: number) => number ->1 : number +>1 : 1 // Using ES6 object var o = { @@ -65,7 +65,7 @@ var o = { a: 2, >a : number ->2 : number +>2 : 2 [Symbol.hasInstance](value: any) { >Symbol.hasInstance : symbol @@ -74,7 +74,7 @@ var o = { >value : any return false; ->false : boolean +>false : false } }; o.hasOwnProperty(Symbol.hasInstance); @@ -111,7 +111,7 @@ var reg = new RegExp("/s"); >reg : RegExp >new RegExp("/s") : RegExp >RegExp : RegExpConstructor ->"/s" : string +>"/s" : "/s" reg.flags; >reg.flags : string @@ -121,15 +121,15 @@ reg.flags; // Using ES6 string var str = "Hello world"; >str : string ->"Hello world" : string +>"Hello world" : "Hello world" str.includes("hello", 0); >str.includes("hello", 0) : boolean >str.includes : (searchString: string, position?: number) => boolean >str : string >includes : (searchString: string, position?: number) => boolean ->"hello" : string ->0 : number +>"hello" : "hello" +>0 : 0 // Using ES6 symbol var s = Symbol(); @@ -149,6 +149,6 @@ const o1 = { >value : any return false; ->false : boolean +>false : false } } diff --git a/tests/baselines/reference/modularizeLibrary_UsingES5LibAndES6ArrayLib.types b/tests/baselines/reference/modularizeLibrary_UsingES5LibAndES6ArrayLib.types index d17a6fcbcbb..a097b116186 100644 --- a/tests/baselines/reference/modularizeLibrary_UsingES5LibAndES6ArrayLib.types +++ b/tests/baselines/reference/modularizeLibrary_UsingES5LibAndES6ArrayLib.types @@ -18,7 +18,7 @@ function f(x: number, y: number, z: number) { f(1, 2, 3); >f(1, 2, 3) : any[] >f : (x: number, y: number, z: number) => any[] ->1 : number ->2 : number ->3 : number +>1 : 1 +>2 : 2 +>3 : 3 diff --git a/tests/baselines/reference/modularizeLibrary_UsingES5LibAndES6FeatureLibs.types b/tests/baselines/reference/modularizeLibrary_UsingES5LibAndES6FeatureLibs.types index cee8d3fb96b..cceb9a1925e 100644 --- a/tests/baselines/reference/modularizeLibrary_UsingES5LibAndES6FeatureLibs.types +++ b/tests/baselines/reference/modularizeLibrary_UsingES5LibAndES6FeatureLibs.types @@ -28,18 +28,18 @@ function* idGen() { let i = 10; >i : number ->10 : number +>10 : 10 while (i < 20) { >i < 20 : boolean >i : number ->20 : number +>20 : 20 yield i + 2; >yield i + 2 : any >i + 2 : number >i : number ->2 : number +>2 : 2 } } diff --git a/tests/baselines/reference/modularizeLibrary_UsingES5LibES6ArrayLibES6WellknownSymbolLib.types b/tests/baselines/reference/modularizeLibrary_UsingES5LibES6ArrayLibES6WellknownSymbolLib.types index 3ae08c79fd4..6accc7e7905 100644 --- a/tests/baselines/reference/modularizeLibrary_UsingES5LibES6ArrayLibES6WellknownSymbolLib.types +++ b/tests/baselines/reference/modularizeLibrary_UsingES5LibES6ArrayLibES6WellknownSymbolLib.types @@ -17,22 +17,22 @@ function f(x: number, y: number, z: number) { f(1, 2, 3); // no error >f(1, 2, 3) : any[] >f : (x: number, y: number, z: number) => any[] ->1 : number ->2 : number ->3 : number +>1 : 1 +>2 : 2 +>3 : 3 let a = ['c', 'd']; >a : string[] >['c', 'd'] : string[] ->'c' : string ->'d' : string +>'c' : "c" +>'d' : "d" a[Symbol.isConcatSpreadable] = false; ->a[Symbol.isConcatSpreadable] = false : boolean +>a[Symbol.isConcatSpreadable] = false : false >a[Symbol.isConcatSpreadable] : any >a : string[] >Symbol.isConcatSpreadable : symbol >Symbol : SymbolConstructor >isConcatSpreadable : symbol ->false : boolean +>false : false diff --git a/tests/baselines/reference/moduleAugmentationDeclarationEmit1.types b/tests/baselines/reference/moduleAugmentationDeclarationEmit1.types index fad835029c2..6c693b2b23b 100644 --- a/tests/baselines/reference/moduleAugmentationDeclarationEmit1.types +++ b/tests/baselines/reference/moduleAugmentationDeclarationEmit1.types @@ -79,5 +79,5 @@ let y = x.map(x => x + 1); >x : number >x + 1 : number >x : number ->1 : number +>1 : 1 diff --git a/tests/baselines/reference/moduleAugmentationDeclarationEmit2.types b/tests/baselines/reference/moduleAugmentationDeclarationEmit2.types index 85e4ead2ac0..ee302e6407e 100644 --- a/tests/baselines/reference/moduleAugmentationDeclarationEmit2.types +++ b/tests/baselines/reference/moduleAugmentationDeclarationEmit2.types @@ -79,7 +79,7 @@ let y = x.map(x => x + 1); >x : number >x + 1 : number >x : number ->1 : number +>1 : 1 let z1 = Observable.someValue.toFixed(); >z1 : string diff --git a/tests/baselines/reference/moduleAugmentationExtendAmbientModule1.types b/tests/baselines/reference/moduleAugmentationExtendAmbientModule1.types index e6ee79e3585..6c2c8c8e781 100644 --- a/tests/baselines/reference/moduleAugmentationExtendAmbientModule1.types +++ b/tests/baselines/reference/moduleAugmentationExtendAmbientModule1.types @@ -20,7 +20,7 @@ let y = x.map(x => x + 1); >x : number >x + 1 : number >x : number ->1 : number +>1 : 1 === tests/cases/compiler/map.ts === diff --git a/tests/baselines/reference/moduleAugmentationExtendAmbientModule2.types b/tests/baselines/reference/moduleAugmentationExtendAmbientModule2.types index 70288e48f02..b938cf9944e 100644 --- a/tests/baselines/reference/moduleAugmentationExtendAmbientModule2.types +++ b/tests/baselines/reference/moduleAugmentationExtendAmbientModule2.types @@ -20,7 +20,7 @@ let y = x.map(x => x + 1); >x : number >x + 1 : number >x : number ->1 : number +>1 : 1 let z1 = Observable.someValue.toFixed(); >z1 : string diff --git a/tests/baselines/reference/moduleAugmentationExtendFileModule1.types b/tests/baselines/reference/moduleAugmentationExtendFileModule1.types index fad835029c2..6c693b2b23b 100644 --- a/tests/baselines/reference/moduleAugmentationExtendFileModule1.types +++ b/tests/baselines/reference/moduleAugmentationExtendFileModule1.types @@ -79,5 +79,5 @@ let y = x.map(x => x + 1); >x : number >x + 1 : number >x : number ->1 : number +>1 : 1 diff --git a/tests/baselines/reference/moduleAugmentationExtendFileModule2.types b/tests/baselines/reference/moduleAugmentationExtendFileModule2.types index 85e4ead2ac0..ee302e6407e 100644 --- a/tests/baselines/reference/moduleAugmentationExtendFileModule2.types +++ b/tests/baselines/reference/moduleAugmentationExtendFileModule2.types @@ -79,7 +79,7 @@ let y = x.map(x => x + 1); >x : number >x + 1 : number >x : number ->1 : number +>1 : 1 let z1 = Observable.someValue.toFixed(); >z1 : string diff --git a/tests/baselines/reference/moduleAugmentationGlobal1.symbols b/tests/baselines/reference/moduleAugmentationGlobal1.symbols index 4115379b0f2..53cc4500e07 100644 --- a/tests/baselines/reference/moduleAugmentationGlobal1.symbols +++ b/tests/baselines/reference/moduleAugmentationGlobal1.symbols @@ -10,7 +10,7 @@ import {A} from "./f1"; // change the shape of Array declare global { ->global : Symbol(, Decl(f2.ts, 0, 23)) +>global : Symbol(global, Decl(f2.ts, 0, 23)) interface Array { >Array : Symbol(Array, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(f2.ts, 3, 16)) diff --git a/tests/baselines/reference/moduleAugmentationGlobal1.types b/tests/baselines/reference/moduleAugmentationGlobal1.types index 9963cbe1162..48ed21e2145 100644 --- a/tests/baselines/reference/moduleAugmentationGlobal1.types +++ b/tests/baselines/reference/moduleAugmentationGlobal1.types @@ -25,7 +25,7 @@ declare global { let x = [1]; >x : number[] >[1] : number[] ->1 : number +>1 : 1 let y = x.getA().x; >y : number diff --git a/tests/baselines/reference/moduleAugmentationGlobal2.symbols b/tests/baselines/reference/moduleAugmentationGlobal2.symbols index 48fe93353fb..0e6d8a6024d 100644 --- a/tests/baselines/reference/moduleAugmentationGlobal2.symbols +++ b/tests/baselines/reference/moduleAugmentationGlobal2.symbols @@ -10,7 +10,7 @@ import {A} from "./f1"; >A : Symbol(A, Decl(f2.ts, 2, 8)) declare global { ->global : Symbol(, Decl(f2.ts, 2, 23)) +>global : Symbol(global, Decl(f2.ts, 2, 23)) interface Array { >Array : Symbol(Array, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(f2.ts, 4, 16)) diff --git a/tests/baselines/reference/moduleAugmentationGlobal2.types b/tests/baselines/reference/moduleAugmentationGlobal2.types index 96252569da6..f80f0ec7c72 100644 --- a/tests/baselines/reference/moduleAugmentationGlobal2.types +++ b/tests/baselines/reference/moduleAugmentationGlobal2.types @@ -24,7 +24,7 @@ declare global { let x = [1]; >x : number[] >[1] : number[] ->1 : number +>1 : 1 let y = x.getCountAsString().toLowerCase(); >y : string diff --git a/tests/baselines/reference/moduleAugmentationGlobal3.symbols b/tests/baselines/reference/moduleAugmentationGlobal3.symbols index 41c7f25b818..1521fbb6e34 100644 --- a/tests/baselines/reference/moduleAugmentationGlobal3.symbols +++ b/tests/baselines/reference/moduleAugmentationGlobal3.symbols @@ -10,7 +10,7 @@ import {A} from "./f1"; >A : Symbol(A, Decl(f2.ts, 2, 8)) declare global { ->global : Symbol(, Decl(f2.ts, 2, 23)) +>global : Symbol(global, Decl(f2.ts, 2, 23)) interface Array { >Array : Symbol(Array, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(f2.ts, 4, 16)) diff --git a/tests/baselines/reference/moduleAugmentationGlobal3.types b/tests/baselines/reference/moduleAugmentationGlobal3.types index 0e8e731aec1..3b9ed24a452 100644 --- a/tests/baselines/reference/moduleAugmentationGlobal3.types +++ b/tests/baselines/reference/moduleAugmentationGlobal3.types @@ -27,7 +27,7 @@ import "./f2"; let x = [1]; >x : number[] >[1] : number[] ->1 : number +>1 : 1 let y = x.getCountAsString().toLowerCase(); >y : string diff --git a/tests/baselines/reference/moduleAugmentationGlobal4.symbols b/tests/baselines/reference/moduleAugmentationGlobal4.symbols index f9cdac3fc2e..6aaa587234b 100644 --- a/tests/baselines/reference/moduleAugmentationGlobal4.symbols +++ b/tests/baselines/reference/moduleAugmentationGlobal4.symbols @@ -1,7 +1,7 @@ === tests/cases/compiler/f1.ts === declare global { ->global : Symbol(, Decl(f1.ts, 0, 0)) +>global : Symbol(global, Decl(f1.ts, 0, 0)) interface Something {x} >Something : Symbol(Something, Decl(f1.ts, 1, 16), Decl(f2.ts, 1, 16)) @@ -11,7 +11,7 @@ export {}; === tests/cases/compiler/f2.ts === declare global { ->global : Symbol(, Decl(f2.ts, 0, 0)) +>global : Symbol(global, Decl(f2.ts, 0, 0)) interface Something {y} >Something : Symbol(Something, Decl(f1.ts, 1, 16), Decl(f2.ts, 1, 16)) diff --git a/tests/baselines/reference/moduleAugmentationGlobal5.symbols b/tests/baselines/reference/moduleAugmentationGlobal5.symbols index 27548b05ef2..4c4693601e8 100644 --- a/tests/baselines/reference/moduleAugmentationGlobal5.symbols +++ b/tests/baselines/reference/moduleAugmentationGlobal5.symbols @@ -9,7 +9,7 @@ No type information for this code.=== tests/cases/compiler/f1.d.ts === declare module "A" { global { ->global : Symbol(, Decl(f1.d.ts, 1, 20)) +>global : Symbol(global, Decl(f1.d.ts, 1, 20)) interface Something {x} >Something : Symbol(Something, Decl(f1.d.ts, 2, 12), Decl(f2.d.ts, 1, 12)) @@ -19,7 +19,7 @@ declare module "A" { === tests/cases/compiler/f2.d.ts === declare module "B" { global { ->global : Symbol(, Decl(f2.d.ts, 0, 20)) +>global : Symbol(global, Decl(f2.d.ts, 0, 20)) interface Something {y} >Something : Symbol(Something, Decl(f1.d.ts, 2, 12), Decl(f2.d.ts, 1, 12)) diff --git a/tests/baselines/reference/moduleAugmentationInAmbientModule5.symbols b/tests/baselines/reference/moduleAugmentationInAmbientModule5.symbols index 76b135307dd..a8cc1a3412e 100644 --- a/tests/baselines/reference/moduleAugmentationInAmbientModule5.symbols +++ b/tests/baselines/reference/moduleAugmentationInAmbientModule5.symbols @@ -26,7 +26,7 @@ declare module "array" { >A : Symbol(A, Decl(array.d.ts, 6, 12)) global { ->global : Symbol(, Decl(array.d.ts, 6, 24)) +>global : Symbol(global, Decl(array.d.ts, 6, 24)) interface Array { >Array : Symbol(Array, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(array.d.ts, 7, 12)) diff --git a/tests/baselines/reference/moduleAugmentationInAmbientModule5.types b/tests/baselines/reference/moduleAugmentationInAmbientModule5.types index 998452be450..d6d81f97a3a 100644 --- a/tests/baselines/reference/moduleAugmentationInAmbientModule5.types +++ b/tests/baselines/reference/moduleAugmentationInAmbientModule5.types @@ -5,7 +5,7 @@ import "array"; let x = [1]; >x : number[] >[1] : number[] ->1 : number +>1 : 1 let y = x.getA().x; >y : number diff --git a/tests/baselines/reference/moduleAugmentationNoNewNames.types b/tests/baselines/reference/moduleAugmentationNoNewNames.types index 37dc54b6663..06eab66c8d1 100644 --- a/tests/baselines/reference/moduleAugmentationNoNewNames.types +++ b/tests/baselines/reference/moduleAugmentationNoNewNames.types @@ -82,5 +82,5 @@ let y = x.map(x => x + 1); >x : number >x + 1 : number >x : number ->1 : number +>1 : 1 diff --git a/tests/baselines/reference/moduleAugmentationsBundledOutput1.types b/tests/baselines/reference/moduleAugmentationsBundledOutput1.types index 80e9127905d..c3cac91fa38 100644 --- a/tests/baselines/reference/moduleAugmentationsBundledOutput1.types +++ b/tests/baselines/reference/moduleAugmentationsBundledOutput1.types @@ -18,7 +18,7 @@ import {Cls} from "./m1"; >prototype : Cls >foo : any >function() { return 1; } : () => number ->1 : number +>1 : 1 (Cls.prototype).bar = function() { return "1"; }; >(Cls.prototype).bar = function() { return "1"; } : () => string @@ -30,7 +30,7 @@ import {Cls} from "./m1"; >prototype : Cls >bar : any >function() { return "1"; } : () => string ->"1" : string +>"1" : "1" declare module "./m1" { interface Cls { diff --git a/tests/baselines/reference/moduleClassArrayCodeGenTest.errors.txt b/tests/baselines/reference/moduleClassArrayCodeGenTest.errors.txt index 702beffa290..d6c78f71761 100644 --- a/tests/baselines/reference/moduleClassArrayCodeGenTest.errors.txt +++ b/tests/baselines/reference/moduleClassArrayCodeGenTest.errors.txt @@ -1,4 +1,4 @@ -tests/cases/compiler/moduleClassArrayCodeGenTest.ts(10,11): error TS2305: Module 'M' has no exported member 'B'. +tests/cases/compiler/moduleClassArrayCodeGenTest.ts(10,11): error TS2694: Namespace 'M' has no exported member 'B'. ==== tests/cases/compiler/moduleClassArrayCodeGenTest.ts (1 errors) ==== @@ -13,4 +13,4 @@ tests/cases/compiler/moduleClassArrayCodeGenTest.ts(10,11): error TS2305: Module var t: M.A[] = []; var t2: M.B[] = []; ~ -!!! error TS2305: Module 'M' has no exported member 'B'. \ No newline at end of file +!!! error TS2694: Namespace 'M' has no exported member 'B'. \ No newline at end of file diff --git a/tests/baselines/reference/moduleCodeGenTest3.types b/tests/baselines/reference/moduleCodeGenTest3.types index 288b794326f..77c59d8fc73 100644 --- a/tests/baselines/reference/moduleCodeGenTest3.types +++ b/tests/baselines/reference/moduleCodeGenTest3.types @@ -2,12 +2,12 @@ module Baz { export var x = "hello"; } >Baz : typeof Baz >x : string ->"hello" : string +>"hello" : "hello" Baz.x = "goodbye"; ->Baz.x = "goodbye" : string +>Baz.x = "goodbye" : "goodbye" >Baz.x : string >Baz : typeof Baz >x : string ->"goodbye" : string +>"goodbye" : "goodbye" diff --git a/tests/baselines/reference/moduleCodeGenTest5.types b/tests/baselines/reference/moduleCodeGenTest5.types index c2e4ccf6d65..b49c0c895d2 100644 --- a/tests/baselines/reference/moduleCodeGenTest5.types +++ b/tests/baselines/reference/moduleCodeGenTest5.types @@ -1,11 +1,11 @@ === tests/cases/compiler/moduleCodeGenTest5.ts === export var x = 0; >x : number ->0 : number +>0 : 0 var y = 0; >y : number ->0 : number +>0 : 0 export function f1() {} >f1 : () => void @@ -18,7 +18,7 @@ export class C1 { public p1 = 0; >p1 : number ->0 : number +>0 : 0 public p2() {} >p2 : () => void @@ -28,7 +28,7 @@ class C2{ public p1 = 0; >p1 : number ->0 : number +>0 : 0 public p2() {} >p2 : () => void @@ -37,7 +37,7 @@ class C2{ export enum E1 {A=0} >E1 : E1 >A : E1 ->0 : number +>0 : 0 var u = E1.A; >u : E1 @@ -48,7 +48,7 @@ var u = E1.A; enum E2 {B=0} >E2 : E2 >B : E2 ->0 : number +>0 : 0 var v = E2.B; >v : E2 diff --git a/tests/baselines/reference/moduleCodegenTest4.types b/tests/baselines/reference/moduleCodegenTest4.types index 919432c938f..1c419e8710f 100644 --- a/tests/baselines/reference/moduleCodegenTest4.types +++ b/tests/baselines/reference/moduleCodegenTest4.types @@ -2,16 +2,16 @@ export module Baz { export var x = "hello"; } >Baz : typeof Baz >x : string ->"hello" : string +>"hello" : "hello" Baz.x = "goodbye"; ->Baz.x = "goodbye" : string +>Baz.x = "goodbye" : "goodbye" >Baz.x : string >Baz : typeof Baz >x : string ->"goodbye" : string +>"goodbye" : "goodbye" void 0; >void 0 : undefined ->0 : number +>0 : 0 diff --git a/tests/baselines/reference/moduleElementsInWrongContext.js b/tests/baselines/reference/moduleElementsInWrongContext.js index 7cd2af405e2..cd440bd6017 100644 --- a/tests/baselines/reference/moduleElementsInWrongContext.js +++ b/tests/baselines/reference/moduleElementsInWrongContext.js @@ -44,6 +44,7 @@ } return C; }()); + export default C; function bee() { } import I2 = require("foo"); import * as Foo from "ambient"; diff --git a/tests/baselines/reference/moduleElementsInWrongContext2.js b/tests/baselines/reference/moduleElementsInWrongContext2.js index 55dd133ec95..cc4aca0dec0 100644 --- a/tests/baselines/reference/moduleElementsInWrongContext2.js +++ b/tests/baselines/reference/moduleElementsInWrongContext2.js @@ -44,6 +44,7 @@ function blah() { } return C; }()); + export default C; function bee() { } import I2 = require("foo"); import * as Foo from "ambient"; diff --git a/tests/baselines/reference/moduleIdentifiers.types b/tests/baselines/reference/moduleIdentifiers.types index dc540823815..fccf8a9a904 100644 --- a/tests/baselines/reference/moduleIdentifiers.types +++ b/tests/baselines/reference/moduleIdentifiers.types @@ -9,7 +9,7 @@ module M { export var a = 1 >a : number ->1 : number +>1 : 1 } //var p: M.P; diff --git a/tests/baselines/reference/moduleImport.errors.txt b/tests/baselines/reference/moduleImport.errors.txt index 7b18c80ba24..4032b4b7871 100644 --- a/tests/baselines/reference/moduleImport.errors.txt +++ b/tests/baselines/reference/moduleImport.errors.txt @@ -1,14 +1,14 @@ -tests/cases/compiler/moduleImport.ts(2,17): error TS2305: Module 'X' has no exported member 'Y'. tests/cases/compiler/moduleImport.ts(2,17): error TS2339: Property 'Y' does not exist on type 'typeof X'. +tests/cases/compiler/moduleImport.ts(2,17): error TS2694: Namespace 'X' has no exported member 'Y'. ==== tests/cases/compiler/moduleImport.ts (2 errors) ==== module A.B.C { import XYZ = X.Y.Z; ~ -!!! error TS2305: Module 'X' has no exported member 'Y'. - ~ !!! error TS2339: Property 'Y' does not exist on type 'typeof X'. + ~ +!!! error TS2694: Namespace 'X' has no exported member 'Y'. export function ping(x: number) { if (x>0) XYZ.pong (x-1); } diff --git a/tests/baselines/reference/moduleMemberWithoutTypeAnnotation1.types b/tests/baselines/reference/moduleMemberWithoutTypeAnnotation1.types index c308f535a7a..a9a0c4bbd5c 100644 --- a/tests/baselines/reference/moduleMemberWithoutTypeAnnotation1.types +++ b/tests/baselines/reference/moduleMemberWithoutTypeAnnotation1.types @@ -64,7 +64,7 @@ module TypeScript { >findToken : (position: number, includeSkippedTokens?: boolean) => PositionedToken >position : number >includeSkippedTokens : boolean ->false : boolean +>false : false >PositionedToken : PositionedToken var positionedToken = this.findTokenInternal(null, position, 0); @@ -75,7 +75,7 @@ module TypeScript { >findTokenInternal : (x: any, y: any, z: any) => any >null : null >position : number ->0 : number +>0 : 0 return null; >null : null diff --git a/tests/baselines/reference/moduleMerge.types b/tests/baselines/reference/moduleMerge.types index 06d532673ed..99fe3c2a7c6 100644 --- a/tests/baselines/reference/moduleMerge.types +++ b/tests/baselines/reference/moduleMerge.types @@ -11,7 +11,7 @@ module A >Hello : () => string { return "from private B"; ->"from private B" : string +>"from private B" : "from private B" } } } @@ -26,7 +26,7 @@ module A >Hello : () => string { return "from export B"; ->"from export B" : string +>"from export B" : "from export B" } } } diff --git a/tests/baselines/reference/moduleNewExportBug.errors.txt b/tests/baselines/reference/moduleNewExportBug.errors.txt index 779d51e4699..35b8a269c02 100644 --- a/tests/baselines/reference/moduleNewExportBug.errors.txt +++ b/tests/baselines/reference/moduleNewExportBug.errors.txt @@ -1,4 +1,4 @@ -tests/cases/compiler/moduleNewExportBug.ts(10,14): error TS2305: Module 'mod1' has no exported member 'C'. +tests/cases/compiler/moduleNewExportBug.ts(10,14): error TS2694: Namespace 'mod1' has no exported member 'C'. ==== tests/cases/compiler/moduleNewExportBug.ts (1 errors) ==== @@ -13,7 +13,7 @@ tests/cases/compiler/moduleNewExportBug.ts(10,14): error TS2305: Module 'mod1' h var c : mod1.C; // ERROR: C should not be visible ~ -!!! error TS2305: Module 'mod1' has no exported member 'C'. +!!! error TS2694: Namespace 'mod1' has no exported member 'C'. \ No newline at end of file diff --git a/tests/baselines/reference/moduleNoEmit.types b/tests/baselines/reference/moduleNoEmit.types index 1097bea5a4c..da5f58fde37 100644 --- a/tests/baselines/reference/moduleNoEmit.types +++ b/tests/baselines/reference/moduleNoEmit.types @@ -4,6 +4,6 @@ module Foo { 1+1; >1+1 : number ->1 : number ->1 : number +>1 : 1 +>1 : 1 } diff --git a/tests/baselines/reference/modulePrologueAMD.types b/tests/baselines/reference/modulePrologueAMD.types index b57b5a8bf2f..f4c390ac060 100644 --- a/tests/baselines/reference/modulePrologueAMD.types +++ b/tests/baselines/reference/modulePrologueAMD.types @@ -1,6 +1,6 @@ === tests/cases/compiler/modulePrologueAMD.ts === "use strict"; ->"use strict" : string +>"use strict" : "use strict" export class Foo {} >Foo : Foo diff --git a/tests/baselines/reference/modulePrologueCommonjs.types b/tests/baselines/reference/modulePrologueCommonjs.types index 5d76532b3e4..0aeaef6c38e 100644 --- a/tests/baselines/reference/modulePrologueCommonjs.types +++ b/tests/baselines/reference/modulePrologueCommonjs.types @@ -1,6 +1,6 @@ === tests/cases/compiler/modulePrologueCommonjs.ts === "use strict"; ->"use strict" : string +>"use strict" : "use strict" export class Foo {} >Foo : Foo diff --git a/tests/baselines/reference/modulePrologueES6.types b/tests/baselines/reference/modulePrologueES6.types index 5f09a60ac6a..4b6a74608cb 100644 --- a/tests/baselines/reference/modulePrologueES6.types +++ b/tests/baselines/reference/modulePrologueES6.types @@ -1,6 +1,6 @@ === tests/cases/compiler/modulePrologueES6.ts === "use strict"; ->"use strict" : string +>"use strict" : "use strict" export class Foo {} >Foo : Foo diff --git a/tests/baselines/reference/modulePrologueSystem.types b/tests/baselines/reference/modulePrologueSystem.types index ac0d52e4a2b..f54048b79a4 100644 --- a/tests/baselines/reference/modulePrologueSystem.types +++ b/tests/baselines/reference/modulePrologueSystem.types @@ -1,6 +1,6 @@ === tests/cases/compiler/modulePrologueSystem.ts === "use strict"; ->"use strict" : string +>"use strict" : "use strict" export class Foo {} >Foo : Foo diff --git a/tests/baselines/reference/modulePrologueUmd.types b/tests/baselines/reference/modulePrologueUmd.types index 2a1064da8e2..02f90df9704 100644 --- a/tests/baselines/reference/modulePrologueUmd.types +++ b/tests/baselines/reference/modulePrologueUmd.types @@ -1,6 +1,6 @@ === tests/cases/compiler/modulePrologueUmd.ts === "use strict"; ->"use strict" : string +>"use strict" : "use strict" export class Foo {} >Foo : Foo diff --git a/tests/baselines/reference/moduleResolutionNoResolve.types b/tests/baselines/reference/moduleResolutionNoResolve.types index 3e96ed2b197..dbec43bf1a2 100644 --- a/tests/baselines/reference/moduleResolutionNoResolve.types +++ b/tests/baselines/reference/moduleResolutionNoResolve.types @@ -6,5 +6,5 @@ import a = require('./b'); === tests/cases/compiler/b.ts === export var c = ''; >c : string ->'' : string +>'' : "" diff --git a/tests/baselines/reference/moduleResolutionWithExtensions.types b/tests/baselines/reference/moduleResolutionWithExtensions.types index f59eda1a81e..60196f2b25d 100644 --- a/tests/baselines/reference/moduleResolutionWithExtensions.types +++ b/tests/baselines/reference/moduleResolutionWithExtensions.types @@ -5,12 +5,12 @@ No type information for this code. No type information for this code.// No extension: '.ts' added No type information for this code.=== /src/b.ts === import a from './a'; ->a : number +>a : 0 // '.js' extension: stripped and replaced with '.ts' === /src/d.ts === import a from './a.js'; ->a : number +>a : 0 === /src/jquery.d.ts === declare var x: number; diff --git a/tests/baselines/reference/moduleSameValueDuplicateExportedBindings1.types b/tests/baselines/reference/moduleSameValueDuplicateExportedBindings1.types index 57be71c802b..bfeb5a14c94 100644 --- a/tests/baselines/reference/moduleSameValueDuplicateExportedBindings1.types +++ b/tests/baselines/reference/moduleSameValueDuplicateExportedBindings1.types @@ -8,5 +8,5 @@ No type information for this code. No type information for this code.=== tests/cases/compiler/c.ts === export var foo = 42; >foo : number ->42 : number +>42 : 42 diff --git a/tests/baselines/reference/moduleSameValueDuplicateExportedBindings2.types b/tests/baselines/reference/moduleSameValueDuplicateExportedBindings2.types index 600b0d946c6..1e1f0be5101 100644 --- a/tests/baselines/reference/moduleSameValueDuplicateExportedBindings2.types +++ b/tests/baselines/reference/moduleSameValueDuplicateExportedBindings2.types @@ -11,9 +11,9 @@ export enum Animals { >Animals : Animals Cat, ->Cat : Animals +>Cat : Animals.Cat Dog ->Dog : Animals +>Dog : Animals.Dog }; diff --git a/tests/baselines/reference/moduleScoping.types b/tests/baselines/reference/moduleScoping.types index b2ee83dc69b..7ae2c0a2abf 100644 --- a/tests/baselines/reference/moduleScoping.types +++ b/tests/baselines/reference/moduleScoping.types @@ -1,29 +1,29 @@ === tests/cases/conformance/externalModules/file1.ts === var v1 = "sausages"; // Global scope >v1 : string ->"sausages" : string +>"sausages" : "sausages" === tests/cases/conformance/externalModules/file2.ts === var v2 = 42; // Global scope >v2 : number ->42 : number +>42 : 42 var v4 = () => 5; >v4 : () => number >() => 5 : () => number ->5 : number +>5 : 5 === tests/cases/conformance/externalModules/file3.ts === export var v3 = true; >v3 : boolean ->true : boolean +>true : true var v2 = [1,2,3]; // Module scope. Should not appear in global scope >v2 : number[] >[1,2,3] : number[] ->1 : number ->2 : number ->3 : number +>1 : 1 +>2 : 2 +>3 : 3 === tests/cases/conformance/externalModules/file4.ts === import file3 = require('./file3'); @@ -47,7 +47,7 @@ var v4 = {a: true, b: NaN}; // Should shadow global v2 in this module >v4 : { a: boolean; b: number; } >{a: true, b: NaN} : { a: boolean; b: number; } >a : boolean ->true : boolean +>true : true >b : number >NaN : number diff --git a/tests/baselines/reference/moduleSharesNameWithImportDeclarationInsideIt.types b/tests/baselines/reference/moduleSharesNameWithImportDeclarationInsideIt.types index b473adf2aa4..865546d12fa 100644 --- a/tests/baselines/reference/moduleSharesNameWithImportDeclarationInsideIt.types +++ b/tests/baselines/reference/moduleSharesNameWithImportDeclarationInsideIt.types @@ -7,7 +7,7 @@ module Z.M { >bar : () => string return ""; ->"" : string +>"" : "" } } module A.M { diff --git a/tests/baselines/reference/moduleSharesNameWithImportDeclarationInsideIt2.types b/tests/baselines/reference/moduleSharesNameWithImportDeclarationInsideIt2.types index 56160637e0f..b2a3198eab8 100644 --- a/tests/baselines/reference/moduleSharesNameWithImportDeclarationInsideIt2.types +++ b/tests/baselines/reference/moduleSharesNameWithImportDeclarationInsideIt2.types @@ -7,7 +7,7 @@ module Z.M { >bar : () => string return ""; ->"" : string +>"" : "" } } module A.M { diff --git a/tests/baselines/reference/moduleSharesNameWithImportDeclarationInsideIt4.types b/tests/baselines/reference/moduleSharesNameWithImportDeclarationInsideIt4.types index b8574a2c71f..02f47ec112b 100644 --- a/tests/baselines/reference/moduleSharesNameWithImportDeclarationInsideIt4.types +++ b/tests/baselines/reference/moduleSharesNameWithImportDeclarationInsideIt4.types @@ -7,7 +7,7 @@ module Z.M { >bar : () => string return ""; ->"" : string +>"" : "" } } module A.M { diff --git a/tests/baselines/reference/moduleSharesNameWithImportDeclarationInsideIt6.types b/tests/baselines/reference/moduleSharesNameWithImportDeclarationInsideIt6.types index 65f820e0606..32e5cbd850e 100644 --- a/tests/baselines/reference/moduleSharesNameWithImportDeclarationInsideIt6.types +++ b/tests/baselines/reference/moduleSharesNameWithImportDeclarationInsideIt6.types @@ -7,7 +7,7 @@ module Z.M { >bar : () => string return ""; ->"" : string +>"" : "" } } module A.M { diff --git a/tests/baselines/reference/moduleUnassignedVariable.types b/tests/baselines/reference/moduleUnassignedVariable.types index 3e5ab538ad5..cfc3cb0b3d2 100644 --- a/tests/baselines/reference/moduleUnassignedVariable.types +++ b/tests/baselines/reference/moduleUnassignedVariable.types @@ -4,7 +4,7 @@ module Bar { export var a = 1; >a : number ->1 : number +>1 : 1 function fooA() { return a; } // Correct: return Bar.a >fooA : () => number diff --git a/tests/baselines/reference/moduleVariableArrayIndexer.types b/tests/baselines/reference/moduleVariableArrayIndexer.types index 4c8e73b9478..aa31ab27c6a 100644 --- a/tests/baselines/reference/moduleVariableArrayIndexer.types +++ b/tests/baselines/reference/moduleVariableArrayIndexer.types @@ -4,7 +4,7 @@ module Bar { export var a = 1; >a : number ->1 : number +>1 : 1 var t = undefined[a][a]; // CG: var t = undefined[Bar.a][a]; >t : any diff --git a/tests/baselines/reference/moduleVariables.types b/tests/baselines/reference/moduleVariables.types index 5bdf8490aed..71cd74bd078 100644 --- a/tests/baselines/reference/moduleVariables.types +++ b/tests/baselines/reference/moduleVariables.types @@ -4,14 +4,14 @@ declare var console: any; var x = 1; >x : number ->1 : number +>1 : 1 module M { >M : typeof M export var x = 2; >x : number ->2 : number +>2 : 2 console.log(x); // 2 >console.log(x) : any @@ -37,7 +37,7 @@ module M { var x = 3; >x : number ->3 : number +>3 : 3 console.log(x); // 3 >console.log(x) : any diff --git a/tests/baselines/reference/moduleVisibilityTest1.types b/tests/baselines/reference/moduleVisibilityTest1.types index b54f897d014..c8b7a1a8e31 100644 --- a/tests/baselines/reference/moduleVisibilityTest1.types +++ b/tests/baselines/reference/moduleVisibilityTest1.types @@ -6,15 +6,15 @@ module OuterMod { export function someExportedOuterFunc() { return -1; } >someExportedOuterFunc : () => number ->-1 : number ->1 : number +>-1 : -1 +>1 : 1 export module OuterInnerMod { >OuterInnerMod : typeof OuterInnerMod export function someExportedOuterInnerFunc() { return "foo"; } >someExportedOuterInnerFunc : () => string ->"foo" : string +>"foo" : "foo" } } @@ -31,26 +31,26 @@ module M { export function someExportedInnerFunc() { return -2; } >someExportedInnerFunc : () => number ->-2 : number ->2 : number +>-2 : -2 +>2 : 2 } export enum E { >E : E A, ->A : E +>A : E.A B, ->B : E +>B : E.B C, ->C : E +>C : E.C } export var x = 5; >x : number ->5 : number +>5 : 5 export declare var exported_var; >exported_var : any @@ -72,7 +72,7 @@ module M { class B {public b = 0;} >B : B >b : number ->0 : number +>0 : 0 export class C implements I { >C : C @@ -101,30 +101,30 @@ module M { public someMethod() { return 0; } >someMethod : () => number ->0 : number +>0 : 0 public someProp = 1; >someProp : number ->1 : number +>1 : 1 constructor() { function someInnerFunc() { return 2; } >someInnerFunc : () => number ->2 : number +>2 : 2 var someInnerVar = 3; >someInnerVar : number ->3 : number +>3 : 3 } } var someModuleVar = 4; >someModuleVar : number ->4 : number +>4 : 4 function someModuleFunction() { return 5;} >someModuleFunction : () => number ->5 : number +>5 : 5 } module M { @@ -136,11 +136,11 @@ module M { export var meb = M.E.B; >meb : E ->M.E.B : E +>M.E.B : E.B >M.E : typeof E >M : typeof M >E : typeof E ->B : E +>B : E.B } var cprime : M.I = null; @@ -167,11 +167,11 @@ var z = M.x; var alpha = M.E.A; >alpha : M.E ->M.E.A : M.E +>M.E.A : M.E.A >M.E : typeof M.E >M : typeof M >E : typeof M.E ->A : M.E +>A : M.E.A var omega = M.exported_var; >omega : any diff --git a/tests/baselines/reference/moduleVisibilityTest2.errors.txt b/tests/baselines/reference/moduleVisibilityTest2.errors.txt index 9ff92604392..d7b991f9f62 100644 --- a/tests/baselines/reference/moduleVisibilityTest2.errors.txt +++ b/tests/baselines/reference/moduleVisibilityTest2.errors.txt @@ -1,7 +1,7 @@ tests/cases/compiler/moduleVisibilityTest2.ts(57,17): error TS2304: Cannot find name 'x'. tests/cases/compiler/moduleVisibilityTest2.ts(58,21): error TS2339: Property 'E' does not exist on type 'typeof M'. -tests/cases/compiler/moduleVisibilityTest2.ts(61,16): error TS2305: Module 'M' has no exported member 'I'. -tests/cases/compiler/moduleVisibilityTest2.ts(61,23): error TS2305: Module 'M' has no exported member 'I'. +tests/cases/compiler/moduleVisibilityTest2.ts(61,16): error TS2694: Namespace 'M' has no exported member 'I'. +tests/cases/compiler/moduleVisibilityTest2.ts(61,23): error TS2694: Namespace 'M' has no exported member 'I'. tests/cases/compiler/moduleVisibilityTest2.ts(64,11): error TS2339: Property 'x' does not exist on type 'typeof M'. tests/cases/compiler/moduleVisibilityTest2.ts(65,15): error TS2339: Property 'E' does not exist on type 'typeof M'. @@ -73,9 +73,9 @@ tests/cases/compiler/moduleVisibilityTest2.ts(65,15): error TS2339: Property 'E' var cprime : M.I = null; ~ -!!! error TS2305: Module 'M' has no exported member 'I'. +!!! error TS2694: Namespace 'M' has no exported member 'I'. ~ -!!! error TS2305: Module 'M' has no exported member 'I'. +!!! error TS2694: Namespace 'M' has no exported member 'I'. var c = new M.C(); var z = M.x; diff --git a/tests/baselines/reference/moduleVisibilityTest3.errors.txt b/tests/baselines/reference/moduleVisibilityTest3.errors.txt index 0ad8a789a8f..dfecadec23e 100644 --- a/tests/baselines/reference/moduleVisibilityTest3.errors.txt +++ b/tests/baselines/reference/moduleVisibilityTest3.errors.txt @@ -1,6 +1,6 @@ tests/cases/compiler/moduleVisibilityTest3.ts(20,22): error TS2304: Cannot find name 'modes'. -tests/cases/compiler/moduleVisibilityTest3.ts(20,39): error TS2305: Module '_modes' has no exported member 'Mode'. -tests/cases/compiler/moduleVisibilityTest3.ts(21,22): error TS2305: Module '_modes' has no exported member 'Mode'. +tests/cases/compiler/moduleVisibilityTest3.ts(20,39): error TS2694: Namespace '_modes' has no exported member 'Mode'. +tests/cases/compiler/moduleVisibilityTest3.ts(21,22): error TS2694: Namespace '_modes' has no exported member 'Mode'. ==== tests/cases/compiler/moduleVisibilityTest3.ts (3 errors) ==== @@ -27,10 +27,10 @@ tests/cases/compiler/moduleVisibilityTest3.ts(21,22): error TS2305: Module '_mod ~~~~~ !!! error TS2304: Cannot find name 'modes'. ~~~~ -!!! error TS2305: Module '_modes' has no exported member 'Mode'. +!!! error TS2694: Namespace '_modes' has no exported member 'Mode'. var x:modes.Mode; ~~~~ -!!! error TS2305: Module '_modes' has no exported member 'Mode'. +!!! error TS2694: Namespace '_modes' has no exported member 'Mode'. } } diff --git a/tests/baselines/reference/moduleWithStatementsOfEveryKind.types b/tests/baselines/reference/moduleWithStatementsOfEveryKind.types index c6f4be850be..6f2d5243704 100644 --- a/tests/baselines/reference/moduleWithStatementsOfEveryKind.types +++ b/tests/baselines/reference/moduleWithStatementsOfEveryKind.types @@ -40,19 +40,19 @@ module A { } enum Color { Blue, Red } >Color : Color ->Blue : Color ->Red : Color +>Blue : Color.Blue +>Red : Color.Red var x = 12; >x : number ->12 : number +>12 : 12 function F(s: string): number { >F : (s: string) => number >s : string return 2; ->2 : number +>2 : 2 } var array: I[] = null; >array : I[] @@ -66,18 +66,18 @@ module A { return 'hello ' + s; >'hello ' + s : string ->'hello ' : string +>'hello ' : "hello " >s : string } var ol = { s: 'hello', id: 2, isvalid: true }; >ol : { s: string; id: number; isvalid: boolean; } >{ s: 'hello', id: 2, isvalid: true } : { s: string; id: number; isvalid: boolean; } >s : string ->'hello' : string +>'hello' : "hello" >id : number ->2 : number +>2 : 2 >isvalid : boolean ->true : boolean +>true : true declare class DC { >DC : DC @@ -128,19 +128,19 @@ module Y { } export enum Color { Blue, Red } >Color : Color ->Blue : Color ->Red : Color +>Blue : Color.Blue +>Red : Color.Red export var x = 12; >x : number ->12 : number +>12 : 12 export function F(s: string): number { >F : (s: string) => number >s : string return 2; ->2 : number +>2 : 2 } export var array: I[] = null; >array : I[] @@ -154,18 +154,18 @@ module Y { return 'hello ' + s; >'hello ' + s : string ->'hello ' : string +>'hello ' : "hello " >s : string } export var ol = { s: 'hello', id: 2, isvalid: true }; >ol : { s: string; id: number; isvalid: boolean; } >{ s: 'hello', id: 2, isvalid: true } : { s: string; id: number; isvalid: boolean; } >s : string ->'hello' : string +>'hello' : "hello" >id : number ->2 : number +>2 : 2 >isvalid : boolean ->true : boolean +>true : true export declare class DC { >DC : DC diff --git a/tests/baselines/reference/module_augmentUninstantiatedModule.symbols b/tests/baselines/reference/module_augmentUninstantiatedModule.symbols index d405f9549ea..4ea073b0254 100644 --- a/tests/baselines/reference/module_augmentUninstantiatedModule.symbols +++ b/tests/baselines/reference/module_augmentUninstantiatedModule.symbols @@ -1,10 +1,10 @@ === tests/cases/compiler/module_augmentUninstantiatedModule.ts === declare module "foo" { namespace M {} ->M : Symbol(, Decl(module_augmentUninstantiatedModule.ts, 0, 22), Decl(module_augmentUninstantiatedModule.ts, 2, 6), Decl(module_augmentUninstantiatedModule.ts, 6, 22)) +>M : Symbol(M, Decl(module_augmentUninstantiatedModule.ts, 0, 22), Decl(module_augmentUninstantiatedModule.ts, 2, 6), Decl(module_augmentUninstantiatedModule.ts, 6, 22)) var M; ->M : Symbol(, Decl(module_augmentUninstantiatedModule.ts, 0, 22), Decl(module_augmentUninstantiatedModule.ts, 2, 6), Decl(module_augmentUninstantiatedModule.ts, 6, 22)) +>M : Symbol(M, Decl(module_augmentUninstantiatedModule.ts, 0, 22), Decl(module_augmentUninstantiatedModule.ts, 2, 6), Decl(module_augmentUninstantiatedModule.ts, 6, 22)) export = M; >M : Symbol(M, Decl(module_augmentUninstantiatedModule.ts, 0, 22), Decl(module_augmentUninstantiatedModule.ts, 2, 6)) diff --git a/tests/baselines/reference/moduledecl.types b/tests/baselines/reference/moduledecl.types index 0c117fb5184..e6382861972 100644 --- a/tests/baselines/reference/moduledecl.types +++ b/tests/baselines/reference/moduledecl.types @@ -156,7 +156,7 @@ module m1 { >d : () => string return "Hello"; ->"Hello" : string +>"Hello" : "Hello" } public e: { x: number; y: string; }; @@ -220,7 +220,7 @@ module m { var a = 10; >a : number ->10 : number +>10 : 10 export var b: number; >b : number @@ -270,7 +270,7 @@ module m13 { >f : () => number return 20; ->20 : number +>20 : 20 } } } @@ -318,14 +318,14 @@ module exportTests { >f2 : () => number return 30; ->30 : number +>30 : 30 } public f3() { >f3 : () => string return "string"; ->"string" : string +>"string" : "string" } } class C2_private { @@ -335,14 +335,14 @@ module exportTests { >f2 : () => number return 30; ->30 : number +>30 : 30 } public f3() { >f3 : () => string return "string"; ->"string" : string +>"string" : "string" } } diff --git a/tests/baselines/reference/multiModuleClodule1.types b/tests/baselines/reference/multiModuleClodule1.types index b958d18f984..86749bd1935 100644 --- a/tests/baselines/reference/multiModuleClodule1.types +++ b/tests/baselines/reference/multiModuleClodule1.types @@ -20,11 +20,11 @@ module C { export var x = 1; >x : number ->1 : number +>1 : 1 var y = 2; >y : number ->2 : number +>2 : 2 } module C { >C : typeof C @@ -34,7 +34,7 @@ module C { function baz() { return ''; } >baz : () => string ->'' : string +>'' : "" } var c = new C(C.x); diff --git a/tests/baselines/reference/multiModuleFundule1.types b/tests/baselines/reference/multiModuleFundule1.types index 7eed100c199..aed6f825a7c 100644 --- a/tests/baselines/reference/multiModuleFundule1.types +++ b/tests/baselines/reference/multiModuleFundule1.types @@ -8,7 +8,7 @@ module C { export var x = 1; >x : number ->1 : number +>1 : 1 } module C { >C : typeof C @@ -21,13 +21,13 @@ var r = C(2); >r : void >C(2) : void >C : typeof C ->2 : number +>2 : 2 var r2 = new C(2); // using void returning function as constructor >r2 : any >new C(2) : any >C : typeof C ->2 : number +>2 : 2 var r3 = C.foo(); >r3 : void diff --git a/tests/baselines/reference/multipleDeclarations.types b/tests/baselines/reference/multipleDeclarations.types index 900d03195d4..195bdc2ad0d 100644 --- a/tests/baselines/reference/multipleDeclarations.types +++ b/tests/baselines/reference/multipleDeclarations.types @@ -42,11 +42,11 @@ class X { >this : this this.mistake = 'frankly, complete nonsense'; ->this.mistake = 'frankly, complete nonsense' : string +>this.mistake = 'frankly, complete nonsense' : "frankly, complete nonsense" >this.mistake : () => void >this : this >mistake : () => void ->'frankly, complete nonsense' : string +>'frankly, complete nonsense' : "frankly, complete nonsense" } m() { >m : () => void @@ -61,13 +61,13 @@ let x = new X(); >X : typeof X X.prototype.mistake = false; ->X.prototype.mistake = false : boolean +>X.prototype.mistake = false : false >X.prototype.mistake : () => void >X.prototype : X >X : typeof X >prototype : X >mistake : () => void ->false : boolean +>false : false x.m(); >x.m() : void @@ -104,21 +104,21 @@ class Y { >this : this this.mistake = 'even more nonsense'; ->this.mistake = 'even more nonsense' : string +>this.mistake = 'even more nonsense' : "even more nonsense" >this.mistake : any >this : this >mistake : any ->'even more nonsense' : string +>'even more nonsense' : "even more nonsense" } } Y.prototype.mistake = true; ->Y.prototype.mistake = true : boolean +>Y.prototype.mistake = true : true >Y.prototype.mistake : any >Y.prototype : Y >Y : typeof Y >prototype : Y >mistake : any ->true : boolean +>true : true let y = new Y(); >y : Y diff --git a/tests/baselines/reference/nameCollision.types b/tests/baselines/reference/nameCollision.types index e8badb7ab92..cfb56fb61e9 100644 --- a/tests/baselines/reference/nameCollision.types +++ b/tests/baselines/reference/nameCollision.types @@ -6,11 +6,11 @@ module A { // in the generated function call. var A = 12; >A : number ->12 : number +>12 : 12 var _A = ''; >_A : string ->'' : string +>'' : "" } module B { @@ -18,7 +18,7 @@ module B { var A = 12; >A : number ->12 : number +>12 : 12 } module B { @@ -39,29 +39,29 @@ module X { var X = 13; >X : number ->13 : number +>13 : 13 export module Y { >Y : typeof X.Y var Y = 13; >Y : number ->13 : number +>13 : 13 export module Z { >Z : typeof X.Y.Z var X = 12; >X : number ->12 : number +>12 : 12 var Y = 12; >Y : number ->12 : number +>12 : 12 var Z = 12; >Z : number ->12 : number +>12 : 12 } } } @@ -74,8 +74,8 @@ module Y.Y { >Y : Y Red, Blue ->Red : Y ->Blue : Y +>Red : Y.Red +>Blue : Y.Blue } } @@ -93,5 +93,5 @@ module D { export var E = 'hello'; >E : string ->'hello' : string +>'hello' : "hello" } diff --git a/tests/baselines/reference/nameCollisionWithBlockScopedVariable1.types b/tests/baselines/reference/nameCollisionWithBlockScopedVariable1.types index 7a3c07af187..43b91520db3 100644 --- a/tests/baselines/reference/nameCollisionWithBlockScopedVariable1.types +++ b/tests/baselines/reference/nameCollisionWithBlockScopedVariable1.types @@ -10,7 +10,7 @@ module M { { let M = 0; >M : number ->0 : number +>0 : 0 new C(); >new C() : C diff --git a/tests/baselines/reference/nameCollisionsInPropertyAssignments.types b/tests/baselines/reference/nameCollisionsInPropertyAssignments.types index bffe75896c4..d1064ea3abb 100644 --- a/tests/baselines/reference/nameCollisionsInPropertyAssignments.types +++ b/tests/baselines/reference/nameCollisionsInPropertyAssignments.types @@ -1,7 +1,7 @@ === tests/cases/compiler/nameCollisionsInPropertyAssignments.ts === var x = 1 >x : number ->1 : number +>1 : 1 var y = { x() { x++; } }; >y : { x(): void; } diff --git a/tests/baselines/reference/nameDelimitedBySlashes.types b/tests/baselines/reference/nameDelimitedBySlashes.types index 4987a52196f..03f4437ff67 100644 --- a/tests/baselines/reference/nameDelimitedBySlashes.types +++ b/tests/baselines/reference/nameDelimitedBySlashes.types @@ -8,10 +8,10 @@ var x = foo.foo + 42; >foo.foo : number >foo : typeof foo >foo : number ->42 : number +>42 : 42 === tests/cases/conformance/externalModules/test/foo_0.ts === export var foo = 42; >foo : number ->42 : number +>42 : 42 diff --git a/tests/baselines/reference/nameWithFileExtension.types b/tests/baselines/reference/nameWithFileExtension.types index a0fca3d4562..3f3e96eae1c 100644 --- a/tests/baselines/reference/nameWithFileExtension.types +++ b/tests/baselines/reference/nameWithFileExtension.types @@ -8,10 +8,10 @@ var x = foo.foo + 42; >foo.foo : number >foo : typeof foo >foo : number ->42 : number +>42 : 42 === tests/cases/conformance/externalModules/foo_0.ts === export var foo = 42; >foo : number ->42 : number +>42 : 42 diff --git a/tests/baselines/reference/nameWithRelativePaths.types b/tests/baselines/reference/nameWithRelativePaths.types index ea552cfa531..e27170e82f9 100644 --- a/tests/baselines/reference/nameWithRelativePaths.types +++ b/tests/baselines/reference/nameWithRelativePaths.types @@ -30,14 +30,14 @@ if(foo2.M2.x){ === tests/cases/conformance/externalModules/foo_0.ts === export var foo = 42; >foo : number ->42 : number +>42 : 42 === tests/cases/conformance/externalModules/test/test/foo_1.ts === export function f(){ >f : () => number return 42; ->42 : number +>42 : 42 } === tests/cases/conformance/externalModules/test/foo_2.ts === @@ -46,6 +46,6 @@ export module M2 { export var x = true; >x : boolean ->true : boolean +>true : true } diff --git a/tests/baselines/reference/namedFunctionExpressionInModule.types b/tests/baselines/reference/namedFunctionExpressionInModule.types index 8202cfbaf1b..2a361de76fb 100644 --- a/tests/baselines/reference/namedFunctionExpressionInModule.types +++ b/tests/baselines/reference/namedFunctionExpressionInModule.types @@ -13,8 +13,8 @@ module Variables{ x(1, 2, 3); >x(1, 2, 3) : void >x : (a: any, b: any, c: any) => void ->1 : number ->2 : number ->3 : number +>1 : 1 +>2 : 2 +>3 : 3 } diff --git a/tests/baselines/reference/namespacesDeclaration1.js b/tests/baselines/reference/namespacesDeclaration1.js new file mode 100644 index 00000000000..b722dc1fc00 --- /dev/null +++ b/tests/baselines/reference/namespacesDeclaration1.js @@ -0,0 +1,22 @@ +//// [namespacesDeclaration1.ts] + +module M { + export namespace N { + export module M2 { + export interface I {} + } + } +} + +//// [namespacesDeclaration1.js] + + +//// [namespacesDeclaration1.d.ts] +declare module M { + namespace N { + module M2 { + interface I { + } + } + } +} diff --git a/tests/baselines/reference/namespacesDeclaration1.symbols b/tests/baselines/reference/namespacesDeclaration1.symbols new file mode 100644 index 00000000000..512bc9757aa --- /dev/null +++ b/tests/baselines/reference/namespacesDeclaration1.symbols @@ -0,0 +1,16 @@ +=== tests/cases/compiler/namespacesDeclaration1.ts === + +module M { +>M : Symbol(M, Decl(namespacesDeclaration1.ts, 0, 0)) + + export namespace N { +>N : Symbol(N, Decl(namespacesDeclaration1.ts, 1, 10)) + + export module M2 { +>M2 : Symbol(M2, Decl(namespacesDeclaration1.ts, 2, 23)) + + export interface I {} +>I : Symbol(I, Decl(namespacesDeclaration1.ts, 3, 24)) + } + } +} diff --git a/tests/baselines/reference/namespacesDeclaration1.types b/tests/baselines/reference/namespacesDeclaration1.types new file mode 100644 index 00000000000..e99f5d0e6c3 --- /dev/null +++ b/tests/baselines/reference/namespacesDeclaration1.types @@ -0,0 +1,16 @@ +=== tests/cases/compiler/namespacesDeclaration1.ts === + +module M { +>M : any + + export namespace N { +>N : any + + export module M2 { +>M2 : any + + export interface I {} +>I : I + } + } +} diff --git a/tests/baselines/reference/namespacesDeclaration2.errors.txt b/tests/baselines/reference/namespacesDeclaration2.errors.txt new file mode 100644 index 00000000000..50c64b7d83a --- /dev/null +++ b/tests/baselines/reference/namespacesDeclaration2.errors.txt @@ -0,0 +1,27 @@ +tests/cases/compiler/namespacesDeclaration2.ts(13,13): error TS2694: Namespace 'N' has no exported member 'S'. +tests/cases/compiler/namespacesDeclaration2.ts(14,12): error TS2694: Namespace 'M' has no exported member 'F'. +tests/cases/compiler/namespacesDeclaration2.ts(15,11): error TS2694: Namespace 'ns' has no exported member 'A'. + + +==== tests/cases/compiler/namespacesDeclaration2.ts (3 errors) ==== + + namespace N { + function S() {} + } + module M { + function F() {} + } + + declare namespace ns { + let f: number; + } + + var foge: N.S; + ~ +!!! error TS2694: Namespace 'N' has no exported member 'S'. + var foo: M.F; + ~ +!!! error TS2694: Namespace 'M' has no exported member 'F'. + let x: ns.A; + ~ +!!! error TS2694: Namespace 'ns' has no exported member 'A'. \ No newline at end of file diff --git a/tests/baselines/reference/namespacesDeclaration2.js b/tests/baselines/reference/namespacesDeclaration2.js new file mode 100644 index 00000000000..d680e781145 --- /dev/null +++ b/tests/baselines/reference/namespacesDeclaration2.js @@ -0,0 +1,42 @@ +//// [namespacesDeclaration2.ts] + +namespace N { + function S() {} +} +module M { + function F() {} +} + +declare namespace ns { + let f: number; +} + +var foge: N.S; +var foo: M.F; +let x: ns.A; + +//// [namespacesDeclaration2.js] +var N; +(function (N) { + function S() { } +})(N || (N = {})); +var M; +(function (M) { + function F() { } +})(M || (M = {})); +var foge; +var foo; +var x; + + +//// [namespacesDeclaration2.d.ts] +declare namespace N { +} +declare module M { +} +declare namespace ns { + let f: number; +} +declare var foge: N.S; +declare var foo: M.F; +declare let x: ns.A; diff --git a/tests/baselines/reference/narrowFromAnyWithTypePredicate.errors.txt b/tests/baselines/reference/narrowFromAnyWithTypePredicate.errors.txt index 94f41becdad..c06c8a98801 100644 --- a/tests/baselines/reference/narrowFromAnyWithTypePredicate.errors.txt +++ b/tests/baselines/reference/narrowFromAnyWithTypePredicate.errors.txt @@ -1,5 +1,5 @@ tests/cases/conformance/types/any/narrowFromAnyWithTypePredicate.ts(22,7): error TS2339: Property 'method' does not exist on type '{}'. -tests/cases/conformance/types/any/narrowFromAnyWithTypePredicate.ts(23,5): error TS2349: Cannot invoke an expression whose type lacks a call signature. +tests/cases/conformance/types/any/narrowFromAnyWithTypePredicate.ts(23,5): error TS2349: Cannot invoke an expression whose type lacks a call signature. Type '{}' has no compatible call signatures. tests/cases/conformance/types/any/narrowFromAnyWithTypePredicate.ts(28,7): error TS2339: Property 'mesage' does not exist on type 'Error'. tests/cases/conformance/types/any/narrowFromAnyWithTypePredicate.ts(33,7): error TS2339: Property 'getHuors' does not exist on type 'Date'. @@ -31,7 +31,7 @@ tests/cases/conformance/types/any/narrowFromAnyWithTypePredicate.ts(33,7): error !!! error TS2339: Property 'method' does not exist on type '{}'. x(); ~~~ -!!! error TS2349: Cannot invoke an expression whose type lacks a call signature. +!!! error TS2349: Cannot invoke an expression whose type lacks a call signature. Type '{}' has no compatible call signatures. } if (isError(x)) { diff --git a/tests/baselines/reference/narrowingByDiscriminantInLoop.types b/tests/baselines/reference/narrowingByDiscriminantInLoop.types index 50f322636cc..c0f6fe73bca 100644 --- a/tests/baselines/reference/narrowingByDiscriminantInLoop.types +++ b/tests/baselines/reference/narrowingByDiscriminantInLoop.types @@ -185,7 +185,7 @@ function f1(x: A | B) { >B : B while (true) { ->true : boolean +>true : true x.prop; >x.prop : { a: string; } | { b: string; } @@ -230,7 +230,7 @@ function f2(x: A | B) { >B : B while (true) { ->true : boolean +>true : true if (x.kind) { >x.kind : boolean diff --git a/tests/baselines/reference/narrowingConstrainedTypeParameter.js b/tests/baselines/reference/narrowingConstrainedTypeParameter.js new file mode 100644 index 00000000000..3107585d941 --- /dev/null +++ b/tests/baselines/reference/narrowingConstrainedTypeParameter.js @@ -0,0 +1,32 @@ +//// [narrowingConstrainedTypeParameter.ts] + +// Repro from #10811 + +interface Pet { + name: string; +} + +function isPet(pet: any): pet is Pet { + return typeof pet.name === "string"; +} + +export function speak(pet: TPet, voice: (pet: TPet) => string): string { + if (!isPet(pet)) { + throw new Error("Expected \"pet\" to be a Pet"); + } + return voice(pet); +} + +//// [narrowingConstrainedTypeParameter.js] +// Repro from #10811 +"use strict"; +function isPet(pet) { + return typeof pet.name === "string"; +} +function speak(pet, voice) { + if (!isPet(pet)) { + throw new Error("Expected \"pet\" to be a Pet"); + } + return voice(pet); +} +exports.speak = speak; diff --git a/tests/baselines/reference/narrowingConstrainedTypeParameter.symbols b/tests/baselines/reference/narrowingConstrainedTypeParameter.symbols new file mode 100644 index 00000000000..89ca39e98a2 --- /dev/null +++ b/tests/baselines/reference/narrowingConstrainedTypeParameter.symbols @@ -0,0 +1,42 @@ +=== tests/cases/compiler/narrowingConstrainedTypeParameter.ts === + +// Repro from #10811 + +interface Pet { +>Pet : Symbol(Pet, Decl(narrowingConstrainedTypeParameter.ts, 0, 0)) + + name: string; +>name : Symbol(Pet.name, Decl(narrowingConstrainedTypeParameter.ts, 3, 15)) +} + +function isPet(pet: any): pet is Pet { +>isPet : Symbol(isPet, Decl(narrowingConstrainedTypeParameter.ts, 5, 1)) +>pet : Symbol(pet, Decl(narrowingConstrainedTypeParameter.ts, 7, 15)) +>pet : Symbol(pet, Decl(narrowingConstrainedTypeParameter.ts, 7, 15)) +>Pet : Symbol(Pet, Decl(narrowingConstrainedTypeParameter.ts, 0, 0)) + + return typeof pet.name === "string"; +>pet : Symbol(pet, Decl(narrowingConstrainedTypeParameter.ts, 7, 15)) +} + +export function speak(pet: TPet, voice: (pet: TPet) => string): string { +>speak : Symbol(speak, Decl(narrowingConstrainedTypeParameter.ts, 9, 1)) +>TPet : Symbol(TPet, Decl(narrowingConstrainedTypeParameter.ts, 11, 22)) +>Pet : Symbol(Pet, Decl(narrowingConstrainedTypeParameter.ts, 0, 0)) +>pet : Symbol(pet, Decl(narrowingConstrainedTypeParameter.ts, 11, 40)) +>TPet : Symbol(TPet, Decl(narrowingConstrainedTypeParameter.ts, 11, 22)) +>voice : Symbol(voice, Decl(narrowingConstrainedTypeParameter.ts, 11, 50)) +>pet : Symbol(pet, Decl(narrowingConstrainedTypeParameter.ts, 11, 59)) +>TPet : Symbol(TPet, Decl(narrowingConstrainedTypeParameter.ts, 11, 22)) + + if (!isPet(pet)) { +>isPet : Symbol(isPet, Decl(narrowingConstrainedTypeParameter.ts, 5, 1)) +>pet : Symbol(pet, Decl(narrowingConstrainedTypeParameter.ts, 11, 40)) + + throw new Error("Expected \"pet\" to be a Pet"); +>Error : Symbol(Error, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) + } + return voice(pet); +>voice : Symbol(voice, Decl(narrowingConstrainedTypeParameter.ts, 11, 50)) +>pet : Symbol(pet, Decl(narrowingConstrainedTypeParameter.ts, 11, 40)) +} diff --git a/tests/baselines/reference/narrowingConstrainedTypeParameter.types b/tests/baselines/reference/narrowingConstrainedTypeParameter.types new file mode 100644 index 00000000000..942b9f7055d --- /dev/null +++ b/tests/baselines/reference/narrowingConstrainedTypeParameter.types @@ -0,0 +1,52 @@ +=== tests/cases/compiler/narrowingConstrainedTypeParameter.ts === + +// Repro from #10811 + +interface Pet { +>Pet : Pet + + name: string; +>name : string +} + +function isPet(pet: any): pet is Pet { +>isPet : (pet: any) => pet is Pet +>pet : any +>pet : any +>Pet : Pet + + return typeof pet.name === "string"; +>typeof pet.name === "string" : boolean +>typeof pet.name : string +>pet.name : any +>pet : any +>name : any +>"string" : "string" +} + +export function speak(pet: TPet, voice: (pet: TPet) => string): string { +>speak : (pet: TPet, voice: (pet: TPet) => string) => string +>TPet : TPet +>Pet : Pet +>pet : TPet +>TPet : TPet +>voice : (pet: TPet) => string +>pet : TPet +>TPet : TPet + + if (!isPet(pet)) { +>!isPet(pet) : boolean +>isPet(pet) : boolean +>isPet : (pet: any) => pet is Pet +>pet : TPet + + throw new Error("Expected \"pet\" to be a Pet"); +>new Error("Expected \"pet\" to be a Pet") : Error +>Error : ErrorConstructor +>"Expected \"pet\" to be a Pet" : "Expected \"pet\" to be a Pet" + } + return voice(pet); +>voice(pet) : string +>voice : (pet: TPet) => string +>pet : TPet +} diff --git a/tests/baselines/reference/narrowingOfDottedNames.types b/tests/baselines/reference/narrowingOfDottedNames.types index 697e080b661..c9c3392b0c3 100644 --- a/tests/baselines/reference/narrowingOfDottedNames.types +++ b/tests/baselines/reference/narrowingOfDottedNames.types @@ -48,7 +48,7 @@ function f1(x: A | B) { >B : B while (true) { ->true : boolean +>true : true if (x instanceof A) { >x instanceof A : boolean @@ -84,7 +84,7 @@ function f2(x: A | B) { >B : B while (true) { ->true : boolean +>true : true if (isA(x)) { >isA(x) : boolean diff --git a/tests/baselines/reference/negateOperatorWithAnyOtherType.errors.txt b/tests/baselines/reference/negateOperatorWithAnyOtherType.errors.txt new file mode 100644 index 00000000000..f008b4698ed --- /dev/null +++ b/tests/baselines/reference/negateOperatorWithAnyOtherType.errors.txt @@ -0,0 +1,59 @@ +tests/cases/conformance/expressions/unaryOperators/negateOperator/negateOperatorWithAnyOtherType.ts(51,1): error TS2695: Left side of comma operator is unused and has no side effects. + + +==== tests/cases/conformance/expressions/unaryOperators/negateOperator/negateOperatorWithAnyOtherType.ts (1 errors) ==== + // - operator on any type + + var ANY: any; + var ANY1; + var ANY2: any[] = ["", ""]; + var obj: () => {} + var obj1 = { x: "", y: () => { }}; + + function foo(): any { + var a; + return a; + } + class A { + public a: any; + static foo() { + var a; + return a; + } + } + module M { + export var n: any; + } + var objA = new A(); + + // any type var + var ResultIsNumber1 = -ANY1; + var ResultIsNumber2 = -ANY2; + var ResultIsNumber3 = -A; + var ResultIsNumber4 = -M; + var ResultIsNumber5 = -obj; + var ResultIsNumber6 = -obj1; + + // any type literal + var ResultIsNumber7 = -undefined; + var ResultIsNumber = -null; + + // any type expressions + var ResultIsNumber8 = -ANY2[0]; + var ResultIsNumber9 = -obj1.x; + var ResultIsNumber10 = -obj1.y; + var ResultIsNumber11 = -objA.a; + var ResultIsNumber12 = -M.n; + var ResultIsNumber13 = -foo(); + var ResultIsNumber14 = -A.foo(); + var ResultIsNumber15 = -(ANY - ANY1); + + // miss assignment operators + -ANY; + -ANY1; + -ANY2[0]; + -ANY, ANY1; + ~~~~ +!!! error TS2695: Left side of comma operator is unused and has no side effects. + -objA.a; + -M.n; \ No newline at end of file diff --git a/tests/baselines/reference/negateOperatorWithAnyOtherType.types b/tests/baselines/reference/negateOperatorWithAnyOtherType.types index f864c9d166c..75054b49573 100644 --- a/tests/baselines/reference/negateOperatorWithAnyOtherType.types +++ b/tests/baselines/reference/negateOperatorWithAnyOtherType.types @@ -10,8 +10,8 @@ var ANY1; var ANY2: any[] = ["", ""]; >ANY2 : any[] >["", ""] : string[] ->"" : string ->"" : string +>"" : "" +>"" : "" var obj: () => {} >obj : () => {} @@ -20,7 +20,7 @@ var obj1 = { x: "", y: () => { }}; >obj1 : { x: string; y: () => void; } >{ x: "", y: () => { }} : { x: string; y: () => void; } >x : string ->"" : string +>"" : "" >y : () => void >() => { } : () => void @@ -108,7 +108,7 @@ var ResultIsNumber8 = -ANY2[0]; >-ANY2[0] : number >ANY2[0] : any >ANY2 : any[] ->0 : number +>0 : 0 var ResultIsNumber9 = -obj1.x; >ResultIsNumber9 : number @@ -173,7 +173,7 @@ var ResultIsNumber15 = -(ANY - ANY1); >-ANY2[0] : number >ANY2[0] : any >ANY2 : any[] ->0 : number +>0 : 0 -ANY, ANY1; >-ANY, ANY1 : any diff --git a/tests/baselines/reference/negateOperatorWithBooleanType.errors.txt b/tests/baselines/reference/negateOperatorWithBooleanType.errors.txt new file mode 100644 index 00000000000..5abbf8b8679 --- /dev/null +++ b/tests/baselines/reference/negateOperatorWithBooleanType.errors.txt @@ -0,0 +1,41 @@ +tests/cases/conformance/expressions/unaryOperators/negateOperator/negateOperatorWithBooleanType.ts(33,1): error TS2695: Left side of comma operator is unused and has no side effects. + + +==== tests/cases/conformance/expressions/unaryOperators/negateOperator/negateOperatorWithBooleanType.ts (1 errors) ==== + // - operator on boolean type + var BOOLEAN: boolean; + + function foo(): boolean { return true; } + + class A { + public a: boolean; + static foo() { return false; } + } + module M { + export var n: boolean; + } + + var objA = new A(); + + // boolean type var + var ResultIsNumber1 = -BOOLEAN; + + // 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(); + + // miss assignment operators + -true; + -BOOLEAN; + -foo(); + -true, false; + ~~~~~ +!!! error TS2695: Left side of comma operator is unused and has no side effects. + -objA.a; + -M.n; \ No newline at end of file diff --git a/tests/baselines/reference/negateOperatorWithBooleanType.types b/tests/baselines/reference/negateOperatorWithBooleanType.types index 89f5afc1c2b..ca383455ec8 100644 --- a/tests/baselines/reference/negateOperatorWithBooleanType.types +++ b/tests/baselines/reference/negateOperatorWithBooleanType.types @@ -5,7 +5,7 @@ var BOOLEAN: boolean; function foo(): boolean { return true; } >foo : () => boolean ->true : boolean +>true : true class A { >A : A @@ -15,7 +15,7 @@ class A { static foo() { return false; } >foo : () => boolean ->false : boolean +>false : false } module M { >M : typeof M @@ -39,16 +39,16 @@ var ResultIsNumber1 = -BOOLEAN; var ResultIsNumber2 = -true; >ResultIsNumber2 : number >-true : number ->true : boolean +>true : true var ResultIsNumber3 = -{ x: true, y: false }; >ResultIsNumber3 : number >-{ x: true, y: false } : number >{ x: true, y: false } : { x: boolean; y: boolean; } >x : boolean ->true : boolean +>true : true >y : boolean ->false : boolean +>false : false // boolean type expressions var ResultIsNumber4 = -objA.a; @@ -82,7 +82,7 @@ var ResultIsNumber7 = -A.foo(); // miss assignment operators -true; >-true : number ->true : boolean +>true : true -BOOLEAN; >-BOOLEAN : number @@ -94,10 +94,10 @@ var ResultIsNumber7 = -A.foo(); >foo : () => boolean -true, false; ->-true, false : boolean +>-true, false : false >-true : number ->true : boolean ->false : boolean +>true : true +>false : false -objA.a; >-objA.a : number diff --git a/tests/baselines/reference/negateOperatorWithEnumType.errors.txt b/tests/baselines/reference/negateOperatorWithEnumType.errors.txt new file mode 100644 index 00000000000..4d4608d40a5 --- /dev/null +++ b/tests/baselines/reference/negateOperatorWithEnumType.errors.txt @@ -0,0 +1,23 @@ +tests/cases/conformance/expressions/unaryOperators/negateOperator/negateOperatorWithEnumType.ts(17,1): error TS2695: Left side of comma operator is unused and has no side effects. + + +==== tests/cases/conformance/expressions/unaryOperators/negateOperator/negateOperatorWithEnumType.ts (1 errors) ==== + // - operator on enum type + + enum ENUM { }; + enum ENUM1 { A, B, "" }; + + // enum type var + var ResultIsNumber1 = -ENUM; + + // expressions + var ResultIsNumber2 = -ENUM1["B"]; + var ResultIsNumber3 = -(ENUM1.B + ENUM1[""]); + + // miss assignment operators + -ENUM; + -ENUM1; + -ENUM1["B"]; + -ENUM, ENUM1; + ~~~~~ +!!! error TS2695: Left side of comma operator is unused and has no side effects. \ No newline at end of file diff --git a/tests/baselines/reference/negateOperatorWithEnumType.types b/tests/baselines/reference/negateOperatorWithEnumType.types index 2f39a581ef8..d49f01c7f0d 100644 --- a/tests/baselines/reference/negateOperatorWithEnumType.types +++ b/tests/baselines/reference/negateOperatorWithEnumType.types @@ -6,8 +6,8 @@ enum ENUM { }; enum ENUM1 { A, B, "" }; >ENUM1 : ENUM1 ->A : ENUM1 ->B : ENUM1 +>A : ENUM1.A +>B : ENUM1.B // enum type var var ResultIsNumber1 = -ENUM; @@ -19,21 +19,21 @@ var ResultIsNumber1 = -ENUM; var ResultIsNumber2 = -ENUM1["B"]; >ResultIsNumber2 : number >-ENUM1["B"] : number ->ENUM1["B"] : ENUM1 +>ENUM1["B"] : ENUM1.B >ENUM1 : typeof ENUM1 ->"B" : string +>"B" : "B" var ResultIsNumber3 = -(ENUM1.B + ENUM1[""]); >ResultIsNumber3 : number >-(ENUM1.B + ENUM1[""]) : number >(ENUM1.B + ENUM1[""]) : number >ENUM1.B + ENUM1[""] : number ->ENUM1.B : ENUM1 +>ENUM1.B : ENUM1.B >ENUM1 : typeof ENUM1 ->B : ENUM1 ->ENUM1[""] : ENUM1 +>B : ENUM1.B +>ENUM1[""] : ENUM1."" >ENUM1 : typeof ENUM1 ->"" : string +>"" : "" // miss assignment operators -ENUM; @@ -46,9 +46,9 @@ var ResultIsNumber3 = -(ENUM1.B + ENUM1[""]); -ENUM1["B"]; >-ENUM1["B"] : number ->ENUM1["B"] : ENUM1 +>ENUM1["B"] : ENUM1.B >ENUM1 : typeof ENUM1 ->"B" : string +>"B" : "B" -ENUM, ENUM1; >-ENUM, ENUM1 : typeof ENUM1 diff --git a/tests/baselines/reference/negateOperatorWithNumberType.errors.txt b/tests/baselines/reference/negateOperatorWithNumberType.errors.txt new file mode 100644 index 00000000000..f5ca9813fdf --- /dev/null +++ b/tests/baselines/reference/negateOperatorWithNumberType.errors.txt @@ -0,0 +1,47 @@ +tests/cases/conformance/expressions/unaryOperators/negateOperator/negateOperatorWithNumberType.ts(41,1): error TS2695: Left side of comma operator is unused and has no side effects. + + +==== tests/cases/conformance/expressions/unaryOperators/negateOperator/negateOperatorWithNumberType.ts (1 errors) ==== + // - operator on number type + var NUMBER: number; + var NUMBER1: number[] = [1, 2]; + + function foo(): number { return 1; } + + class A { + public a: number; + static foo() { return 1; } + } + module M { + export var n: number; + } + + var objA = new A(); + + // number type var + var ResultIsNumber1 = -NUMBER; + 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); + + // miss assignment operators + -1; + -NUMBER; + -NUMBER1; + -foo(); + -objA.a; + -M.n; + -objA.a, M.n; + ~~~~~~~ +!!! error TS2695: Left side of comma operator is unused and has no side effects. \ No newline at end of file diff --git a/tests/baselines/reference/negateOperatorWithNumberType.types b/tests/baselines/reference/negateOperatorWithNumberType.types index e53a4e54444..d3d9b474637 100644 --- a/tests/baselines/reference/negateOperatorWithNumberType.types +++ b/tests/baselines/reference/negateOperatorWithNumberType.types @@ -6,12 +6,12 @@ var NUMBER: number; var NUMBER1: number[] = [1, 2]; >NUMBER1 : number[] >[1, 2] : number[] ->1 : number ->2 : number +>1 : 1 +>2 : 2 function foo(): number { return 1; } >foo : () => number ->1 : number +>1 : 1 class A { >A : A @@ -21,7 +21,7 @@ class A { static foo() { return 1; } >foo : () => number ->1 : number +>1 : 1 } module M { >M : typeof M @@ -49,24 +49,24 @@ var ResultIsNumber2 = -NUMBER1; // number type literal var ResultIsNumber3 = -1; >ResultIsNumber3 : number ->-1 : number ->1 : number +>-1 : -1 +>1 : 1 var ResultIsNumber4 = -{ x: 1, y: 2}; >ResultIsNumber4 : number >-{ x: 1, y: 2} : number >{ x: 1, y: 2} : { x: number; y: number; } >x : number ->1 : number +>1 : 1 >y : number ->2 : number +>2 : 2 var ResultIsNumber5 = -{ x: 1, y: (n: number) => { return n; } }; >ResultIsNumber5 : number >-{ x: 1, y: (n: number) => { return n; } } : number >{ x: 1, y: (n: number) => { return n; } } : { x: number; y: (n: number) => number; } >x : number ->1 : number +>1 : 1 >y : (n: number) => number >(n: number) => { return n; } : (n: number) => number >n : number @@ -92,7 +92,7 @@ var ResultIsNumber8 = -NUMBER1[0]; >-NUMBER1[0] : number >NUMBER1[0] : number >NUMBER1 : number[] ->0 : number +>0 : 0 var ResultIsNumber9 = -foo(); >ResultIsNumber9 : number @@ -118,8 +118,8 @@ var ResultIsNumber11 = -(NUMBER - NUMBER); // miss assignment operators -1; ->-1 : number ->1 : number +>-1 : -1 +>1 : 1 -NUMBER; >-NUMBER : number diff --git a/tests/baselines/reference/negateOperatorWithStringType.errors.txt b/tests/baselines/reference/negateOperatorWithStringType.errors.txt new file mode 100644 index 00000000000..c2c37b76832 --- /dev/null +++ b/tests/baselines/reference/negateOperatorWithStringType.errors.txt @@ -0,0 +1,46 @@ +tests/cases/conformance/expressions/unaryOperators/negateOperator/negateOperatorWithStringType.ts(40,1): error TS2695: Left side of comma operator is unused and has no side effects. + + +==== tests/cases/conformance/expressions/unaryOperators/negateOperator/negateOperatorWithStringType.ts (1 errors) ==== + // - operator on string type + var STRING: string; + var STRING1: string[] = ["", "abc"]; + + function foo(): string { return "abc"; } + + class A { + public a: string; + static foo() { return ""; } + } + module M { + export var n: string; + } + + var objA = new A(); + + // string type var + var ResultIsNumber1 = -STRING; + 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); + var ResultIsNumber12 = -STRING.charAt(0); + + // miss assignment operators + -""; + -STRING; + -STRING1; + -foo(); + -objA.a,M.n; + ~~~~~~~ +!!! error TS2695: Left side of comma operator is unused and has no side effects. \ No newline at end of file diff --git a/tests/baselines/reference/negateOperatorWithStringType.types b/tests/baselines/reference/negateOperatorWithStringType.types index 6ef570557fe..053fd113801 100644 --- a/tests/baselines/reference/negateOperatorWithStringType.types +++ b/tests/baselines/reference/negateOperatorWithStringType.types @@ -6,12 +6,12 @@ var STRING: string; var STRING1: string[] = ["", "abc"]; >STRING1 : string[] >["", "abc"] : string[] ->"" : string ->"abc" : string +>"" : "" +>"abc" : "abc" function foo(): string { return "abc"; } >foo : () => string ->"abc" : string +>"abc" : "abc" class A { >A : A @@ -21,7 +21,7 @@ class A { static foo() { return ""; } >foo : () => string ->"" : string +>"" : "" } module M { >M : typeof M @@ -50,23 +50,23 @@ var ResultIsNumber2 = -STRING1; var ResultIsNumber3 = -""; >ResultIsNumber3 : number >-"" : number ->"" : string +>"" : "" var ResultIsNumber4 = -{ x: "", y: "" }; >ResultIsNumber4 : number >-{ x: "", y: "" } : number >{ x: "", y: "" } : { x: string; y: string; } >x : string ->"" : string +>"" : "" >y : string ->"" : string +>"" : "" var ResultIsNumber5 = -{ x: "", y: (s: string) => { return s; } }; >ResultIsNumber5 : number >-{ x: "", y: (s: string) => { return s; } } : number >{ x: "", y: (s: string) => { return s; } } : { x: string; y: (s: string) => string; } >x : string ->"" : string +>"" : "" >y : (s: string) => string >(s: string) => { return s; } : (s: string) => string >s : string @@ -92,7 +92,7 @@ var ResultIsNumber8 = -STRING1[0]; >-STRING1[0] : number >STRING1[0] : string >STRING1 : string[] ->0 : number +>0 : 0 var ResultIsNumber9 = -foo(); >ResultIsNumber9 : number @@ -123,12 +123,12 @@ var ResultIsNumber12 = -STRING.charAt(0); >STRING.charAt : (pos: number) => string >STRING : string >charAt : (pos: number) => string ->0 : number +>0 : 0 // miss assignment operators -""; >-"" : number ->"" : string +>"" : "" -STRING; >-STRING : number diff --git a/tests/baselines/reference/negativeZero.types b/tests/baselines/reference/negativeZero.types index 3468e22fdb2..114dc337927 100644 --- a/tests/baselines/reference/negativeZero.types +++ b/tests/baselines/reference/negativeZero.types @@ -1,6 +1,6 @@ === tests/cases/compiler/negativeZero.ts === var x = -0 >x : number ->-0 : number ->0 : number +>-0 : 0 +>0 : 0 diff --git a/tests/baselines/reference/nestedBlockScopedBindings1.types b/tests/baselines/reference/nestedBlockScopedBindings1.types index e192b0748a5..1812d54e370 100644 --- a/tests/baselines/reference/nestedBlockScopedBindings1.types +++ b/tests/baselines/reference/nestedBlockScopedBindings1.types @@ -4,12 +4,12 @@ function a0() { { let x = 1; >x : number ->1 : number +>1 : 1 } { let x = 1; >x : number ->1 : number +>1 : 1 } } @@ -22,7 +22,7 @@ function a1() { { let x = 1; >x : number ->1 : number +>1 : 1 } } @@ -31,7 +31,7 @@ function a2() { { let x = 1; >x : number ->1 : number +>1 : 1 } { let x; @@ -44,10 +44,10 @@ function a3() { { let x = 1; >x : number ->1 : number +>1 : 1 } switch (1) { ->1 : number +>1 : 1 case 1: >1 : 1 @@ -67,14 +67,14 @@ function a4() { >x : any } switch (1) { ->1 : number +>1 : 1 case 1: >1 : 1 let x = 1; >x : number ->1 : number +>1 : 1 break; } diff --git a/tests/baselines/reference/nestedBlockScopedBindings10.types b/tests/baselines/reference/nestedBlockScopedBindings10.types index 747f2ef1f2b..d002a4f8cb4 100644 --- a/tests/baselines/reference/nestedBlockScopedBindings10.types +++ b/tests/baselines/reference/nestedBlockScopedBindings10.types @@ -4,13 +4,13 @@ >x : any x = 1; ->x = 1 : number +>x = 1 : 1 >x : any ->1 : number +>1 : 1 } switch (1) { ->1 : number +>1 : 1 case 1: >1 : 1 @@ -19,9 +19,9 @@ switch (1) { >y : any y = 1; ->y = 1 : number +>y = 1 : 1 >y : any ->1 : number +>1 : 1 break; } diff --git a/tests/baselines/reference/nestedBlockScopedBindings11.types b/tests/baselines/reference/nestedBlockScopedBindings11.types index 4d1914d6f1a..ed356c53ad9 100644 --- a/tests/baselines/reference/nestedBlockScopedBindings11.types +++ b/tests/baselines/reference/nestedBlockScopedBindings11.types @@ -14,7 +14,7 @@ var y; >y : any switch (1) { ->1 : number +>1 : 1 case 1: >1 : 1 diff --git a/tests/baselines/reference/nestedBlockScopedBindings12.types b/tests/baselines/reference/nestedBlockScopedBindings12.types index ec75d16a37f..1ac7dc39bf0 100644 --- a/tests/baselines/reference/nestedBlockScopedBindings12.types +++ b/tests/baselines/reference/nestedBlockScopedBindings12.types @@ -6,16 +6,16 @@ var x; >x : any x = 1; ->x = 1 : number +>x = 1 : 1 >x : any ->1 : number +>1 : 1 } var y; >y : any switch (1) { ->1 : number +>1 : 1 case 1: >1 : 1 @@ -24,9 +24,9 @@ switch (1) { >y : any y = 1; ->y = 1 : number +>y = 1 : 1 >y : any ->1 : number +>1 : 1 break; } diff --git a/tests/baselines/reference/nestedBlockScopedBindings2.types b/tests/baselines/reference/nestedBlockScopedBindings2.types index 3e7dbe4b757..2a7d077ad71 100644 --- a/tests/baselines/reference/nestedBlockScopedBindings2.types +++ b/tests/baselines/reference/nestedBlockScopedBindings2.types @@ -4,7 +4,7 @@ function a0() { { let x = 1; >x : number ->1 : number +>1 : 1 () => x; >() => x : () => number @@ -13,7 +13,7 @@ function a0() { { let x = 1; >x : number ->1 : number +>1 : 1 } } @@ -26,7 +26,7 @@ function a1() { { let x = 1; >x : number ->1 : number +>1 : 1 () => x; >() => x : () => number @@ -39,7 +39,7 @@ function a2() { { let x = 1; >x : number ->1 : number +>1 : 1 () => x; >() => x : () => number @@ -61,14 +61,14 @@ function a3() { { let x = 1; >x : number ->1 : number +>1 : 1 () => x; >() => x : () => number >x : number } switch (1) { ->1 : number +>1 : 1 case 1: >1 : 1 @@ -92,7 +92,7 @@ function a4() { >x : any } switch (1) { ->1 : number +>1 : 1 case 1: >1 : 1 @@ -120,7 +120,7 @@ function a5() { >x : any } switch (1) { ->1 : number +>1 : 1 case 1: >1 : 1 @@ -136,7 +136,7 @@ function a6() { >a6 : () => void switch (1) { ->1 : number +>1 : 1 case 1: >1 : 1 @@ -147,7 +147,7 @@ function a6() { break; } switch (1) { ->1 : number +>1 : 1 case 1: >1 : 1 @@ -163,7 +163,7 @@ function a7() { >a7 : () => void switch (1) { ->1 : number +>1 : 1 case 1: >1 : 1 @@ -178,7 +178,7 @@ function a7() { break; } switch (1) { ->1 : number +>1 : 1 case 1: >1 : 1 @@ -194,7 +194,7 @@ function a8() { >a8 : () => void switch (1) { ->1 : number +>1 : 1 case 1: >1 : 1 @@ -205,7 +205,7 @@ function a8() { break; } switch (1) { ->1 : number +>1 : 1 case 1: >1 : 1 @@ -225,7 +225,7 @@ function a9() { >a9 : () => void switch (1) { ->1 : number +>1 : 1 case 1: >1 : 1 @@ -240,7 +240,7 @@ function a9() { break; } switch (1) { ->1 : number +>1 : 1 case 1: >1 : 1 diff --git a/tests/baselines/reference/nestedBlockScopedBindings3.types b/tests/baselines/reference/nestedBlockScopedBindings3.types index e10cffb7123..0de8123861d 100644 --- a/tests/baselines/reference/nestedBlockScopedBindings3.types +++ b/tests/baselines/reference/nestedBlockScopedBindings3.types @@ -4,10 +4,10 @@ function a0() { { for (let x = 0; x < 1; ) { >x : number ->0 : number +>0 : 0 >x < 1 : boolean >x : number ->1 : number +>1 : 1 () => x; >() => x : () => number @@ -32,7 +32,7 @@ function a1() { >x : any >x < 1 : boolean >x : any ->1 : number +>1 : 1 () => x; >() => x : () => any @@ -54,14 +54,14 @@ function a2() { >x : any >x < 1 : boolean >x : any ->1 : number +>1 : 1 x = x + 1; >x = x + 1 : any >x : any >x + 1 : any >x : any ->1 : number +>1 : 1 } for (let x;;) { >x : any @@ -71,7 +71,7 @@ function a2() { >x : any >x + 2 : any >x : any ->2 : number +>2 : 2 } } @@ -83,17 +83,17 @@ function a3() { >x : any >x < 1 : boolean >x : any ->1 : number +>1 : 1 x = x + 1; >x = x + 1 : any >x : any >x + 1 : any >x : any ->1 : number +>1 : 1 } switch (1) { ->1 : number +>1 : 1 case 1: >1 : 1 @@ -112,21 +112,21 @@ function a4() { >x : any >x < 1 : boolean >x : any ->1 : number +>1 : 1 x = x + 1; >x = x + 1 : any >x : any >x + 1 : any >x : any ->1 : number +>1 : 1 () => x; >() => x : () => any >x : any } switch (1) { ->1 : number +>1 : 1 case 1: >1 : 1 @@ -146,21 +146,21 @@ function a5() { >x : any >x < 1 : boolean >x : any ->1 : number +>1 : 1 x = x + 1; >x = x + 1 : any >x : any >x + 1 : any >x : any ->1 : number +>1 : 1 () => x; >() => x : () => any >x : any } switch (1) { ->1 : number +>1 : 1 case 1: >1 : 1 diff --git a/tests/baselines/reference/nestedBlockScopedBindings4.types b/tests/baselines/reference/nestedBlockScopedBindings4.types index b38d61f3f44..65b5d73db9d 100644 --- a/tests/baselines/reference/nestedBlockScopedBindings4.types +++ b/tests/baselines/reference/nestedBlockScopedBindings4.types @@ -6,14 +6,14 @@ function a0() { >x : any >x < 1 : boolean >x : any ->1 : number +>1 : 1 x = x + 1; >x = x + 1 : any >x : any >x + 1 : any >x : any ->1 : number +>1 : 1 } for (let x;;) { >x : any @@ -23,7 +23,7 @@ function a0() { >x : any >x + 2 : any >x : any ->2 : number +>2 : 2 } } @@ -34,14 +34,14 @@ function a1() { >x : any >x < 1 : boolean >x : any ->1 : number +>1 : 1 x = x + 1; >x = x + 1 : any >x : any >x + 1 : any >x : any ->1 : number +>1 : 1 () => x; >() => x : () => any @@ -55,7 +55,7 @@ function a1() { >x : any >x + 2 : any >x : any ->2 : number +>2 : 2 } } @@ -66,14 +66,14 @@ function a2() { >x : any >x < 1 : boolean >x : any ->1 : number +>1 : 1 x = x + 1; >x = x + 1 : any >x : any >x + 1 : any >x : any ->1 : number +>1 : 1 } for (let x;;) { >x : any @@ -83,7 +83,7 @@ function a2() { >x : any >x + 2 : any >x : any ->2 : number +>2 : 2 () => x; >() => x : () => any @@ -99,14 +99,14 @@ function a3() { >x : any >x < 1 : boolean >x : any ->1 : number +>1 : 1 x = x + 1; >x = x + 1 : any >x : any >x + 1 : any >x : any ->1 : number +>1 : 1 () => x; >() => x : () => any @@ -120,7 +120,7 @@ function a3() { >x : any >x + 2 : any >x : any ->2 : number +>2 : 2 () => x; >() => x : () => any diff --git a/tests/baselines/reference/nestedBlockScopedBindings6.types b/tests/baselines/reference/nestedBlockScopedBindings6.types index fa4fa5ec695..865dea31e37 100644 --- a/tests/baselines/reference/nestedBlockScopedBindings6.types +++ b/tests/baselines/reference/nestedBlockScopedBindings6.types @@ -5,14 +5,14 @@ function a0() { for (let x of [1]) { >x : number >[1] : number[] ->1 : number +>1 : 1 x = x + 1; >x = x + 1 : number >x : number >x + 1 : number >x : number ->1 : number +>1 : 1 } for (let x;;) { >x : any @@ -22,7 +22,7 @@ function a0() { >x : any >x + 2 : any >x : any ->2 : number +>2 : 2 } } @@ -32,14 +32,14 @@ function a1() { for (let x of [1]) { >x : number >[1] : number[] ->1 : number +>1 : 1 x = x + 1; >x = x + 1 : number >x : number >x + 1 : number >x : number ->1 : number +>1 : 1 () => x; >() => x : () => number @@ -53,7 +53,7 @@ function a1() { >x : any >x + 2 : any >x : any ->2 : number +>2 : 2 } } @@ -63,14 +63,14 @@ function a2() { for (let x of [1]) { >x : number >[1] : number[] ->1 : number +>1 : 1 x = x + 1; >x = x + 1 : number >x : number >x + 1 : number >x : number ->1 : number +>1 : 1 } for (let x;;) { >x : any @@ -80,7 +80,7 @@ function a2() { >x : any >x + 2 : any >x : any ->2 : number +>2 : 2 () => x; >() => x : () => any @@ -94,14 +94,14 @@ function a3() { for (let x of [1]) { >x : number >[1] : number[] ->1 : number +>1 : 1 x = x + 1; >x = x + 1 : number >x : number >x + 1 : number >x : number ->1 : number +>1 : 1 () => x; >() => x : () => number @@ -115,7 +115,7 @@ function a3() { >x : any >x + 2 : any >x : any ->2 : number +>2 : 2 () => x; >() => x : () => any @@ -129,21 +129,21 @@ function a4() { for (let x of [1]) { >x : number >[1] : number[] ->1 : number +>1 : 1 x = x + 1; >x = x + 1 : number >x : number >x + 1 : number >x : number ->1 : number +>1 : 1 () => x; >() => x : () => number >x : number } switch (1) { ->1 : number +>1 : 1 case 1: >1 : 1 @@ -162,17 +162,17 @@ function a5() { for (let x of [1]) { >x : number >[1] : number[] ->1 : number +>1 : 1 x = x + 1; >x = x + 1 : number >x : number >x + 1 : number >x : number ->1 : number +>1 : 1 } switch (1) { ->1 : number +>1 : 1 case 1: >1 : 1 @@ -194,17 +194,17 @@ function a6() { for (let x of [1]) { >x : number >[1] : number[] ->1 : number +>1 : 1 x = x + 1; >x = x + 1 : number >x : number >x + 1 : number >x : number ->1 : number +>1 : 1 } switch (1) { ->1 : number +>1 : 1 case 1: >1 : 1 @@ -222,21 +222,21 @@ function a7() { for (let x of [1]) { >x : number >[1] : number[] ->1 : number +>1 : 1 x = x + 1; >x = x + 1 : number >x : number >x + 1 : number >x : number ->1 : number +>1 : 1 () => x; >() => x : () => number >x : number } switch (1) { ->1 : number +>1 : 1 case 1: >1 : 1 diff --git a/tests/baselines/reference/nestedBlockScopedBindings9.types b/tests/baselines/reference/nestedBlockScopedBindings9.types index e27254717fa..0aa2ecaa9d7 100644 --- a/tests/baselines/reference/nestedBlockScopedBindings9.types +++ b/tests/baselines/reference/nestedBlockScopedBindings9.types @@ -9,7 +9,7 @@ } switch (1) { ->1 : number +>1 : 1 case 1: >1 : 1 diff --git a/tests/baselines/reference/nestedIfStatement.types b/tests/baselines/reference/nestedIfStatement.types index 19799d25172..d6ea5b80b4f 100644 --- a/tests/baselines/reference/nestedIfStatement.types +++ b/tests/baselines/reference/nestedIfStatement.types @@ -1,15 +1,15 @@ === tests/cases/compiler/nestedIfStatement.ts === if (0) { ->0 : number +>0 : 0 } else if (1) { ->1 : number +>1 : 1 } else if (2) { ->2 : number +>2 : 2 } else if (3) { ->3 : number +>3 : 3 } else { } diff --git a/tests/baselines/reference/nestedLoopTypeGuards.types b/tests/baselines/reference/nestedLoopTypeGuards.types index 9611fba2fbf..9d7b793badf 100644 --- a/tests/baselines/reference/nestedLoopTypeGuards.types +++ b/tests/baselines/reference/nestedLoopTypeGuards.types @@ -16,19 +16,19 @@ function f1() { // a is narrowed to "number | string" for (var i = 0; i < 1; i++) { >i : number ->0 : number +>0 : 0 >i < 1 : boolean >i : number ->1 : number +>1 : 1 >i++ : number >i : number for (var j = 0; j < 1; j++) {} >j : number ->0 : number +>0 : 0 >j < 1 : boolean >j : number ->1 : number +>1 : 1 >j++ : number >j : number @@ -41,10 +41,10 @@ function f1() { // a is narrowed to "string' for (var j = 0; j < 1; j++) { >j : number ->0 : number +>0 : 0 >j < 1 : boolean >j : number ->1 : number +>1 : 1 >j++ : number >j : number @@ -71,10 +71,10 @@ function f2() { >'string' : "string" while (1) { ->1 : number +>1 : 1 while (1) {} ->1 : number +>1 : 1 if (typeof a === 'string') { >typeof a === 'string' : boolean @@ -83,7 +83,7 @@ function f2() { >'string' : "string" while (1) { ->1 : number +>1 : 1 a.length; // Should not error here >a.length : number diff --git a/tests/baselines/reference/nestedModules.types b/tests/baselines/reference/nestedModules.types index eee3ee3968a..95f6ae40669 100644 --- a/tests/baselines/reference/nestedModules.types +++ b/tests/baselines/reference/nestedModules.types @@ -27,9 +27,9 @@ module A { >Point : C.Point >{ x: 0, y: 0 } : { x: number; y: number; } >x : number ->0 : number +>0 : 0 >y : number ->0 : number +>0 : 0 } } diff --git a/tests/baselines/reference/nestedRedeclarationInES6AMD.types b/tests/baselines/reference/nestedRedeclarationInES6AMD.types index 2b8d971e3c1..ebc93abd3af 100644 --- a/tests/baselines/reference/nestedRedeclarationInES6AMD.types +++ b/tests/baselines/reference/nestedRedeclarationInES6AMD.types @@ -4,11 +4,11 @@ function a() { { let status = 1; >status : number ->1 : number +>1 : 1 status = 2; ->status = 2 : number +>status = 2 : 2 >status : number ->2 : number +>2 : 2 } } diff --git a/tests/baselines/reference/nestedSelf.types b/tests/baselines/reference/nestedSelf.types index ed7f084246a..9fb4b0bd65d 100644 --- a/tests/baselines/reference/nestedSelf.types +++ b/tests/baselines/reference/nestedSelf.types @@ -7,16 +7,16 @@ module M { public n = 42; >n : number ->42 : number +>42 : 42 public foo() { [1,2,3].map((x) => { return this.n * x; })} >foo : () => void >[1,2,3].map((x) => { return this.n * x; }) : number[] >[1,2,3].map : (callbackfn: (value: number, index: number, array: number[]) => U, thisArg?: any) => U[] >[1,2,3] : number[] ->1 : number ->2 : number ->3 : number +>1 : 1 +>2 : 2 +>3 : 3 >map : (callbackfn: (value: number, index: number, array: number[]) => U, thisArg?: any) => U[] >(x) => { return this.n * x; } : (x: number) => number >x : number diff --git a/tests/baselines/reference/neverType.js b/tests/baselines/reference/neverType.js index 56a1373903e..a1e4c71f803 100644 --- a/tests/baselines/reference/neverType.js +++ b/tests/baselines/reference/neverType.js @@ -180,8 +180,8 @@ declare function fail(): never; declare function failOrThrow(shouldFail: boolean): never; declare function infiniteLoop1(): void; declare function infiniteLoop2(): never; -declare function move1(direction: "up" | "down"): number; -declare function move2(direction: "up" | "down"): number; +declare function move1(direction: "up" | "down"): 1 | -1; +declare function move2(direction: "up" | "down"): 1 | -1; declare function check(x: T | undefined): T; declare class C { void1(): void; diff --git a/tests/baselines/reference/neverType.types b/tests/baselines/reference/neverType.types index 72d8eae6b3b..bdb1ff56c3e 100644 --- a/tests/baselines/reference/neverType.types +++ b/tests/baselines/reference/neverType.types @@ -27,7 +27,7 @@ function fail() { return error("Something failed"); >error("Something failed") : never >error : (message: string) => never ->"Something failed" : string +>"Something failed" : "Something failed" } function failOrThrow(shouldFail: boolean) { @@ -50,7 +50,7 @@ function infiniteLoop1() { >infiniteLoop1 : () => void while (true) { ->true : boolean +>true : true } } @@ -58,12 +58,12 @@ function infiniteLoop2(): never { >infiniteLoop2 : () => never while (true) { ->true : boolean +>true : true } } function move1(direction: "up" | "down") { ->move1 : (direction: "up" | "down") => number +>move1 : (direction: "up" | "down") => 1 | -1 >direction : "up" | "down" switch (direction) { @@ -73,44 +73,44 @@ function move1(direction: "up" | "down") { >"up" : "up" return 1; ->1 : number +>1 : 1 case "down": >"down" : "down" return -1; ->-1 : number ->1 : number +>-1 : -1 +>1 : 1 } return error("Should never get here"); >error("Should never get here") : never >error : (message: string) => never ->"Should never get here" : string +>"Should never get here" : "Should never get here" } function move2(direction: "up" | "down") { ->move2 : (direction: "up" | "down") => number +>move2 : (direction: "up" | "down") => 1 | -1 >direction : "up" | "down" return direction === "up" ? 1 : ->direction === "up" ? 1 : direction === "down" ? -1 : error("Should never get here") : number +>direction === "up" ? 1 : direction === "down" ? -1 : error("Should never get here") : 1 | -1 >direction === "up" : boolean >direction : "up" | "down" >"up" : "up" ->1 : number +>1 : 1 direction === "down" ? -1 : ->direction === "down" ? -1 : error("Should never get here") : number +>direction === "down" ? -1 : error("Should never get here") : -1 >direction === "down" : boolean >direction : "down" >"down" : "down" ->-1 : number ->1 : number +>-1 : -1 +>1 : 1 error("Should never get here"); >error("Should never get here") : never >error : (message: string) => never ->"Should never get here" : string +>"Should never get here" : "Should never get here" } function check(x: T | undefined) { @@ -124,7 +124,7 @@ function check(x: T | undefined) { >x : T | undefined >error("Undefined value") : never >error : (message: string) => never ->"Undefined value" : string +>"Undefined value" : "Undefined value" } class C { @@ -141,7 +141,7 @@ class C { >void2 : () => void while (true) {} ->true : boolean +>true : true } never1(): never { >never1 : () => never @@ -154,7 +154,7 @@ class C { >never2 : () => never while (true) {} ->true : boolean +>true : true } } @@ -178,7 +178,7 @@ function f2(x: string | number) { >x : string | number while (true) { ->true : boolean +>true : true if (typeof x === "boolean") { >typeof x === "boolean" : boolean @@ -210,13 +210,13 @@ let errorCallback = () => error("Error callback"); >() => error("Error callback") : () => never >error("Error callback") : never >error : (message: string) => never ->"Error callback" : string +>"Error callback" : "Error callback" test(() => "hello"); >test(() => "hello") : string >test : (cb: () => string) => string >() => "hello" : () => string ->"hello" : string +>"hello" : "hello" test(() => fail()); >test(() => fail()) : string diff --git a/tests/baselines/reference/neverTypeErrors1.errors.txt b/tests/baselines/reference/neverTypeErrors1.errors.txt index 8fd6f9c924e..cb79c0c19fb 100644 --- a/tests/baselines/reference/neverTypeErrors1.errors.txt +++ b/tests/baselines/reference/neverTypeErrors1.errors.txt @@ -1,11 +1,11 @@ -tests/cases/conformance/types/never/neverTypeErrors1.ts(3,5): error TS2322: Type 'number' is not assignable to type 'never'. -tests/cases/conformance/types/never/neverTypeErrors1.ts(4,5): error TS2322: Type 'string' is not assignable to type 'never'. -tests/cases/conformance/types/never/neverTypeErrors1.ts(5,5): error TS2322: Type 'boolean' is not assignable to type 'never'. +tests/cases/conformance/types/never/neverTypeErrors1.ts(3,5): error TS2322: Type '1' is not assignable to type 'never'. +tests/cases/conformance/types/never/neverTypeErrors1.ts(4,5): error TS2322: Type '"abc"' is not assignable to type 'never'. +tests/cases/conformance/types/never/neverTypeErrors1.ts(5,5): error TS2322: Type 'false' is not assignable to type 'never'. tests/cases/conformance/types/never/neverTypeErrors1.ts(6,5): error TS2322: Type 'undefined' is not assignable to type 'never'. tests/cases/conformance/types/never/neverTypeErrors1.ts(7,5): error TS2322: Type 'null' is not assignable to type 'never'. tests/cases/conformance/types/never/neverTypeErrors1.ts(8,5): error TS2322: Type '{}' is not assignable to type 'never'. tests/cases/conformance/types/never/neverTypeErrors1.ts(12,5): error TS2322: Type 'undefined' is not assignable to type 'never'. -tests/cases/conformance/types/never/neverTypeErrors1.ts(16,12): error TS2322: Type 'number' is not assignable to type 'never'. +tests/cases/conformance/types/never/neverTypeErrors1.ts(16,12): error TS2322: Type '1' is not assignable to type 'never'. tests/cases/conformance/types/never/neverTypeErrors1.ts(19,16): error TS2534: A function returning 'never' cannot have a reachable end point. @@ -14,13 +14,13 @@ tests/cases/conformance/types/never/neverTypeErrors1.ts(19,16): error TS2534: A let x: never; x = 1; ~ -!!! error TS2322: Type 'number' is not assignable to type 'never'. +!!! error TS2322: Type '1' is not assignable to type 'never'. x = "abc"; ~ -!!! error TS2322: Type 'string' is not assignable to type 'never'. +!!! error TS2322: Type '"abc"' is not assignable to type 'never'. x = false; ~ -!!! error TS2322: Type 'boolean' is not assignable to type 'never'. +!!! error TS2322: Type 'false' is not assignable to type 'never'. x = undefined; ~ !!! error TS2322: Type 'undefined' is not assignable to type 'never'. @@ -41,7 +41,7 @@ tests/cases/conformance/types/never/neverTypeErrors1.ts(19,16): error TS2534: A function f3(): never { return 1; ~ -!!! error TS2322: Type 'number' is not assignable to type 'never'. +!!! error TS2322: Type '1' is not assignable to type 'never'. } function f4(): never { diff --git a/tests/baselines/reference/neverTypeErrors2.errors.txt b/tests/baselines/reference/neverTypeErrors2.errors.txt index c6292657ad1..ed27e615ea1 100644 --- a/tests/baselines/reference/neverTypeErrors2.errors.txt +++ b/tests/baselines/reference/neverTypeErrors2.errors.txt @@ -1,11 +1,11 @@ -tests/cases/conformance/types/never/neverTypeErrors2.ts(4,5): error TS2322: Type 'number' is not assignable to type 'never'. -tests/cases/conformance/types/never/neverTypeErrors2.ts(5,5): error TS2322: Type 'string' is not assignable to type 'never'. -tests/cases/conformance/types/never/neverTypeErrors2.ts(6,5): error TS2322: Type 'boolean' is not assignable to type 'never'. +tests/cases/conformance/types/never/neverTypeErrors2.ts(4,5): error TS2322: Type '1' is not assignable to type 'never'. +tests/cases/conformance/types/never/neverTypeErrors2.ts(5,5): error TS2322: Type '"abc"' is not assignable to type 'never'. +tests/cases/conformance/types/never/neverTypeErrors2.ts(6,5): error TS2322: Type 'false' is not assignable to type 'never'. tests/cases/conformance/types/never/neverTypeErrors2.ts(7,5): error TS2322: Type 'undefined' is not assignable to type 'never'. tests/cases/conformance/types/never/neverTypeErrors2.ts(8,5): error TS2322: Type 'null' is not assignable to type 'never'. tests/cases/conformance/types/never/neverTypeErrors2.ts(9,5): error TS2322: Type '{}' is not assignable to type 'never'. tests/cases/conformance/types/never/neverTypeErrors2.ts(13,5): error TS2322: Type 'undefined' is not assignable to type 'never'. -tests/cases/conformance/types/never/neverTypeErrors2.ts(17,12): error TS2322: Type 'number' is not assignable to type 'never'. +tests/cases/conformance/types/never/neverTypeErrors2.ts(17,12): error TS2322: Type '1' is not assignable to type 'never'. tests/cases/conformance/types/never/neverTypeErrors2.ts(20,16): error TS2534: A function returning 'never' cannot have a reachable end point. @@ -15,13 +15,13 @@ tests/cases/conformance/types/never/neverTypeErrors2.ts(20,16): error TS2534: A let x: never; x = 1; ~ -!!! error TS2322: Type 'number' is not assignable to type 'never'. +!!! error TS2322: Type '1' is not assignable to type 'never'. x = "abc"; ~ -!!! error TS2322: Type 'string' is not assignable to type 'never'. +!!! error TS2322: Type '"abc"' is not assignable to type 'never'. x = false; ~ -!!! error TS2322: Type 'boolean' is not assignable to type 'never'. +!!! error TS2322: Type 'false' is not assignable to type 'never'. x = undefined; ~ !!! error TS2322: Type 'undefined' is not assignable to type 'never'. @@ -42,7 +42,7 @@ tests/cases/conformance/types/never/neverTypeErrors2.ts(20,16): error TS2534: A function f3(): never { return 1; ~ -!!! error TS2322: Type 'number' is not assignable to type 'never'. +!!! error TS2322: Type '1' is not assignable to type 'never'. } function f4(): never { diff --git a/tests/baselines/reference/newArrays.types b/tests/baselines/reference/newArrays.types index 3c0928a46ea..7676b9b14f7 100644 --- a/tests/baselines/reference/newArrays.types +++ b/tests/baselines/reference/newArrays.types @@ -14,11 +14,11 @@ module M { public x = 10; >x : number ->10 : number +>10 : 10 public y = 10; >y : number ->10 : number +>10 : 10 public m () { >m : () => void diff --git a/tests/baselines/reference/newExpressionWithTypeParameterConstrainedToOuterTypeParameter.types b/tests/baselines/reference/newExpressionWithTypeParameterConstrainedToOuterTypeParameter.types index 6d541198802..badd17765b8 100644 --- a/tests/baselines/reference/newExpressionWithTypeParameterConstrainedToOuterTypeParameter.types +++ b/tests/baselines/reference/newExpressionWithTypeParameterConstrainedToOuterTypeParameter.types @@ -15,7 +15,7 @@ var i: I; >I : I var y = new i(""); // y should be string ->y : "" +>y : string >new i("") : "" >i : I >"" : "" diff --git a/tests/baselines/reference/newLineFlagWithCRLF.types b/tests/baselines/reference/newLineFlagWithCRLF.types index 4898d2495b2..fc8caa2c324 100644 --- a/tests/baselines/reference/newLineFlagWithCRLF.types +++ b/tests/baselines/reference/newLineFlagWithCRLF.types @@ -1,11 +1,11 @@ === tests/cases/compiler/newLineFlagWithCRLF.ts === var x=1; >x : number ->1 : number +>1 : 1 x=2; ->x=2 : number +>x=2 : 2 >x : number ->2 : number +>2 : 2 diff --git a/tests/baselines/reference/newLineFlagWithLF.types b/tests/baselines/reference/newLineFlagWithLF.types index bfdf6072e0e..e16a15282a0 100644 --- a/tests/baselines/reference/newLineFlagWithLF.types +++ b/tests/baselines/reference/newLineFlagWithLF.types @@ -1,11 +1,11 @@ === tests/cases/compiler/newLineFlagWithLF.ts === var x=1; >x : number ->1 : number +>1 : 1 x=2; ->x=2 : number +>x=2 : 2 >x : number ->2 : number +>2 : 2 diff --git a/tests/baselines/reference/newOperator.errors.txt b/tests/baselines/reference/newOperator.errors.txt index 7998217f2e5..fc6f22d9eac 100644 --- a/tests/baselines/reference/newOperator.errors.txt +++ b/tests/baselines/reference/newOperator.errors.txt @@ -1,4 +1,4 @@ -tests/cases/compiler/newOperator.ts(3,13): error TS2304: Cannot find name 'ifc'. +tests/cases/compiler/newOperator.ts(3,13): error TS2693: 'ifc' only refers to a type, but is being used as a value here. tests/cases/compiler/newOperator.ts(10,10): error TS2351: Cannot use 'new' with an expression whose type lacks a call or construct signature. tests/cases/compiler/newOperator.ts(11,10): error TS2351: Cannot use 'new' with an expression whose type lacks a call or construct signature. tests/cases/compiler/newOperator.ts(12,5): error TS2304: Cannot find name 'string'. @@ -17,7 +17,7 @@ tests/cases/compiler/newOperator.ts(45,23): error TS1150: 'new T[]' cannot be us // Attempting to 'new' an interface yields poor error var i = new ifc(); ~~~ -!!! error TS2304: Cannot find name 'ifc'. +!!! error TS2693: 'ifc' only refers to a type, but is being used as a value here. // Parens are optional var x = new Date; diff --git a/tests/baselines/reference/newOperatorConformance.types b/tests/baselines/reference/newOperatorConformance.types index 912c0a5c81a..c7fb0125a1a 100644 --- a/tests/baselines/reference/newOperatorConformance.types +++ b/tests/baselines/reference/newOperatorConformance.types @@ -110,7 +110,7 @@ function newFn2(s: T) { >p : string >new s(32) : string >s : T ->32 : number +>32 : 32 var p: string; >p : string diff --git a/tests/baselines/reference/newOperatorErrorCases.errors.txt b/tests/baselines/reference/newOperatorErrorCases.errors.txt index 11a6beb1d39..b2947a1d218 100644 --- a/tests/baselines/reference/newOperatorErrorCases.errors.txt +++ b/tests/baselines/reference/newOperatorErrorCases.errors.txt @@ -1,9 +1,10 @@ tests/cases/conformance/expressions/newOperator/newOperatorErrorCases.ts(27,16): error TS1005: ',' expected. +tests/cases/conformance/expressions/newOperator/newOperatorErrorCases.ts(27,16): error TS2695: Left side of comma operator is unused and has no side effects. tests/cases/conformance/expressions/newOperator/newOperatorErrorCases.ts(32,23): error TS1005: '(' expected. tests/cases/conformance/expressions/newOperator/newOperatorErrorCases.ts(37,9): error TS2350: Only a void function can be called with the 'new' keyword. -==== tests/cases/conformance/expressions/newOperator/newOperatorErrorCases.ts (3 errors) ==== +==== tests/cases/conformance/expressions/newOperator/newOperatorErrorCases.ts (4 errors) ==== class C0 { @@ -33,6 +34,8 @@ tests/cases/conformance/expressions/newOperator/newOperatorErrorCases.ts(37,9): var b = new C0 32, ''; // Parse error ~~ !!! error TS1005: ',' expected. + ~~ +!!! error TS2695: Left side of comma operator is unused and has no side effects. // Generic construct expression with no parentheses var c1 = new T; diff --git a/tests/baselines/reference/newWithSpreadES5.types b/tests/baselines/reference/newWithSpreadES5.types index a2c83ed6372..dfa45b33ee1 100644 --- a/tests/baselines/reference/newWithSpreadES5.types +++ b/tests/baselines/reference/newWithSpreadES5.types @@ -84,26 +84,26 @@ var i: C[][]; new f(1, 2, "string"); >new f(1, 2, "string") : any >f : (x: number, y: number, ...z: string[]) => void ->1 : number ->2 : number ->"string" : string +>1 : 1 +>2 : 2 +>"string" : "string" new f(1, 2, ...a); >new f(1, 2, ...a) : any >f : (x: number, y: number, ...z: string[]) => void ->1 : number ->2 : number +>1 : 1 +>2 : 2 >...a : string >a : string[] new f(1, 2, ...a, "string"); >new f(1, 2, ...a, "string") : any >f : (x: number, y: number, ...z: string[]) => void ->1 : number ->2 : number +>1 : 1 +>2 : 2 >...a : string >a : string[] ->"string" : string +>"string" : "string" // Multiple spreads arguments new f2(...a, ...a); @@ -117,8 +117,8 @@ new f2(...a, ...a); new f(1 ,2, ...a, ...a); >new f(1 ,2, ...a, ...a) : any >f : (x: number, y: number, ...z: string[]) => void ->1 : number ->2 : number +>1 : 1 +>2 : 2 >...a : string >a : string[] >...a : string @@ -129,16 +129,16 @@ new f(1, 2, "string")(); >new f(1, 2, "string")() : any >new f(1, 2, "string") : any >f : (x: number, y: number, ...z: string[]) => void ->1 : number ->2 : number ->"string" : string +>1 : 1 +>2 : 2 +>"string" : "string" new f(1, 2, ...a)(); >new f(1, 2, ...a)() : any >new f(1, 2, ...a) : any >f : (x: number, y: number, ...z: string[]) => void ->1 : number ->2 : number +>1 : 1 +>2 : 2 >...a : string >a : string[] @@ -146,11 +146,11 @@ new f(1, 2, ...a, "string")(); >new f(1, 2, ...a, "string")() : any >new f(1, 2, ...a, "string") : any >f : (x: number, y: number, ...z: string[]) => void ->1 : number ->2 : number +>1 : 1 +>2 : 2 >...a : string >a : string[] ->"string" : string +>"string" : "string" // Property access expression new b.f(1, 2, "string"); @@ -158,17 +158,17 @@ new b.f(1, 2, "string"); >b.f : new (x: number, y: number, ...z: string[]) => any >b : A >f : new (x: number, y: number, ...z: string[]) => any ->1 : number ->2 : number ->"string" : string +>1 : 1 +>2 : 2 +>"string" : "string" new b.f(1, 2, ...a); >new b.f(1, 2, ...a) : any >b.f : new (x: number, y: number, ...z: string[]) => any >b : A >f : new (x: number, y: number, ...z: string[]) => any ->1 : number ->2 : number +>1 : 1 +>2 : 2 >...a : string >a : string[] @@ -177,11 +177,11 @@ new b.f(1, 2, ...a, "string"); >b.f : new (x: number, y: number, ...z: string[]) => any >b : A >f : new (x: number, y: number, ...z: string[]) => any ->1 : number ->2 : number +>1 : 1 +>2 : 2 >...a : string >a : string[] ->"string" : string +>"string" : "string" // Parenthesised expression new (b.f)(1, 2, "string"); @@ -190,9 +190,9 @@ new (b.f)(1, 2, "string"); >b.f : new (x: number, y: number, ...z: string[]) => any >b : A >f : new (x: number, y: number, ...z: string[]) => any ->1 : number ->2 : number ->"string" : string +>1 : 1 +>2 : 2 +>"string" : "string" new (b.f)(1, 2, ...a); >new (b.f)(1, 2, ...a) : any @@ -200,8 +200,8 @@ new (b.f)(1, 2, ...a); >b.f : new (x: number, y: number, ...z: string[]) => any >b : A >f : new (x: number, y: number, ...z: string[]) => any ->1 : number ->2 : number +>1 : 1 +>2 : 2 >...a : string >a : string[] @@ -211,11 +211,11 @@ new (b.f)(1, 2, ...a, "string"); >b.f : new (x: number, y: number, ...z: string[]) => any >b : A >f : new (x: number, y: number, ...z: string[]) => any ->1 : number ->2 : number +>1 : 1 +>2 : 2 >...a : string >a : string[] ->"string" : string +>"string" : "string" // Element access expression new d[1].f(1, 2, "string"); @@ -223,21 +223,21 @@ new d[1].f(1, 2, "string"); >d[1].f : new (x: number, y: number, ...z: string[]) => any >d[1] : A >d : A[] ->1 : number +>1 : 1 >f : new (x: number, y: number, ...z: string[]) => any ->1 : number ->2 : number ->"string" : string +>1 : 1 +>2 : 2 +>"string" : "string" new d[1].f(1, 2, ...a); >new d[1].f(1, 2, ...a) : any >d[1].f : new (x: number, y: number, ...z: string[]) => any >d[1] : A >d : A[] ->1 : number +>1 : 1 >f : new (x: number, y: number, ...z: string[]) => any ->1 : number ->2 : number +>1 : 1 +>2 : 2 >...a : string >a : string[] @@ -246,13 +246,13 @@ new d[1].f(1, 2, ...a, "string"); >d[1].f : new (x: number, y: number, ...z: string[]) => any >d[1] : A >d : A[] ->1 : number +>1 : 1 >f : new (x: number, y: number, ...z: string[]) => any ->1 : number ->2 : number +>1 : 1 +>2 : 2 >...a : string >a : string[] ->"string" : string +>"string" : "string" // Element access expression with a punctuated key new e["a-b"].f(1, 2, "string"); @@ -260,21 +260,21 @@ new e["a-b"].f(1, 2, "string"); >e["a-b"].f : new (x: number, y: number, ...z: string[]) => any >e["a-b"] : A >e : { [key: string]: A; } ->"a-b" : string +>"a-b" : "a-b" >f : new (x: number, y: number, ...z: string[]) => any ->1 : number ->2 : number ->"string" : string +>1 : 1 +>2 : 2 +>"string" : "string" new e["a-b"].f(1, 2, ...a); >new e["a-b"].f(1, 2, ...a) : any >e["a-b"].f : new (x: number, y: number, ...z: string[]) => any >e["a-b"] : A >e : { [key: string]: A; } ->"a-b" : string +>"a-b" : "a-b" >f : new (x: number, y: number, ...z: string[]) => any ->1 : number ->2 : number +>1 : 1 +>2 : 2 >...a : string >a : string[] @@ -283,56 +283,56 @@ new e["a-b"].f(1, 2, ...a, "string"); >e["a-b"].f : new (x: number, y: number, ...z: string[]) => any >e["a-b"] : A >e : { [key: string]: A; } ->"a-b" : string +>"a-b" : "a-b" >f : new (x: number, y: number, ...z: string[]) => any ->1 : number ->2 : number +>1 : 1 +>2 : 2 >...a : string >a : string[] ->"string" : string +>"string" : "string" // Basic expression new B(1, 2, "string"); >new B(1, 2, "string") : B >B : typeof B ->1 : number ->2 : number ->"string" : string +>1 : 1 +>2 : 2 +>"string" : "string" new B(1, 2, ...a); >new B(1, 2, ...a) : B >B : typeof B ->1 : number ->2 : number +>1 : 1 +>2 : 2 >...a : string >a : string[] new B(1, 2, ...a, "string"); >new B(1, 2, ...a, "string") : B >B : typeof B ->1 : number ->2 : number +>1 : 1 +>2 : 2 >...a : string >a : string[] ->"string" : string +>"string" : "string" // Property access expression new c["a-b"](1, 2, "string"); >new c["a-b"](1, 2, "string") : B >c["a-b"] : typeof B >c : C ->"a-b" : string ->1 : number ->2 : number ->"string" : string +>"a-b" : "a-b" +>1 : 1 +>2 : 2 +>"string" : "string" new c["a-b"](1, 2, ...a); >new c["a-b"](1, 2, ...a) : B >c["a-b"] : typeof B >c : C ->"a-b" : string ->1 : number ->2 : number +>"a-b" : "a-b" +>1 : 1 +>2 : 2 >...a : string >a : string[] @@ -340,12 +340,12 @@ new c["a-b"](1, 2, ...a, "string"); >new c["a-b"](1, 2, ...a, "string") : B >c["a-b"] : typeof B >c : C ->"a-b" : string ->1 : number ->2 : number +>"a-b" : "a-b" +>1 : 1 +>2 : 2 >...a : string >a : string[] ->"string" : string +>"string" : "string" // Parenthesised expression new (c["a-b"])(1, 2, "string"); @@ -353,19 +353,19 @@ new (c["a-b"])(1, 2, "string"); >(c["a-b"]) : typeof B >c["a-b"] : typeof B >c : C ->"a-b" : string ->1 : number ->2 : number ->"string" : string +>"a-b" : "a-b" +>1 : 1 +>2 : 2 +>"string" : "string" new (c["a-b"])(1, 2, ...a); >new (c["a-b"])(1, 2, ...a) : B >(c["a-b"]) : typeof B >c["a-b"] : typeof B >c : C ->"a-b" : string ->1 : number ->2 : number +>"a-b" : "a-b" +>1 : 1 +>2 : 2 >...a : string >a : string[] @@ -374,12 +374,12 @@ new (c["a-b"])(1, 2, ...a, "string"); >(c["a-b"]) : typeof B >c["a-b"] : typeof B >c : C ->"a-b" : string ->1 : number ->2 : number +>"a-b" : "a-b" +>1 : 1 +>2 : 2 >...a : string >a : string[] ->"string" : string +>"string" : "string" // Element access expression new g[1]["a-b"](1, 2, "string"); @@ -387,21 +387,21 @@ new g[1]["a-b"](1, 2, "string"); >g[1]["a-b"] : typeof B >g[1] : C >g : C[] ->1 : number ->"a-b" : string ->1 : number ->2 : number ->"string" : string +>1 : 1 +>"a-b" : "a-b" +>1 : 1 +>2 : 2 +>"string" : "string" new g[1]["a-b"](1, 2, ...a); >new g[1]["a-b"](1, 2, ...a) : B >g[1]["a-b"] : typeof B >g[1] : C >g : C[] ->1 : number ->"a-b" : string ->1 : number ->2 : number +>1 : 1 +>"a-b" : "a-b" +>1 : 1 +>2 : 2 >...a : string >a : string[] @@ -410,13 +410,13 @@ new g[1]["a-b"](1, 2, ...a, "string"); >g[1]["a-b"] : typeof B >g[1] : C >g : C[] ->1 : number ->"a-b" : string ->1 : number ->2 : number +>1 : 1 +>"a-b" : "a-b" +>1 : 1 +>2 : 2 >...a : string >a : string[] ->"string" : string +>"string" : "string" // Element access expression with a punctuated key new h["a-b"]["a-b"](1, 2, "string"); @@ -424,21 +424,21 @@ new h["a-b"]["a-b"](1, 2, "string"); >h["a-b"]["a-b"] : typeof B >h["a-b"] : C >h : { [key: string]: C; } ->"a-b" : string ->"a-b" : string ->1 : number ->2 : number ->"string" : string +>"a-b" : "a-b" +>"a-b" : "a-b" +>1 : 1 +>2 : 2 +>"string" : "string" new h["a-b"]["a-b"](1, 2, ...a); >new h["a-b"]["a-b"](1, 2, ...a) : B >h["a-b"]["a-b"] : typeof B >h["a-b"] : C >h : { [key: string]: C; } ->"a-b" : string ->"a-b" : string ->1 : number ->2 : number +>"a-b" : "a-b" +>"a-b" : "a-b" +>1 : 1 +>2 : 2 >...a : string >a : string[] @@ -447,13 +447,13 @@ new h["a-b"]["a-b"](1, 2, ...a, "string"); >h["a-b"]["a-b"] : typeof B >h["a-b"] : C >h : { [key: string]: C; } ->"a-b" : string ->"a-b" : string ->1 : number ->2 : number +>"a-b" : "a-b" +>"a-b" : "a-b" +>1 : 1 +>2 : 2 >...a : string >a : string[] ->"string" : string +>"string" : "string" // Element access expression with a number new i["a-b"][1](1, 2, "string"); @@ -461,21 +461,21 @@ new i["a-b"][1](1, 2, "string"); >i["a-b"][1] : any >i["a-b"] : any >i : C[][] ->"a-b" : string ->1 : number ->1 : number ->2 : number ->"string" : string +>"a-b" : "a-b" +>1 : 1 +>1 : 1 +>2 : 2 +>"string" : "string" new i["a-b"][1](1, 2, ...a); >new i["a-b"][1](1, 2, ...a) : any >i["a-b"][1] : any >i["a-b"] : any >i : C[][] ->"a-b" : string ->1 : number ->1 : number ->2 : number +>"a-b" : "a-b" +>1 : 1 +>1 : 1 +>2 : 2 >...a : string >a : string[] @@ -484,11 +484,11 @@ new i["a-b"][1](1, 2, ...a, "string"); >i["a-b"][1] : any >i["a-b"] : any >i : C[][] ->"a-b" : string ->1 : number ->1 : number ->2 : number +>"a-b" : "a-b" +>1 : 1 +>1 : 1 +>2 : 2 >...a : string >a : string[] ->"string" : string +>"string" : "string" diff --git a/tests/baselines/reference/newWithSpreadES6.types b/tests/baselines/reference/newWithSpreadES6.types index 52951729e3d..587e7683e6a 100644 --- a/tests/baselines/reference/newWithSpreadES6.types +++ b/tests/baselines/reference/newWithSpreadES6.types @@ -85,26 +85,26 @@ var i: C[][]; new f(1, 2, "string"); >new f(1, 2, "string") : any >f : (x: number, y: number, ...z: string[]) => void ->1 : number ->2 : number ->"string" : string +>1 : 1 +>2 : 2 +>"string" : "string" new f(1, 2, ...a); >new f(1, 2, ...a) : any >f : (x: number, y: number, ...z: string[]) => void ->1 : number ->2 : number +>1 : 1 +>2 : 2 >...a : string >a : string[] new f(1, 2, ...a, "string"); >new f(1, 2, ...a, "string") : any >f : (x: number, y: number, ...z: string[]) => void ->1 : number ->2 : number +>1 : 1 +>2 : 2 >...a : string >a : string[] ->"string" : string +>"string" : "string" // Multiple spreads arguments new f2(...a, ...a); @@ -118,8 +118,8 @@ new f2(...a, ...a); new f(1 ,2, ...a, ...a); >new f(1 ,2, ...a, ...a) : any >f : (x: number, y: number, ...z: string[]) => void ->1 : number ->2 : number +>1 : 1 +>2 : 2 >...a : string >a : string[] >...a : string @@ -130,16 +130,16 @@ new f(1, 2, "string")(); >new f(1, 2, "string")() : any >new f(1, 2, "string") : any >f : (x: number, y: number, ...z: string[]) => void ->1 : number ->2 : number ->"string" : string +>1 : 1 +>2 : 2 +>"string" : "string" new f(1, 2, ...a)(); >new f(1, 2, ...a)() : any >new f(1, 2, ...a) : any >f : (x: number, y: number, ...z: string[]) => void ->1 : number ->2 : number +>1 : 1 +>2 : 2 >...a : string >a : string[] @@ -147,11 +147,11 @@ new f(1, 2, ...a, "string")(); >new f(1, 2, ...a, "string")() : any >new f(1, 2, ...a, "string") : any >f : (x: number, y: number, ...z: string[]) => void ->1 : number ->2 : number +>1 : 1 +>2 : 2 >...a : string >a : string[] ->"string" : string +>"string" : "string" // Property access expression new b.f(1, 2, "string"); @@ -159,17 +159,17 @@ new b.f(1, 2, "string"); >b.f : new (x: number, y: number, ...z: string[]) => any >b : A >f : new (x: number, y: number, ...z: string[]) => any ->1 : number ->2 : number ->"string" : string +>1 : 1 +>2 : 2 +>"string" : "string" new b.f(1, 2, ...a); >new b.f(1, 2, ...a) : any >b.f : new (x: number, y: number, ...z: string[]) => any >b : A >f : new (x: number, y: number, ...z: string[]) => any ->1 : number ->2 : number +>1 : 1 +>2 : 2 >...a : string >a : string[] @@ -178,11 +178,11 @@ new b.f(1, 2, ...a, "string"); >b.f : new (x: number, y: number, ...z: string[]) => any >b : A >f : new (x: number, y: number, ...z: string[]) => any ->1 : number ->2 : number +>1 : 1 +>2 : 2 >...a : string >a : string[] ->"string" : string +>"string" : "string" // Parenthesised expression new (b.f)(1, 2, "string"); @@ -191,9 +191,9 @@ new (b.f)(1, 2, "string"); >b.f : new (x: number, y: number, ...z: string[]) => any >b : A >f : new (x: number, y: number, ...z: string[]) => any ->1 : number ->2 : number ->"string" : string +>1 : 1 +>2 : 2 +>"string" : "string" new (b.f)(1, 2, ...a); >new (b.f)(1, 2, ...a) : any @@ -201,8 +201,8 @@ new (b.f)(1, 2, ...a); >b.f : new (x: number, y: number, ...z: string[]) => any >b : A >f : new (x: number, y: number, ...z: string[]) => any ->1 : number ->2 : number +>1 : 1 +>2 : 2 >...a : string >a : string[] @@ -212,11 +212,11 @@ new (b.f)(1, 2, ...a, "string"); >b.f : new (x: number, y: number, ...z: string[]) => any >b : A >f : new (x: number, y: number, ...z: string[]) => any ->1 : number ->2 : number +>1 : 1 +>2 : 2 >...a : string >a : string[] ->"string" : string +>"string" : "string" // Element access expression new d[1].f(1, 2, "string"); @@ -224,21 +224,21 @@ new d[1].f(1, 2, "string"); >d[1].f : new (x: number, y: number, ...z: string[]) => any >d[1] : A >d : A[] ->1 : number +>1 : 1 >f : new (x: number, y: number, ...z: string[]) => any ->1 : number ->2 : number ->"string" : string +>1 : 1 +>2 : 2 +>"string" : "string" new d[1].f(1, 2, ...a); >new d[1].f(1, 2, ...a) : any >d[1].f : new (x: number, y: number, ...z: string[]) => any >d[1] : A >d : A[] ->1 : number +>1 : 1 >f : new (x: number, y: number, ...z: string[]) => any ->1 : number ->2 : number +>1 : 1 +>2 : 2 >...a : string >a : string[] @@ -247,13 +247,13 @@ new d[1].f(1, 2, ...a, "string"); >d[1].f : new (x: number, y: number, ...z: string[]) => any >d[1] : A >d : A[] ->1 : number +>1 : 1 >f : new (x: number, y: number, ...z: string[]) => any ->1 : number ->2 : number +>1 : 1 +>2 : 2 >...a : string >a : string[] ->"string" : string +>"string" : "string" // Element access expression with a punctuated key new e["a-b"].f(1, 2, "string"); @@ -261,21 +261,21 @@ new e["a-b"].f(1, 2, "string"); >e["a-b"].f : new (x: number, y: number, ...z: string[]) => any >e["a-b"] : A >e : { [key: string]: A; } ->"a-b" : string +>"a-b" : "a-b" >f : new (x: number, y: number, ...z: string[]) => any ->1 : number ->2 : number ->"string" : string +>1 : 1 +>2 : 2 +>"string" : "string" new e["a-b"].f(1, 2, ...a); >new e["a-b"].f(1, 2, ...a) : any >e["a-b"].f : new (x: number, y: number, ...z: string[]) => any >e["a-b"] : A >e : { [key: string]: A; } ->"a-b" : string +>"a-b" : "a-b" >f : new (x: number, y: number, ...z: string[]) => any ->1 : number ->2 : number +>1 : 1 +>2 : 2 >...a : string >a : string[] @@ -284,56 +284,56 @@ new e["a-b"].f(1, 2, ...a, "string"); >e["a-b"].f : new (x: number, y: number, ...z: string[]) => any >e["a-b"] : A >e : { [key: string]: A; } ->"a-b" : string +>"a-b" : "a-b" >f : new (x: number, y: number, ...z: string[]) => any ->1 : number ->2 : number +>1 : 1 +>2 : 2 >...a : string >a : string[] ->"string" : string +>"string" : "string" // Basic expression new B(1, 2, "string"); >new B(1, 2, "string") : B >B : typeof B ->1 : number ->2 : number ->"string" : string +>1 : 1 +>2 : 2 +>"string" : "string" new B(1, 2, ...a); >new B(1, 2, ...a) : B >B : typeof B ->1 : number ->2 : number +>1 : 1 +>2 : 2 >...a : string >a : string[] new B(1, 2, ...a, "string"); >new B(1, 2, ...a, "string") : B >B : typeof B ->1 : number ->2 : number +>1 : 1 +>2 : 2 >...a : string >a : string[] ->"string" : string +>"string" : "string" // Property access expression new c["a-b"](1, 2, "string"); >new c["a-b"](1, 2, "string") : B >c["a-b"] : typeof B >c : C ->"a-b" : string ->1 : number ->2 : number ->"string" : string +>"a-b" : "a-b" +>1 : 1 +>2 : 2 +>"string" : "string" new c["a-b"](1, 2, ...a); >new c["a-b"](1, 2, ...a) : B >c["a-b"] : typeof B >c : C ->"a-b" : string ->1 : number ->2 : number +>"a-b" : "a-b" +>1 : 1 +>2 : 2 >...a : string >a : string[] @@ -341,12 +341,12 @@ new c["a-b"](1, 2, ...a, "string"); >new c["a-b"](1, 2, ...a, "string") : B >c["a-b"] : typeof B >c : C ->"a-b" : string ->1 : number ->2 : number +>"a-b" : "a-b" +>1 : 1 +>2 : 2 >...a : string >a : string[] ->"string" : string +>"string" : "string" // Parenthesised expression new (c["a-b"])(1, 2, "string"); @@ -354,19 +354,19 @@ new (c["a-b"])(1, 2, "string"); >(c["a-b"]) : typeof B >c["a-b"] : typeof B >c : C ->"a-b" : string ->1 : number ->2 : number ->"string" : string +>"a-b" : "a-b" +>1 : 1 +>2 : 2 +>"string" : "string" new (c["a-b"])(1, 2, ...a); >new (c["a-b"])(1, 2, ...a) : B >(c["a-b"]) : typeof B >c["a-b"] : typeof B >c : C ->"a-b" : string ->1 : number ->2 : number +>"a-b" : "a-b" +>1 : 1 +>2 : 2 >...a : string >a : string[] @@ -375,12 +375,12 @@ new (c["a-b"])(1, 2, ...a, "string"); >(c["a-b"]) : typeof B >c["a-b"] : typeof B >c : C ->"a-b" : string ->1 : number ->2 : number +>"a-b" : "a-b" +>1 : 1 +>2 : 2 >...a : string >a : string[] ->"string" : string +>"string" : "string" // Element access expression new g[1]["a-b"](1, 2, "string"); @@ -388,21 +388,21 @@ new g[1]["a-b"](1, 2, "string"); >g[1]["a-b"] : typeof B >g[1] : C >g : C[] ->1 : number ->"a-b" : string ->1 : number ->2 : number ->"string" : string +>1 : 1 +>"a-b" : "a-b" +>1 : 1 +>2 : 2 +>"string" : "string" new g[1]["a-b"](1, 2, ...a); >new g[1]["a-b"](1, 2, ...a) : B >g[1]["a-b"] : typeof B >g[1] : C >g : C[] ->1 : number ->"a-b" : string ->1 : number ->2 : number +>1 : 1 +>"a-b" : "a-b" +>1 : 1 +>2 : 2 >...a : string >a : string[] @@ -411,13 +411,13 @@ new g[1]["a-b"](1, 2, ...a, "string"); >g[1]["a-b"] : typeof B >g[1] : C >g : C[] ->1 : number ->"a-b" : string ->1 : number ->2 : number +>1 : 1 +>"a-b" : "a-b" +>1 : 1 +>2 : 2 >...a : string >a : string[] ->"string" : string +>"string" : "string" // Element access expression with a punctuated key new h["a-b"]["a-b"](1, 2, "string"); @@ -425,21 +425,21 @@ new h["a-b"]["a-b"](1, 2, "string"); >h["a-b"]["a-b"] : typeof B >h["a-b"] : C >h : { [key: string]: C; } ->"a-b" : string ->"a-b" : string ->1 : number ->2 : number ->"string" : string +>"a-b" : "a-b" +>"a-b" : "a-b" +>1 : 1 +>2 : 2 +>"string" : "string" new h["a-b"]["a-b"](1, 2, ...a); >new h["a-b"]["a-b"](1, 2, ...a) : B >h["a-b"]["a-b"] : typeof B >h["a-b"] : C >h : { [key: string]: C; } ->"a-b" : string ->"a-b" : string ->1 : number ->2 : number +>"a-b" : "a-b" +>"a-b" : "a-b" +>1 : 1 +>2 : 2 >...a : string >a : string[] @@ -448,13 +448,13 @@ new h["a-b"]["a-b"](1, 2, ...a, "string"); >h["a-b"]["a-b"] : typeof B >h["a-b"] : C >h : { [key: string]: C; } ->"a-b" : string ->"a-b" : string ->1 : number ->2 : number +>"a-b" : "a-b" +>"a-b" : "a-b" +>1 : 1 +>2 : 2 >...a : string >a : string[] ->"string" : string +>"string" : "string" // Element access expression with a number new i["a-b"][1](1, 2, "string"); @@ -462,21 +462,21 @@ new i["a-b"][1](1, 2, "string"); >i["a-b"][1] : any >i["a-b"] : any >i : C[][] ->"a-b" : string ->1 : number ->1 : number ->2 : number ->"string" : string +>"a-b" : "a-b" +>1 : 1 +>1 : 1 +>2 : 2 +>"string" : "string" new i["a-b"][1](1, 2, ...a); >new i["a-b"][1](1, 2, ...a) : any >i["a-b"][1] : any >i["a-b"] : any >i : C[][] ->"a-b" : string ->1 : number ->1 : number ->2 : number +>"a-b" : "a-b" +>1 : 1 +>1 : 1 +>2 : 2 >...a : string >a : string[] @@ -485,11 +485,11 @@ new i["a-b"][1](1, 2, ...a, "string"); >i["a-b"][1] : any >i["a-b"] : any >i : C[][] ->"a-b" : string ->1 : number ->1 : number ->2 : number +>"a-b" : "a-b" +>1 : 1 +>1 : 1 +>2 : 2 >...a : string >a : string[] ->"string" : string +>"string" : "string" diff --git a/tests/baselines/reference/noCollisionThisExpressionAndLocalVarInConstructor.types b/tests/baselines/reference/noCollisionThisExpressionAndLocalVarInConstructor.types index 8c3cc633c10..da98162609f 100644 --- a/tests/baselines/reference/noCollisionThisExpressionAndLocalVarInConstructor.types +++ b/tests/baselines/reference/noCollisionThisExpressionAndLocalVarInConstructor.types @@ -15,7 +15,7 @@ class class1 { var _this = 2; >_this : number ->2 : number +>2 : 2 return callback(_this); >callback(_this) : any @@ -32,7 +32,7 @@ class class2 { constructor() { var _this = 2; >_this : number ->2 : number +>2 : 2 var x2 = { >x2 : { doStuff: (callback: any) => () => any; } diff --git a/tests/baselines/reference/noCollisionThisExpressionAndLocalVarInFunction.types b/tests/baselines/reference/noCollisionThisExpressionAndLocalVarInFunction.types index 3edf54a594f..1094638c7a1 100644 --- a/tests/baselines/reference/noCollisionThisExpressionAndLocalVarInFunction.types +++ b/tests/baselines/reference/noCollisionThisExpressionAndLocalVarInFunction.types @@ -11,7 +11,7 @@ function x() { var _this = 5; >_this : number ->5 : number +>5 : 5 x => { console.log(_this); }; >x => { console.log(_this); } : (x: any) => void diff --git a/tests/baselines/reference/noCollisionThisExpressionAndLocalVarInLambda.types b/tests/baselines/reference/noCollisionThisExpressionAndLocalVarInLambda.types index 83732f9c350..a0a9a25c516 100644 --- a/tests/baselines/reference/noCollisionThisExpressionAndLocalVarInLambda.types +++ b/tests/baselines/reference/noCollisionThisExpressionAndLocalVarInLambda.types @@ -15,7 +15,7 @@ var x = { var _this = 2; >_this : number ->2 : number +>2 : 2 return callback(_this); >callback(_this) : any diff --git a/tests/baselines/reference/noCollisionThisExpressionAndLocalVarInMethod.types b/tests/baselines/reference/noCollisionThisExpressionAndLocalVarInMethod.types index 49d0e3ed93a..6cec96104b5 100644 --- a/tests/baselines/reference/noCollisionThisExpressionAndLocalVarInMethod.types +++ b/tests/baselines/reference/noCollisionThisExpressionAndLocalVarInMethod.types @@ -1,7 +1,7 @@ === tests/cases/compiler/noCollisionThisExpressionAndLocalVarInMethod.ts === var _this = 2; >_this : number ->2 : number +>2 : 2 class a { >a : a @@ -20,7 +20,7 @@ class a { var _this = 2; >_this : number ->2 : number +>2 : 2 return callback(_this); >callback(_this) : any @@ -34,7 +34,7 @@ class a { var _this = 2; >_this : number ->2 : number +>2 : 2 return { >{ doStuff: (callback) => () => { return callback(_this); } } : { doStuff: (callback: any) => () => any; } diff --git a/tests/baselines/reference/noCollisionThisExpressionAndLocalVarInProperty.types b/tests/baselines/reference/noCollisionThisExpressionAndLocalVarInProperty.types index 8918ccc825c..e118d925515 100644 --- a/tests/baselines/reference/noCollisionThisExpressionAndLocalVarInProperty.types +++ b/tests/baselines/reference/noCollisionThisExpressionAndLocalVarInProperty.types @@ -14,7 +14,7 @@ class class1 { var _this = 2; >_this : number ->2 : number +>2 : 2 return callback(_this); >callback(_this) : any @@ -30,7 +30,7 @@ class class2 { constructor() { var _this = 2; >_this : number ->2 : number +>2 : 2 } public prop1 = { >prop1 : { doStuff: (callback: any) => () => any; } @@ -45,7 +45,7 @@ class class2 { return callback(10); >callback(10) : any >callback : any ->10 : number +>10 : 10 } } } diff --git a/tests/baselines/reference/noCollisionThisExpressionAndVarInGlobal.types b/tests/baselines/reference/noCollisionThisExpressionAndVarInGlobal.types index c5943ef5c14..36332f39505 100644 --- a/tests/baselines/reference/noCollisionThisExpressionAndVarInGlobal.types +++ b/tests/baselines/reference/noCollisionThisExpressionAndVarInGlobal.types @@ -1,7 +1,7 @@ === tests/cases/compiler/noCollisionThisExpressionAndVarInGlobal.ts === var _this = 1; >_this : number ->1 : number +>1 : 1 var f = () => _this; >f : () => number diff --git a/tests/baselines/reference/noCollisionThisExpressionInFunctionAndVarInGlobal.types b/tests/baselines/reference/noCollisionThisExpressionInFunctionAndVarInGlobal.types index ba65e03ba59..6fb54bbdf9e 100644 --- a/tests/baselines/reference/noCollisionThisExpressionInFunctionAndVarInGlobal.types +++ b/tests/baselines/reference/noCollisionThisExpressionInFunctionAndVarInGlobal.types @@ -8,7 +8,7 @@ var console: { } var _this = 5; >_this : number ->5 : number +>5 : 5 function x() { >x : () => void diff --git a/tests/baselines/reference/noEmitOnError.errors.txt b/tests/baselines/reference/noEmitOnError.errors.txt index e03e5948092..87a71c30756 100644 --- a/tests/baselines/reference/noEmitOnError.errors.txt +++ b/tests/baselines/reference/noEmitOnError.errors.txt @@ -1,9 +1,9 @@ -tests/cases/compiler/noEmitOnError.ts(2,5): error TS2322: Type 'string' is not assignable to type 'number'. +tests/cases/compiler/noEmitOnError.ts(2,5): error TS2322: Type '""' is not assignable to type 'number'. ==== tests/cases/compiler/noEmitOnError.ts (1 errors) ==== var x: number = ""; ~ -!!! error TS2322: Type 'string' is not assignable to type 'number'. +!!! error TS2322: Type '""' is not assignable to type 'number'. \ No newline at end of file diff --git a/tests/baselines/reference/noErrorTruncation.errors.txt b/tests/baselines/reference/noErrorTruncation.errors.txt index d27fad84e50..af3acb54bba 100644 --- a/tests/baselines/reference/noErrorTruncation.errors.txt +++ b/tests/baselines/reference/noErrorTruncation.errors.txt @@ -1,4 +1,4 @@ -tests/cases/compiler/noErrorTruncation.ts(10,7): error TS2322: Type 'number' is not assignable to type '{ someLongOptionA: string; } | { someLongOptionB: string; } | { someLongOptionC: string; } | { someLongOptionD: string; } | { someLongOptionE: string; } | { someLongOptionF: string; }'. +tests/cases/compiler/noErrorTruncation.ts(10,7): error TS2322: Type '42' is not assignable to type '{ someLongOptionA: string; } | { someLongOptionB: string; } | { someLongOptionC: string; } | { someLongOptionD: string; } | { someLongOptionE: string; } | { someLongOptionF: string; }'. ==== tests/cases/compiler/noErrorTruncation.ts (1 errors) ==== @@ -13,7 +13,7 @@ tests/cases/compiler/noErrorTruncation.ts(10,7): error TS2322: Type 'number' is const x: SomeLongOptionA ~ -!!! error TS2322: Type 'number' is not assignable to type '{ someLongOptionA: string; } | { someLongOptionB: string; } | { someLongOptionC: string; } | { someLongOptionD: string; } | { someLongOptionE: string; } | { someLongOptionF: string; }'. +!!! error TS2322: Type '42' is not assignable to type '{ someLongOptionA: string; } | { someLongOptionB: string; } | { someLongOptionC: string; } | { someLongOptionD: string; } | { someLongOptionE: string; } | { someLongOptionF: string; }'. | SomeLongOptionB | SomeLongOptionC | SomeLongOptionD diff --git a/tests/baselines/reference/noImplicitAnyDestructuringVarDeclaration2.types b/tests/baselines/reference/noImplicitAnyDestructuringVarDeclaration2.types index ef0a3f2c25b..c494d0795dd 100644 --- a/tests/baselines/reference/noImplicitAnyDestructuringVarDeclaration2.types +++ b/tests/baselines/reference/noImplicitAnyDestructuringVarDeclaration2.types @@ -4,21 +4,21 @@ let [a, b, c] = [1, 2, 3]; // no error >b : number >c : number >[1, 2, 3] : [number, number, number] ->1 : number ->2 : number ->3 : number +>1 : 1 +>2 : 2 +>3 : 3 let [a1 = 10, b1 = 10, c1 = 10] = [1, 2, 3]; // no error >a1 : number ->10 : number +>10 : 10 >b1 : number ->10 : number +>10 : 10 >c1 : number ->10 : number +>10 : 10 >[1, 2, 3] : [number, number, number] ->1 : number ->2 : number ->3 : number +>1 : 1 +>2 : 2 +>3 : 3 let [a2 = undefined, b2 = undefined, c2 = undefined] = [1, 2, 3]; // no error >a2 : number @@ -28,24 +28,24 @@ let [a2 = undefined, b2 = undefined, c2 = undefined] = [1, 2, 3]; // no error >c2 : number >undefined : undefined >[1, 2, 3] : [number, number, number] ->1 : number ->2 : number ->3 : number +>1 : 1 +>2 : 2 +>3 : 3 let [a3 = undefined, b3 = null, c3 = undefined] = [1, 2, 3]; // no error ->a3 : number +>a3 : any >undefined : any >undefined : undefined ->b3 : number +>b3 : any >null : any >null : null ->c3 : number +>c3 : any >undefined : any >undefined : undefined >[1, 2, 3] : [number, number, number] ->1 : number ->2 : number ->3 : number +>1 : 1 +>2 : 2 +>3 : 3 let [a4] = [undefined], [b4] = [null], c4 = undefined, d4 = null; // no error >a4 : any @@ -69,26 +69,26 @@ let {x, y, z} = { x: 1, y: 2, z: 3 }; // no error >z : number >{ x: 1, y: 2, z: 3 } : { x: number; y: number; z: number; } >x : number ->1 : number +>1 : 1 >y : number ->2 : number +>2 : 2 >z : number ->3 : number +>3 : 3 let {x1 = 10, y1 = 10, z1 = 10} = { x1: 1, y1: 2, z1: 3 }; // no error >x1 : number ->10 : number +>10 : 10 >y1 : number ->10 : number +>10 : 10 >z1 : number ->10 : number +>10 : 10 >{ x1: 1, y1: 2, z1: 3 } : { x1?: number; y1?: number; z1?: number; } >x1 : number ->1 : number +>1 : 1 >y1 : number ->2 : number +>2 : 2 >z1 : number ->3 : number +>3 : 3 let {x2 = undefined, y2 = undefined, z2 = undefined} = { x2: 1, y2: 2, z2: 3 }; // no error >x2 : number @@ -99,29 +99,29 @@ let {x2 = undefined, y2 = undefined, z2 = undefined} = { x2: 1, y2: 2, z2: 3 }; >undefined : undefined >{ x2: 1, y2: 2, z2: 3 } : { x2?: number; y2?: number; z2?: number; } >x2 : number ->1 : number +>1 : 1 >y2 : number ->2 : number +>2 : 2 >z2 : number ->3 : number +>3 : 3 let {x3 = undefined, y3 = null, z3 = undefined} = { x3: 1, y3: 2, z3: 3 }; // no error ->x3 : number +>x3 : any >undefined : any >undefined : undefined ->y3 : number +>y3 : any >null : any >null : null ->z3 : number +>z3 : any >undefined : any >undefined : undefined >{ x3: 1, y3: 2, z3: 3 } : { x3?: number; y3?: number; z3?: number; } >x3 : number ->1 : number +>1 : 1 >y3 : number ->2 : number +>2 : 2 >z3 : number ->3 : number +>3 : 3 let {x4} = { x4: undefined }, {y4} = { y4: null }; // no error >x4 : any diff --git a/tests/baselines/reference/noImplicitAnyInContextuallyTypesFunctionParamter.types b/tests/baselines/reference/noImplicitAnyInContextuallyTypesFunctionParamter.types index afe2ff7bd22..928185a0953 100644 --- a/tests/baselines/reference/noImplicitAnyInContextuallyTypesFunctionParamter.types +++ b/tests/baselines/reference/noImplicitAnyInContextuallyTypesFunctionParamter.types @@ -3,8 +3,8 @@ var regexMatchList = ['', '']; >regexMatchList : string[] >['', ''] : string[] ->'' : string ->'' : string +>'' : "" +>'' : "" regexMatchList.forEach(match => ''.replace(match, '')); >regexMatchList.forEach(match => ''.replace(match, '')) : void @@ -15,8 +15,8 @@ regexMatchList.forEach(match => ''.replace(match, '')); >match : string >''.replace(match, '') : string >''.replace : { (searchValue: string, replaceValue: string): string; (searchValue: string, replacer: (substring: string, ...args: any[]) => string): string; (searchValue: RegExp, replaceValue: string): string; (searchValue: RegExp, replacer: (substring: string, ...args: any[]) => string): string; } ->'' : string +>'' : "" >replace : { (searchValue: string, replaceValue: string): string; (searchValue: string, replacer: (substring: string, ...args: any[]) => string): string; (searchValue: RegExp, replaceValue: string): string; (searchValue: RegExp, replacer: (substring: string, ...args: any[]) => string): string; } >match : string ->'' : string +>'' : "" diff --git a/tests/baselines/reference/noImplicitAnyIndexingSuppressed.types b/tests/baselines/reference/noImplicitAnyIndexingSuppressed.types index d82b37e0f9e..6bb0c04fbb0 100644 --- a/tests/baselines/reference/noImplicitAnyIndexingSuppressed.types +++ b/tests/baselines/reference/noImplicitAnyIndexingSuppressed.types @@ -12,7 +12,7 @@ var strRepresentation1 = MyEmusEnum[0] >strRepresentation1 : string >MyEmusEnum[0] : string >MyEmusEnum : typeof MyEmusEnum ->0 : number +>0 : 0 // Should be okay; should be a string. var strRepresentation2 = MyEmusEnum[MyEmusEnum.emu] @@ -28,14 +28,14 @@ var strRepresentation3 = MyEmusEnum["monehh"]; >strRepresentation3 : any >MyEmusEnum["monehh"] : any >MyEmusEnum : typeof MyEmusEnum ->"monehh" : string +>"monehh" : "monehh" // Should be okay; should be a MyEmusEnum var strRepresentation4 = MyEmusEnum["emu"]; >strRepresentation4 : MyEmusEnum >MyEmusEnum["emu"] : MyEmusEnum >MyEmusEnum : typeof MyEmusEnum ->"emu" : string +>"emu" : "emu" // Should be okay, as we suppress implicit 'any' property access checks @@ -43,18 +43,18 @@ var x = {}["hi"]; >x : any >{}["hi"] : any >{} : {} ->"hi" : string +>"hi" : "hi" // Should be okay, as we suppress implicit 'any' property access checks var y = {}[10]; >y : any >{}[10] : any >{} : {} ->10 : number +>10 : 10 var hi: any = "hi"; >hi : any ->"hi" : string +>"hi" : "hi" var emptyObj = {}; >emptyObj : {} @@ -90,13 +90,13 @@ var m: MyMap = { >{ "0": 0, "1": 1, "2": 2, "Okay that's enough for today.": NaN} : { "0": number; "1": number; "2": number; "Okay that's enough for today.": number; } "0": 0, ->0 : number +>0 : 0 "1": 1, ->1 : number +>1 : 1 "2": 2, ->2 : number +>2 : 2 "Okay that's enough for today.": NaN >NaN : number diff --git a/tests/baselines/reference/noImplicitReturnsInAsync1.types b/tests/baselines/reference/noImplicitReturnsInAsync1.types index 1dfc098675c..19da8fdfaf4 100644 --- a/tests/baselines/reference/noImplicitReturnsInAsync1.types +++ b/tests/baselines/reference/noImplicitReturnsInAsync1.types @@ -3,7 +3,7 @@ async function test(isError: boolean = false) { >test : (isError?: boolean) => Promise >isError : boolean ->false : boolean +>false : false if (isError === true) { >isError === true : boolean @@ -19,5 +19,5 @@ async function test(isError: boolean = false) { >Promise.resolve : { (value: T | PromiseLike): Promise; (): Promise; } >Promise : PromiseConstructor >resolve : { (value: T | PromiseLike): Promise; (): Promise; } ->"The test is passed without an error." : string +>"The test is passed without an error." : "The test is passed without an error." } diff --git a/tests/baselines/reference/noImplicitReturnsWithProtectedBlocks1.types b/tests/baselines/reference/noImplicitReturnsWithProtectedBlocks1.types index 90db4fb42e1..87214276b7c 100644 --- a/tests/baselines/reference/noImplicitReturnsWithProtectedBlocks1.types +++ b/tests/baselines/reference/noImplicitReturnsWithProtectedBlocks1.types @@ -18,6 +18,6 @@ function main1() : number { log("in finally"); >log("in finally") : void >log : (s: string) => void ->"in finally" : string +>"in finally" : "in finally" } } diff --git a/tests/baselines/reference/noImplicitUseStrict_amd.types b/tests/baselines/reference/noImplicitUseStrict_amd.types index c9e1b5749dc..5eec5bf57af 100644 --- a/tests/baselines/reference/noImplicitUseStrict_amd.types +++ b/tests/baselines/reference/noImplicitUseStrict_amd.types @@ -2,5 +2,5 @@ export var x = 0; >x : number ->0 : number +>0 : 0 diff --git a/tests/baselines/reference/noImplicitUseStrict_commonjs.types b/tests/baselines/reference/noImplicitUseStrict_commonjs.types index 9999d3b94ba..ad7ed27dfe6 100644 --- a/tests/baselines/reference/noImplicitUseStrict_commonjs.types +++ b/tests/baselines/reference/noImplicitUseStrict_commonjs.types @@ -2,5 +2,5 @@ export var x = 0; >x : number ->0 : number +>0 : 0 diff --git a/tests/baselines/reference/noImplicitUseStrict_es6.types b/tests/baselines/reference/noImplicitUseStrict_es6.types index 838c7316be0..38a83033ff7 100644 --- a/tests/baselines/reference/noImplicitUseStrict_es6.types +++ b/tests/baselines/reference/noImplicitUseStrict_es6.types @@ -2,5 +2,5 @@ export var x = 0; >x : number ->0 : number +>0 : 0 diff --git a/tests/baselines/reference/noImplicitUseStrict_system.types b/tests/baselines/reference/noImplicitUseStrict_system.types index 1da563f938b..66246719284 100644 --- a/tests/baselines/reference/noImplicitUseStrict_system.types +++ b/tests/baselines/reference/noImplicitUseStrict_system.types @@ -2,5 +2,5 @@ export var x = 0; >x : number ->0 : number +>0 : 0 diff --git a/tests/baselines/reference/noImplicitUseStrict_umd.types b/tests/baselines/reference/noImplicitUseStrict_umd.types index 6a3fd6ece77..102f21c238b 100644 --- a/tests/baselines/reference/noImplicitUseStrict_umd.types +++ b/tests/baselines/reference/noImplicitUseStrict_umd.types @@ -2,5 +2,5 @@ export var x = 0; >x : number ->0 : number +>0 : 0 diff --git a/tests/baselines/reference/noReachabilityErrorsOnEmptyStatement.types b/tests/baselines/reference/noReachabilityErrorsOnEmptyStatement.types index e90fa04699b..c971741c5f1 100644 --- a/tests/baselines/reference/noReachabilityErrorsOnEmptyStatement.types +++ b/tests/baselines/reference/noReachabilityErrorsOnEmptyStatement.types @@ -3,5 +3,5 @@ function foo() { >foo : () => number return 1;; ->1 : number +>1 : 1 } diff --git a/tests/baselines/reference/nodeResolution1.types b/tests/baselines/reference/nodeResolution1.types index 4f29acfcc03..cd4feb3aba8 100644 --- a/tests/baselines/reference/nodeResolution1.types +++ b/tests/baselines/reference/nodeResolution1.types @@ -6,5 +6,5 @@ import y = require("./a"); export var x = 1; >x : number ->1 : number +>1 : 1 diff --git a/tests/baselines/reference/nodeResolution4.types b/tests/baselines/reference/nodeResolution4.types index b273b203bde..f52f28df25a 100644 --- a/tests/baselines/reference/nodeResolution4.types +++ b/tests/baselines/reference/nodeResolution4.types @@ -6,7 +6,7 @@ import y = require("./a"); var x = 1; >x : number ->1 : number +>1 : 1 === tests/cases/compiler/a.ts === /// diff --git a/tests/baselines/reference/nodeResolution6.types b/tests/baselines/reference/nodeResolution6.types index 13c5d6d9276..9e685e8c493 100644 --- a/tests/baselines/reference/nodeResolution6.types +++ b/tests/baselines/reference/nodeResolution6.types @@ -6,7 +6,7 @@ import y = require("a"); var x = 1; >x : number ->1 : number +>1 : 1 === tests/cases/compiler/node_modules/a.d.ts === /// diff --git a/tests/baselines/reference/nodeResolution8.types b/tests/baselines/reference/nodeResolution8.types index cced0d3008d..757af64a0ef 100644 --- a/tests/baselines/reference/nodeResolution8.types +++ b/tests/baselines/reference/nodeResolution8.types @@ -6,7 +6,7 @@ import y = require("a"); var x = 1; >x : number ->1 : number +>1 : 1 === tests/cases/compiler/node_modules/a/index.d.ts === /// diff --git a/tests/baselines/reference/nonInstantiatedModule.types b/tests/baselines/reference/nonInstantiatedModule.types index c1aac2824dc..97231a5e2c6 100644 --- a/tests/baselines/reference/nonInstantiatedModule.types +++ b/tests/baselines/reference/nonInstantiatedModule.types @@ -9,7 +9,7 @@ module M { export var a = 1; >a : number ->1 : number +>1 : 1 } // primary expression @@ -52,9 +52,9 @@ module M2 { return { x: 0, y: 0 }; >{ x: 0, y: 0 } : { x: number; y: number; } >x : number ->0 : number +>0 : 0 >y : number ->0 : number +>0 : 0 } } diff --git a/tests/baselines/reference/nonIterableRestElement1.types b/tests/baselines/reference/nonIterableRestElement1.types index a15fe5afd38..c226eb04138 100644 --- a/tests/baselines/reference/nonIterableRestElement1.types +++ b/tests/baselines/reference/nonIterableRestElement1.types @@ -9,6 +9,6 @@ var c = {}; >...c : any >c : {} >["", 0] : (string | number)[] ->"" : string ->0 : number +>"" : "" +>0 : 0 diff --git a/tests/baselines/reference/nonIterableRestElement2.types b/tests/baselines/reference/nonIterableRestElement2.types index c39a592d2e6..af99cc04655 100644 --- a/tests/baselines/reference/nonIterableRestElement2.types +++ b/tests/baselines/reference/nonIterableRestElement2.types @@ -9,6 +9,6 @@ var c = {}; >...c : any >c : {} >["", 0] : (string | number)[] ->"" : string ->0 : number +>"" : "" +>0 : 0 diff --git a/tests/baselines/reference/null.types b/tests/baselines/reference/null.types index 6fd8b423f13..35c084c3cbf 100644 --- a/tests/baselines/reference/null.types +++ b/tests/baselines/reference/null.types @@ -7,13 +7,13 @@ var x=null; var y=3+x; >y : any >3+x : any ->3 : number +>3 : 3 >x : any var z=3+null; >z : number >3+null : number ->3 : number +>3 : 3 >null : null class C { @@ -36,7 +36,7 @@ function g() { >null : null return 3; ->3 : number +>3 : 3 } interface I { >I : I @@ -54,7 +54,7 @@ var w:I={x:null,y:3}; >x : null >null : null >y : number ->3 : number +>3 : 3 diff --git a/tests/baselines/reference/nullIsSubtypeOfEverythingButUndefined.types b/tests/baselines/reference/nullIsSubtypeOfEverythingButUndefined.types index 42243076e9f..a65baab4442 100644 --- a/tests/baselines/reference/nullIsSubtypeOfEverythingButUndefined.types +++ b/tests/baselines/reference/nullIsSubtypeOfEverythingButUndefined.types @@ -4,14 +4,14 @@ var r0 = true ? null : null; >r0 : any >true ? null : null : null ->true : boolean +>true : true >null : null >null : null var r0 = true ? null : null; >r0 : any >true ? null : null : null ->true : boolean +>true : true >null : null >null : null @@ -22,63 +22,63 @@ var u: typeof undefined; var r0b = true ? u : null; >r0b : any >true ? u : null : any ->true : boolean +>true : true >u : any >null : null var r0b = true ? null : u; >r0b : any >true ? null : u : any ->true : boolean +>true : true >null : null >u : any var r1 = true ? 1 : null; >r1 : number ->true ? 1 : null : number ->true : boolean ->1 : number +>true ? 1 : null : 1 +>true : true +>1 : 1 >null : null var r1 = true ? null : 1; >r1 : number ->true ? null : 1 : number ->true : boolean +>true ? null : 1 : 1 +>true : true >null : null ->1 : number +>1 : 1 var r2 = true ? '' : null; >r2 : string ->true ? '' : null : string ->true : boolean ->'' : string +>true ? '' : null : "" +>true : true +>'' : "" >null : null var r2 = true ? null : ''; >r2 : string ->true ? null : '' : string ->true : boolean +>true ? null : '' : "" +>true : true >null : null ->'' : string +>'' : "" var r3 = true ? true : null; >r3 : boolean ->true ? true : null : boolean ->true : boolean ->true : boolean +>true ? true : null : true +>true : true +>true : true >null : null var r3 = true ? null : true; >r3 : boolean ->true ? null : true : boolean ->true : boolean +>true ? null : true : true +>true : true >null : null ->true : boolean +>true : true var r4 = true ? new Date() : null; >r4 : Date >true ? new Date() : null : Date ->true : boolean +>true : true >new Date() : Date >Date : DateConstructor >null : null @@ -86,7 +86,7 @@ var r4 = true ? new Date() : null; var r4 = true ? null : new Date(); >r4 : Date >true ? null : new Date() : Date ->true : boolean +>true : true >null : null >new Date() : Date >Date : DateConstructor @@ -94,53 +94,53 @@ var r4 = true ? null : new Date(); var r5 = true ? /1/ : null; >r5 : RegExp >true ? /1/ : null : RegExp ->true : boolean +>true : true >/1/ : RegExp >null : null var r5 = true ? null : /1/; >r5 : RegExp >true ? null : /1/ : RegExp ->true : boolean +>true : true >null : null >/1/ : RegExp var r6 = true ? { foo: 1 } : null; >r6 : { foo: number; } >true ? { foo: 1 } : null : { foo: number; } ->true : boolean +>true : true >{ foo: 1 } : { foo: number; } >foo : number ->1 : number +>1 : 1 >null : null var r6 = true ? null : { foo: 1 }; >r6 : { foo: number; } >true ? null : { foo: 1 } : { foo: number; } ->true : boolean +>true : true >null : null >{ foo: 1 } : { foo: number; } >foo : number ->1 : number +>1 : 1 var r7 = true ? () => { } : null; >r7 : () => void >true ? () => { } : null : () => void ->true : boolean +>true : true >() => { } : () => void >null : null var r7 = true ? null : () => { }; >r7 : () => void >true ? null : () => { } : () => void ->true : boolean +>true : true >null : null >() => { } : () => void var r8 = true ? (x: T) => { return x } : null; >r8 : (x: T) => T >true ? (x: T) => { return x } : null : (x: T) => T ->true : boolean +>true : true >(x: T) => { return x } : (x: T) => T >T : T >x : T @@ -151,7 +151,7 @@ var r8 = true ? (x: T) => { return x } : null; var r8b = true ? null : (x: T) => { return x }; // type parameters not identical across declarations >r8b : (x: T) => T >true ? null : (x: T) => { return x } : (x: T) => T ->true : boolean +>true : true >null : null >(x: T) => { return x } : (x: T) => T >T : T @@ -170,14 +170,14 @@ var i1: I1; var r9 = true ? i1 : null; >r9 : I1 >true ? i1 : null : I1 ->true : boolean +>true : true >i1 : I1 >null : null var r9 = true ? null : i1; >r9 : I1 >true ? null : i1 : I1 ->true : boolean +>true : true >null : null >i1 : I1 @@ -192,14 +192,14 @@ var c1: C1; var r10 = true ? c1 : null; >r10 : C1 >true ? c1 : null : C1 ->true : boolean +>true : true >c1 : C1 >null : null var r10 = true ? null : c1; >r10 : C1 >true ? null : c1 : C1 ->true : boolean +>true : true >null : null >c1 : C1 @@ -216,14 +216,14 @@ var c2: C2; var r12 = true ? c2 : null; >r12 : C2 >true ? c2 : null : C2 ->true : boolean +>true : true >c2 : C2 >null : null var r12 = true ? null : c2; >r12 : C2 >true ? null : c2 : C2 ->true : boolean +>true : true >null : null >c2 : C2 @@ -234,21 +234,21 @@ enum E { A } var r13 = true ? E : null; >r13 : typeof E >true ? E : null : typeof E ->true : boolean +>true : true >E : typeof E >null : null var r13 = true ? null : E; >r13 : typeof E >true ? null : E : typeof E ->true : boolean +>true : true >null : null >E : typeof E var r14 = true ? E.A : null; >r14 : E >true ? E.A : null : E ->true : boolean +>true : true >E.A : E >E : typeof E >A : E @@ -257,7 +257,7 @@ var r14 = true ? E.A : null; var r14 = true ? null : E.A; >r14 : E >true ? null : E.A : E ->true : boolean +>true : true >null : null >E.A : E >E : typeof E @@ -271,7 +271,7 @@ module f { export var bar = 1; >bar : number ->1 : number +>1 : 1 } var af: typeof f; >af : typeof f @@ -280,14 +280,14 @@ var af: typeof f; var r15 = true ? af : null; >r15 : typeof f >true ? af : null : typeof f ->true : boolean +>true : true >af : typeof f >null : null var r15 = true ? null : af; >r15 : typeof f >true ? null : af : typeof f ->true : boolean +>true : true >null : null >af : typeof f @@ -300,7 +300,7 @@ module c { export var bar = 1; >bar : number ->1 : number +>1 : 1 } var ac: typeof c; >ac : typeof c @@ -309,14 +309,14 @@ var ac: typeof c; var r16 = true ? ac : null; >r16 : typeof c >true ? ac : null : typeof c ->true : boolean +>true : true >ac : typeof c >null : null var r16 = true ? null : ac; >r16 : typeof c >true ? null : ac : typeof c ->true : boolean +>true : true >null : null >ac : typeof c @@ -329,14 +329,14 @@ function f17(x: T) { var r17 = true ? x : null; >r17 : T >true ? x : null : T ->true : boolean +>true : true >x : T >null : null var r17 = true ? null : x; >r17 : T >true ? null : x : T ->true : boolean +>true : true >null : null >x : T } @@ -351,14 +351,14 @@ function f18(x: U) { var r18 = true ? x : null; >r18 : U >true ? x : null : U ->true : boolean +>true : true >x : U >null : null var r18 = true ? null : x; >r18 : U >true ? null : x : U ->true : boolean +>true : true >null : null >x : U } @@ -370,7 +370,7 @@ function f18(x: U) { var r19 = true ? new Object() : null; >r19 : Object >true ? new Object() : null : Object ->true : boolean +>true : true >new Object() : Object >Object : ObjectConstructor >null : null @@ -378,7 +378,7 @@ var r19 = true ? new Object() : null; var r19 = true ? null : new Object(); >r19 : Object >true ? null : new Object() : Object ->true : boolean +>true : true >null : null >new Object() : Object >Object : ObjectConstructor @@ -386,14 +386,14 @@ var r19 = true ? null : new Object(); var r20 = true ? {} : null; >r20 : {} >true ? {} : null : {} ->true : boolean +>true : true >{} : {} >null : null var r20 = true ? null : {}; >r20 : {} >true ? null : {} : {} ->true : boolean +>true : true >null : null >{} : {} diff --git a/tests/baselines/reference/nullOrUndefinedTypeGuardIsOrderIndependent.types b/tests/baselines/reference/nullOrUndefinedTypeGuardIsOrderIndependent.types index f599366e66e..4d5f6d11538 100644 --- a/tests/baselines/reference/nullOrUndefinedTypeGuardIsOrderIndependent.types +++ b/tests/baselines/reference/nullOrUndefinedTypeGuardIsOrderIndependent.types @@ -7,7 +7,7 @@ function test(strOrNull: string | null, strOrUndefined: string | undefined) { var str: string = "original"; >str : string ->"original" : string +>"original" : "original" var nil: null; >nil : null diff --git a/tests/baselines/reference/numberAsInLHS.types b/tests/baselines/reference/numberAsInLHS.types index 848f937c618..af2541bffe7 100644 --- a/tests/baselines/reference/numberAsInLHS.types +++ b/tests/baselines/reference/numberAsInLHS.types @@ -1,8 +1,8 @@ === tests/cases/compiler/numberAsInLHS.ts === 3 in [0, 1] >3 in [0, 1] : boolean ->3 : number +>3 : 3 >[0, 1] : number[] ->0 : number ->1 : number +>0 : 0 +>1 : 1 diff --git a/tests/baselines/reference/numberAssignableToEnumInsideUnion.js b/tests/baselines/reference/numberAssignableToEnumInsideUnion.js new file mode 100644 index 00000000000..584b395212d --- /dev/null +++ b/tests/baselines/reference/numberAssignableToEnumInsideUnion.js @@ -0,0 +1,14 @@ +//// [numberAssignableToEnumInsideUnion.ts] +enum E { A, B } +let n: number; +let z: E | boolean = n; + + +//// [numberAssignableToEnumInsideUnion.js] +var E; +(function (E) { + E[E["A"] = 0] = "A"; + E[E["B"] = 1] = "B"; +})(E || (E = {})); +var n; +var z = n; diff --git a/tests/baselines/reference/numberAssignableToEnumInsideUnion.symbols b/tests/baselines/reference/numberAssignableToEnumInsideUnion.symbols new file mode 100644 index 00000000000..4d815a99690 --- /dev/null +++ b/tests/baselines/reference/numberAssignableToEnumInsideUnion.symbols @@ -0,0 +1,14 @@ +=== tests/cases/compiler/numberAssignableToEnumInsideUnion.ts === +enum E { A, B } +>E : Symbol(E, Decl(numberAssignableToEnumInsideUnion.ts, 0, 0)) +>A : Symbol(E.A, Decl(numberAssignableToEnumInsideUnion.ts, 0, 8)) +>B : Symbol(E.B, Decl(numberAssignableToEnumInsideUnion.ts, 0, 11)) + +let n: number; +>n : Symbol(n, Decl(numberAssignableToEnumInsideUnion.ts, 1, 3)) + +let z: E | boolean = n; +>z : Symbol(z, Decl(numberAssignableToEnumInsideUnion.ts, 2, 3)) +>E : Symbol(E, Decl(numberAssignableToEnumInsideUnion.ts, 0, 0)) +>n : Symbol(n, Decl(numberAssignableToEnumInsideUnion.ts, 1, 3)) + diff --git a/tests/baselines/reference/numberAssignableToEnumInsideUnion.types b/tests/baselines/reference/numberAssignableToEnumInsideUnion.types new file mode 100644 index 00000000000..56d6efb0d1e --- /dev/null +++ b/tests/baselines/reference/numberAssignableToEnumInsideUnion.types @@ -0,0 +1,14 @@ +=== tests/cases/compiler/numberAssignableToEnumInsideUnion.ts === +enum E { A, B } +>E : E +>A : E.A +>B : E.B + +let n: number; +>n : number + +let z: E | boolean = n; +>z : boolean | E +>E : E +>n : number + diff --git a/tests/baselines/reference/numberPropertyAccess.types b/tests/baselines/reference/numberPropertyAccess.types index b7f5479ed79..e7ffcbc246d 100644 --- a/tests/baselines/reference/numberPropertyAccess.types +++ b/tests/baselines/reference/numberPropertyAccess.types @@ -1,7 +1,7 @@ === tests/cases/conformance/types/primitives/number/numberPropertyAccess.ts === var x = 1; >x : number ->1 : number +>1 : 1 var a = x.toExponential(); >a : string @@ -16,20 +16,20 @@ var b = x.hasOwnProperty('toFixed'); >x.hasOwnProperty : (v: string) => boolean >x : number >hasOwnProperty : (v: string) => boolean ->'toFixed' : string +>'toFixed' : "toFixed" var c = x['toExponential'](); >c : string >x['toExponential']() : string >x['toExponential'] : (fractionDigits?: number) => string >x : number ->'toExponential' : string +>'toExponential' : "toExponential" var d = x['hasOwnProperty']('toFixed'); >d : boolean >x['hasOwnProperty']('toFixed') : boolean >x['hasOwnProperty'] : (v: string) => boolean >x : number ->'hasOwnProperty' : string ->'toFixed' : string +>'hasOwnProperty' : "hasOwnProperty" +>'toFixed' : "toFixed" diff --git a/tests/baselines/reference/numberToString.errors.txt b/tests/baselines/reference/numberToString.errors.txt index 07cc9009a67..60a382e47c3 100644 --- a/tests/baselines/reference/numberToString.errors.txt +++ b/tests/baselines/reference/numberToString.errors.txt @@ -1,5 +1,5 @@ tests/cases/compiler/numberToString.ts(2,12): error TS2322: Type 'number' is not assignable to type 'string'. -tests/cases/compiler/numberToString.ts(9,4): error TS2345: Argument of type 'number' is not assignable to parameter of type 'string'. +tests/cases/compiler/numberToString.ts(9,4): error TS2345: Argument of type '3' is not assignable to parameter of type 'string'. ==== tests/cases/compiler/numberToString.ts (2 errors) ==== @@ -15,6 +15,6 @@ tests/cases/compiler/numberToString.ts(9,4): error TS2345: Argument of type 'num f1(3); f2(3); // error no coercion to string ~ -!!! error TS2345: Argument of type 'number' is not assignable to parameter of type 'string'. +!!! error TS2345: Argument of type '3' is not assignable to parameter of type 'string'. f2(3+""); // ok + operator promotes \ No newline at end of file diff --git a/tests/baselines/reference/numericIndexExpressions.errors.txt b/tests/baselines/reference/numericIndexExpressions.errors.txt index 2c3b8d76796..da0993ffee3 100644 --- a/tests/baselines/reference/numericIndexExpressions.errors.txt +++ b/tests/baselines/reference/numericIndexExpressions.errors.txt @@ -1,7 +1,7 @@ -tests/cases/compiler/numericIndexExpressions.ts(10,1): error TS2322: Type 'number' is not assignable to type 'string'. -tests/cases/compiler/numericIndexExpressions.ts(11,1): error TS2322: Type 'number' is not assignable to type 'string'. -tests/cases/compiler/numericIndexExpressions.ts(14,1): error TS2322: Type 'number' is not assignable to type 'string'. -tests/cases/compiler/numericIndexExpressions.ts(15,1): error TS2322: Type 'number' is not assignable to type 'string'. +tests/cases/compiler/numericIndexExpressions.ts(10,1): error TS2322: Type '4' is not assignable to type 'string'. +tests/cases/compiler/numericIndexExpressions.ts(11,1): error TS2322: Type '4' is not assignable to type 'string'. +tests/cases/compiler/numericIndexExpressions.ts(14,1): error TS2322: Type '4' is not assignable to type 'string'. +tests/cases/compiler/numericIndexExpressions.ts(15,1): error TS2322: Type '4' is not assignable to type 'string'. ==== tests/cases/compiler/numericIndexExpressions.ts (4 errors) ==== @@ -16,15 +16,15 @@ tests/cases/compiler/numericIndexExpressions.ts(15,1): error TS2322: Type 'numbe var x: Numbers1; x[1] = 4; // error ~~~~ -!!! error TS2322: Type 'number' is not assignable to type 'string'. +!!! error TS2322: Type '4' is not assignable to type 'string'. x['1'] = 4; // error ~~~~~~ -!!! error TS2322: Type 'number' is not assignable to type 'string'. +!!! error TS2322: Type '4' is not assignable to type 'string'. var y: Strings1; y['1'] = 4; // should be error ~~~~~~ -!!! error TS2322: Type 'number' is not assignable to type 'string'. +!!! error TS2322: Type '4' is not assignable to type 'string'. y[1] = 4; // should be error ~~~~ -!!! error TS2322: Type 'number' is not assignable to type 'string'. \ No newline at end of file +!!! error TS2322: Type '4' is not assignable to type 'string'. \ No newline at end of file diff --git a/tests/baselines/reference/numericIndexingResults.types b/tests/baselines/reference/numericIndexingResults.types index 9a060b388e3..8d25a44eab0 100644 --- a/tests/baselines/reference/numericIndexingResults.types +++ b/tests/baselines/reference/numericIndexingResults.types @@ -6,10 +6,10 @@ class C { >x : number 1 = ''; ->'' : string +>'' : "" "2" = '' ->'' : string +>'' : "" } var c: C; @@ -20,37 +20,37 @@ var r1 = c['1']; >r1 : string >c['1'] : string >c : C ->'1' : string +>'1' : "1" var r2 = c['2']; >r2 : string >c['2'] : string >c : C ->'2' : string +>'2' : "2" var r3 = c['3']; >r3 : any >c['3'] : any >c : C ->'3' : string +>'3' : "3" var r4 = c[1]; >r4 : string >c[1] : string >c : C ->1 : number +>1 : 1 var r5 = c[2]; >r5 : string >c[2] : string >c : C ->2 : number +>2 : 2 var r6 = c[3]; >r6 : string >c[3] : string >c : C ->3 : number +>3 : 3 interface I { >I : I @@ -70,37 +70,37 @@ var r1 = i['1']; >r1 : string >i['1'] : string >i : I ->'1' : string +>'1' : "1" var r2 = i['2']; >r2 : string >i['2'] : string >i : I ->'2' : string +>'2' : "2" var r3 = i['3']; >r3 : any >i['3'] : any >i : I ->'3' : string +>'3' : "3" var r4 = i[1]; >r4 : string >i[1] : string >i : I ->1 : number +>1 : 1 var r5 = i[2]; >r5 : string >i[2] : string >i : I ->2 : number +>2 : 2 var r6 = i[3]; >r6 : string >i[3] : string >i : I ->3 : number +>3 : 3 var a: { >a : { [x: number]: string; 1: string; "2": string; } @@ -116,121 +116,121 @@ var r1 = a['1']; >r1 : string >a['1'] : string >a : { [x: number]: string; 1: string; "2": string; } ->'1' : string +>'1' : "1" var r2 = a['2']; >r2 : string >a['2'] : string >a : { [x: number]: string; 1: string; "2": string; } ->'2' : string +>'2' : "2" var r3 = a['3']; >r3 : any >a['3'] : any >a : { [x: number]: string; 1: string; "2": string; } ->'3' : string +>'3' : "3" var r4 = a[1]; >r4 : string >a[1] : string >a : { [x: number]: string; 1: string; "2": string; } ->1 : number +>1 : 1 var r5 = a[2]; >r5 : string >a[2] : string >a : { [x: number]: string; 1: string; "2": string; } ->2 : number +>2 : 2 var r6 = a[3]; >r6 : string >a[3] : string >a : { [x: number]: string; 1: string; "2": string; } ->3 : number +>3 : 3 var b: { [x: number]: string } = { 1: '', "2": '' } >b : { [x: number]: string; } >x : number >{ 1: '', "2": '' } : { 1: string; "2": string; } ->'' : string ->'' : string +>'' : "" +>'' : "" var r1a = b['1']; >r1a : any >b['1'] : any >b : { [x: number]: string; } ->'1' : string +>'1' : "1" var r2a = b['2']; >r2a : any >b['2'] : any >b : { [x: number]: string; } ->'2' : string +>'2' : "2" var r3 = b['3']; >r3 : any >b['3'] : any >b : { [x: number]: string; } ->'3' : string +>'3' : "3" var r4 = b[1]; >r4 : string >b[1] : string >b : { [x: number]: string; } ->1 : number +>1 : 1 var r5 = b[2]; >r5 : string >b[2] : string >b : { [x: number]: string; } ->2 : number +>2 : 2 var r6 = b[3]; >r6 : string >b[3] : string >b : { [x: number]: string; } ->3 : number +>3 : 3 var b2: { [x: number]: string; 1: string; "2": string; } = { 1: '', "2": '' } >b2 : { [x: number]: string; 1: string; "2": string; } >x : number >{ 1: '', "2": '' } : { 1: string; "2": string; } ->'' : string ->'' : string +>'' : "" +>'' : "" var r1b = b2['1']; >r1b : string >b2['1'] : string >b2 : { [x: number]: string; 1: string; "2": string; } ->'1' : string +>'1' : "1" var r2b = b2['2']; >r2b : string >b2['2'] : string >b2 : { [x: number]: string; 1: string; "2": string; } ->'2' : string +>'2' : "2" var r3 = b2['3']; >r3 : any >b2['3'] : any >b2 : { [x: number]: string; 1: string; "2": string; } ->'3' : string +>'3' : "3" var r4 = b2[1]; >r4 : string >b2[1] : string >b2 : { [x: number]: string; 1: string; "2": string; } ->1 : number +>1 : 1 var r5 = b2[2]; >r5 : string >b2[2] : string >b2 : { [x: number]: string; 1: string; "2": string; } ->2 : number +>2 : 2 var r6 = b2[3]; >r6 : string >b2[3] : string >b2 : { [x: number]: string; 1: string; "2": string; } ->3 : number +>3 : 3 diff --git a/tests/baselines/reference/numericLiteralTypes1.types b/tests/baselines/reference/numericLiteralTypes1.types index 38912e05365..f091dd99d60 100644 --- a/tests/baselines/reference/numericLiteralTypes1.types +++ b/tests/baselines/reference/numericLiteralTypes1.types @@ -46,17 +46,17 @@ function f1() { type B1 = -1 | 0 | 1; >B1 : B1 >-1 : -1 ->1 : number +>1 : 1 type B2 = 1 | 0 | -1; >B2 : B1 >-1 : -1 ->1 : number +>1 : 1 type B3 = 0 | -1 | 1; >B3 : B1 >-1 : -1 ->1 : number +>1 : 1 function f2() { >f2 : () => void @@ -65,7 +65,7 @@ function f2() { >b : B1 >B1 : B1 >-1 : -1 ->1 : number +>1 : 1 var b: B2 = 0; >b : B1 @@ -242,7 +242,7 @@ function f5(a: 1, b: 0 | 1 | 2) { >z3 : number >g(2) : number >g : { (x: 0): string; (x: 1): boolean; (x: number): number; } ->2 : number +>2 : 2 var z4 = g(a); >z4 : boolean @@ -264,14 +264,14 @@ function assertNever(x: never): never { throw new Error("Unexpected value"); >new Error("Unexpected value") : Error >Error : ErrorConstructor ->"Unexpected value" : string +>"Unexpected value" : "Unexpected value" } type Tag = 0 | 1 | 2; >Tag : 0 | 1 | 2 function f10(x: Tag) { ->f10 : (x: 0 | 1 | 2) => string +>f10 : (x: 0 | 1 | 2) => "a" | "b" | "c" >x : 0 | 1 | 2 >Tag : 0 | 1 | 2 @@ -280,20 +280,20 @@ function f10(x: Tag) { case 0: return "a"; >0 : 0 ->"a" : string +>"a" : "a" case 1: return "b"; >1 : 1 ->"b" : string +>"b" : "b" case 2: return "c"; >2 : 2 ->"c" : string +>"c" : "c" } } function f11(x: Tag) { ->f11 : (x: 0 | 1 | 2) => string +>f11 : (x: 0 | 1 | 2) => "a" | "b" | "c" >x : 0 | 1 | 2 >Tag : 0 | 1 | 2 @@ -302,15 +302,15 @@ function f11(x: Tag) { case 0: return "a"; >0 : 0 ->"a" : string +>"a" : "a" case 1: return "b"; >1 : 1 ->"b" : string +>"b" : "b" case 2: return "c"; >2 : 2 ->"c" : string +>"c" : "c" } return assertNever(x); >assertNever(x) : never @@ -370,7 +370,7 @@ function f14(x: 0 | 1 | 2, y: string) { >y : string var b = x || y; ->b : string | 1 | 2 +>b : string | number >x || y : string | 1 | 2 >x : 0 | 1 | 2 >y : string @@ -383,31 +383,31 @@ function f15(x: 0 | false, y: 1 | "one") { >y : 1 | "one" var a = x && y; ->a : false | 0 +>a : number | boolean >x && y : false | 0 >x : false | 0 >y : 1 | "one" var b = y && x; ->b : false | 0 +>b : number | boolean >y && x : false | 0 >y : 1 | "one" >x : false | 0 var c = x || y; ->c : 1 | "one" +>c : string | number >x || y : 1 | "one" >x : false | 0 >y : 1 | "one" var d = y || x; ->d : false | 0 | 1 | "one" +>d : string | number | boolean >y || x : false | 0 | 1 | "one" >y : 1 | "one" >x : false | 0 var e = !x; ->e : true +>e : boolean >!x : true >x : false | 0 diff --git a/tests/baselines/reference/numericLiteralTypes2.types b/tests/baselines/reference/numericLiteralTypes2.types index 13292e5f75c..a5744de2a34 100644 --- a/tests/baselines/reference/numericLiteralTypes2.types +++ b/tests/baselines/reference/numericLiteralTypes2.types @@ -47,17 +47,17 @@ function f1() { type B1 = -1 | 0 | 1; >B1 : B1 >-1 : -1 ->1 : number +>1 : 1 type B2 = 1 | 0 | -1; >B2 : B1 >-1 : -1 ->1 : number +>1 : 1 type B3 = 0 | -1 | 1; >B3 : B1 >-1 : -1 ->1 : number +>1 : 1 function f2() { >f2 : () => void @@ -66,7 +66,7 @@ function f2() { >b : B1 >B1 : B1 >-1 : -1 ->1 : number +>1 : 1 var b: B2 = 0; >b : B1 @@ -243,7 +243,7 @@ function f5(a: 1, b: 0 | 1 | 2) { >z3 : number >g(2) : number >g : { (x: 0): string; (x: 1): boolean; (x: number): number; } ->2 : number +>2 : 2 var z4 = g(a); >z4 : boolean @@ -265,14 +265,14 @@ function assertNever(x: never): never { throw new Error("Unexpected value"); >new Error("Unexpected value") : Error >Error : ErrorConstructor ->"Unexpected value" : string +>"Unexpected value" : "Unexpected value" } type Tag = 0 | 1 | 2; >Tag : 0 | 1 | 2 function f10(x: Tag) { ->f10 : (x: 0 | 1 | 2) => string +>f10 : (x: 0 | 1 | 2) => "a" | "b" | "c" >x : 0 | 1 | 2 >Tag : 0 | 1 | 2 @@ -281,20 +281,20 @@ function f10(x: Tag) { case 0: return "a"; >0 : 0 ->"a" : string +>"a" : "a" case 1: return "b"; >1 : 1 ->"b" : string +>"b" : "b" case 2: return "c"; >2 : 2 ->"c" : string +>"c" : "c" } } function f11(x: Tag) { ->f11 : (x: 0 | 1 | 2) => string +>f11 : (x: 0 | 1 | 2) => "a" | "b" | "c" >x : 0 | 1 | 2 >Tag : 0 | 1 | 2 @@ -303,15 +303,15 @@ function f11(x: Tag) { case 0: return "a"; >0 : 0 ->"a" : string +>"a" : "a" case 1: return "b"; >1 : 1 ->"b" : string +>"b" : "b" case 2: return "c"; >2 : 2 ->"c" : string +>"c" : "c" } return assertNever(x); >assertNever(x) : never @@ -365,13 +365,13 @@ function f14(x: 0 | 1 | 2, y: string) { >y : string var a = x && y; ->a : string | 0 +>a : string | number >x && y : string | 0 >x : 0 | 1 | 2 >y : string var b = x || y; ->b : string | 1 | 2 +>b : string | number >x || y : string | 1 | 2 >x : 0 | 1 | 2 >y : string @@ -384,36 +384,36 @@ function f15(x: 0 | false, y: 1 | "one") { >y : 1 | "one" var a = x && y; ->a : false | 0 +>a : number | boolean >x && y : false | 0 >x : false | 0 >y : 1 | "one" var b = y && x; ->b : false | 0 +>b : number | boolean >y && x : false | 0 >y : 1 | "one" >x : false | 0 var c = x || y; ->c : 1 | "one" +>c : string | number >x || y : 1 | "one" >x : false | 0 >y : 1 | "one" var d = y || x; ->d : 1 | "one" +>d : string | number >y || x : 1 | "one" >y : 1 | "one" >x : false | 0 var e = !x; ->e : true +>e : boolean >!x : true >x : false | 0 var f = !y; ->f : false +>f : boolean >!y : false >y : 1 | "one" } diff --git a/tests/baselines/reference/numericMethodName1.types b/tests/baselines/reference/numericMethodName1.types index e6e631fc705..4f907f06feb 100644 --- a/tests/baselines/reference/numericMethodName1.types +++ b/tests/baselines/reference/numericMethodName1.types @@ -3,6 +3,6 @@ class C { >C : C 1 = 2; ->2 : number +>2 : 2 } diff --git a/tests/baselines/reference/objectBindingPatternKeywordIdentifiers05.types b/tests/baselines/reference/objectBindingPatternKeywordIdentifiers05.types index d736121a3b7..d5838d7174a 100644 --- a/tests/baselines/reference/objectBindingPatternKeywordIdentifiers05.types +++ b/tests/baselines/reference/objectBindingPatternKeywordIdentifiers05.types @@ -4,5 +4,5 @@ var { as } = { as: 1 } >as : number >{ as: 1 } : { as: number; } >as : number ->1 : number +>1 : 1 diff --git a/tests/baselines/reference/objectBindingPatternKeywordIdentifiers06.types b/tests/baselines/reference/objectBindingPatternKeywordIdentifiers06.types index 739771385b2..427957c1ef8 100644 --- a/tests/baselines/reference/objectBindingPatternKeywordIdentifiers06.types +++ b/tests/baselines/reference/objectBindingPatternKeywordIdentifiers06.types @@ -5,5 +5,5 @@ var { as: as } = { as: 1 } >as : number >{ as: 1 } : { as: number; } >as : number ->1 : number +>1 : 1 diff --git a/tests/baselines/reference/objectCreationExpressionInFunctionParameter.errors.txt b/tests/baselines/reference/objectCreationExpressionInFunctionParameter.errors.txt index bd9e021494c..6948f080aef 100644 --- a/tests/baselines/reference/objectCreationExpressionInFunctionParameter.errors.txt +++ b/tests/baselines/reference/objectCreationExpressionInFunctionParameter.errors.txt @@ -1,4 +1,4 @@ -tests/cases/compiler/objectCreationExpressionInFunctionParameter.ts(5,24): error TS2345: Argument of type 'number' is not assignable to parameter of type 'string'. +tests/cases/compiler/objectCreationExpressionInFunctionParameter.ts(5,24): error TS2345: Argument of type '123' is not assignable to parameter of type 'string'. tests/cases/compiler/objectCreationExpressionInFunctionParameter.ts(6,2): error TS1128: Declaration or statement expected. @@ -9,7 +9,7 @@ tests/cases/compiler/objectCreationExpressionInFunctionParameter.ts(6,2): error } function foo(x = new A(123)) { //should error, 123 is not string ~~~ -!!! error TS2345: Argument of type 'number' is not assignable to parameter of type 'string'. +!!! error TS2345: Argument of type '123' is not assignable to parameter of type 'string'. }} ~ !!! error TS1128: Declaration or statement expected. \ No newline at end of file diff --git a/tests/baselines/reference/objectLitGetterSetter.types b/tests/baselines/reference/objectLitGetterSetter.types index 4f7865374e2..12801b65340 100644 --- a/tests/baselines/reference/objectLitGetterSetter.types +++ b/tests/baselines/reference/objectLitGetterSetter.types @@ -9,7 +9,7 @@ >Object : ObjectConstructor >defineProperty : (o: any, p: string, attributes: PropertyDescriptor) => any >obj : {} ->"accProperty" : string +>"accProperty" : "accProperty" >({ get: function () { eval("public = 1;"); return 11; }, set: function (v) { } }) : PropertyDescriptor >PropertyDescriptor : PropertyDescriptor >({ get: function () { eval("public = 1;"); return 11; }, set: function (v) { } }) : { get: () => number; set: (v: any) => void; } @@ -22,10 +22,10 @@ eval("public = 1;"); >eval("public = 1;") : any >eval : (x: string) => any ->"public = 1;" : string +>"public = 1;" : "public = 1;" return 11; ->11 : number +>11 : 11 }, set: function (v) { diff --git a/tests/baselines/reference/objectLiteral1.types b/tests/baselines/reference/objectLiteral1.types index 491b4ce365b..244cb62dbef 100644 --- a/tests/baselines/reference/objectLiteral1.types +++ b/tests/baselines/reference/objectLiteral1.types @@ -3,7 +3,7 @@ var v30 = {a:1, b:2}; >v30 : { a: number; b: number; } >{a:1, b:2} : { a: number; b: number; } >a : number ->1 : number +>1 : 1 >b : number ->2 : number +>2 : 2 diff --git a/tests/baselines/reference/objectLiteral2.types b/tests/baselines/reference/objectLiteral2.types index 387bd0ba90f..52184a27833 100644 --- a/tests/baselines/reference/objectLiteral2.types +++ b/tests/baselines/reference/objectLiteral2.types @@ -3,8 +3,8 @@ var v30 = {a:1, b:2}, v31; >v30 : { a: number; b: number; } >{a:1, b:2} : { a: number; b: number; } >a : number ->1 : number +>1 : 1 >b : number ->2 : number +>2 : 2 >v31 : any diff --git a/tests/baselines/reference/objectLiteralArraySpecialization.types b/tests/baselines/reference/objectLiteralArraySpecialization.types index 405d8bff472..d51b7ffc3cf 100644 --- a/tests/baselines/reference/objectLiteralArraySpecialization.types +++ b/tests/baselines/reference/objectLiteralArraySpecialization.types @@ -31,14 +31,14 @@ var thing = create([ { name: "bob", id: 24 }, { name: "doug", id: 32 } ]); // sh >[ { name: "bob", id: 24 }, { name: "doug", id: 32 } ] : { name: string; id: number; }[] >{ name: "bob", id: 24 } : { name: string; id: number; } >name : string ->"bob" : string +>"bob" : "bob" >id : number ->24 : number +>24 : 24 >{ name: "doug", id: 32 } : { name: string; id: number; } >name : string ->"doug" : string +>"doug" : "doug" >id : number ->32 : number +>32 : 32 thing.doSomething((x, y) => x.name === "bob"); // should not error >thing.doSomething((x, y) => x.name === "bob") : void diff --git a/tests/baselines/reference/objectLiteralContextualTyping.types b/tests/baselines/reference/objectLiteralContextualTyping.types index 8100b7a5446..a0c6ff7417b 100644 --- a/tests/baselines/reference/objectLiteralContextualTyping.types +++ b/tests/baselines/reference/objectLiteralContextualTyping.types @@ -29,7 +29,7 @@ var x = foo({ name: "Sprocket" }); >foo : { (item: Item): string; (item: any): number; } >{ name: "Sprocket" } : { name: string; } >name : string ->"Sprocket" : string +>"Sprocket" : "Sprocket" var x: string; >x : string @@ -40,9 +40,9 @@ var y = foo({ name: "Sprocket", description: "Bumpy wheel" }); >foo : { (item: Item): string; (item: any): number; } >{ name: "Sprocket", description: "Bumpy wheel" } : { name: string; description: string; } >name : string ->"Sprocket" : string +>"Sprocket" : "Sprocket" >description : string ->"Bumpy wheel" : string +>"Bumpy wheel" : "Bumpy wheel" var y: string; >y : string @@ -53,9 +53,9 @@ var z = foo({ name: "Sprocket", description: false }); >foo : { (item: Item): string; (item: any): number; } >{ name: "Sprocket", description: false } : { name: string; description: boolean; } >name : string ->"Sprocket" : string +>"Sprocket" : "Sprocket" >description : boolean ->false : boolean +>false : false var z: number; >z : number @@ -66,7 +66,7 @@ var w = foo({ a: 10 }); >foo : { (item: Item): string; (item: any): number; } >{ a: 10 } : { a: number; } >a : number ->10 : number +>10 : 10 var w: number; >w : number diff --git a/tests/baselines/reference/objectLiteralErrors.errors.txt b/tests/baselines/reference/objectLiteralErrors.errors.txt index 2505748760c..234ac24a8fd 100644 --- a/tests/baselines/reference/objectLiteralErrors.errors.txt +++ b/tests/baselines/reference/objectLiteralErrors.errors.txt @@ -73,7 +73,7 @@ tests/cases/conformance/expressions/objectLiterals/objectLiteralErrors.ts(40,46) tests/cases/conformance/expressions/objectLiterals/objectLiteralErrors.ts(40,46): error TS2300: Duplicate identifier 'a'. tests/cases/conformance/expressions/objectLiterals/objectLiteralErrors.ts(43,16): error TS2380: 'get' and 'set' accessor must have the same type. tests/cases/conformance/expressions/objectLiterals/objectLiteralErrors.ts(43,47): error TS2380: 'get' and 'set' accessor must have the same type. -tests/cases/conformance/expressions/objectLiterals/objectLiteralErrors.ts(44,29): error TS2322: Type 'number' is not assignable to type 'string'. +tests/cases/conformance/expressions/objectLiterals/objectLiteralErrors.ts(44,29): error TS2322: Type '4' is not assignable to type 'string'. tests/cases/conformance/expressions/objectLiterals/objectLiteralErrors.ts(45,16): error TS2380: 'get' and 'set' accessor must have the same type. tests/cases/conformance/expressions/objectLiterals/objectLiteralErrors.ts(45,55): error TS2380: 'get' and 'set' accessor must have the same type. @@ -274,7 +274,7 @@ tests/cases/conformance/expressions/objectLiterals/objectLiteralErrors.ts(45,55) !!! error TS2380: 'get' and 'set' accessor must have the same type. var g2 = { get a() { return 4; }, set a(n: string) { } }; ~ -!!! error TS2322: Type 'number' is not assignable to type 'string'. +!!! error TS2322: Type '4' is not assignable to type 'string'. var g3 = { get a(): number { return undefined; }, set a(n: string) { } }; ~ !!! error TS2380: 'get' and 'set' accessor must have the same type. diff --git a/tests/baselines/reference/objectLiteralShorthandProperties.types b/tests/baselines/reference/objectLiteralShorthandProperties.types index 9d537173d49..4f4482906aa 100644 --- a/tests/baselines/reference/objectLiteralShorthandProperties.types +++ b/tests/baselines/reference/objectLiteralShorthandProperties.types @@ -27,7 +27,7 @@ var x3 = { a: 0, >a : number ->0 : number +>0 : 0 b, >b : any diff --git a/tests/baselines/reference/objectLiteralShorthandPropertiesAssignment.types b/tests/baselines/reference/objectLiteralShorthandPropertiesAssignment.types index 869a67fb22f..88a910a99fb 100644 --- a/tests/baselines/reference/objectLiteralShorthandPropertiesAssignment.types +++ b/tests/baselines/reference/objectLiteralShorthandPropertiesAssignment.types @@ -1,11 +1,11 @@ === tests/cases/conformance/es6/shorthandPropertyAssignment/objectLiteralShorthandPropertiesAssignment.ts === var id: number = 10000; >id : number ->10000 : number +>10000 : 10000 var name: string = "my name"; >name : string ->"my name" : string +>"my name" : "my name" var person: { name: string; id: number } = { name, id }; >person : { name: string; id: number; } @@ -54,16 +54,16 @@ var person1 = bar("Hello", 5); >person1 : { name: string; id: number; } >bar("Hello", 5) : { name: string; id: number; } >bar : (name: string, id: number) => { name: string; id: number; } ->"Hello" : string ->5 : number +>"Hello" : "Hello" +>5 : 5 var person2: { name: string } = bar("Hello", 5); >person2 : { name: string; } >name : string >bar("Hello", 5) : { name: string; id: number; } >bar : (name: string, id: number) => { name: string; id: number; } ->"Hello" : string ->5 : number +>"Hello" : "Hello" +>5 : 5 var person3: { name: string; id:number } = bar("Hello", 5); >person3 : { name: string; id: number; } @@ -71,6 +71,6 @@ var person3: { name: string; id:number } = bar("Hello", 5); >id : number >bar("Hello", 5) : { name: string; id: number; } >bar : (name: string, id: number) => { name: string; id: number; } ->"Hello" : string ->5 : number +>"Hello" : "Hello" +>5 : 5 diff --git a/tests/baselines/reference/objectLiteralShorthandPropertiesAssignmentES6.types b/tests/baselines/reference/objectLiteralShorthandPropertiesAssignmentES6.types index 710fc430339..527c9c5fb6c 100644 --- a/tests/baselines/reference/objectLiteralShorthandPropertiesAssignmentES6.types +++ b/tests/baselines/reference/objectLiteralShorthandPropertiesAssignmentES6.types @@ -1,11 +1,11 @@ === tests/cases/conformance/es6/shorthandPropertyAssignment/objectLiteralShorthandPropertiesAssignmentES6.ts === var id: number = 10000; >id : number ->10000 : number +>10000 : 10000 var name: string = "my name"; >name : string ->"my name" : string +>"my name" : "my name" var person: { name: string; id: number } = { name, id }; >person : { name: string; id: number; } @@ -54,16 +54,16 @@ var person1 = bar("Hello", 5); >person1 : { name: string; id: number; } >bar("Hello", 5) : { name: string; id: number; } >bar : (name: string, id: number) => { name: string; id: number; } ->"Hello" : string ->5 : number +>"Hello" : "Hello" +>5 : 5 var person2: { name: string } = bar("Hello", 5); >person2 : { name: string; } >name : string >bar("Hello", 5) : { name: string; id: number; } >bar : (name: string, id: number) => { name: string; id: number; } ->"Hello" : string ->5 : number +>"Hello" : "Hello" +>5 : 5 var person3: { name: string; id: number } = bar("Hello", 5); >person3 : { name: string; id: number; } @@ -71,6 +71,6 @@ var person3: { name: string; id: number } = bar("Hello", 5); >id : number >bar("Hello", 5) : { name: string; id: number; } >bar : (name: string, id: number) => { name: string; id: number; } ->"Hello" : string ->5 : number +>"Hello" : "Hello" +>5 : 5 diff --git a/tests/baselines/reference/objectLiteralShorthandPropertiesES6.types b/tests/baselines/reference/objectLiteralShorthandPropertiesES6.types index 5c36262f695..1565be04625 100644 --- a/tests/baselines/reference/objectLiteralShorthandPropertiesES6.types +++ b/tests/baselines/reference/objectLiteralShorthandPropertiesES6.types @@ -27,7 +27,7 @@ var x3 = { a: 0, >a : number ->0 : number +>0 : 0 b, >b : any diff --git a/tests/baselines/reference/objectLiteralShorthandPropertiesFunctionArgument.types b/tests/baselines/reference/objectLiteralShorthandPropertiesFunctionArgument.types index 083d4118128..fe67e59dd7b 100644 --- a/tests/baselines/reference/objectLiteralShorthandPropertiesFunctionArgument.types +++ b/tests/baselines/reference/objectLiteralShorthandPropertiesFunctionArgument.types @@ -1,11 +1,11 @@ === tests/cases/conformance/es6/shorthandPropertyAssignment/objectLiteralShorthandPropertiesFunctionArgument.ts === var id: number = 10000; >id : number ->10000 : number +>10000 : 10000 var name: string = "my name"; >name : string ->"my name" : string +>"my name" : "my name" var person = { name, id }; >person : { name: string; id: number; } diff --git a/tests/baselines/reference/objectTypePropertyAccess.types b/tests/baselines/reference/objectTypePropertyAccess.types index 5fc03bd86ed..6f9bffaf0de 100644 --- a/tests/baselines/reference/objectTypePropertyAccess.types +++ b/tests/baselines/reference/objectTypePropertyAccess.types @@ -23,7 +23,7 @@ var r2 = c['toString'](); >c['toString']() : string >c['toString'] : () => string >c : C ->'toString' : string +>'toString' : "toString" var r3 = c.foo; >r3 : string @@ -35,7 +35,7 @@ var r4 = c['foo']; >r4 : string >c['foo'] : string >c : C ->'foo' : string +>'foo' : "foo" interface I { >I : I @@ -59,7 +59,7 @@ var r5 = i['toString'](); >i['toString']() : string >i['toString'] : () => string >i : I ->'toString' : string +>'toString' : "toString" var r6 = i.bar; >r6 : string @@ -71,7 +71,7 @@ var r7 = i['bar']; >r7 : string >i['bar'] : string >i : I ->'bar' : string +>'bar' : "bar" var a = { >a : { foo: string; } @@ -79,7 +79,7 @@ var a = { foo: '' >foo : string ->'' : string +>'' : "" } var r8 = a.toString(); @@ -94,7 +94,7 @@ var r9 = a['toString'](); >a['toString']() : string >a['toString'] : () => string >a : { foo: string; } ->'toString' : string +>'toString' : "toString" var r10 = a.foo; >r10 : string @@ -106,5 +106,5 @@ var r11 = a['foo']; >r11 : string >a['foo'] : string >a : { foo: string; } ->'foo' : string +>'foo' : "foo" diff --git a/tests/baselines/reference/objectTypeWithCallSignatureHidingMembersOfExtendedFunction.types b/tests/baselines/reference/objectTypeWithCallSignatureHidingMembersOfExtendedFunction.types index 93caca61bfa..ea0ee84b575 100644 --- a/tests/baselines/reference/objectTypeWithCallSignatureHidingMembersOfExtendedFunction.types +++ b/tests/baselines/reference/objectTypeWithCallSignatureHidingMembersOfExtendedFunction.types @@ -64,7 +64,7 @@ var r1e = i['hm']; // should be Object >r1e : any >i['hm'] : any >i : I ->'hm' : string +>'hm' : "hm" var x: { >x : { (): void; apply(a: any, b?: any): void; call(thisArg: number, ...argArray: number[]): any; } @@ -113,5 +113,5 @@ var r2e = x['hm']; // should be Object >r2e : any >x['hm'] : any >x : { (): void; apply(a: any, b?: any): void; call(thisArg: number, ...argArray: number[]): any; } ->'hm' : string +>'hm' : "hm" diff --git a/tests/baselines/reference/objectTypeWithConstructSignatureHidingMembersOfExtendedFunction.types b/tests/baselines/reference/objectTypeWithConstructSignatureHidingMembersOfExtendedFunction.types index 427b700fb59..c0b5c9d5a77 100644 --- a/tests/baselines/reference/objectTypeWithConstructSignatureHidingMembersOfExtendedFunction.types +++ b/tests/baselines/reference/objectTypeWithConstructSignatureHidingMembersOfExtendedFunction.types @@ -61,7 +61,7 @@ var r1e = i['hm']; // should be Object >r1e : any >i['hm'] : any >i : I ->'hm' : string +>'hm' : "hm" var x: { >x : { new (): number; apply(a: any, b?: any): void; call(thisArg: number, ...argArray: number[]): any; } @@ -110,5 +110,5 @@ var r2e = x['hm']; // should be Object >r2e : any >x['hm'] : any >x : { new (): number; apply(a: any, b?: any): void; call(thisArg: number, ...argArray: number[]): any; } ->'hm' : string +>'hm' : "hm" diff --git a/tests/baselines/reference/objectTypeWithNumericProperty.types b/tests/baselines/reference/objectTypeWithNumericProperty.types index 32efd3398fb..52a27ea09af 100644 --- a/tests/baselines/reference/objectTypeWithNumericProperty.types +++ b/tests/baselines/reference/objectTypeWithNumericProperty.types @@ -16,25 +16,25 @@ var r1 = c[1]; >r1 : number >c[1] : number >c : C ->1 : number +>1 : 1 var r2 = c[1.1]; >r2 : string >c[1.1] : string >c : C ->1.1 : number +>1.1 : 1.1 var r3 = c['1']; >r3 : number >c['1'] : number >c : C ->'1' : string +>'1' : "1" var r4 = c['1.1']; >r4 : string >c['1.1'] : string >c : C ->'1.1' : string +>'1.1' : "1.1" interface I { >I : I @@ -51,25 +51,25 @@ var r1 = i[1]; >r1 : number >i[1] : number >i : I ->1 : number +>1 : 1 var r2 = i[1.1]; >r2 : string >i[1.1] : string >i : I ->1.1 : number +>1.1 : 1.1 var r3 = i['1']; >r3 : number >i['1'] : number >i : I ->'1' : string +>'1' : "1" var r4 = i['1.1']; >r4 : string >i['1.1'] : string >i : I ->'1.1' : string +>'1.1' : "1.1" var a: { >a : { 1: number; 1.1: string; } @@ -82,58 +82,58 @@ var r1 = a[1]; >r1 : number >a[1] : number >a : { 1: number; 1.1: string; } ->1 : number +>1 : 1 var r2 = a[1.1]; >r2 : string >a[1.1] : string >a : { 1: number; 1.1: string; } ->1.1 : number +>1.1 : 1.1 var r3 = a['1']; >r3 : number >a['1'] : number >a : { 1: number; 1.1: string; } ->'1' : string +>'1' : "1" var r4 = a['1.1']; >r4 : string >a['1.1'] : string >a : { 1: number; 1.1: string; } ->'1.1' : string +>'1.1' : "1.1" var b = { >b : { 1: number; 1.1: string; } >{ 1: 1, 1.1: ""} : { 1: number; 1.1: string; } 1: 1, ->1 : number +>1 : 1 1.1: "" ->"" : string +>"" : "" } var r1 = b[1]; >r1 : number >b[1] : number >b : { 1: number; 1.1: string; } ->1 : number +>1 : 1 var r2 = b[1.1]; >r2 : string >b[1.1] : string >b : { 1: number; 1.1: string; } ->1.1 : number +>1.1 : 1.1 var r3 = b['1']; >r3 : number >b['1'] : number >b : { 1: number; 1.1: string; } ->'1' : string +>'1' : "1" var r4 = b['1.1']; >r4 : string >b['1.1'] : string >b : { 1: number; 1.1: string; } ->'1.1' : string +>'1.1' : "1.1" diff --git a/tests/baselines/reference/objectTypeWithStringNamedNumericProperty.types b/tests/baselines/reference/objectTypeWithStringNamedNumericProperty.types index 490f3101751..5e664fadd20 100644 --- a/tests/baselines/reference/objectTypeWithStringNamedNumericProperty.types +++ b/tests/baselines/reference/objectTypeWithStringNamedNumericProperty.types @@ -32,108 +32,108 @@ var r1 = c['0.1']; >r1 : void >c['0.1'] : void >c : C ->'0.1' : string +>'0.1' : "0.1" var r2 = c['.1']; >r2 : Object >c['.1'] : Object >c : C ->'.1' : string +>'.1' : ".1" var r3 = c['1']; >r3 : number >c['1'] : number >c : C ->'1' : string +>'1' : "1" var r3 = c[1]; >r3 : number >c[1] : number >c : C ->1 : number +>1 : 1 var r4 = c['1.']; >r4 : string >c['1.'] : string >c : C ->'1.' : string +>'1.' : "1." var r3 = c[1.]; // same as indexing by 1 when done numerically >r3 : number >c[1.] : number >c : C ->1. : number +>1. : 1 var r5 = c['1..']; >r5 : boolean >c['1..'] : boolean >c : C ->'1..' : string +>'1..' : "1.." var r6 = c['1.0']; >r6 : Date >c['1.0'] : Date >c : C ->'1.0' : string +>'1.0' : "1.0" var r3 = c[1.0]; // same as indexing by 1 when done numerically >r3 : number >c[1.0] : number >c : C ->1.0 : number +>1.0 : 1 // BUG 823822 var r7 = i[-1]; >r7 : any >i[-1] : any >i : I ->-1 : number ->1 : number +>-1 : -1 +>1 : 1 var r7 = i[-1.0]; >r7 : any >i[-1.0] : any >i : I ->-1.0 : number ->1.0 : number +>-1.0 : -1 +>1.0 : 1 var r8 = i["-1.0"]; >r8 : RegExp >i["-1.0"] : RegExp >i : I ->"-1.0" : string +>"-1.0" : "-1.0" var r9 = i["-1"]; >r9 : Date >i["-1"] : Date >i : I ->"-1" : string +>"-1" : "-1" var r10 = i[0x1] >r10 : number >i[0x1] : number >i : I ->0x1 : number +>0x1 : 1 var r11 = i[-0x1] >r11 : any >i[-0x1] : any >i : I ->-0x1 : number ->0x1 : number +>-0x1 : -1 +>0x1 : 1 var r12 = i[01] >r12 : number >i[01] : number >i : I ->01 : number +>01 : 1 var r13 = i[-01] >r13 : any >i[-01] : any >i : I ->-01 : number ->01 : number +>-01 : -1 +>01 : 1 interface I { >I : I @@ -163,108 +163,108 @@ var r1 = i['0.1']; >r1 : void >i['0.1'] : void >i : I ->'0.1' : string +>'0.1' : "0.1" var r2 = i['.1']; >r2 : Object >i['.1'] : Object >i : I ->'.1' : string +>'.1' : ".1" var r3 = i['1']; >r3 : number >i['1'] : number >i : I ->'1' : string +>'1' : "1" var r3 = c[1]; >r3 : number >c[1] : number >c : C ->1 : number +>1 : 1 var r4 = i['1.']; >r4 : string >i['1.'] : string >i : I ->'1.' : string +>'1.' : "1." var r3 = c[1.]; // same as indexing by 1 when done numerically >r3 : number >c[1.] : number >c : C ->1. : number +>1. : 1 var r5 = i['1..']; >r5 : boolean >i['1..'] : boolean >i : I ->'1..' : string +>'1..' : "1.." var r6 = i['1.0']; >r6 : Date >i['1.0'] : Date >i : I ->'1.0' : string +>'1.0' : "1.0" var r3 = c[1.0]; // same as indexing by 1 when done numerically >r3 : number >c[1.0] : number >c : C ->1.0 : number +>1.0 : 1 // BUG 823822 var r7 = i[-1]; >r7 : any >i[-1] : any >i : I ->-1 : number ->1 : number +>-1 : -1 +>1 : 1 var r7 = i[-1.0]; >r7 : any >i[-1.0] : any >i : I ->-1.0 : number ->1.0 : number +>-1.0 : -1 +>1.0 : 1 var r8 = i["-1.0"]; >r8 : RegExp >i["-1.0"] : RegExp >i : I ->"-1.0" : string +>"-1.0" : "-1.0" var r9 = i["-1"]; >r9 : Date >i["-1"] : Date >i : I ->"-1" : string +>"-1" : "-1" var r10 = i[0x1] >r10 : number >i[0x1] : number >i : I ->0x1 : number +>0x1 : 1 var r11 = i[-0x1] >r11 : any >i[-0x1] : any >i : I ->-0x1 : number ->0x1 : number +>-0x1 : -1 +>0x1 : 1 var r12 = i[01] >r12 : number >i[01] : number >i : I ->01 : number +>01 : 1 var r13 = i[-01] >r13 : any >i[-01] : any >i : I ->-01 : number ->01 : number +>-01 : -1 +>01 : 1 var a: { >a : { "1": number; "0.1": void; ".1": Object; "1.": string; "1..": boolean; "1.0": Date; "-1.0": RegExp; "-1": Date; } @@ -290,108 +290,108 @@ var r1 = a['0.1']; >r1 : void >a['0.1'] : void >a : { "1": number; "0.1": void; ".1": Object; "1.": string; "1..": boolean; "1.0": Date; "-1.0": RegExp; "-1": Date; } ->'0.1' : string +>'0.1' : "0.1" var r2 = a['.1']; >r2 : Object >a['.1'] : Object >a : { "1": number; "0.1": void; ".1": Object; "1.": string; "1..": boolean; "1.0": Date; "-1.0": RegExp; "-1": Date; } ->'.1' : string +>'.1' : ".1" var r3 = a['1']; >r3 : number >a['1'] : number >a : { "1": number; "0.1": void; ".1": Object; "1.": string; "1..": boolean; "1.0": Date; "-1.0": RegExp; "-1": Date; } ->'1' : string +>'1' : "1" var r3 = c[1]; >r3 : number >c[1] : number >c : C ->1 : number +>1 : 1 var r4 = a['1.']; >r4 : string >a['1.'] : string >a : { "1": number; "0.1": void; ".1": Object; "1.": string; "1..": boolean; "1.0": Date; "-1.0": RegExp; "-1": Date; } ->'1.' : string +>'1.' : "1." var r3 = c[1.]; // same as indexing by 1 when done numerically >r3 : number >c[1.] : number >c : C ->1. : number +>1. : 1 var r5 = a['1..']; >r5 : boolean >a['1..'] : boolean >a : { "1": number; "0.1": void; ".1": Object; "1.": string; "1..": boolean; "1.0": Date; "-1.0": RegExp; "-1": Date; } ->'1..' : string +>'1..' : "1.." var r6 = a['1.0']; >r6 : Date >a['1.0'] : Date >a : { "1": number; "0.1": void; ".1": Object; "1.": string; "1..": boolean; "1.0": Date; "-1.0": RegExp; "-1": Date; } ->'1.0' : string +>'1.0' : "1.0" var r3 = c[1.0]; // same as indexing by 1 when done numerically >r3 : number >c[1.0] : number >c : C ->1.0 : number +>1.0 : 1 // BUG 823822 var r7 = i[-1]; >r7 : any >i[-1] : any >i : I ->-1 : number ->1 : number +>-1 : -1 +>1 : 1 var r7 = i[-1.0]; >r7 : any >i[-1.0] : any >i : I ->-1.0 : number ->1.0 : number +>-1.0 : -1 +>1.0 : 1 var r8 = i["-1.0"]; >r8 : RegExp >i["-1.0"] : RegExp >i : I ->"-1.0" : string +>"-1.0" : "-1.0" var r9 = i["-1"]; >r9 : Date >i["-1"] : Date >i : I ->"-1" : string +>"-1" : "-1" var r10 = i[0x1] >r10 : number >i[0x1] : number >i : I ->0x1 : number +>0x1 : 1 var r11 = i[-0x1] >r11 : any >i[-0x1] : any >i : I ->-0x1 : number ->0x1 : number +>-0x1 : -1 +>0x1 : 1 var r12 = i[01] >r12 : number >i[01] : number >i : I ->01 : number +>01 : 1 var r13 = i[-01] >r13 : any >i[-01] : any >i : I ->-01 : number ->01 : number +>-01 : -1 +>01 : 1 var b = { >b : { "1": number; "0.1": void; ".1": Object; "1.": string; "1..": boolean; "1.0": Date; "-1.0": RegExp; "-1": DateConstructor; } @@ -406,13 +406,13 @@ var b = { >Object : ObjectConstructor "1": 1, ->1 : number +>1 : 1 "1.": "", ->"" : string +>"" : "" "1..": true, ->true : boolean +>true : true "1.0": new Date(), >new Date() : Date @@ -430,106 +430,106 @@ var r1 = b['0.1']; >r1 : void >b['0.1'] : void >b : { "1": number; "0.1": void; ".1": Object; "1.": string; "1..": boolean; "1.0": Date; "-1.0": RegExp; "-1": DateConstructor; } ->'0.1' : string +>'0.1' : "0.1" var r2 = b['.1']; >r2 : Object >b['.1'] : Object >b : { "1": number; "0.1": void; ".1": Object; "1.": string; "1..": boolean; "1.0": Date; "-1.0": RegExp; "-1": DateConstructor; } ->'.1' : string +>'.1' : ".1" var r3 = b['1']; >r3 : number >b['1'] : number >b : { "1": number; "0.1": void; ".1": Object; "1.": string; "1..": boolean; "1.0": Date; "-1.0": RegExp; "-1": DateConstructor; } ->'1' : string +>'1' : "1" var r3 = c[1]; >r3 : number >c[1] : number >c : C ->1 : number +>1 : 1 var r4 = b['1.']; >r4 : string >b['1.'] : string >b : { "1": number; "0.1": void; ".1": Object; "1.": string; "1..": boolean; "1.0": Date; "-1.0": RegExp; "-1": DateConstructor; } ->'1.' : string +>'1.' : "1." var r3 = c[1.]; // same as indexing by 1 when done numerically >r3 : number >c[1.] : number >c : C ->1. : number +>1. : 1 var r5 = b['1..']; >r5 : boolean >b['1..'] : boolean >b : { "1": number; "0.1": void; ".1": Object; "1.": string; "1..": boolean; "1.0": Date; "-1.0": RegExp; "-1": DateConstructor; } ->'1..' : string +>'1..' : "1.." var r6 = b['1.0']; >r6 : Date >b['1.0'] : Date >b : { "1": number; "0.1": void; ".1": Object; "1.": string; "1..": boolean; "1.0": Date; "-1.0": RegExp; "-1": DateConstructor; } ->'1.0' : string +>'1.0' : "1.0" var r3 = c[1.0]; // same as indexing by 1 when done numerically >r3 : number >c[1.0] : number >c : C ->1.0 : number +>1.0 : 1 // BUG 823822 var r7 = i[-1]; >r7 : any >i[-1] : any >i : I ->-1 : number ->1 : number +>-1 : -1 +>1 : 1 var r7 = i[-1.0]; >r7 : any >i[-1.0] : any >i : I ->-1.0 : number ->1.0 : number +>-1.0 : -1 +>1.0 : 1 var r8 = i["-1.0"]; >r8 : RegExp >i["-1.0"] : RegExp >i : I ->"-1.0" : string +>"-1.0" : "-1.0" var r9 = i["-1"]; >r9 : Date >i["-1"] : Date >i : I ->"-1" : string +>"-1" : "-1" var r10 = i[0x1] >r10 : number >i[0x1] : number >i : I ->0x1 : number +>0x1 : 1 var r11 = i[-0x1] >r11 : any >i[-0x1] : any >i : I ->-0x1 : number ->0x1 : number +>-0x1 : -1 +>0x1 : 1 var r12 = i[01] >r12 : number >i[01] : number >i : I ->01 : number +>01 : 1 var r13 = i[-01] >r13 : any >i[-01] : any >i : I ->-01 : number ->01 : number +>-01 : -1 +>01 : 1 diff --git a/tests/baselines/reference/objectTypeWithStringNamedPropertyOfIllegalCharacters.types b/tests/baselines/reference/objectTypeWithStringNamedPropertyOfIllegalCharacters.types index b676d284e70..ca200efcebf 100644 --- a/tests/baselines/reference/objectTypeWithStringNamedPropertyOfIllegalCharacters.types +++ b/tests/baselines/reference/objectTypeWithStringNamedPropertyOfIllegalCharacters.types @@ -17,26 +17,26 @@ var r = c[" "]; >r : number >c[" "] : number >c : C ->" " : string +>" " : " " var r2 = c[" "]; >r2 : any >c[" "] : any >c : C ->" " : string +>" " : " " var r3 = c["a b"]; >r3 : string >c["a b"] : string >c : C ->"a b" : string +>"a b" : "a b" // BUG 817263 var r4 = c["~!@#$%^&*()_+{}|:'<>?\/.,`"]; >r4 : number >c["~!@#$%^&*()_+{}|:'<>?\/.,`"] : number >c : C ->"~!@#$%^&*()_+{}|:'<>?\/.,`" : string +>"~!@#$%^&*()_+{}|:'<>?\/.,`" : "~!@#$%^&*()_+{}|:'<>?/.,`" interface I { >I : I @@ -54,26 +54,26 @@ var r = i[" "]; >r : number >i[" "] : number >i : I ->" " : string +>" " : " " var r2 = i[" "]; >r2 : any >i[" "] : any >i : I ->" " : string +>" " : " " var r3 = i["a b"]; >r3 : string >i["a b"] : string >i : I ->"a b" : string +>"a b" : "a b" // BUG 817263 var r4 = i["~!@#$%^&*()_+{}|:'<>?\/.,`"]; >r4 : number >i["~!@#$%^&*()_+{}|:'<>?\/.,`"] : number >i : I ->"~!@#$%^&*()_+{}|:'<>?\/.,`" : string +>"~!@#$%^&*()_+{}|:'<>?\/.,`" : "~!@#$%^&*()_+{}|:'<>?/.,`" var a: { @@ -88,63 +88,63 @@ var r = a[" "]; >r : number >a[" "] : number >a : { " ": number; "a b": string; "~!@#$%^&*()_+{}|:'<>?\/.,`": number; } ->" " : string +>" " : " " var r2 = a[" "]; >r2 : any >a[" "] : any >a : { " ": number; "a b": string; "~!@#$%^&*()_+{}|:'<>?\/.,`": number; } ->" " : string +>" " : " " var r3 = a["a b"]; >r3 : string >a["a b"] : string >a : { " ": number; "a b": string; "~!@#$%^&*()_+{}|:'<>?\/.,`": number; } ->"a b" : string +>"a b" : "a b" // BUG 817263 var r4 = a["~!@#$%^&*()_+{}|:'<>?\/.,`"]; >r4 : number >a["~!@#$%^&*()_+{}|:'<>?\/.,`"] : number >a : { " ": number; "a b": string; "~!@#$%^&*()_+{}|:'<>?\/.,`": number; } ->"~!@#$%^&*()_+{}|:'<>?\/.,`" : string +>"~!@#$%^&*()_+{}|:'<>?\/.,`" : "~!@#$%^&*()_+{}|:'<>?/.,`" var b = { >b : { " ": number; "a b": string; "~!@#$%^&*()_+{}|:'<>?\/.,`": number; } >{ " ": 1, "a b": "", "~!@#$%^&*()_+{}|:'<>?\/.,`": 1,} : { " ": number; "a b": string; "~!@#$%^&*()_+{}|:'<>?\/.,`": number; } " ": 1, ->1 : number +>1 : 1 "a b": "", ->"" : string +>"" : "" "~!@#$%^&*()_+{}|:'<>?\/.,`": 1, ->1 : number +>1 : 1 } var r = b[" "]; >r : number >b[" "] : number >b : { " ": number; "a b": string; "~!@#$%^&*()_+{}|:'<>?\/.,`": number; } ->" " : string +>" " : " " var r2 = b[" "]; >r2 : any >b[" "] : any >b : { " ": number; "a b": string; "~!@#$%^&*()_+{}|:'<>?\/.,`": number; } ->" " : string +>" " : " " var r3 = b["a b"]; >r3 : string >b["a b"] : string >b : { " ": number; "a b": string; "~!@#$%^&*()_+{}|:'<>?\/.,`": number; } ->"a b" : string +>"a b" : "a b" // BUG 817263 var r4 = b["~!@#$%^&*()_+{}|:'<>?\/.,`"]; >r4 : number >b["~!@#$%^&*()_+{}|:'<>?\/.,`"] : number >b : { " ": number; "a b": string; "~!@#$%^&*()_+{}|:'<>?\/.,`": number; } ->"~!@#$%^&*()_+{}|:'<>?\/.,`" : string +>"~!@#$%^&*()_+{}|:'<>?\/.,`" : "~!@#$%^&*()_+{}|:'<>?/.,`" diff --git a/tests/baselines/reference/objectTypesIdentity.types b/tests/baselines/reference/objectTypesIdentity.types index 3491682954a..af9957f9aee 100644 --- a/tests/baselines/reference/objectTypesIdentity.types +++ b/tests/baselines/reference/objectTypesIdentity.types @@ -39,7 +39,7 @@ var b = { foo: '' }; >b : { foo: string; } >{ foo: '' } : { foo: string; } >foo : string ->'' : string +>'' : "" function foo1(x: A); >foo1 : { (x: A): any; (x: A): any; } diff --git a/tests/baselines/reference/objectTypesIdentityWithCallSignatures.types b/tests/baselines/reference/objectTypesIdentityWithCallSignatures.types index 545e2376bb3..86a2ebec7c9 100644 --- a/tests/baselines/reference/objectTypesIdentityWithCallSignatures.types +++ b/tests/baselines/reference/objectTypesIdentityWithCallSignatures.types @@ -60,7 +60,7 @@ var b = { foo(x: string) { return ''; } }; >{ foo(x: string) { return ''; } } : { foo(x: string): string; } >foo : (x: string) => string >x : string ->'' : string +>'' : "" function foo1(x: A); >foo1 : { (x: A): any; (x: A): any; } diff --git a/tests/baselines/reference/objectTypesIdentityWithCallSignatures2.types b/tests/baselines/reference/objectTypesIdentityWithCallSignatures2.types index 378c5c4fa0c..12ebec233aa 100644 --- a/tests/baselines/reference/objectTypesIdentityWithCallSignatures2.types +++ b/tests/baselines/reference/objectTypesIdentityWithCallSignatures2.types @@ -62,7 +62,7 @@ var b = { foo(x: RegExp) { return ''; } }; >foo : (x: RegExp) => string >x : RegExp >RegExp : RegExp ->'' : string +>'' : "" function foo1(x: A); >foo1 : { (x: A): any; (x: A): any; } diff --git a/tests/baselines/reference/objectTypesIdentityWithCallSignaturesDifferingParamCounts.types b/tests/baselines/reference/objectTypesIdentityWithCallSignaturesDifferingParamCounts.types index 62426cb0333..7808037fd70 100644 --- a/tests/baselines/reference/objectTypesIdentityWithCallSignaturesDifferingParamCounts.types +++ b/tests/baselines/reference/objectTypesIdentityWithCallSignaturesDifferingParamCounts.types @@ -64,7 +64,7 @@ var b = { foo(x: string) { return ''; } }; >{ foo(x: string) { return ''; } } : { foo(x: string): string; } >foo : (x: string) => string >x : string ->'' : string +>'' : "" function foo1(x: A); >foo1 : { (x: A): any; (x: A): any; } diff --git a/tests/baselines/reference/objectTypesIdentityWithCallSignaturesWithOverloads.types b/tests/baselines/reference/objectTypesIdentityWithCallSignaturesWithOverloads.types index edaad51b32e..ea89bbc059e 100644 --- a/tests/baselines/reference/objectTypesIdentityWithCallSignaturesWithOverloads.types +++ b/tests/baselines/reference/objectTypesIdentityWithCallSignaturesWithOverloads.types @@ -110,7 +110,7 @@ var b = { >foo : (x: any) => any >x : any >'' : any ->'' : string +>'' : "" }; diff --git a/tests/baselines/reference/objectTypesIdentityWithConstructSignatures2.types b/tests/baselines/reference/objectTypesIdentityWithConstructSignatures2.types index 2e5e7231721..4dd31ec26d3 100644 --- a/tests/baselines/reference/objectTypesIdentityWithConstructSignatures2.types +++ b/tests/baselines/reference/objectTypesIdentityWithConstructSignatures2.types @@ -47,7 +47,7 @@ var b = { new(x: RegExp) { return ''; } }; // not a construct signature, functio >new : (x: RegExp) => string >x : RegExp >RegExp : RegExp ->'' : string +>'' : "" function foo1b(x: B); >foo1b : { (x: B): any; (x: B): any; } diff --git a/tests/baselines/reference/objectTypesIdentityWithConstructSignaturesDifferingParamCounts.types b/tests/baselines/reference/objectTypesIdentityWithConstructSignaturesDifferingParamCounts.types index b7f59953959..b7d4b42a83e 100644 --- a/tests/baselines/reference/objectTypesIdentityWithConstructSignaturesDifferingParamCounts.types +++ b/tests/baselines/reference/objectTypesIdentityWithConstructSignaturesDifferingParamCounts.types @@ -49,7 +49,7 @@ var b = { new(x: string) { return ''; } }; // not a construct signature, functio >{ new(x: string) { return ''; } } : { new(x: string): string; } >new : (x: string) => string >x : string ->'' : string +>'' : "" function foo1b(x: B); >foo1b : { (x: B): any; (x: B): any; } diff --git a/tests/baselines/reference/objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.types b/tests/baselines/reference/objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.types index 90ed7fd0945..33598fe815f 100644 --- a/tests/baselines/reference/objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.types +++ b/tests/baselines/reference/objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.types @@ -77,7 +77,7 @@ var b = { foo(x: T) { return ''; } }; >RegExp : RegExp >x : T >T : T ->'' : string +>'' : "" function foo1(x: A); >foo1 : { (x: A): any; (x: A): any; } diff --git a/tests/baselines/reference/objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints2.types b/tests/baselines/reference/objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints2.types index 4974b0874eb..265dd91784b 100644 --- a/tests/baselines/reference/objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints2.types +++ b/tests/baselines/reference/objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints2.types @@ -121,7 +121,7 @@ var b = { foo(x: T, y: U) { return ''; } }; >T : T >y : U >U : U ->'' : string +>'' : "" function foo1(x: A); >foo1 : { (x: A): any; (x: A): any; } diff --git a/tests/baselines/reference/objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints3.types b/tests/baselines/reference/objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints3.types index b5c2f6bdef0..89d0ceb2c73 100644 --- a/tests/baselines/reference/objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints3.types +++ b/tests/baselines/reference/objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints3.types @@ -155,7 +155,7 @@ var b = { foo(x: T, y: U) { return ''; } }; >T : T >y : U >U : U ->'' : string +>'' : "" function foo1(x: A); >foo1 : { (x: A): any; (x: A): any; } diff --git a/tests/baselines/reference/objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints.types b/tests/baselines/reference/objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints.types index ef3ec91f479..40c1733a1e1 100644 --- a/tests/baselines/reference/objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints.types +++ b/tests/baselines/reference/objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints.types @@ -60,7 +60,7 @@ var b = { new(x: T) { return ''; } }; // not a construct signa >RegExp : RegExp >x : T >T : T ->'' : string +>'' : "" function foo1b(x: B>); >foo1b : { (x: B): any; (x: B): any; } diff --git a/tests/baselines/reference/objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints2.types b/tests/baselines/reference/objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints2.types index b1d1d79ac05..2c214565809 100644 --- a/tests/baselines/reference/objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints2.types +++ b/tests/baselines/reference/objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints2.types @@ -99,7 +99,7 @@ var b = { new(x: T, y: U) { return ''; } }; // no >T : T >y : U >U : U ->'' : string +>'' : "" function foo1b(x: B, Array>); >foo1b : { (x: B): any; (x: B): any; } diff --git a/tests/baselines/reference/objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints3.types b/tests/baselines/reference/objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints3.types index d8109a6a826..6b3dab83ded 100644 --- a/tests/baselines/reference/objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints3.types +++ b/tests/baselines/reference/objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints3.types @@ -133,7 +133,7 @@ var b = { new(x: T, y: U) { return ''; } }; // not a >T : T >y : U >U : U ->'' : string +>'' : "" function foo1b(x: B); >foo1b : { (x: B): any; (x: B): any; } diff --git a/tests/baselines/reference/objectTypesIdentityWithNumericIndexers1.types b/tests/baselines/reference/objectTypesIdentityWithNumericIndexers1.types index 78c69f0cdd3..8ac7b807cba 100644 --- a/tests/baselines/reference/objectTypesIdentityWithNumericIndexers1.types +++ b/tests/baselines/reference/objectTypesIdentityWithNumericIndexers1.types @@ -51,7 +51,7 @@ var b: { [x: number]: string; } = { 0: '' }; >b : { [x: number]: string; } >x : number >{ 0: '' } : { 0: string; } ->'' : string +>'' : "" function foo1(x: A); >foo1 : { (x: A): any; (x: A): any; } diff --git a/tests/baselines/reference/objectTypesIdentityWithNumericIndexers3.types b/tests/baselines/reference/objectTypesIdentityWithNumericIndexers3.types index a6ea5a292e5..bcf2ef6d733 100644 --- a/tests/baselines/reference/objectTypesIdentityWithNumericIndexers3.types +++ b/tests/baselines/reference/objectTypesIdentityWithNumericIndexers3.types @@ -51,7 +51,7 @@ var b: { [x: number]: string; } = { 0: '' }; >b : { [x: number]: string; } >x : number >{ 0: '' } : { 0: string; } ->'' : string +>'' : "" function foo1(x: A); >foo1 : { (x: A): any; (x: A): any; } diff --git a/tests/baselines/reference/objectTypesIdentityWithOptionality.types b/tests/baselines/reference/objectTypesIdentityWithOptionality.types index bab319f3598..0e02350de9a 100644 --- a/tests/baselines/reference/objectTypesIdentityWithOptionality.types +++ b/tests/baselines/reference/objectTypesIdentityWithOptionality.types @@ -39,7 +39,7 @@ var b = { foo: '' }; >b : { foo: string; } >{ foo: '' } : { foo: string; } >foo : string ->'' : string +>'' : "" function foo2(x: I); >foo2 : { (x: I): any; (x: I): any; } diff --git a/tests/baselines/reference/objectTypesIdentityWithPrivates.types b/tests/baselines/reference/objectTypesIdentityWithPrivates.types index c828f45ac5a..6a0cf84850f 100644 --- a/tests/baselines/reference/objectTypesIdentityWithPrivates.types +++ b/tests/baselines/reference/objectTypesIdentityWithPrivates.types @@ -49,7 +49,7 @@ var b = { foo: '' }; >b : { foo: string; } >{ foo: '' } : { foo: string; } >foo : string ->'' : string +>'' : "" function foo1(x: A); >foo1 : { (x: A): any; (x: A): any; } diff --git a/tests/baselines/reference/objectTypesIdentityWithPublics.types b/tests/baselines/reference/objectTypesIdentityWithPublics.types index daae624a7d1..5fe82c099ef 100644 --- a/tests/baselines/reference/objectTypesIdentityWithPublics.types +++ b/tests/baselines/reference/objectTypesIdentityWithPublics.types @@ -39,7 +39,7 @@ var b = { foo: '' }; >b : { foo: string; } >{ foo: '' } : { foo: string; } >foo : string ->'' : string +>'' : "" function foo1(x: A); >foo1 : { (x: A): any; (x: A): any; } diff --git a/tests/baselines/reference/objectTypesIdentityWithStringIndexers.types b/tests/baselines/reference/objectTypesIdentityWithStringIndexers.types index 8393eaf68a0..4028835a9c4 100644 --- a/tests/baselines/reference/objectTypesIdentityWithStringIndexers.types +++ b/tests/baselines/reference/objectTypesIdentityWithStringIndexers.types @@ -52,7 +52,7 @@ var b: { [x: string]: string; } = { foo: '' }; >x : string >{ foo: '' } : { foo: string; } >foo : string ->'' : string +>'' : "" function foo1(x: A); >foo1 : { (x: A): any; (x: A): any; } diff --git a/tests/baselines/reference/octalIntegerLiteral.types b/tests/baselines/reference/octalIntegerLiteral.types index 8352e5fac0c..f8f07da9a4b 100644 --- a/tests/baselines/reference/octalIntegerLiteral.types +++ b/tests/baselines/reference/octalIntegerLiteral.types @@ -1,30 +1,30 @@ === tests/cases/conformance/es6/binaryAndOctalIntegerLiteral/octalIntegerLiteral.ts === var oct1 = 0o45436; >oct1 : number ->0o45436 : number +>0o45436 : 19230 var oct2 = 0O45436; >oct2 : number ->0O45436 : number +>0O45436 : 19230 var oct3 = 0o7777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777; >oct3 : number ->0o7777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777 : number +>0o7777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777 : Infinity var oct4 = 0o7777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777; >oct4 : number ->0o7777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777 : number +>0o7777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777 : 5.462437423415177e+244 var obj1 = { >obj1 : { 0o45436: string; a: number; b: number; oct1: number; 0o7777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777: boolean; } >{ 0o45436: "Hello", a: 0o45436, b: oct1, oct1, 0o7777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777: true} : { 0o45436: string; a: number; b: number; oct1: number; 0o7777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777: boolean; } 0o45436: "Hello", ->"Hello" : string +>"Hello" : "Hello" a: 0o45436, >a : number ->0o45436 : number +>0o45436 : 19230 b: oct1, >b : number @@ -34,7 +34,7 @@ var obj1 = { >oct1 : number 0o7777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777: true ->true : boolean +>true : true } var obj2 = { @@ -42,11 +42,11 @@ var obj2 = { >{ 0O45436: "hi", a: 0O45436, b: oct2, oct2, 0o7777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777: false,} : { 0O45436: string; a: number; b: number; oct2: number; 0o7777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777: boolean; } 0O45436: "hi", ->"hi" : string +>"hi" : "hi" a: 0O45436, >a : number ->0O45436 : number +>0O45436 : 19230 b: oct2, >b : number @@ -56,96 +56,96 @@ var obj2 = { >oct2 : number 0o7777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777: false, ->false : boolean +>false : false } obj1[0o45436]; // string >obj1[0o45436] : string >obj1 : { 0o45436: string; a: number; b: number; oct1: number; 0o7777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777: boolean; } ->0o45436 : number +>0o45436 : 19230 obj1["0o45436"]; // any >obj1["0o45436"] : any >obj1 : { 0o45436: string; a: number; b: number; oct1: number; 0o7777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777: boolean; } ->"0o45436" : string +>"0o45436" : "0o45436" obj1["19230"]; // string >obj1["19230"] : string >obj1 : { 0o45436: string; a: number; b: number; oct1: number; 0o7777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777: boolean; } ->"19230" : string +>"19230" : "19230" obj1[19230]; // string >obj1[19230] : string >obj1 : { 0o45436: string; a: number; b: number; oct1: number; 0o7777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777: boolean; } ->19230 : number +>19230 : 19230 obj1["a"]; // number >obj1["a"] : number >obj1 : { 0o45436: string; a: number; b: number; oct1: number; 0o7777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777: boolean; } ->"a" : string +>"a" : "a" obj1["b"]; // number >obj1["b"] : number >obj1 : { 0o45436: string; a: number; b: number; oct1: number; 0o7777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777: boolean; } ->"b" : string +>"b" : "b" obj1["oct1"]; // number >obj1["oct1"] : number >obj1 : { 0o45436: string; a: number; b: number; oct1: number; 0o7777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777: boolean; } ->"oct1" : string +>"oct1" : "oct1" obj1["Infinity"]; // boolean >obj1["Infinity"] : boolean >obj1 : { 0o45436: string; a: number; b: number; oct1: number; 0o7777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777: boolean; } ->"Infinity" : string +>"Infinity" : "Infinity" obj2[0O45436]; // string >obj2[0O45436] : string >obj2 : { 0O45436: string; a: number; b: number; oct2: number; 0o7777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777: boolean; } ->0O45436 : number +>0O45436 : 19230 obj2["0O45436"]; // any >obj2["0O45436"] : any >obj2 : { 0O45436: string; a: number; b: number; oct2: number; 0o7777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777: boolean; } ->"0O45436" : string +>"0O45436" : "0O45436" obj2["19230"]; // string >obj2["19230"] : string >obj2 : { 0O45436: string; a: number; b: number; oct2: number; 0o7777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777: boolean; } ->"19230" : string +>"19230" : "19230" obj2[19230]; // string >obj2[19230] : string >obj2 : { 0O45436: string; a: number; b: number; oct2: number; 0o7777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777: boolean; } ->19230 : number +>19230 : 19230 obj2["a"]; // number >obj2["a"] : number >obj2 : { 0O45436: string; a: number; b: number; oct2: number; 0o7777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777: boolean; } ->"a" : string +>"a" : "a" obj2["b"]; // number >obj2["b"] : number >obj2 : { 0O45436: string; a: number; b: number; oct2: number; 0o7777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777: boolean; } ->"b" : string +>"b" : "b" obj2["oct2"]; // number >obj2["oct2"] : number >obj2 : { 0O45436: string; a: number; b: number; oct2: number; 0o7777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777: boolean; } ->"oct2" : string +>"oct2" : "oct2" obj2[5.462437423415177e+244]; // boolean >obj2[5.462437423415177e+244] : boolean >obj2 : { 0O45436: string; a: number; b: number; oct2: number; 0o7777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777: boolean; } ->5.462437423415177e+244 : number +>5.462437423415177e+244 : 5.462437423415177e+244 obj2["5.462437423415177e+244"]; // boolean >obj2["5.462437423415177e+244"] : boolean >obj2 : { 0O45436: string; a: number; b: number; oct2: number; 0o7777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777: boolean; } ->"5.462437423415177e+244" : string +>"5.462437423415177e+244" : "5.462437423415177e+244" obj2["Infinity"]; // any >obj2["Infinity"] : any >obj2 : { 0O45436: string; a: number; b: number; oct2: number; 0o7777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777: boolean; } ->"Infinity" : string +>"Infinity" : "Infinity" diff --git a/tests/baselines/reference/octalIntegerLiteralES6.types b/tests/baselines/reference/octalIntegerLiteralES6.types index 7ef32b49289..06061be5d58 100644 --- a/tests/baselines/reference/octalIntegerLiteralES6.types +++ b/tests/baselines/reference/octalIntegerLiteralES6.types @@ -1,30 +1,30 @@ === tests/cases/conformance/es6/binaryAndOctalIntegerLiteral/octalIntegerLiteralES6.ts === var oct1 = 0o45436; >oct1 : number ->0o45436 : number +>0o45436 : 19230 var oct2 = 0O45436; >oct2 : number ->0O45436 : number +>0O45436 : 19230 var oct3 = 0o7777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777; >oct3 : number ->0o7777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777 : number +>0o7777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777 : Infinity var oct4 = 0o7777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777; >oct4 : number ->0o7777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777 : number +>0o7777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777 : 5.462437423415177e+244 var obj1 = { >obj1 : { 0o45436: string; a: number; b: number; oct1: number; 0o7777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777: boolean; } >{ 0o45436: "Hello", a: 0o45436, b: oct1, oct1, 0o7777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777: true} : { 0o45436: string; a: number; b: number; oct1: number; 0o7777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777: boolean; } 0o45436: "Hello", ->"Hello" : string +>"Hello" : "Hello" a: 0o45436, >a : number ->0o45436 : number +>0o45436 : 19230 b: oct1, >b : number @@ -34,7 +34,7 @@ var obj1 = { >oct1 : number 0o7777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777: true ->true : boolean +>true : true } var obj2 = { @@ -42,11 +42,11 @@ var obj2 = { >{ 0O45436: "hi", a: 0O45436, b: oct2, oct2, 0o7777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777: false,} : { 0O45436: string; a: number; b: number; oct2: number; 0o7777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777: boolean; } 0O45436: "hi", ->"hi" : string +>"hi" : "hi" a: 0O45436, >a : number ->0O45436 : number +>0O45436 : 19230 b: oct2, >b : number @@ -56,96 +56,96 @@ var obj2 = { >oct2 : number 0o7777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777: false, ->false : boolean +>false : false } obj1[0o45436]; // string >obj1[0o45436] : string >obj1 : { 0o45436: string; a: number; b: number; oct1: number; 0o7777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777: boolean; } ->0o45436 : number +>0o45436 : 19230 obj1["0o45436"]; // any >obj1["0o45436"] : any >obj1 : { 0o45436: string; a: number; b: number; oct1: number; 0o7777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777: boolean; } ->"0o45436" : string +>"0o45436" : "0o45436" obj1["19230"]; // string >obj1["19230"] : string >obj1 : { 0o45436: string; a: number; b: number; oct1: number; 0o7777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777: boolean; } ->"19230" : string +>"19230" : "19230" obj1[19230]; // string >obj1[19230] : string >obj1 : { 0o45436: string; a: number; b: number; oct1: number; 0o7777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777: boolean; } ->19230 : number +>19230 : 19230 obj1["a"]; // number >obj1["a"] : number >obj1 : { 0o45436: string; a: number; b: number; oct1: number; 0o7777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777: boolean; } ->"a" : string +>"a" : "a" obj1["b"]; // number >obj1["b"] : number >obj1 : { 0o45436: string; a: number; b: number; oct1: number; 0o7777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777: boolean; } ->"b" : string +>"b" : "b" obj1["oct1"]; // number >obj1["oct1"] : number >obj1 : { 0o45436: string; a: number; b: number; oct1: number; 0o7777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777: boolean; } ->"oct1" : string +>"oct1" : "oct1" obj1["Infinity"]; // boolean >obj1["Infinity"] : boolean >obj1 : { 0o45436: string; a: number; b: number; oct1: number; 0o7777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777: boolean; } ->"Infinity" : string +>"Infinity" : "Infinity" obj2[0O45436]; // string >obj2[0O45436] : string >obj2 : { 0O45436: string; a: number; b: number; oct2: number; 0o7777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777: boolean; } ->0O45436 : number +>0O45436 : 19230 obj2["0O45436"]; // any >obj2["0O45436"] : any >obj2 : { 0O45436: string; a: number; b: number; oct2: number; 0o7777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777: boolean; } ->"0O45436" : string +>"0O45436" : "0O45436" obj2["19230"]; // string >obj2["19230"] : string >obj2 : { 0O45436: string; a: number; b: number; oct2: number; 0o7777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777: boolean; } ->"19230" : string +>"19230" : "19230" obj2[19230]; // string >obj2[19230] : string >obj2 : { 0O45436: string; a: number; b: number; oct2: number; 0o7777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777: boolean; } ->19230 : number +>19230 : 19230 obj2["a"]; // number >obj2["a"] : number >obj2 : { 0O45436: string; a: number; b: number; oct2: number; 0o7777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777: boolean; } ->"a" : string +>"a" : "a" obj2["b"]; // number >obj2["b"] : number >obj2 : { 0O45436: string; a: number; b: number; oct2: number; 0o7777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777: boolean; } ->"b" : string +>"b" : "b" obj2["oct2"]; // number >obj2["oct2"] : number >obj2 : { 0O45436: string; a: number; b: number; oct2: number; 0o7777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777: boolean; } ->"oct2" : string +>"oct2" : "oct2" obj2[5.462437423415177e+244]; // boolean >obj2[5.462437423415177e+244] : boolean >obj2 : { 0O45436: string; a: number; b: number; oct2: number; 0o7777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777: boolean; } ->5.462437423415177e+244 : number +>5.462437423415177e+244 : 5.462437423415177e+244 obj2["5.462437423415177e+244"]; // boolean >obj2["5.462437423415177e+244"] : boolean >obj2 : { 0O45436: string; a: number; b: number; oct2: number; 0o7777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777: boolean; } ->"5.462437423415177e+244" : string +>"5.462437423415177e+244" : "5.462437423415177e+244" obj2["Infinity"]; // any >obj2["Infinity"] : any >obj2 : { 0O45436: string; a: number; b: number; oct2: number; 0o7777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777: boolean; } ->"Infinity" : string +>"Infinity" : "Infinity" diff --git a/tests/baselines/reference/operatorsAndIntersectionTypes.types b/tests/baselines/reference/operatorsAndIntersectionTypes.types index b955059fea6..7c594b08812 100644 --- a/tests/baselines/reference/operatorsAndIntersectionTypes.types +++ b/tests/baselines/reference/operatorsAndIntersectionTypes.types @@ -12,7 +12,7 @@ function createGuid() { return "21EC2020-3AEA-4069-A2DD-08002B30309D" as Guid; >"21EC2020-3AEA-4069-A2DD-08002B30309D" as Guid : Guid ->"21EC2020-3AEA-4069-A2DD-08002B30309D" : string +>"21EC2020-3AEA-4069-A2DD-08002B30309D" : "21EC2020-3AEA-4069-A2DD-08002B30309D" >Guid : Guid } @@ -21,7 +21,7 @@ function createSerialNo() { return 12345 as SerialNo; >12345 as SerialNo : SerialNo ->12345 : number +>12345 : 12345 >SerialNo : SerialNo } @@ -36,11 +36,11 @@ let guid = createGuid(); >createGuid : () => Guid map1[guid] = 123; // Can with tagged string ->map1[guid] = 123 : number +>map1[guid] = 123 : 123 >map1[guid] : number >map1 : { [x: string]: number; } >guid : Guid ->123 : number +>123 : 123 let map2: { [x: number]: string } = {}; >map2 : { [x: number]: string; } @@ -53,19 +53,19 @@ let serialNo = createSerialNo(); >createSerialNo : () => SerialNo map2[serialNo] = "hello"; // Can index with tagged number ->map2[serialNo] = "hello" : string +>map2[serialNo] = "hello" : "hello" >map2[serialNo] : string >map2 : { [x: number]: string; } >serialNo : SerialNo ->"hello" : string +>"hello" : "hello" const s1 = "{" + guid + "}"; >s1 : string >"{" + guid + "}" : string >"{" + guid : string ->"{" : string +>"{" : "{" >guid : Guid ->"}" : string +>"}" : "}" const s2 = guid.toLowerCase(); >s2 : string @@ -92,13 +92,13 @@ const s5 = serialNo.toPrecision(0); >serialNo.toPrecision : (precision?: number) => string >serialNo : SerialNo >toPrecision : (precision?: number) => string ->0 : number +>0 : 0 const n1 = serialNo * 3; >n1 : number >serialNo * 3 : number >serialNo : SerialNo ->3 : number +>3 : 3 const n2 = serialNo + serialNo; >n2 : number diff --git a/tests/baselines/reference/optionalAccessorsInInterface1.types b/tests/baselines/reference/optionalAccessorsInInterface1.types index d030849e554..c4894fd30dc 100644 --- a/tests/baselines/reference/optionalAccessorsInInterface1.types +++ b/tests/baselines/reference/optionalAccessorsInInterface1.types @@ -21,11 +21,11 @@ defineMyProperty({}, "name", { get: function () { return 5; } }); >defineMyProperty({}, "name", { get: function () { return 5; } }) : any >defineMyProperty : (o: any, p: string, attributes: MyPropertyDescriptor) => any >{} : {} ->"name" : string +>"name" : "name" >{ get: function () { return 5; } } : { get: () => number; } >get : () => number >function () { return 5; } : () => number ->5 : number +>5 : 5 interface MyPropertyDescriptor2 { >MyPropertyDescriptor2 : MyPropertyDescriptor2 @@ -49,9 +49,9 @@ defineMyProperty2({}, "name", { get: function () { return 5; } }); >defineMyProperty2({}, "name", { get: function () { return 5; } }) : any >defineMyProperty2 : (o: any, p: string, attributes: MyPropertyDescriptor2) => any >{} : {} ->"name" : string +>"name" : "name" >{ get: function () { return 5; } } : { get: () => number; } >get : () => number >function () { return 5; } : () => number ->5 : number +>5 : 5 diff --git a/tests/baselines/reference/optionalBindingParameters1.errors.txt b/tests/baselines/reference/optionalBindingParameters1.errors.txt index 0780c626baf..66256edf727 100644 --- a/tests/baselines/reference/optionalBindingParameters1.errors.txt +++ b/tests/baselines/reference/optionalBindingParameters1.errors.txt @@ -1,5 +1,5 @@ tests/cases/conformance/es6/destructuring/optionalBindingParameters1.ts(2,14): error TS2463: A binding pattern parameter cannot be optional in an implementation signature. -tests/cases/conformance/es6/destructuring/optionalBindingParameters1.ts(8,5): error TS2345: Argument of type '[boolean, number, string]' is not assignable to parameter of type '[string, number, boolean]'. +tests/cases/conformance/es6/destructuring/optionalBindingParameters1.ts(8,5): error TS2345: Argument of type '[boolean, number, ""]' is not assignable to parameter of type '[string, number, boolean]'. Type 'boolean' is not assignable to type 'string'. @@ -15,5 +15,5 @@ tests/cases/conformance/es6/destructuring/optionalBindingParameters1.ts(8,5): er foo([false, 0, ""]); ~~~~~~~~~~~~~~ -!!! error TS2345: Argument of type '[boolean, number, string]' is not assignable to parameter of type '[string, number, boolean]'. +!!! error TS2345: Argument of type '[boolean, number, ""]' is not assignable to parameter of type '[string, number, boolean]'. !!! error TS2345: Type 'boolean' is not assignable to type 'string'. \ No newline at end of file diff --git a/tests/baselines/reference/optionalBindingParameters2.errors.txt b/tests/baselines/reference/optionalBindingParameters2.errors.txt index e67687722d0..34f36d32380 100644 --- a/tests/baselines/reference/optionalBindingParameters2.errors.txt +++ b/tests/baselines/reference/optionalBindingParameters2.errors.txt @@ -1,5 +1,5 @@ tests/cases/conformance/es6/destructuring/optionalBindingParameters2.ts(2,14): error TS2463: A binding pattern parameter cannot be optional in an implementation signature. -tests/cases/conformance/es6/destructuring/optionalBindingParameters2.ts(8,5): error TS2345: Argument of type '{ x: boolean; y: number; z: string; }' is not assignable to parameter of type '{ x: string; y: number; z: boolean; }'. +tests/cases/conformance/es6/destructuring/optionalBindingParameters2.ts(8,5): error TS2345: Argument of type '{ x: boolean; y: number; z: ""; }' is not assignable to parameter of type '{ x: string; y: number; z: boolean; }'. Types of property 'x' are incompatible. Type 'boolean' is not assignable to type 'string'. @@ -16,6 +16,6 @@ tests/cases/conformance/es6/destructuring/optionalBindingParameters2.ts(8,5): er foo({ x: false, y: 0, z: "" }); ~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2345: Argument of type '{ x: boolean; y: number; z: string; }' is not assignable to parameter of type '{ x: string; y: number; z: boolean; }'. +!!! error TS2345: Argument of type '{ x: boolean; y: number; z: ""; }' is not assignable to parameter of type '{ x: string; y: number; z: boolean; }'. !!! error TS2345: Types of property 'x' are incompatible. !!! error TS2345: Type 'boolean' is not assignable to type 'string'. \ No newline at end of file diff --git a/tests/baselines/reference/optionalBindingParametersInOverloads1.errors.txt b/tests/baselines/reference/optionalBindingParametersInOverloads1.errors.txt index 30ec4037c88..771ada1a464 100644 --- a/tests/baselines/reference/optionalBindingParametersInOverloads1.errors.txt +++ b/tests/baselines/reference/optionalBindingParametersInOverloads1.errors.txt @@ -1,4 +1,4 @@ -tests/cases/conformance/es6/destructuring/optionalBindingParametersInOverloads1.ts(9,5): error TS2345: Argument of type '[boolean, number, string]' is not assignable to parameter of type '[string, number, boolean]'. +tests/cases/conformance/es6/destructuring/optionalBindingParametersInOverloads1.ts(9,5): error TS2345: Argument of type '[boolean, number, ""]' is not assignable to parameter of type '[string, number, boolean]'. Type 'boolean' is not assignable to type 'string'. @@ -13,5 +13,5 @@ tests/cases/conformance/es6/destructuring/optionalBindingParametersInOverloads1. foo([false, 0, ""]); ~~~~~~~~~~~~~~ -!!! error TS2345: Argument of type '[boolean, number, string]' is not assignable to parameter of type '[string, number, boolean]'. +!!! error TS2345: Argument of type '[boolean, number, ""]' is not assignable to parameter of type '[string, number, boolean]'. !!! error TS2345: Type 'boolean' is not assignable to type 'string'. \ No newline at end of file diff --git a/tests/baselines/reference/optionalBindingParametersInOverloads2.errors.txt b/tests/baselines/reference/optionalBindingParametersInOverloads2.errors.txt index 765fd5e3de6..e2546aff724 100644 --- a/tests/baselines/reference/optionalBindingParametersInOverloads2.errors.txt +++ b/tests/baselines/reference/optionalBindingParametersInOverloads2.errors.txt @@ -1,4 +1,4 @@ -tests/cases/conformance/es6/destructuring/optionalBindingParametersInOverloads2.ts(9,5): error TS2345: Argument of type '{ x: boolean; y: number; z: string; }' is not assignable to parameter of type '{ x: string; y: number; z: boolean; }'. +tests/cases/conformance/es6/destructuring/optionalBindingParametersInOverloads2.ts(9,5): error TS2345: Argument of type '{ x: boolean; y: number; z: ""; }' is not assignable to parameter of type '{ x: string; y: number; z: boolean; }'. Types of property 'x' are incompatible. Type 'boolean' is not assignable to type 'string'. @@ -14,6 +14,6 @@ tests/cases/conformance/es6/destructuring/optionalBindingParametersInOverloads2. foo({ x: false, y: 0, z: "" }); ~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2345: Argument of type '{ x: boolean; y: number; z: string; }' is not assignable to parameter of type '{ x: string; y: number; z: boolean; }'. +!!! error TS2345: Argument of type '{ x: boolean; y: number; z: ""; }' is not assignable to parameter of type '{ x: string; y: number; z: boolean; }'. !!! error TS2345: Types of property 'x' are incompatible. !!! error TS2345: Type 'boolean' is not assignable to type 'string'. \ No newline at end of file diff --git a/tests/baselines/reference/optionalMethods.types b/tests/baselines/reference/optionalMethods.types index 70fda27c012..cf545eda509 100644 --- a/tests/baselines/reference/optionalMethods.types +++ b/tests/baselines/reference/optionalMethods.types @@ -69,7 +69,7 @@ function test1(x: Foo) { >x.g : () => number >x : Foo >g : () => number ->0 : number +>0 : 0 } class Bar { @@ -83,18 +83,18 @@ class Bar { c? = 2; >c : number | undefined ->2 : number +>2 : 2 constructor(public d?: number, public e = 10) {} >d : number | undefined >e : number ->10 : number +>10 : 10 f() { >f : () => number return 1; ->1 : number +>1 : 1 } g?(): number; // Body of optional method can be omitted >g : (() => number) | undefined @@ -103,7 +103,7 @@ class Bar { >h : (() => number) | undefined return 2; ->2 : number +>2 : 2 } } @@ -175,7 +175,7 @@ function test2(x: Bar) { >x.g : () => number >x : Bar >g : () => number ->0 : number +>0 : 0 let h1 = x.h && x.h(); >h1 : number | undefined @@ -198,7 +198,7 @@ function test2(x: Bar) { >x.h : () => number >x : Bar >h : () => number ->0 : number +>0 : 0 } class Base { @@ -217,10 +217,10 @@ class Derived extends Base { a = 1; >a : number ->1 : number +>1 : 1 f(): number { return 1; } >f : () => number ->1 : number +>1 : 1 } diff --git a/tests/baselines/reference/optionalParamReferencingOtherParams1.types b/tests/baselines/reference/optionalParamReferencingOtherParams1.types index 5a8963b8b33..ed8f0472191 100644 --- a/tests/baselines/reference/optionalParamReferencingOtherParams1.types +++ b/tests/baselines/reference/optionalParamReferencingOtherParams1.types @@ -5,7 +5,7 @@ function strange(x: number, y = x * 1, z = x + y) { >y : number >x * 1 : number >x : number ->1 : number +>1 : 1 >z : number >x + y : number >x : number diff --git a/tests/baselines/reference/optionalParamterAndVariableDeclaration.types b/tests/baselines/reference/optionalParamterAndVariableDeclaration.types index 36c74bf00b9..ad153779039 100644 --- a/tests/baselines/reference/optionalParamterAndVariableDeclaration.types +++ b/tests/baselines/reference/optionalParamterAndVariableDeclaration.types @@ -10,7 +10,7 @@ class C { >(options || 0) : number >options || 0 : number >options : number ->0 : number +>0 : 0 } } diff --git a/tests/baselines/reference/optionsInlineSourceMapSourceRoot.types b/tests/baselines/reference/optionsInlineSourceMapSourceRoot.types index 1f6a5fc9dc6..a1a47c3f975 100644 --- a/tests/baselines/reference/optionsInlineSourceMapSourceRoot.types +++ b/tests/baselines/reference/optionsInlineSourceMapSourceRoot.types @@ -2,5 +2,5 @@ var a = 10; >a : number ->10 : number +>10 : 10 diff --git a/tests/baselines/reference/optionsSourcemapInlineSources.types b/tests/baselines/reference/optionsSourcemapInlineSources.types index 42fa1839371..1c9865777bb 100644 --- a/tests/baselines/reference/optionsSourcemapInlineSources.types +++ b/tests/baselines/reference/optionsSourcemapInlineSources.types @@ -2,5 +2,5 @@ var a = 10; >a : number ->10 : number +>10 : 10 diff --git a/tests/baselines/reference/optionsSourcemapInlineSourcesMapRoot.types b/tests/baselines/reference/optionsSourcemapInlineSourcesMapRoot.types index 77abb6f7b11..cfe881d34f5 100644 --- a/tests/baselines/reference/optionsSourcemapInlineSourcesMapRoot.types +++ b/tests/baselines/reference/optionsSourcemapInlineSourcesMapRoot.types @@ -2,5 +2,5 @@ var a = 10; >a : number ->10 : number +>10 : 10 diff --git a/tests/baselines/reference/optionsSourcemapInlineSourcesSourceRoot.types b/tests/baselines/reference/optionsSourcemapInlineSourcesSourceRoot.types index 3689afc382c..02226ff945a 100644 --- a/tests/baselines/reference/optionsSourcemapInlineSourcesSourceRoot.types +++ b/tests/baselines/reference/optionsSourcemapInlineSourcesSourceRoot.types @@ -2,5 +2,5 @@ var a = 10; >a : number ->10 : number +>10 : 10 diff --git a/tests/baselines/reference/out-flag.types b/tests/baselines/reference/out-flag.types index b182e4e53d9..f1dee2d3c4a 100644 --- a/tests/baselines/reference/out-flag.types +++ b/tests/baselines/reference/out-flag.types @@ -10,7 +10,7 @@ class MyClass >Count : () => number { return 42; ->42 : number +>42 : 42 } public SetCount(value: number) diff --git a/tests/baselines/reference/overload1.errors.txt b/tests/baselines/reference/overload1.errors.txt index a1d8c5a6232..a88b4f81519 100644 --- a/tests/baselines/reference/overload1.errors.txt +++ b/tests/baselines/reference/overload1.errors.txt @@ -3,7 +3,7 @@ tests/cases/compiler/overload1.ts(29,1): error TS2322: Type 'number' is not assi tests/cases/compiler/overload1.ts(31,3): error TS2346: Supplied parameters do not match any signature of call target. tests/cases/compiler/overload1.ts(32,3): error TS2346: Supplied parameters do not match any signature of call target. tests/cases/compiler/overload1.ts(33,1): error TS2322: Type 'C' is not assignable to type 'string'. -tests/cases/compiler/overload1.ts(34,9): error TS2345: Argument of type 'number' is not assignable to parameter of type 'string'. +tests/cases/compiler/overload1.ts(34,9): error TS2345: Argument of type '2' is not assignable to parameter of type 'string'. ==== tests/cases/compiler/overload1.ts (6 errors) ==== @@ -52,7 +52,7 @@ tests/cases/compiler/overload1.ts(34,9): error TS2345: Argument of type 'number' !!! error TS2322: Type 'C' is not assignable to type 'string'. z=x.h(2,2); // no match ~ -!!! error TS2345: Argument of type 'number' is not assignable to parameter of type 'string'. +!!! error TS2345: Argument of type '2' is not assignable to parameter of type 'string'. z=x.h("hello",0); // good var v=x.g; diff --git a/tests/baselines/reference/overloadCallTest.types b/tests/baselines/reference/overloadCallTest.types index bd719311975..8b35c56bf57 100644 --- a/tests/baselines/reference/overloadCallTest.types +++ b/tests/baselines/reference/overloadCallTest.types @@ -13,13 +13,13 @@ class foo { function bar(foo?: string) { return "foo" }; >bar : { (): string; (s: string): any; } >foo : string ->"foo" : string +>"foo" : "foo" var test = bar("test"); >test : any >bar("test") : any >bar : { (): string; (s: string): any; } ->"test" : string +>"test" : "test" var goo = bar(); >goo : string @@ -31,7 +31,7 @@ class foo { >goo : string >bar("test") : any >bar : { (): string; (s: string): any; } ->"test" : string +>"test" : "test" } } diff --git a/tests/baselines/reference/overloadOnConstAsTypeAnnotation.types b/tests/baselines/reference/overloadOnConstAsTypeAnnotation.types index 10a185708d4..382fddfb78a 100644 --- a/tests/baselines/reference/overloadOnConstAsTypeAnnotation.types +++ b/tests/baselines/reference/overloadOnConstAsTypeAnnotation.types @@ -5,5 +5,5 @@ var f: (x: 'hi') => number = (x: 'hi') => { return 1; }; >x : "hi" >(x: 'hi') => { return 1; } : (x: "hi") => number >x : "hi" ->1 : number +>1 : 1 diff --git a/tests/baselines/reference/overloadOnConstConstraintChecks3.types b/tests/baselines/reference/overloadOnConstConstraintChecks3.types index 0348d3d4b79..293d92d4674 100644 --- a/tests/baselines/reference/overloadOnConstConstraintChecks3.types +++ b/tests/baselines/reference/overloadOnConstConstraintChecks3.types @@ -2,7 +2,7 @@ class A { private x = 1} >A : A >x : number ->1 : number +>1 : 1 class B extends A {} >B : B diff --git a/tests/baselines/reference/overloadOnConstConstraintChecks4.types b/tests/baselines/reference/overloadOnConstConstraintChecks4.types index 6ca7288ead9..7b3900038d4 100644 --- a/tests/baselines/reference/overloadOnConstConstraintChecks4.types +++ b/tests/baselines/reference/overloadOnConstConstraintChecks4.types @@ -6,7 +6,7 @@ class A extends Z { private x = 1 } >A : A >Z : Z >x : number ->1 : number +>1 : 1 class B extends A {} >B : B diff --git a/tests/baselines/reference/overloadOnConstInCallback1.types b/tests/baselines/reference/overloadOnConstInCallback1.types index c8c123df1e8..c9d954aa282 100644 --- a/tests/baselines/reference/overloadOnConstInCallback1.types +++ b/tests/baselines/reference/overloadOnConstInCallback1.types @@ -17,16 +17,16 @@ class C { callback('hi'); >callback('hi') : number >callback : (x: any) => number ->'hi' : string +>'hi' : "hi" callback('bye'); >callback('bye') : number >callback : (x: any) => number ->'bye' : string +>'bye' : "bye" var hm = "hm"; >hm : string ->"hm" : string +>"hm" : "hm" callback(hm); >callback(hm) : number diff --git a/tests/baselines/reference/overloadOnConstNoAnyImplementation.errors.txt b/tests/baselines/reference/overloadOnConstNoAnyImplementation.errors.txt index fe5219606ff..0573c6ed79e 100644 --- a/tests/baselines/reference/overloadOnConstNoAnyImplementation.errors.txt +++ b/tests/baselines/reference/overloadOnConstNoAnyImplementation.errors.txt @@ -1,4 +1,4 @@ -tests/cases/compiler/overloadOnConstNoAnyImplementation.ts(9,8): error TS2345: Argument of type 'number' is not assignable to parameter of type 'string'. +tests/cases/compiler/overloadOnConstNoAnyImplementation.ts(9,8): error TS2345: Argument of type '1' is not assignable to parameter of type 'string'. ==== tests/cases/compiler/overloadOnConstNoAnyImplementation.ts (1 errors) ==== @@ -12,7 +12,7 @@ tests/cases/compiler/overloadOnConstNoAnyImplementation.ts(9,8): error TS2345: A cb('uh'); cb(1); // error ~ -!!! error TS2345: Argument of type 'number' is not assignable to parameter of type 'string'. +!!! error TS2345: Argument of type '1' is not assignable to parameter of type 'string'. } var cb: (number) => number = (x: number) => 1; diff --git a/tests/baselines/reference/overloadOnConstNoAnyImplementation2.errors.txt b/tests/baselines/reference/overloadOnConstNoAnyImplementation2.errors.txt index 8723a79d474..24047578ec6 100644 --- a/tests/baselines/reference/overloadOnConstNoAnyImplementation2.errors.txt +++ b/tests/baselines/reference/overloadOnConstNoAnyImplementation2.errors.txt @@ -1,4 +1,4 @@ -tests/cases/compiler/overloadOnConstNoAnyImplementation2.ts(12,18): error TS2345: Argument of type 'number' is not assignable to parameter of type 'string'. +tests/cases/compiler/overloadOnConstNoAnyImplementation2.ts(12,18): error TS2345: Argument of type '1' is not assignable to parameter of type 'string'. tests/cases/compiler/overloadOnConstNoAnyImplementation2.ts(18,9): error TS2345: Argument of type '(x: "bye") => number' is not assignable to parameter of type '(x: "hi") => number'. Types of parameters 'x' and 'x' are incompatible. Type '"hi"' is not assignable to type '"bye"'. @@ -21,7 +21,7 @@ tests/cases/compiler/overloadOnConstNoAnyImplementation2.ts(21,9): error TS2345: callback(hm); callback(1); // error ~ -!!! error TS2345: Argument of type 'number' is not assignable to parameter of type 'string'. +!!! error TS2345: Argument of type '1' is not assignable to parameter of type 'string'. } } diff --git a/tests/baselines/reference/overloadOnConstNoStringImplementation.types b/tests/baselines/reference/overloadOnConstNoStringImplementation.types index 9161620841f..0fdbc97e380 100644 --- a/tests/baselines/reference/overloadOnConstNoStringImplementation.types +++ b/tests/baselines/reference/overloadOnConstNoStringImplementation.types @@ -20,16 +20,16 @@ function x2(a: number, cb: (x: any) => number) { cb('hi'); >cb('hi') : number >cb : (x: any) => number ->'hi' : string +>'hi' : "hi" cb('bye'); >cb('bye') : number >cb : (x: any) => number ->'bye' : string +>'bye' : "bye" var hm = 'hm'; >hm : string ->'hm' : string +>'hm' : "hm" cb(hm); // should this work without a string definition? >cb(hm) : number @@ -39,12 +39,12 @@ function x2(a: number, cb: (x: any) => number) { cb('uh'); >cb('uh') : number >cb : (x: any) => number ->'uh' : string +>'uh' : "uh" cb(1); >cb(1) : number >cb : (x: any) => number ->1 : number +>1 : 1 } var cb: (number) => number = (x: number) => 1; @@ -52,27 +52,27 @@ var cb: (number) => number = (x: number) => 1; >number : any >(x: number) => 1 : (x: number) => number >x : number ->1 : number +>1 : 1 x2(1, cb); // error >x2(1, cb) : any >x2 : { (a: number, cb: (x: "hi") => number): any; (a: number, cb: (x: "bye") => number): any; } ->1 : number +>1 : 1 >cb : (number: any) => number x2(1, (x: 'hi') => 1); // error >x2(1, (x: 'hi') => 1) : any >x2 : { (a: number, cb: (x: "hi") => number): any; (a: number, cb: (x: "bye") => number): any; } ->1 : number +>1 : 1 >(x: 'hi') => 1 : (x: "hi") => number >x : "hi" ->1 : number +>1 : 1 x2(1, (x: string) => 1); >x2(1, (x: string) => 1) : any >x2 : { (a: number, cb: (x: "hi") => number): any; (a: number, cb: (x: "bye") => number): any; } ->1 : number +>1 : 1 >(x: string) => 1 : (x: string) => number >x : string ->1 : number +>1 : 1 diff --git a/tests/baselines/reference/overloadResolution.errors.txt b/tests/baselines/reference/overloadResolution.errors.txt index e0a65f7475e..b8b2cdfe888 100644 --- a/tests/baselines/reference/overloadResolution.errors.txt +++ b/tests/baselines/reference/overloadResolution.errors.txt @@ -1,11 +1,11 @@ tests/cases/conformance/expressions/functionCalls/overloadResolution.ts(27,5): error TS2345: Argument of type '{}' is not assignable to parameter of type 'number'. -tests/cases/conformance/expressions/functionCalls/overloadResolution.ts(41,11): error TS2345: Argument of type 'string' is not assignable to parameter of type 'number'. +tests/cases/conformance/expressions/functionCalls/overloadResolution.ts(41,11): error TS2345: Argument of type '""' is not assignable to parameter of type 'number'. tests/cases/conformance/expressions/functionCalls/overloadResolution.ts(63,1): error TS2346: Supplied parameters do not match any signature of call target. -tests/cases/conformance/expressions/functionCalls/overloadResolution.ts(70,21): error TS2345: Argument of type 'number' is not assignable to parameter of type 'string'. -tests/cases/conformance/expressions/functionCalls/overloadResolution.ts(71,21): error TS2345: Argument of type 'string' is not assignable to parameter of type 'number'. +tests/cases/conformance/expressions/functionCalls/overloadResolution.ts(70,21): error TS2345: Argument of type '3' is not assignable to parameter of type 'string'. +tests/cases/conformance/expressions/functionCalls/overloadResolution.ts(71,21): error TS2345: Argument of type '""' is not assignable to parameter of type 'number'. tests/cases/conformance/expressions/functionCalls/overloadResolution.ts(81,5): error TS2344: Type 'boolean' does not satisfy the constraint 'number'. -tests/cases/conformance/expressions/functionCalls/overloadResolution.ts(84,5): error TS2345: Argument of type 'boolean' is not assignable to parameter of type 'number'. -tests/cases/conformance/expressions/functionCalls/overloadResolution.ts(85,11): error TS2345: Argument of type 'boolean' is not assignable to parameter of type 'string'. +tests/cases/conformance/expressions/functionCalls/overloadResolution.ts(84,5): error TS2345: Argument of type 'true' is not assignable to parameter of type 'number'. +tests/cases/conformance/expressions/functionCalls/overloadResolution.ts(85,11): error TS2345: Argument of type 'true' is not assignable to parameter of type 'string'. tests/cases/conformance/expressions/functionCalls/overloadResolution.ts(91,5): error TS2403: Subsequent variable declarations must have the same type. Variable 'n' must be of type 'number', but here has type 'string'. tests/cases/conformance/expressions/functionCalls/overloadResolution.ts(91,22): error TS2339: Property 'toFixed' does not exist on type 'string'. @@ -55,7 +55,7 @@ tests/cases/conformance/expressions/functionCalls/overloadResolution.ts(91,22): // Generic and non - generic overload where non - generic overload is the only candidate when called with type arguments fn2('', 0); // Error ~~ -!!! error TS2345: Argument of type 'string' is not assignable to parameter of type 'number'. +!!! error TS2345: Argument of type '""' is not assignable to parameter of type 'number'. // Generic and non - generic overload where non - generic overload is the only candidate when called without type arguments fn2('', 0); // OK @@ -88,10 +88,10 @@ tests/cases/conformance/expressions/functionCalls/overloadResolution.ts(91,22): fn4('', 3); fn4(3, ''); // Error ~ -!!! error TS2345: Argument of type 'number' is not assignable to parameter of type 'string'. +!!! error TS2345: Argument of type '3' is not assignable to parameter of type 'string'. fn4('', 3); // Error ~~ -!!! error TS2345: Argument of type 'string' is not assignable to parameter of type 'number'. +!!! error TS2345: Argument of type '""' is not assignable to parameter of type 'number'. fn4(3, ''); // Generic overloads with constraints called without type arguments but with types that satisfy the constraints @@ -108,10 +108,10 @@ tests/cases/conformance/expressions/functionCalls/overloadResolution.ts(91,22): // Generic overloads with constraints called without type arguments but with types that do not satisfy the constraints fn4(true, null); // Error ~~~~ -!!! error TS2345: Argument of type 'boolean' is not assignable to parameter of type 'number'. +!!! error TS2345: Argument of type 'true' is not assignable to parameter of type 'number'. fn4(null, true); // Error ~~~~ -!!! error TS2345: Argument of type 'boolean' is not assignable to parameter of type 'string'. +!!! error TS2345: Argument of type 'true' is not assignable to parameter of type 'string'. // Non - generic overloads where contextual typing of function arguments has errors function fn5(f: (n: string) => void): string; diff --git a/tests/baselines/reference/overloadResolutionClassConstructors.errors.txt b/tests/baselines/reference/overloadResolutionClassConstructors.errors.txt index c6737c3d792..4c8e9b2513a 100644 --- a/tests/baselines/reference/overloadResolutionClassConstructors.errors.txt +++ b/tests/baselines/reference/overloadResolutionClassConstructors.errors.txt @@ -2,14 +2,14 @@ tests/cases/conformance/expressions/functionCalls/overloadResolutionClassConstru tests/cases/conformance/expressions/functionCalls/overloadResolutionClassConstructors.ts(60,1): error TS2346: Supplied parameters do not match any signature of call target. tests/cases/conformance/expressions/functionCalls/overloadResolutionClassConstructors.ts(61,1): error TS2346: Supplied parameters do not match any signature of call target. tests/cases/conformance/expressions/functionCalls/overloadResolutionClassConstructors.ts(65,1): error TS2346: Supplied parameters do not match any signature of call target. -tests/cases/conformance/expressions/functionCalls/overloadResolutionClassConstructors.ts(73,25): error TS2345: Argument of type 'number' is not assignable to parameter of type 'string'. +tests/cases/conformance/expressions/functionCalls/overloadResolutionClassConstructors.ts(73,25): error TS2345: Argument of type '3' is not assignable to parameter of type 'string'. tests/cases/conformance/expressions/functionCalls/overloadResolutionClassConstructors.ts(74,9): error TS2344: Type 'number' does not satisfy the constraint 'string'. tests/cases/conformance/expressions/functionCalls/overloadResolutionClassConstructors.ts(75,9): error TS2344: Type 'number' does not satisfy the constraint 'string'. -tests/cases/conformance/expressions/functionCalls/overloadResolutionClassConstructors.ts(79,9): error TS2345: Argument of type 'number' is not assignable to parameter of type 'string'. -tests/cases/conformance/expressions/functionCalls/overloadResolutionClassConstructors.ts(80,9): error TS2345: Argument of type 'number' is not assignable to parameter of type 'string'. +tests/cases/conformance/expressions/functionCalls/overloadResolutionClassConstructors.ts(79,9): error TS2345: Argument of type '3' is not assignable to parameter of type 'string'. +tests/cases/conformance/expressions/functionCalls/overloadResolutionClassConstructors.ts(80,9): error TS2345: Argument of type '3' is not assignable to parameter of type 'string'. tests/cases/conformance/expressions/functionCalls/overloadResolutionClassConstructors.ts(84,9): error TS2344: Type 'boolean' does not satisfy the constraint 'string'. -tests/cases/conformance/expressions/functionCalls/overloadResolutionClassConstructors.ts(87,9): error TS2345: Argument of type 'boolean' is not assignable to parameter of type 'string'. -tests/cases/conformance/expressions/functionCalls/overloadResolutionClassConstructors.ts(88,15): error TS2345: Argument of type 'boolean' is not assignable to parameter of type 'number'. +tests/cases/conformance/expressions/functionCalls/overloadResolutionClassConstructors.ts(87,9): error TS2345: Argument of type 'true' is not assignable to parameter of type 'string'. +tests/cases/conformance/expressions/functionCalls/overloadResolutionClassConstructors.ts(88,15): error TS2345: Argument of type 'true' is not assignable to parameter of type 'number'. tests/cases/conformance/expressions/functionCalls/overloadResolutionClassConstructors.ts(96,18): error TS2339: Property 'toFixed' does not exist on type 'string'. tests/cases/conformance/expressions/functionCalls/overloadResolutionClassConstructors.ts(98,18): error TS2339: Property 'blah' does not exist on type 'string'. @@ -97,7 +97,7 @@ tests/cases/conformance/expressions/functionCalls/overloadResolutionClassConstru new fn4('', 3); new fn4(3, ''); // Error ~ -!!! error TS2345: Argument of type 'number' is not assignable to parameter of type 'string'. +!!! error TS2345: Argument of type '3' is not assignable to parameter of type 'string'. new fn4('', 3); // Error ~~~~~~ !!! error TS2344: Type 'number' does not satisfy the constraint 'string'. @@ -109,10 +109,10 @@ tests/cases/conformance/expressions/functionCalls/overloadResolutionClassConstru new fn4('', 3); new fn4(3, ''); // Error ~ -!!! error TS2345: Argument of type 'number' is not assignable to parameter of type 'string'. +!!! error TS2345: Argument of type '3' is not assignable to parameter of type 'string'. new fn4(3, undefined); // Error ~ -!!! error TS2345: Argument of type 'number' is not assignable to parameter of type 'string'. +!!! error TS2345: Argument of type '3' is not assignable to parameter of type 'string'. new fn4('', null); // Generic overloads with constraints called with type arguments that do not satisfy the constraints @@ -123,10 +123,10 @@ tests/cases/conformance/expressions/functionCalls/overloadResolutionClassConstru // Generic overloads with constraints called without type arguments but with types that do not satisfy the constraints new fn4(true, null); // Error ~~~~ -!!! error TS2345: Argument of type 'boolean' is not assignable to parameter of type 'string'. +!!! error TS2345: Argument of type 'true' is not assignable to parameter of type 'string'. new fn4(null, true); // Error ~~~~ -!!! error TS2345: Argument of type 'boolean' is not assignable to parameter of type 'number'. +!!! error TS2345: Argument of type 'true' is not assignable to parameter of type 'number'. // Non - generic overloads where contextual typing of function arguments has errors class fn5 { diff --git a/tests/baselines/reference/overloadResolutionConstructors.errors.txt b/tests/baselines/reference/overloadResolutionConstructors.errors.txt index 540e12774c7..9a112eaf2ef 100644 --- a/tests/baselines/reference/overloadResolutionConstructors.errors.txt +++ b/tests/baselines/reference/overloadResolutionConstructors.errors.txt @@ -1,11 +1,11 @@ tests/cases/conformance/expressions/functionCalls/overloadResolutionConstructors.ts(27,9): error TS2345: Argument of type '{}' is not assignable to parameter of type 'number'. -tests/cases/conformance/expressions/functionCalls/overloadResolutionConstructors.ts(43,15): error TS2345: Argument of type 'string' is not assignable to parameter of type 'number'. +tests/cases/conformance/expressions/functionCalls/overloadResolutionConstructors.ts(43,15): error TS2345: Argument of type '""' is not assignable to parameter of type 'number'. tests/cases/conformance/expressions/functionCalls/overloadResolutionConstructors.ts(67,1): error TS2346: Supplied parameters do not match any signature of call target. -tests/cases/conformance/expressions/functionCalls/overloadResolutionConstructors.ts(77,25): error TS2345: Argument of type 'number' is not assignable to parameter of type 'string'. -tests/cases/conformance/expressions/functionCalls/overloadResolutionConstructors.ts(78,25): error TS2345: Argument of type 'string' is not assignable to parameter of type 'number'. +tests/cases/conformance/expressions/functionCalls/overloadResolutionConstructors.ts(77,25): error TS2345: Argument of type '3' is not assignable to parameter of type 'string'. +tests/cases/conformance/expressions/functionCalls/overloadResolutionConstructors.ts(78,25): error TS2345: Argument of type '""' is not assignable to parameter of type 'number'. tests/cases/conformance/expressions/functionCalls/overloadResolutionConstructors.ts(88,9): error TS2344: Type 'boolean' does not satisfy the constraint 'number'. -tests/cases/conformance/expressions/functionCalls/overloadResolutionConstructors.ts(91,9): error TS2345: Argument of type 'boolean' is not assignable to parameter of type 'number'. -tests/cases/conformance/expressions/functionCalls/overloadResolutionConstructors.ts(92,15): error TS2345: Argument of type 'boolean' is not assignable to parameter of type 'string'. +tests/cases/conformance/expressions/functionCalls/overloadResolutionConstructors.ts(91,9): error TS2345: Argument of type 'true' is not assignable to parameter of type 'number'. +tests/cases/conformance/expressions/functionCalls/overloadResolutionConstructors.ts(92,15): error TS2345: Argument of type 'true' is not assignable to parameter of type 'string'. tests/cases/conformance/expressions/functionCalls/overloadResolutionConstructors.ts(100,5): error TS2403: Subsequent variable declarations must have the same type. Variable 'n' must be of type 'number', but here has type 'string'. tests/cases/conformance/expressions/functionCalls/overloadResolutionConstructors.ts(100,26): error TS2339: Property 'toFixed' does not exist on type 'string'. @@ -57,7 +57,7 @@ tests/cases/conformance/expressions/functionCalls/overloadResolutionConstructors // Generic and non - generic overload where non - generic overload is the only candidate when called with type arguments new fn2('', 0); // Error ~~ -!!! error TS2345: Argument of type 'string' is not assignable to parameter of type 'number'. +!!! error TS2345: Argument of type '""' is not assignable to parameter of type 'number'. // Generic and non - generic overload where non - generic overload is the only candidate when called without type arguments new fn2('', 0); // OK @@ -95,10 +95,10 @@ tests/cases/conformance/expressions/functionCalls/overloadResolutionConstructors new fn4('', 3); new fn4(3, ''); // Error ~ -!!! error TS2345: Argument of type 'number' is not assignable to parameter of type 'string'. +!!! error TS2345: Argument of type '3' is not assignable to parameter of type 'string'. new fn4('', 3); // Error ~~ -!!! error TS2345: Argument of type 'string' is not assignable to parameter of type 'number'. +!!! error TS2345: Argument of type '""' is not assignable to parameter of type 'number'. new fn4(3, ''); // Generic overloads with constraints called without type arguments but with types that satisfy the constraints @@ -115,10 +115,10 @@ tests/cases/conformance/expressions/functionCalls/overloadResolutionConstructors // Generic overloads with constraints called without type arguments but with types that do not satisfy the constraints new fn4(true, null); // Error ~~~~ -!!! error TS2345: Argument of type 'boolean' is not assignable to parameter of type 'number'. +!!! error TS2345: Argument of type 'true' is not assignable to parameter of type 'number'. new fn4(null, true); // Error ~~~~ -!!! error TS2345: Argument of type 'boolean' is not assignable to parameter of type 'string'. +!!! error TS2345: Argument of type 'true' is not assignable to parameter of type 'string'. // Non - generic overloads where contextual typing of function arguments has errors interface fn5 { diff --git a/tests/baselines/reference/overloadResolutionOverNonCTLambdas.types b/tests/baselines/reference/overloadResolutionOverNonCTLambdas.types index 4cf7b0b086f..ee5c336ba9c 100644 --- a/tests/baselines/reference/overloadResolutionOverNonCTLambdas.types +++ b/tests/baselines/reference/overloadResolutionOverNonCTLambdas.types @@ -27,7 +27,7 @@ module Bugs { >index : any >rest[0] : any >rest : any[] ->0 : number +>0 : 0 return typeof args[index] !== 'undefined' >typeof args[index] !== 'undefined' ? args[index] : match : any @@ -58,7 +58,7 @@ function bug3(f:(x:string)=>string) { return f("s") } >x : string >f("s") : string >f : (x: string) => string ->"s" : string +>"s" : "s" function fprime(x:string):string { return x; } >fprime : (x: string) => string diff --git a/tests/baselines/reference/overloadResolutionOverNonCTObjectLit.types b/tests/baselines/reference/overloadResolutionOverNonCTObjectLit.types index e6ff0cda468..d5a06781eec 100644 --- a/tests/baselines/reference/overloadResolutionOverNonCTObjectLit.types +++ b/tests/baselines/reference/overloadResolutionOverNonCTObjectLit.types @@ -46,11 +46,11 @@ module Bugs { >push : (...items: IToken[]) => number >{ startIndex: 1, type: '', bracket: 3 } : { startIndex: number; type: string; bracket: number; } >startIndex : number ->1 : number +>1 : 1 >type : string ->'' : string +>'' : "" >bracket : number ->3 : number +>3 : 3 tokens.push(({ startIndex: 1, type: '', bracket: 3, state: null, length: 10 })); >tokens.push(({ startIndex: 1, type: '', bracket: 3, state: null, length: 10 })) : number @@ -62,14 +62,14 @@ module Bugs { >({ startIndex: 1, type: '', bracket: 3, state: null, length: 10 }) : { startIndex: number; type: string; bracket: number; state: null; length: number; } >{ startIndex: 1, type: '', bracket: 3, state: null, length: 10 } : { startIndex: number; type: string; bracket: number; state: null; length: number; } >startIndex : number ->1 : number +>1 : 1 >type : string ->'' : string +>'' : "" >bracket : number ->3 : number +>3 : 3 >state : null >null : null >length : number ->10 : number +>10 : 10 } } diff --git a/tests/baselines/reference/overloadResolutionTest1.errors.txt b/tests/baselines/reference/overloadResolutionTest1.errors.txt index 9f51c0fa10b..1bb1fb2041a 100644 --- a/tests/baselines/reference/overloadResolutionTest1.errors.txt +++ b/tests/baselines/reference/overloadResolutionTest1.errors.txt @@ -1,10 +1,10 @@ -tests/cases/compiler/overloadResolutionTest1.ts(8,16): error TS2345: Argument of type '{ a: string; }[]' is not assignable to parameter of type '{ a: boolean; }[]'. - Type '{ a: string; }' is not assignable to type '{ a: boolean; }'. +tests/cases/compiler/overloadResolutionTest1.ts(8,16): error TS2345: Argument of type '{ a: "s"; }[]' is not assignable to parameter of type '{ a: boolean; }[]'. + Type '{ a: "s"; }' is not assignable to type '{ a: boolean; }'. Types of property 'a' are incompatible. - Type 'string' is not assignable to type 'boolean'. -tests/cases/compiler/overloadResolutionTest1.ts(19,15): error TS2345: Argument of type '{ a: string; }' is not assignable to parameter of type '{ a: boolean; }'. + Type '"s"' is not assignable to type 'boolean'. +tests/cases/compiler/overloadResolutionTest1.ts(19,15): error TS2345: Argument of type '{ a: "s"; }' is not assignable to parameter of type '{ a: boolean; }'. Types of property 'a' are incompatible. - Type 'string' is not assignable to type 'boolean'. + Type '"s"' is not assignable to type 'boolean'. tests/cases/compiler/overloadResolutionTest1.ts(25,14): error TS2345: Argument of type '{ a: boolean; }' is not assignable to parameter of type '{ a: string; }'. Types of property 'a' are incompatible. Type 'boolean' is not assignable to type 'string'. @@ -20,10 +20,10 @@ tests/cases/compiler/overloadResolutionTest1.ts(25,14): error TS2345: Argument o var x11 = foo([{a:0}]); // works var x111 = foo([{a:"s"}]); // error - does not match any signature ~~~~~~~~~ -!!! error TS2345: Argument of type '{ a: string; }[]' is not assignable to parameter of type '{ a: boolean; }[]'. -!!! error TS2345: Type '{ a: string; }' is not assignable to type '{ a: boolean; }'. +!!! error TS2345: Argument of type '{ a: "s"; }[]' is not assignable to parameter of type '{ a: boolean; }[]'. +!!! error TS2345: Type '{ a: "s"; }' is not assignable to type '{ a: boolean; }'. !!! error TS2345: Types of property 'a' are incompatible. -!!! error TS2345: Type 'string' is not assignable to type 'boolean'. +!!! error TS2345: Type '"s"' is not assignable to type 'boolean'. var x1111 = foo([{a:null}]); // works - ambiguous call is resolved to be the first in the overload set so this returns a string @@ -36,9 +36,9 @@ tests/cases/compiler/overloadResolutionTest1.ts(25,14): error TS2345: Argument o var x3 = foo2({a:true}); // works var x4 = foo2({a:"s"}); // error ~~~~~~~ -!!! error TS2345: Argument of type '{ a: string; }' is not assignable to parameter of type '{ a: boolean; }'. +!!! error TS2345: Argument of type '{ a: "s"; }' is not assignable to parameter of type '{ a: boolean; }'. !!! error TS2345: Types of property 'a' are incompatible. -!!! error TS2345: Type 'string' is not assignable to type 'boolean'. +!!! error TS2345: Type '"s"' is not assignable to type 'boolean'. function foo4(bar:{a:number;}):number; diff --git a/tests/baselines/reference/overloadResolutionWithAny.types b/tests/baselines/reference/overloadResolutionWithAny.types index e66368d3554..362c70f6162 100644 --- a/tests/baselines/reference/overloadResolutionWithAny.types +++ b/tests/baselines/reference/overloadResolutionWithAny.types @@ -13,12 +13,12 @@ var func: { func(""); // number >func("") : number >func : { (s: string): number; (s: any): string; } ->"" : string +>"" : "" func(3); // string >func(3) : string >func : { (s: string): number; (s: any): string; } ->3 : number +>3 : 3 var x: any; >x : any @@ -58,18 +58,18 @@ func2(x, x); // string func2("", ""); // number >func2("", "") : number >func2 : { (s: string, t: string): number; (s: any, t: string): boolean; (s: string, t: any): RegExp; (s: any, t: any): string; } ->"" : string ->"" : string +>"" : "" +>"" : "" func2(x, ""); // boolean >func2(x, "") : boolean >func2 : { (s: string, t: string): number; (s: any, t: string): boolean; (s: string, t: any): RegExp; (s: any, t: any): string; } >x : any ->"" : string +>"" : "" func2("", x); // RegExp >func2("", x) : RegExp >func2 : { (s: string, t: string): number; (s: any, t: string): boolean; (s: string, t: any): RegExp; (s: any, t: any): string; } ->"" : string +>"" : "" >x : any diff --git a/tests/baselines/reference/overloadReturnTypes.types b/tests/baselines/reference/overloadReturnTypes.types index e8d1b7905dc..c0f573fb980 100644 --- a/tests/baselines/reference/overloadReturnTypes.types +++ b/tests/baselines/reference/overloadReturnTypes.types @@ -38,7 +38,7 @@ function attr(nameOrMap: any, value?: string): any { else { // handle string case return "s"; ->"s" : string +>"s" : "s" } } diff --git a/tests/baselines/reference/overloadWithCallbacksWithDifferingOptionalityOnArgs.types b/tests/baselines/reference/overloadWithCallbacksWithDifferingOptionalityOnArgs.types index b9ea7d98270..9b44e197cd8 100644 --- a/tests/baselines/reference/overloadWithCallbacksWithDifferingOptionalityOnArgs.types +++ b/tests/baselines/reference/overloadWithCallbacksWithDifferingOptionalityOnArgs.types @@ -18,12 +18,12 @@ x2(() => 1); >x2(() => 1) : any >x2 : { (callback: (x?: number) => number): any; (callback: (x: string) => number): any; } >() => 1 : () => number ->1 : number +>1 : 1 x2((x) => 1 ); >x2((x) => 1 ) : any >x2 : { (callback: (x?: number) => number): any; (callback: (x: string) => number): any; } >(x) => 1 : (x: number) => number >x : number ->1 : number +>1 : 1 diff --git a/tests/baselines/reference/overloadsAndTypeArgumentArity.types b/tests/baselines/reference/overloadsAndTypeArgumentArity.types index b69f394e83d..bd86c19beb9 100644 --- a/tests/baselines/reference/overloadsAndTypeArgumentArity.types +++ b/tests/baselines/reference/overloadsAndTypeArgumentArity.types @@ -24,10 +24,10 @@ declare function Callbacks(flags?: string): void; Callbacks('s'); // no error >Callbacks('s') : void >Callbacks : { (flags?: string): void; (flags?: string): void; (flags?: string): void; (flags?: string): void; } ->'s' : string +>'s' : "s" new Callbacks('s'); // no error >new Callbacks('s') : any >Callbacks : { (flags?: string): void; (flags?: string): void; (flags?: string): void; (flags?: string): void; } ->'s' : string +>'s' : "s" diff --git a/tests/baselines/reference/overloadsWithConstraints.types b/tests/baselines/reference/overloadsWithConstraints.types index b045904ece5..87974482f43 100644 --- a/tests/baselines/reference/overloadsWithConstraints.types +++ b/tests/baselines/reference/overloadsWithConstraints.types @@ -19,5 +19,5 @@ var v = f(""); >v : string >f("") : string >f : { (x: T): T; (x: T): T; } ->"" : string +>"" : "" diff --git a/tests/baselines/reference/parenthesizedContexualTyping1.errors.txt b/tests/baselines/reference/parenthesizedContexualTyping1.errors.txt new file mode 100644 index 00000000000..c77d571f270 --- /dev/null +++ b/tests/baselines/reference/parenthesizedContexualTyping1.errors.txt @@ -0,0 +1,44 @@ +tests/cases/conformance/expressions/contextualTyping/parenthesizedContexualTyping1.ts(28,32): error TS2695: Left side of comma operator is unused and has no side effects. +tests/cases/conformance/expressions/contextualTyping/parenthesizedContexualTyping1.ts(28,56): error TS2695: Left side of comma operator is unused and has no side effects. +tests/cases/conformance/expressions/contextualTyping/parenthesizedContexualTyping1.ts(29,33): error TS2695: Left side of comma operator is unused and has no side effects. +tests/cases/conformance/expressions/contextualTyping/parenthesizedContexualTyping1.ts(29,57): error TS2695: Left side of comma operator is unused and has no side effects. + + +==== tests/cases/conformance/expressions/contextualTyping/parenthesizedContexualTyping1.ts (4 errors) ==== + + function fun(g: (x: T) => T, x: T): T; + function fun(g: (x: T) => T, h: (y: T) => T, x: T): T; + function fun(g: (x: T) => T, x: T): T { + return g(x); + } + + var a = fun(x => x, 10); + var b = fun((x => x), 10); + var c = fun(((x => x)), 10); + var d = fun((((x => x))), 10); + + var e = fun(x => x, x => x, 10); + var f = fun((x => x), (x => x), 10); + var g = fun(((x => x)), ((x => x)), 10); + var h = fun((((x => x))), ((x => x)), 10); + + // Ternaries in parens + var i = fun((Math.random() < 0.5 ? x => x : x => undefined), 10); + var j = fun((Math.random() < 0.5 ? (x => x) : (x => undefined)), 10); + var k = fun((Math.random() < 0.5 ? (x => x) : (x => undefined)), x => x, 10); + var l = fun(((Math.random() < 0.5 ? ((x => x)) : ((x => undefined)))), ((x => x)), 10); + + var lambda1: (x: number) => number = x => x; + var lambda2: (x: number) => number = (x => x); + + type ObjType = { x: (p: number) => string; y: (p: string) => number }; + var obj1: ObjType = { x: x => (x, undefined), y: y => (y, undefined) }; + ~ +!!! error TS2695: Left side of comma operator is unused and has no side effects. + ~ +!!! error TS2695: Left side of comma operator is unused and has no side effects. + var obj2: ObjType = ({ x: x => (x, undefined), y: y => (y, undefined) }); + ~ +!!! error TS2695: Left side of comma operator is unused and has no side effects. + ~ +!!! error TS2695: Left side of comma operator is unused and has no side effects. \ No newline at end of file diff --git a/tests/baselines/reference/parenthesizedContexualTyping1.types b/tests/baselines/reference/parenthesizedContexualTyping1.types index 61ec1a24ec5..387e80d349f 100644 --- a/tests/baselines/reference/parenthesizedContexualTyping1.types +++ b/tests/baselines/reference/parenthesizedContexualTyping1.types @@ -50,7 +50,7 @@ var a = fun(x => x, 10); >x => x : (x: number) => number >x : number >x : number ->10 : number +>10 : 10 var b = fun((x => x), 10); >b : number @@ -60,7 +60,7 @@ var b = fun((x => x), 10); >x => x : (x: number) => number >x : number >x : number ->10 : number +>10 : 10 var c = fun(((x => x)), 10); >c : number @@ -71,7 +71,7 @@ var c = fun(((x => x)), 10); >x => x : (x: number) => number >x : number >x : number ->10 : number +>10 : 10 var d = fun((((x => x))), 10); >d : number @@ -83,7 +83,7 @@ var d = fun((((x => x))), 10); >x => x : (x: number) => number >x : number >x : number ->10 : number +>10 : 10 var e = fun(x => x, x => x, 10); >e : number @@ -95,7 +95,7 @@ var e = fun(x => x, x => x, 10); >x => x : (x: number) => number >x : number >x : number ->10 : number +>10 : 10 var f = fun((x => x), (x => x), 10); >f : number @@ -109,7 +109,7 @@ var f = fun((x => x), (x => x), 10); >x => x : (x: number) => number >x : number >x : number ->10 : number +>10 : 10 var g = fun(((x => x)), ((x => x)), 10); >g : number @@ -125,7 +125,7 @@ var g = fun(((x => x)), ((x => x)), 10); >x => x : (x: number) => number >x : number >x : number ->10 : number +>10 : 10 var h = fun((((x => x))), ((x => x)), 10); >h : number @@ -142,7 +142,7 @@ var h = fun((((x => x))), ((x => x)), 10); >x => x : (x: number) => number >x : number >x : number ->10 : number +>10 : 10 // Ternaries in parens var i = fun((Math.random() < 0.5 ? x => x : x => undefined), 10); @@ -156,14 +156,14 @@ var i = fun((Math.random() < 0.5 ? x => x : x => undefined), 10); >Math.random : () => number >Math : Math >random : () => number ->0.5 : number +>0.5 : 0.5 >x => x : (x: number) => number >x : number >x : number >x => undefined : (x: number) => any >x : number >undefined : undefined ->10 : number +>10 : 10 var j = fun((Math.random() < 0.5 ? (x => x) : (x => undefined)), 10); >j : number @@ -176,7 +176,7 @@ var j = fun((Math.random() < 0.5 ? (x => x) : (x => undefined)), 10); >Math.random : () => number >Math : Math >random : () => number ->0.5 : number +>0.5 : 0.5 >(x => x) : (x: number) => number >x => x : (x: number) => number >x : number @@ -185,7 +185,7 @@ var j = fun((Math.random() < 0.5 ? (x => x) : (x => undefined)), 10); >x => undefined : (x: number) => any >x : number >undefined : undefined ->10 : number +>10 : 10 var k = fun((Math.random() < 0.5 ? (x => x) : (x => undefined)), x => x, 10); >k : number @@ -198,7 +198,7 @@ var k = fun((Math.random() < 0.5 ? (x => x) : (x => undefined)), x => x, 10); >Math.random : () => number >Math : Math >random : () => number ->0.5 : number +>0.5 : 0.5 >(x => x) : (x: number) => number >x => x : (x: number) => number >x : number @@ -210,7 +210,7 @@ var k = fun((Math.random() < 0.5 ? (x => x) : (x => undefined)), x => x, 10); >x => x : (x: number) => number >x : number >x : number ->10 : number +>10 : 10 var l = fun(((Math.random() < 0.5 ? ((x => x)) : ((x => undefined)))), ((x => x)), 10); >l : number @@ -224,7 +224,7 @@ var l = fun(((Math.random() < 0.5 ? ((x => x)) : ((x => undefined)))), ((x => x) >Math.random : () => number >Math : Math >random : () => number ->0.5 : number +>0.5 : 0.5 >((x => x)) : (x: number) => number >(x => x) : (x: number) => number >x => x : (x: number) => number @@ -240,7 +240,7 @@ var l = fun(((Math.random() < 0.5 ? ((x => x)) : ((x => undefined)))), ((x => x) >x => x : (x: number) => number >x : number >x : number ->10 : number +>10 : 10 var lambda1: (x: number) => number = x => x; >lambda1 : (x: number) => number diff --git a/tests/baselines/reference/parenthesizedContexualTyping2.errors.txt b/tests/baselines/reference/parenthesizedContexualTyping2.errors.txt new file mode 100644 index 00000000000..e97a61cf532 --- /dev/null +++ b/tests/baselines/reference/parenthesizedContexualTyping2.errors.txt @@ -0,0 +1,51 @@ +tests/cases/conformance/expressions/contextualTyping/parenthesizedContexualTyping2.ts(35,32): error TS2695: Left side of comma operator is unused and has no side effects. +tests/cases/conformance/expressions/contextualTyping/parenthesizedContexualTyping2.ts(35,56): error TS2695: Left side of comma operator is unused and has no side effects. +tests/cases/conformance/expressions/contextualTyping/parenthesizedContexualTyping2.ts(36,33): error TS2695: Left side of comma operator is unused and has no side effects. +tests/cases/conformance/expressions/contextualTyping/parenthesizedContexualTyping2.ts(36,57): error TS2695: Left side of comma operator is unused and has no side effects. + + +==== tests/cases/conformance/expressions/contextualTyping/parenthesizedContexualTyping2.ts (4 errors) ==== + // These tests ensure that in cases where it may *appear* that a value has a type, + // they actually are properly being contextually typed. The way we test this is + // that we invoke contextually typed arguments with type arguments. + // Since 'any' cannot be invoked with type arguments, we should get errors + // back if contextual typing is not taking effect. + + type FuncType = (x: (p: T) => T) => typeof x; + + function fun(f: FuncType, x: T): T; + function fun(f: FuncType, g: FuncType, x: T): T; + function fun(...rest: any[]): T { + return undefined; + } + + var a = fun(x => { x(undefined); return x; }, 10); + var b = fun((x => { x(undefined); return x; }), 10); + var c = fun(((x => { x(undefined); return x; })), 10); + var d = fun((((x => { x(undefined); return x; }))), 10); + + var e = fun(x => { x(undefined); return x; }, x => { x(undefined); return x; }, 10); + var f = fun((x => { x(undefined); return x; }),(x => { x(undefined); return x; }), 10); + var g = fun(((x => { x(undefined); return x; })),((x => { x(undefined); return x; })), 10); + var h = fun((((x => { x(undefined); return x; }))),((x => { x(undefined); return x; })), 10); + + // Ternaries in parens + var i = fun((Math.random() < 0.5 ? x => { x(undefined); return x; } : x => undefined), 10); + var j = fun((Math.random() < 0.5 ? (x => { x(undefined); return x; }) : (x => undefined)), 10); + var k = fun((Math.random() < 0.5 ? (x => { x(undefined); return x; }) : (x => undefined)), x => { x(undefined); return x; }, 10); + var l = fun(((Math.random() < 0.5 ? ((x => { x(undefined); return x; })) : ((x => undefined)))),((x => { x(undefined); return x; })), 10); + + var lambda1: FuncType = x => { x(undefined); return x; }; + var lambda2: FuncType = (x => { x(undefined); return x; }); + + type ObjType = { x: (p: number) => string; y: (p: string) => number }; + var obj1: ObjType = { x: x => (x, undefined), y: y => (y, undefined) }; + ~ +!!! error TS2695: Left side of comma operator is unused and has no side effects. + ~ +!!! error TS2695: Left side of comma operator is unused and has no side effects. + var obj2: ObjType = ({ x: x => (x, undefined), y: y => (y, undefined) }); + ~ +!!! error TS2695: Left side of comma operator is unused and has no side effects. + ~ +!!! error TS2695: Left side of comma operator is unused and has no side effects. \ No newline at end of file diff --git a/tests/baselines/reference/parenthesizedContexualTyping2.types b/tests/baselines/reference/parenthesizedContexualTyping2.types index aa6e1916f81..7944f6f43de 100644 --- a/tests/baselines/reference/parenthesizedContexualTyping2.types +++ b/tests/baselines/reference/parenthesizedContexualTyping2.types @@ -46,7 +46,7 @@ function fun(...rest: any[]): T { var a = fun(x => { x(undefined); return x; }, 10); >a : number ->fun(x => { x(undefined); return x; }, 10) : number +>fun(x => { x(undefined); return x; }, 10) : 10 >fun : { (f: FuncType, x: T): T; (f: FuncType, g: FuncType, x: T): T; } >x => { x(undefined); return x; } : (x: (p: T) => T) => (p: T) => T >x : (p: T) => T @@ -54,11 +54,11 @@ var a = fun(x => { x(undefined); return x; }, 10); >x : (p: T) => T >undefined : undefined >x : (p: T) => T ->10 : number +>10 : 10 var b = fun((x => { x(undefined); return x; }), 10); >b : number ->fun((x => { x(undefined); return x; }), 10) : number +>fun((x => { x(undefined); return x; }), 10) : 10 >fun : { (f: FuncType, x: T): T; (f: FuncType, g: FuncType, x: T): T; } >(x => { x(undefined); return x; }) : (x: (p: T) => T) => (p: T) => T >x => { x(undefined); return x; } : (x: (p: T) => T) => (p: T) => T @@ -67,11 +67,11 @@ var b = fun((x => { x(undefined); return x; }), 10); >x : (p: T) => T >undefined : undefined >x : (p: T) => T ->10 : number +>10 : 10 var c = fun(((x => { x(undefined); return x; })), 10); >c : number ->fun(((x => { x(undefined); return x; })), 10) : number +>fun(((x => { x(undefined); return x; })), 10) : 10 >fun : { (f: FuncType, x: T): T; (f: FuncType, g: FuncType, x: T): T; } >((x => { x(undefined); return x; })) : (x: (p: T) => T) => (p: T) => T >(x => { x(undefined); return x; }) : (x: (p: T) => T) => (p: T) => T @@ -81,11 +81,11 @@ var c = fun(((x => { x(undefined); return x; })), 10); >x : (p: T) => T >undefined : undefined >x : (p: T) => T ->10 : number +>10 : 10 var d = fun((((x => { x(undefined); return x; }))), 10); >d : number ->fun((((x => { x(undefined); return x; }))), 10) : number +>fun((((x => { x(undefined); return x; }))), 10) : 10 >fun : { (f: FuncType, x: T): T; (f: FuncType, g: FuncType, x: T): T; } >(((x => { x(undefined); return x; }))) : (x: (p: T) => T) => (p: T) => T >((x => { x(undefined); return x; })) : (x: (p: T) => T) => (p: T) => T @@ -96,11 +96,11 @@ var d = fun((((x => { x(undefined); return x; }))), 10); >x : (p: T) => T >undefined : undefined >x : (p: T) => T ->10 : number +>10 : 10 var e = fun(x => { x(undefined); return x; }, x => { x(undefined); return x; }, 10); >e : number ->fun(x => { x(undefined); return x; }, x => { x(undefined); return x; }, 10) : number +>fun(x => { x(undefined); return x; }, x => { x(undefined); return x; }, 10) : 10 >fun : { (f: FuncType, x: T): T; (f: FuncType, g: FuncType, x: T): T; } >x => { x(undefined); return x; } : (x: (p: T) => T) => (p: T) => T >x : (p: T) => T @@ -114,11 +114,11 @@ var e = fun(x => { x(undefined); return x; }, x => { x(undefined >x : (p: T) => T >undefined : undefined >x : (p: T) => T ->10 : number +>10 : 10 var f = fun((x => { x(undefined); return x; }),(x => { x(undefined); return x; }), 10); >f : number ->fun((x => { x(undefined); return x; }),(x => { x(undefined); return x; }), 10) : number +>fun((x => { x(undefined); return x; }),(x => { x(undefined); return x; }), 10) : 10 >fun : { (f: FuncType, x: T): T; (f: FuncType, g: FuncType, x: T): T; } >(x => { x(undefined); return x; }) : (x: (p: T) => T) => (p: T) => T >x => { x(undefined); return x; } : (x: (p: T) => T) => (p: T) => T @@ -134,11 +134,11 @@ var f = fun((x => { x(undefined); return x; }),(x => { x(undefin >x : (p: T) => T >undefined : undefined >x : (p: T) => T ->10 : number +>10 : 10 var g = fun(((x => { x(undefined); return x; })),((x => { x(undefined); return x; })), 10); >g : number ->fun(((x => { x(undefined); return x; })),((x => { x(undefined); return x; })), 10) : number +>fun(((x => { x(undefined); return x; })),((x => { x(undefined); return x; })), 10) : 10 >fun : { (f: FuncType, x: T): T; (f: FuncType, g: FuncType, x: T): T; } >((x => { x(undefined); return x; })) : (x: (p: T) => T) => (p: T) => T >(x => { x(undefined); return x; }) : (x: (p: T) => T) => (p: T) => T @@ -156,11 +156,11 @@ var g = fun(((x => { x(undefined); return x; })),((x => { x(unde >x : (p: T) => T >undefined : undefined >x : (p: T) => T ->10 : number +>10 : 10 var h = fun((((x => { x(undefined); return x; }))),((x => { x(undefined); return x; })), 10); >h : number ->fun((((x => { x(undefined); return x; }))),((x => { x(undefined); return x; })), 10) : number +>fun((((x => { x(undefined); return x; }))),((x => { x(undefined); return x; })), 10) : 10 >fun : { (f: FuncType, x: T): T; (f: FuncType, g: FuncType, x: T): T; } >(((x => { x(undefined); return x; }))) : (x: (p: T) => T) => (p: T) => T >((x => { x(undefined); return x; })) : (x: (p: T) => T) => (p: T) => T @@ -179,12 +179,12 @@ var h = fun((((x => { x(undefined); return x; }))),((x => { x(un >x : (p: T) => T >undefined : undefined >x : (p: T) => T ->10 : number +>10 : 10 // Ternaries in parens var i = fun((Math.random() < 0.5 ? x => { x(undefined); return x; } : x => undefined), 10); >i : number ->fun((Math.random() < 0.5 ? x => { x(undefined); return x; } : x => undefined), 10) : number +>fun((Math.random() < 0.5 ? x => { x(undefined); return x; } : x => undefined), 10) : 10 >fun : { (f: FuncType, x: T): T; (f: FuncType, g: FuncType, x: T): T; } >(Math.random() < 0.5 ? x => { x(undefined); return x; } : x => undefined) : (x: (p: T) => T) => any >Math.random() < 0.5 ? x => { x(undefined); return x; } : x => undefined : (x: (p: T) => T) => any @@ -193,7 +193,7 @@ var i = fun((Math.random() < 0.5 ? x => { x(undefined); return x; } : x >Math.random : () => number >Math : Math >random : () => number ->0.5 : number +>0.5 : 0.5 >x => { x(undefined); return x; } : (x: (p: T) => T) => (p: T) => T >x : (p: T) => T >x(undefined) : number @@ -203,11 +203,11 @@ var i = fun((Math.random() < 0.5 ? x => { x(undefined); return x; } : x >x => undefined : (x: (p: T) => T) => any >x : (p: T) => T >undefined : undefined ->10 : number +>10 : 10 var j = fun((Math.random() < 0.5 ? (x => { x(undefined); return x; }) : (x => undefined)), 10); >j : number ->fun((Math.random() < 0.5 ? (x => { x(undefined); return x; }) : (x => undefined)), 10) : number +>fun((Math.random() < 0.5 ? (x => { x(undefined); return x; }) : (x => undefined)), 10) : 10 >fun : { (f: FuncType, x: T): T; (f: FuncType, g: FuncType, x: T): T; } >(Math.random() < 0.5 ? (x => { x(undefined); return x; }) : (x => undefined)) : (x: (p: T) => T) => any >Math.random() < 0.5 ? (x => { x(undefined); return x; }) : (x => undefined) : (x: (p: T) => T) => any @@ -216,7 +216,7 @@ var j = fun((Math.random() < 0.5 ? (x => { x(undefined); return x; }) : >Math.random : () => number >Math : Math >random : () => number ->0.5 : number +>0.5 : 0.5 >(x => { x(undefined); return x; }) : (x: (p: T) => T) => (p: T) => T >x => { x(undefined); return x; } : (x: (p: T) => T) => (p: T) => T >x : (p: T) => T @@ -228,11 +228,11 @@ var j = fun((Math.random() < 0.5 ? (x => { x(undefined); return x; }) : >x => undefined : (x: (p: T) => T) => any >x : (p: T) => T >undefined : undefined ->10 : number +>10 : 10 var k = fun((Math.random() < 0.5 ? (x => { x(undefined); return x; }) : (x => undefined)), x => { x(undefined); return x; }, 10); >k : number ->fun((Math.random() < 0.5 ? (x => { x(undefined); return x; }) : (x => undefined)), x => { x(undefined); return x; }, 10) : number +>fun((Math.random() < 0.5 ? (x => { x(undefined); return x; }) : (x => undefined)), x => { x(undefined); return x; }, 10) : 10 >fun : { (f: FuncType, x: T): T; (f: FuncType, g: FuncType, x: T): T; } >(Math.random() < 0.5 ? (x => { x(undefined); return x; }) : (x => undefined)) : (x: (p: T) => T) => any >Math.random() < 0.5 ? (x => { x(undefined); return x; }) : (x => undefined) : (x: (p: T) => T) => any @@ -241,7 +241,7 @@ var k = fun((Math.random() < 0.5 ? (x => { x(undefined); return x; }) : >Math.random : () => number >Math : Math >random : () => number ->0.5 : number +>0.5 : 0.5 >(x => { x(undefined); return x; }) : (x: (p: T) => T) => (p: T) => T >x => { x(undefined); return x; } : (x: (p: T) => T) => (p: T) => T >x : (p: T) => T @@ -259,11 +259,11 @@ var k = fun((Math.random() < 0.5 ? (x => { x(undefined); return x; }) : >x : (p: T) => T >undefined : undefined >x : (p: T) => T ->10 : number +>10 : 10 var l = fun(((Math.random() < 0.5 ? ((x => { x(undefined); return x; })) : ((x => undefined)))),((x => { x(undefined); return x; })), 10); >l : number ->fun(((Math.random() < 0.5 ? ((x => { x(undefined); return x; })) : ((x => undefined)))),((x => { x(undefined); return x; })), 10) : number +>fun(((Math.random() < 0.5 ? ((x => { x(undefined); return x; })) : ((x => undefined)))),((x => { x(undefined); return x; })), 10) : 10 >fun : { (f: FuncType, x: T): T; (f: FuncType, g: FuncType, x: T): T; } >((Math.random() < 0.5 ? ((x => { x(undefined); return x; })) : ((x => undefined)))) : (x: (p: T) => T) => any >(Math.random() < 0.5 ? ((x => { x(undefined); return x; })) : ((x => undefined))) : (x: (p: T) => T) => any @@ -273,7 +273,7 @@ var l = fun(((Math.random() < 0.5 ? ((x => { x(undefined); return x; })) >Math.random : () => number >Math : Math >random : () => number ->0.5 : number +>0.5 : 0.5 >((x => { x(undefined); return x; })) : (x: (p: T) => T) => (p: T) => T >(x => { x(undefined); return x; }) : (x: (p: T) => T) => (p: T) => T >x => { x(undefined); return x; } : (x: (p: T) => T) => (p: T) => T @@ -295,7 +295,7 @@ var l = fun(((Math.random() < 0.5 ? ((x => { x(undefined); return x; })) >x : (p: T) => T >undefined : undefined >x : (p: T) => T ->10 : number +>10 : 10 var lambda1: FuncType = x => { x(undefined); return x; }; >lambda1 : FuncType diff --git a/tests/baselines/reference/parenthesizedContexualTyping3.types b/tests/baselines/reference/parenthesizedContexualTyping3.types index 5d424e5a7b0..522228b260d 100644 --- a/tests/baselines/reference/parenthesizedContexualTyping3.types +++ b/tests/baselines/reference/parenthesizedContexualTyping3.types @@ -62,7 +62,7 @@ var a = tempFun `${ x => x } ${ 10 }` >x => x : (x: number) => number >x : number >x : number ->10 : number +>10 : 10 var b = tempFun `${ (x => x) } ${ 10 }` >b : number @@ -73,7 +73,7 @@ var b = tempFun `${ (x => x) } ${ 10 }` >x => x : (x: number) => number >x : number >x : number ->10 : number +>10 : 10 var c = tempFun `${ ((x => x)) } ${ 10 }` >c : number @@ -85,7 +85,7 @@ var c = tempFun `${ ((x => x)) } ${ 10 }` >x => x : (x: number) => number >x : number >x : number ->10 : number +>10 : 10 var d = tempFun `${ x => x } ${ x => x } ${ 10 }` >d : number @@ -98,7 +98,7 @@ var d = tempFun `${ x => x } ${ x => x } ${ 10 }` >x => x : (x: number) => number >x : number >x : number ->10 : number +>10 : 10 var e = tempFun `${ x => x } ${ (x => x) } ${ 10 }` >e : number @@ -112,7 +112,7 @@ var e = tempFun `${ x => x } ${ (x => x) } ${ 10 }` >x => x : (x: number) => number >x : number >x : number ->10 : number +>10 : 10 var f = tempFun `${ x => x } ${ ((x => x)) } ${ 10 }` >f : number @@ -127,7 +127,7 @@ var f = tempFun `${ x => x } ${ ((x => x)) } ${ 10 }` >x => x : (x: number) => number >x : number >x : number ->10 : number +>10 : 10 var g = tempFun `${ (x => x) } ${ (((x => x))) } ${ 10 }` >g : number @@ -144,7 +144,7 @@ var g = tempFun `${ (x => x) } ${ (((x => x))) } ${ 10 }` >x => x : (x: number) => number >x : number >x : number ->10 : number +>10 : 10 var h = tempFun `${ (x => x) } ${ (((x => x))) } ${ undefined }` >h : any diff --git a/tests/baselines/reference/parseClassDeclarationInStrictModeByDefaultInES6.errors.txt b/tests/baselines/reference/parseClassDeclarationInStrictModeByDefaultInES6.errors.txt index 6f45030a650..16eb82ecb34 100644 --- a/tests/baselines/reference/parseClassDeclarationInStrictModeByDefaultInES6.errors.txt +++ b/tests/baselines/reference/parseClassDeclarationInStrictModeByDefaultInES6.errors.txt @@ -1,7 +1,7 @@ tests/cases/conformance/es6/classDeclaration/parseClassDeclarationInStrictModeByDefaultInES6.ts(4,16): error TS1210: Invalid use of 'arguments'. Class definitions are automatically in strict mode. tests/cases/conformance/es6/classDeclaration/parseClassDeclarationInStrictModeByDefaultInES6.ts(5,17): error TS1210: Invalid use of 'eval'. Class definitions are automatically in strict mode. tests/cases/conformance/es6/classDeclaration/parseClassDeclarationInStrictModeByDefaultInES6.ts(6,9): error TS1210: Invalid use of 'arguments'. Class definitions are automatically in strict mode. -tests/cases/conformance/es6/classDeclaration/parseClassDeclarationInStrictModeByDefaultInES6.ts(6,9): error TS2322: Type 'string' is not assignable to type 'IArguments'. +tests/cases/conformance/es6/classDeclaration/parseClassDeclarationInStrictModeByDefaultInES6.ts(6,9): error TS2322: Type '"hello"' is not assignable to type 'IArguments'. ==== tests/cases/conformance/es6/classDeclaration/parseClassDeclarationInStrictModeByDefaultInES6.ts (4 errors) ==== @@ -18,6 +18,6 @@ tests/cases/conformance/es6/classDeclaration/parseClassDeclarationInStrictModeBy ~~~~~~~~~ !!! error TS1210: Invalid use of 'arguments'. Class definitions are automatically in strict mode. ~~~~~~~~~ -!!! error TS2322: Type 'string' is not assignable to type 'IArguments'. +!!! error TS2322: Type '"hello"' is not assignable to type 'IArguments'. } } \ No newline at end of file diff --git a/tests/baselines/reference/parser15.4.4.14-9-2.errors.txt b/tests/baselines/reference/parser15.4.4.14-9-2.errors.txt index 940083ca93a..2c721724b3e 100644 --- a/tests/baselines/reference/parser15.4.4.14-9-2.errors.txt +++ b/tests/baselines/reference/parser15.4.4.14-9-2.errors.txt @@ -1,5 +1,5 @@ tests/cases/conformance/parser/ecmascript5/parser15.4.4.14-9-2.ts(16,15): error TS2453: The type argument for type parameter 'T' cannot be inferred from the usage. Consider specifying the type arguments explicitly. - Type argument candidate 'boolean' is not a valid type argument because it is not a supertype of candidate 'string'. + Type argument candidate 'number' is not a valid type argument because it is not a supertype of candidate 'false'. tests/cases/conformance/parser/ecmascript5/parser15.4.4.14-9-2.ts(25,1): error TS2304: Cannot find name 'runTestCase'. @@ -22,7 +22,7 @@ tests/cases/conformance/parser/ecmascript5/parser15.4.4.14-9-2.ts(25,1): error T var a = new Array(false,undefined,null,"0",obj,-1.3333333333333, "str",-0,true,+0, one, 1,0, false, _float, -(4/3)); ~~~~~ !!! error TS2453: The type argument for type parameter 'T' cannot be inferred from the usage. Consider specifying the type arguments explicitly. -!!! error TS2453: Type argument candidate 'boolean' is not a valid type argument because it is not a supertype of candidate 'string'. +!!! error TS2453: Type argument candidate 'number' is not a valid type argument because it is not a supertype of candidate 'false'. if (a.indexOf(-(4/3)) === 14 && // a[14]=_float===-(4/3) a.indexOf(0) === 7 && // a[7] = +0, 0===+0 a.indexOf(-0) === 7 && // a[7] = +0, -0===+0 diff --git a/tests/baselines/reference/parser509546_2.types b/tests/baselines/reference/parser509546_2.types index 211553286a5..819b972254d 100644 --- a/tests/baselines/reference/parser509546_2.types +++ b/tests/baselines/reference/parser509546_2.types @@ -1,6 +1,6 @@ === tests/cases/conformance/parser/ecmascript5/RegressionTests/parser509546_2.ts === "use strict"; ->"use strict" : string +>"use strict" : "use strict" export class Logger { >Logger : Logger diff --git a/tests/baselines/reference/parser512325.errors.txt b/tests/baselines/reference/parser512325.errors.txt index 57e75d2beff..e6a47fbf226 100644 --- a/tests/baselines/reference/parser512325.errors.txt +++ b/tests/baselines/reference/parser512325.errors.txt @@ -1,5 +1,7 @@ tests/cases/conformance/parser/ecmascript5/RegressionTests/parser512325.ts(1,11): error TS2304: Cannot find name 'a'. +tests/cases/conformance/parser/ecmascript5/RegressionTests/parser512325.ts(1,11): error TS2695: Left side of comma operator is unused and has no side effects. tests/cases/conformance/parser/ecmascript5/RegressionTests/parser512325.ts(1,15): error TS2304: Cannot find name 'b'. +tests/cases/conformance/parser/ecmascript5/RegressionTests/parser512325.ts(1,15): error TS2695: Left side of comma operator is unused and has no side effects. tests/cases/conformance/parser/ecmascript5/RegressionTests/parser512325.ts(1,18): error TS2304: Cannot find name 'c'. tests/cases/conformance/parser/ecmascript5/RegressionTests/parser512325.ts(1,22): error TS1005: ';' expected. tests/cases/conformance/parser/ecmascript5/RegressionTests/parser512325.ts(1,25): error TS2304: Cannot find name 'a'. @@ -7,12 +9,16 @@ tests/cases/conformance/parser/ecmascript5/RegressionTests/parser512325.ts(1,27) tests/cases/conformance/parser/ecmascript5/RegressionTests/parser512325.ts(1,29): error TS2304: Cannot find name 'c'. -==== tests/cases/conformance/parser/ecmascript5/RegressionTests/parser512325.ts (7 errors) ==== +==== tests/cases/conformance/parser/ecmascript5/RegressionTests/parser512325.ts (9 errors) ==== var tt = (a, (b, c)) => a+b+c; ~ !!! error TS2304: Cannot find name 'a'. + ~ +!!! error TS2695: Left side of comma operator is unused and has no side effects. ~ !!! error TS2304: Cannot find name 'b'. + ~ +!!! error TS2695: Left side of comma operator is unused and has no side effects. ~ !!! error TS2304: Cannot find name 'c'. ~~ diff --git a/tests/baselines/reference/parser630933.types b/tests/baselines/reference/parser630933.types index 3f991f58d30..9a0ba9e7205 100644 --- a/tests/baselines/reference/parser630933.types +++ b/tests/baselines/reference/parser630933.types @@ -1,7 +1,7 @@ === tests/cases/conformance/parser/ecmascript5/RegressionTests/parser630933.ts === var a = "Hello"; >a : string ->"Hello" : string +>"Hello" : "Hello" var b = a.match(/\/ver=([^/]+)/); >b : RegExpMatchArray diff --git a/tests/baselines/reference/parser768531.types b/tests/baselines/reference/parser768531.types index 434535b5cc9..17bae7161fa 100644 --- a/tests/baselines/reference/parser768531.types +++ b/tests/baselines/reference/parser768531.types @@ -2,7 +2,7 @@ {a: 3} >a : any ->3 : number +>3 : 3 /x/ >/x/ : RegExp diff --git a/tests/baselines/reference/parserAccessibilityAfterStatic3.types b/tests/baselines/reference/parserAccessibilityAfterStatic3.types index c85c5077392..3bf87f8807f 100644 --- a/tests/baselines/reference/parserAccessibilityAfterStatic3.types +++ b/tests/baselines/reference/parserAccessibilityAfterStatic3.types @@ -4,6 +4,6 @@ class Outer { static public = 1; >public : number ->1 : number +>1 : 1 } diff --git a/tests/baselines/reference/parserAmbiguityWithBinaryOperator1.types b/tests/baselines/reference/parserAmbiguityWithBinaryOperator1.types index bdeb5ab7bbc..234375fb46d 100644 --- a/tests/baselines/reference/parserAmbiguityWithBinaryOperator1.types +++ b/tests/baselines/reference/parserAmbiguityWithBinaryOperator1.types @@ -17,5 +17,5 @@ function f1() { >(c + 1) : any >c + 1 : any >c : any ->1 : number +>1 : 1 } diff --git a/tests/baselines/reference/parserAmbiguityWithBinaryOperator2.types b/tests/baselines/reference/parserAmbiguityWithBinaryOperator2.types index 79eb212163e..ed3b4b903bb 100644 --- a/tests/baselines/reference/parserAmbiguityWithBinaryOperator2.types +++ b/tests/baselines/reference/parserAmbiguityWithBinaryOperator2.types @@ -17,5 +17,5 @@ function f() { >(c + 1) : any >c + 1 : any >c : any ->1 : number +>1 : 1 } diff --git a/tests/baselines/reference/parserAmbiguityWithBinaryOperator3.types b/tests/baselines/reference/parserAmbiguityWithBinaryOperator3.types index aba5f4872d8..61601d8bdf6 100644 --- a/tests/baselines/reference/parserAmbiguityWithBinaryOperator3.types +++ b/tests/baselines/reference/parserAmbiguityWithBinaryOperator3.types @@ -17,6 +17,6 @@ function f() { >(c + 1) : any >c + 1 : any >c : any ->1 : number +>1 : 1 } diff --git a/tests/baselines/reference/parserArrayLiteralExpression10.types b/tests/baselines/reference/parserArrayLiteralExpression10.types index 370e9fb6c9d..7960490e7cf 100644 --- a/tests/baselines/reference/parserArrayLiteralExpression10.types +++ b/tests/baselines/reference/parserArrayLiteralExpression10.types @@ -2,6 +2,6 @@ var v = [1,1,]; >v : number[] >[1,1,] : number[] ->1 : number ->1 : number +>1 : 1 +>1 : 1 diff --git a/tests/baselines/reference/parserArrayLiteralExpression11.types b/tests/baselines/reference/parserArrayLiteralExpression11.types index aba6e30a291..36491c96655 100644 --- a/tests/baselines/reference/parserArrayLiteralExpression11.types +++ b/tests/baselines/reference/parserArrayLiteralExpression11.types @@ -2,7 +2,7 @@ var v = [1,,1]; >v : number[] >[1,,1] : number[] ->1 : number +>1 : 1 > : undefined ->1 : number +>1 : 1 diff --git a/tests/baselines/reference/parserArrayLiteralExpression12.types b/tests/baselines/reference/parserArrayLiteralExpression12.types index 7d9e4c38976..cd861667501 100644 --- a/tests/baselines/reference/parserArrayLiteralExpression12.types +++ b/tests/baselines/reference/parserArrayLiteralExpression12.types @@ -2,8 +2,8 @@ var v = [1,,,1]; >v : number[] >[1,,,1] : number[] ->1 : number +>1 : 1 > : undefined > : undefined ->1 : number +>1 : 1 diff --git a/tests/baselines/reference/parserArrayLiteralExpression13.types b/tests/baselines/reference/parserArrayLiteralExpression13.types index 62fb9aea5f7..7d377e9ac5a 100644 --- a/tests/baselines/reference/parserArrayLiteralExpression13.types +++ b/tests/baselines/reference/parserArrayLiteralExpression13.types @@ -2,9 +2,9 @@ var v = [1,,1,,1]; >v : number[] >[1,,1,,1] : number[] ->1 : number +>1 : 1 > : undefined ->1 : number +>1 : 1 > : undefined ->1 : number +>1 : 1 diff --git a/tests/baselines/reference/parserArrayLiteralExpression14.types b/tests/baselines/reference/parserArrayLiteralExpression14.types index 9d3a029aed2..aa08d2b13d0 100644 --- a/tests/baselines/reference/parserArrayLiteralExpression14.types +++ b/tests/baselines/reference/parserArrayLiteralExpression14.types @@ -4,13 +4,13 @@ var v = [,,1,1,,1,,1,1,,1]; >[,,1,1,,1,,1,1,,1] : number[] > : undefined > : undefined ->1 : number ->1 : number +>1 : 1 +>1 : 1 > : undefined ->1 : number +>1 : 1 > : undefined ->1 : number ->1 : number +>1 : 1 +>1 : 1 > : undefined ->1 : number +>1 : 1 diff --git a/tests/baselines/reference/parserArrayLiteralExpression15.types b/tests/baselines/reference/parserArrayLiteralExpression15.types index 75afab3731c..7f7b855a007 100644 --- a/tests/baselines/reference/parserArrayLiteralExpression15.types +++ b/tests/baselines/reference/parserArrayLiteralExpression15.types @@ -4,13 +4,13 @@ var v = [,,1,1,,1,,1,1,,1,]; >[,,1,1,,1,,1,1,,1,] : number[] > : undefined > : undefined ->1 : number ->1 : number +>1 : 1 +>1 : 1 > : undefined ->1 : number +>1 : 1 > : undefined ->1 : number ->1 : number +>1 : 1 +>1 : 1 > : undefined ->1 : number +>1 : 1 diff --git a/tests/baselines/reference/parserArrayLiteralExpression5.types b/tests/baselines/reference/parserArrayLiteralExpression5.types index 48fdaa024fc..b1b2e59b8d4 100644 --- a/tests/baselines/reference/parserArrayLiteralExpression5.types +++ b/tests/baselines/reference/parserArrayLiteralExpression5.types @@ -2,5 +2,5 @@ var v = [1]; >v : number[] >[1] : number[] ->1 : number +>1 : 1 diff --git a/tests/baselines/reference/parserArrayLiteralExpression6.types b/tests/baselines/reference/parserArrayLiteralExpression6.types index 66df1cda219..f13db817901 100644 --- a/tests/baselines/reference/parserArrayLiteralExpression6.types +++ b/tests/baselines/reference/parserArrayLiteralExpression6.types @@ -3,5 +3,5 @@ var v = [,1]; >v : number[] >[,1] : number[] > : undefined ->1 : number +>1 : 1 diff --git a/tests/baselines/reference/parserArrayLiteralExpression7.types b/tests/baselines/reference/parserArrayLiteralExpression7.types index 65225500eb2..35d786ea67b 100644 --- a/tests/baselines/reference/parserArrayLiteralExpression7.types +++ b/tests/baselines/reference/parserArrayLiteralExpression7.types @@ -2,5 +2,5 @@ var v = [1,]; >v : number[] >[1,] : number[] ->1 : number +>1 : 1 diff --git a/tests/baselines/reference/parserArrayLiteralExpression8.types b/tests/baselines/reference/parserArrayLiteralExpression8.types index e14c99f3b57..7ea2b3b8e5c 100644 --- a/tests/baselines/reference/parserArrayLiteralExpression8.types +++ b/tests/baselines/reference/parserArrayLiteralExpression8.types @@ -3,5 +3,5 @@ var v = [,1,]; >v : number[] >[,1,] : number[] > : undefined ->1 : number +>1 : 1 diff --git a/tests/baselines/reference/parserArrayLiteralExpression9.types b/tests/baselines/reference/parserArrayLiteralExpression9.types index 96bb1595326..3dc1326c812 100644 --- a/tests/baselines/reference/parserArrayLiteralExpression9.types +++ b/tests/baselines/reference/parserArrayLiteralExpression9.types @@ -2,6 +2,6 @@ var v = [1,1]; >v : number[] >[1,1] : number[] ->1 : number ->1 : number +>1 : 1 +>1 : 1 diff --git a/tests/baselines/reference/parserArrowFunctionExpression4.errors.txt b/tests/baselines/reference/parserArrowFunctionExpression4.errors.txt index 9e04f60139d..6fd839315d4 100644 --- a/tests/baselines/reference/parserArrowFunctionExpression4.errors.txt +++ b/tests/baselines/reference/parserArrowFunctionExpression4.errors.txt @@ -1,10 +1,13 @@ tests/cases/conformance/parser/ecmascript5/ArrowFunctionExpressions/parserArrowFunctionExpression4.ts(1,1): error TS2304: Cannot find name 'a'. +tests/cases/conformance/parser/ecmascript5/ArrowFunctionExpressions/parserArrowFunctionExpression4.ts(1,6): error TS2695: Left side of comma operator is unused and has no side effects. tests/cases/conformance/parser/ecmascript5/ArrowFunctionExpressions/parserArrowFunctionExpression4.ts(1,17): error TS2304: Cannot find name 'a'. -==== tests/cases/conformance/parser/ecmascript5/ArrowFunctionExpressions/parserArrowFunctionExpression4.ts (2 errors) ==== +==== tests/cases/conformance/parser/ecmascript5/ArrowFunctionExpressions/parserArrowFunctionExpression4.ts (3 errors) ==== a = (() => { }, a) ~ !!! error TS2304: Cannot find name 'a'. + ~~~~~~~~~ +!!! error TS2695: Left side of comma operator is unused and has no side effects. ~ !!! error TS2304: Cannot find name 'a'. \ No newline at end of file diff --git a/tests/baselines/reference/parserCastVersusArrowFunction1.errors.txt b/tests/baselines/reference/parserCastVersusArrowFunction1.errors.txt index 6faa7934898..e2d90538b8c 100644 --- a/tests/baselines/reference/parserCastVersusArrowFunction1.errors.txt +++ b/tests/baselines/reference/parserCastVersusArrowFunction1.errors.txt @@ -7,13 +7,14 @@ tests/cases/conformance/parser/ecmascript5/Generics/parserCastVersusArrowFunctio tests/cases/conformance/parser/ecmascript5/Generics/parserCastVersusArrowFunction1.ts(8,13): error TS2304: Cannot find name 'a'. tests/cases/conformance/parser/ecmascript5/Generics/parserCastVersusArrowFunction1.ts(9,10): error TS2304: Cannot find name 'T'. tests/cases/conformance/parser/ecmascript5/Generics/parserCastVersusArrowFunction1.ts(9,13): error TS2304: Cannot find name 'a'. +tests/cases/conformance/parser/ecmascript5/Generics/parserCastVersusArrowFunction1.ts(9,13): error TS2695: Left side of comma operator is unused and has no side effects. tests/cases/conformance/parser/ecmascript5/Generics/parserCastVersusArrowFunction1.ts(9,16): error TS2304: Cannot find name 'b'. tests/cases/conformance/parser/ecmascript5/Generics/parserCastVersusArrowFunction1.ts(10,10): error TS2304: Cannot find name 'T'. tests/cases/conformance/parser/ecmascript5/Generics/parserCastVersusArrowFunction1.ts(10,13): error TS2304: Cannot find name 'a'. tests/cases/conformance/parser/ecmascript5/Generics/parserCastVersusArrowFunction1.ts(10,20): error TS2304: Cannot find name 'b'. -==== tests/cases/conformance/parser/ecmascript5/Generics/parserCastVersusArrowFunction1.ts (13 errors) ==== +==== tests/cases/conformance/parser/ecmascript5/Generics/parserCastVersusArrowFunction1.ts (14 errors) ==== var v = () => 1; var v = a; ~ @@ -41,6 +42,8 @@ tests/cases/conformance/parser/ecmascript5/Generics/parserCastVersusArrowFunctio !!! error TS2304: Cannot find name 'T'. ~ !!! error TS2304: Cannot find name 'a'. + ~ +!!! error TS2695: Left side of comma operator is unused and has no side effects. ~ !!! error TS2304: Cannot find name 'b'. var v = (a = 1, b = 2); diff --git a/tests/baselines/reference/parserComputedPropertyName35.errors.txt b/tests/baselines/reference/parserComputedPropertyName35.errors.txt index e603d1c73fd..39afa0999b8 100644 --- a/tests/baselines/reference/parserComputedPropertyName35.errors.txt +++ b/tests/baselines/reference/parserComputedPropertyName35.errors.txt @@ -1,9 +1,12 @@ +tests/cases/conformance/parser/ecmascript6/ComputedPropertyNames/parserComputedPropertyName35.ts(2,6): error TS2695: Left side of comma operator is unused and has no side effects. tests/cases/conformance/parser/ecmascript6/ComputedPropertyNames/parserComputedPropertyName35.ts(2,6): error TS1171: A comma expression is not allowed in a computed property name. -==== tests/cases/conformance/parser/ecmascript6/ComputedPropertyNames/parserComputedPropertyName35.ts (1 errors) ==== +==== tests/cases/conformance/parser/ecmascript6/ComputedPropertyNames/parserComputedPropertyName35.ts (2 errors) ==== var x = { [0, 1]: { } + ~ +!!! error TS2695: Left side of comma operator is unused and has no side effects. ~~~~ !!! error TS1171: A comma expression is not allowed in a computed property name. } \ No newline at end of file diff --git a/tests/baselines/reference/parserDoStatement2.types b/tests/baselines/reference/parserDoStatement2.types index 5affaa958d6..9e83f6ad6d2 100644 --- a/tests/baselines/reference/parserDoStatement2.types +++ b/tests/baselines/reference/parserDoStatement2.types @@ -1,5 +1,5 @@ === tests/cases/conformance/parser/ecmascript5/Statements/parserDoStatement2.ts === do{;}while(false)false ->false : boolean ->false : boolean +>false : false +>false : false diff --git a/tests/baselines/reference/parserEmptyStatement1.types b/tests/baselines/reference/parserEmptyStatement1.types index a581dd6e871..1cb1e33b2b8 100644 --- a/tests/baselines/reference/parserEmptyStatement1.types +++ b/tests/baselines/reference/parserEmptyStatement1.types @@ -2,7 +2,7 @@ ; ; var a = 1; >a : number ->1 : number +>1 : 1 ; diff --git a/tests/baselines/reference/parserEnum1.types b/tests/baselines/reference/parserEnum1.types index 34d11a1858d..42161656a1e 100644 --- a/tests/baselines/reference/parserEnum1.types +++ b/tests/baselines/reference/parserEnum1.types @@ -6,21 +6,21 @@ None = 0, >None : SignatureFlags ->0 : number +>0 : 0 IsIndexer = 1, >IsIndexer : SignatureFlags ->1 : number +>1 : 1 IsStringIndexer = 1 << 1, >IsStringIndexer : SignatureFlags >1 << 1 : number ->1 : number ->1 : number +>1 : 1 +>1 : 1 IsNumberIndexer = 1 << 2, >IsNumberIndexer : SignatureFlags >1 << 2 : number ->1 : number ->2 : number +>1 : 1 +>2 : 2 } diff --git a/tests/baselines/reference/parserEnum2.types b/tests/baselines/reference/parserEnum2.types index 6d119d8f079..5c0a8fec2d4 100644 --- a/tests/baselines/reference/parserEnum2.types +++ b/tests/baselines/reference/parserEnum2.types @@ -6,21 +6,21 @@ None = 0, >None : SignatureFlags ->0 : number +>0 : 0 IsIndexer = 1, >IsIndexer : SignatureFlags ->1 : number +>1 : 1 IsStringIndexer = 1 << 1, >IsStringIndexer : SignatureFlags >1 << 1 : number ->1 : number ->1 : number +>1 : 1 +>1 : 1 IsNumberIndexer = 1 << 2 >IsNumberIndexer : SignatureFlags >1 << 2 : number ->1 : number ->2 : number +>1 : 1 +>2 : 2 } diff --git a/tests/baselines/reference/parserEnumDeclaration1.types b/tests/baselines/reference/parserEnumDeclaration1.types index de99855b310..cd58d5dc89a 100644 --- a/tests/baselines/reference/parserEnumDeclaration1.types +++ b/tests/baselines/reference/parserEnumDeclaration1.types @@ -3,9 +3,9 @@ enum E { >E : E Foo = 1, ->Foo : E ->1 : number +>Foo : E.Foo +>1 : 1 Bar ->Bar : E +>Bar : E.Bar } diff --git a/tests/baselines/reference/parserEnumDeclaration3.types b/tests/baselines/reference/parserEnumDeclaration3.types index b427a795eb6..027f837229f 100644 --- a/tests/baselines/reference/parserEnumDeclaration3.types +++ b/tests/baselines/reference/parserEnumDeclaration3.types @@ -4,5 +4,5 @@ declare enum E { A = 1 >A : E ->1 : number +>1 : 1 } diff --git a/tests/baselines/reference/parserEnumDeclaration5.types b/tests/baselines/reference/parserEnumDeclaration5.types index bbb596b7b0f..4068eed0a4b 100644 --- a/tests/baselines/reference/parserEnumDeclaration5.types +++ b/tests/baselines/reference/parserEnumDeclaration5.types @@ -3,16 +3,16 @@ enum E { >E : E A = 1, ->A : E ->1 : number +>A : E.A +>1 : 1 B, ->B : E +>B : E.B C = 2, ->C : E ->2 : number +>C : E.B +>2 : 2 D ->D : E +>D : E.D } diff --git a/tests/baselines/reference/parserEnumDeclaration6.types b/tests/baselines/reference/parserEnumDeclaration6.types index c13d66db41c..53d1e636750 100644 --- a/tests/baselines/reference/parserEnumDeclaration6.types +++ b/tests/baselines/reference/parserEnumDeclaration6.types @@ -4,7 +4,7 @@ enum E { A = 1, >A : E ->1 : number +>1 : 1 B, >B : E @@ -12,8 +12,8 @@ enum E { C = 1 << 1, >C : E >1 << 1 : number ->1 : number ->1 : number +>1 : 1 +>1 : 1 D, >D : E diff --git a/tests/baselines/reference/parserErrorRecoveryArrayLiteralExpression3.errors.txt b/tests/baselines/reference/parserErrorRecoveryArrayLiteralExpression3.errors.txt index 69997baef28..e34e8b6072a 100644 --- a/tests/baselines/reference/parserErrorRecoveryArrayLiteralExpression3.errors.txt +++ b/tests/baselines/reference/parserErrorRecoveryArrayLiteralExpression3.errors.txt @@ -1,12 +1,18 @@ tests/cases/conformance/parser/ecmascript5/ErrorRecovery/ArrayLiteralExpressions/parserErrorRecoveryArrayLiteralExpression3.ts(2,54): error TS1005: ',' expected. +tests/cases/conformance/parser/ecmascript5/ErrorRecovery/ArrayLiteralExpressions/parserErrorRecoveryArrayLiteralExpression3.ts(2,56): error TS2695: Left side of comma operator is unused and has no side effects. +tests/cases/conformance/parser/ecmascript5/ErrorRecovery/ArrayLiteralExpressions/parserErrorRecoveryArrayLiteralExpression3.ts(2,56): error TS2695: Left side of comma operator is unused and has no side effects. tests/cases/conformance/parser/ecmascript5/ErrorRecovery/ArrayLiteralExpressions/parserErrorRecoveryArrayLiteralExpression3.ts(2,105): error TS1005: ';' expected. -==== tests/cases/conformance/parser/ecmascript5/ErrorRecovery/ArrayLiteralExpressions/parserErrorRecoveryArrayLiteralExpression3.ts (2 errors) ==== +==== tests/cases/conformance/parser/ecmascript5/ErrorRecovery/ArrayLiteralExpressions/parserErrorRecoveryArrayLiteralExpression3.ts (4 errors) ==== var texCoords = [2, 2, 0.5000001192092895, 0.8749999 ; 403953552, 0.5000001192092895, 0.8749999403953552]; ~ !!! error TS1005: ',' expected. + ~~~~~~~~~ +!!! error TS2695: Left side of comma operator is unused and has no side effects. + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS2695: Left side of comma operator is unused and has no side effects. ~ !!! error TS1005: ';' expected. \ No newline at end of file diff --git a/tests/baselines/reference/parserErrorRecovery_IncompleteMemberVariable1.types b/tests/baselines/reference/parserErrorRecovery_IncompleteMemberVariable1.types index b38bbbfe64d..161824e512d 100644 --- a/tests/baselines/reference/parserErrorRecovery_IncompleteMemberVariable1.types +++ b/tests/baselines/reference/parserErrorRecovery_IncompleteMemberVariable1.types @@ -52,8 +52,8 @@ module Shapes { >origin : Point >new Point(0, 0) : Point >Point : typeof Point ->0 : number ->0 : number +>0 : 0 +>0 : 0 } } @@ -66,8 +66,8 @@ var p: IPoint = new Shapes.Point(3, 4); >Shapes.Point : typeof Shapes.Point >Shapes : typeof Shapes >Point : typeof Shapes.Point ->3 : number ->4 : number +>3 : 3 +>4 : 4 var dist = p.getDist(); >dist : number diff --git a/tests/baselines/reference/parserGreaterThanTokenAmbiguity1.types b/tests/baselines/reference/parserGreaterThanTokenAmbiguity1.types index 0449fdda85a..1c82fb807d8 100644 --- a/tests/baselines/reference/parserGreaterThanTokenAmbiguity1.types +++ b/tests/baselines/reference/parserGreaterThanTokenAmbiguity1.types @@ -1,6 +1,6 @@ === tests/cases/conformance/parser/ecmascript5/Generics/parserGreaterThanTokenAmbiguity1.ts === 1 >> 2; >1 >> 2 : number ->1 : number ->2 : number +>1 : 1 +>2 : 2 diff --git a/tests/baselines/reference/parserGreaterThanTokenAmbiguity10.types b/tests/baselines/reference/parserGreaterThanTokenAmbiguity10.types index 8b3d5dd2ba3..cda7a97701e 100644 --- a/tests/baselines/reference/parserGreaterThanTokenAmbiguity10.types +++ b/tests/baselines/reference/parserGreaterThanTokenAmbiguity10.types @@ -1,10 +1,10 @@ === tests/cases/conformance/parser/ecmascript5/Generics/parserGreaterThanTokenAmbiguity10.ts === 1 >1 // before>>> // after2 : number ->1 : number +>1 : 1 // before >>> // after 2; ->2 : number +>2 : 2 diff --git a/tests/baselines/reference/parserGreaterThanTokenAmbiguity2.errors.txt b/tests/baselines/reference/parserGreaterThanTokenAmbiguity2.errors.txt index 30ede342a85..ee2d3666682 100644 --- a/tests/baselines/reference/parserGreaterThanTokenAmbiguity2.errors.txt +++ b/tests/baselines/reference/parserGreaterThanTokenAmbiguity2.errors.txt @@ -1,10 +1,10 @@ -tests/cases/conformance/parser/ecmascript5/Generics/parserGreaterThanTokenAmbiguity2.ts(1,1): error TS2365: Operator '>' cannot be applied to types 'boolean' and 'number'. +tests/cases/conformance/parser/ecmascript5/Generics/parserGreaterThanTokenAmbiguity2.ts(1,1): error TS2365: Operator '>' cannot be applied to types 'boolean' and '2'. tests/cases/conformance/parser/ecmascript5/Generics/parserGreaterThanTokenAmbiguity2.ts(1,5): error TS1109: Expression expected. ==== tests/cases/conformance/parser/ecmascript5/Generics/parserGreaterThanTokenAmbiguity2.ts (2 errors) ==== 1 > > 2; ~~~~~~~ -!!! error TS2365: Operator '>' cannot be applied to types 'boolean' and 'number'. +!!! error TS2365: Operator '>' cannot be applied to types 'boolean' and '2'. ~ !!! error TS1109: Expression expected. \ No newline at end of file diff --git a/tests/baselines/reference/parserGreaterThanTokenAmbiguity3.errors.txt b/tests/baselines/reference/parserGreaterThanTokenAmbiguity3.errors.txt index baebfd81304..1651009bf0d 100644 --- a/tests/baselines/reference/parserGreaterThanTokenAmbiguity3.errors.txt +++ b/tests/baselines/reference/parserGreaterThanTokenAmbiguity3.errors.txt @@ -1,10 +1,10 @@ -tests/cases/conformance/parser/ecmascript5/Generics/parserGreaterThanTokenAmbiguity3.ts(1,1): error TS2365: Operator '>' cannot be applied to types 'boolean' and 'number'. +tests/cases/conformance/parser/ecmascript5/Generics/parserGreaterThanTokenAmbiguity3.ts(1,1): error TS2365: Operator '>' cannot be applied to types 'boolean' and '2'. tests/cases/conformance/parser/ecmascript5/Generics/parserGreaterThanTokenAmbiguity3.ts(1,8): error TS1109: Expression expected. ==== tests/cases/conformance/parser/ecmascript5/Generics/parserGreaterThanTokenAmbiguity3.ts (2 errors) ==== 1 >/**/> 2; ~~~~~~~~~~ -!!! error TS2365: Operator '>' cannot be applied to types 'boolean' and 'number'. +!!! error TS2365: Operator '>' cannot be applied to types 'boolean' and '2'. ~ !!! error TS1109: Expression expected. \ No newline at end of file diff --git a/tests/baselines/reference/parserGreaterThanTokenAmbiguity4.errors.txt b/tests/baselines/reference/parserGreaterThanTokenAmbiguity4.errors.txt index 924c9440d16..dff69b37612 100644 --- a/tests/baselines/reference/parserGreaterThanTokenAmbiguity4.errors.txt +++ b/tests/baselines/reference/parserGreaterThanTokenAmbiguity4.errors.txt @@ -1,4 +1,4 @@ -tests/cases/conformance/parser/ecmascript5/Generics/parserGreaterThanTokenAmbiguity4.ts(1,1): error TS2365: Operator '>' cannot be applied to types 'boolean' and 'number'. +tests/cases/conformance/parser/ecmascript5/Generics/parserGreaterThanTokenAmbiguity4.ts(1,1): error TS2365: Operator '>' cannot be applied to types 'boolean' and '2'. tests/cases/conformance/parser/ecmascript5/Generics/parserGreaterThanTokenAmbiguity4.ts(2,1): error TS1109: Expression expected. @@ -7,6 +7,6 @@ tests/cases/conformance/parser/ecmascript5/Generics/parserGreaterThanTokenAmbigu ~~~ > 2; ~~~ -!!! error TS2365: Operator '>' cannot be applied to types 'boolean' and 'number'. +!!! error TS2365: Operator '>' cannot be applied to types 'boolean' and '2'. ~ !!! error TS1109: Expression expected. \ No newline at end of file diff --git a/tests/baselines/reference/parserGreaterThanTokenAmbiguity5.types b/tests/baselines/reference/parserGreaterThanTokenAmbiguity5.types index 609901bfdd5..0dc774103aa 100644 --- a/tests/baselines/reference/parserGreaterThanTokenAmbiguity5.types +++ b/tests/baselines/reference/parserGreaterThanTokenAmbiguity5.types @@ -1,10 +1,10 @@ === tests/cases/conformance/parser/ecmascript5/Generics/parserGreaterThanTokenAmbiguity5.ts === 1 >1 // before>> // after2 : number ->1 : number +>1 : 1 // before >> // after 2; ->2 : number +>2 : 2 diff --git a/tests/baselines/reference/parserGreaterThanTokenAmbiguity6.types b/tests/baselines/reference/parserGreaterThanTokenAmbiguity6.types index e7aa311113c..171211bfbab 100644 --- a/tests/baselines/reference/parserGreaterThanTokenAmbiguity6.types +++ b/tests/baselines/reference/parserGreaterThanTokenAmbiguity6.types @@ -1,6 +1,6 @@ === tests/cases/conformance/parser/ecmascript5/Generics/parserGreaterThanTokenAmbiguity6.ts === 1 >>> 2; >1 >>> 2 : number ->1 : number ->2 : number +>1 : 1 +>2 : 2 diff --git a/tests/baselines/reference/parserInterfaceKeywordInEnum1.types b/tests/baselines/reference/parserInterfaceKeywordInEnum1.types index f6b613f3f60..57c4ef2ebec 100644 --- a/tests/baselines/reference/parserInterfaceKeywordInEnum1.types +++ b/tests/baselines/reference/parserInterfaceKeywordInEnum1.types @@ -1,6 +1,6 @@ === tests/cases/conformance/parser/ecmascript5/EnumDeclarations/parserInterfaceKeywordInEnum1.ts === "use strict"; ->"use strict" : string +>"use strict" : "use strict" enum Bar { >Bar : Bar diff --git a/tests/baselines/reference/parserKeywordsAsIdentifierName1.types b/tests/baselines/reference/parserKeywordsAsIdentifierName1.types index bc586e8a4bb..74b9e0b30de 100644 --- a/tests/baselines/reference/parserKeywordsAsIdentifierName1.types +++ b/tests/baselines/reference/parserKeywordsAsIdentifierName1.types @@ -5,14 +5,14 @@ var big = { break : 0, >break : number ->0 : number +>0 : 0 super : 0, >super : number ->0 : number +>0 : 0 const : 0 >const : number ->0 : number +>0 : 0 } diff --git a/tests/baselines/reference/parserModule1.types b/tests/baselines/reference/parserModule1.types index 2d3b670aaa6..b32651a71a4 100644 --- a/tests/baselines/reference/parserModule1.types +++ b/tests/baselines/reference/parserModule1.types @@ -4,7 +4,7 @@ export var debug = false; >debug : boolean ->false : boolean +>false : false export interface IDiagnosticWriter { >IDiagnosticWriter : IDiagnosticWriter @@ -21,7 +21,7 @@ export var analysisPass: number = 0; >analysisPass : number ->0 : number +>0 : 0 export function Alert(output: string) { >Alert : (output: string) => void diff --git a/tests/baselines/reference/parserModuleDeclaration11.types b/tests/baselines/reference/parserModuleDeclaration11.types index 98075a505f7..21d9f0803ea 100644 --- a/tests/baselines/reference/parserModuleDeclaration11.types +++ b/tests/baselines/reference/parserModuleDeclaration11.types @@ -14,7 +14,7 @@ string.foo("abc"); >string.foo : (s: string) => any >string : typeof string >foo : (s: string) => any ->"abc" : string +>"abc" : "abc" var x: string.X; >x : string.X diff --git a/tests/baselines/reference/parserObjectLiterals1.types b/tests/baselines/reference/parserObjectLiterals1.types index b6bca18e360..fb85352747f 100644 --- a/tests/baselines/reference/parserObjectLiterals1.types +++ b/tests/baselines/reference/parserObjectLiterals1.types @@ -3,7 +3,7 @@ var v = { a: 1, b: 2 }; >v : { a: number; b: number; } >{ a: 1, b: 2 } : { a: number; b: number; } >a : number ->1 : number +>1 : 1 >b : number ->2 : number +>2 : 2 diff --git a/tests/baselines/reference/parserRealSource14.errors.txt b/tests/baselines/reference/parserRealSource14.errors.txt index 4881864e236..8682b1e6557 100644 --- a/tests/baselines/reference/parserRealSource14.errors.txt +++ b/tests/baselines/reference/parserRealSource14.errors.txt @@ -1,30 +1,30 @@ tests/cases/conformance/parser/ecmascript5/parserRealSource14.ts(4,1): error TS6053: File 'tests/cases/conformance/parser/ecmascript5/typescript.ts' not found. -tests/cases/conformance/parser/ecmascript5/parserRealSource14.ts(24,33): error TS2305: Module 'TypeScript' has no exported member 'AST'. -tests/cases/conformance/parser/ecmascript5/parserRealSource14.ts(38,34): error TS2305: Module 'TypeScript' has no exported member 'AST'. -tests/cases/conformance/parser/ecmascript5/parserRealSource14.ts(48,37): error TS2305: Module 'TypeScript' has no exported member 'AST'. -tests/cases/conformance/parser/ecmascript5/parserRealSource14.ts(68,39): error TS2305: Module 'TypeScript' has no exported member 'NodeType'. +tests/cases/conformance/parser/ecmascript5/parserRealSource14.ts(24,33): error TS2694: Namespace 'TypeScript' has no exported member 'AST'. +tests/cases/conformance/parser/ecmascript5/parserRealSource14.ts(38,34): error TS2694: Namespace 'TypeScript' has no exported member 'AST'. +tests/cases/conformance/parser/ecmascript5/parserRealSource14.ts(48,37): error TS2694: Namespace 'TypeScript' has no exported member 'AST'. +tests/cases/conformance/parser/ecmascript5/parserRealSource14.ts(68,39): error TS2694: Namespace 'TypeScript' has no exported member 'NodeType'. tests/cases/conformance/parser/ecmascript5/parserRealSource14.ts(70,35): error TS2339: Property 'NodeType' does not exist on type 'typeof TypeScript'. -tests/cases/conformance/parser/ecmascript5/parserRealSource14.ts(75,32): error TS2305: Module 'TypeScript' has no exported member 'AST'. -tests/cases/conformance/parser/ecmascript5/parserRealSource14.ts(79,32): error TS2305: Module 'TypeScript' has no exported member 'AST'. -tests/cases/conformance/parser/ecmascript5/parserRealSource14.ts(86,47): error TS2305: Module 'TypeScript' has no exported member 'AST'. +tests/cases/conformance/parser/ecmascript5/parserRealSource14.ts(75,32): error TS2694: Namespace 'TypeScript' has no exported member 'AST'. +tests/cases/conformance/parser/ecmascript5/parserRealSource14.ts(79,32): error TS2694: Namespace 'TypeScript' has no exported member 'AST'. +tests/cases/conformance/parser/ecmascript5/parserRealSource14.ts(86,47): error TS2694: Namespace 'TypeScript' has no exported member 'AST'. tests/cases/conformance/parser/ecmascript5/parserRealSource14.ts(94,56): error TS2339: Property 'NodeType' does not exist on type 'typeof TypeScript'. tests/cases/conformance/parser/ecmascript5/parserRealSource14.ts(95,56): error TS2339: Property 'NodeType' does not exist on type 'typeof TypeScript'. -tests/cases/conformance/parser/ecmascript5/parserRealSource14.ts(96,31): error TS2305: Module 'TypeScript' has no exported member 'InterfaceDeclaration'. +tests/cases/conformance/parser/ecmascript5/parserRealSource14.ts(96,31): error TS2694: Namespace 'TypeScript' has no exported member 'InterfaceDeclaration'. tests/cases/conformance/parser/ecmascript5/parserRealSource14.ts(103,56): error TS2339: Property 'NodeType' does not exist on type 'typeof TypeScript'. tests/cases/conformance/parser/ecmascript5/parserRealSource14.ts(104,56): error TS2339: Property 'NodeType' does not exist on type 'typeof TypeScript'. -tests/cases/conformance/parser/ecmascript5/parserRealSource14.ts(105,31): error TS2305: Module 'TypeScript' has no exported member 'InterfaceDeclaration'. +tests/cases/conformance/parser/ecmascript5/parserRealSource14.ts(105,31): error TS2694: Namespace 'TypeScript' has no exported member 'InterfaceDeclaration'. tests/cases/conformance/parser/ecmascript5/parserRealSource14.ts(112,56): error TS2339: Property 'NodeType' does not exist on type 'typeof TypeScript'. tests/cases/conformance/parser/ecmascript5/parserRealSource14.ts(113,56): error TS2339: Property 'NodeType' does not exist on type 'typeof TypeScript'. -tests/cases/conformance/parser/ecmascript5/parserRealSource14.ts(114,31): error TS2305: Module 'TypeScript' has no exported member 'ArgDecl'. +tests/cases/conformance/parser/ecmascript5/parserRealSource14.ts(114,31): error TS2694: Namespace 'TypeScript' has no exported member 'ArgDecl'. tests/cases/conformance/parser/ecmascript5/parserRealSource14.ts(121,56): error TS2339: Property 'NodeType' does not exist on type 'typeof TypeScript'. tests/cases/conformance/parser/ecmascript5/parserRealSource14.ts(122,56): error TS2339: Property 'NodeType' does not exist on type 'typeof TypeScript'. -tests/cases/conformance/parser/ecmascript5/parserRealSource14.ts(123,31): error TS2305: Module 'TypeScript' has no exported member 'VarDecl'. +tests/cases/conformance/parser/ecmascript5/parserRealSource14.ts(123,31): error TS2694: Namespace 'TypeScript' has no exported member 'VarDecl'. tests/cases/conformance/parser/ecmascript5/parserRealSource14.ts(130,56): error TS2339: Property 'NodeType' does not exist on type 'typeof TypeScript'. tests/cases/conformance/parser/ecmascript5/parserRealSource14.ts(131,56): error TS2339: Property 'NodeType' does not exist on type 'typeof TypeScript'. -tests/cases/conformance/parser/ecmascript5/parserRealSource14.ts(132,31): error TS2305: Module 'TypeScript' has no exported member 'ModuleDeclaration'. +tests/cases/conformance/parser/ecmascript5/parserRealSource14.ts(132,31): error TS2694: Namespace 'TypeScript' has no exported member 'ModuleDeclaration'. tests/cases/conformance/parser/ecmascript5/parserRealSource14.ts(139,56): error TS2339: Property 'NodeType' does not exist on type 'typeof TypeScript'. tests/cases/conformance/parser/ecmascript5/parserRealSource14.ts(140,56): error TS2339: Property 'NodeType' does not exist on type 'typeof TypeScript'. -tests/cases/conformance/parser/ecmascript5/parserRealSource14.ts(141,31): error TS2305: Module 'TypeScript' has no exported member 'FuncDecl'. +tests/cases/conformance/parser/ecmascript5/parserRealSource14.ts(141,31): error TS2694: Namespace 'TypeScript' has no exported member 'FuncDecl'. tests/cases/conformance/parser/ecmascript5/parserRealSource14.ts(148,65): error TS2339: Property 'NodeType' does not exist on type 'typeof TypeScript'. tests/cases/conformance/parser/ecmascript5/parserRealSource14.ts(149,65): error TS2339: Property 'NodeType' does not exist on type 'typeof TypeScript'. tests/cases/conformance/parser/ecmascript5/parserRealSource14.ts(156,65): error TS2339: Property 'NodeType' does not exist on type 'typeof TypeScript'. @@ -35,128 +35,128 @@ tests/cases/conformance/parser/ecmascript5/parserRealSource14.ts(172,65): error tests/cases/conformance/parser/ecmascript5/parserRealSource14.ts(173,65): error TS2339: Property 'NodeType' does not exist on type 'typeof TypeScript'. tests/cases/conformance/parser/ecmascript5/parserRealSource14.ts(174,65): error TS2339: Property 'NodeType' does not exist on type 'typeof TypeScript'. tests/cases/conformance/parser/ecmascript5/parserRealSource14.ts(175,65): error TS2339: Property 'NodeType' does not exist on type 'typeof TypeScript'. -tests/cases/conformance/parser/ecmascript5/parserRealSource14.ts(176,31): error TS2305: Module 'TypeScript' has no exported member 'FuncDecl'. -tests/cases/conformance/parser/ecmascript5/parserRealSource14.ts(177,31): error TS2305: Module 'TypeScript' has no exported member 'FuncDecl'. -tests/cases/conformance/parser/ecmascript5/parserRealSource14.ts(178,31): error TS2305: Module 'TypeScript' has no exported member 'ClassDeclaration'. +tests/cases/conformance/parser/ecmascript5/parserRealSource14.ts(176,31): error TS2694: Namespace 'TypeScript' has no exported member 'FuncDecl'. +tests/cases/conformance/parser/ecmascript5/parserRealSource14.ts(177,31): error TS2694: Namespace 'TypeScript' has no exported member 'FuncDecl'. +tests/cases/conformance/parser/ecmascript5/parserRealSource14.ts(178,31): error TS2694: Namespace 'TypeScript' has no exported member 'ClassDeclaration'. tests/cases/conformance/parser/ecmascript5/parserRealSource14.ts(185,65): error TS2339: Property 'NodeType' does not exist on type 'typeof TypeScript'. tests/cases/conformance/parser/ecmascript5/parserRealSource14.ts(186,65): error TS2339: Property 'NodeType' does not exist on type 'typeof TypeScript'. tests/cases/conformance/parser/ecmascript5/parserRealSource14.ts(191,61): error TS2339: Property 'NodeType' does not exist on type 'typeof TypeScript'. tests/cases/conformance/parser/ecmascript5/parserRealSource14.ts(192,28): error TS2339: Property 'hasFlag' does not exist on type 'typeof TypeScript'. -tests/cases/conformance/parser/ecmascript5/parserRealSource14.ts(192,49): error TS2305: Module 'TypeScript' has no exported member 'ModuleDeclaration'. +tests/cases/conformance/parser/ecmascript5/parserRealSource14.ts(192,49): error TS2694: Namespace 'TypeScript' has no exported member 'ModuleDeclaration'. tests/cases/conformance/parser/ecmascript5/parserRealSource14.ts(192,109): error TS2339: Property 'ModuleFlags' does not exist on type 'typeof TypeScript'. tests/cases/conformance/parser/ecmascript5/parserRealSource14.ts(197,65): error TS2339: Property 'NodeType' does not exist on type 'typeof TypeScript'. tests/cases/conformance/parser/ecmascript5/parserRealSource14.ts(198,65): error TS2339: Property 'NodeType' does not exist on type 'typeof TypeScript'. -tests/cases/conformance/parser/ecmascript5/parserRealSource14.ts(199,31): error TS2305: Module 'TypeScript' has no exported member 'ModuleDeclaration'. +tests/cases/conformance/parser/ecmascript5/parserRealSource14.ts(199,31): error TS2694: Namespace 'TypeScript' has no exported member 'ModuleDeclaration'. tests/cases/conformance/parser/ecmascript5/parserRealSource14.ts(200,28): error TS2339: Property 'hasFlag' does not exist on type 'typeof TypeScript'. -tests/cases/conformance/parser/ecmascript5/parserRealSource14.ts(200,49): error TS2305: Module 'TypeScript' has no exported member 'ModuleDeclaration'. +tests/cases/conformance/parser/ecmascript5/parserRealSource14.ts(200,49): error TS2694: Namespace 'TypeScript' has no exported member 'ModuleDeclaration'. tests/cases/conformance/parser/ecmascript5/parserRealSource14.ts(200,113): error TS2339: Property 'ModuleFlags' does not exist on type 'typeof TypeScript'. tests/cases/conformance/parser/ecmascript5/parserRealSource14.ts(205,65): error TS2339: Property 'NodeType' does not exist on type 'typeof TypeScript'. -tests/cases/conformance/parser/ecmascript5/parserRealSource14.ts(206,31): error TS2305: Module 'TypeScript' has no exported member 'Script'. +tests/cases/conformance/parser/ecmascript5/parserRealSource14.ts(206,31): error TS2694: Namespace 'TypeScript' has no exported member 'Script'. tests/cases/conformance/parser/ecmascript5/parserRealSource14.ts(211,65): error TS2339: Property 'NodeType' does not exist on type 'typeof TypeScript'. -tests/cases/conformance/parser/ecmascript5/parserRealSource14.ts(212,31): error TS2305: Module 'TypeScript' has no exported member 'SwitchStatement'. +tests/cases/conformance/parser/ecmascript5/parserRealSource14.ts(212,31): error TS2694: Namespace 'TypeScript' has no exported member 'SwitchStatement'. tests/cases/conformance/parser/ecmascript5/parserRealSource14.ts(217,65): error TS2339: Property 'NodeType' does not exist on type 'typeof TypeScript'. -tests/cases/conformance/parser/ecmascript5/parserRealSource14.ts(218,31): error TS2305: Module 'TypeScript' has no exported member 'ModuleDeclaration'. +tests/cases/conformance/parser/ecmascript5/parserRealSource14.ts(218,31): error TS2694: Namespace 'TypeScript' has no exported member 'ModuleDeclaration'. tests/cases/conformance/parser/ecmascript5/parserRealSource14.ts(223,65): error TS2339: Property 'NodeType' does not exist on type 'typeof TypeScript'. -tests/cases/conformance/parser/ecmascript5/parserRealSource14.ts(224,31): error TS2305: Module 'TypeScript' has no exported member 'ClassDeclaration'. +tests/cases/conformance/parser/ecmascript5/parserRealSource14.ts(224,31): error TS2694: Namespace 'TypeScript' has no exported member 'ClassDeclaration'. tests/cases/conformance/parser/ecmascript5/parserRealSource14.ts(229,65): error TS2339: Property 'NodeType' does not exist on type 'typeof TypeScript'. -tests/cases/conformance/parser/ecmascript5/parserRealSource14.ts(230,31): error TS2305: Module 'TypeScript' has no exported member 'FuncDecl'. +tests/cases/conformance/parser/ecmascript5/parserRealSource14.ts(230,31): error TS2694: Namespace 'TypeScript' has no exported member 'FuncDecl'. tests/cases/conformance/parser/ecmascript5/parserRealSource14.ts(235,65): error TS2339: Property 'NodeType' does not exist on type 'typeof TypeScript'. -tests/cases/conformance/parser/ecmascript5/parserRealSource14.ts(236,31): error TS2305: Module 'TypeScript' has no exported member 'InterfaceDeclaration'. +tests/cases/conformance/parser/ecmascript5/parserRealSource14.ts(236,31): error TS2694: Namespace 'TypeScript' has no exported member 'InterfaceDeclaration'. tests/cases/conformance/parser/ecmascript5/parserRealSource14.ts(241,65): error TS2339: Property 'NodeType' does not exist on type 'typeof TypeScript'. -tests/cases/conformance/parser/ecmascript5/parserRealSource14.ts(242,30): error TS2305: Module 'TypeScript' has no exported member 'Block'. +tests/cases/conformance/parser/ecmascript5/parserRealSource14.ts(242,30): error TS2694: Namespace 'TypeScript' has no exported member 'Block'. tests/cases/conformance/parser/ecmascript5/parserRealSource14.ts(247,65): error TS2339: Property 'NodeType' does not exist on type 'typeof TypeScript'. -tests/cases/conformance/parser/ecmascript5/parserRealSource14.ts(248,30): error TS2305: Module 'TypeScript' has no exported member 'ForStatement'. +tests/cases/conformance/parser/ecmascript5/parserRealSource14.ts(248,30): error TS2694: Namespace 'TypeScript' has no exported member 'ForStatement'. tests/cases/conformance/parser/ecmascript5/parserRealSource14.ts(253,65): error TS2339: Property 'NodeType' does not exist on type 'typeof TypeScript'. -tests/cases/conformance/parser/ecmascript5/parserRealSource14.ts(254,30): error TS2305: Module 'TypeScript' has no exported member 'CaseStatement'. +tests/cases/conformance/parser/ecmascript5/parserRealSource14.ts(254,30): error TS2694: Namespace 'TypeScript' has no exported member 'CaseStatement'. tests/cases/conformance/parser/ecmascript5/parserRealSource14.ts(259,65): error TS2339: Property 'NodeType' does not exist on type 'typeof TypeScript'. -tests/cases/conformance/parser/ecmascript5/parserRealSource14.ts(260,30): error TS2305: Module 'TypeScript' has no exported member 'Try'. +tests/cases/conformance/parser/ecmascript5/parserRealSource14.ts(260,30): error TS2694: Namespace 'TypeScript' has no exported member 'Try'. tests/cases/conformance/parser/ecmascript5/parserRealSource14.ts(265,65): error TS2339: Property 'NodeType' does not exist on type 'typeof TypeScript'. -tests/cases/conformance/parser/ecmascript5/parserRealSource14.ts(266,30): error TS2305: Module 'TypeScript' has no exported member 'Catch'. +tests/cases/conformance/parser/ecmascript5/parserRealSource14.ts(266,30): error TS2694: Namespace 'TypeScript' has no exported member 'Catch'. tests/cases/conformance/parser/ecmascript5/parserRealSource14.ts(271,65): error TS2339: Property 'NodeType' does not exist on type 'typeof TypeScript'. -tests/cases/conformance/parser/ecmascript5/parserRealSource14.ts(272,30): error TS2305: Module 'TypeScript' has no exported member 'DoWhileStatement'. +tests/cases/conformance/parser/ecmascript5/parserRealSource14.ts(272,30): error TS2694: Namespace 'TypeScript' has no exported member 'DoWhileStatement'. tests/cases/conformance/parser/ecmascript5/parserRealSource14.ts(277,65): error TS2339: Property 'NodeType' does not exist on type 'typeof TypeScript'. -tests/cases/conformance/parser/ecmascript5/parserRealSource14.ts(278,30): error TS2305: Module 'TypeScript' has no exported member 'WhileStatement'. +tests/cases/conformance/parser/ecmascript5/parserRealSource14.ts(278,30): error TS2694: Namespace 'TypeScript' has no exported member 'WhileStatement'. tests/cases/conformance/parser/ecmascript5/parserRealSource14.ts(283,65): error TS2339: Property 'NodeType' does not exist on type 'typeof TypeScript'. -tests/cases/conformance/parser/ecmascript5/parserRealSource14.ts(284,30): error TS2305: Module 'TypeScript' has no exported member 'ForInStatement'. +tests/cases/conformance/parser/ecmascript5/parserRealSource14.ts(284,30): error TS2694: Namespace 'TypeScript' has no exported member 'ForInStatement'. tests/cases/conformance/parser/ecmascript5/parserRealSource14.ts(289,65): error TS2339: Property 'NodeType' does not exist on type 'typeof TypeScript'. -tests/cases/conformance/parser/ecmascript5/parserRealSource14.ts(290,30): error TS2305: Module 'TypeScript' has no exported member 'WithStatement'. +tests/cases/conformance/parser/ecmascript5/parserRealSource14.ts(290,30): error TS2694: Namespace 'TypeScript' has no exported member 'WithStatement'. tests/cases/conformance/parser/ecmascript5/parserRealSource14.ts(295,65): error TS2339: Property 'NodeType' does not exist on type 'typeof TypeScript'. -tests/cases/conformance/parser/ecmascript5/parserRealSource14.ts(296,30): error TS2305: Module 'TypeScript' has no exported member 'Finally'. +tests/cases/conformance/parser/ecmascript5/parserRealSource14.ts(296,30): error TS2694: Namespace 'TypeScript' has no exported member 'Finally'. tests/cases/conformance/parser/ecmascript5/parserRealSource14.ts(301,65): error TS2339: Property 'NodeType' does not exist on type 'typeof TypeScript'. tests/cases/conformance/parser/ecmascript5/parserRealSource14.ts(302,65): error TS2339: Property 'NodeType' does not exist on type 'typeof TypeScript'. -tests/cases/conformance/parser/ecmascript5/parserRealSource14.ts(303,30): error TS2305: Module 'TypeScript' has no exported member 'SwitchStatement'. +tests/cases/conformance/parser/ecmascript5/parserRealSource14.ts(303,30): error TS2694: Namespace 'TypeScript' has no exported member 'SwitchStatement'. tests/cases/conformance/parser/ecmascript5/parserRealSource14.ts(308,65): error TS2339: Property 'NodeType' does not exist on type 'typeof TypeScript'. tests/cases/conformance/parser/ecmascript5/parserRealSource14.ts(309,65): error TS2339: Property 'NodeType' does not exist on type 'typeof TypeScript'. -tests/cases/conformance/parser/ecmascript5/parserRealSource14.ts(310,30): error TS2305: Module 'TypeScript' has no exported member 'SwitchStatement'. -tests/cases/conformance/parser/ecmascript5/parserRealSource14.ts(311,30): error TS2305: Module 'TypeScript' has no exported member 'SwitchStatement'. +tests/cases/conformance/parser/ecmascript5/parserRealSource14.ts(310,30): error TS2694: Namespace 'TypeScript' has no exported member 'SwitchStatement'. +tests/cases/conformance/parser/ecmascript5/parserRealSource14.ts(311,30): error TS2694: Namespace 'TypeScript' has no exported member 'SwitchStatement'. tests/cases/conformance/parser/ecmascript5/parserRealSource14.ts(316,65): error TS2339: Property 'NodeType' does not exist on type 'typeof TypeScript'. tests/cases/conformance/parser/ecmascript5/parserRealSource14.ts(317,65): error TS2339: Property 'NodeType' does not exist on type 'typeof TypeScript'. -tests/cases/conformance/parser/ecmascript5/parserRealSource14.ts(318,30): error TS2305: Module 'TypeScript' has no exported member 'UnaryExpression'. +tests/cases/conformance/parser/ecmascript5/parserRealSource14.ts(318,30): error TS2694: Namespace 'TypeScript' has no exported member 'UnaryExpression'. tests/cases/conformance/parser/ecmascript5/parserRealSource14.ts(327,65): error TS2339: Property 'NodeType' does not exist on type 'typeof TypeScript'. tests/cases/conformance/parser/ecmascript5/parserRealSource14.ts(328,65): error TS2339: Property 'NodeType' does not exist on type 'typeof TypeScript'. -tests/cases/conformance/parser/ecmascript5/parserRealSource14.ts(329,30): error TS2305: Module 'TypeScript' has no exported member 'UnaryExpression'. -tests/cases/conformance/parser/ecmascript5/parserRealSource14.ts(330,30): error TS2305: Module 'TypeScript' has no exported member 'ASTList'. +tests/cases/conformance/parser/ecmascript5/parserRealSource14.ts(329,30): error TS2694: Namespace 'TypeScript' has no exported member 'UnaryExpression'. +tests/cases/conformance/parser/ecmascript5/parserRealSource14.ts(330,30): error TS2694: Namespace 'TypeScript' has no exported member 'ASTList'. tests/cases/conformance/parser/ecmascript5/parserRealSource14.ts(335,65): error TS2339: Property 'NodeType' does not exist on type 'typeof TypeScript'. tests/cases/conformance/parser/ecmascript5/parserRealSource14.ts(336,65): error TS2339: Property 'NodeType' does not exist on type 'typeof TypeScript'. tests/cases/conformance/parser/ecmascript5/parserRealSource14.ts(337,65): error TS2339: Property 'NodeType' does not exist on type 'typeof TypeScript'. -tests/cases/conformance/parser/ecmascript5/parserRealSource14.ts(338,30): error TS2305: Module 'TypeScript' has no exported member 'UnaryExpression'. +tests/cases/conformance/parser/ecmascript5/parserRealSource14.ts(338,30): error TS2694: Namespace 'TypeScript' has no exported member 'UnaryExpression'. tests/cases/conformance/parser/ecmascript5/parserRealSource14.ts(343,65): error TS2339: Property 'NodeType' does not exist on type 'typeof TypeScript'. tests/cases/conformance/parser/ecmascript5/parserRealSource14.ts(344,65): error TS2339: Property 'NodeType' does not exist on type 'typeof TypeScript'. tests/cases/conformance/parser/ecmascript5/parserRealSource14.ts(345,65): error TS2339: Property 'NodeType' does not exist on type 'typeof TypeScript'. tests/cases/conformance/parser/ecmascript5/parserRealSource14.ts(346,65): error TS2339: Property 'NodeType' does not exist on type 'typeof TypeScript'. -tests/cases/conformance/parser/ecmascript5/parserRealSource14.ts(347,30): error TS2305: Module 'TypeScript' has no exported member 'UnaryExpression'. +tests/cases/conformance/parser/ecmascript5/parserRealSource14.ts(347,30): error TS2694: Namespace 'TypeScript' has no exported member 'UnaryExpression'. tests/cases/conformance/parser/ecmascript5/parserRealSource14.ts(352,65): error TS2339: Property 'NodeType' does not exist on type 'typeof TypeScript'. tests/cases/conformance/parser/ecmascript5/parserRealSource14.ts(353,65): error TS2339: Property 'NodeType' does not exist on type 'typeof TypeScript'. -tests/cases/conformance/parser/ecmascript5/parserRealSource14.ts(354,30): error TS2305: Module 'TypeScript' has no exported member 'UnaryExpression'. +tests/cases/conformance/parser/ecmascript5/parserRealSource14.ts(354,30): error TS2694: Namespace 'TypeScript' has no exported member 'UnaryExpression'. tests/cases/conformance/parser/ecmascript5/parserRealSource14.ts(359,65): error TS2339: Property 'NodeType' does not exist on type 'typeof TypeScript'. -tests/cases/conformance/parser/ecmascript5/parserRealSource14.ts(360,30): error TS2305: Module 'TypeScript' has no exported member 'BinaryExpression'. +tests/cases/conformance/parser/ecmascript5/parserRealSource14.ts(360,30): error TS2694: Namespace 'TypeScript' has no exported member 'BinaryExpression'. tests/cases/conformance/parser/ecmascript5/parserRealSource14.ts(365,65): error TS2339: Property 'NodeType' does not exist on type 'typeof TypeScript'. -tests/cases/conformance/parser/ecmascript5/parserRealSource14.ts(366,30): error TS2305: Module 'TypeScript' has no exported member 'BinaryExpression'. +tests/cases/conformance/parser/ecmascript5/parserRealSource14.ts(366,30): error TS2694: Namespace 'TypeScript' has no exported member 'BinaryExpression'. tests/cases/conformance/parser/ecmascript5/parserRealSource14.ts(371,65): error TS2339: Property 'NodeType' does not exist on type 'typeof TypeScript'. tests/cases/conformance/parser/ecmascript5/parserRealSource14.ts(377,65): error TS2339: Property 'NodeType' does not exist on type 'typeof TypeScript'. -tests/cases/conformance/parser/ecmascript5/parserRealSource14.ts(378,30): error TS2305: Module 'TypeScript' has no exported member 'IfStatement'. +tests/cases/conformance/parser/ecmascript5/parserRealSource14.ts(378,30): error TS2694: Namespace 'TypeScript' has no exported member 'IfStatement'. tests/cases/conformance/parser/ecmascript5/parserRealSource14.ts(383,65): error TS2339: Property 'NodeType' does not exist on type 'typeof TypeScript'. -tests/cases/conformance/parser/ecmascript5/parserRealSource14.ts(384,30): error TS2305: Module 'TypeScript' has no exported member 'IfStatement'. +tests/cases/conformance/parser/ecmascript5/parserRealSource14.ts(384,30): error TS2694: Namespace 'TypeScript' has no exported member 'IfStatement'. tests/cases/conformance/parser/ecmascript5/parserRealSource14.ts(393,61): error TS2339: Property 'NodeType' does not exist on type 'typeof TypeScript'. -tests/cases/conformance/parser/ecmascript5/parserRealSource14.ts(394,30): error TS2305: Module 'TypeScript' has no exported member 'ASTList'. +tests/cases/conformance/parser/ecmascript5/parserRealSource14.ts(394,30): error TS2694: Namespace 'TypeScript' has no exported member 'ASTList'. tests/cases/conformance/parser/ecmascript5/parserRealSource14.ts(399,65): error TS2339: Property 'NodeType' does not exist on type 'typeof TypeScript'. tests/cases/conformance/parser/ecmascript5/parserRealSource14.ts(400,65): error TS2339: Property 'NodeType' does not exist on type 'typeof TypeScript'. -tests/cases/conformance/parser/ecmascript5/parserRealSource14.ts(401,30): error TS2305: Module 'TypeScript' has no exported member 'FuncDecl'. +tests/cases/conformance/parser/ecmascript5/parserRealSource14.ts(401,30): error TS2694: Namespace 'TypeScript' has no exported member 'FuncDecl'. tests/cases/conformance/parser/ecmascript5/parserRealSource14.ts(406,65): error TS2339: Property 'NodeType' does not exist on type 'typeof TypeScript'. tests/cases/conformance/parser/ecmascript5/parserRealSource14.ts(407,65): error TS2339: Property 'NodeType' does not exist on type 'typeof TypeScript'. -tests/cases/conformance/parser/ecmascript5/parserRealSource14.ts(408,30): error TS2305: Module 'TypeScript' has no exported member 'FuncDecl'. +tests/cases/conformance/parser/ecmascript5/parserRealSource14.ts(408,30): error TS2694: Namespace 'TypeScript' has no exported member 'FuncDecl'. tests/cases/conformance/parser/ecmascript5/parserRealSource14.ts(413,65): error TS2339: Property 'NodeType' does not exist on type 'typeof TypeScript'. tests/cases/conformance/parser/ecmascript5/parserRealSource14.ts(414,65): error TS2339: Property 'NodeType' does not exist on type 'typeof TypeScript'. -tests/cases/conformance/parser/ecmascript5/parserRealSource14.ts(415,30): error TS2305: Module 'TypeScript' has no exported member 'CallExpression'. +tests/cases/conformance/parser/ecmascript5/parserRealSource14.ts(415,30): error TS2694: Namespace 'TypeScript' has no exported member 'CallExpression'. tests/cases/conformance/parser/ecmascript5/parserRealSource14.ts(420,65): error TS2339: Property 'NodeType' does not exist on type 'typeof TypeScript'. tests/cases/conformance/parser/ecmascript5/parserRealSource14.ts(421,65): error TS2339: Property 'NodeType' does not exist on type 'typeof TypeScript'. -tests/cases/conformance/parser/ecmascript5/parserRealSource14.ts(422,30): error TS2305: Module 'TypeScript' has no exported member 'CallExpression'. +tests/cases/conformance/parser/ecmascript5/parserRealSource14.ts(422,30): error TS2694: Namespace 'TypeScript' has no exported member 'CallExpression'. tests/cases/conformance/parser/ecmascript5/parserRealSource14.ts(427,65): error TS2339: Property 'NodeType' does not exist on type 'typeof TypeScript'. -tests/cases/conformance/parser/ecmascript5/parserRealSource14.ts(428,30): error TS2305: Module 'TypeScript' has no exported member 'Block'. -tests/cases/conformance/parser/ecmascript5/parserRealSource14.ts(432,52): error TS2305: Module 'TypeScript' has no exported member 'ASTSpan'. -tests/cases/conformance/parser/ecmascript5/parserRealSource14.ts(462,61): error TS2305: Module 'TypeScript' has no exported member 'AST'. -tests/cases/conformance/parser/ecmascript5/parserRealSource14.ts(463,52): error TS2305: Module 'TypeScript' has no exported member 'Comment'. -tests/cases/conformance/parser/ecmascript5/parserRealSource14.ts(478,45): error TS2305: Module 'TypeScript' has no exported member 'AST'. -tests/cases/conformance/parser/ecmascript5/parserRealSource14.ts(478,69): error TS2305: Module 'TypeScript' has no exported member 'AST'. +tests/cases/conformance/parser/ecmascript5/parserRealSource14.ts(428,30): error TS2694: Namespace 'TypeScript' has no exported member 'Block'. +tests/cases/conformance/parser/ecmascript5/parserRealSource14.ts(432,52): error TS2694: Namespace 'TypeScript' has no exported member 'ASTSpan'. +tests/cases/conformance/parser/ecmascript5/parserRealSource14.ts(462,61): error TS2694: Namespace 'TypeScript' has no exported member 'AST'. +tests/cases/conformance/parser/ecmascript5/parserRealSource14.ts(463,52): error TS2694: Namespace 'TypeScript' has no exported member 'Comment'. +tests/cases/conformance/parser/ecmascript5/parserRealSource14.ts(478,45): error TS2694: Namespace 'TypeScript' has no exported member 'AST'. +tests/cases/conformance/parser/ecmascript5/parserRealSource14.ts(478,69): error TS2694: Namespace 'TypeScript' has no exported member 'AST'. tests/cases/conformance/parser/ecmascript5/parserRealSource14.ts(478,82): error TS2304: Cannot find name 'IAstWalker'. tests/cases/conformance/parser/ecmascript5/parserRealSource14.ts(489,21): error TS2304: Cannot find name 'hasFlag'. tests/cases/conformance/parser/ecmascript5/parserRealSource14.ts(490,49): error TS2339: Property 'NodeType' does not exist on type 'typeof TypeScript'. tests/cases/conformance/parser/ecmascript5/parserRealSource14.ts(516,22): error TS2304: Cannot find name 'hasFlag'. tests/cases/conformance/parser/ecmascript5/parserRealSource14.ts(525,20): error TS2339: Property 'getAstWalkerFactory' does not exist on type 'typeof TypeScript'. -tests/cases/conformance/parser/ecmascript5/parserRealSource14.ts(533,62): error TS2305: Module 'TypeScript' has no exported member 'Script'. -tests/cases/conformance/parser/ecmascript5/parserRealSource14.ts(535,36): error TS2305: Module 'TypeScript' has no exported member 'AST'. -tests/cases/conformance/parser/ecmascript5/parserRealSource14.ts(535,60): error TS2305: Module 'TypeScript' has no exported member 'AST'. -tests/cases/conformance/parser/ecmascript5/parserRealSource14.ts(535,84): error TS2305: Module 'TypeScript' has no exported member 'IAstWalker'. -tests/cases/conformance/parser/ecmascript5/parserRealSource14.ts(535,108): error TS2305: Module 'TypeScript' has no exported member 'AST'. +tests/cases/conformance/parser/ecmascript5/parserRealSource14.ts(533,62): error TS2694: Namespace 'TypeScript' has no exported member 'Script'. +tests/cases/conformance/parser/ecmascript5/parserRealSource14.ts(535,36): error TS2694: Namespace 'TypeScript' has no exported member 'AST'. +tests/cases/conformance/parser/ecmascript5/parserRealSource14.ts(535,60): error TS2694: Namespace 'TypeScript' has no exported member 'AST'. +tests/cases/conformance/parser/ecmascript5/parserRealSource14.ts(535,84): error TS2694: Namespace 'TypeScript' has no exported member 'IAstWalker'. +tests/cases/conformance/parser/ecmascript5/parserRealSource14.ts(535,108): error TS2694: Namespace 'TypeScript' has no exported member 'AST'. tests/cases/conformance/parser/ecmascript5/parserRealSource14.ts(551,20): error TS2339: Property 'getAstWalkerFactory' does not exist on type 'typeof TypeScript'. -tests/cases/conformance/parser/ecmascript5/parserRealSource14.ts(558,45): error TS2305: Module 'TypeScript' has no exported member 'AST'. -tests/cases/conformance/parser/ecmascript5/parserRealSource14.ts(558,95): error TS2305: Module 'TypeScript' has no exported member 'IAstWalker'. -tests/cases/conformance/parser/ecmascript5/parserRealSource14.ts(559,45): error TS2305: Module 'TypeScript' has no exported member 'AST'. -tests/cases/conformance/parser/ecmascript5/parserRealSource14.ts(559,69): error TS2305: Module 'TypeScript' has no exported member 'AST'. -tests/cases/conformance/parser/ecmascript5/parserRealSource14.ts(559,93): error TS2305: Module 'TypeScript' has no exported member 'IAstWalker'. -tests/cases/conformance/parser/ecmascript5/parserRealSource14.ts(565,46): error TS2305: Module 'TypeScript' has no exported member 'AST'. -tests/cases/conformance/parser/ecmascript5/parserRealSource14.ts(565,70): error TS2305: Module 'TypeScript' has no exported member 'AST'. -tests/cases/conformance/parser/ecmascript5/parserRealSource14.ts(565,94): error TS2305: Module 'TypeScript' has no exported member 'IAstWalker'. +tests/cases/conformance/parser/ecmascript5/parserRealSource14.ts(558,45): error TS2694: Namespace 'TypeScript' has no exported member 'AST'. +tests/cases/conformance/parser/ecmascript5/parserRealSource14.ts(558,95): error TS2694: Namespace 'TypeScript' has no exported member 'IAstWalker'. +tests/cases/conformance/parser/ecmascript5/parserRealSource14.ts(559,45): error TS2694: Namespace 'TypeScript' has no exported member 'AST'. +tests/cases/conformance/parser/ecmascript5/parserRealSource14.ts(559,69): error TS2694: Namespace 'TypeScript' has no exported member 'AST'. +tests/cases/conformance/parser/ecmascript5/parserRealSource14.ts(559,93): error TS2694: Namespace 'TypeScript' has no exported member 'IAstWalker'. +tests/cases/conformance/parser/ecmascript5/parserRealSource14.ts(565,46): error TS2694: Namespace 'TypeScript' has no exported member 'AST'. +tests/cases/conformance/parser/ecmascript5/parserRealSource14.ts(565,70): error TS2694: Namespace 'TypeScript' has no exported member 'AST'. +tests/cases/conformance/parser/ecmascript5/parserRealSource14.ts(565,94): error TS2694: Namespace 'TypeScript' has no exported member 'IAstWalker'. tests/cases/conformance/parser/ecmascript5/parserRealSource14.ts(572,20): error TS2339: Property 'getAstWalkerFactory' does not exist on type 'typeof TypeScript'. @@ -188,7 +188,7 @@ tests/cases/conformance/parser/ecmascript5/parserRealSource14.ts(572,20): error export class AstPath { public asts: TypeScript.AST[] = []; ~~~ -!!! error TS2305: Module 'TypeScript' has no exported member 'AST'. +!!! error TS2694: Namespace 'TypeScript' has no exported member 'AST'. public top: number = -1; static reverseIndexOf(items: any[], index: number): any { @@ -204,7 +204,7 @@ tests/cases/conformance/parser/ecmascript5/parserRealSource14.ts(572,20): error public pop(): TypeScript.AST { ~~~ -!!! error TS2305: Module 'TypeScript' has no exported member 'AST'. +!!! error TS2694: Namespace 'TypeScript' has no exported member 'AST'. var head = this.ast(); this.up(); @@ -216,7 +216,7 @@ tests/cases/conformance/parser/ecmascript5/parserRealSource14.ts(572,20): error public push(ast: TypeScript.AST) { ~~~ -!!! error TS2305: Module 'TypeScript' has no exported member 'AST'. +!!! error TS2694: Namespace 'TypeScript' has no exported member 'AST'. while (this.asts.length > this.count()) { this.asts.pop(); } @@ -238,7 +238,7 @@ tests/cases/conformance/parser/ecmascript5/parserRealSource14.ts(572,20): error public nodeType(): TypeScript.NodeType { ~~~~~~~~ -!!! error TS2305: Module 'TypeScript' has no exported member 'NodeType'. +!!! error TS2694: Namespace 'TypeScript' has no exported member 'NodeType'. if (this.ast() == null) return TypeScript.NodeType.None; ~~~~~~~~ @@ -249,13 +249,13 @@ tests/cases/conformance/parser/ecmascript5/parserRealSource14.ts(572,20): error public ast() { return AstPath.reverseIndexOf(this.asts, this.asts.length - (this.top + 1)); ~~~ -!!! error TS2305: Module 'TypeScript' has no exported member 'AST'. +!!! error TS2694: Namespace 'TypeScript' has no exported member 'AST'. } public parent() { return AstPath.reverseIndexOf(this.asts, this.asts.length - this.top); ~~~ -!!! error TS2305: Module 'TypeScript' has no exported member 'AST'. +!!! error TS2694: Namespace 'TypeScript' has no exported member 'AST'. } public count() { @@ -264,7 +264,7 @@ tests/cases/conformance/parser/ecmascript5/parserRealSource14.ts(572,20): error public get(index: number): TypeScript.AST { ~~~ -!!! error TS2305: Module 'TypeScript' has no exported member 'AST'. +!!! error TS2694: Namespace 'TypeScript' has no exported member 'AST'. return this.asts[index]; } @@ -280,7 +280,7 @@ tests/cases/conformance/parser/ecmascript5/parserRealSource14.ts(572,20): error !!! error TS2339: Property 'NodeType' does not exist on type 'typeof TypeScript'. ((this.parent()).name === this.ast()); ~~~~~~~~~~~~~~~~~~~~ -!!! error TS2305: Module 'TypeScript' has no exported member 'InterfaceDeclaration'. +!!! error TS2694: Namespace 'TypeScript' has no exported member 'InterfaceDeclaration'. } public isNameOfInterface(): boolean { @@ -295,7 +295,7 @@ tests/cases/conformance/parser/ecmascript5/parserRealSource14.ts(572,20): error !!! error TS2339: Property 'NodeType' does not exist on type 'typeof TypeScript'. ((this.parent()).name === this.ast()); ~~~~~~~~~~~~~~~~~~~~ -!!! error TS2305: Module 'TypeScript' has no exported member 'InterfaceDeclaration'. +!!! error TS2694: Namespace 'TypeScript' has no exported member 'InterfaceDeclaration'. } public isNameOfArgument(): boolean { @@ -310,7 +310,7 @@ tests/cases/conformance/parser/ecmascript5/parserRealSource14.ts(572,20): error !!! error TS2339: Property 'NodeType' does not exist on type 'typeof TypeScript'. ((this.parent()).id === this.ast()); ~~~~~~~ -!!! error TS2305: Module 'TypeScript' has no exported member 'ArgDecl'. +!!! error TS2694: Namespace 'TypeScript' has no exported member 'ArgDecl'. } public isNameOfVariable(): boolean { @@ -325,7 +325,7 @@ tests/cases/conformance/parser/ecmascript5/parserRealSource14.ts(572,20): error !!! error TS2339: Property 'NodeType' does not exist on type 'typeof TypeScript'. ((this.parent()).id === this.ast()); ~~~~~~~ -!!! error TS2305: Module 'TypeScript' has no exported member 'VarDecl'. +!!! error TS2694: Namespace 'TypeScript' has no exported member 'VarDecl'. } public isNameOfModule(): boolean { @@ -340,7 +340,7 @@ tests/cases/conformance/parser/ecmascript5/parserRealSource14.ts(572,20): error !!! error TS2339: Property 'NodeType' does not exist on type 'typeof TypeScript'. ((this.parent()).name === this.ast()); ~~~~~~~~~~~~~~~~~ -!!! error TS2305: Module 'TypeScript' has no exported member 'ModuleDeclaration'. +!!! error TS2694: Namespace 'TypeScript' has no exported member 'ModuleDeclaration'. } public isNameOfFunction(): boolean { @@ -355,7 +355,7 @@ tests/cases/conformance/parser/ecmascript5/parserRealSource14.ts(572,20): error !!! error TS2339: Property 'NodeType' does not exist on type 'typeof TypeScript'. ((this.parent()).name === this.ast()); ~~~~~~~~ -!!! error TS2305: Module 'TypeScript' has no exported member 'FuncDecl'. +!!! error TS2694: Namespace 'TypeScript' has no exported member 'FuncDecl'. } public isChildOfScript(): boolean { @@ -412,13 +412,13 @@ tests/cases/conformance/parser/ecmascript5/parserRealSource14.ts(572,20): error !!! error TS2339: Property 'NodeType' does not exist on type 'typeof TypeScript'. ((this.asts[this.top - 2]).isConstructor) && ~~~~~~~~ -!!! error TS2305: Module 'TypeScript' has no exported member 'FuncDecl'. +!!! error TS2694: Namespace 'TypeScript' has no exported member 'FuncDecl'. ((this.asts[this.top - 2]).arguments === this.asts[this.top - 1]) && ~~~~~~~~ -!!! error TS2305: Module 'TypeScript' has no exported member 'FuncDecl'. +!!! error TS2694: Namespace 'TypeScript' has no exported member 'FuncDecl'. ((this.asts[this.top - 4]).constructorDecl === this.asts[this.top - 2]); ~~~~~~~~~~~~~~~~ -!!! error TS2305: Module 'TypeScript' has no exported member 'ClassDeclaration'. +!!! error TS2694: Namespace 'TypeScript' has no exported member 'ClassDeclaration'. } public isChildOfInterface(): boolean { @@ -442,7 +442,7 @@ tests/cases/conformance/parser/ecmascript5/parserRealSource14.ts(572,20): error ~~~~~~~ !!! error TS2339: Property 'hasFlag' does not exist on type 'typeof TypeScript'. ~~~~~~~~~~~~~~~~~ -!!! error TS2305: Module 'TypeScript' has no exported member 'ModuleDeclaration'. +!!! error TS2694: Namespace 'TypeScript' has no exported member 'ModuleDeclaration'. ~~~~~~~~~~~ !!! error TS2339: Property 'ModuleFlags' does not exist on type 'typeof TypeScript'. } @@ -457,12 +457,12 @@ tests/cases/conformance/parser/ecmascript5/parserRealSource14.ts(572,20): error !!! error TS2339: Property 'NodeType' does not exist on type 'typeof TypeScript'. (this.asts[this.top - 1]).members == this.asts[this.top - 0] && ~~~~~~~~~~~~~~~~~ -!!! error TS2305: Module 'TypeScript' has no exported member 'ModuleDeclaration'. +!!! error TS2694: Namespace 'TypeScript' has no exported member 'ModuleDeclaration'. TypeScript.hasFlag((this.asts[this.top - 1]).modFlags, TypeScript.ModuleFlags.IsWholeFile); ~~~~~~~ !!! error TS2339: Property 'hasFlag' does not exist on type 'typeof TypeScript'. ~~~~~~~~~~~~~~~~~ -!!! error TS2305: Module 'TypeScript' has no exported member 'ModuleDeclaration'. +!!! error TS2694: Namespace 'TypeScript' has no exported member 'ModuleDeclaration'. ~~~~~~~~~~~ !!! error TS2339: Property 'ModuleFlags' does not exist on type 'typeof TypeScript'. } @@ -474,7 +474,7 @@ tests/cases/conformance/parser/ecmascript5/parserRealSource14.ts(572,20): error !!! error TS2339: Property 'NodeType' does not exist on type 'typeof TypeScript'. (this.asts[this.top - 1]).bod == this.asts[this.top - 0]; ~~~~~~ -!!! error TS2305: Module 'TypeScript' has no exported member 'Script'. +!!! error TS2694: Namespace 'TypeScript' has no exported member 'Script'. } public isBodyOfSwitch(): boolean { @@ -484,7 +484,7 @@ tests/cases/conformance/parser/ecmascript5/parserRealSource14.ts(572,20): error !!! error TS2339: Property 'NodeType' does not exist on type 'typeof TypeScript'. (this.asts[this.top - 1]).caseList == this.asts[this.top - 0]; ~~~~~~~~~~~~~~~ -!!! error TS2305: Module 'TypeScript' has no exported member 'SwitchStatement'. +!!! error TS2694: Namespace 'TypeScript' has no exported member 'SwitchStatement'. } public isBodyOfModule(): boolean { @@ -494,7 +494,7 @@ tests/cases/conformance/parser/ecmascript5/parserRealSource14.ts(572,20): error !!! error TS2339: Property 'NodeType' does not exist on type 'typeof TypeScript'. (this.asts[this.top - 1]).members == this.asts[this.top - 0]; ~~~~~~~~~~~~~~~~~ -!!! error TS2305: Module 'TypeScript' has no exported member 'ModuleDeclaration'. +!!! error TS2694: Namespace 'TypeScript' has no exported member 'ModuleDeclaration'. } public isBodyOfClass(): boolean { @@ -504,7 +504,7 @@ tests/cases/conformance/parser/ecmascript5/parserRealSource14.ts(572,20): error !!! error TS2339: Property 'NodeType' does not exist on type 'typeof TypeScript'. (this.asts[this.top - 1]).members == this.asts[this.top - 0]; ~~~~~~~~~~~~~~~~ -!!! error TS2305: Module 'TypeScript' has no exported member 'ClassDeclaration'. +!!! error TS2694: Namespace 'TypeScript' has no exported member 'ClassDeclaration'. } public isBodyOfFunction(): boolean { @@ -514,7 +514,7 @@ tests/cases/conformance/parser/ecmascript5/parserRealSource14.ts(572,20): error !!! error TS2339: Property 'NodeType' does not exist on type 'typeof TypeScript'. (this.asts[this.top - 1]).bod == this.asts[this.top - 0]; ~~~~~~~~ -!!! error TS2305: Module 'TypeScript' has no exported member 'FuncDecl'. +!!! error TS2694: Namespace 'TypeScript' has no exported member 'FuncDecl'. } public isBodyOfInterface(): boolean { @@ -524,7 +524,7 @@ tests/cases/conformance/parser/ecmascript5/parserRealSource14.ts(572,20): error !!! error TS2339: Property 'NodeType' does not exist on type 'typeof TypeScript'. (this.asts[this.top - 1]).members == this.asts[this.top - 0]; ~~~~~~~~~~~~~~~~~~~~ -!!! error TS2305: Module 'TypeScript' has no exported member 'InterfaceDeclaration'. +!!! error TS2694: Namespace 'TypeScript' has no exported member 'InterfaceDeclaration'. } public isBodyOfBlock(): boolean { @@ -534,7 +534,7 @@ tests/cases/conformance/parser/ecmascript5/parserRealSource14.ts(572,20): error !!! error TS2339: Property 'NodeType' does not exist on type 'typeof TypeScript'. (this.asts[this.top - 1]).statements == this.asts[this.top - 0]; ~~~~~ -!!! error TS2305: Module 'TypeScript' has no exported member 'Block'. +!!! error TS2694: Namespace 'TypeScript' has no exported member 'Block'. } public isBodyOfFor(): boolean { @@ -544,7 +544,7 @@ tests/cases/conformance/parser/ecmascript5/parserRealSource14.ts(572,20): error !!! error TS2339: Property 'NodeType' does not exist on type 'typeof TypeScript'. (this.asts[this.top - 1]).body == this.asts[this.top - 0]; ~~~~~~~~~~~~ -!!! error TS2305: Module 'TypeScript' has no exported member 'ForStatement'. +!!! error TS2694: Namespace 'TypeScript' has no exported member 'ForStatement'. } public isBodyOfCase(): boolean { @@ -554,7 +554,7 @@ tests/cases/conformance/parser/ecmascript5/parserRealSource14.ts(572,20): error !!! error TS2339: Property 'NodeType' does not exist on type 'typeof TypeScript'. (this.asts[this.top - 1]).body == this.asts[this.top - 0]; ~~~~~~~~~~~~~ -!!! error TS2305: Module 'TypeScript' has no exported member 'CaseStatement'. +!!! error TS2694: Namespace 'TypeScript' has no exported member 'CaseStatement'. } public isBodyOfTry(): boolean { @@ -564,7 +564,7 @@ tests/cases/conformance/parser/ecmascript5/parserRealSource14.ts(572,20): error !!! error TS2339: Property 'NodeType' does not exist on type 'typeof TypeScript'. (this.asts[this.top - 1]).body == this.asts[this.top - 0]; ~~~ -!!! error TS2305: Module 'TypeScript' has no exported member 'Try'. +!!! error TS2694: Namespace 'TypeScript' has no exported member 'Try'. } public isBodyOfCatch(): boolean { @@ -574,7 +574,7 @@ tests/cases/conformance/parser/ecmascript5/parserRealSource14.ts(572,20): error !!! error TS2339: Property 'NodeType' does not exist on type 'typeof TypeScript'. (this.asts[this.top - 1]).body == this.asts[this.top - 0]; ~~~~~ -!!! error TS2305: Module 'TypeScript' has no exported member 'Catch'. +!!! error TS2694: Namespace 'TypeScript' has no exported member 'Catch'. } public isBodyOfDoWhile(): boolean { @@ -584,7 +584,7 @@ tests/cases/conformance/parser/ecmascript5/parserRealSource14.ts(572,20): error !!! error TS2339: Property 'NodeType' does not exist on type 'typeof TypeScript'. (this.asts[this.top - 1]).body == this.asts[this.top - 0]; ~~~~~~~~~~~~~~~~ -!!! error TS2305: Module 'TypeScript' has no exported member 'DoWhileStatement'. +!!! error TS2694: Namespace 'TypeScript' has no exported member 'DoWhileStatement'. } public isBodyOfWhile(): boolean { @@ -594,7 +594,7 @@ tests/cases/conformance/parser/ecmascript5/parserRealSource14.ts(572,20): error !!! error TS2339: Property 'NodeType' does not exist on type 'typeof TypeScript'. (this.asts[this.top - 1]).body == this.asts[this.top - 0]; ~~~~~~~~~~~~~~ -!!! error TS2305: Module 'TypeScript' has no exported member 'WhileStatement'. +!!! error TS2694: Namespace 'TypeScript' has no exported member 'WhileStatement'. } public isBodyOfForIn(): boolean { @@ -604,7 +604,7 @@ tests/cases/conformance/parser/ecmascript5/parserRealSource14.ts(572,20): error !!! error TS2339: Property 'NodeType' does not exist on type 'typeof TypeScript'. (this.asts[this.top - 1]).body == this.asts[this.top - 0]; ~~~~~~~~~~~~~~ -!!! error TS2305: Module 'TypeScript' has no exported member 'ForInStatement'. +!!! error TS2694: Namespace 'TypeScript' has no exported member 'ForInStatement'. } public isBodyOfWith(): boolean { @@ -614,7 +614,7 @@ tests/cases/conformance/parser/ecmascript5/parserRealSource14.ts(572,20): error !!! error TS2339: Property 'NodeType' does not exist on type 'typeof TypeScript'. (this.asts[this.top - 1]).body == this.asts[this.top - 0]; ~~~~~~~~~~~~~ -!!! error TS2305: Module 'TypeScript' has no exported member 'WithStatement'. +!!! error TS2694: Namespace 'TypeScript' has no exported member 'WithStatement'. } public isBodyOfFinally(): boolean { @@ -624,7 +624,7 @@ tests/cases/conformance/parser/ecmascript5/parserRealSource14.ts(572,20): error !!! error TS2339: Property 'NodeType' does not exist on type 'typeof TypeScript'. (this.asts[this.top - 1]).body == this.asts[this.top - 0]; ~~~~~~~ -!!! error TS2305: Module 'TypeScript' has no exported member 'Finally'. +!!! error TS2694: Namespace 'TypeScript' has no exported member 'Finally'. } public isCaseOfSwitch(): boolean { @@ -637,7 +637,7 @@ tests/cases/conformance/parser/ecmascript5/parserRealSource14.ts(572,20): error !!! error TS2339: Property 'NodeType' does not exist on type 'typeof TypeScript'. (this.asts[this.top - 2]).caseList == this.asts[this.top - 1]; ~~~~~~~~~~~~~~~ -!!! error TS2305: Module 'TypeScript' has no exported member 'SwitchStatement'. +!!! error TS2694: Namespace 'TypeScript' has no exported member 'SwitchStatement'. } public isDefaultCaseOfSwitch(): boolean { @@ -650,10 +650,10 @@ tests/cases/conformance/parser/ecmascript5/parserRealSource14.ts(572,20): error !!! error TS2339: Property 'NodeType' does not exist on type 'typeof TypeScript'. (this.asts[this.top - 2]).caseList == this.asts[this.top - 1] && ~~~~~~~~~~~~~~~ -!!! error TS2305: Module 'TypeScript' has no exported member 'SwitchStatement'. +!!! error TS2694: Namespace 'TypeScript' has no exported member 'SwitchStatement'. (this.asts[this.top - 2]).defaultCase == this.asts[this.top - 0]; ~~~~~~~~~~~~~~~ -!!! error TS2305: Module 'TypeScript' has no exported member 'SwitchStatement'. +!!! error TS2694: Namespace 'TypeScript' has no exported member 'SwitchStatement'. } public isListOfObjectLit(): boolean { @@ -666,7 +666,7 @@ tests/cases/conformance/parser/ecmascript5/parserRealSource14.ts(572,20): error !!! error TS2339: Property 'NodeType' does not exist on type 'typeof TypeScript'. (this.asts[this.top - 1]).operand == this.asts[this.top - 0]; ~~~~~~~~~~~~~~~ -!!! error TS2305: Module 'TypeScript' has no exported member 'UnaryExpression'. +!!! error TS2694: Namespace 'TypeScript' has no exported member 'UnaryExpression'. } public isBodyOfObjectLit(): boolean { @@ -683,10 +683,10 @@ tests/cases/conformance/parser/ecmascript5/parserRealSource14.ts(572,20): error !!! error TS2339: Property 'NodeType' does not exist on type 'typeof TypeScript'. (this.asts[this.top - 1]).operand == this.asts[this.top - 0] && ~~~~~~~~~~~~~~~ -!!! error TS2305: Module 'TypeScript' has no exported member 'UnaryExpression'. +!!! error TS2694: Namespace 'TypeScript' has no exported member 'UnaryExpression'. (this.asts[this.top - 0]).members.length == 0; ~~~~~~~ -!!! error TS2305: Module 'TypeScript' has no exported member 'ASTList'. +!!! error TS2694: Namespace 'TypeScript' has no exported member 'ASTList'. } public isMemberOfObjectLit(): boolean { @@ -702,7 +702,7 @@ tests/cases/conformance/parser/ecmascript5/parserRealSource14.ts(572,20): error !!! error TS2339: Property 'NodeType' does not exist on type 'typeof TypeScript'. (this.asts[this.top - 2]).operand == this.asts[this.top - 1]; ~~~~~~~~~~~~~~~ -!!! error TS2305: Module 'TypeScript' has no exported member 'UnaryExpression'. +!!! error TS2694: Namespace 'TypeScript' has no exported member 'UnaryExpression'. } public isNameOfMemberOfObjectLit(): boolean { @@ -721,7 +721,7 @@ tests/cases/conformance/parser/ecmascript5/parserRealSource14.ts(572,20): error !!! error TS2339: Property 'NodeType' does not exist on type 'typeof TypeScript'. (this.asts[this.top - 3]).operand == this.asts[this.top - 2]; ~~~~~~~~~~~~~~~ -!!! error TS2305: Module 'TypeScript' has no exported member 'UnaryExpression'. +!!! error TS2694: Namespace 'TypeScript' has no exported member 'UnaryExpression'. } public isListOfArrayLit(): boolean { @@ -734,7 +734,7 @@ tests/cases/conformance/parser/ecmascript5/parserRealSource14.ts(572,20): error !!! error TS2339: Property 'NodeType' does not exist on type 'typeof TypeScript'. (this.asts[this.top - 1]).operand == this.asts[this.top - 0]; ~~~~~~~~~~~~~~~ -!!! error TS2305: Module 'TypeScript' has no exported member 'UnaryExpression'. +!!! error TS2694: Namespace 'TypeScript' has no exported member 'UnaryExpression'. } public isTargetOfMember(): boolean { @@ -744,7 +744,7 @@ tests/cases/conformance/parser/ecmascript5/parserRealSource14.ts(572,20): error !!! error TS2339: Property 'NodeType' does not exist on type 'typeof TypeScript'. (this.asts[this.top - 1]).operand1 === this.asts[this.top - 0]; ~~~~~~~~~~~~~~~~ -!!! error TS2305: Module 'TypeScript' has no exported member 'BinaryExpression'. +!!! error TS2694: Namespace 'TypeScript' has no exported member 'BinaryExpression'. } public isMemberOfMember(): boolean { @@ -754,7 +754,7 @@ tests/cases/conformance/parser/ecmascript5/parserRealSource14.ts(572,20): error !!! error TS2339: Property 'NodeType' does not exist on type 'typeof TypeScript'. (this.asts[this.top - 1]).operand2 === this.asts[this.top - 0]; ~~~~~~~~~~~~~~~~ -!!! error TS2305: Module 'TypeScript' has no exported member 'BinaryExpression'. +!!! error TS2694: Namespace 'TypeScript' has no exported member 'BinaryExpression'. } public isItemOfList(): boolean { @@ -772,7 +772,7 @@ tests/cases/conformance/parser/ecmascript5/parserRealSource14.ts(572,20): error !!! error TS2339: Property 'NodeType' does not exist on type 'typeof TypeScript'. (this.asts[this.top - 1]).thenBod == this.asts[this.top - 0]; ~~~~~~~~~~~ -!!! error TS2305: Module 'TypeScript' has no exported member 'IfStatement'. +!!! error TS2694: Namespace 'TypeScript' has no exported member 'IfStatement'. } public isElseOfIf(): boolean { @@ -782,7 +782,7 @@ tests/cases/conformance/parser/ecmascript5/parserRealSource14.ts(572,20): error !!! error TS2339: Property 'NodeType' does not exist on type 'typeof TypeScript'. (this.asts[this.top - 1]).elseBod == this.asts[this.top - 0]; ~~~~~~~~~~~ -!!! error TS2305: Module 'TypeScript' has no exported member 'IfStatement'. +!!! error TS2694: Namespace 'TypeScript' has no exported member 'IfStatement'. } public isBodyOfDefaultCase(): boolean { @@ -796,7 +796,7 @@ tests/cases/conformance/parser/ecmascript5/parserRealSource14.ts(572,20): error !!! error TS2339: Property 'NodeType' does not exist on type 'typeof TypeScript'. (this.asts[this.top]).members.length === 1; ~~~~~~~ -!!! error TS2305: Module 'TypeScript' has no exported member 'ASTList'. +!!! error TS2694: Namespace 'TypeScript' has no exported member 'ASTList'. } public isArgumentListOfFunction(): boolean { @@ -809,7 +809,7 @@ tests/cases/conformance/parser/ecmascript5/parserRealSource14.ts(572,20): error !!! error TS2339: Property 'NodeType' does not exist on type 'typeof TypeScript'. (this.asts[this.top - 1]).arguments === this.asts[this.top - 0]; ~~~~~~~~ -!!! error TS2305: Module 'TypeScript' has no exported member 'FuncDecl'. +!!! error TS2694: Namespace 'TypeScript' has no exported member 'FuncDecl'. } public isArgumentOfFunction(): boolean { @@ -822,7 +822,7 @@ tests/cases/conformance/parser/ecmascript5/parserRealSource14.ts(572,20): error !!! error TS2339: Property 'NodeType' does not exist on type 'typeof TypeScript'. (this.asts[this.top - 2]).arguments === this.asts[this.top - 1]; ~~~~~~~~ -!!! error TS2305: Module 'TypeScript' has no exported member 'FuncDecl'. +!!! error TS2694: Namespace 'TypeScript' has no exported member 'FuncDecl'. } public isArgumentListOfCall(): boolean { @@ -835,7 +835,7 @@ tests/cases/conformance/parser/ecmascript5/parserRealSource14.ts(572,20): error !!! error TS2339: Property 'NodeType' does not exist on type 'typeof TypeScript'. (this.asts[this.top - 1]).arguments === this.asts[this.top - 0]; ~~~~~~~~~~~~~~ -!!! error TS2305: Module 'TypeScript' has no exported member 'CallExpression'. +!!! error TS2694: Namespace 'TypeScript' has no exported member 'CallExpression'. } public isArgumentListOfNew(): boolean { @@ -848,7 +848,7 @@ tests/cases/conformance/parser/ecmascript5/parserRealSource14.ts(572,20): error !!! error TS2339: Property 'NodeType' does not exist on type 'typeof TypeScript'. (this.asts[this.top - 1]).arguments === this.asts[this.top - 0]; ~~~~~~~~~~~~~~ -!!! error TS2305: Module 'TypeScript' has no exported member 'CallExpression'. +!!! error TS2694: Namespace 'TypeScript' has no exported member 'CallExpression'. } public isSynthesizedBlock(): boolean { @@ -858,13 +858,13 @@ tests/cases/conformance/parser/ecmascript5/parserRealSource14.ts(572,20): error !!! error TS2339: Property 'NodeType' does not exist on type 'typeof TypeScript'. (this.asts[this.top - 0]).isStatementBlock === false; ~~~~~ -!!! error TS2305: Module 'TypeScript' has no exported member 'Block'. +!!! error TS2694: Namespace 'TypeScript' has no exported member 'Block'. } } export function isValidAstNode(ast: TypeScript.ASTSpan): boolean { ~~~~~~~ -!!! error TS2305: Module 'TypeScript' has no exported member 'ASTSpan'. +!!! error TS2694: Namespace 'TypeScript' has no exported member 'ASTSpan'. if (ast === null) return false; @@ -896,10 +896,10 @@ tests/cases/conformance/parser/ecmascript5/parserRealSource14.ts(572,20): error /// export function getAstPathToPosition(script: TypeScript.AST, pos: number, options = GetAstPathOptions.Default): TypeScript.AstPath { ~~~ -!!! error TS2305: Module 'TypeScript' has no exported member 'AST'. +!!! error TS2694: Namespace 'TypeScript' has no exported member 'AST'. var lookInComments = (comments: TypeScript.Comment[]) => { ~~~~~~~ -!!! error TS2305: Module 'TypeScript' has no exported member 'Comment'. +!!! error TS2694: Namespace 'TypeScript' has no exported member 'Comment'. if (comments && comments.length > 0) { for (var i = 0; i < comments.length; i++) { var minChar = comments[i].minChar; @@ -916,9 +916,9 @@ tests/cases/conformance/parser/ecmascript5/parserRealSource14.ts(572,20): error var pre = function (cur: TypeScript.AST, parent: TypeScript.AST, walker: IAstWalker) { ~~~ -!!! error TS2305: Module 'TypeScript' has no exported member 'AST'. +!!! error TS2694: Namespace 'TypeScript' has no exported member 'AST'. ~~~ -!!! error TS2305: Module 'TypeScript' has no exported member 'AST'. +!!! error TS2694: Namespace 'TypeScript' has no exported member 'AST'. ~~~~~~~~~~ !!! error TS2304: Cannot find name 'IAstWalker'. if (isValidAstNode(cur)) { @@ -985,17 +985,17 @@ tests/cases/conformance/parser/ecmascript5/parserRealSource14.ts(572,20): error // export function getTokenizationOffset(script: TypeScript.Script, position: number): number { ~~~~~~ -!!! error TS2305: Module 'TypeScript' has no exported member 'Script'. +!!! error TS2694: Namespace 'TypeScript' has no exported member 'Script'. var bestOffset = 0; var pre = (cur: TypeScript.AST, parent: TypeScript.AST, walker: TypeScript.IAstWalker): TypeScript.AST => { ~~~ -!!! error TS2305: Module 'TypeScript' has no exported member 'AST'. +!!! error TS2694: Namespace 'TypeScript' has no exported member 'AST'. ~~~ -!!! error TS2305: Module 'TypeScript' has no exported member 'AST'. +!!! error TS2694: Namespace 'TypeScript' has no exported member 'AST'. ~~~~~~~~~~ -!!! error TS2305: Module 'TypeScript' has no exported member 'IAstWalker'. +!!! error TS2694: Namespace 'TypeScript' has no exported member 'IAstWalker'. ~~~ -!!! error TS2305: Module 'TypeScript' has no exported member 'AST'. +!!! error TS2694: Namespace 'TypeScript' has no exported member 'AST'. if (TypeScript.isValidAstNode(cur)) { // Did we find a closer offset? if (cur.minChar <= position) { @@ -1022,16 +1022,16 @@ tests/cases/conformance/parser/ecmascript5/parserRealSource14.ts(572,20): error /// export function walkAST(ast: TypeScript.AST, callback: (path: AstPath, walker: TypeScript.IAstWalker) => void ): void { ~~~ -!!! error TS2305: Module 'TypeScript' has no exported member 'AST'. +!!! error TS2694: Namespace 'TypeScript' has no exported member 'AST'. ~~~~~~~~~~ -!!! error TS2305: Module 'TypeScript' has no exported member 'IAstWalker'. +!!! error TS2694: Namespace 'TypeScript' has no exported member 'IAstWalker'. var pre = function (cur: TypeScript.AST, parent: TypeScript.AST, walker: TypeScript.IAstWalker) { ~~~ -!!! error TS2305: Module 'TypeScript' has no exported member 'AST'. +!!! error TS2694: Namespace 'TypeScript' has no exported member 'AST'. ~~~ -!!! error TS2305: Module 'TypeScript' has no exported member 'AST'. +!!! error TS2694: Namespace 'TypeScript' has no exported member 'AST'. ~~~~~~~~~~ -!!! error TS2305: Module 'TypeScript' has no exported member 'IAstWalker'. +!!! error TS2694: Namespace 'TypeScript' has no exported member 'IAstWalker'. var path: TypeScript.AstPath = walker.state; path.push(cur); callback(path, walker); @@ -1039,11 +1039,11 @@ tests/cases/conformance/parser/ecmascript5/parserRealSource14.ts(572,20): error } var post = function (cur: TypeScript.AST, parent: TypeScript.AST, walker: TypeScript.IAstWalker) { ~~~ -!!! error TS2305: Module 'TypeScript' has no exported member 'AST'. +!!! error TS2694: Namespace 'TypeScript' has no exported member 'AST'. ~~~ -!!! error TS2305: Module 'TypeScript' has no exported member 'AST'. +!!! error TS2694: Namespace 'TypeScript' has no exported member 'AST'. ~~~~~~~~~~ -!!! error TS2305: Module 'TypeScript' has no exported member 'IAstWalker'. +!!! error TS2694: Namespace 'TypeScript' has no exported member 'IAstWalker'. var path: TypeScript.AstPath = walker.state; path.pop(); return cur; diff --git a/tests/baselines/reference/parserSbp_7.9_A9_T3.types b/tests/baselines/reference/parserSbp_7.9_A9_T3.types index 5e1eed4dd98..58147a37a67 100644 --- a/tests/baselines/reference/parserSbp_7.9_A9_T3.types +++ b/tests/baselines/reference/parserSbp_7.9_A9_T3.types @@ -13,7 +13,7 @@ do { ; } while (false) true ->false : boolean ->true : boolean +>false : false +>true : true diff --git a/tests/baselines/reference/parserStrictMode16.types b/tests/baselines/reference/parserStrictMode16.types index a7a68ab7811..fbe701f374b 100644 --- a/tests/baselines/reference/parserStrictMode16.types +++ b/tests/baselines/reference/parserStrictMode16.types @@ -1,6 +1,6 @@ === tests/cases/conformance/parser/ecmascript5/StrictMode/parserStrictMode16.ts === "use strict"; ->"use strict" : string +>"use strict" : "use strict" delete this; >delete this : boolean @@ -8,7 +8,7 @@ delete this; delete 1; >delete 1 : boolean ->1 : number +>1 : 1 delete null; >delete null : boolean @@ -16,5 +16,5 @@ delete null; delete "a"; >delete "a" : boolean ->"a" : string +>"a" : "a" diff --git a/tests/baselines/reference/parserStrictMode5.errors.txt b/tests/baselines/reference/parserStrictMode5.errors.txt index 4b3dc48f2b4..e541963a1fb 100644 --- a/tests/baselines/reference/parserStrictMode5.errors.txt +++ b/tests/baselines/reference/parserStrictMode5.errors.txt @@ -1,5 +1,5 @@ tests/cases/conformance/parser/ecmascript5/StrictMode/parserStrictMode5.ts(2,1): error TS1100: Invalid use of 'eval' in strict mode. -tests/cases/conformance/parser/ecmascript5/StrictMode/parserStrictMode5.ts(2,1): error TS2365: Operator '+=' cannot be applied to types '(x: string) => any' and 'number'. +tests/cases/conformance/parser/ecmascript5/StrictMode/parserStrictMode5.ts(2,1): error TS2365: Operator '+=' cannot be applied to types '(x: string) => any' and '1'. ==== tests/cases/conformance/parser/ecmascript5/StrictMode/parserStrictMode5.ts (2 errors) ==== @@ -8,4 +8,4 @@ tests/cases/conformance/parser/ecmascript5/StrictMode/parserStrictMode5.ts(2,1): ~~~~ !!! error TS1100: Invalid use of 'eval' in strict mode. ~~~~~~~~~ -!!! error TS2365: Operator '+=' cannot be applied to types '(x: string) => any' and 'number'. \ No newline at end of file +!!! error TS2365: Operator '+=' cannot be applied to types '(x: string) => any' and '1'. \ No newline at end of file diff --git a/tests/baselines/reference/parserSymbolProperty6.types b/tests/baselines/reference/parserSymbolProperty6.types index a802765cb4f..13553eb27c6 100644 --- a/tests/baselines/reference/parserSymbolProperty6.types +++ b/tests/baselines/reference/parserSymbolProperty6.types @@ -6,5 +6,5 @@ class C { >Symbol.toStringTag : symbol >Symbol : SymbolConstructor >toStringTag : symbol ->"" : string +>"" : "" } diff --git a/tests/baselines/reference/parserTernaryAndCommaOperators1.errors.txt b/tests/baselines/reference/parserTernaryAndCommaOperators1.errors.txt index 3efccba3359..38b163f3188 100644 --- a/tests/baselines/reference/parserTernaryAndCommaOperators1.errors.txt +++ b/tests/baselines/reference/parserTernaryAndCommaOperators1.errors.txt @@ -1,12 +1,15 @@ tests/cases/conformance/parser/ecmascript5/RegressionTests/parserTernaryAndCommaOperators1.ts(1,1): error TS2304: Cannot find name 'b'. +tests/cases/conformance/parser/ecmascript5/RegressionTests/parserTernaryAndCommaOperators1.ts(1,1): error TS2695: Left side of comma operator is unused and has no side effects. tests/cases/conformance/parser/ecmascript5/RegressionTests/parserTernaryAndCommaOperators1.ts(1,16): error TS2304: Cannot find name 'c'. tests/cases/conformance/parser/ecmascript5/RegressionTests/parserTernaryAndCommaOperators1.ts(1,21): error TS2304: Cannot find name 'd'. -==== tests/cases/conformance/parser/ecmascript5/RegressionTests/parserTernaryAndCommaOperators1.ts (3 errors) ==== +==== tests/cases/conformance/parser/ecmascript5/RegressionTests/parserTernaryAndCommaOperators1.ts (4 errors) ==== b.src ? 1 : 2, c && d; ~ !!! error TS2304: Cannot find name 'b'. + ~~~~~~~~~~~~~ +!!! error TS2695: Left side of comma operator is unused and has no side effects. ~ !!! error TS2304: Cannot find name 'c'. ~ diff --git a/tests/baselines/reference/parserUnicode2.types b/tests/baselines/reference/parserUnicode2.types index 1051b23905f..5e25bef8306 100644 --- a/tests/baselines/reference/parserUnicode2.types +++ b/tests/baselines/reference/parserUnicode2.types @@ -1,5 +1,5 @@ === tests/cases/conformance/parser/ecmascript5/parserUnicode2.ts === var 才能ソЫⅨ蒤郳र्क्ड्राüışğİliيونيكودöÄüß才能ソЫⅨ蒤郳र्क्ड्राüışğİliيونيكودöÄüßAbcd123 = 1; >才能ソЫⅨ蒤郳र्क्ड्राüışğİliيونيكودöÄüß才能ソЫⅨ蒤郳र्क्ड्राüışğİliيونيكودöÄüßAbcd123 : number ->1 : number +>1 : 1 diff --git a/tests/baselines/reference/parserVoidExpression1.types b/tests/baselines/reference/parserVoidExpression1.types index a2d9988eee3..a4495f987e6 100644 --- a/tests/baselines/reference/parserVoidExpression1.types +++ b/tests/baselines/reference/parserVoidExpression1.types @@ -1,5 +1,5 @@ === tests/cases/conformance/parser/ecmascript5/parserVoidExpression1.ts === void 0; >void 0 : undefined ->0 : number +>0 : 0 diff --git a/tests/baselines/reference/parser_breakInIterationOrSwitchStatement1.types b/tests/baselines/reference/parser_breakInIterationOrSwitchStatement1.types index 6688f334a86..d00c1e6f708 100644 --- a/tests/baselines/reference/parser_breakInIterationOrSwitchStatement1.types +++ b/tests/baselines/reference/parser_breakInIterationOrSwitchStatement1.types @@ -1,6 +1,6 @@ === tests/cases/conformance/parser/ecmascript5/Statements/BreakStatements/parser_breakInIterationOrSwitchStatement1.ts === while (true) { ->true : boolean +>true : true break; } diff --git a/tests/baselines/reference/parser_breakInIterationOrSwitchStatement2.types b/tests/baselines/reference/parser_breakInIterationOrSwitchStatement2.types index 7def75c322a..1d490ef1040 100644 --- a/tests/baselines/reference/parser_breakInIterationOrSwitchStatement2.types +++ b/tests/baselines/reference/parser_breakInIterationOrSwitchStatement2.types @@ -3,5 +3,5 @@ do { break; } while (true); ->true : boolean +>true : true diff --git a/tests/baselines/reference/parser_breakTarget2.types b/tests/baselines/reference/parser_breakTarget2.types index 8a1e7a991db..550a3d39de3 100644 --- a/tests/baselines/reference/parser_breakTarget2.types +++ b/tests/baselines/reference/parser_breakTarget2.types @@ -3,7 +3,7 @@ target: >target : any while (true) { ->true : boolean +>true : true break target; >target : any diff --git a/tests/baselines/reference/parser_breakTarget3.types b/tests/baselines/reference/parser_breakTarget3.types index b1ce9f8d94d..eb5c2cf68a5 100644 --- a/tests/baselines/reference/parser_breakTarget3.types +++ b/tests/baselines/reference/parser_breakTarget3.types @@ -7,7 +7,7 @@ target2: >target2 : any while (true) { ->true : boolean +>true : true break target1; >target1 : any diff --git a/tests/baselines/reference/parser_breakTarget4.types b/tests/baselines/reference/parser_breakTarget4.types index 04bb129c919..3a368eeb6c9 100644 --- a/tests/baselines/reference/parser_breakTarget4.types +++ b/tests/baselines/reference/parser_breakTarget4.types @@ -7,7 +7,7 @@ target2: >target2 : any while (true) { ->true : boolean +>true : true break target2; >target2 : any diff --git a/tests/baselines/reference/parser_continueInIterationStatement1.types b/tests/baselines/reference/parser_continueInIterationStatement1.types index c6819ba2c18..0e1bd38266c 100644 --- a/tests/baselines/reference/parser_continueInIterationStatement1.types +++ b/tests/baselines/reference/parser_continueInIterationStatement1.types @@ -1,6 +1,6 @@ === tests/cases/conformance/parser/ecmascript5/Statements/ContinueStatements/parser_continueInIterationStatement1.ts === while (true) { ->true : boolean +>true : true continue; } diff --git a/tests/baselines/reference/parser_continueInIterationStatement2.types b/tests/baselines/reference/parser_continueInIterationStatement2.types index ead70157de4..701f5e5ffaf 100644 --- a/tests/baselines/reference/parser_continueInIterationStatement2.types +++ b/tests/baselines/reference/parser_continueInIterationStatement2.types @@ -3,5 +3,5 @@ do { continue; } while (true); ->true : boolean +>true : true diff --git a/tests/baselines/reference/parser_continueLabel.types b/tests/baselines/reference/parser_continueLabel.types index a8a240ac18b..24f1ed509de 100644 --- a/tests/baselines/reference/parser_continueLabel.types +++ b/tests/baselines/reference/parser_continueLabel.types @@ -2,10 +2,10 @@ label1: for(var i = 0; i < 1; i++) { >label1 : any >i : number ->0 : number +>0 : 0 >i < 1 : boolean >i : number ->1 : number +>1 : 1 >i++ : number >i : number diff --git a/tests/baselines/reference/parser_continueTarget2.types b/tests/baselines/reference/parser_continueTarget2.types index ba01f3b8927..0dc073fda3f 100644 --- a/tests/baselines/reference/parser_continueTarget2.types +++ b/tests/baselines/reference/parser_continueTarget2.types @@ -3,7 +3,7 @@ target: >target : any while (true) { ->true : boolean +>true : true continue target; >target : any diff --git a/tests/baselines/reference/parser_continueTarget3.types b/tests/baselines/reference/parser_continueTarget3.types index fd8aedc357f..273c47f97cf 100644 --- a/tests/baselines/reference/parser_continueTarget3.types +++ b/tests/baselines/reference/parser_continueTarget3.types @@ -7,7 +7,7 @@ target2: >target2 : any while (true) { ->true : boolean +>true : true continue target1; >target1 : any diff --git a/tests/baselines/reference/parser_continueTarget4.types b/tests/baselines/reference/parser_continueTarget4.types index be1e5458f4b..21381823e7c 100644 --- a/tests/baselines/reference/parser_continueTarget4.types +++ b/tests/baselines/reference/parser_continueTarget4.types @@ -7,7 +7,7 @@ target2: >target2 : any while (true) { ->true : boolean +>true : true continue target2; >target2 : any diff --git a/tests/baselines/reference/parser_duplicateLabel3.types b/tests/baselines/reference/parser_duplicateLabel3.types index 88ea435bf3e..8d62ee2a14d 100644 --- a/tests/baselines/reference/parser_duplicateLabel3.types +++ b/tests/baselines/reference/parser_duplicateLabel3.types @@ -4,7 +4,7 @@ target: >target : any while (true) { ->true : boolean +>true : true function f() { >f : () => void @@ -13,7 +13,7 @@ while (true) { >target : any while (true) { ->true : boolean +>true : true } } } diff --git a/tests/baselines/reference/parser_duplicateLabel4.types b/tests/baselines/reference/parser_duplicateLabel4.types index b70dd12c695..483cf8a0051 100644 --- a/tests/baselines/reference/parser_duplicateLabel4.types +++ b/tests/baselines/reference/parser_duplicateLabel4.types @@ -4,12 +4,12 @@ target: >target : any while (true) { ->true : boolean +>true : true } target: >target : any while (true) { ->true : boolean +>true : true } diff --git a/tests/baselines/reference/parserharness.errors.txt b/tests/baselines/reference/parserharness.errors.txt index fd9ad6d3a10..d3d0c4056a1 100644 --- a/tests/baselines/reference/parserharness.errors.txt +++ b/tests/baselines/reference/parserharness.errors.txt @@ -2,7 +2,7 @@ tests/cases/conformance/parser/ecmascript5/RealWorld/parserharness.ts(16,1): err tests/cases/conformance/parser/ecmascript5/RealWorld/parserharness.ts(17,1): error TS6053: File 'tests/cases/conformance/parser/ecmascript5/compiler/typescript.ts' not found. tests/cases/conformance/parser/ecmascript5/RealWorld/parserharness.ts(18,1): error TS6053: File 'tests/cases/conformance/parser/ecmascript5/services/typescriptServices.ts' not found. tests/cases/conformance/parser/ecmascript5/RealWorld/parserharness.ts(19,1): error TS6053: File 'tests/cases/conformance/parser/ecmascript5/RealWorld/diff.ts' not found. -tests/cases/conformance/parser/ecmascript5/RealWorld/parserharness.ts(21,29): error TS2305: Module 'Harness' has no exported member 'Assert'. +tests/cases/conformance/parser/ecmascript5/RealWorld/parserharness.ts(21,29): error TS2694: Namespace 'Harness' has no exported member 'Assert'. tests/cases/conformance/parser/ecmascript5/RealWorld/parserharness.ts(25,17): error TS2304: Cannot find name 'IIO'. tests/cases/conformance/parser/ecmascript5/RealWorld/parserharness.ts(41,12): error TS2304: Cannot find name 'ActiveXObject'. tests/cases/conformance/parser/ecmascript5/RealWorld/parserharness.ts(43,19): error TS2304: Cannot find name 'require'. @@ -141,7 +141,7 @@ tests/cases/conformance/parser/ecmascript5/RealWorld/parserharness.ts(2030,32): declare var assert: Harness.Assert; ~~~~~~ -!!! error TS2305: Module 'Harness' has no exported member 'Assert'. +!!! error TS2694: Namespace 'Harness' has no exported member 'Assert'. declare var it; declare var describe; declare var run; diff --git a/tests/baselines/reference/pathMappingBasedModuleResolution3_classic.types b/tests/baselines/reference/pathMappingBasedModuleResolution3_classic.types index 359811ff3b2..17f93932265 100644 --- a/tests/baselines/reference/pathMappingBasedModuleResolution3_classic.types +++ b/tests/baselines/reference/pathMappingBasedModuleResolution3_classic.types @@ -35,10 +35,10 @@ export var x = a + b; === c:/root/folder2/file3.ts === export var x = 1; >x : number ->1 : number +>1 : 1 === c:/file4.ts === export var y = 100; >y : number ->100 : number +>100 : 100 diff --git a/tests/baselines/reference/pathMappingBasedModuleResolution3_node.types b/tests/baselines/reference/pathMappingBasedModuleResolution3_node.types index 78597cf50ef..2c85b8ebcbd 100644 --- a/tests/baselines/reference/pathMappingBasedModuleResolution3_node.types +++ b/tests/baselines/reference/pathMappingBasedModuleResolution3_node.types @@ -35,7 +35,7 @@ export var x = a + b; === c:/root/folder2/file3.ts === export var x = 1; >x : number ->1 : number +>1 : 1 === c:/node_modules/file4/index.d.ts === export var y: number; diff --git a/tests/baselines/reference/pathMappingBasedModuleResolution4_classic.types b/tests/baselines/reference/pathMappingBasedModuleResolution4_classic.types index d225246e2f9..6cb2db1bc5c 100644 --- a/tests/baselines/reference/pathMappingBasedModuleResolution4_classic.types +++ b/tests/baselines/reference/pathMappingBasedModuleResolution4_classic.types @@ -32,10 +32,10 @@ export var x = a + b; === c:/root/folder2/file3.ts === export var x = 1; >x : number ->1 : number +>1 : 1 === c:/file4.ts === export var y = 100; >y : number ->100 : number +>100 : 100 diff --git a/tests/baselines/reference/pathMappingBasedModuleResolution4_node.types b/tests/baselines/reference/pathMappingBasedModuleResolution4_node.types index 5478a601f02..871446b5ebb 100644 --- a/tests/baselines/reference/pathMappingBasedModuleResolution4_node.types +++ b/tests/baselines/reference/pathMappingBasedModuleResolution4_node.types @@ -32,7 +32,7 @@ export var x = a + b; === c:/root/folder2/file3.ts === export var x = 1; >x : number ->1 : number +>1 : 1 === c:/node_modules/file4/index.d.ts === export var y: number; diff --git a/tests/baselines/reference/pathMappingBasedModuleResolution5_classic.types b/tests/baselines/reference/pathMappingBasedModuleResolution5_classic.types index 32a1f42bc0f..7a15355b157 100644 --- a/tests/baselines/reference/pathMappingBasedModuleResolution5_classic.types +++ b/tests/baselines/reference/pathMappingBasedModuleResolution5_classic.types @@ -50,20 +50,20 @@ use(z1.toExponential()); === c:/root/folder2/file1.ts === export var x = 1; >x : number ->1 : number +>1 : 1 === c:/root/generated/folder3/file2.ts === export var y = 1; >y : number ->1 : number +>1 : 1 === c:/root/shared/components/file3.ts === export var z = 1; >z : number ->1 : number +>1 : 1 === c:/file4.ts === export var z1 = 1; >z1 : number ->1 : number +>1 : 1 diff --git a/tests/baselines/reference/pathMappingBasedModuleResolution5_node.types b/tests/baselines/reference/pathMappingBasedModuleResolution5_node.types index 1b96e3f4f22..2cdc99dcd8c 100644 --- a/tests/baselines/reference/pathMappingBasedModuleResolution5_node.types +++ b/tests/baselines/reference/pathMappingBasedModuleResolution5_node.types @@ -50,12 +50,12 @@ use(z1.toExponential()); === c:/root/folder2/file1.ts === export var x = 1; >x : number ->1 : number +>1 : 1 === c:/root/generated/folder3/file2.ts === export var y = 1; >y : number ->1 : number +>1 : 1 === c:/root/shared/components/file3/index.d.ts === export var z: number; @@ -64,5 +64,5 @@ export var z: number; === c:/node_modules/file4.ts === export var z1 = 1; >z1 : number ->1 : number +>1 : 1 diff --git a/tests/baselines/reference/pathMappingBasedModuleResolution7_classic.trace.json b/tests/baselines/reference/pathMappingBasedModuleResolution7_classic.trace.json index 2d72108210e..a8cadb8f067 100644 --- a/tests/baselines/reference/pathMappingBasedModuleResolution7_classic.trace.json +++ b/tests/baselines/reference/pathMappingBasedModuleResolution7_classic.trace.json @@ -14,7 +14,7 @@ "======== Module name './project/file2' was successfully resolved to 'c:/root/generated/src/project/file2.ts'. ========", "======== Resolving module 'module3' from 'c:/root/src/file1.ts'. ========", "Module resolution kind is not specified, using 'Classic'.", - "'baseUrl' option is set to 'c:/root', using this value to resolve non-relative module name 'module3'", + "'baseUrl' option is set to 'c:/root/', using this value to resolve non-relative module name 'module3'", "'paths' option is specified, looking for a pattern to match module name 'module3'.", "Module name 'module3', matched pattern '*'.", "Trying substitution '*', candidate module location: 'module3'.", @@ -32,7 +32,7 @@ "======== Module name 'module3' was successfully resolved to 'c:/module3.d.ts'. ========", "======== Resolving module 'module1' from 'c:/root/generated/src/project/file2.ts'. ========", "Module resolution kind is not specified, using 'Classic'.", - "'baseUrl' option is set to 'c:/root', using this value to resolve non-relative module name 'module1'", + "'baseUrl' option is set to 'c:/root/', using this value to resolve non-relative module name 'module1'", "'paths' option is specified, looking for a pattern to match module name 'module1'.", "Module name 'module1', matched pattern '*'.", "Trying substitution '*', candidate module location: 'module1'.", @@ -44,7 +44,7 @@ "======== Module name 'module1' was successfully resolved to 'c:/shared/module1.d.ts'. ========", "======== Resolving module 'templates/module2' from 'c:/root/generated/src/project/file2.ts'. ========", "Module resolution kind is not specified, using 'Classic'.", - "'baseUrl' option is set to 'c:/root', using this value to resolve non-relative module name 'templates/module2'", + "'baseUrl' option is set to 'c:/root/', using this value to resolve non-relative module name 'templates/module2'", "'paths' option is specified, looking for a pattern to match module name 'templates/module2'.", "Module name 'templates/module2', matched pattern 'templates/*'.", "Trying substitution 'generated/src/templates/*', candidate module location: 'generated/src/templates/module2'.", diff --git a/tests/baselines/reference/pathMappingBasedModuleResolution7_node.trace.json b/tests/baselines/reference/pathMappingBasedModuleResolution7_node.trace.json index 6be7d349fed..48633c85e3b 100644 --- a/tests/baselines/reference/pathMappingBasedModuleResolution7_node.trace.json +++ b/tests/baselines/reference/pathMappingBasedModuleResolution7_node.trace.json @@ -22,7 +22,7 @@ "======== Module name './project/file2' was successfully resolved to 'c:/root/generated/src/project/file2.ts'. ========", "======== Resolving module 'module3' from 'c:/root/src/file1.ts'. ========", "Module resolution kind is not specified, using 'NodeJs'.", - "'baseUrl' option is set to 'c:/root', using this value to resolve non-relative module name 'module3'", + "'baseUrl' option is set to 'c:/root/', using this value to resolve non-relative module name 'module3'", "'paths' option is specified, looking for a pattern to match module name 'module3'.", "Module name 'module3', matched pattern '*'.", "Trying substitution '*', candidate module location: 'module3'.", @@ -79,7 +79,7 @@ "======== Module name 'module3' was successfully resolved to 'c:/node_modules/module3.d.ts'. ========", "======== Resolving module 'module1' from 'c:/root/generated/src/project/file2.ts'. ========", "Module resolution kind is not specified, using 'NodeJs'.", - "'baseUrl' option is set to 'c:/root', using this value to resolve non-relative module name 'module1'", + "'baseUrl' option is set to 'c:/root/', using this value to resolve non-relative module name 'module1'", "'paths' option is specified, looking for a pattern to match module name 'module1'.", "Module name 'module1', matched pattern '*'.", "Trying substitution '*', candidate module location: 'module1'.", @@ -104,7 +104,7 @@ "======== Module name 'module1' was successfully resolved to 'c:/shared/module1/index.d.ts'. ========", "======== Resolving module 'templates/module2' from 'c:/root/generated/src/project/file2.ts'. ========", "Module resolution kind is not specified, using 'NodeJs'.", - "'baseUrl' option is set to 'c:/root', using this value to resolve non-relative module name 'templates/module2'", + "'baseUrl' option is set to 'c:/root/', using this value to resolve non-relative module name 'templates/module2'", "'paths' option is specified, looking for a pattern to match module name 'templates/module2'.", "Module name 'templates/module2', matched pattern 'templates/*'.", "Trying substitution 'generated/src/templates/*', candidate module location: 'generated/src/templates/module2'.", diff --git a/tests/baselines/reference/plusOperatorWithAnyOtherType.errors.txt b/tests/baselines/reference/plusOperatorWithAnyOtherType.errors.txt index bc76e073234..6c0f113b17b 100644 --- a/tests/baselines/reference/plusOperatorWithAnyOtherType.errors.txt +++ b/tests/baselines/reference/plusOperatorWithAnyOtherType.errors.txt @@ -1,9 +1,10 @@ tests/cases/conformance/expressions/unaryOperators/plusOperator/plusOperatorWithAnyOtherType.ts(46,26): error TS2365: Operator '+' cannot be applied to types 'undefined' and 'undefined'. tests/cases/conformance/expressions/unaryOperators/plusOperator/plusOperatorWithAnyOtherType.ts(47,26): error TS2365: Operator '+' cannot be applied to types 'null' and 'null'. tests/cases/conformance/expressions/unaryOperators/plusOperator/plusOperatorWithAnyOtherType.ts(48,26): error TS2365: Operator '+' cannot be applied to types 'undefined' and 'undefined'. +tests/cases/conformance/expressions/unaryOperators/plusOperator/plusOperatorWithAnyOtherType.ts(54,1): error TS2695: Left side of comma operator is unused and has no side effects. -==== tests/cases/conformance/expressions/unaryOperators/plusOperator/plusOperatorWithAnyOtherType.ts (3 errors) ==== +==== tests/cases/conformance/expressions/unaryOperators/plusOperator/plusOperatorWithAnyOtherType.ts (4 errors) ==== // + operator on any type var ANY: any; @@ -64,5 +65,7 @@ tests/cases/conformance/expressions/unaryOperators/plusOperator/plusOperatorWith +ANY1; +ANY2[0]; +ANY, ANY1; + ~~~~ +!!! error TS2695: Left side of comma operator is unused and has no side effects. +objA.a; +M.n; \ No newline at end of file diff --git a/tests/baselines/reference/plusOperatorWithBooleanType.errors.txt b/tests/baselines/reference/plusOperatorWithBooleanType.errors.txt new file mode 100644 index 00000000000..4a27aa50e05 --- /dev/null +++ b/tests/baselines/reference/plusOperatorWithBooleanType.errors.txt @@ -0,0 +1,41 @@ +tests/cases/conformance/expressions/unaryOperators/plusOperator/plusOperatorWithBooleanType.ts(33,1): error TS2695: Left side of comma operator is unused and has no side effects. + + +==== tests/cases/conformance/expressions/unaryOperators/plusOperator/plusOperatorWithBooleanType.ts (1 errors) ==== + // + operator on boolean type + var BOOLEAN: boolean; + + function foo(): boolean { return true; } + + class A { + public a: boolean; + static foo() { return false; } + } + module M { + export var n: boolean; + } + + var objA = new A(); + + // boolean type var + var ResultIsNumber1 = +BOOLEAN; + + // 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(); + + // miss assignment operators + +true; + +BOOLEAN; + +foo(); + +true, false; + ~~~~~ +!!! error TS2695: Left side of comma operator is unused and has no side effects. + +objA.a; + +M.n; \ No newline at end of file diff --git a/tests/baselines/reference/plusOperatorWithBooleanType.types b/tests/baselines/reference/plusOperatorWithBooleanType.types index d2218d3cc95..8fd2ee350eb 100644 --- a/tests/baselines/reference/plusOperatorWithBooleanType.types +++ b/tests/baselines/reference/plusOperatorWithBooleanType.types @@ -5,7 +5,7 @@ var BOOLEAN: boolean; function foo(): boolean { return true; } >foo : () => boolean ->true : boolean +>true : true class A { >A : A @@ -15,7 +15,7 @@ class A { static foo() { return false; } >foo : () => boolean ->false : boolean +>false : false } module M { >M : typeof M @@ -39,16 +39,16 @@ var ResultIsNumber1 = +BOOLEAN; var ResultIsNumber2 = +true; >ResultIsNumber2 : number >+true : number ->true : boolean +>true : true var ResultIsNumber3 = +{ x: true, y: false }; >ResultIsNumber3 : number >+{ x: true, y: false } : number >{ x: true, y: false } : { x: boolean; y: boolean; } >x : boolean ->true : boolean +>true : true >y : boolean ->false : boolean +>false : false // boolean type expressions var ResultIsNumber4 = +objA.a; @@ -82,7 +82,7 @@ var ResultIsNumber7 = +A.foo(); // miss assignment operators +true; >+true : number ->true : boolean +>true : true +BOOLEAN; >+BOOLEAN : number @@ -94,10 +94,10 @@ var ResultIsNumber7 = +A.foo(); >foo : () => boolean +true, false; ->+true, false : boolean +>+true, false : false >+true : number ->true : boolean ->false : boolean +>true : true +>false : false +objA.a; >+objA.a : number diff --git a/tests/baselines/reference/plusOperatorWithEnumType.errors.txt b/tests/baselines/reference/plusOperatorWithEnumType.errors.txt new file mode 100644 index 00000000000..a7fed5b29a4 --- /dev/null +++ b/tests/baselines/reference/plusOperatorWithEnumType.errors.txt @@ -0,0 +1,24 @@ +tests/cases/conformance/expressions/unaryOperators/plusOperator/plusOperatorWithEnumType.ts(18,1): error TS2695: Left side of comma operator is unused and has no side effects. + + +==== tests/cases/conformance/expressions/unaryOperators/plusOperator/plusOperatorWithEnumType.ts (1 errors) ==== + // + operator on enum type + + enum ENUM { }; + enum ENUM1 { A, B, "" }; + + // enum type var + var ResultIsNumber1 = +ENUM; + var ResultIsNumber2 = +ENUM1; + + // enum type expressions + var ResultIsNumber3 = +ENUM1["A"]; + var ResultIsNumber4 = +(ENUM[0] + ENUM1["B"]); + + // miss assignment operators + +ENUM; + +ENUM1; + +ENUM1.B; + +ENUM, ENUM1; + ~~~~~ +!!! error TS2695: Left side of comma operator is unused and has no side effects. \ No newline at end of file diff --git a/tests/baselines/reference/plusOperatorWithEnumType.types b/tests/baselines/reference/plusOperatorWithEnumType.types index e6dd769900e..f0b7df10756 100644 --- a/tests/baselines/reference/plusOperatorWithEnumType.types +++ b/tests/baselines/reference/plusOperatorWithEnumType.types @@ -6,8 +6,8 @@ enum ENUM { }; enum ENUM1 { A, B, "" }; >ENUM1 : ENUM1 ->A : ENUM1 ->B : ENUM1 +>A : ENUM1.A +>B : ENUM1.B // enum type var var ResultIsNumber1 = +ENUM; @@ -24,9 +24,9 @@ var ResultIsNumber2 = +ENUM1; var ResultIsNumber3 = +ENUM1["A"]; >ResultIsNumber3 : number >+ENUM1["A"] : number ->ENUM1["A"] : ENUM1 +>ENUM1["A"] : ENUM1.A >ENUM1 : typeof ENUM1 ->"A" : string +>"A" : "A" var ResultIsNumber4 = +(ENUM[0] + ENUM1["B"]); >ResultIsNumber4 : number @@ -35,10 +35,10 @@ var ResultIsNumber4 = +(ENUM[0] + ENUM1["B"]); >ENUM[0] + ENUM1["B"] : string >ENUM[0] : string >ENUM : typeof ENUM ->0 : number ->ENUM1["B"] : ENUM1 +>0 : 0 +>ENUM1["B"] : ENUM1.B >ENUM1 : typeof ENUM1 ->"B" : string +>"B" : "B" // miss assignment operators +ENUM; @@ -51,9 +51,9 @@ var ResultIsNumber4 = +(ENUM[0] + ENUM1["B"]); +ENUM1.B; >+ENUM1.B : number ->ENUM1.B : ENUM1 +>ENUM1.B : ENUM1.B >ENUM1 : typeof ENUM1 ->B : ENUM1 +>B : ENUM1.B +ENUM, ENUM1; >+ENUM, ENUM1 : typeof ENUM1 diff --git a/tests/baselines/reference/plusOperatorWithNumberType.errors.txt b/tests/baselines/reference/plusOperatorWithNumberType.errors.txt new file mode 100644 index 00000000000..9abbe156e0f --- /dev/null +++ b/tests/baselines/reference/plusOperatorWithNumberType.errors.txt @@ -0,0 +1,47 @@ +tests/cases/conformance/expressions/unaryOperators/plusOperator/plusOperatorWithNumberType.ts(41,1): error TS2695: Left side of comma operator is unused and has no side effects. + + +==== tests/cases/conformance/expressions/unaryOperators/plusOperator/plusOperatorWithNumberType.ts (1 errors) ==== + // + operator on number type + var NUMBER: number; + var NUMBER1: number[] = [1, 2]; + + function foo(): number { return 1; } + + class A { + public a: number; + static foo() { return 1; } + } + module M { + export var n: number; + } + + var objA = new A(); + + // number type var + var ResultIsNumber1 = +NUMBER; + 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); + + // miss assignment operators + +1; + +NUMBER; + +NUMBER1; + +foo(); + +objA.a; + +M.n; + +objA.a, M.n; + ~~~~~~~ +!!! error TS2695: Left side of comma operator is unused and has no side effects. \ No newline at end of file diff --git a/tests/baselines/reference/plusOperatorWithNumberType.types b/tests/baselines/reference/plusOperatorWithNumberType.types index 2db1288de4a..f24785ffa06 100644 --- a/tests/baselines/reference/plusOperatorWithNumberType.types +++ b/tests/baselines/reference/plusOperatorWithNumberType.types @@ -6,12 +6,12 @@ var NUMBER: number; var NUMBER1: number[] = [1, 2]; >NUMBER1 : number[] >[1, 2] : number[] ->1 : number ->2 : number +>1 : 1 +>2 : 2 function foo(): number { return 1; } >foo : () => number ->1 : number +>1 : 1 class A { >A : A @@ -21,7 +21,7 @@ class A { static foo() { return 1; } >foo : () => number ->1 : number +>1 : 1 } module M { >M : typeof M @@ -50,23 +50,23 @@ var ResultIsNumber2 = +NUMBER1; var ResultIsNumber3 = +1; >ResultIsNumber3 : number >+1 : number ->1 : number +>1 : 1 var ResultIsNumber4 = +{ x: 1, y: 2}; >ResultIsNumber4 : number >+{ x: 1, y: 2} : number >{ x: 1, y: 2} : { x: number; y: number; } >x : number ->1 : number +>1 : 1 >y : number ->2 : number +>2 : 2 var ResultIsNumber5 = +{ x: 1, y: (n: number) => { return n; } }; >ResultIsNumber5 : number >+{ x: 1, y: (n: number) => { return n; } } : number >{ x: 1, y: (n: number) => { return n; } } : { x: number; y: (n: number) => number; } >x : number ->1 : number +>1 : 1 >y : (n: number) => number >(n: number) => { return n; } : (n: number) => number >n : number @@ -92,7 +92,7 @@ var ResultIsNumber8 = +NUMBER1[0]; >+NUMBER1[0] : number >NUMBER1[0] : number >NUMBER1 : number[] ->0 : number +>0 : 0 var ResultIsNumber9 = +foo(); >ResultIsNumber9 : number @@ -119,7 +119,7 @@ var ResultIsNumber11 = +(NUMBER + NUMBER); // miss assignment operators +1; >+1 : number ->1 : number +>1 : 1 +NUMBER; >+NUMBER : number diff --git a/tests/baselines/reference/plusOperatorWithStringType.errors.txt b/tests/baselines/reference/plusOperatorWithStringType.errors.txt new file mode 100644 index 00000000000..b731484555a --- /dev/null +++ b/tests/baselines/reference/plusOperatorWithStringType.errors.txt @@ -0,0 +1,46 @@ +tests/cases/conformance/expressions/unaryOperators/plusOperator/plusOperatorWithStringType.ts(40,1): error TS2695: Left side of comma operator is unused and has no side effects. + + +==== tests/cases/conformance/expressions/unaryOperators/plusOperator/plusOperatorWithStringType.ts (1 errors) ==== + // + operator on string type + var STRING: string; + var STRING1: string[] = ["", "abc"]; + + function foo(): string { return "abc"; } + + class A { + public a: string; + static foo() { return ""; } + } + module M { + export var n: string; + } + + var objA = new A(); + + // string type var + var ResultIsNumber1 = +STRING; + 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); + var ResultIsNumber12 = +STRING.charAt(0); + + // miss assignment operators + +""; + +STRING; + +STRING1; + +foo(); + +objA.a,M.n; + ~~~~~~~ +!!! error TS2695: Left side of comma operator is unused and has no side effects. \ No newline at end of file diff --git a/tests/baselines/reference/plusOperatorWithStringType.types b/tests/baselines/reference/plusOperatorWithStringType.types index c285a88c5d9..ec19aaed497 100644 --- a/tests/baselines/reference/plusOperatorWithStringType.types +++ b/tests/baselines/reference/plusOperatorWithStringType.types @@ -6,12 +6,12 @@ var STRING: string; var STRING1: string[] = ["", "abc"]; >STRING1 : string[] >["", "abc"] : string[] ->"" : string ->"abc" : string +>"" : "" +>"abc" : "abc" function foo(): string { return "abc"; } >foo : () => string ->"abc" : string +>"abc" : "abc" class A { >A : A @@ -21,7 +21,7 @@ class A { static foo() { return ""; } >foo : () => string ->"" : string +>"" : "" } module M { >M : typeof M @@ -50,23 +50,23 @@ var ResultIsNumber2 = +STRING1; var ResultIsNumber3 = +""; >ResultIsNumber3 : number >+"" : number ->"" : string +>"" : "" var ResultIsNumber4 = +{ x: "", y: "" }; >ResultIsNumber4 : number >+{ x: "", y: "" } : number >{ x: "", y: "" } : { x: string; y: string; } >x : string ->"" : string +>"" : "" >y : string ->"" : string +>"" : "" var ResultIsNumber5 = +{ x: "", y: (s: string) => { return s; } }; >ResultIsNumber5 : number >+{ x: "", y: (s: string) => { return s; } } : number >{ x: "", y: (s: string) => { return s; } } : { x: string; y: (s: string) => string; } >x : string ->"" : string +>"" : "" >y : (s: string) => string >(s: string) => { return s; } : (s: string) => string >s : string @@ -92,7 +92,7 @@ var ResultIsNumber8 = +STRING1[0]; >+STRING1[0] : number >STRING1[0] : string >STRING1 : string[] ->0 : number +>0 : 0 var ResultIsNumber9 = +foo(); >ResultIsNumber9 : number @@ -123,12 +123,12 @@ var ResultIsNumber12 = +STRING.charAt(0); >STRING.charAt : (pos: number) => string >STRING : string >charAt : (pos: number) => string ->0 : number +>0 : 0 // miss assignment operators +""; >+"" : number ->"" : string +>"" : "" +STRING; >+STRING : number diff --git a/tests/baselines/reference/prefixIncrementAsOperandOfPlusExpression.types b/tests/baselines/reference/prefixIncrementAsOperandOfPlusExpression.types index d5c9b03cc56..8e041acda38 100644 --- a/tests/baselines/reference/prefixIncrementAsOperandOfPlusExpression.types +++ b/tests/baselines/reference/prefixIncrementAsOperandOfPlusExpression.types @@ -1,11 +1,11 @@ === tests/cases/compiler/prefixIncrementAsOperandOfPlusExpression.ts === var x = 1; >x : number ->1 : number +>1 : 1 var y = 1; >y : number ->1 : number +>1 : 1 + ++x; >+ ++x : number diff --git a/tests/baselines/reference/prefixUnaryOperatorsOnExportedVariables.types b/tests/baselines/reference/prefixUnaryOperatorsOnExportedVariables.types index c75ba492c31..4e4dbe93372 100644 --- a/tests/baselines/reference/prefixUnaryOperatorsOnExportedVariables.types +++ b/tests/baselines/reference/prefixUnaryOperatorsOnExportedVariables.types @@ -2,45 +2,45 @@ export var x = false; >x : boolean ->false : boolean +>false : false export var y = 1; >y : number ->1 : number +>1 : 1 if (!x) { ->!x : boolean ->x : boolean +>!x : true +>x : false } if (+x) { >+x : number ->x : boolean +>x : false } if (-x) { >-x : number ->x : boolean +>x : false } if (~x) { >~x : number ->x : boolean +>x : false } if (void x) { >void x : undefined ->x : boolean +>x : false } if (typeof x) { >typeof x : string ->x : boolean +>x : false } diff --git a/tests/baselines/reference/preserveConstEnums.types b/tests/baselines/reference/preserveConstEnums.types index f128b4a831b..9f2d30a3604 100644 --- a/tests/baselines/reference/preserveConstEnums.types +++ b/tests/baselines/reference/preserveConstEnums.types @@ -4,7 +4,7 @@ const enum E { Value = 1, Value2 = Value >Value : E ->1 : number +>1 : 1 >Value2 : E >Value : E } diff --git a/tests/baselines/reference/primitiveConstraints2.errors.txt b/tests/baselines/reference/primitiveConstraints2.errors.txt index e571ee73417..822846540f7 100644 --- a/tests/baselines/reference/primitiveConstraints2.errors.txt +++ b/tests/baselines/reference/primitiveConstraints2.errors.txt @@ -1,4 +1,4 @@ -tests/cases/compiler/primitiveConstraints2.ts(8,11): error TS2345: Argument of type 'string' is not assignable to parameter of type 'number'. +tests/cases/compiler/primitiveConstraints2.ts(8,11): error TS2345: Argument of type '""' is not assignable to parameter of type 'number'. tests/cases/compiler/primitiveConstraints2.ts(9,8): error TS2344: Type 'string' does not satisfy the constraint 'number'. @@ -12,7 +12,7 @@ tests/cases/compiler/primitiveConstraints2.ts(9,8): error TS2344: Type 'string' var x = new C(); x.bar2(2, ""); // should error ~~ -!!! error TS2345: Argument of type 'string' is not assignable to parameter of type 'number'. +!!! error TS2345: Argument of type '""' is not assignable to parameter of type 'number'. x.bar2(2, ""); // should error ~~~~~~ !!! error TS2344: Type 'string' does not satisfy the constraint 'number'. \ No newline at end of file diff --git a/tests/baselines/reference/privacyCheckAnonymousFunctionParameter.types b/tests/baselines/reference/privacyCheckAnonymousFunctionParameter.types index c8e4d237091..0c025ceaee3 100644 --- a/tests/baselines/reference/privacyCheckAnonymousFunctionParameter.types +++ b/tests/baselines/reference/privacyCheckAnonymousFunctionParameter.types @@ -1,7 +1,7 @@ === tests/cases/compiler/privacyCheckAnonymousFunctionParameter.ts === export var x = 1; // Makes this an external module >x : number ->1 : number +>1 : 1 interface Iterator { >Iterator : Iterator @@ -31,11 +31,11 @@ module Query { return fromDoWhile(test => { >fromDoWhile(test => { return true; }) : Iterator<{}> >fromDoWhile : (doWhile: (test: Iterator) => boolean) => Iterator ->test => { return true; } : (test: Iterator<{}>) => boolean +>test => { return true; } : (test: Iterator<{}>) => true >test : Iterator<{}> return true; ->true : boolean +>true : true }); } diff --git a/tests/baselines/reference/privacyCheckAnonymousFunctionParameter2.types b/tests/baselines/reference/privacyCheckAnonymousFunctionParameter2.types index 445e318c0fb..de05ac5f740 100644 --- a/tests/baselines/reference/privacyCheckAnonymousFunctionParameter2.types +++ b/tests/baselines/reference/privacyCheckAnonymousFunctionParameter2.types @@ -1,7 +1,7 @@ === tests/cases/compiler/privacyCheckAnonymousFunctionParameter2.ts === export var x = 1; // Makes this an external module >x : number ->1 : number +>1 : 1 interface Iterator { x: T } >Iterator : Iterator diff --git a/tests/baselines/reference/privacyCheckExportAssignmentOnExportedGenericInterface2.types b/tests/baselines/reference/privacyCheckExportAssignmentOnExportedGenericInterface2.types index ce785983ce8..fcb0a27388b 100644 --- a/tests/baselines/reference/privacyCheckExportAssignmentOnExportedGenericInterface2.types +++ b/tests/baselines/reference/privacyCheckExportAssignmentOnExportedGenericInterface2.types @@ -24,6 +24,6 @@ module Foo { export var x = "hello"; >x : string ->"hello" : string +>"hello" : "hello" } diff --git a/tests/baselines/reference/privateVisibles.types b/tests/baselines/reference/privateVisibles.types index 71e26d7e264..95f60839fc1 100644 --- a/tests/baselines/reference/privateVisibles.types +++ b/tests/baselines/reference/privateVisibles.types @@ -4,7 +4,7 @@ class Foo { private pvar = 0; >pvar : number ->0 : number +>0 : 0 constructor() { var n = this.pvar; diff --git a/tests/baselines/reference/project/nodeModulesImportHigher/amd/nodeModulesImportHigher.errors.txt b/tests/baselines/reference/project/nodeModulesImportHigher/amd/nodeModulesImportHigher.errors.txt index 68a1ef3b7c9..8b4e11eb606 100644 --- a/tests/baselines/reference/project/nodeModulesImportHigher/amd/nodeModulesImportHigher.errors.txt +++ b/tests/baselines/reference/project/nodeModulesImportHigher/amd/nodeModulesImportHigher.errors.txt @@ -1,4 +1,4 @@ -importHigher/root.ts(6,1): error TS2322: Type 'string' is not assignable to type 'number'. +importHigher/root.ts(6,1): error TS2322: Type '"10"' is not assignable to type 'number'. ==== entry.js (0 errors) ==== @@ -36,5 +36,5 @@ importHigher/root.ts(6,1): error TS2322: Type 'string' is not assignable to type m1.f2.a = 10; m1.f2.person.age = "10"; // Error: Should be number (if direct import of m2 made the m3 module visible). ~~~~~~~~~~~~~~~~ -!!! error TS2322: Type 'string' is not assignable to type 'number'. +!!! error TS2322: Type '"10"' is not assignable to type 'number'. \ No newline at end of file diff --git a/tests/baselines/reference/project/nodeModulesImportHigher/node/nodeModulesImportHigher.errors.txt b/tests/baselines/reference/project/nodeModulesImportHigher/node/nodeModulesImportHigher.errors.txt index 68a1ef3b7c9..8b4e11eb606 100644 --- a/tests/baselines/reference/project/nodeModulesImportHigher/node/nodeModulesImportHigher.errors.txt +++ b/tests/baselines/reference/project/nodeModulesImportHigher/node/nodeModulesImportHigher.errors.txt @@ -1,4 +1,4 @@ -importHigher/root.ts(6,1): error TS2322: Type 'string' is not assignable to type 'number'. +importHigher/root.ts(6,1): error TS2322: Type '"10"' is not assignable to type 'number'. ==== entry.js (0 errors) ==== @@ -36,5 +36,5 @@ importHigher/root.ts(6,1): error TS2322: Type 'string' is not assignable to type m1.f2.a = 10; m1.f2.person.age = "10"; // Error: Should be number (if direct import of m2 made the m3 module visible). ~~~~~~~~~~~~~~~~ -!!! error TS2322: Type 'string' is not assignable to type 'number'. +!!! error TS2322: Type '"10"' is not assignable to type 'number'. \ No newline at end of file diff --git a/tests/baselines/reference/project/nodeModulesMaxDepthExceeded/amd/nodeModulesMaxDepthExceeded.errors.txt b/tests/baselines/reference/project/nodeModulesMaxDepthExceeded/amd/nodeModulesMaxDepthExceeded.errors.txt index 7099c05d577..6d95ac42c8f 100644 --- a/tests/baselines/reference/project/nodeModulesMaxDepthExceeded/amd/nodeModulesMaxDepthExceeded.errors.txt +++ b/tests/baselines/reference/project/nodeModulesMaxDepthExceeded/amd/nodeModulesMaxDepthExceeded.errors.txt @@ -1,5 +1,5 @@ -maxDepthExceeded/root.ts(3,1): error TS2322: Type 'string' is not assignable to type 'number'. -maxDepthExceeded/root.ts(4,1): error TS2322: Type 'number' is not assignable to type 'boolean'. +maxDepthExceeded/root.ts(3,1): error TS2322: Type '"10"' is not assignable to type 'number'. +maxDepthExceeded/root.ts(4,1): error TS2322: Type '42' is not assignable to type 'true'. ==== entry.js (0 errors) ==== @@ -34,10 +34,10 @@ maxDepthExceeded/root.ts(4,1): error TS2322: Type 'number' is not assignable to m1.f1("test"); m1.f2.a = "10"; // Error: Should be number ~~~~~~~ -!!! error TS2322: Type 'string' is not assignable to type 'number'. +!!! error TS2322: Type '"10"' is not assignable to type 'number'. m1.rel = 42; // Error: Should be boolean ~~~~~~ -!!! error TS2322: Type 'number' is not assignable to type 'boolean'. +!!! error TS2322: Type '42' is not assignable to type 'true'. m1.f2.person.age = "10"; // OK if stopped at 2 modules: person will be "any". \ No newline at end of file diff --git a/tests/baselines/reference/project/nodeModulesMaxDepthExceeded/node/nodeModulesMaxDepthExceeded.errors.txt b/tests/baselines/reference/project/nodeModulesMaxDepthExceeded/node/nodeModulesMaxDepthExceeded.errors.txt index 7099c05d577..6d95ac42c8f 100644 --- a/tests/baselines/reference/project/nodeModulesMaxDepthExceeded/node/nodeModulesMaxDepthExceeded.errors.txt +++ b/tests/baselines/reference/project/nodeModulesMaxDepthExceeded/node/nodeModulesMaxDepthExceeded.errors.txt @@ -1,5 +1,5 @@ -maxDepthExceeded/root.ts(3,1): error TS2322: Type 'string' is not assignable to type 'number'. -maxDepthExceeded/root.ts(4,1): error TS2322: Type 'number' is not assignable to type 'boolean'. +maxDepthExceeded/root.ts(3,1): error TS2322: Type '"10"' is not assignable to type 'number'. +maxDepthExceeded/root.ts(4,1): error TS2322: Type '42' is not assignable to type 'true'. ==== entry.js (0 errors) ==== @@ -34,10 +34,10 @@ maxDepthExceeded/root.ts(4,1): error TS2322: Type 'number' is not assignable to m1.f1("test"); m1.f2.a = "10"; // Error: Should be number ~~~~~~~ -!!! error TS2322: Type 'string' is not assignable to type 'number'. +!!! error TS2322: Type '"10"' is not assignable to type 'number'. m1.rel = 42; // Error: Should be boolean ~~~~~~ -!!! error TS2322: Type 'number' is not assignable to type 'boolean'. +!!! error TS2322: Type '42' is not assignable to type 'true'. m1.f2.person.age = "10"; // OK if stopped at 2 modules: person will be "any". \ No newline at end of file diff --git a/tests/baselines/reference/project/nodeModulesMaxDepthIncreased/amd/nodeModulesMaxDepthIncreased.errors.txt b/tests/baselines/reference/project/nodeModulesMaxDepthIncreased/amd/nodeModulesMaxDepthIncreased.errors.txt index f511000d5ac..684821d60a2 100644 --- a/tests/baselines/reference/project/nodeModulesMaxDepthIncreased/amd/nodeModulesMaxDepthIncreased.errors.txt +++ b/tests/baselines/reference/project/nodeModulesMaxDepthIncreased/amd/nodeModulesMaxDepthIncreased.errors.txt @@ -1,4 +1,4 @@ -maxDepthIncreased/root.ts(7,1): error TS2322: Type 'string' is not assignable to type 'number'. +maxDepthIncreased/root.ts(7,1): error TS2322: Type '"10"' is not assignable to type 'number'. ==== index.js (0 errors) ==== @@ -40,7 +40,7 @@ maxDepthIncreased/root.ts(7,1): error TS2322: Type 'string' is not assignable to m1.f2.person.age = "10"; // Should error if loaded the .js files correctly ~~~~~~~~~~~~~~~~ -!!! error TS2322: Type 'string' is not assignable to type 'number'. +!!! error TS2322: Type '"10"' is not assignable to type 'number'. let r2 = 3 + m4.foo; // Should be OK if correctly using the @types .d.ts file \ No newline at end of file diff --git a/tests/baselines/reference/project/nodeModulesMaxDepthIncreased/node/nodeModulesMaxDepthIncreased.errors.txt b/tests/baselines/reference/project/nodeModulesMaxDepthIncreased/node/nodeModulesMaxDepthIncreased.errors.txt index f511000d5ac..684821d60a2 100644 --- a/tests/baselines/reference/project/nodeModulesMaxDepthIncreased/node/nodeModulesMaxDepthIncreased.errors.txt +++ b/tests/baselines/reference/project/nodeModulesMaxDepthIncreased/node/nodeModulesMaxDepthIncreased.errors.txt @@ -1,4 +1,4 @@ -maxDepthIncreased/root.ts(7,1): error TS2322: Type 'string' is not assignable to type 'number'. +maxDepthIncreased/root.ts(7,1): error TS2322: Type '"10"' is not assignable to type 'number'. ==== index.js (0 errors) ==== @@ -40,7 +40,7 @@ maxDepthIncreased/root.ts(7,1): error TS2322: Type 'string' is not assignable to m1.f2.person.age = "10"; // Should error if loaded the .js files correctly ~~~~~~~~~~~~~~~~ -!!! error TS2322: Type 'string' is not assignable to type 'number'. +!!! error TS2322: Type '"10"' is not assignable to type 'number'. let r2 = 3 + m4.foo; // Should be OK if correctly using the @types .d.ts file \ No newline at end of file diff --git a/tests/baselines/reference/promiseChaining.types b/tests/baselines/reference/promiseChaining.types index 23a8b276fdc..fa40d8b68fc 100644 --- a/tests/baselines/reference/promiseChaining.types +++ b/tests/baselines/reference/promiseChaining.types @@ -42,7 +42,7 @@ class Chain { >then : (cb: (x: S) => S) => Chain >x => "abc" : (x: S) => string >x : S ->"abc" : string +>"abc" : "abc" >then : (cb: (x: string) => S) => Chain >x => x.length : (x: string) => number >x : string diff --git a/tests/baselines/reference/promiseType.js b/tests/baselines/reference/promiseType.js index 6b8d292a2b0..fc49dda9db4 100644 --- a/tests/baselines/reference/promiseType.js +++ b/tests/baselines/reference/promiseType.js @@ -91,7 +91,69 @@ async function I() { catch (e) { return Promise.reject(Error()); } -} +} + +// addresses github issue #4903: + +const p00 = p.catch(); +const p01 = p.catch(undefined); +const p07 = p.catch(null); +const p02 = p.catch(() => 1); +const p03 = p.catch(() => {}); +const p04 = p.catch(() => {throw 1}); +const p05 = p.catch(() => Promise.reject(1)); +const p06 = p.catch(() => Promise.resolve(1)); + +const p10 = p.then(); + +const p20 = p.then(undefined); +const p21 = p.then(() => 1); +const p22 = p.then(() => {}); +const p23 = p.then(() => {throw 1}); +const p24 = p.then(() => Promise.resolve(1)); +const p25 = p.then(() => Promise.reject(1)); + +const p30 = p.then(undefined, undefined); +const p31 = p.then(undefined, () => 1); +const p32 = p.then(undefined, () => {}); +const p33 = p.then(undefined, () => {throw 1}); +const p34 = p.then(undefined, () => Promise.resolve(1)); +const p35 = p.then(undefined, () => Promise.reject(1)); + +const p40 = p.then(() => "1", undefined); +const p41 = p.then(() => "1", () => 1); +const p42 = p.then(() => "1", () => {}); +const p43 = p.then(() => "1", () => {throw 1}); +const p44 = p.then(() => "1", () => Promise.resolve(1)); +const p45 = p.then(() => "1", () => Promise.reject(1)); + +const p50 = p.then(() => {}, undefined); +const p51 = p.then(() => {}, () => 1); +const p52 = p.then(() => {}, () => {}); +const p53 = p.then(() => {}, () => {throw 1}); +const p54 = p.then(() => {}, () => Promise.resolve(1)); +const p55 = p.then(() => {}, () => Promise.reject(1)); + +const p60 = p.then(() => {throw 1}, undefined); +const p61 = p.then(() => {throw 1}, () => 1); +const p62 = p.then(() => {throw 1}, () => {}); +const p63 = p.then(() => {throw 1}, () => {throw 1}); +const p64 = p.then(() => {throw 1}, () => Promise.resolve(1)); +const p65 = p.then(() => {throw 1}, () => Promise.reject(1)); + +const p70 = p.then(() => Promise.resolve("1"), undefined); +const p71 = p.then(() => Promise.resolve("1"), () => 1); +const p72 = p.then(() => Promise.resolve("1"), () => {}); +const p73 = p.then(() => Promise.resolve("1"), () => {throw 1}); +const p74 = p.then(() => Promise.resolve("1"), () => Promise.resolve(1)); +const p75 = p.then(() => Promise.resolve("1"), () => Promise.reject(1)); + +const p80 = p.then(() => Promise.reject(1), undefined); +const p81 = p.then(() => Promise.reject(1), () => 1); +const p82 = p.then(() => Promise.reject(1), () => {}); +const p83 = p.then(() => Promise.reject(1), () => {throw 1}); +const p84 = p.then(() => Promise.reject(1), () => Promise.resolve(1)); +const p85 = p.then(() => Promise.reject(1), () => Promise.reject(1)); //// [promiseType.js] var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { @@ -200,3 +262,55 @@ function I() { } }); } +// addresses github issue #4903: +const p00 = p.catch(); +const p01 = p.catch(undefined); +const p07 = p.catch(null); +const p02 = p.catch(() => 1); +const p03 = p.catch(() => { }); +const p04 = p.catch(() => { throw 1; }); +const p05 = p.catch(() => Promise.reject(1)); +const p06 = p.catch(() => Promise.resolve(1)); +const p10 = p.then(); +const p20 = p.then(undefined); +const p21 = p.then(() => 1); +const p22 = p.then(() => { }); +const p23 = p.then(() => { throw 1; }); +const p24 = p.then(() => Promise.resolve(1)); +const p25 = p.then(() => Promise.reject(1)); +const p30 = p.then(undefined, undefined); +const p31 = p.then(undefined, () => 1); +const p32 = p.then(undefined, () => { }); +const p33 = p.then(undefined, () => { throw 1; }); +const p34 = p.then(undefined, () => Promise.resolve(1)); +const p35 = p.then(undefined, () => Promise.reject(1)); +const p40 = p.then(() => "1", undefined); +const p41 = p.then(() => "1", () => 1); +const p42 = p.then(() => "1", () => { }); +const p43 = p.then(() => "1", () => { throw 1; }); +const p44 = p.then(() => "1", () => Promise.resolve(1)); +const p45 = p.then(() => "1", () => Promise.reject(1)); +const p50 = p.then(() => { }, undefined); +const p51 = p.then(() => { }, () => 1); +const p52 = p.then(() => { }, () => { }); +const p53 = p.then(() => { }, () => { throw 1; }); +const p54 = p.then(() => { }, () => Promise.resolve(1)); +const p55 = p.then(() => { }, () => Promise.reject(1)); +const p60 = p.then(() => { throw 1; }, undefined); +const p61 = p.then(() => { throw 1; }, () => 1); +const p62 = p.then(() => { throw 1; }, () => { }); +const p63 = p.then(() => { throw 1; }, () => { throw 1; }); +const p64 = p.then(() => { throw 1; }, () => Promise.resolve(1)); +const p65 = p.then(() => { throw 1; }, () => Promise.reject(1)); +const p70 = p.then(() => Promise.resolve("1"), undefined); +const p71 = p.then(() => Promise.resolve("1"), () => 1); +const p72 = p.then(() => Promise.resolve("1"), () => { }); +const p73 = p.then(() => Promise.resolve("1"), () => { throw 1; }); +const p74 = p.then(() => Promise.resolve("1"), () => Promise.resolve(1)); +const p75 = p.then(() => Promise.resolve("1"), () => Promise.reject(1)); +const p80 = p.then(() => Promise.reject(1), undefined); +const p81 = p.then(() => Promise.reject(1), () => 1); +const p82 = p.then(() => Promise.reject(1), () => { }); +const p83 = p.then(() => Promise.reject(1), () => { throw 1; }); +const p84 = p.then(() => Promise.reject(1), () => Promise.resolve(1)); +const p85 = p.then(() => Promise.reject(1), () => Promise.reject(1)); diff --git a/tests/baselines/reference/promiseType.symbols b/tests/baselines/reference/promiseType.symbols index fde4cf4f6f2..845aed26d5e 100644 --- a/tests/baselines/reference/promiseType.symbols +++ b/tests/baselines/reference/promiseType.symbols @@ -231,3 +231,410 @@ async function I() { >Error : Symbol(Error, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) } } + +// addresses github issue #4903: + +const p00 = p.catch(); +>p00 : Symbol(p00, Decl(promiseType.ts, 96, 5)) +>p.catch : Symbol(Promise.catch, Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) +>p : Symbol(p, Decl(promiseType.ts, 0, 11)) +>catch : Symbol(Promise.catch, Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) + +const p01 = p.catch(undefined); +>p01 : Symbol(p01, Decl(promiseType.ts, 97, 5)) +>p.catch : Symbol(Promise.catch, Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) +>p : Symbol(p, Decl(promiseType.ts, 0, 11)) +>catch : Symbol(Promise.catch, Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) +>undefined : Symbol(undefined) + +const p07 = p.catch(null); +>p07 : Symbol(p07, Decl(promiseType.ts, 98, 5)) +>p.catch : Symbol(Promise.catch, Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) +>p : Symbol(p, Decl(promiseType.ts, 0, 11)) +>catch : Symbol(Promise.catch, Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) + +const p02 = p.catch(() => 1); +>p02 : Symbol(p02, Decl(promiseType.ts, 99, 5)) +>p.catch : Symbol(Promise.catch, Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) +>p : Symbol(p, Decl(promiseType.ts, 0, 11)) +>catch : Symbol(Promise.catch, Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) + +const p03 = p.catch(() => {}); +>p03 : Symbol(p03, Decl(promiseType.ts, 100, 5)) +>p.catch : Symbol(Promise.catch, Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) +>p : Symbol(p, Decl(promiseType.ts, 0, 11)) +>catch : Symbol(Promise.catch, Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) + +const p04 = p.catch(() => {throw 1}); +>p04 : Symbol(p04, Decl(promiseType.ts, 101, 5)) +>p.catch : Symbol(Promise.catch, Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) +>p : Symbol(p, Decl(promiseType.ts, 0, 11)) +>catch : Symbol(Promise.catch, Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) + +const p05 = p.catch(() => Promise.reject(1)); +>p05 : Symbol(p05, Decl(promiseType.ts, 102, 5)) +>p.catch : Symbol(Promise.catch, Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) +>p : Symbol(p, Decl(promiseType.ts, 0, 11)) +>catch : Symbol(Promise.catch, Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) +>Promise.reject : Symbol(PromiseConstructor.reject, Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) +>Promise : Symbol(Promise, Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --)) +>reject : Symbol(PromiseConstructor.reject, Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) + +const p06 = p.catch(() => Promise.resolve(1)); +>p06 : Symbol(p06, Decl(promiseType.ts, 103, 5)) +>p.catch : Symbol(Promise.catch, Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) +>p : Symbol(p, Decl(promiseType.ts, 0, 11)) +>catch : Symbol(Promise.catch, Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) +>Promise.resolve : Symbol(PromiseConstructor.resolve, Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) +>Promise : Symbol(Promise, Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --)) +>resolve : Symbol(PromiseConstructor.resolve, Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) + +const p10 = p.then(); +>p10 : Symbol(p10, Decl(promiseType.ts, 105, 5)) +>p.then : Symbol(Promise.then, Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) +>p : Symbol(p, Decl(promiseType.ts, 0, 11)) +>then : Symbol(Promise.then, Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) + +const p20 = p.then(undefined); +>p20 : Symbol(p20, Decl(promiseType.ts, 107, 5)) +>p.then : Symbol(Promise.then, Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) +>p : Symbol(p, Decl(promiseType.ts, 0, 11)) +>then : Symbol(Promise.then, Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) +>undefined : Symbol(undefined) + +const p21 = p.then(() => 1); +>p21 : Symbol(p21, Decl(promiseType.ts, 108, 5)) +>p.then : Symbol(Promise.then, Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) +>p : Symbol(p, Decl(promiseType.ts, 0, 11)) +>then : Symbol(Promise.then, Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) + +const p22 = p.then(() => {}); +>p22 : Symbol(p22, Decl(promiseType.ts, 109, 5)) +>p.then : Symbol(Promise.then, Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) +>p : Symbol(p, Decl(promiseType.ts, 0, 11)) +>then : Symbol(Promise.then, Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) + +const p23 = p.then(() => {throw 1}); +>p23 : Symbol(p23, Decl(promiseType.ts, 110, 5)) +>p.then : Symbol(Promise.then, Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) +>p : Symbol(p, Decl(promiseType.ts, 0, 11)) +>then : Symbol(Promise.then, Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) + +const p24 = p.then(() => Promise.resolve(1)); +>p24 : Symbol(p24, Decl(promiseType.ts, 111, 5)) +>p.then : Symbol(Promise.then, Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) +>p : Symbol(p, Decl(promiseType.ts, 0, 11)) +>then : Symbol(Promise.then, Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) +>Promise.resolve : Symbol(PromiseConstructor.resolve, Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) +>Promise : Symbol(Promise, Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --)) +>resolve : Symbol(PromiseConstructor.resolve, Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) + +const p25 = p.then(() => Promise.reject(1)); +>p25 : Symbol(p25, Decl(promiseType.ts, 112, 5)) +>p.then : Symbol(Promise.then, Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) +>p : Symbol(p, Decl(promiseType.ts, 0, 11)) +>then : Symbol(Promise.then, Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) +>Promise.reject : Symbol(PromiseConstructor.reject, Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) +>Promise : Symbol(Promise, Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --)) +>reject : Symbol(PromiseConstructor.reject, Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) + +const p30 = p.then(undefined, undefined); +>p30 : Symbol(p30, Decl(promiseType.ts, 114, 5)) +>p.then : Symbol(Promise.then, Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) +>p : Symbol(p, Decl(promiseType.ts, 0, 11)) +>then : Symbol(Promise.then, Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) +>undefined : Symbol(undefined) +>undefined : Symbol(undefined) + +const p31 = p.then(undefined, () => 1); +>p31 : Symbol(p31, Decl(promiseType.ts, 115, 5)) +>p.then : Symbol(Promise.then, Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) +>p : Symbol(p, Decl(promiseType.ts, 0, 11)) +>then : Symbol(Promise.then, Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) +>undefined : Symbol(undefined) + +const p32 = p.then(undefined, () => {}); +>p32 : Symbol(p32, Decl(promiseType.ts, 116, 5)) +>p.then : Symbol(Promise.then, Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) +>p : Symbol(p, Decl(promiseType.ts, 0, 11)) +>then : Symbol(Promise.then, Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) +>undefined : Symbol(undefined) + +const p33 = p.then(undefined, () => {throw 1}); +>p33 : Symbol(p33, Decl(promiseType.ts, 117, 5)) +>p.then : Symbol(Promise.then, Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) +>p : Symbol(p, Decl(promiseType.ts, 0, 11)) +>then : Symbol(Promise.then, Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) +>undefined : Symbol(undefined) + +const p34 = p.then(undefined, () => Promise.resolve(1)); +>p34 : Symbol(p34, Decl(promiseType.ts, 118, 5)) +>p.then : Symbol(Promise.then, Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) +>p : Symbol(p, Decl(promiseType.ts, 0, 11)) +>then : Symbol(Promise.then, Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) +>undefined : Symbol(undefined) +>Promise.resolve : Symbol(PromiseConstructor.resolve, Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) +>Promise : Symbol(Promise, Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --)) +>resolve : Symbol(PromiseConstructor.resolve, Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) + +const p35 = p.then(undefined, () => Promise.reject(1)); +>p35 : Symbol(p35, Decl(promiseType.ts, 119, 5)) +>p.then : Symbol(Promise.then, Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) +>p : Symbol(p, Decl(promiseType.ts, 0, 11)) +>then : Symbol(Promise.then, Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) +>undefined : Symbol(undefined) +>Promise.reject : Symbol(PromiseConstructor.reject, Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) +>Promise : Symbol(Promise, Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --)) +>reject : Symbol(PromiseConstructor.reject, Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) + +const p40 = p.then(() => "1", undefined); +>p40 : Symbol(p40, Decl(promiseType.ts, 121, 5)) +>p.then : Symbol(Promise.then, Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) +>p : Symbol(p, Decl(promiseType.ts, 0, 11)) +>then : Symbol(Promise.then, Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) +>undefined : Symbol(undefined) + +const p41 = p.then(() => "1", () => 1); +>p41 : Symbol(p41, Decl(promiseType.ts, 122, 5)) +>p.then : Symbol(Promise.then, Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) +>p : Symbol(p, Decl(promiseType.ts, 0, 11)) +>then : Symbol(Promise.then, Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) + +const p42 = p.then(() => "1", () => {}); +>p42 : Symbol(p42, Decl(promiseType.ts, 123, 5)) +>p.then : Symbol(Promise.then, Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) +>p : Symbol(p, Decl(promiseType.ts, 0, 11)) +>then : Symbol(Promise.then, Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) + +const p43 = p.then(() => "1", () => {throw 1}); +>p43 : Symbol(p43, Decl(promiseType.ts, 124, 5)) +>p.then : Symbol(Promise.then, Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) +>p : Symbol(p, Decl(promiseType.ts, 0, 11)) +>then : Symbol(Promise.then, Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) + +const p44 = p.then(() => "1", () => Promise.resolve(1)); +>p44 : Symbol(p44, Decl(promiseType.ts, 125, 5)) +>p.then : Symbol(Promise.then, Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) +>p : Symbol(p, Decl(promiseType.ts, 0, 11)) +>then : Symbol(Promise.then, Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) +>Promise.resolve : Symbol(PromiseConstructor.resolve, Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) +>Promise : Symbol(Promise, Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --)) +>resolve : Symbol(PromiseConstructor.resolve, Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) + +const p45 = p.then(() => "1", () => Promise.reject(1)); +>p45 : Symbol(p45, Decl(promiseType.ts, 126, 5)) +>p.then : Symbol(Promise.then, Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) +>p : Symbol(p, Decl(promiseType.ts, 0, 11)) +>then : Symbol(Promise.then, Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) +>Promise.reject : Symbol(PromiseConstructor.reject, Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) +>Promise : Symbol(Promise, Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --)) +>reject : Symbol(PromiseConstructor.reject, Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) + +const p50 = p.then(() => {}, undefined); +>p50 : Symbol(p50, Decl(promiseType.ts, 128, 5)) +>p.then : Symbol(Promise.then, Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) +>p : Symbol(p, Decl(promiseType.ts, 0, 11)) +>then : Symbol(Promise.then, Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) +>undefined : Symbol(undefined) + +const p51 = p.then(() => {}, () => 1); +>p51 : Symbol(p51, Decl(promiseType.ts, 129, 5)) +>p.then : Symbol(Promise.then, Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) +>p : Symbol(p, Decl(promiseType.ts, 0, 11)) +>then : Symbol(Promise.then, Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) + +const p52 = p.then(() => {}, () => {}); +>p52 : Symbol(p52, Decl(promiseType.ts, 130, 5)) +>p.then : Symbol(Promise.then, Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) +>p : Symbol(p, Decl(promiseType.ts, 0, 11)) +>then : Symbol(Promise.then, Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) + +const p53 = p.then(() => {}, () => {throw 1}); +>p53 : Symbol(p53, Decl(promiseType.ts, 131, 5)) +>p.then : Symbol(Promise.then, Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) +>p : Symbol(p, Decl(promiseType.ts, 0, 11)) +>then : Symbol(Promise.then, Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) + +const p54 = p.then(() => {}, () => Promise.resolve(1)); +>p54 : Symbol(p54, Decl(promiseType.ts, 132, 5)) +>p.then : Symbol(Promise.then, Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) +>p : Symbol(p, Decl(promiseType.ts, 0, 11)) +>then : Symbol(Promise.then, Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) +>Promise.resolve : Symbol(PromiseConstructor.resolve, Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) +>Promise : Symbol(Promise, Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --)) +>resolve : Symbol(PromiseConstructor.resolve, Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) + +const p55 = p.then(() => {}, () => Promise.reject(1)); +>p55 : Symbol(p55, Decl(promiseType.ts, 133, 5)) +>p.then : Symbol(Promise.then, Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) +>p : Symbol(p, Decl(promiseType.ts, 0, 11)) +>then : Symbol(Promise.then, Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) +>Promise.reject : Symbol(PromiseConstructor.reject, Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) +>Promise : Symbol(Promise, Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --)) +>reject : Symbol(PromiseConstructor.reject, Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) + +const p60 = p.then(() => {throw 1}, undefined); +>p60 : Symbol(p60, Decl(promiseType.ts, 135, 5)) +>p.then : Symbol(Promise.then, Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) +>p : Symbol(p, Decl(promiseType.ts, 0, 11)) +>then : Symbol(Promise.then, Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) +>undefined : Symbol(undefined) + +const p61 = p.then(() => {throw 1}, () => 1); +>p61 : Symbol(p61, Decl(promiseType.ts, 136, 5)) +>p.then : Symbol(Promise.then, Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) +>p : Symbol(p, Decl(promiseType.ts, 0, 11)) +>then : Symbol(Promise.then, Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) + +const p62 = p.then(() => {throw 1}, () => {}); +>p62 : Symbol(p62, Decl(promiseType.ts, 137, 5)) +>p.then : Symbol(Promise.then, Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) +>p : Symbol(p, Decl(promiseType.ts, 0, 11)) +>then : Symbol(Promise.then, Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) + +const p63 = p.then(() => {throw 1}, () => {throw 1}); +>p63 : Symbol(p63, Decl(promiseType.ts, 138, 5)) +>p.then : Symbol(Promise.then, Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) +>p : Symbol(p, Decl(promiseType.ts, 0, 11)) +>then : Symbol(Promise.then, Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) + +const p64 = p.then(() => {throw 1}, () => Promise.resolve(1)); +>p64 : Symbol(p64, Decl(promiseType.ts, 139, 5)) +>p.then : Symbol(Promise.then, Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) +>p : Symbol(p, Decl(promiseType.ts, 0, 11)) +>then : Symbol(Promise.then, Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) +>Promise.resolve : Symbol(PromiseConstructor.resolve, Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) +>Promise : Symbol(Promise, Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --)) +>resolve : Symbol(PromiseConstructor.resolve, Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) + +const p65 = p.then(() => {throw 1}, () => Promise.reject(1)); +>p65 : Symbol(p65, Decl(promiseType.ts, 140, 5)) +>p.then : Symbol(Promise.then, Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) +>p : Symbol(p, Decl(promiseType.ts, 0, 11)) +>then : Symbol(Promise.then, Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) +>Promise.reject : Symbol(PromiseConstructor.reject, Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) +>Promise : Symbol(Promise, Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --)) +>reject : Symbol(PromiseConstructor.reject, Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) + +const p70 = p.then(() => Promise.resolve("1"), undefined); +>p70 : Symbol(p70, Decl(promiseType.ts, 142, 5)) +>p.then : Symbol(Promise.then, Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) +>p : Symbol(p, Decl(promiseType.ts, 0, 11)) +>then : Symbol(Promise.then, Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) +>Promise.resolve : Symbol(PromiseConstructor.resolve, Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) +>Promise : Symbol(Promise, Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --)) +>resolve : Symbol(PromiseConstructor.resolve, Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) +>undefined : Symbol(undefined) + +const p71 = p.then(() => Promise.resolve("1"), () => 1); +>p71 : Symbol(p71, Decl(promiseType.ts, 143, 5)) +>p.then : Symbol(Promise.then, Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) +>p : Symbol(p, Decl(promiseType.ts, 0, 11)) +>then : Symbol(Promise.then, Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) +>Promise.resolve : Symbol(PromiseConstructor.resolve, Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) +>Promise : Symbol(Promise, Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --)) +>resolve : Symbol(PromiseConstructor.resolve, Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) + +const p72 = p.then(() => Promise.resolve("1"), () => {}); +>p72 : Symbol(p72, Decl(promiseType.ts, 144, 5)) +>p.then : Symbol(Promise.then, Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) +>p : Symbol(p, Decl(promiseType.ts, 0, 11)) +>then : Symbol(Promise.then, Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) +>Promise.resolve : Symbol(PromiseConstructor.resolve, Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) +>Promise : Symbol(Promise, Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --)) +>resolve : Symbol(PromiseConstructor.resolve, Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) + +const p73 = p.then(() => Promise.resolve("1"), () => {throw 1}); +>p73 : Symbol(p73, Decl(promiseType.ts, 145, 5)) +>p.then : Symbol(Promise.then, Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) +>p : Symbol(p, Decl(promiseType.ts, 0, 11)) +>then : Symbol(Promise.then, Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) +>Promise.resolve : Symbol(PromiseConstructor.resolve, Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) +>Promise : Symbol(Promise, Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --)) +>resolve : Symbol(PromiseConstructor.resolve, Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) + +const p74 = p.then(() => Promise.resolve("1"), () => Promise.resolve(1)); +>p74 : Symbol(p74, Decl(promiseType.ts, 146, 5)) +>p.then : Symbol(Promise.then, Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) +>p : Symbol(p, Decl(promiseType.ts, 0, 11)) +>then : Symbol(Promise.then, Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) +>Promise.resolve : Symbol(PromiseConstructor.resolve, Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) +>Promise : Symbol(Promise, Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --)) +>resolve : Symbol(PromiseConstructor.resolve, Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) +>Promise.resolve : Symbol(PromiseConstructor.resolve, Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) +>Promise : Symbol(Promise, Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --)) +>resolve : Symbol(PromiseConstructor.resolve, Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) + +const p75 = p.then(() => Promise.resolve("1"), () => Promise.reject(1)); +>p75 : Symbol(p75, Decl(promiseType.ts, 147, 5)) +>p.then : Symbol(Promise.then, Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) +>p : Symbol(p, Decl(promiseType.ts, 0, 11)) +>then : Symbol(Promise.then, Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) +>Promise.resolve : Symbol(PromiseConstructor.resolve, Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) +>Promise : Symbol(Promise, Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --)) +>resolve : Symbol(PromiseConstructor.resolve, Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) +>Promise.reject : Symbol(PromiseConstructor.reject, Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) +>Promise : Symbol(Promise, Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --)) +>reject : Symbol(PromiseConstructor.reject, Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) + +const p80 = p.then(() => Promise.reject(1), undefined); +>p80 : Symbol(p80, Decl(promiseType.ts, 149, 5)) +>p.then : Symbol(Promise.then, Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) +>p : Symbol(p, Decl(promiseType.ts, 0, 11)) +>then : Symbol(Promise.then, Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) +>Promise.reject : Symbol(PromiseConstructor.reject, Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) +>Promise : Symbol(Promise, Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --)) +>reject : Symbol(PromiseConstructor.reject, Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) +>undefined : Symbol(undefined) + +const p81 = p.then(() => Promise.reject(1), () => 1); +>p81 : Symbol(p81, Decl(promiseType.ts, 150, 5)) +>p.then : Symbol(Promise.then, Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) +>p : Symbol(p, Decl(promiseType.ts, 0, 11)) +>then : Symbol(Promise.then, Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) +>Promise.reject : Symbol(PromiseConstructor.reject, Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) +>Promise : Symbol(Promise, Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --)) +>reject : Symbol(PromiseConstructor.reject, Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) + +const p82 = p.then(() => Promise.reject(1), () => {}); +>p82 : Symbol(p82, Decl(promiseType.ts, 151, 5)) +>p.then : Symbol(Promise.then, Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) +>p : Symbol(p, Decl(promiseType.ts, 0, 11)) +>then : Symbol(Promise.then, Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) +>Promise.reject : Symbol(PromiseConstructor.reject, Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) +>Promise : Symbol(Promise, Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --)) +>reject : Symbol(PromiseConstructor.reject, Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) + +const p83 = p.then(() => Promise.reject(1), () => {throw 1}); +>p83 : Symbol(p83, Decl(promiseType.ts, 152, 5)) +>p.then : Symbol(Promise.then, Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) +>p : Symbol(p, Decl(promiseType.ts, 0, 11)) +>then : Symbol(Promise.then, Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) +>Promise.reject : Symbol(PromiseConstructor.reject, Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) +>Promise : Symbol(Promise, Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --)) +>reject : Symbol(PromiseConstructor.reject, Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) + +const p84 = p.then(() => Promise.reject(1), () => Promise.resolve(1)); +>p84 : Symbol(p84, Decl(promiseType.ts, 153, 5)) +>p.then : Symbol(Promise.then, Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) +>p : Symbol(p, Decl(promiseType.ts, 0, 11)) +>then : Symbol(Promise.then, Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) +>Promise.reject : Symbol(PromiseConstructor.reject, Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) +>Promise : Symbol(Promise, Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --)) +>reject : Symbol(PromiseConstructor.reject, Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) +>Promise.resolve : Symbol(PromiseConstructor.resolve, Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) +>Promise : Symbol(Promise, Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --)) +>resolve : Symbol(PromiseConstructor.resolve, Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) + +const p85 = p.then(() => Promise.reject(1), () => Promise.reject(1)); +>p85 : Symbol(p85, Decl(promiseType.ts, 154, 5)) +>p.then : Symbol(Promise.then, Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) +>p : Symbol(p, Decl(promiseType.ts, 0, 11)) +>then : Symbol(Promise.then, Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) +>Promise.reject : Symbol(PromiseConstructor.reject, Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) +>Promise : Symbol(Promise, Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --)) +>reject : Symbol(PromiseConstructor.reject, Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) +>Promise.reject : Symbol(PromiseConstructor.reject, Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) +>Promise : Symbol(Promise, Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --)) +>reject : Symbol(PromiseConstructor.reject, Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) + diff --git a/tests/baselines/reference/promiseType.types b/tests/baselines/reference/promiseType.types index 1608182d6e9..3d055f73f0a 100644 --- a/tests/baselines/reference/promiseType.types +++ b/tests/baselines/reference/promiseType.types @@ -6,68 +6,68 @@ declare var p: Promise; const a = p.then(); >a : Promise >p.then() : Promise ->p.then : { (onfulfilled: (value: boolean) => TResult1 | PromiseLike, onrejected: (reason: any) => TResult2 | PromiseLike): Promise; (onfulfilled: (value: boolean) => TResult | PromiseLike, onrejected: (reason: any) => TResult | PromiseLike): Promise; (onfulfilled: (value: boolean) => TResult | PromiseLike): Promise; (): Promise; } +>p.then : { (onfulfilled?: (value: boolean) => boolean | PromiseLike, onrejected?: (reason: any) => boolean | PromiseLike): Promise; (onfulfilled: (value: boolean) => boolean | PromiseLike, onrejected: (reason: any) => TResult | PromiseLike): Promise; (onfulfilled: (value: boolean) => TResult | PromiseLike, onrejected?: (reason: any) => TResult | PromiseLike): Promise; (onfulfilled: (value: boolean) => TResult1 | PromiseLike, onrejected: (reason: any) => TResult2 | PromiseLike): Promise; } >p : Promise ->then : { (onfulfilled: (value: boolean) => TResult1 | PromiseLike, onrejected: (reason: any) => TResult2 | PromiseLike): Promise; (onfulfilled: (value: boolean) => TResult | PromiseLike, onrejected: (reason: any) => TResult | PromiseLike): Promise; (onfulfilled: (value: boolean) => TResult | PromiseLike): Promise; (): Promise; } +>then : { (onfulfilled?: (value: boolean) => boolean | PromiseLike, onrejected?: (reason: any) => boolean | PromiseLike): Promise; (onfulfilled: (value: boolean) => boolean | PromiseLike, onrejected: (reason: any) => TResult | PromiseLike): Promise; (onfulfilled: (value: boolean) => TResult | PromiseLike, onrejected?: (reason: any) => TResult | PromiseLike): Promise; (onfulfilled: (value: boolean) => TResult1 | PromiseLike, onrejected: (reason: any) => TResult2 | PromiseLike): Promise; } const b = p.then(b => 1); ->b : Promise ->p.then(b => 1) : Promise ->p.then : { (onfulfilled: (value: boolean) => TResult1 | PromiseLike, onrejected: (reason: any) => TResult2 | PromiseLike): Promise; (onfulfilled: (value: boolean) => TResult | PromiseLike, onrejected: (reason: any) => TResult | PromiseLike): Promise; (onfulfilled: (value: boolean) => TResult | PromiseLike): Promise; (): Promise; } +>b : Promise<1> +>p.then(b => 1) : Promise<1> +>p.then : { (onfulfilled?: (value: boolean) => boolean | PromiseLike, onrejected?: (reason: any) => boolean | PromiseLike): Promise; (onfulfilled: (value: boolean) => boolean | PromiseLike, onrejected: (reason: any) => TResult | PromiseLike): Promise; (onfulfilled: (value: boolean) => TResult | PromiseLike, onrejected?: (reason: any) => TResult | PromiseLike): Promise; (onfulfilled: (value: boolean) => TResult1 | PromiseLike, onrejected: (reason: any) => TResult2 | PromiseLike): Promise; } >p : Promise ->then : { (onfulfilled: (value: boolean) => TResult1 | PromiseLike, onrejected: (reason: any) => TResult2 | PromiseLike): Promise; (onfulfilled: (value: boolean) => TResult | PromiseLike, onrejected: (reason: any) => TResult | PromiseLike): Promise; (onfulfilled: (value: boolean) => TResult | PromiseLike): Promise; (): Promise; } ->b => 1 : (b: boolean) => number +>then : { (onfulfilled?: (value: boolean) => boolean | PromiseLike, onrejected?: (reason: any) => boolean | PromiseLike): Promise; (onfulfilled: (value: boolean) => boolean | PromiseLike, onrejected: (reason: any) => TResult | PromiseLike): Promise; (onfulfilled: (value: boolean) => TResult | PromiseLike, onrejected?: (reason: any) => TResult | PromiseLike): Promise; (onfulfilled: (value: boolean) => TResult1 | PromiseLike, onrejected: (reason: any) => TResult2 | PromiseLike): Promise; } +>b => 1 : (b: boolean) => 1 >b : boolean ->1 : number +>1 : 1 const c = p.then(b => 1, e => 'error'); ->c : Promise ->p.then(b => 1, e => 'error') : Promise ->p.then : { (onfulfilled: (value: boolean) => TResult1 | PromiseLike, onrejected: (reason: any) => TResult2 | PromiseLike): Promise; (onfulfilled: (value: boolean) => TResult | PromiseLike, onrejected: (reason: any) => TResult | PromiseLike): Promise; (onfulfilled: (value: boolean) => TResult | PromiseLike): Promise; (): Promise; } +>c : Promise +>p.then(b => 1, e => 'error') : Promise +>p.then : { (onfulfilled?: (value: boolean) => boolean | PromiseLike, onrejected?: (reason: any) => boolean | PromiseLike): Promise; (onfulfilled: (value: boolean) => boolean | PromiseLike, onrejected: (reason: any) => TResult | PromiseLike): Promise; (onfulfilled: (value: boolean) => TResult | PromiseLike, onrejected?: (reason: any) => TResult | PromiseLike): Promise; (onfulfilled: (value: boolean) => TResult1 | PromiseLike, onrejected: (reason: any) => TResult2 | PromiseLike): Promise; } >p : Promise ->then : { (onfulfilled: (value: boolean) => TResult1 | PromiseLike, onrejected: (reason: any) => TResult2 | PromiseLike): Promise; (onfulfilled: (value: boolean) => TResult | PromiseLike, onrejected: (reason: any) => TResult | PromiseLike): Promise; (onfulfilled: (value: boolean) => TResult | PromiseLike): Promise; (): Promise; } ->b => 1 : (b: boolean) => number +>then : { (onfulfilled?: (value: boolean) => boolean | PromiseLike, onrejected?: (reason: any) => boolean | PromiseLike): Promise; (onfulfilled: (value: boolean) => boolean | PromiseLike, onrejected: (reason: any) => TResult | PromiseLike): Promise; (onfulfilled: (value: boolean) => TResult | PromiseLike, onrejected?: (reason: any) => TResult | PromiseLike): Promise; (onfulfilled: (value: boolean) => TResult1 | PromiseLike, onrejected: (reason: any) => TResult2 | PromiseLike): Promise; } +>b => 1 : (b: boolean) => 1 >b : boolean ->1 : number +>1 : 1 >e => 'error' : (e: any) => string >e : any ->'error' : string +>'error' : "error" const d = p.then(b => 1, e => { }); ->d : Promise ->p.then(b => 1, e => { }) : Promise ->p.then : { (onfulfilled: (value: boolean) => TResult1 | PromiseLike, onrejected: (reason: any) => TResult2 | PromiseLike): Promise; (onfulfilled: (value: boolean) => TResult | PromiseLike, onrejected: (reason: any) => TResult | PromiseLike): Promise; (onfulfilled: (value: boolean) => TResult | PromiseLike): Promise; (): Promise; } +>d : Promise +>p.then(b => 1, e => { }) : Promise +>p.then : { (onfulfilled?: (value: boolean) => boolean | PromiseLike, onrejected?: (reason: any) => boolean | PromiseLike): Promise; (onfulfilled: (value: boolean) => boolean | PromiseLike, onrejected: (reason: any) => TResult | PromiseLike): Promise; (onfulfilled: (value: boolean) => TResult | PromiseLike, onrejected?: (reason: any) => TResult | PromiseLike): Promise; (onfulfilled: (value: boolean) => TResult1 | PromiseLike, onrejected: (reason: any) => TResult2 | PromiseLike): Promise; } >p : Promise ->then : { (onfulfilled: (value: boolean) => TResult1 | PromiseLike, onrejected: (reason: any) => TResult2 | PromiseLike): Promise; (onfulfilled: (value: boolean) => TResult | PromiseLike, onrejected: (reason: any) => TResult | PromiseLike): Promise; (onfulfilled: (value: boolean) => TResult | PromiseLike): Promise; (): Promise; } ->b => 1 : (b: boolean) => number +>then : { (onfulfilled?: (value: boolean) => boolean | PromiseLike, onrejected?: (reason: any) => boolean | PromiseLike): Promise; (onfulfilled: (value: boolean) => boolean | PromiseLike, onrejected: (reason: any) => TResult | PromiseLike): Promise; (onfulfilled: (value: boolean) => TResult | PromiseLike, onrejected?: (reason: any) => TResult | PromiseLike): Promise; (onfulfilled: (value: boolean) => TResult1 | PromiseLike, onrejected: (reason: any) => TResult2 | PromiseLike): Promise; } +>b => 1 : (b: boolean) => 1 >b : boolean ->1 : number +>1 : 1 >e => { } : (e: any) => void >e : any const e = p.then(b => 1, e => { throw Error(); }); ->e : Promise ->p.then(b => 1, e => { throw Error(); }) : Promise ->p.then : { (onfulfilled: (value: boolean) => TResult1 | PromiseLike, onrejected: (reason: any) => TResult2 | PromiseLike): Promise; (onfulfilled: (value: boolean) => TResult | PromiseLike, onrejected: (reason: any) => TResult | PromiseLike): Promise; (onfulfilled: (value: boolean) => TResult | PromiseLike): Promise; (): Promise; } +>e : Promise<1> +>p.then(b => 1, e => { throw Error(); }) : Promise<1> +>p.then : { (onfulfilled?: (value: boolean) => boolean | PromiseLike, onrejected?: (reason: any) => boolean | PromiseLike): Promise; (onfulfilled: (value: boolean) => boolean | PromiseLike, onrejected: (reason: any) => TResult | PromiseLike): Promise; (onfulfilled: (value: boolean) => TResult | PromiseLike, onrejected?: (reason: any) => TResult | PromiseLike): Promise; (onfulfilled: (value: boolean) => TResult1 | PromiseLike, onrejected: (reason: any) => TResult2 | PromiseLike): Promise; } >p : Promise ->then : { (onfulfilled: (value: boolean) => TResult1 | PromiseLike, onrejected: (reason: any) => TResult2 | PromiseLike): Promise; (onfulfilled: (value: boolean) => TResult | PromiseLike, onrejected: (reason: any) => TResult | PromiseLike): Promise; (onfulfilled: (value: boolean) => TResult | PromiseLike): Promise; (): Promise; } ->b => 1 : (b: boolean) => number +>then : { (onfulfilled?: (value: boolean) => boolean | PromiseLike, onrejected?: (reason: any) => boolean | PromiseLike): Promise; (onfulfilled: (value: boolean) => boolean | PromiseLike, onrejected: (reason: any) => TResult | PromiseLike): Promise; (onfulfilled: (value: boolean) => TResult | PromiseLike, onrejected?: (reason: any) => TResult | PromiseLike): Promise; (onfulfilled: (value: boolean) => TResult1 | PromiseLike, onrejected: (reason: any) => TResult2 | PromiseLike): Promise; } +>b => 1 : (b: boolean) => 1 >b : boolean ->1 : number +>1 : 1 >e => { throw Error(); } : (e: any) => never >e : any >Error() : Error >Error : ErrorConstructor const f = p.then(b => 1, e => Promise.reject(Error())); ->f : Promise ->p.then(b => 1, e => Promise.reject(Error())) : Promise ->p.then : { (onfulfilled: (value: boolean) => TResult1 | PromiseLike, onrejected: (reason: any) => TResult2 | PromiseLike): Promise; (onfulfilled: (value: boolean) => TResult | PromiseLike, onrejected: (reason: any) => TResult | PromiseLike): Promise; (onfulfilled: (value: boolean) => TResult | PromiseLike): Promise; (): Promise; } +>f : Promise<1> +>p.then(b => 1, e => Promise.reject(Error())) : Promise<1> +>p.then : { (onfulfilled?: (value: boolean) => boolean | PromiseLike, onrejected?: (reason: any) => boolean | PromiseLike): Promise; (onfulfilled: (value: boolean) => boolean | PromiseLike, onrejected: (reason: any) => TResult | PromiseLike): Promise; (onfulfilled: (value: boolean) => TResult | PromiseLike, onrejected?: (reason: any) => TResult | PromiseLike): Promise; (onfulfilled: (value: boolean) => TResult1 | PromiseLike, onrejected: (reason: any) => TResult2 | PromiseLike): Promise; } >p : Promise ->then : { (onfulfilled: (value: boolean) => TResult1 | PromiseLike, onrejected: (reason: any) => TResult2 | PromiseLike): Promise; (onfulfilled: (value: boolean) => TResult | PromiseLike, onrejected: (reason: any) => TResult | PromiseLike): Promise; (onfulfilled: (value: boolean) => TResult | PromiseLike): Promise; (): Promise; } ->b => 1 : (b: boolean) => number +>then : { (onfulfilled?: (value: boolean) => boolean | PromiseLike, onrejected?: (reason: any) => boolean | PromiseLike): Promise; (onfulfilled: (value: boolean) => boolean | PromiseLike, onrejected: (reason: any) => TResult | PromiseLike): Promise; (onfulfilled: (value: boolean) => TResult | PromiseLike, onrejected?: (reason: any) => TResult | PromiseLike): Promise; (onfulfilled: (value: boolean) => TResult1 | PromiseLike, onrejected: (reason: any) => TResult2 | PromiseLike): Promise; } +>b => 1 : (b: boolean) => 1 >b : boolean ->1 : number +>1 : 1 >e => Promise.reject(Error()) : (e: any) => Promise >e : any >Promise.reject(Error()) : Promise @@ -78,30 +78,30 @@ const f = p.then(b => 1, e => Promise.reject(Error())); >Error : ErrorConstructor const g = p.catch(e => 'error'); ->g : Promise ->p.catch(e => 'error') : Promise ->p.catch : { (onrejected: (reason: any) => TResult | PromiseLike): Promise; (onrejected: (reason: any) => boolean | PromiseLike): Promise; } +>g : Promise +>p.catch(e => 'error') : Promise +>p.catch : { (onrejected?: (reason: any) => boolean | PromiseLike): Promise; (onrejected: (reason: any) => TResult | PromiseLike): Promise; } >p : Promise ->catch : { (onrejected: (reason: any) => TResult | PromiseLike): Promise; (onrejected: (reason: any) => boolean | PromiseLike): Promise; } ->e => 'error' : (e: any) => string +>catch : { (onrejected?: (reason: any) => boolean | PromiseLike): Promise; (onrejected: (reason: any) => TResult | PromiseLike): Promise; } +>e => 'error' : (e: any) => "error" >e : any ->'error' : string +>'error' : "error" const h = p.catch(e => { }); >h : Promise >p.catch(e => { }) : Promise ->p.catch : { (onrejected: (reason: any) => TResult | PromiseLike): Promise; (onrejected: (reason: any) => boolean | PromiseLike): Promise; } +>p.catch : { (onrejected?: (reason: any) => boolean | PromiseLike): Promise; (onrejected: (reason: any) => TResult | PromiseLike): Promise; } >p : Promise ->catch : { (onrejected: (reason: any) => TResult | PromiseLike): Promise; (onrejected: (reason: any) => boolean | PromiseLike): Promise; } +>catch : { (onrejected?: (reason: any) => boolean | PromiseLike): Promise; (onrejected: (reason: any) => TResult | PromiseLike): Promise; } >e => { } : (e: any) => void >e : any const i = p.catch(e => { throw Error(); }); >i : Promise >p.catch(e => { throw Error(); }) : Promise ->p.catch : { (onrejected: (reason: any) => TResult | PromiseLike): Promise; (onrejected: (reason: any) => boolean | PromiseLike): Promise; } +>p.catch : { (onrejected?: (reason: any) => boolean | PromiseLike): Promise; (onrejected: (reason: any) => TResult | PromiseLike): Promise; } >p : Promise ->catch : { (onrejected: (reason: any) => TResult | PromiseLike): Promise; (onrejected: (reason: any) => boolean | PromiseLike): Promise; } +>catch : { (onrejected?: (reason: any) => boolean | PromiseLike): Promise; (onrejected: (reason: any) => TResult | PromiseLike): Promise; } >e => { throw Error(); } : (e: any) => never >e : any >Error() : Error @@ -110,9 +110,9 @@ const i = p.catch(e => { throw Error(); }); const j = p.catch(e => Promise.reject(Error())); >j : Promise >p.catch(e => Promise.reject(Error())) : Promise ->p.catch : { (onrejected: (reason: any) => TResult | PromiseLike): Promise; (onrejected: (reason: any) => boolean | PromiseLike): Promise; } +>p.catch : { (onrejected?: (reason: any) => boolean | PromiseLike): Promise; (onrejected: (reason: any) => TResult | PromiseLike): Promise; } >p : Promise ->catch : { (onrejected: (reason: any) => TResult | PromiseLike): Promise; (onrejected: (reason: any) => boolean | PromiseLike): Promise; } +>catch : { (onrejected?: (reason: any) => boolean | PromiseLike): Promise; (onrejected: (reason: any) => TResult | PromiseLike): Promise; } >e => Promise.reject(Error()) : (e: any) => Promise >e : any >Promise.reject(Error()) : Promise @@ -143,7 +143,7 @@ async function B() { >p : Promise return 1; ->1 : number +>1 : 1 } // NOTE: This reports a "No best comment type exists among return expressions." error, and is @@ -168,7 +168,7 @@ async function D() { >p : Promise return 1; ->1 : number +>1 : 1 } catch (e) { >e : any @@ -185,7 +185,7 @@ async function E() { >p : Promise return 1; ->1 : number +>1 : 1 } catch (e) { >e : any @@ -206,7 +206,7 @@ async function F() { >p : Promise return 1; ->1 : number +>1 : 1 } catch (e) { >e : any @@ -285,3 +285,616 @@ async function I() { >Error : ErrorConstructor } } + +// addresses github issue #4903: + +const p00 = p.catch(); +>p00 : Promise +>p.catch() : Promise +>p.catch : { (onrejected?: (reason: any) => boolean | PromiseLike): Promise; (onrejected: (reason: any) => TResult | PromiseLike): Promise; } +>p : Promise +>catch : { (onrejected?: (reason: any) => boolean | PromiseLike): Promise; (onrejected: (reason: any) => TResult | PromiseLike): Promise; } + +const p01 = p.catch(undefined); +>p01 : Promise +>p.catch(undefined) : Promise +>p.catch : { (onrejected?: (reason: any) => boolean | PromiseLike): Promise; (onrejected: (reason: any) => TResult | PromiseLike): Promise; } +>p : Promise +>catch : { (onrejected?: (reason: any) => boolean | PromiseLike): Promise; (onrejected: (reason: any) => TResult | PromiseLike): Promise; } +>undefined : undefined + +const p07 = p.catch(null); +>p07 : Promise +>p.catch(null) : Promise +>p.catch : { (onrejected?: (reason: any) => boolean | PromiseLike): Promise; (onrejected: (reason: any) => TResult | PromiseLike): Promise; } +>p : Promise +>catch : { (onrejected?: (reason: any) => boolean | PromiseLike): Promise; (onrejected: (reason: any) => TResult | PromiseLike): Promise; } +>null : null + +const p02 = p.catch(() => 1); +>p02 : Promise +>p.catch(() => 1) : Promise +>p.catch : { (onrejected?: (reason: any) => boolean | PromiseLike): Promise; (onrejected: (reason: any) => TResult | PromiseLike): Promise; } +>p : Promise +>catch : { (onrejected?: (reason: any) => boolean | PromiseLike): Promise; (onrejected: (reason: any) => TResult | PromiseLike): Promise; } +>() => 1 : () => 1 +>1 : 1 + +const p03 = p.catch(() => {}); +>p03 : Promise +>p.catch(() => {}) : Promise +>p.catch : { (onrejected?: (reason: any) => boolean | PromiseLike): Promise; (onrejected: (reason: any) => TResult | PromiseLike): Promise; } +>p : Promise +>catch : { (onrejected?: (reason: any) => boolean | PromiseLike): Promise; (onrejected: (reason: any) => TResult | PromiseLike): Promise; } +>() => {} : () => void + +const p04 = p.catch(() => {throw 1}); +>p04 : Promise +>p.catch(() => {throw 1}) : Promise +>p.catch : { (onrejected?: (reason: any) => boolean | PromiseLike): Promise; (onrejected: (reason: any) => TResult | PromiseLike): Promise; } +>p : Promise +>catch : { (onrejected?: (reason: any) => boolean | PromiseLike): Promise; (onrejected: (reason: any) => TResult | PromiseLike): Promise; } +>() => {throw 1} : () => never +>1 : 1 + +const p05 = p.catch(() => Promise.reject(1)); +>p05 : Promise +>p.catch(() => Promise.reject(1)) : Promise +>p.catch : { (onrejected?: (reason: any) => boolean | PromiseLike): Promise; (onrejected: (reason: any) => TResult | PromiseLike): Promise; } +>p : Promise +>catch : { (onrejected?: (reason: any) => boolean | PromiseLike): Promise; (onrejected: (reason: any) => TResult | PromiseLike): Promise; } +>() => Promise.reject(1) : () => Promise +>Promise.reject(1) : Promise +>Promise.reject : { (reason: any): Promise; (reason: any): Promise; } +>Promise : PromiseConstructor +>reject : { (reason: any): Promise; (reason: any): Promise; } +>1 : 1 + +const p06 = p.catch(() => Promise.resolve(1)); +>p06 : Promise +>p.catch(() => Promise.resolve(1)) : Promise +>p.catch : { (onrejected?: (reason: any) => boolean | PromiseLike): Promise; (onrejected: (reason: any) => TResult | PromiseLike): Promise; } +>p : Promise +>catch : { (onrejected?: (reason: any) => boolean | PromiseLike): Promise; (onrejected: (reason: any) => TResult | PromiseLike): Promise; } +>() => Promise.resolve(1) : () => Promise +>Promise.resolve(1) : Promise +>Promise.resolve : { (value: T | PromiseLike): Promise; (): Promise; } +>Promise : PromiseConstructor +>resolve : { (value: T | PromiseLike): Promise; (): Promise; } +>1 : 1 + +const p10 = p.then(); +>p10 : Promise +>p.then() : Promise +>p.then : { (onfulfilled?: (value: boolean) => boolean | PromiseLike, onrejected?: (reason: any) => boolean | PromiseLike): Promise; (onfulfilled: (value: boolean) => boolean | PromiseLike, onrejected: (reason: any) => TResult | PromiseLike): Promise; (onfulfilled: (value: boolean) => TResult | PromiseLike, onrejected?: (reason: any) => TResult | PromiseLike): Promise; (onfulfilled: (value: boolean) => TResult1 | PromiseLike, onrejected: (reason: any) => TResult2 | PromiseLike): Promise; } +>p : Promise +>then : { (onfulfilled?: (value: boolean) => boolean | PromiseLike, onrejected?: (reason: any) => boolean | PromiseLike): Promise; (onfulfilled: (value: boolean) => boolean | PromiseLike, onrejected: (reason: any) => TResult | PromiseLike): Promise; (onfulfilled: (value: boolean) => TResult | PromiseLike, onrejected?: (reason: any) => TResult | PromiseLike): Promise; (onfulfilled: (value: boolean) => TResult1 | PromiseLike, onrejected: (reason: any) => TResult2 | PromiseLike): Promise; } + +const p20 = p.then(undefined); +>p20 : Promise +>p.then(undefined) : Promise +>p.then : { (onfulfilled?: (value: boolean) => boolean | PromiseLike, onrejected?: (reason: any) => boolean | PromiseLike): Promise; (onfulfilled: (value: boolean) => boolean | PromiseLike, onrejected: (reason: any) => TResult | PromiseLike): Promise; (onfulfilled: (value: boolean) => TResult | PromiseLike, onrejected?: (reason: any) => TResult | PromiseLike): Promise; (onfulfilled: (value: boolean) => TResult1 | PromiseLike, onrejected: (reason: any) => TResult2 | PromiseLike): Promise; } +>p : Promise +>then : { (onfulfilled?: (value: boolean) => boolean | PromiseLike, onrejected?: (reason: any) => boolean | PromiseLike): Promise; (onfulfilled: (value: boolean) => boolean | PromiseLike, onrejected: (reason: any) => TResult | PromiseLike): Promise; (onfulfilled: (value: boolean) => TResult | PromiseLike, onrejected?: (reason: any) => TResult | PromiseLike): Promise; (onfulfilled: (value: boolean) => TResult1 | PromiseLike, onrejected: (reason: any) => TResult2 | PromiseLike): Promise; } +>undefined : undefined + +const p21 = p.then(() => 1); +>p21 : Promise<1> +>p.then(() => 1) : Promise<1> +>p.then : { (onfulfilled?: (value: boolean) => boolean | PromiseLike, onrejected?: (reason: any) => boolean | PromiseLike): Promise; (onfulfilled: (value: boolean) => boolean | PromiseLike, onrejected: (reason: any) => TResult | PromiseLike): Promise; (onfulfilled: (value: boolean) => TResult | PromiseLike, onrejected?: (reason: any) => TResult | PromiseLike): Promise; (onfulfilled: (value: boolean) => TResult1 | PromiseLike, onrejected: (reason: any) => TResult2 | PromiseLike): Promise; } +>p : Promise +>then : { (onfulfilled?: (value: boolean) => boolean | PromiseLike, onrejected?: (reason: any) => boolean | PromiseLike): Promise; (onfulfilled: (value: boolean) => boolean | PromiseLike, onrejected: (reason: any) => TResult | PromiseLike): Promise; (onfulfilled: (value: boolean) => TResult | PromiseLike, onrejected?: (reason: any) => TResult | PromiseLike): Promise; (onfulfilled: (value: boolean) => TResult1 | PromiseLike, onrejected: (reason: any) => TResult2 | PromiseLike): Promise; } +>() => 1 : () => 1 +>1 : 1 + +const p22 = p.then(() => {}); +>p22 : Promise +>p.then(() => {}) : Promise +>p.then : { (onfulfilled?: (value: boolean) => boolean | PromiseLike, onrejected?: (reason: any) => boolean | PromiseLike): Promise; (onfulfilled: (value: boolean) => boolean | PromiseLike, onrejected: (reason: any) => TResult | PromiseLike): Promise; (onfulfilled: (value: boolean) => TResult | PromiseLike, onrejected?: (reason: any) => TResult | PromiseLike): Promise; (onfulfilled: (value: boolean) => TResult1 | PromiseLike, onrejected: (reason: any) => TResult2 | PromiseLike): Promise; } +>p : Promise +>then : { (onfulfilled?: (value: boolean) => boolean | PromiseLike, onrejected?: (reason: any) => boolean | PromiseLike): Promise; (onfulfilled: (value: boolean) => boolean | PromiseLike, onrejected: (reason: any) => TResult | PromiseLike): Promise; (onfulfilled: (value: boolean) => TResult | PromiseLike, onrejected?: (reason: any) => TResult | PromiseLike): Promise; (onfulfilled: (value: boolean) => TResult1 | PromiseLike, onrejected: (reason: any) => TResult2 | PromiseLike): Promise; } +>() => {} : () => void + +const p23 = p.then(() => {throw 1}); +>p23 : Promise +>p.then(() => {throw 1}) : Promise +>p.then : { (onfulfilled?: (value: boolean) => boolean | PromiseLike, onrejected?: (reason: any) => boolean | PromiseLike): Promise; (onfulfilled: (value: boolean) => boolean | PromiseLike, onrejected: (reason: any) => TResult | PromiseLike): Promise; (onfulfilled: (value: boolean) => TResult | PromiseLike, onrejected?: (reason: any) => TResult | PromiseLike): Promise; (onfulfilled: (value: boolean) => TResult1 | PromiseLike, onrejected: (reason: any) => TResult2 | PromiseLike): Promise; } +>p : Promise +>then : { (onfulfilled?: (value: boolean) => boolean | PromiseLike, onrejected?: (reason: any) => boolean | PromiseLike): Promise; (onfulfilled: (value: boolean) => boolean | PromiseLike, onrejected: (reason: any) => TResult | PromiseLike): Promise; (onfulfilled: (value: boolean) => TResult | PromiseLike, onrejected?: (reason: any) => TResult | PromiseLike): Promise; (onfulfilled: (value: boolean) => TResult1 | PromiseLike, onrejected: (reason: any) => TResult2 | PromiseLike): Promise; } +>() => {throw 1} : () => never +>1 : 1 + +const p24 = p.then(() => Promise.resolve(1)); +>p24 : Promise +>p.then(() => Promise.resolve(1)) : Promise +>p.then : { (onfulfilled?: (value: boolean) => boolean | PromiseLike, onrejected?: (reason: any) => boolean | PromiseLike): Promise; (onfulfilled: (value: boolean) => boolean | PromiseLike, onrejected: (reason: any) => TResult | PromiseLike): Promise; (onfulfilled: (value: boolean) => TResult | PromiseLike, onrejected?: (reason: any) => TResult | PromiseLike): Promise; (onfulfilled: (value: boolean) => TResult1 | PromiseLike, onrejected: (reason: any) => TResult2 | PromiseLike): Promise; } +>p : Promise +>then : { (onfulfilled?: (value: boolean) => boolean | PromiseLike, onrejected?: (reason: any) => boolean | PromiseLike): Promise; (onfulfilled: (value: boolean) => boolean | PromiseLike, onrejected: (reason: any) => TResult | PromiseLike): Promise; (onfulfilled: (value: boolean) => TResult | PromiseLike, onrejected?: (reason: any) => TResult | PromiseLike): Promise; (onfulfilled: (value: boolean) => TResult1 | PromiseLike, onrejected: (reason: any) => TResult2 | PromiseLike): Promise; } +>() => Promise.resolve(1) : () => Promise +>Promise.resolve(1) : Promise +>Promise.resolve : { (value: T | PromiseLike): Promise; (): Promise; } +>Promise : PromiseConstructor +>resolve : { (value: T | PromiseLike): Promise; (): Promise; } +>1 : 1 + +const p25 = p.then(() => Promise.reject(1)); +>p25 : Promise +>p.then(() => Promise.reject(1)) : Promise +>p.then : { (onfulfilled?: (value: boolean) => boolean | PromiseLike, onrejected?: (reason: any) => boolean | PromiseLike): Promise; (onfulfilled: (value: boolean) => boolean | PromiseLike, onrejected: (reason: any) => TResult | PromiseLike): Promise; (onfulfilled: (value: boolean) => TResult | PromiseLike, onrejected?: (reason: any) => TResult | PromiseLike): Promise; (onfulfilled: (value: boolean) => TResult1 | PromiseLike, onrejected: (reason: any) => TResult2 | PromiseLike): Promise; } +>p : Promise +>then : { (onfulfilled?: (value: boolean) => boolean | PromiseLike, onrejected?: (reason: any) => boolean | PromiseLike): Promise; (onfulfilled: (value: boolean) => boolean | PromiseLike, onrejected: (reason: any) => TResult | PromiseLike): Promise; (onfulfilled: (value: boolean) => TResult | PromiseLike, onrejected?: (reason: any) => TResult | PromiseLike): Promise; (onfulfilled: (value: boolean) => TResult1 | PromiseLike, onrejected: (reason: any) => TResult2 | PromiseLike): Promise; } +>() => Promise.reject(1) : () => Promise +>Promise.reject(1) : Promise +>Promise.reject : { (reason: any): Promise; (reason: any): Promise; } +>Promise : PromiseConstructor +>reject : { (reason: any): Promise; (reason: any): Promise; } +>1 : 1 + +const p30 = p.then(undefined, undefined); +>p30 : Promise +>p.then(undefined, undefined) : Promise +>p.then : { (onfulfilled?: (value: boolean) => boolean | PromiseLike, onrejected?: (reason: any) => boolean | PromiseLike): Promise; (onfulfilled: (value: boolean) => boolean | PromiseLike, onrejected: (reason: any) => TResult | PromiseLike): Promise; (onfulfilled: (value: boolean) => TResult | PromiseLike, onrejected?: (reason: any) => TResult | PromiseLike): Promise; (onfulfilled: (value: boolean) => TResult1 | PromiseLike, onrejected: (reason: any) => TResult2 | PromiseLike): Promise; } +>p : Promise +>then : { (onfulfilled?: (value: boolean) => boolean | PromiseLike, onrejected?: (reason: any) => boolean | PromiseLike): Promise; (onfulfilled: (value: boolean) => boolean | PromiseLike, onrejected: (reason: any) => TResult | PromiseLike): Promise; (onfulfilled: (value: boolean) => TResult | PromiseLike, onrejected?: (reason: any) => TResult | PromiseLike): Promise; (onfulfilled: (value: boolean) => TResult1 | PromiseLike, onrejected: (reason: any) => TResult2 | PromiseLike): Promise; } +>undefined : undefined +>undefined : undefined + +const p31 = p.then(undefined, () => 1); +>p31 : Promise +>p.then(undefined, () => 1) : Promise +>p.then : { (onfulfilled?: (value: boolean) => boolean | PromiseLike, onrejected?: (reason: any) => boolean | PromiseLike): Promise; (onfulfilled: (value: boolean) => boolean | PromiseLike, onrejected: (reason: any) => TResult | PromiseLike): Promise; (onfulfilled: (value: boolean) => TResult | PromiseLike, onrejected?: (reason: any) => TResult | PromiseLike): Promise; (onfulfilled: (value: boolean) => TResult1 | PromiseLike, onrejected: (reason: any) => TResult2 | PromiseLike): Promise; } +>p : Promise +>then : { (onfulfilled?: (value: boolean) => boolean | PromiseLike, onrejected?: (reason: any) => boolean | PromiseLike): Promise; (onfulfilled: (value: boolean) => boolean | PromiseLike, onrejected: (reason: any) => TResult | PromiseLike): Promise; (onfulfilled: (value: boolean) => TResult | PromiseLike, onrejected?: (reason: any) => TResult | PromiseLike): Promise; (onfulfilled: (value: boolean) => TResult1 | PromiseLike, onrejected: (reason: any) => TResult2 | PromiseLike): Promise; } +>undefined : undefined +>() => 1 : () => 1 +>1 : 1 + +const p32 = p.then(undefined, () => {}); +>p32 : Promise +>p.then(undefined, () => {}) : Promise +>p.then : { (onfulfilled?: (value: boolean) => boolean | PromiseLike, onrejected?: (reason: any) => boolean | PromiseLike): Promise; (onfulfilled: (value: boolean) => boolean | PromiseLike, onrejected: (reason: any) => TResult | PromiseLike): Promise; (onfulfilled: (value: boolean) => TResult | PromiseLike, onrejected?: (reason: any) => TResult | PromiseLike): Promise; (onfulfilled: (value: boolean) => TResult1 | PromiseLike, onrejected: (reason: any) => TResult2 | PromiseLike): Promise; } +>p : Promise +>then : { (onfulfilled?: (value: boolean) => boolean | PromiseLike, onrejected?: (reason: any) => boolean | PromiseLike): Promise; (onfulfilled: (value: boolean) => boolean | PromiseLike, onrejected: (reason: any) => TResult | PromiseLike): Promise; (onfulfilled: (value: boolean) => TResult | PromiseLike, onrejected?: (reason: any) => TResult | PromiseLike): Promise; (onfulfilled: (value: boolean) => TResult1 | PromiseLike, onrejected: (reason: any) => TResult2 | PromiseLike): Promise; } +>undefined : undefined +>() => {} : () => void + +const p33 = p.then(undefined, () => {throw 1}); +>p33 : Promise +>p.then(undefined, () => {throw 1}) : Promise +>p.then : { (onfulfilled?: (value: boolean) => boolean | PromiseLike, onrejected?: (reason: any) => boolean | PromiseLike): Promise; (onfulfilled: (value: boolean) => boolean | PromiseLike, onrejected: (reason: any) => TResult | PromiseLike): Promise; (onfulfilled: (value: boolean) => TResult | PromiseLike, onrejected?: (reason: any) => TResult | PromiseLike): Promise; (onfulfilled: (value: boolean) => TResult1 | PromiseLike, onrejected: (reason: any) => TResult2 | PromiseLike): Promise; } +>p : Promise +>then : { (onfulfilled?: (value: boolean) => boolean | PromiseLike, onrejected?: (reason: any) => boolean | PromiseLike): Promise; (onfulfilled: (value: boolean) => boolean | PromiseLike, onrejected: (reason: any) => TResult | PromiseLike): Promise; (onfulfilled: (value: boolean) => TResult | PromiseLike, onrejected?: (reason: any) => TResult | PromiseLike): Promise; (onfulfilled: (value: boolean) => TResult1 | PromiseLike, onrejected: (reason: any) => TResult2 | PromiseLike): Promise; } +>undefined : undefined +>() => {throw 1} : () => never +>1 : 1 + +const p34 = p.then(undefined, () => Promise.resolve(1)); +>p34 : Promise +>p.then(undefined, () => Promise.resolve(1)) : Promise +>p.then : { (onfulfilled?: (value: boolean) => boolean | PromiseLike, onrejected?: (reason: any) => boolean | PromiseLike): Promise; (onfulfilled: (value: boolean) => boolean | PromiseLike, onrejected: (reason: any) => TResult | PromiseLike): Promise; (onfulfilled: (value: boolean) => TResult | PromiseLike, onrejected?: (reason: any) => TResult | PromiseLike): Promise; (onfulfilled: (value: boolean) => TResult1 | PromiseLike, onrejected: (reason: any) => TResult2 | PromiseLike): Promise; } +>p : Promise +>then : { (onfulfilled?: (value: boolean) => boolean | PromiseLike, onrejected?: (reason: any) => boolean | PromiseLike): Promise; (onfulfilled: (value: boolean) => boolean | PromiseLike, onrejected: (reason: any) => TResult | PromiseLike): Promise; (onfulfilled: (value: boolean) => TResult | PromiseLike, onrejected?: (reason: any) => TResult | PromiseLike): Promise; (onfulfilled: (value: boolean) => TResult1 | PromiseLike, onrejected: (reason: any) => TResult2 | PromiseLike): Promise; } +>undefined : undefined +>() => Promise.resolve(1) : () => Promise +>Promise.resolve(1) : Promise +>Promise.resolve : { (value: T | PromiseLike): Promise; (): Promise; } +>Promise : PromiseConstructor +>resolve : { (value: T | PromiseLike): Promise; (): Promise; } +>1 : 1 + +const p35 = p.then(undefined, () => Promise.reject(1)); +>p35 : Promise +>p.then(undefined, () => Promise.reject(1)) : Promise +>p.then : { (onfulfilled?: (value: boolean) => boolean | PromiseLike, onrejected?: (reason: any) => boolean | PromiseLike): Promise; (onfulfilled: (value: boolean) => boolean | PromiseLike, onrejected: (reason: any) => TResult | PromiseLike): Promise; (onfulfilled: (value: boolean) => TResult | PromiseLike, onrejected?: (reason: any) => TResult | PromiseLike): Promise; (onfulfilled: (value: boolean) => TResult1 | PromiseLike, onrejected: (reason: any) => TResult2 | PromiseLike): Promise; } +>p : Promise +>then : { (onfulfilled?: (value: boolean) => boolean | PromiseLike, onrejected?: (reason: any) => boolean | PromiseLike): Promise; (onfulfilled: (value: boolean) => boolean | PromiseLike, onrejected: (reason: any) => TResult | PromiseLike): Promise; (onfulfilled: (value: boolean) => TResult | PromiseLike, onrejected?: (reason: any) => TResult | PromiseLike): Promise; (onfulfilled: (value: boolean) => TResult1 | PromiseLike, onrejected: (reason: any) => TResult2 | PromiseLike): Promise; } +>undefined : undefined +>() => Promise.reject(1) : () => Promise +>Promise.reject(1) : Promise +>Promise.reject : { (reason: any): Promise; (reason: any): Promise; } +>Promise : PromiseConstructor +>reject : { (reason: any): Promise; (reason: any): Promise; } +>1 : 1 + +const p40 = p.then(() => "1", undefined); +>p40 : Promise<"1"> +>p.then(() => "1", undefined) : Promise<"1"> +>p.then : { (onfulfilled?: (value: boolean) => boolean | PromiseLike, onrejected?: (reason: any) => boolean | PromiseLike): Promise; (onfulfilled: (value: boolean) => boolean | PromiseLike, onrejected: (reason: any) => TResult | PromiseLike): Promise; (onfulfilled: (value: boolean) => TResult | PromiseLike, onrejected?: (reason: any) => TResult | PromiseLike): Promise; (onfulfilled: (value: boolean) => TResult1 | PromiseLike, onrejected: (reason: any) => TResult2 | PromiseLike): Promise; } +>p : Promise +>then : { (onfulfilled?: (value: boolean) => boolean | PromiseLike, onrejected?: (reason: any) => boolean | PromiseLike): Promise; (onfulfilled: (value: boolean) => boolean | PromiseLike, onrejected: (reason: any) => TResult | PromiseLike): Promise; (onfulfilled: (value: boolean) => TResult | PromiseLike, onrejected?: (reason: any) => TResult | PromiseLike): Promise; (onfulfilled: (value: boolean) => TResult1 | PromiseLike, onrejected: (reason: any) => TResult2 | PromiseLike): Promise; } +>() => "1" : () => "1" +>"1" : "1" +>undefined : undefined + +const p41 = p.then(() => "1", () => 1); +>p41 : Promise +>p.then(() => "1", () => 1) : Promise +>p.then : { (onfulfilled?: (value: boolean) => boolean | PromiseLike, onrejected?: (reason: any) => boolean | PromiseLike): Promise; (onfulfilled: (value: boolean) => boolean | PromiseLike, onrejected: (reason: any) => TResult | PromiseLike): Promise; (onfulfilled: (value: boolean) => TResult | PromiseLike, onrejected?: (reason: any) => TResult | PromiseLike): Promise; (onfulfilled: (value: boolean) => TResult1 | PromiseLike, onrejected: (reason: any) => TResult2 | PromiseLike): Promise; } +>p : Promise +>then : { (onfulfilled?: (value: boolean) => boolean | PromiseLike, onrejected?: (reason: any) => boolean | PromiseLike): Promise; (onfulfilled: (value: boolean) => boolean | PromiseLike, onrejected: (reason: any) => TResult | PromiseLike): Promise; (onfulfilled: (value: boolean) => TResult | PromiseLike, onrejected?: (reason: any) => TResult | PromiseLike): Promise; (onfulfilled: (value: boolean) => TResult1 | PromiseLike, onrejected: (reason: any) => TResult2 | PromiseLike): Promise; } +>() => "1" : () => "1" +>"1" : "1" +>() => 1 : () => number +>1 : 1 + +const p42 = p.then(() => "1", () => {}); +>p42 : Promise +>p.then(() => "1", () => {}) : Promise +>p.then : { (onfulfilled?: (value: boolean) => boolean | PromiseLike, onrejected?: (reason: any) => boolean | PromiseLike): Promise; (onfulfilled: (value: boolean) => boolean | PromiseLike, onrejected: (reason: any) => TResult | PromiseLike): Promise; (onfulfilled: (value: boolean) => TResult | PromiseLike, onrejected?: (reason: any) => TResult | PromiseLike): Promise; (onfulfilled: (value: boolean) => TResult1 | PromiseLike, onrejected: (reason: any) => TResult2 | PromiseLike): Promise; } +>p : Promise +>then : { (onfulfilled?: (value: boolean) => boolean | PromiseLike, onrejected?: (reason: any) => boolean | PromiseLike): Promise; (onfulfilled: (value: boolean) => boolean | PromiseLike, onrejected: (reason: any) => TResult | PromiseLike): Promise; (onfulfilled: (value: boolean) => TResult | PromiseLike, onrejected?: (reason: any) => TResult | PromiseLike): Promise; (onfulfilled: (value: boolean) => TResult1 | PromiseLike, onrejected: (reason: any) => TResult2 | PromiseLike): Promise; } +>() => "1" : () => "1" +>"1" : "1" +>() => {} : () => void + +const p43 = p.then(() => "1", () => {throw 1}); +>p43 : Promise<"1"> +>p.then(() => "1", () => {throw 1}) : Promise<"1"> +>p.then : { (onfulfilled?: (value: boolean) => boolean | PromiseLike, onrejected?: (reason: any) => boolean | PromiseLike): Promise; (onfulfilled: (value: boolean) => boolean | PromiseLike, onrejected: (reason: any) => TResult | PromiseLike): Promise; (onfulfilled: (value: boolean) => TResult | PromiseLike, onrejected?: (reason: any) => TResult | PromiseLike): Promise; (onfulfilled: (value: boolean) => TResult1 | PromiseLike, onrejected: (reason: any) => TResult2 | PromiseLike): Promise; } +>p : Promise +>then : { (onfulfilled?: (value: boolean) => boolean | PromiseLike, onrejected?: (reason: any) => boolean | PromiseLike): Promise; (onfulfilled: (value: boolean) => boolean | PromiseLike, onrejected: (reason: any) => TResult | PromiseLike): Promise; (onfulfilled: (value: boolean) => TResult | PromiseLike, onrejected?: (reason: any) => TResult | PromiseLike): Promise; (onfulfilled: (value: boolean) => TResult1 | PromiseLike, onrejected: (reason: any) => TResult2 | PromiseLike): Promise; } +>() => "1" : () => "1" +>"1" : "1" +>() => {throw 1} : () => never +>1 : 1 + +const p44 = p.then(() => "1", () => Promise.resolve(1)); +>p44 : Promise +>p.then(() => "1", () => Promise.resolve(1)) : Promise +>p.then : { (onfulfilled?: (value: boolean) => boolean | PromiseLike, onrejected?: (reason: any) => boolean | PromiseLike): Promise; (onfulfilled: (value: boolean) => boolean | PromiseLike, onrejected: (reason: any) => TResult | PromiseLike): Promise; (onfulfilled: (value: boolean) => TResult | PromiseLike, onrejected?: (reason: any) => TResult | PromiseLike): Promise; (onfulfilled: (value: boolean) => TResult1 | PromiseLike, onrejected: (reason: any) => TResult2 | PromiseLike): Promise; } +>p : Promise +>then : { (onfulfilled?: (value: boolean) => boolean | PromiseLike, onrejected?: (reason: any) => boolean | PromiseLike): Promise; (onfulfilled: (value: boolean) => boolean | PromiseLike, onrejected: (reason: any) => TResult | PromiseLike): Promise; (onfulfilled: (value: boolean) => TResult | PromiseLike, onrejected?: (reason: any) => TResult | PromiseLike): Promise; (onfulfilled: (value: boolean) => TResult1 | PromiseLike, onrejected: (reason: any) => TResult2 | PromiseLike): Promise; } +>() => "1" : () => "1" +>"1" : "1" +>() => Promise.resolve(1) : () => Promise +>Promise.resolve(1) : Promise +>Promise.resolve : { (value: T | PromiseLike): Promise; (): Promise; } +>Promise : PromiseConstructor +>resolve : { (value: T | PromiseLike): Promise; (): Promise; } +>1 : 1 + +const p45 = p.then(() => "1", () => Promise.reject(1)); +>p45 : Promise<"1"> +>p.then(() => "1", () => Promise.reject(1)) : Promise<"1"> +>p.then : { (onfulfilled?: (value: boolean) => boolean | PromiseLike, onrejected?: (reason: any) => boolean | PromiseLike): Promise; (onfulfilled: (value: boolean) => boolean | PromiseLike, onrejected: (reason: any) => TResult | PromiseLike): Promise; (onfulfilled: (value: boolean) => TResult | PromiseLike, onrejected?: (reason: any) => TResult | PromiseLike): Promise; (onfulfilled: (value: boolean) => TResult1 | PromiseLike, onrejected: (reason: any) => TResult2 | PromiseLike): Promise; } +>p : Promise +>then : { (onfulfilled?: (value: boolean) => boolean | PromiseLike, onrejected?: (reason: any) => boolean | PromiseLike): Promise; (onfulfilled: (value: boolean) => boolean | PromiseLike, onrejected: (reason: any) => TResult | PromiseLike): Promise; (onfulfilled: (value: boolean) => TResult | PromiseLike, onrejected?: (reason: any) => TResult | PromiseLike): Promise; (onfulfilled: (value: boolean) => TResult1 | PromiseLike, onrejected: (reason: any) => TResult2 | PromiseLike): Promise; } +>() => "1" : () => "1" +>"1" : "1" +>() => Promise.reject(1) : () => Promise +>Promise.reject(1) : Promise +>Promise.reject : { (reason: any): Promise; (reason: any): Promise; } +>Promise : PromiseConstructor +>reject : { (reason: any): Promise; (reason: any): Promise; } +>1 : 1 + +const p50 = p.then(() => {}, undefined); +>p50 : Promise +>p.then(() => {}, undefined) : Promise +>p.then : { (onfulfilled?: (value: boolean) => boolean | PromiseLike, onrejected?: (reason: any) => boolean | PromiseLike): Promise; (onfulfilled: (value: boolean) => boolean | PromiseLike, onrejected: (reason: any) => TResult | PromiseLike): Promise; (onfulfilled: (value: boolean) => TResult | PromiseLike, onrejected?: (reason: any) => TResult | PromiseLike): Promise; (onfulfilled: (value: boolean) => TResult1 | PromiseLike, onrejected: (reason: any) => TResult2 | PromiseLike): Promise; } +>p : Promise +>then : { (onfulfilled?: (value: boolean) => boolean | PromiseLike, onrejected?: (reason: any) => boolean | PromiseLike): Promise; (onfulfilled: (value: boolean) => boolean | PromiseLike, onrejected: (reason: any) => TResult | PromiseLike): Promise; (onfulfilled: (value: boolean) => TResult | PromiseLike, onrejected?: (reason: any) => TResult | PromiseLike): Promise; (onfulfilled: (value: boolean) => TResult1 | PromiseLike, onrejected: (reason: any) => TResult2 | PromiseLike): Promise; } +>() => {} : () => void +>undefined : undefined + +const p51 = p.then(() => {}, () => 1); +>p51 : Promise +>p.then(() => {}, () => 1) : Promise +>p.then : { (onfulfilled?: (value: boolean) => boolean | PromiseLike, onrejected?: (reason: any) => boolean | PromiseLike): Promise; (onfulfilled: (value: boolean) => boolean | PromiseLike, onrejected: (reason: any) => TResult | PromiseLike): Promise; (onfulfilled: (value: boolean) => TResult | PromiseLike, onrejected?: (reason: any) => TResult | PromiseLike): Promise; (onfulfilled: (value: boolean) => TResult1 | PromiseLike, onrejected: (reason: any) => TResult2 | PromiseLike): Promise; } +>p : Promise +>then : { (onfulfilled?: (value: boolean) => boolean | PromiseLike, onrejected?: (reason: any) => boolean | PromiseLike): Promise; (onfulfilled: (value: boolean) => boolean | PromiseLike, onrejected: (reason: any) => TResult | PromiseLike): Promise; (onfulfilled: (value: boolean) => TResult | PromiseLike, onrejected?: (reason: any) => TResult | PromiseLike): Promise; (onfulfilled: (value: boolean) => TResult1 | PromiseLike, onrejected: (reason: any) => TResult2 | PromiseLike): Promise; } +>() => {} : () => void +>() => 1 : () => number +>1 : 1 + +const p52 = p.then(() => {}, () => {}); +>p52 : Promise +>p.then(() => {}, () => {}) : Promise +>p.then : { (onfulfilled?: (value: boolean) => boolean | PromiseLike, onrejected?: (reason: any) => boolean | PromiseLike): Promise; (onfulfilled: (value: boolean) => boolean | PromiseLike, onrejected: (reason: any) => TResult | PromiseLike): Promise; (onfulfilled: (value: boolean) => TResult | PromiseLike, onrejected?: (reason: any) => TResult | PromiseLike): Promise; (onfulfilled: (value: boolean) => TResult1 | PromiseLike, onrejected: (reason: any) => TResult2 | PromiseLike): Promise; } +>p : Promise +>then : { (onfulfilled?: (value: boolean) => boolean | PromiseLike, onrejected?: (reason: any) => boolean | PromiseLike): Promise; (onfulfilled: (value: boolean) => boolean | PromiseLike, onrejected: (reason: any) => TResult | PromiseLike): Promise; (onfulfilled: (value: boolean) => TResult | PromiseLike, onrejected?: (reason: any) => TResult | PromiseLike): Promise; (onfulfilled: (value: boolean) => TResult1 | PromiseLike, onrejected: (reason: any) => TResult2 | PromiseLike): Promise; } +>() => {} : () => void +>() => {} : () => void + +const p53 = p.then(() => {}, () => {throw 1}); +>p53 : Promise +>p.then(() => {}, () => {throw 1}) : Promise +>p.then : { (onfulfilled?: (value: boolean) => boolean | PromiseLike, onrejected?: (reason: any) => boolean | PromiseLike): Promise; (onfulfilled: (value: boolean) => boolean | PromiseLike, onrejected: (reason: any) => TResult | PromiseLike): Promise; (onfulfilled: (value: boolean) => TResult | PromiseLike, onrejected?: (reason: any) => TResult | PromiseLike): Promise; (onfulfilled: (value: boolean) => TResult1 | PromiseLike, onrejected: (reason: any) => TResult2 | PromiseLike): Promise; } +>p : Promise +>then : { (onfulfilled?: (value: boolean) => boolean | PromiseLike, onrejected?: (reason: any) => boolean | PromiseLike): Promise; (onfulfilled: (value: boolean) => boolean | PromiseLike, onrejected: (reason: any) => TResult | PromiseLike): Promise; (onfulfilled: (value: boolean) => TResult | PromiseLike, onrejected?: (reason: any) => TResult | PromiseLike): Promise; (onfulfilled: (value: boolean) => TResult1 | PromiseLike, onrejected: (reason: any) => TResult2 | PromiseLike): Promise; } +>() => {} : () => void +>() => {throw 1} : () => never +>1 : 1 + +const p54 = p.then(() => {}, () => Promise.resolve(1)); +>p54 : Promise +>p.then(() => {}, () => Promise.resolve(1)) : Promise +>p.then : { (onfulfilled?: (value: boolean) => boolean | PromiseLike, onrejected?: (reason: any) => boolean | PromiseLike): Promise; (onfulfilled: (value: boolean) => boolean | PromiseLike, onrejected: (reason: any) => TResult | PromiseLike): Promise; (onfulfilled: (value: boolean) => TResult | PromiseLike, onrejected?: (reason: any) => TResult | PromiseLike): Promise; (onfulfilled: (value: boolean) => TResult1 | PromiseLike, onrejected: (reason: any) => TResult2 | PromiseLike): Promise; } +>p : Promise +>then : { (onfulfilled?: (value: boolean) => boolean | PromiseLike, onrejected?: (reason: any) => boolean | PromiseLike): Promise; (onfulfilled: (value: boolean) => boolean | PromiseLike, onrejected: (reason: any) => TResult | PromiseLike): Promise; (onfulfilled: (value: boolean) => TResult | PromiseLike, onrejected?: (reason: any) => TResult | PromiseLike): Promise; (onfulfilled: (value: boolean) => TResult1 | PromiseLike, onrejected: (reason: any) => TResult2 | PromiseLike): Promise; } +>() => {} : () => void +>() => Promise.resolve(1) : () => Promise +>Promise.resolve(1) : Promise +>Promise.resolve : { (value: T | PromiseLike): Promise; (): Promise; } +>Promise : PromiseConstructor +>resolve : { (value: T | PromiseLike): Promise; (): Promise; } +>1 : 1 + +const p55 = p.then(() => {}, () => Promise.reject(1)); +>p55 : Promise +>p.then(() => {}, () => Promise.reject(1)) : Promise +>p.then : { (onfulfilled?: (value: boolean) => boolean | PromiseLike, onrejected?: (reason: any) => boolean | PromiseLike): Promise; (onfulfilled: (value: boolean) => boolean | PromiseLike, onrejected: (reason: any) => TResult | PromiseLike): Promise; (onfulfilled: (value: boolean) => TResult | PromiseLike, onrejected?: (reason: any) => TResult | PromiseLike): Promise; (onfulfilled: (value: boolean) => TResult1 | PromiseLike, onrejected: (reason: any) => TResult2 | PromiseLike): Promise; } +>p : Promise +>then : { (onfulfilled?: (value: boolean) => boolean | PromiseLike, onrejected?: (reason: any) => boolean | PromiseLike): Promise; (onfulfilled: (value: boolean) => boolean | PromiseLike, onrejected: (reason: any) => TResult | PromiseLike): Promise; (onfulfilled: (value: boolean) => TResult | PromiseLike, onrejected?: (reason: any) => TResult | PromiseLike): Promise; (onfulfilled: (value: boolean) => TResult1 | PromiseLike, onrejected: (reason: any) => TResult2 | PromiseLike): Promise; } +>() => {} : () => void +>() => Promise.reject(1) : () => Promise +>Promise.reject(1) : Promise +>Promise.reject : { (reason: any): Promise; (reason: any): Promise; } +>Promise : PromiseConstructor +>reject : { (reason: any): Promise; (reason: any): Promise; } +>1 : 1 + +const p60 = p.then(() => {throw 1}, undefined); +>p60 : Promise +>p.then(() => {throw 1}, undefined) : Promise +>p.then : { (onfulfilled?: (value: boolean) => boolean | PromiseLike, onrejected?: (reason: any) => boolean | PromiseLike): Promise; (onfulfilled: (value: boolean) => boolean | PromiseLike, onrejected: (reason: any) => TResult | PromiseLike): Promise; (onfulfilled: (value: boolean) => TResult | PromiseLike, onrejected?: (reason: any) => TResult | PromiseLike): Promise; (onfulfilled: (value: boolean) => TResult1 | PromiseLike, onrejected: (reason: any) => TResult2 | PromiseLike): Promise; } +>p : Promise +>then : { (onfulfilled?: (value: boolean) => boolean | PromiseLike, onrejected?: (reason: any) => boolean | PromiseLike): Promise; (onfulfilled: (value: boolean) => boolean | PromiseLike, onrejected: (reason: any) => TResult | PromiseLike): Promise; (onfulfilled: (value: boolean) => TResult | PromiseLike, onrejected?: (reason: any) => TResult | PromiseLike): Promise; (onfulfilled: (value: boolean) => TResult1 | PromiseLike, onrejected: (reason: any) => TResult2 | PromiseLike): Promise; } +>() => {throw 1} : () => never +>1 : 1 +>undefined : undefined + +const p61 = p.then(() => {throw 1}, () => 1); +>p61 : Promise +>p.then(() => {throw 1}, () => 1) : Promise +>p.then : { (onfulfilled?: (value: boolean) => boolean | PromiseLike, onrejected?: (reason: any) => boolean | PromiseLike): Promise; (onfulfilled: (value: boolean) => boolean | PromiseLike, onrejected: (reason: any) => TResult | PromiseLike): Promise; (onfulfilled: (value: boolean) => TResult | PromiseLike, onrejected?: (reason: any) => TResult | PromiseLike): Promise; (onfulfilled: (value: boolean) => TResult1 | PromiseLike, onrejected: (reason: any) => TResult2 | PromiseLike): Promise; } +>p : Promise +>then : { (onfulfilled?: (value: boolean) => boolean | PromiseLike, onrejected?: (reason: any) => boolean | PromiseLike): Promise; (onfulfilled: (value: boolean) => boolean | PromiseLike, onrejected: (reason: any) => TResult | PromiseLike): Promise; (onfulfilled: (value: boolean) => TResult | PromiseLike, onrejected?: (reason: any) => TResult | PromiseLike): Promise; (onfulfilled: (value: boolean) => TResult1 | PromiseLike, onrejected: (reason: any) => TResult2 | PromiseLike): Promise; } +>() => {throw 1} : () => never +>1 : 1 +>() => 1 : () => 1 +>1 : 1 + +const p62 = p.then(() => {throw 1}, () => {}); +>p62 : Promise +>p.then(() => {throw 1}, () => {}) : Promise +>p.then : { (onfulfilled?: (value: boolean) => boolean | PromiseLike, onrejected?: (reason: any) => boolean | PromiseLike): Promise; (onfulfilled: (value: boolean) => boolean | PromiseLike, onrejected: (reason: any) => TResult | PromiseLike): Promise; (onfulfilled: (value: boolean) => TResult | PromiseLike, onrejected?: (reason: any) => TResult | PromiseLike): Promise; (onfulfilled: (value: boolean) => TResult1 | PromiseLike, onrejected: (reason: any) => TResult2 | PromiseLike): Promise; } +>p : Promise +>then : { (onfulfilled?: (value: boolean) => boolean | PromiseLike, onrejected?: (reason: any) => boolean | PromiseLike): Promise; (onfulfilled: (value: boolean) => boolean | PromiseLike, onrejected: (reason: any) => TResult | PromiseLike): Promise; (onfulfilled: (value: boolean) => TResult | PromiseLike, onrejected?: (reason: any) => TResult | PromiseLike): Promise; (onfulfilled: (value: boolean) => TResult1 | PromiseLike, onrejected: (reason: any) => TResult2 | PromiseLike): Promise; } +>() => {throw 1} : () => never +>1 : 1 +>() => {} : () => void + +const p63 = p.then(() => {throw 1}, () => {throw 1}); +>p63 : Promise +>p.then(() => {throw 1}, () => {throw 1}) : Promise +>p.then : { (onfulfilled?: (value: boolean) => boolean | PromiseLike, onrejected?: (reason: any) => boolean | PromiseLike): Promise; (onfulfilled: (value: boolean) => boolean | PromiseLike, onrejected: (reason: any) => TResult | PromiseLike): Promise; (onfulfilled: (value: boolean) => TResult | PromiseLike, onrejected?: (reason: any) => TResult | PromiseLike): Promise; (onfulfilled: (value: boolean) => TResult1 | PromiseLike, onrejected: (reason: any) => TResult2 | PromiseLike): Promise; } +>p : Promise +>then : { (onfulfilled?: (value: boolean) => boolean | PromiseLike, onrejected?: (reason: any) => boolean | PromiseLike): Promise; (onfulfilled: (value: boolean) => boolean | PromiseLike, onrejected: (reason: any) => TResult | PromiseLike): Promise; (onfulfilled: (value: boolean) => TResult | PromiseLike, onrejected?: (reason: any) => TResult | PromiseLike): Promise; (onfulfilled: (value: boolean) => TResult1 | PromiseLike, onrejected: (reason: any) => TResult2 | PromiseLike): Promise; } +>() => {throw 1} : () => never +>1 : 1 +>() => {throw 1} : () => never +>1 : 1 + +const p64 = p.then(() => {throw 1}, () => Promise.resolve(1)); +>p64 : Promise +>p.then(() => {throw 1}, () => Promise.resolve(1)) : Promise +>p.then : { (onfulfilled?: (value: boolean) => boolean | PromiseLike, onrejected?: (reason: any) => boolean | PromiseLike): Promise; (onfulfilled: (value: boolean) => boolean | PromiseLike, onrejected: (reason: any) => TResult | PromiseLike): Promise; (onfulfilled: (value: boolean) => TResult | PromiseLike, onrejected?: (reason: any) => TResult | PromiseLike): Promise; (onfulfilled: (value: boolean) => TResult1 | PromiseLike, onrejected: (reason: any) => TResult2 | PromiseLike): Promise; } +>p : Promise +>then : { (onfulfilled?: (value: boolean) => boolean | PromiseLike, onrejected?: (reason: any) => boolean | PromiseLike): Promise; (onfulfilled: (value: boolean) => boolean | PromiseLike, onrejected: (reason: any) => TResult | PromiseLike): Promise; (onfulfilled: (value: boolean) => TResult | PromiseLike, onrejected?: (reason: any) => TResult | PromiseLike): Promise; (onfulfilled: (value: boolean) => TResult1 | PromiseLike, onrejected: (reason: any) => TResult2 | PromiseLike): Promise; } +>() => {throw 1} : () => never +>1 : 1 +>() => Promise.resolve(1) : () => Promise +>Promise.resolve(1) : Promise +>Promise.resolve : { (value: T | PromiseLike): Promise; (): Promise; } +>Promise : PromiseConstructor +>resolve : { (value: T | PromiseLike): Promise; (): Promise; } +>1 : 1 + +const p65 = p.then(() => {throw 1}, () => Promise.reject(1)); +>p65 : Promise +>p.then(() => {throw 1}, () => Promise.reject(1)) : Promise +>p.then : { (onfulfilled?: (value: boolean) => boolean | PromiseLike, onrejected?: (reason: any) => boolean | PromiseLike): Promise; (onfulfilled: (value: boolean) => boolean | PromiseLike, onrejected: (reason: any) => TResult | PromiseLike): Promise; (onfulfilled: (value: boolean) => TResult | PromiseLike, onrejected?: (reason: any) => TResult | PromiseLike): Promise; (onfulfilled: (value: boolean) => TResult1 | PromiseLike, onrejected: (reason: any) => TResult2 | PromiseLike): Promise; } +>p : Promise +>then : { (onfulfilled?: (value: boolean) => boolean | PromiseLike, onrejected?: (reason: any) => boolean | PromiseLike): Promise; (onfulfilled: (value: boolean) => boolean | PromiseLike, onrejected: (reason: any) => TResult | PromiseLike): Promise; (onfulfilled: (value: boolean) => TResult | PromiseLike, onrejected?: (reason: any) => TResult | PromiseLike): Promise; (onfulfilled: (value: boolean) => TResult1 | PromiseLike, onrejected: (reason: any) => TResult2 | PromiseLike): Promise; } +>() => {throw 1} : () => never +>1 : 1 +>() => Promise.reject(1) : () => Promise +>Promise.reject(1) : Promise +>Promise.reject : { (reason: any): Promise; (reason: any): Promise; } +>Promise : PromiseConstructor +>reject : { (reason: any): Promise; (reason: any): Promise; } +>1 : 1 + +const p70 = p.then(() => Promise.resolve("1"), undefined); +>p70 : Promise +>p.then(() => Promise.resolve("1"), undefined) : Promise +>p.then : { (onfulfilled?: (value: boolean) => boolean | PromiseLike, onrejected?: (reason: any) => boolean | PromiseLike): Promise; (onfulfilled: (value: boolean) => boolean | PromiseLike, onrejected: (reason: any) => TResult | PromiseLike): Promise; (onfulfilled: (value: boolean) => TResult | PromiseLike, onrejected?: (reason: any) => TResult | PromiseLike): Promise; (onfulfilled: (value: boolean) => TResult1 | PromiseLike, onrejected: (reason: any) => TResult2 | PromiseLike): Promise; } +>p : Promise +>then : { (onfulfilled?: (value: boolean) => boolean | PromiseLike, onrejected?: (reason: any) => boolean | PromiseLike): Promise; (onfulfilled: (value: boolean) => boolean | PromiseLike, onrejected: (reason: any) => TResult | PromiseLike): Promise; (onfulfilled: (value: boolean) => TResult | PromiseLike, onrejected?: (reason: any) => TResult | PromiseLike): Promise; (onfulfilled: (value: boolean) => TResult1 | PromiseLike, onrejected: (reason: any) => TResult2 | PromiseLike): Promise; } +>() => Promise.resolve("1") : () => Promise +>Promise.resolve("1") : Promise +>Promise.resolve : { (value: T | PromiseLike): Promise; (): Promise; } +>Promise : PromiseConstructor +>resolve : { (value: T | PromiseLike): Promise; (): Promise; } +>"1" : "1" +>undefined : undefined + +const p71 = p.then(() => Promise.resolve("1"), () => 1); +>p71 : Promise +>p.then(() => Promise.resolve("1"), () => 1) : Promise +>p.then : { (onfulfilled?: (value: boolean) => boolean | PromiseLike, onrejected?: (reason: any) => boolean | PromiseLike): Promise; (onfulfilled: (value: boolean) => boolean | PromiseLike, onrejected: (reason: any) => TResult | PromiseLike): Promise; (onfulfilled: (value: boolean) => TResult | PromiseLike, onrejected?: (reason: any) => TResult | PromiseLike): Promise; (onfulfilled: (value: boolean) => TResult1 | PromiseLike, onrejected: (reason: any) => TResult2 | PromiseLike): Promise; } +>p : Promise +>then : { (onfulfilled?: (value: boolean) => boolean | PromiseLike, onrejected?: (reason: any) => boolean | PromiseLike): Promise; (onfulfilled: (value: boolean) => boolean | PromiseLike, onrejected: (reason: any) => TResult | PromiseLike): Promise; (onfulfilled: (value: boolean) => TResult | PromiseLike, onrejected?: (reason: any) => TResult | PromiseLike): Promise; (onfulfilled: (value: boolean) => TResult1 | PromiseLike, onrejected: (reason: any) => TResult2 | PromiseLike): Promise; } +>() => Promise.resolve("1") : () => Promise +>Promise.resolve("1") : Promise +>Promise.resolve : { (value: T | PromiseLike): Promise; (): Promise; } +>Promise : PromiseConstructor +>resolve : { (value: T | PromiseLike): Promise; (): Promise; } +>"1" : "1" +>() => 1 : () => number +>1 : 1 + +const p72 = p.then(() => Promise.resolve("1"), () => {}); +>p72 : Promise +>p.then(() => Promise.resolve("1"), () => {}) : Promise +>p.then : { (onfulfilled?: (value: boolean) => boolean | PromiseLike, onrejected?: (reason: any) => boolean | PromiseLike): Promise; (onfulfilled: (value: boolean) => boolean | PromiseLike, onrejected: (reason: any) => TResult | PromiseLike): Promise; (onfulfilled: (value: boolean) => TResult | PromiseLike, onrejected?: (reason: any) => TResult | PromiseLike): Promise; (onfulfilled: (value: boolean) => TResult1 | PromiseLike, onrejected: (reason: any) => TResult2 | PromiseLike): Promise; } +>p : Promise +>then : { (onfulfilled?: (value: boolean) => boolean | PromiseLike, onrejected?: (reason: any) => boolean | PromiseLike): Promise; (onfulfilled: (value: boolean) => boolean | PromiseLike, onrejected: (reason: any) => TResult | PromiseLike): Promise; (onfulfilled: (value: boolean) => TResult | PromiseLike, onrejected?: (reason: any) => TResult | PromiseLike): Promise; (onfulfilled: (value: boolean) => TResult1 | PromiseLike, onrejected: (reason: any) => TResult2 | PromiseLike): Promise; } +>() => Promise.resolve("1") : () => Promise +>Promise.resolve("1") : Promise +>Promise.resolve : { (value: T | PromiseLike): Promise; (): Promise; } +>Promise : PromiseConstructor +>resolve : { (value: T | PromiseLike): Promise; (): Promise; } +>"1" : "1" +>() => {} : () => void + +const p73 = p.then(() => Promise.resolve("1"), () => {throw 1}); +>p73 : Promise +>p.then(() => Promise.resolve("1"), () => {throw 1}) : Promise +>p.then : { (onfulfilled?: (value: boolean) => boolean | PromiseLike, onrejected?: (reason: any) => boolean | PromiseLike): Promise; (onfulfilled: (value: boolean) => boolean | PromiseLike, onrejected: (reason: any) => TResult | PromiseLike): Promise; (onfulfilled: (value: boolean) => TResult | PromiseLike, onrejected?: (reason: any) => TResult | PromiseLike): Promise; (onfulfilled: (value: boolean) => TResult1 | PromiseLike, onrejected: (reason: any) => TResult2 | PromiseLike): Promise; } +>p : Promise +>then : { (onfulfilled?: (value: boolean) => boolean | PromiseLike, onrejected?: (reason: any) => boolean | PromiseLike): Promise; (onfulfilled: (value: boolean) => boolean | PromiseLike, onrejected: (reason: any) => TResult | PromiseLike): Promise; (onfulfilled: (value: boolean) => TResult | PromiseLike, onrejected?: (reason: any) => TResult | PromiseLike): Promise; (onfulfilled: (value: boolean) => TResult1 | PromiseLike, onrejected: (reason: any) => TResult2 | PromiseLike): Promise; } +>() => Promise.resolve("1") : () => Promise +>Promise.resolve("1") : Promise +>Promise.resolve : { (value: T | PromiseLike): Promise; (): Promise; } +>Promise : PromiseConstructor +>resolve : { (value: T | PromiseLike): Promise; (): Promise; } +>"1" : "1" +>() => {throw 1} : () => never +>1 : 1 + +const p74 = p.then(() => Promise.resolve("1"), () => Promise.resolve(1)); +>p74 : Promise +>p.then(() => Promise.resolve("1"), () => Promise.resolve(1)) : Promise +>p.then : { (onfulfilled?: (value: boolean) => boolean | PromiseLike, onrejected?: (reason: any) => boolean | PromiseLike): Promise; (onfulfilled: (value: boolean) => boolean | PromiseLike, onrejected: (reason: any) => TResult | PromiseLike): Promise; (onfulfilled: (value: boolean) => TResult | PromiseLike, onrejected?: (reason: any) => TResult | PromiseLike): Promise; (onfulfilled: (value: boolean) => TResult1 | PromiseLike, onrejected: (reason: any) => TResult2 | PromiseLike): Promise; } +>p : Promise +>then : { (onfulfilled?: (value: boolean) => boolean | PromiseLike, onrejected?: (reason: any) => boolean | PromiseLike): Promise; (onfulfilled: (value: boolean) => boolean | PromiseLike, onrejected: (reason: any) => TResult | PromiseLike): Promise; (onfulfilled: (value: boolean) => TResult | PromiseLike, onrejected?: (reason: any) => TResult | PromiseLike): Promise; (onfulfilled: (value: boolean) => TResult1 | PromiseLike, onrejected: (reason: any) => TResult2 | PromiseLike): Promise; } +>() => Promise.resolve("1") : () => Promise +>Promise.resolve("1") : Promise +>Promise.resolve : { (value: T | PromiseLike): Promise; (): Promise; } +>Promise : PromiseConstructor +>resolve : { (value: T | PromiseLike): Promise; (): Promise; } +>"1" : "1" +>() => Promise.resolve(1) : () => Promise +>Promise.resolve(1) : Promise +>Promise.resolve : { (value: T | PromiseLike): Promise; (): Promise; } +>Promise : PromiseConstructor +>resolve : { (value: T | PromiseLike): Promise; (): Promise; } +>1 : 1 + +const p75 = p.then(() => Promise.resolve("1"), () => Promise.reject(1)); +>p75 : Promise +>p.then(() => Promise.resolve("1"), () => Promise.reject(1)) : Promise +>p.then : { (onfulfilled?: (value: boolean) => boolean | PromiseLike, onrejected?: (reason: any) => boolean | PromiseLike): Promise; (onfulfilled: (value: boolean) => boolean | PromiseLike, onrejected: (reason: any) => TResult | PromiseLike): Promise; (onfulfilled: (value: boolean) => TResult | PromiseLike, onrejected?: (reason: any) => TResult | PromiseLike): Promise; (onfulfilled: (value: boolean) => TResult1 | PromiseLike, onrejected: (reason: any) => TResult2 | PromiseLike): Promise; } +>p : Promise +>then : { (onfulfilled?: (value: boolean) => boolean | PromiseLike, onrejected?: (reason: any) => boolean | PromiseLike): Promise; (onfulfilled: (value: boolean) => boolean | PromiseLike, onrejected: (reason: any) => TResult | PromiseLike): Promise; (onfulfilled: (value: boolean) => TResult | PromiseLike, onrejected?: (reason: any) => TResult | PromiseLike): Promise; (onfulfilled: (value: boolean) => TResult1 | PromiseLike, onrejected: (reason: any) => TResult2 | PromiseLike): Promise; } +>() => Promise.resolve("1") : () => Promise +>Promise.resolve("1") : Promise +>Promise.resolve : { (value: T | PromiseLike): Promise; (): Promise; } +>Promise : PromiseConstructor +>resolve : { (value: T | PromiseLike): Promise; (): Promise; } +>"1" : "1" +>() => Promise.reject(1) : () => Promise +>Promise.reject(1) : Promise +>Promise.reject : { (reason: any): Promise; (reason: any): Promise; } +>Promise : PromiseConstructor +>reject : { (reason: any): Promise; (reason: any): Promise; } +>1 : 1 + +const p80 = p.then(() => Promise.reject(1), undefined); +>p80 : Promise +>p.then(() => Promise.reject(1), undefined) : Promise +>p.then : { (onfulfilled?: (value: boolean) => boolean | PromiseLike, onrejected?: (reason: any) => boolean | PromiseLike): Promise; (onfulfilled: (value: boolean) => boolean | PromiseLike, onrejected: (reason: any) => TResult | PromiseLike): Promise; (onfulfilled: (value: boolean) => TResult | PromiseLike, onrejected?: (reason: any) => TResult | PromiseLike): Promise; (onfulfilled: (value: boolean) => TResult1 | PromiseLike, onrejected: (reason: any) => TResult2 | PromiseLike): Promise; } +>p : Promise +>then : { (onfulfilled?: (value: boolean) => boolean | PromiseLike, onrejected?: (reason: any) => boolean | PromiseLike): Promise; (onfulfilled: (value: boolean) => boolean | PromiseLike, onrejected: (reason: any) => TResult | PromiseLike): Promise; (onfulfilled: (value: boolean) => TResult | PromiseLike, onrejected?: (reason: any) => TResult | PromiseLike): Promise; (onfulfilled: (value: boolean) => TResult1 | PromiseLike, onrejected: (reason: any) => TResult2 | PromiseLike): Promise; } +>() => Promise.reject(1) : () => Promise +>Promise.reject(1) : Promise +>Promise.reject : { (reason: any): Promise; (reason: any): Promise; } +>Promise : PromiseConstructor +>reject : { (reason: any): Promise; (reason: any): Promise; } +>1 : 1 +>undefined : undefined + +const p81 = p.then(() => Promise.reject(1), () => 1); +>p81 : Promise +>p.then(() => Promise.reject(1), () => 1) : Promise +>p.then : { (onfulfilled?: (value: boolean) => boolean | PromiseLike, onrejected?: (reason: any) => boolean | PromiseLike): Promise; (onfulfilled: (value: boolean) => boolean | PromiseLike, onrejected: (reason: any) => TResult | PromiseLike): Promise; (onfulfilled: (value: boolean) => TResult | PromiseLike, onrejected?: (reason: any) => TResult | PromiseLike): Promise; (onfulfilled: (value: boolean) => TResult1 | PromiseLike, onrejected: (reason: any) => TResult2 | PromiseLike): Promise; } +>p : Promise +>then : { (onfulfilled?: (value: boolean) => boolean | PromiseLike, onrejected?: (reason: any) => boolean | PromiseLike): Promise; (onfulfilled: (value: boolean) => boolean | PromiseLike, onrejected: (reason: any) => TResult | PromiseLike): Promise; (onfulfilled: (value: boolean) => TResult | PromiseLike, onrejected?: (reason: any) => TResult | PromiseLike): Promise; (onfulfilled: (value: boolean) => TResult1 | PromiseLike, onrejected: (reason: any) => TResult2 | PromiseLike): Promise; } +>() => Promise.reject(1) : () => Promise +>Promise.reject(1) : Promise +>Promise.reject : { (reason: any): Promise; (reason: any): Promise; } +>Promise : PromiseConstructor +>reject : { (reason: any): Promise; (reason: any): Promise; } +>1 : 1 +>() => 1 : () => 1 +>1 : 1 + +const p82 = p.then(() => Promise.reject(1), () => {}); +>p82 : Promise +>p.then(() => Promise.reject(1), () => {}) : Promise +>p.then : { (onfulfilled?: (value: boolean) => boolean | PromiseLike, onrejected?: (reason: any) => boolean | PromiseLike): Promise; (onfulfilled: (value: boolean) => boolean | PromiseLike, onrejected: (reason: any) => TResult | PromiseLike): Promise; (onfulfilled: (value: boolean) => TResult | PromiseLike, onrejected?: (reason: any) => TResult | PromiseLike): Promise; (onfulfilled: (value: boolean) => TResult1 | PromiseLike, onrejected: (reason: any) => TResult2 | PromiseLike): Promise; } +>p : Promise +>then : { (onfulfilled?: (value: boolean) => boolean | PromiseLike, onrejected?: (reason: any) => boolean | PromiseLike): Promise; (onfulfilled: (value: boolean) => boolean | PromiseLike, onrejected: (reason: any) => TResult | PromiseLike): Promise; (onfulfilled: (value: boolean) => TResult | PromiseLike, onrejected?: (reason: any) => TResult | PromiseLike): Promise; (onfulfilled: (value: boolean) => TResult1 | PromiseLike, onrejected: (reason: any) => TResult2 | PromiseLike): Promise; } +>() => Promise.reject(1) : () => Promise +>Promise.reject(1) : Promise +>Promise.reject : { (reason: any): Promise; (reason: any): Promise; } +>Promise : PromiseConstructor +>reject : { (reason: any): Promise; (reason: any): Promise; } +>1 : 1 +>() => {} : () => void + +const p83 = p.then(() => Promise.reject(1), () => {throw 1}); +>p83 : Promise +>p.then(() => Promise.reject(1), () => {throw 1}) : Promise +>p.then : { (onfulfilled?: (value: boolean) => boolean | PromiseLike, onrejected?: (reason: any) => boolean | PromiseLike): Promise; (onfulfilled: (value: boolean) => boolean | PromiseLike, onrejected: (reason: any) => TResult | PromiseLike): Promise; (onfulfilled: (value: boolean) => TResult | PromiseLike, onrejected?: (reason: any) => TResult | PromiseLike): Promise; (onfulfilled: (value: boolean) => TResult1 | PromiseLike, onrejected: (reason: any) => TResult2 | PromiseLike): Promise; } +>p : Promise +>then : { (onfulfilled?: (value: boolean) => boolean | PromiseLike, onrejected?: (reason: any) => boolean | PromiseLike): Promise; (onfulfilled: (value: boolean) => boolean | PromiseLike, onrejected: (reason: any) => TResult | PromiseLike): Promise; (onfulfilled: (value: boolean) => TResult | PromiseLike, onrejected?: (reason: any) => TResult | PromiseLike): Promise; (onfulfilled: (value: boolean) => TResult1 | PromiseLike, onrejected: (reason: any) => TResult2 | PromiseLike): Promise; } +>() => Promise.reject(1) : () => Promise +>Promise.reject(1) : Promise +>Promise.reject : { (reason: any): Promise; (reason: any): Promise; } +>Promise : PromiseConstructor +>reject : { (reason: any): Promise; (reason: any): Promise; } +>1 : 1 +>() => {throw 1} : () => never +>1 : 1 + +const p84 = p.then(() => Promise.reject(1), () => Promise.resolve(1)); +>p84 : Promise +>p.then(() => Promise.reject(1), () => Promise.resolve(1)) : Promise +>p.then : { (onfulfilled?: (value: boolean) => boolean | PromiseLike, onrejected?: (reason: any) => boolean | PromiseLike): Promise; (onfulfilled: (value: boolean) => boolean | PromiseLike, onrejected: (reason: any) => TResult | PromiseLike): Promise; (onfulfilled: (value: boolean) => TResult | PromiseLike, onrejected?: (reason: any) => TResult | PromiseLike): Promise; (onfulfilled: (value: boolean) => TResult1 | PromiseLike, onrejected: (reason: any) => TResult2 | PromiseLike): Promise; } +>p : Promise +>then : { (onfulfilled?: (value: boolean) => boolean | PromiseLike, onrejected?: (reason: any) => boolean | PromiseLike): Promise; (onfulfilled: (value: boolean) => boolean | PromiseLike, onrejected: (reason: any) => TResult | PromiseLike): Promise; (onfulfilled: (value: boolean) => TResult | PromiseLike, onrejected?: (reason: any) => TResult | PromiseLike): Promise; (onfulfilled: (value: boolean) => TResult1 | PromiseLike, onrejected: (reason: any) => TResult2 | PromiseLike): Promise; } +>() => Promise.reject(1) : () => Promise +>Promise.reject(1) : Promise +>Promise.reject : { (reason: any): Promise; (reason: any): Promise; } +>Promise : PromiseConstructor +>reject : { (reason: any): Promise; (reason: any): Promise; } +>1 : 1 +>() => Promise.resolve(1) : () => Promise +>Promise.resolve(1) : Promise +>Promise.resolve : { (value: T | PromiseLike): Promise; (): Promise; } +>Promise : PromiseConstructor +>resolve : { (value: T | PromiseLike): Promise; (): Promise; } +>1 : 1 + +const p85 = p.then(() => Promise.reject(1), () => Promise.reject(1)); +>p85 : Promise +>p.then(() => Promise.reject(1), () => Promise.reject(1)) : Promise +>p.then : { (onfulfilled?: (value: boolean) => boolean | PromiseLike, onrejected?: (reason: any) => boolean | PromiseLike): Promise; (onfulfilled: (value: boolean) => boolean | PromiseLike, onrejected: (reason: any) => TResult | PromiseLike): Promise; (onfulfilled: (value: boolean) => TResult | PromiseLike, onrejected?: (reason: any) => TResult | PromiseLike): Promise; (onfulfilled: (value: boolean) => TResult1 | PromiseLike, onrejected: (reason: any) => TResult2 | PromiseLike): Promise; } +>p : Promise +>then : { (onfulfilled?: (value: boolean) => boolean | PromiseLike, onrejected?: (reason: any) => boolean | PromiseLike): Promise; (onfulfilled: (value: boolean) => boolean | PromiseLike, onrejected: (reason: any) => TResult | PromiseLike): Promise; (onfulfilled: (value: boolean) => TResult | PromiseLike, onrejected?: (reason: any) => TResult | PromiseLike): Promise; (onfulfilled: (value: boolean) => TResult1 | PromiseLike, onrejected: (reason: any) => TResult2 | PromiseLike): Promise; } +>() => Promise.reject(1) : () => Promise +>Promise.reject(1) : Promise +>Promise.reject : { (reason: any): Promise; (reason: any): Promise; } +>Promise : PromiseConstructor +>reject : { (reason: any): Promise; (reason: any): Promise; } +>1 : 1 +>() => Promise.reject(1) : () => Promise +>Promise.reject(1) : Promise +>Promise.reject : { (reason: any): Promise; (reason: any): Promise; } +>Promise : PromiseConstructor +>reject : { (reason: any): Promise; (reason: any): Promise; } +>1 : 1 + diff --git a/tests/baselines/reference/promiseTypeInference.types b/tests/baselines/reference/promiseTypeInference.types index 2789f710876..f3026c68f21 100644 --- a/tests/baselines/reference/promiseTypeInference.types +++ b/tests/baselines/reference/promiseTypeInference.types @@ -45,7 +45,7 @@ var $$x = load("something").then(s => convert(s)); >load("something").then : (success?: (value: string) => Promise) => Promise >load("something") : Promise >load : (name: string) => Promise ->"something" : string +>"something" : "something" >then : (success?: (value: string) => Promise) => Promise >s => convert(s) : (s: string) => IPromise >s : string diff --git a/tests/baselines/reference/promiseTypeStrictNull.js b/tests/baselines/reference/promiseTypeStrictNull.js new file mode 100644 index 00000000000..cba4f7735ce --- /dev/null +++ b/tests/baselines/reference/promiseTypeStrictNull.js @@ -0,0 +1,316 @@ +//// [promiseTypeStrictNull.ts] +declare var p: Promise; + +const a = p.then(); +const b = p.then(b => 1); +const c = p.then(b => 1, e => 'error'); +const d = p.then(b => 1, e => { }); +const e = p.then(b => 1, e => { throw Error(); }); +const f = p.then(b => 1, e => Promise.reject(Error())); +const g = p.catch(e => 'error'); +const h = p.catch(e => { }); +const i = p.catch(e => { throw Error(); }); +const j = p.catch(e => Promise.reject(Error())); + +async function A() { + const a = await p; + return a; +} + +async function B() { + const a = await p; + return 1; +} + +// NOTE: This reports a "No best comment type exists among return expressions." error, and is +// ignored to get the types result for the test. +// async function C() { +// try { +// const a = await p; +// return 1; +// } +// catch (e) { +// return 'error'; +// } +// } + +async function D() { + try { + const a = await p; + return 1; + } + catch (e) { + } +} + +async function E() { + try { + const a = await p; + return 1; + } + catch (e) { + throw Error(); + } +} + +async function F() { + try { + const a = await p; + return 1; + } + catch (e) { + return Promise.reject(Error()); + } +} + +async function G() { + try { + const a = await p; + return a; + } + catch (e) { + return; + } +} + +async function H() { + try { + const a = await p; + return a; + } + catch (e) { + throw Error(); + } +} + +async function I() { + try { + const a = await p; + return a; + } + catch (e) { + return Promise.reject(Error()); + } +} + +// addresses github issue #4903: + +const p00 = p.catch(); +const p01 = p.catch(undefined); +const p07 = p.catch(null); +const p02 = p.catch(() => 1); +const p03 = p.catch(() => {}); +const p04 = p.catch(() => {throw 1}); +const p05 = p.catch(() => Promise.reject(1)); +const p06 = p.catch(() => Promise.resolve(1)); + +const p10 = p.then(); + +const p20 = p.then(undefined); +const p21 = p.then(() => 1); +const p22 = p.then(() => {}); +const p23 = p.then(() => {throw 1}); +const p24 = p.then(() => Promise.resolve(1)); +const p25 = p.then(() => Promise.reject(1)); + +const p30 = p.then(undefined, undefined); +const p31 = p.then(undefined, () => 1); +const p32 = p.then(undefined, () => {}); +const p33 = p.then(undefined, () => {throw 1}); +const p34 = p.then(undefined, () => Promise.resolve(1)); +const p35 = p.then(undefined, () => Promise.reject(1)); + +const p40 = p.then(() => "1", undefined); +const p41 = p.then(() => "1", () => 1); +const p42 = p.then(() => "1", () => {}); +const p43 = p.then(() => "1", () => {throw 1}); +const p44 = p.then(() => "1", () => Promise.resolve(1)); +const p45 = p.then(() => "1", () => Promise.reject(1)); + +const p50 = p.then(() => {}, undefined); +const p51 = p.then(() => {}, () => 1); +const p52 = p.then(() => {}, () => {}); +const p53 = p.then(() => {}, () => {throw 1}); +const p54 = p.then(() => {}, () => Promise.resolve(1)); +const p55 = p.then(() => {}, () => Promise.reject(1)); + +const p60 = p.then(() => {throw 1}, undefined); +const p61 = p.then(() => {throw 1}, () => 1); +const p62 = p.then(() => {throw 1}, () => {}); +const p63 = p.then(() => {throw 1}, () => {throw 1}); +const p64 = p.then(() => {throw 1}, () => Promise.resolve(1)); +const p65 = p.then(() => {throw 1}, () => Promise.reject(1)); + +const p70 = p.then(() => Promise.resolve("1"), undefined); +const p71 = p.then(() => Promise.resolve("1"), () => 1); +const p72 = p.then(() => Promise.resolve("1"), () => {}); +const p73 = p.then(() => Promise.resolve("1"), () => {throw 1}); +const p74 = p.then(() => Promise.resolve("1"), () => Promise.resolve(1)); +const p75 = p.then(() => Promise.resolve("1"), () => Promise.reject(1)); + +const p80 = p.then(() => Promise.reject(1), undefined); +const p81 = p.then(() => Promise.reject(1), () => 1); +const p82 = p.then(() => Promise.reject(1), () => {}); +const p83 = p.then(() => Promise.reject(1), () => {throw 1}); +const p84 = p.then(() => Promise.reject(1), () => Promise.resolve(1)); +const p85 = p.then(() => Promise.reject(1), () => Promise.reject(1)); + +//// [promiseTypeStrictNull.js] +var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { + return new (P || (P = Promise))(function (resolve, reject) { + function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } + function rejected(value) { try { step(generator.throw(value)); } catch (e) { reject(e); } } + function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); } + step((generator = generator.apply(thisArg, _arguments)).next()); + }); +}; +const a = p.then(); +const b = p.then(b => 1); +const c = p.then(b => 1, e => 'error'); +const d = p.then(b => 1, e => { }); +const e = p.then(b => 1, e => { throw Error(); }); +const f = p.then(b => 1, e => Promise.reject(Error())); +const g = p.catch(e => 'error'); +const h = p.catch(e => { }); +const i = p.catch(e => { throw Error(); }); +const j = p.catch(e => Promise.reject(Error())); +function A() { + return __awaiter(this, void 0, void 0, function* () { + const a = yield p; + return a; + }); +} +function B() { + return __awaiter(this, void 0, void 0, function* () { + const a = yield p; + return 1; + }); +} +// NOTE: This reports a "No best comment type exists among return expressions." error, and is +// ignored to get the types result for the test. +// async function C() { +// try { +// const a = await p; +// return 1; +// } +// catch (e) { +// return 'error'; +// } +// } +function D() { + return __awaiter(this, void 0, void 0, function* () { + try { + const a = yield p; + return 1; + } + catch (e) { + } + }); +} +function E() { + return __awaiter(this, void 0, void 0, function* () { + try { + const a = yield p; + return 1; + } + catch (e) { + throw Error(); + } + }); +} +function F() { + return __awaiter(this, void 0, void 0, function* () { + try { + const a = yield p; + return 1; + } + catch (e) { + return Promise.reject(Error()); + } + }); +} +function G() { + return __awaiter(this, void 0, void 0, function* () { + try { + const a = yield p; + return a; + } + catch (e) { + return; + } + }); +} +function H() { + return __awaiter(this, void 0, void 0, function* () { + try { + const a = yield p; + return a; + } + catch (e) { + throw Error(); + } + }); +} +function I() { + return __awaiter(this, void 0, void 0, function* () { + try { + const a = yield p; + return a; + } + catch (e) { + return Promise.reject(Error()); + } + }); +} +// addresses github issue #4903: +const p00 = p.catch(); +const p01 = p.catch(undefined); +const p07 = p.catch(null); +const p02 = p.catch(() => 1); +const p03 = p.catch(() => { }); +const p04 = p.catch(() => { throw 1; }); +const p05 = p.catch(() => Promise.reject(1)); +const p06 = p.catch(() => Promise.resolve(1)); +const p10 = p.then(); +const p20 = p.then(undefined); +const p21 = p.then(() => 1); +const p22 = p.then(() => { }); +const p23 = p.then(() => { throw 1; }); +const p24 = p.then(() => Promise.resolve(1)); +const p25 = p.then(() => Promise.reject(1)); +const p30 = p.then(undefined, undefined); +const p31 = p.then(undefined, () => 1); +const p32 = p.then(undefined, () => { }); +const p33 = p.then(undefined, () => { throw 1; }); +const p34 = p.then(undefined, () => Promise.resolve(1)); +const p35 = p.then(undefined, () => Promise.reject(1)); +const p40 = p.then(() => "1", undefined); +const p41 = p.then(() => "1", () => 1); +const p42 = p.then(() => "1", () => { }); +const p43 = p.then(() => "1", () => { throw 1; }); +const p44 = p.then(() => "1", () => Promise.resolve(1)); +const p45 = p.then(() => "1", () => Promise.reject(1)); +const p50 = p.then(() => { }, undefined); +const p51 = p.then(() => { }, () => 1); +const p52 = p.then(() => { }, () => { }); +const p53 = p.then(() => { }, () => { throw 1; }); +const p54 = p.then(() => { }, () => Promise.resolve(1)); +const p55 = p.then(() => { }, () => Promise.reject(1)); +const p60 = p.then(() => { throw 1; }, undefined); +const p61 = p.then(() => { throw 1; }, () => 1); +const p62 = p.then(() => { throw 1; }, () => { }); +const p63 = p.then(() => { throw 1; }, () => { throw 1; }); +const p64 = p.then(() => { throw 1; }, () => Promise.resolve(1)); +const p65 = p.then(() => { throw 1; }, () => Promise.reject(1)); +const p70 = p.then(() => Promise.resolve("1"), undefined); +const p71 = p.then(() => Promise.resolve("1"), () => 1); +const p72 = p.then(() => Promise.resolve("1"), () => { }); +const p73 = p.then(() => Promise.resolve("1"), () => { throw 1; }); +const p74 = p.then(() => Promise.resolve("1"), () => Promise.resolve(1)); +const p75 = p.then(() => Promise.resolve("1"), () => Promise.reject(1)); +const p80 = p.then(() => Promise.reject(1), undefined); +const p81 = p.then(() => Promise.reject(1), () => 1); +const p82 = p.then(() => Promise.reject(1), () => { }); +const p83 = p.then(() => Promise.reject(1), () => { throw 1; }); +const p84 = p.then(() => Promise.reject(1), () => Promise.resolve(1)); +const p85 = p.then(() => Promise.reject(1), () => Promise.reject(1)); diff --git a/tests/baselines/reference/promiseTypeStrictNull.symbols b/tests/baselines/reference/promiseTypeStrictNull.symbols new file mode 100644 index 00000000000..bf14c51656e --- /dev/null +++ b/tests/baselines/reference/promiseTypeStrictNull.symbols @@ -0,0 +1,640 @@ +=== tests/cases/compiler/promiseTypeStrictNull.ts === +declare var p: Promise; +>p : Symbol(p, Decl(promiseTypeStrictNull.ts, 0, 11)) +>Promise : Symbol(Promise, Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --)) + +const a = p.then(); +>a : Symbol(a, Decl(promiseTypeStrictNull.ts, 2, 5)) +>p.then : Symbol(Promise.then, Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) +>p : Symbol(p, Decl(promiseTypeStrictNull.ts, 0, 11)) +>then : Symbol(Promise.then, Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) + +const b = p.then(b => 1); +>b : Symbol(b, Decl(promiseTypeStrictNull.ts, 3, 5)) +>p.then : Symbol(Promise.then, Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) +>p : Symbol(p, Decl(promiseTypeStrictNull.ts, 0, 11)) +>then : Symbol(Promise.then, Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) +>b : Symbol(b, Decl(promiseTypeStrictNull.ts, 3, 17)) + +const c = p.then(b => 1, e => 'error'); +>c : Symbol(c, Decl(promiseTypeStrictNull.ts, 4, 5)) +>p.then : Symbol(Promise.then, Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) +>p : Symbol(p, Decl(promiseTypeStrictNull.ts, 0, 11)) +>then : Symbol(Promise.then, Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) +>b : Symbol(b, Decl(promiseTypeStrictNull.ts, 4, 17)) +>e : Symbol(e, Decl(promiseTypeStrictNull.ts, 4, 24)) + +const d = p.then(b => 1, e => { }); +>d : Symbol(d, Decl(promiseTypeStrictNull.ts, 5, 5)) +>p.then : Symbol(Promise.then, Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) +>p : Symbol(p, Decl(promiseTypeStrictNull.ts, 0, 11)) +>then : Symbol(Promise.then, Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) +>b : Symbol(b, Decl(promiseTypeStrictNull.ts, 5, 17)) +>e : Symbol(e, Decl(promiseTypeStrictNull.ts, 5, 24)) + +const e = p.then(b => 1, e => { throw Error(); }); +>e : Symbol(e, Decl(promiseTypeStrictNull.ts, 6, 5)) +>p.then : Symbol(Promise.then, Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) +>p : Symbol(p, Decl(promiseTypeStrictNull.ts, 0, 11)) +>then : Symbol(Promise.then, Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) +>b : Symbol(b, Decl(promiseTypeStrictNull.ts, 6, 17)) +>e : Symbol(e, Decl(promiseTypeStrictNull.ts, 6, 24)) +>Error : Symbol(Error, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) + +const f = p.then(b => 1, e => Promise.reject(Error())); +>f : Symbol(f, Decl(promiseTypeStrictNull.ts, 7, 5)) +>p.then : Symbol(Promise.then, Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) +>p : Symbol(p, Decl(promiseTypeStrictNull.ts, 0, 11)) +>then : Symbol(Promise.then, Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) +>b : Symbol(b, Decl(promiseTypeStrictNull.ts, 7, 17)) +>e : Symbol(e, Decl(promiseTypeStrictNull.ts, 7, 24)) +>Promise.reject : Symbol(PromiseConstructor.reject, Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) +>Promise : Symbol(Promise, Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --)) +>reject : Symbol(PromiseConstructor.reject, Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) +>Error : Symbol(Error, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) + +const g = p.catch(e => 'error'); +>g : Symbol(g, Decl(promiseTypeStrictNull.ts, 8, 5)) +>p.catch : Symbol(Promise.catch, Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) +>p : Symbol(p, Decl(promiseTypeStrictNull.ts, 0, 11)) +>catch : Symbol(Promise.catch, Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) +>e : Symbol(e, Decl(promiseTypeStrictNull.ts, 8, 18)) + +const h = p.catch(e => { }); +>h : Symbol(h, Decl(promiseTypeStrictNull.ts, 9, 5)) +>p.catch : Symbol(Promise.catch, Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) +>p : Symbol(p, Decl(promiseTypeStrictNull.ts, 0, 11)) +>catch : Symbol(Promise.catch, Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) +>e : Symbol(e, Decl(promiseTypeStrictNull.ts, 9, 18)) + +const i = p.catch(e => { throw Error(); }); +>i : Symbol(i, Decl(promiseTypeStrictNull.ts, 10, 5)) +>p.catch : Symbol(Promise.catch, Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) +>p : Symbol(p, Decl(promiseTypeStrictNull.ts, 0, 11)) +>catch : Symbol(Promise.catch, Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) +>e : Symbol(e, Decl(promiseTypeStrictNull.ts, 10, 18)) +>Error : Symbol(Error, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) + +const j = p.catch(e => Promise.reject(Error())); +>j : Symbol(j, Decl(promiseTypeStrictNull.ts, 11, 5)) +>p.catch : Symbol(Promise.catch, Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) +>p : Symbol(p, Decl(promiseTypeStrictNull.ts, 0, 11)) +>catch : Symbol(Promise.catch, Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) +>e : Symbol(e, Decl(promiseTypeStrictNull.ts, 11, 18)) +>Promise.reject : Symbol(PromiseConstructor.reject, Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) +>Promise : Symbol(Promise, Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --)) +>reject : Symbol(PromiseConstructor.reject, Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) +>Error : Symbol(Error, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) + +async function A() { +>A : Symbol(A, Decl(promiseTypeStrictNull.ts, 11, 48)) + + const a = await p; +>a : Symbol(a, Decl(promiseTypeStrictNull.ts, 14, 9)) +>p : Symbol(p, Decl(promiseTypeStrictNull.ts, 0, 11)) + + return a; +>a : Symbol(a, Decl(promiseTypeStrictNull.ts, 14, 9)) +} + +async function B() { +>B : Symbol(B, Decl(promiseTypeStrictNull.ts, 16, 1)) + + const a = await p; +>a : Symbol(a, Decl(promiseTypeStrictNull.ts, 19, 9)) +>p : Symbol(p, Decl(promiseTypeStrictNull.ts, 0, 11)) + + return 1; +} + +// NOTE: This reports a "No best comment type exists among return expressions." error, and is +// ignored to get the types result for the test. +// async function C() { +// try { +// const a = await p; +// return 1; +// } +// catch (e) { +// return 'error'; +// } +// } + +async function D() { +>D : Symbol(D, Decl(promiseTypeStrictNull.ts, 21, 1)) + + try { + const a = await p; +>a : Symbol(a, Decl(promiseTypeStrictNull.ts, 37, 13)) +>p : Symbol(p, Decl(promiseTypeStrictNull.ts, 0, 11)) + + return 1; + } + catch (e) { +>e : Symbol(e, Decl(promiseTypeStrictNull.ts, 40, 11)) + } +} + +async function E() { +>E : Symbol(E, Decl(promiseTypeStrictNull.ts, 42, 1)) + + try { + const a = await p; +>a : Symbol(a, Decl(promiseTypeStrictNull.ts, 46, 13)) +>p : Symbol(p, Decl(promiseTypeStrictNull.ts, 0, 11)) + + return 1; + } + catch (e) { +>e : Symbol(e, Decl(promiseTypeStrictNull.ts, 49, 11)) + + throw Error(); +>Error : Symbol(Error, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) + } +} + +async function F() { +>F : Symbol(F, Decl(promiseTypeStrictNull.ts, 52, 1)) + + try { + const a = await p; +>a : Symbol(a, Decl(promiseTypeStrictNull.ts, 56, 13)) +>p : Symbol(p, Decl(promiseTypeStrictNull.ts, 0, 11)) + + return 1; + } + catch (e) { +>e : Symbol(e, Decl(promiseTypeStrictNull.ts, 59, 11)) + + return Promise.reject(Error()); +>Promise.reject : Symbol(PromiseConstructor.reject, Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) +>Promise : Symbol(Promise, Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --)) +>reject : Symbol(PromiseConstructor.reject, Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) +>Error : Symbol(Error, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) + } +} + +async function G() { +>G : Symbol(G, Decl(promiseTypeStrictNull.ts, 62, 1)) + + try { + const a = await p; +>a : Symbol(a, Decl(promiseTypeStrictNull.ts, 66, 13)) +>p : Symbol(p, Decl(promiseTypeStrictNull.ts, 0, 11)) + + return a; +>a : Symbol(a, Decl(promiseTypeStrictNull.ts, 66, 13)) + } + catch (e) { +>e : Symbol(e, Decl(promiseTypeStrictNull.ts, 69, 11)) + + return; + } +} + +async function H() { +>H : Symbol(H, Decl(promiseTypeStrictNull.ts, 72, 1)) + + try { + const a = await p; +>a : Symbol(a, Decl(promiseTypeStrictNull.ts, 76, 13)) +>p : Symbol(p, Decl(promiseTypeStrictNull.ts, 0, 11)) + + return a; +>a : Symbol(a, Decl(promiseTypeStrictNull.ts, 76, 13)) + } + catch (e) { +>e : Symbol(e, Decl(promiseTypeStrictNull.ts, 79, 11)) + + throw Error(); +>Error : Symbol(Error, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) + } +} + +async function I() { +>I : Symbol(I, Decl(promiseTypeStrictNull.ts, 82, 1)) + + try { + const a = await p; +>a : Symbol(a, Decl(promiseTypeStrictNull.ts, 86, 13)) +>p : Symbol(p, Decl(promiseTypeStrictNull.ts, 0, 11)) + + return a; +>a : Symbol(a, Decl(promiseTypeStrictNull.ts, 86, 13)) + } + catch (e) { +>e : Symbol(e, Decl(promiseTypeStrictNull.ts, 89, 11)) + + return Promise.reject(Error()); +>Promise.reject : Symbol(PromiseConstructor.reject, Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) +>Promise : Symbol(Promise, Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --)) +>reject : Symbol(PromiseConstructor.reject, Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) +>Error : Symbol(Error, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) + } +} + +// addresses github issue #4903: + +const p00 = p.catch(); +>p00 : Symbol(p00, Decl(promiseTypeStrictNull.ts, 96, 5)) +>p.catch : Symbol(Promise.catch, Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) +>p : Symbol(p, Decl(promiseTypeStrictNull.ts, 0, 11)) +>catch : Symbol(Promise.catch, Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) + +const p01 = p.catch(undefined); +>p01 : Symbol(p01, Decl(promiseTypeStrictNull.ts, 97, 5)) +>p.catch : Symbol(Promise.catch, Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) +>p : Symbol(p, Decl(promiseTypeStrictNull.ts, 0, 11)) +>catch : Symbol(Promise.catch, Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) +>undefined : Symbol(undefined) + +const p07 = p.catch(null); +>p07 : Symbol(p07, Decl(promiseTypeStrictNull.ts, 98, 5)) +>p.catch : Symbol(Promise.catch, Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) +>p : Symbol(p, Decl(promiseTypeStrictNull.ts, 0, 11)) +>catch : Symbol(Promise.catch, Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) + +const p02 = p.catch(() => 1); +>p02 : Symbol(p02, Decl(promiseTypeStrictNull.ts, 99, 5)) +>p.catch : Symbol(Promise.catch, Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) +>p : Symbol(p, Decl(promiseTypeStrictNull.ts, 0, 11)) +>catch : Symbol(Promise.catch, Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) + +const p03 = p.catch(() => {}); +>p03 : Symbol(p03, Decl(promiseTypeStrictNull.ts, 100, 5)) +>p.catch : Symbol(Promise.catch, Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) +>p : Symbol(p, Decl(promiseTypeStrictNull.ts, 0, 11)) +>catch : Symbol(Promise.catch, Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) + +const p04 = p.catch(() => {throw 1}); +>p04 : Symbol(p04, Decl(promiseTypeStrictNull.ts, 101, 5)) +>p.catch : Symbol(Promise.catch, Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) +>p : Symbol(p, Decl(promiseTypeStrictNull.ts, 0, 11)) +>catch : Symbol(Promise.catch, Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) + +const p05 = p.catch(() => Promise.reject(1)); +>p05 : Symbol(p05, Decl(promiseTypeStrictNull.ts, 102, 5)) +>p.catch : Symbol(Promise.catch, Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) +>p : Symbol(p, Decl(promiseTypeStrictNull.ts, 0, 11)) +>catch : Symbol(Promise.catch, Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) +>Promise.reject : Symbol(PromiseConstructor.reject, Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) +>Promise : Symbol(Promise, Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --)) +>reject : Symbol(PromiseConstructor.reject, Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) + +const p06 = p.catch(() => Promise.resolve(1)); +>p06 : Symbol(p06, Decl(promiseTypeStrictNull.ts, 103, 5)) +>p.catch : Symbol(Promise.catch, Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) +>p : Symbol(p, Decl(promiseTypeStrictNull.ts, 0, 11)) +>catch : Symbol(Promise.catch, Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) +>Promise.resolve : Symbol(PromiseConstructor.resolve, Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) +>Promise : Symbol(Promise, Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --)) +>resolve : Symbol(PromiseConstructor.resolve, Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) + +const p10 = p.then(); +>p10 : Symbol(p10, Decl(promiseTypeStrictNull.ts, 105, 5)) +>p.then : Symbol(Promise.then, Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) +>p : Symbol(p, Decl(promiseTypeStrictNull.ts, 0, 11)) +>then : Symbol(Promise.then, Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) + +const p20 = p.then(undefined); +>p20 : Symbol(p20, Decl(promiseTypeStrictNull.ts, 107, 5)) +>p.then : Symbol(Promise.then, Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) +>p : Symbol(p, Decl(promiseTypeStrictNull.ts, 0, 11)) +>then : Symbol(Promise.then, Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) +>undefined : Symbol(undefined) + +const p21 = p.then(() => 1); +>p21 : Symbol(p21, Decl(promiseTypeStrictNull.ts, 108, 5)) +>p.then : Symbol(Promise.then, Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) +>p : Symbol(p, Decl(promiseTypeStrictNull.ts, 0, 11)) +>then : Symbol(Promise.then, Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) + +const p22 = p.then(() => {}); +>p22 : Symbol(p22, Decl(promiseTypeStrictNull.ts, 109, 5)) +>p.then : Symbol(Promise.then, Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) +>p : Symbol(p, Decl(promiseTypeStrictNull.ts, 0, 11)) +>then : Symbol(Promise.then, Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) + +const p23 = p.then(() => {throw 1}); +>p23 : Symbol(p23, Decl(promiseTypeStrictNull.ts, 110, 5)) +>p.then : Symbol(Promise.then, Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) +>p : Symbol(p, Decl(promiseTypeStrictNull.ts, 0, 11)) +>then : Symbol(Promise.then, Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) + +const p24 = p.then(() => Promise.resolve(1)); +>p24 : Symbol(p24, Decl(promiseTypeStrictNull.ts, 111, 5)) +>p.then : Symbol(Promise.then, Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) +>p : Symbol(p, Decl(promiseTypeStrictNull.ts, 0, 11)) +>then : Symbol(Promise.then, Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) +>Promise.resolve : Symbol(PromiseConstructor.resolve, Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) +>Promise : Symbol(Promise, Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --)) +>resolve : Symbol(PromiseConstructor.resolve, Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) + +const p25 = p.then(() => Promise.reject(1)); +>p25 : Symbol(p25, Decl(promiseTypeStrictNull.ts, 112, 5)) +>p.then : Symbol(Promise.then, Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) +>p : Symbol(p, Decl(promiseTypeStrictNull.ts, 0, 11)) +>then : Symbol(Promise.then, Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) +>Promise.reject : Symbol(PromiseConstructor.reject, Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) +>Promise : Symbol(Promise, Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --)) +>reject : Symbol(PromiseConstructor.reject, Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) + +const p30 = p.then(undefined, undefined); +>p30 : Symbol(p30, Decl(promiseTypeStrictNull.ts, 114, 5)) +>p.then : Symbol(Promise.then, Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) +>p : Symbol(p, Decl(promiseTypeStrictNull.ts, 0, 11)) +>then : Symbol(Promise.then, Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) +>undefined : Symbol(undefined) +>undefined : Symbol(undefined) + +const p31 = p.then(undefined, () => 1); +>p31 : Symbol(p31, Decl(promiseTypeStrictNull.ts, 115, 5)) +>p.then : Symbol(Promise.then, Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) +>p : Symbol(p, Decl(promiseTypeStrictNull.ts, 0, 11)) +>then : Symbol(Promise.then, Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) +>undefined : Symbol(undefined) + +const p32 = p.then(undefined, () => {}); +>p32 : Symbol(p32, Decl(promiseTypeStrictNull.ts, 116, 5)) +>p.then : Symbol(Promise.then, Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) +>p : Symbol(p, Decl(promiseTypeStrictNull.ts, 0, 11)) +>then : Symbol(Promise.then, Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) +>undefined : Symbol(undefined) + +const p33 = p.then(undefined, () => {throw 1}); +>p33 : Symbol(p33, Decl(promiseTypeStrictNull.ts, 117, 5)) +>p.then : Symbol(Promise.then, Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) +>p : Symbol(p, Decl(promiseTypeStrictNull.ts, 0, 11)) +>then : Symbol(Promise.then, Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) +>undefined : Symbol(undefined) + +const p34 = p.then(undefined, () => Promise.resolve(1)); +>p34 : Symbol(p34, Decl(promiseTypeStrictNull.ts, 118, 5)) +>p.then : Symbol(Promise.then, Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) +>p : Symbol(p, Decl(promiseTypeStrictNull.ts, 0, 11)) +>then : Symbol(Promise.then, Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) +>undefined : Symbol(undefined) +>Promise.resolve : Symbol(PromiseConstructor.resolve, Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) +>Promise : Symbol(Promise, Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --)) +>resolve : Symbol(PromiseConstructor.resolve, Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) + +const p35 = p.then(undefined, () => Promise.reject(1)); +>p35 : Symbol(p35, Decl(promiseTypeStrictNull.ts, 119, 5)) +>p.then : Symbol(Promise.then, Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) +>p : Symbol(p, Decl(promiseTypeStrictNull.ts, 0, 11)) +>then : Symbol(Promise.then, Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) +>undefined : Symbol(undefined) +>Promise.reject : Symbol(PromiseConstructor.reject, Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) +>Promise : Symbol(Promise, Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --)) +>reject : Symbol(PromiseConstructor.reject, Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) + +const p40 = p.then(() => "1", undefined); +>p40 : Symbol(p40, Decl(promiseTypeStrictNull.ts, 121, 5)) +>p.then : Symbol(Promise.then, Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) +>p : Symbol(p, Decl(promiseTypeStrictNull.ts, 0, 11)) +>then : Symbol(Promise.then, Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) +>undefined : Symbol(undefined) + +const p41 = p.then(() => "1", () => 1); +>p41 : Symbol(p41, Decl(promiseTypeStrictNull.ts, 122, 5)) +>p.then : Symbol(Promise.then, Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) +>p : Symbol(p, Decl(promiseTypeStrictNull.ts, 0, 11)) +>then : Symbol(Promise.then, Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) + +const p42 = p.then(() => "1", () => {}); +>p42 : Symbol(p42, Decl(promiseTypeStrictNull.ts, 123, 5)) +>p.then : Symbol(Promise.then, Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) +>p : Symbol(p, Decl(promiseTypeStrictNull.ts, 0, 11)) +>then : Symbol(Promise.then, Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) + +const p43 = p.then(() => "1", () => {throw 1}); +>p43 : Symbol(p43, Decl(promiseTypeStrictNull.ts, 124, 5)) +>p.then : Symbol(Promise.then, Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) +>p : Symbol(p, Decl(promiseTypeStrictNull.ts, 0, 11)) +>then : Symbol(Promise.then, Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) + +const p44 = p.then(() => "1", () => Promise.resolve(1)); +>p44 : Symbol(p44, Decl(promiseTypeStrictNull.ts, 125, 5)) +>p.then : Symbol(Promise.then, Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) +>p : Symbol(p, Decl(promiseTypeStrictNull.ts, 0, 11)) +>then : Symbol(Promise.then, Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) +>Promise.resolve : Symbol(PromiseConstructor.resolve, Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) +>Promise : Symbol(Promise, Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --)) +>resolve : Symbol(PromiseConstructor.resolve, Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) + +const p45 = p.then(() => "1", () => Promise.reject(1)); +>p45 : Symbol(p45, Decl(promiseTypeStrictNull.ts, 126, 5)) +>p.then : Symbol(Promise.then, Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) +>p : Symbol(p, Decl(promiseTypeStrictNull.ts, 0, 11)) +>then : Symbol(Promise.then, Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) +>Promise.reject : Symbol(PromiseConstructor.reject, Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) +>Promise : Symbol(Promise, Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --)) +>reject : Symbol(PromiseConstructor.reject, Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) + +const p50 = p.then(() => {}, undefined); +>p50 : Symbol(p50, Decl(promiseTypeStrictNull.ts, 128, 5)) +>p.then : Symbol(Promise.then, Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) +>p : Symbol(p, Decl(promiseTypeStrictNull.ts, 0, 11)) +>then : Symbol(Promise.then, Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) +>undefined : Symbol(undefined) + +const p51 = p.then(() => {}, () => 1); +>p51 : Symbol(p51, Decl(promiseTypeStrictNull.ts, 129, 5)) +>p.then : Symbol(Promise.then, Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) +>p : Symbol(p, Decl(promiseTypeStrictNull.ts, 0, 11)) +>then : Symbol(Promise.then, Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) + +const p52 = p.then(() => {}, () => {}); +>p52 : Symbol(p52, Decl(promiseTypeStrictNull.ts, 130, 5)) +>p.then : Symbol(Promise.then, Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) +>p : Symbol(p, Decl(promiseTypeStrictNull.ts, 0, 11)) +>then : Symbol(Promise.then, Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) + +const p53 = p.then(() => {}, () => {throw 1}); +>p53 : Symbol(p53, Decl(promiseTypeStrictNull.ts, 131, 5)) +>p.then : Symbol(Promise.then, Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) +>p : Symbol(p, Decl(promiseTypeStrictNull.ts, 0, 11)) +>then : Symbol(Promise.then, Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) + +const p54 = p.then(() => {}, () => Promise.resolve(1)); +>p54 : Symbol(p54, Decl(promiseTypeStrictNull.ts, 132, 5)) +>p.then : Symbol(Promise.then, Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) +>p : Symbol(p, Decl(promiseTypeStrictNull.ts, 0, 11)) +>then : Symbol(Promise.then, Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) +>Promise.resolve : Symbol(PromiseConstructor.resolve, Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) +>Promise : Symbol(Promise, Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --)) +>resolve : Symbol(PromiseConstructor.resolve, Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) + +const p55 = p.then(() => {}, () => Promise.reject(1)); +>p55 : Symbol(p55, Decl(promiseTypeStrictNull.ts, 133, 5)) +>p.then : Symbol(Promise.then, Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) +>p : Symbol(p, Decl(promiseTypeStrictNull.ts, 0, 11)) +>then : Symbol(Promise.then, Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) +>Promise.reject : Symbol(PromiseConstructor.reject, Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) +>Promise : Symbol(Promise, Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --)) +>reject : Symbol(PromiseConstructor.reject, Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) + +const p60 = p.then(() => {throw 1}, undefined); +>p60 : Symbol(p60, Decl(promiseTypeStrictNull.ts, 135, 5)) +>p.then : Symbol(Promise.then, Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) +>p : Symbol(p, Decl(promiseTypeStrictNull.ts, 0, 11)) +>then : Symbol(Promise.then, Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) +>undefined : Symbol(undefined) + +const p61 = p.then(() => {throw 1}, () => 1); +>p61 : Symbol(p61, Decl(promiseTypeStrictNull.ts, 136, 5)) +>p.then : Symbol(Promise.then, Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) +>p : Symbol(p, Decl(promiseTypeStrictNull.ts, 0, 11)) +>then : Symbol(Promise.then, Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) + +const p62 = p.then(() => {throw 1}, () => {}); +>p62 : Symbol(p62, Decl(promiseTypeStrictNull.ts, 137, 5)) +>p.then : Symbol(Promise.then, Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) +>p : Symbol(p, Decl(promiseTypeStrictNull.ts, 0, 11)) +>then : Symbol(Promise.then, Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) + +const p63 = p.then(() => {throw 1}, () => {throw 1}); +>p63 : Symbol(p63, Decl(promiseTypeStrictNull.ts, 138, 5)) +>p.then : Symbol(Promise.then, Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) +>p : Symbol(p, Decl(promiseTypeStrictNull.ts, 0, 11)) +>then : Symbol(Promise.then, Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) + +const p64 = p.then(() => {throw 1}, () => Promise.resolve(1)); +>p64 : Symbol(p64, Decl(promiseTypeStrictNull.ts, 139, 5)) +>p.then : Symbol(Promise.then, Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) +>p : Symbol(p, Decl(promiseTypeStrictNull.ts, 0, 11)) +>then : Symbol(Promise.then, Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) +>Promise.resolve : Symbol(PromiseConstructor.resolve, Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) +>Promise : Symbol(Promise, Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --)) +>resolve : Symbol(PromiseConstructor.resolve, Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) + +const p65 = p.then(() => {throw 1}, () => Promise.reject(1)); +>p65 : Symbol(p65, Decl(promiseTypeStrictNull.ts, 140, 5)) +>p.then : Symbol(Promise.then, Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) +>p : Symbol(p, Decl(promiseTypeStrictNull.ts, 0, 11)) +>then : Symbol(Promise.then, Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) +>Promise.reject : Symbol(PromiseConstructor.reject, Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) +>Promise : Symbol(Promise, Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --)) +>reject : Symbol(PromiseConstructor.reject, Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) + +const p70 = p.then(() => Promise.resolve("1"), undefined); +>p70 : Symbol(p70, Decl(promiseTypeStrictNull.ts, 142, 5)) +>p.then : Symbol(Promise.then, Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) +>p : Symbol(p, Decl(promiseTypeStrictNull.ts, 0, 11)) +>then : Symbol(Promise.then, Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) +>Promise.resolve : Symbol(PromiseConstructor.resolve, Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) +>Promise : Symbol(Promise, Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --)) +>resolve : Symbol(PromiseConstructor.resolve, Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) +>undefined : Symbol(undefined) + +const p71 = p.then(() => Promise.resolve("1"), () => 1); +>p71 : Symbol(p71, Decl(promiseTypeStrictNull.ts, 143, 5)) +>p.then : Symbol(Promise.then, Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) +>p : Symbol(p, Decl(promiseTypeStrictNull.ts, 0, 11)) +>then : Symbol(Promise.then, Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) +>Promise.resolve : Symbol(PromiseConstructor.resolve, Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) +>Promise : Symbol(Promise, Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --)) +>resolve : Symbol(PromiseConstructor.resolve, Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) + +const p72 = p.then(() => Promise.resolve("1"), () => {}); +>p72 : Symbol(p72, Decl(promiseTypeStrictNull.ts, 144, 5)) +>p.then : Symbol(Promise.then, Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) +>p : Symbol(p, Decl(promiseTypeStrictNull.ts, 0, 11)) +>then : Symbol(Promise.then, Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) +>Promise.resolve : Symbol(PromiseConstructor.resolve, Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) +>Promise : Symbol(Promise, Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --)) +>resolve : Symbol(PromiseConstructor.resolve, Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) + +const p73 = p.then(() => Promise.resolve("1"), () => {throw 1}); +>p73 : Symbol(p73, Decl(promiseTypeStrictNull.ts, 145, 5)) +>p.then : Symbol(Promise.then, Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) +>p : Symbol(p, Decl(promiseTypeStrictNull.ts, 0, 11)) +>then : Symbol(Promise.then, Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) +>Promise.resolve : Symbol(PromiseConstructor.resolve, Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) +>Promise : Symbol(Promise, Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --)) +>resolve : Symbol(PromiseConstructor.resolve, Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) + +const p74 = p.then(() => Promise.resolve("1"), () => Promise.resolve(1)); +>p74 : Symbol(p74, Decl(promiseTypeStrictNull.ts, 146, 5)) +>p.then : Symbol(Promise.then, Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) +>p : Symbol(p, Decl(promiseTypeStrictNull.ts, 0, 11)) +>then : Symbol(Promise.then, Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) +>Promise.resolve : Symbol(PromiseConstructor.resolve, Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) +>Promise : Symbol(Promise, Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --)) +>resolve : Symbol(PromiseConstructor.resolve, Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) +>Promise.resolve : Symbol(PromiseConstructor.resolve, Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) +>Promise : Symbol(Promise, Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --)) +>resolve : Symbol(PromiseConstructor.resolve, Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) + +const p75 = p.then(() => Promise.resolve("1"), () => Promise.reject(1)); +>p75 : Symbol(p75, Decl(promiseTypeStrictNull.ts, 147, 5)) +>p.then : Symbol(Promise.then, Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) +>p : Symbol(p, Decl(promiseTypeStrictNull.ts, 0, 11)) +>then : Symbol(Promise.then, Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) +>Promise.resolve : Symbol(PromiseConstructor.resolve, Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) +>Promise : Symbol(Promise, Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --)) +>resolve : Symbol(PromiseConstructor.resolve, Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) +>Promise.reject : Symbol(PromiseConstructor.reject, Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) +>Promise : Symbol(Promise, Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --)) +>reject : Symbol(PromiseConstructor.reject, Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) + +const p80 = p.then(() => Promise.reject(1), undefined); +>p80 : Symbol(p80, Decl(promiseTypeStrictNull.ts, 149, 5)) +>p.then : Symbol(Promise.then, Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) +>p : Symbol(p, Decl(promiseTypeStrictNull.ts, 0, 11)) +>then : Symbol(Promise.then, Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) +>Promise.reject : Symbol(PromiseConstructor.reject, Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) +>Promise : Symbol(Promise, Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --)) +>reject : Symbol(PromiseConstructor.reject, Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) +>undefined : Symbol(undefined) + +const p81 = p.then(() => Promise.reject(1), () => 1); +>p81 : Symbol(p81, Decl(promiseTypeStrictNull.ts, 150, 5)) +>p.then : Symbol(Promise.then, Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) +>p : Symbol(p, Decl(promiseTypeStrictNull.ts, 0, 11)) +>then : Symbol(Promise.then, Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) +>Promise.reject : Symbol(PromiseConstructor.reject, Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) +>Promise : Symbol(Promise, Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --)) +>reject : Symbol(PromiseConstructor.reject, Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) + +const p82 = p.then(() => Promise.reject(1), () => {}); +>p82 : Symbol(p82, Decl(promiseTypeStrictNull.ts, 151, 5)) +>p.then : Symbol(Promise.then, Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) +>p : Symbol(p, Decl(promiseTypeStrictNull.ts, 0, 11)) +>then : Symbol(Promise.then, Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) +>Promise.reject : Symbol(PromiseConstructor.reject, Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) +>Promise : Symbol(Promise, Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --)) +>reject : Symbol(PromiseConstructor.reject, Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) + +const p83 = p.then(() => Promise.reject(1), () => {throw 1}); +>p83 : Symbol(p83, Decl(promiseTypeStrictNull.ts, 152, 5)) +>p.then : Symbol(Promise.then, Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) +>p : Symbol(p, Decl(promiseTypeStrictNull.ts, 0, 11)) +>then : Symbol(Promise.then, Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) +>Promise.reject : Symbol(PromiseConstructor.reject, Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) +>Promise : Symbol(Promise, Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --)) +>reject : Symbol(PromiseConstructor.reject, Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) + +const p84 = p.then(() => Promise.reject(1), () => Promise.resolve(1)); +>p84 : Symbol(p84, Decl(promiseTypeStrictNull.ts, 153, 5)) +>p.then : Symbol(Promise.then, Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) +>p : Symbol(p, Decl(promiseTypeStrictNull.ts, 0, 11)) +>then : Symbol(Promise.then, Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) +>Promise.reject : Symbol(PromiseConstructor.reject, Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) +>Promise : Symbol(Promise, Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --)) +>reject : Symbol(PromiseConstructor.reject, Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) +>Promise.resolve : Symbol(PromiseConstructor.resolve, Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) +>Promise : Symbol(Promise, Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --)) +>resolve : Symbol(PromiseConstructor.resolve, Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) + +const p85 = p.then(() => Promise.reject(1), () => Promise.reject(1)); +>p85 : Symbol(p85, Decl(promiseTypeStrictNull.ts, 154, 5)) +>p.then : Symbol(Promise.then, Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) +>p : Symbol(p, Decl(promiseTypeStrictNull.ts, 0, 11)) +>then : Symbol(Promise.then, Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) +>Promise.reject : Symbol(PromiseConstructor.reject, Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) +>Promise : Symbol(Promise, Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --)) +>reject : Symbol(PromiseConstructor.reject, Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) +>Promise.reject : Symbol(PromiseConstructor.reject, Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) +>Promise : Symbol(Promise, Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --)) +>reject : Symbol(PromiseConstructor.reject, Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) + diff --git a/tests/baselines/reference/promiseTypeStrictNull.types b/tests/baselines/reference/promiseTypeStrictNull.types new file mode 100644 index 00000000000..a65547ec5f3 --- /dev/null +++ b/tests/baselines/reference/promiseTypeStrictNull.types @@ -0,0 +1,900 @@ +=== tests/cases/compiler/promiseTypeStrictNull.ts === +declare var p: Promise; +>p : Promise +>Promise : Promise + +const a = p.then(); +>a : Promise +>p.then() : Promise +>p.then : { (onfulfilled?: ((value: boolean) => boolean | PromiseLike) | null | undefined, onrejected?: ((reason: any) => boolean | PromiseLike) | null | undefined): Promise; (onfulfilled: ((value: boolean) => boolean | PromiseLike) | null | undefined, onrejected: (reason: any) => TResult | PromiseLike): Promise; (onfulfilled: (value: boolean) => TResult | PromiseLike, onrejected?: ((reason: any) => TResult | PromiseLike) | null | undefined): Promise; (onfulfilled: (value: boolean) => TResult1 | PromiseLike, onrejected: (reason: any) => TResult2 | PromiseLike): Promise; } +>p : Promise +>then : { (onfulfilled?: ((value: boolean) => boolean | PromiseLike) | null | undefined, onrejected?: ((reason: any) => boolean | PromiseLike) | null | undefined): Promise; (onfulfilled: ((value: boolean) => boolean | PromiseLike) | null | undefined, onrejected: (reason: any) => TResult | PromiseLike): Promise; (onfulfilled: (value: boolean) => TResult | PromiseLike, onrejected?: ((reason: any) => TResult | PromiseLike) | null | undefined): Promise; (onfulfilled: (value: boolean) => TResult1 | PromiseLike, onrejected: (reason: any) => TResult2 | PromiseLike): Promise; } + +const b = p.then(b => 1); +>b : Promise<1> +>p.then(b => 1) : Promise<1> +>p.then : { (onfulfilled?: ((value: boolean) => boolean | PromiseLike) | null | undefined, onrejected?: ((reason: any) => boolean | PromiseLike) | null | undefined): Promise; (onfulfilled: ((value: boolean) => boolean | PromiseLike) | null | undefined, onrejected: (reason: any) => TResult | PromiseLike): Promise; (onfulfilled: (value: boolean) => TResult | PromiseLike, onrejected?: ((reason: any) => TResult | PromiseLike) | null | undefined): Promise; (onfulfilled: (value: boolean) => TResult1 | PromiseLike, onrejected: (reason: any) => TResult2 | PromiseLike): Promise; } +>p : Promise +>then : { (onfulfilled?: ((value: boolean) => boolean | PromiseLike) | null | undefined, onrejected?: ((reason: any) => boolean | PromiseLike) | null | undefined): Promise; (onfulfilled: ((value: boolean) => boolean | PromiseLike) | null | undefined, onrejected: (reason: any) => TResult | PromiseLike): Promise; (onfulfilled: (value: boolean) => TResult | PromiseLike, onrejected?: ((reason: any) => TResult | PromiseLike) | null | undefined): Promise; (onfulfilled: (value: boolean) => TResult1 | PromiseLike, onrejected: (reason: any) => TResult2 | PromiseLike): Promise; } +>b => 1 : (b: boolean) => 1 +>b : boolean +>1 : 1 + +const c = p.then(b => 1, e => 'error'); +>c : Promise +>p.then(b => 1, e => 'error') : Promise +>p.then : { (onfulfilled?: ((value: boolean) => boolean | PromiseLike) | null | undefined, onrejected?: ((reason: any) => boolean | PromiseLike) | null | undefined): Promise; (onfulfilled: ((value: boolean) => boolean | PromiseLike) | null | undefined, onrejected: (reason: any) => TResult | PromiseLike): Promise; (onfulfilled: (value: boolean) => TResult | PromiseLike, onrejected?: ((reason: any) => TResult | PromiseLike) | null | undefined): Promise; (onfulfilled: (value: boolean) => TResult1 | PromiseLike, onrejected: (reason: any) => TResult2 | PromiseLike): Promise; } +>p : Promise +>then : { (onfulfilled?: ((value: boolean) => boolean | PromiseLike) | null | undefined, onrejected?: ((reason: any) => boolean | PromiseLike) | null | undefined): Promise; (onfulfilled: ((value: boolean) => boolean | PromiseLike) | null | undefined, onrejected: (reason: any) => TResult | PromiseLike): Promise; (onfulfilled: (value: boolean) => TResult | PromiseLike, onrejected?: ((reason: any) => TResult | PromiseLike) | null | undefined): Promise; (onfulfilled: (value: boolean) => TResult1 | PromiseLike, onrejected: (reason: any) => TResult2 | PromiseLike): Promise; } +>b => 1 : (b: boolean) => 1 +>b : boolean +>1 : 1 +>e => 'error' : (e: any) => string +>e : any +>'error' : "error" + +const d = p.then(b => 1, e => { }); +>d : Promise +>p.then(b => 1, e => { }) : Promise +>p.then : { (onfulfilled?: ((value: boolean) => boolean | PromiseLike) | null | undefined, onrejected?: ((reason: any) => boolean | PromiseLike) | null | undefined): Promise; (onfulfilled: ((value: boolean) => boolean | PromiseLike) | null | undefined, onrejected: (reason: any) => TResult | PromiseLike): Promise; (onfulfilled: (value: boolean) => TResult | PromiseLike, onrejected?: ((reason: any) => TResult | PromiseLike) | null | undefined): Promise; (onfulfilled: (value: boolean) => TResult1 | PromiseLike, onrejected: (reason: any) => TResult2 | PromiseLike): Promise; } +>p : Promise +>then : { (onfulfilled?: ((value: boolean) => boolean | PromiseLike) | null | undefined, onrejected?: ((reason: any) => boolean | PromiseLike) | null | undefined): Promise; (onfulfilled: ((value: boolean) => boolean | PromiseLike) | null | undefined, onrejected: (reason: any) => TResult | PromiseLike): Promise; (onfulfilled: (value: boolean) => TResult | PromiseLike, onrejected?: ((reason: any) => TResult | PromiseLike) | null | undefined): Promise; (onfulfilled: (value: boolean) => TResult1 | PromiseLike, onrejected: (reason: any) => TResult2 | PromiseLike): Promise; } +>b => 1 : (b: boolean) => 1 +>b : boolean +>1 : 1 +>e => { } : (e: any) => void +>e : any + +const e = p.then(b => 1, e => { throw Error(); }); +>e : Promise<1> +>p.then(b => 1, e => { throw Error(); }) : Promise<1> +>p.then : { (onfulfilled?: ((value: boolean) => boolean | PromiseLike) | null | undefined, onrejected?: ((reason: any) => boolean | PromiseLike) | null | undefined): Promise; (onfulfilled: ((value: boolean) => boolean | PromiseLike) | null | undefined, onrejected: (reason: any) => TResult | PromiseLike): Promise; (onfulfilled: (value: boolean) => TResult | PromiseLike, onrejected?: ((reason: any) => TResult | PromiseLike) | null | undefined): Promise; (onfulfilled: (value: boolean) => TResult1 | PromiseLike, onrejected: (reason: any) => TResult2 | PromiseLike): Promise; } +>p : Promise +>then : { (onfulfilled?: ((value: boolean) => boolean | PromiseLike) | null | undefined, onrejected?: ((reason: any) => boolean | PromiseLike) | null | undefined): Promise; (onfulfilled: ((value: boolean) => boolean | PromiseLike) | null | undefined, onrejected: (reason: any) => TResult | PromiseLike): Promise; (onfulfilled: (value: boolean) => TResult | PromiseLike, onrejected?: ((reason: any) => TResult | PromiseLike) | null | undefined): Promise; (onfulfilled: (value: boolean) => TResult1 | PromiseLike, onrejected: (reason: any) => TResult2 | PromiseLike): Promise; } +>b => 1 : (b: boolean) => 1 +>b : boolean +>1 : 1 +>e => { throw Error(); } : (e: any) => never +>e : any +>Error() : Error +>Error : ErrorConstructor + +const f = p.then(b => 1, e => Promise.reject(Error())); +>f : Promise<1> +>p.then(b => 1, e => Promise.reject(Error())) : Promise<1> +>p.then : { (onfulfilled?: ((value: boolean) => boolean | PromiseLike) | null | undefined, onrejected?: ((reason: any) => boolean | PromiseLike) | null | undefined): Promise; (onfulfilled: ((value: boolean) => boolean | PromiseLike) | null | undefined, onrejected: (reason: any) => TResult | PromiseLike): Promise; (onfulfilled: (value: boolean) => TResult | PromiseLike, onrejected?: ((reason: any) => TResult | PromiseLike) | null | undefined): Promise; (onfulfilled: (value: boolean) => TResult1 | PromiseLike, onrejected: (reason: any) => TResult2 | PromiseLike): Promise; } +>p : Promise +>then : { (onfulfilled?: ((value: boolean) => boolean | PromiseLike) | null | undefined, onrejected?: ((reason: any) => boolean | PromiseLike) | null | undefined): Promise; (onfulfilled: ((value: boolean) => boolean | PromiseLike) | null | undefined, onrejected: (reason: any) => TResult | PromiseLike): Promise; (onfulfilled: (value: boolean) => TResult | PromiseLike, onrejected?: ((reason: any) => TResult | PromiseLike) | null | undefined): Promise; (onfulfilled: (value: boolean) => TResult1 | PromiseLike, onrejected: (reason: any) => TResult2 | PromiseLike): Promise; } +>b => 1 : (b: boolean) => 1 +>b : boolean +>1 : 1 +>e => Promise.reject(Error()) : (e: any) => Promise +>e : any +>Promise.reject(Error()) : Promise +>Promise.reject : { (reason: any): Promise; (reason: any): Promise; } +>Promise : PromiseConstructor +>reject : { (reason: any): Promise; (reason: any): Promise; } +>Error() : Error +>Error : ErrorConstructor + +const g = p.catch(e => 'error'); +>g : Promise +>p.catch(e => 'error') : Promise +>p.catch : { (onrejected?: ((reason: any) => boolean | PromiseLike) | null | undefined): Promise; (onrejected: (reason: any) => TResult | PromiseLike): Promise; } +>p : Promise +>catch : { (onrejected?: ((reason: any) => boolean | PromiseLike) | null | undefined): Promise; (onrejected: (reason: any) => TResult | PromiseLike): Promise; } +>e => 'error' : (e: any) => "error" +>e : any +>'error' : "error" + +const h = p.catch(e => { }); +>h : Promise +>p.catch(e => { }) : Promise +>p.catch : { (onrejected?: ((reason: any) => boolean | PromiseLike) | null | undefined): Promise; (onrejected: (reason: any) => TResult | PromiseLike): Promise; } +>p : Promise +>catch : { (onrejected?: ((reason: any) => boolean | PromiseLike) | null | undefined): Promise; (onrejected: (reason: any) => TResult | PromiseLike): Promise; } +>e => { } : (e: any) => void +>e : any + +const i = p.catch(e => { throw Error(); }); +>i : Promise +>p.catch(e => { throw Error(); }) : Promise +>p.catch : { (onrejected?: ((reason: any) => boolean | PromiseLike) | null | undefined): Promise; (onrejected: (reason: any) => TResult | PromiseLike): Promise; } +>p : Promise +>catch : { (onrejected?: ((reason: any) => boolean | PromiseLike) | null | undefined): Promise; (onrejected: (reason: any) => TResult | PromiseLike): Promise; } +>e => { throw Error(); } : (e: any) => never +>e : any +>Error() : Error +>Error : ErrorConstructor + +const j = p.catch(e => Promise.reject(Error())); +>j : Promise +>p.catch(e => Promise.reject(Error())) : Promise +>p.catch : { (onrejected?: ((reason: any) => boolean | PromiseLike) | null | undefined): Promise; (onrejected: (reason: any) => TResult | PromiseLike): Promise; } +>p : Promise +>catch : { (onrejected?: ((reason: any) => boolean | PromiseLike) | null | undefined): Promise; (onrejected: (reason: any) => TResult | PromiseLike): Promise; } +>e => Promise.reject(Error()) : (e: any) => Promise +>e : any +>Promise.reject(Error()) : Promise +>Promise.reject : { (reason: any): Promise; (reason: any): Promise; } +>Promise : PromiseConstructor +>reject : { (reason: any): Promise; (reason: any): Promise; } +>Error() : Error +>Error : ErrorConstructor + +async function A() { +>A : () => Promise + + const a = await p; +>a : boolean +>await p : boolean +>p : Promise + + return a; +>a : boolean +} + +async function B() { +>B : () => Promise + + const a = await p; +>a : boolean +>await p : boolean +>p : Promise + + return 1; +>1 : 1 +} + +// NOTE: This reports a "No best comment type exists among return expressions." error, and is +// ignored to get the types result for the test. +// async function C() { +// try { +// const a = await p; +// return 1; +// } +// catch (e) { +// return 'error'; +// } +// } + +async function D() { +>D : () => Promise<1 | undefined> + + try { + const a = await p; +>a : boolean +>await p : boolean +>p : Promise + + return 1; +>1 : 1 + } + catch (e) { +>e : any + } +} + +async function E() { +>E : () => Promise + + try { + const a = await p; +>a : boolean +>await p : boolean +>p : Promise + + return 1; +>1 : 1 + } + catch (e) { +>e : any + + throw Error(); +>Error() : Error +>Error : ErrorConstructor + } +} + +async function F() { +>F : () => Promise + + try { + const a = await p; +>a : boolean +>await p : boolean +>p : Promise + + return 1; +>1 : 1 + } + catch (e) { +>e : any + + return Promise.reject(Error()); +>Promise.reject(Error()) : Promise +>Promise.reject : { (reason: any): Promise; (reason: any): Promise; } +>Promise : PromiseConstructor +>reject : { (reason: any): Promise; (reason: any): Promise; } +>Error() : Error +>Error : ErrorConstructor + } +} + +async function G() { +>G : () => Promise + + try { + const a = await p; +>a : boolean +>await p : boolean +>p : Promise + + return a; +>a : boolean + } + catch (e) { +>e : any + + return; + } +} + +async function H() { +>H : () => Promise + + try { + const a = await p; +>a : boolean +>await p : boolean +>p : Promise + + return a; +>a : boolean + } + catch (e) { +>e : any + + throw Error(); +>Error() : Error +>Error : ErrorConstructor + } +} + +async function I() { +>I : () => Promise + + try { + const a = await p; +>a : boolean +>await p : boolean +>p : Promise + + return a; +>a : boolean + } + catch (e) { +>e : any + + return Promise.reject(Error()); +>Promise.reject(Error()) : Promise +>Promise.reject : { (reason: any): Promise; (reason: any): Promise; } +>Promise : PromiseConstructor +>reject : { (reason: any): Promise; (reason: any): Promise; } +>Error() : Error +>Error : ErrorConstructor + } +} + +// addresses github issue #4903: + +const p00 = p.catch(); +>p00 : Promise +>p.catch() : Promise +>p.catch : { (onrejected?: ((reason: any) => boolean | PromiseLike) | null | undefined): Promise; (onrejected: (reason: any) => TResult | PromiseLike): Promise; } +>p : Promise +>catch : { (onrejected?: ((reason: any) => boolean | PromiseLike) | null | undefined): Promise; (onrejected: (reason: any) => TResult | PromiseLike): Promise; } + +const p01 = p.catch(undefined); +>p01 : Promise +>p.catch(undefined) : Promise +>p.catch : { (onrejected?: ((reason: any) => boolean | PromiseLike) | null | undefined): Promise; (onrejected: (reason: any) => TResult | PromiseLike): Promise; } +>p : Promise +>catch : { (onrejected?: ((reason: any) => boolean | PromiseLike) | null | undefined): Promise; (onrejected: (reason: any) => TResult | PromiseLike): Promise; } +>undefined : undefined + +const p07 = p.catch(null); +>p07 : Promise +>p.catch(null) : Promise +>p.catch : { (onrejected?: ((reason: any) => boolean | PromiseLike) | null | undefined): Promise; (onrejected: (reason: any) => TResult | PromiseLike): Promise; } +>p : Promise +>catch : { (onrejected?: ((reason: any) => boolean | PromiseLike) | null | undefined): Promise; (onrejected: (reason: any) => TResult | PromiseLike): Promise; } +>null : null + +const p02 = p.catch(() => 1); +>p02 : Promise +>p.catch(() => 1) : Promise +>p.catch : { (onrejected?: ((reason: any) => boolean | PromiseLike) | null | undefined): Promise; (onrejected: (reason: any) => TResult | PromiseLike): Promise; } +>p : Promise +>catch : { (onrejected?: ((reason: any) => boolean | PromiseLike) | null | undefined): Promise; (onrejected: (reason: any) => TResult | PromiseLike): Promise; } +>() => 1 : () => 1 +>1 : 1 + +const p03 = p.catch(() => {}); +>p03 : Promise +>p.catch(() => {}) : Promise +>p.catch : { (onrejected?: ((reason: any) => boolean | PromiseLike) | null | undefined): Promise; (onrejected: (reason: any) => TResult | PromiseLike): Promise; } +>p : Promise +>catch : { (onrejected?: ((reason: any) => boolean | PromiseLike) | null | undefined): Promise; (onrejected: (reason: any) => TResult | PromiseLike): Promise; } +>() => {} : () => void + +const p04 = p.catch(() => {throw 1}); +>p04 : Promise +>p.catch(() => {throw 1}) : Promise +>p.catch : { (onrejected?: ((reason: any) => boolean | PromiseLike) | null | undefined): Promise; (onrejected: (reason: any) => TResult | PromiseLike): Promise; } +>p : Promise +>catch : { (onrejected?: ((reason: any) => boolean | PromiseLike) | null | undefined): Promise; (onrejected: (reason: any) => TResult | PromiseLike): Promise; } +>() => {throw 1} : () => never +>1 : 1 + +const p05 = p.catch(() => Promise.reject(1)); +>p05 : Promise +>p.catch(() => Promise.reject(1)) : Promise +>p.catch : { (onrejected?: ((reason: any) => boolean | PromiseLike) | null | undefined): Promise; (onrejected: (reason: any) => TResult | PromiseLike): Promise; } +>p : Promise +>catch : { (onrejected?: ((reason: any) => boolean | PromiseLike) | null | undefined): Promise; (onrejected: (reason: any) => TResult | PromiseLike): Promise; } +>() => Promise.reject(1) : () => Promise +>Promise.reject(1) : Promise +>Promise.reject : { (reason: any): Promise; (reason: any): Promise; } +>Promise : PromiseConstructor +>reject : { (reason: any): Promise; (reason: any): Promise; } +>1 : 1 + +const p06 = p.catch(() => Promise.resolve(1)); +>p06 : Promise +>p.catch(() => Promise.resolve(1)) : Promise +>p.catch : { (onrejected?: ((reason: any) => boolean | PromiseLike) | null | undefined): Promise; (onrejected: (reason: any) => TResult | PromiseLike): Promise; } +>p : Promise +>catch : { (onrejected?: ((reason: any) => boolean | PromiseLike) | null | undefined): Promise; (onrejected: (reason: any) => TResult | PromiseLike): Promise; } +>() => Promise.resolve(1) : () => Promise +>Promise.resolve(1) : Promise +>Promise.resolve : { (value: T | PromiseLike): Promise; (): Promise; } +>Promise : PromiseConstructor +>resolve : { (value: T | PromiseLike): Promise; (): Promise; } +>1 : 1 + +const p10 = p.then(); +>p10 : Promise +>p.then() : Promise +>p.then : { (onfulfilled?: ((value: boolean) => boolean | PromiseLike) | null | undefined, onrejected?: ((reason: any) => boolean | PromiseLike) | null | undefined): Promise; (onfulfilled: ((value: boolean) => boolean | PromiseLike) | null | undefined, onrejected: (reason: any) => TResult | PromiseLike): Promise; (onfulfilled: (value: boolean) => TResult | PromiseLike, onrejected?: ((reason: any) => TResult | PromiseLike) | null | undefined): Promise; (onfulfilled: (value: boolean) => TResult1 | PromiseLike, onrejected: (reason: any) => TResult2 | PromiseLike): Promise; } +>p : Promise +>then : { (onfulfilled?: ((value: boolean) => boolean | PromiseLike) | null | undefined, onrejected?: ((reason: any) => boolean | PromiseLike) | null | undefined): Promise; (onfulfilled: ((value: boolean) => boolean | PromiseLike) | null | undefined, onrejected: (reason: any) => TResult | PromiseLike): Promise; (onfulfilled: (value: boolean) => TResult | PromiseLike, onrejected?: ((reason: any) => TResult | PromiseLike) | null | undefined): Promise; (onfulfilled: (value: boolean) => TResult1 | PromiseLike, onrejected: (reason: any) => TResult2 | PromiseLike): Promise; } + +const p20 = p.then(undefined); +>p20 : Promise +>p.then(undefined) : Promise +>p.then : { (onfulfilled?: ((value: boolean) => boolean | PromiseLike) | null | undefined, onrejected?: ((reason: any) => boolean | PromiseLike) | null | undefined): Promise; (onfulfilled: ((value: boolean) => boolean | PromiseLike) | null | undefined, onrejected: (reason: any) => TResult | PromiseLike): Promise; (onfulfilled: (value: boolean) => TResult | PromiseLike, onrejected?: ((reason: any) => TResult | PromiseLike) | null | undefined): Promise; (onfulfilled: (value: boolean) => TResult1 | PromiseLike, onrejected: (reason: any) => TResult2 | PromiseLike): Promise; } +>p : Promise +>then : { (onfulfilled?: ((value: boolean) => boolean | PromiseLike) | null | undefined, onrejected?: ((reason: any) => boolean | PromiseLike) | null | undefined): Promise; (onfulfilled: ((value: boolean) => boolean | PromiseLike) | null | undefined, onrejected: (reason: any) => TResult | PromiseLike): Promise; (onfulfilled: (value: boolean) => TResult | PromiseLike, onrejected?: ((reason: any) => TResult | PromiseLike) | null | undefined): Promise; (onfulfilled: (value: boolean) => TResult1 | PromiseLike, onrejected: (reason: any) => TResult2 | PromiseLike): Promise; } +>undefined : undefined + +const p21 = p.then(() => 1); +>p21 : Promise<1> +>p.then(() => 1) : Promise<1> +>p.then : { (onfulfilled?: ((value: boolean) => boolean | PromiseLike) | null | undefined, onrejected?: ((reason: any) => boolean | PromiseLike) | null | undefined): Promise; (onfulfilled: ((value: boolean) => boolean | PromiseLike) | null | undefined, onrejected: (reason: any) => TResult | PromiseLike): Promise; (onfulfilled: (value: boolean) => TResult | PromiseLike, onrejected?: ((reason: any) => TResult | PromiseLike) | null | undefined): Promise; (onfulfilled: (value: boolean) => TResult1 | PromiseLike, onrejected: (reason: any) => TResult2 | PromiseLike): Promise; } +>p : Promise +>then : { (onfulfilled?: ((value: boolean) => boolean | PromiseLike) | null | undefined, onrejected?: ((reason: any) => boolean | PromiseLike) | null | undefined): Promise; (onfulfilled: ((value: boolean) => boolean | PromiseLike) | null | undefined, onrejected: (reason: any) => TResult | PromiseLike): Promise; (onfulfilled: (value: boolean) => TResult | PromiseLike, onrejected?: ((reason: any) => TResult | PromiseLike) | null | undefined): Promise; (onfulfilled: (value: boolean) => TResult1 | PromiseLike, onrejected: (reason: any) => TResult2 | PromiseLike): Promise; } +>() => 1 : () => 1 +>1 : 1 + +const p22 = p.then(() => {}); +>p22 : Promise +>p.then(() => {}) : Promise +>p.then : { (onfulfilled?: ((value: boolean) => boolean | PromiseLike) | null | undefined, onrejected?: ((reason: any) => boolean | PromiseLike) | null | undefined): Promise; (onfulfilled: ((value: boolean) => boolean | PromiseLike) | null | undefined, onrejected: (reason: any) => TResult | PromiseLike): Promise; (onfulfilled: (value: boolean) => TResult | PromiseLike, onrejected?: ((reason: any) => TResult | PromiseLike) | null | undefined): Promise; (onfulfilled: (value: boolean) => TResult1 | PromiseLike, onrejected: (reason: any) => TResult2 | PromiseLike): Promise; } +>p : Promise +>then : { (onfulfilled?: ((value: boolean) => boolean | PromiseLike) | null | undefined, onrejected?: ((reason: any) => boolean | PromiseLike) | null | undefined): Promise; (onfulfilled: ((value: boolean) => boolean | PromiseLike) | null | undefined, onrejected: (reason: any) => TResult | PromiseLike): Promise; (onfulfilled: (value: boolean) => TResult | PromiseLike, onrejected?: ((reason: any) => TResult | PromiseLike) | null | undefined): Promise; (onfulfilled: (value: boolean) => TResult1 | PromiseLike, onrejected: (reason: any) => TResult2 | PromiseLike): Promise; } +>() => {} : () => void + +const p23 = p.then(() => {throw 1}); +>p23 : Promise +>p.then(() => {throw 1}) : Promise +>p.then : { (onfulfilled?: ((value: boolean) => boolean | PromiseLike) | null | undefined, onrejected?: ((reason: any) => boolean | PromiseLike) | null | undefined): Promise; (onfulfilled: ((value: boolean) => boolean | PromiseLike) | null | undefined, onrejected: (reason: any) => TResult | PromiseLike): Promise; (onfulfilled: (value: boolean) => TResult | PromiseLike, onrejected?: ((reason: any) => TResult | PromiseLike) | null | undefined): Promise; (onfulfilled: (value: boolean) => TResult1 | PromiseLike, onrejected: (reason: any) => TResult2 | PromiseLike): Promise; } +>p : Promise +>then : { (onfulfilled?: ((value: boolean) => boolean | PromiseLike) | null | undefined, onrejected?: ((reason: any) => boolean | PromiseLike) | null | undefined): Promise; (onfulfilled: ((value: boolean) => boolean | PromiseLike) | null | undefined, onrejected: (reason: any) => TResult | PromiseLike): Promise; (onfulfilled: (value: boolean) => TResult | PromiseLike, onrejected?: ((reason: any) => TResult | PromiseLike) | null | undefined): Promise; (onfulfilled: (value: boolean) => TResult1 | PromiseLike, onrejected: (reason: any) => TResult2 | PromiseLike): Promise; } +>() => {throw 1} : () => never +>1 : 1 + +const p24 = p.then(() => Promise.resolve(1)); +>p24 : Promise +>p.then(() => Promise.resolve(1)) : Promise +>p.then : { (onfulfilled?: ((value: boolean) => boolean | PromiseLike) | null | undefined, onrejected?: ((reason: any) => boolean | PromiseLike) | null | undefined): Promise; (onfulfilled: ((value: boolean) => boolean | PromiseLike) | null | undefined, onrejected: (reason: any) => TResult | PromiseLike): Promise; (onfulfilled: (value: boolean) => TResult | PromiseLike, onrejected?: ((reason: any) => TResult | PromiseLike) | null | undefined): Promise; (onfulfilled: (value: boolean) => TResult1 | PromiseLike, onrejected: (reason: any) => TResult2 | PromiseLike): Promise; } +>p : Promise +>then : { (onfulfilled?: ((value: boolean) => boolean | PromiseLike) | null | undefined, onrejected?: ((reason: any) => boolean | PromiseLike) | null | undefined): Promise; (onfulfilled: ((value: boolean) => boolean | PromiseLike) | null | undefined, onrejected: (reason: any) => TResult | PromiseLike): Promise; (onfulfilled: (value: boolean) => TResult | PromiseLike, onrejected?: ((reason: any) => TResult | PromiseLike) | null | undefined): Promise; (onfulfilled: (value: boolean) => TResult1 | PromiseLike, onrejected: (reason: any) => TResult2 | PromiseLike): Promise; } +>() => Promise.resolve(1) : () => Promise +>Promise.resolve(1) : Promise +>Promise.resolve : { (value: T | PromiseLike): Promise; (): Promise; } +>Promise : PromiseConstructor +>resolve : { (value: T | PromiseLike): Promise; (): Promise; } +>1 : 1 + +const p25 = p.then(() => Promise.reject(1)); +>p25 : Promise +>p.then(() => Promise.reject(1)) : Promise +>p.then : { (onfulfilled?: ((value: boolean) => boolean | PromiseLike) | null | undefined, onrejected?: ((reason: any) => boolean | PromiseLike) | null | undefined): Promise; (onfulfilled: ((value: boolean) => boolean | PromiseLike) | null | undefined, onrejected: (reason: any) => TResult | PromiseLike): Promise; (onfulfilled: (value: boolean) => TResult | PromiseLike, onrejected?: ((reason: any) => TResult | PromiseLike) | null | undefined): Promise; (onfulfilled: (value: boolean) => TResult1 | PromiseLike, onrejected: (reason: any) => TResult2 | PromiseLike): Promise; } +>p : Promise +>then : { (onfulfilled?: ((value: boolean) => boolean | PromiseLike) | null | undefined, onrejected?: ((reason: any) => boolean | PromiseLike) | null | undefined): Promise; (onfulfilled: ((value: boolean) => boolean | PromiseLike) | null | undefined, onrejected: (reason: any) => TResult | PromiseLike): Promise; (onfulfilled: (value: boolean) => TResult | PromiseLike, onrejected?: ((reason: any) => TResult | PromiseLike) | null | undefined): Promise; (onfulfilled: (value: boolean) => TResult1 | PromiseLike, onrejected: (reason: any) => TResult2 | PromiseLike): Promise; } +>() => Promise.reject(1) : () => Promise +>Promise.reject(1) : Promise +>Promise.reject : { (reason: any): Promise; (reason: any): Promise; } +>Promise : PromiseConstructor +>reject : { (reason: any): Promise; (reason: any): Promise; } +>1 : 1 + +const p30 = p.then(undefined, undefined); +>p30 : Promise +>p.then(undefined, undefined) : Promise +>p.then : { (onfulfilled?: ((value: boolean) => boolean | PromiseLike) | null | undefined, onrejected?: ((reason: any) => boolean | PromiseLike) | null | undefined): Promise; (onfulfilled: ((value: boolean) => boolean | PromiseLike) | null | undefined, onrejected: (reason: any) => TResult | PromiseLike): Promise; (onfulfilled: (value: boolean) => TResult | PromiseLike, onrejected?: ((reason: any) => TResult | PromiseLike) | null | undefined): Promise; (onfulfilled: (value: boolean) => TResult1 | PromiseLike, onrejected: (reason: any) => TResult2 | PromiseLike): Promise; } +>p : Promise +>then : { (onfulfilled?: ((value: boolean) => boolean | PromiseLike) | null | undefined, onrejected?: ((reason: any) => boolean | PromiseLike) | null | undefined): Promise; (onfulfilled: ((value: boolean) => boolean | PromiseLike) | null | undefined, onrejected: (reason: any) => TResult | PromiseLike): Promise; (onfulfilled: (value: boolean) => TResult | PromiseLike, onrejected?: ((reason: any) => TResult | PromiseLike) | null | undefined): Promise; (onfulfilled: (value: boolean) => TResult1 | PromiseLike, onrejected: (reason: any) => TResult2 | PromiseLike): Promise; } +>undefined : undefined +>undefined : undefined + +const p31 = p.then(undefined, () => 1); +>p31 : Promise +>p.then(undefined, () => 1) : Promise +>p.then : { (onfulfilled?: ((value: boolean) => boolean | PromiseLike) | null | undefined, onrejected?: ((reason: any) => boolean | PromiseLike) | null | undefined): Promise; (onfulfilled: ((value: boolean) => boolean | PromiseLike) | null | undefined, onrejected: (reason: any) => TResult | PromiseLike): Promise; (onfulfilled: (value: boolean) => TResult | PromiseLike, onrejected?: ((reason: any) => TResult | PromiseLike) | null | undefined): Promise; (onfulfilled: (value: boolean) => TResult1 | PromiseLike, onrejected: (reason: any) => TResult2 | PromiseLike): Promise; } +>p : Promise +>then : { (onfulfilled?: ((value: boolean) => boolean | PromiseLike) | null | undefined, onrejected?: ((reason: any) => boolean | PromiseLike) | null | undefined): Promise; (onfulfilled: ((value: boolean) => boolean | PromiseLike) | null | undefined, onrejected: (reason: any) => TResult | PromiseLike): Promise; (onfulfilled: (value: boolean) => TResult | PromiseLike, onrejected?: ((reason: any) => TResult | PromiseLike) | null | undefined): Promise; (onfulfilled: (value: boolean) => TResult1 | PromiseLike, onrejected: (reason: any) => TResult2 | PromiseLike): Promise; } +>undefined : undefined +>() => 1 : () => 1 +>1 : 1 + +const p32 = p.then(undefined, () => {}); +>p32 : Promise +>p.then(undefined, () => {}) : Promise +>p.then : { (onfulfilled?: ((value: boolean) => boolean | PromiseLike) | null | undefined, onrejected?: ((reason: any) => boolean | PromiseLike) | null | undefined): Promise; (onfulfilled: ((value: boolean) => boolean | PromiseLike) | null | undefined, onrejected: (reason: any) => TResult | PromiseLike): Promise; (onfulfilled: (value: boolean) => TResult | PromiseLike, onrejected?: ((reason: any) => TResult | PromiseLike) | null | undefined): Promise; (onfulfilled: (value: boolean) => TResult1 | PromiseLike, onrejected: (reason: any) => TResult2 | PromiseLike): Promise; } +>p : Promise +>then : { (onfulfilled?: ((value: boolean) => boolean | PromiseLike) | null | undefined, onrejected?: ((reason: any) => boolean | PromiseLike) | null | undefined): Promise; (onfulfilled: ((value: boolean) => boolean | PromiseLike) | null | undefined, onrejected: (reason: any) => TResult | PromiseLike): Promise; (onfulfilled: (value: boolean) => TResult | PromiseLike, onrejected?: ((reason: any) => TResult | PromiseLike) | null | undefined): Promise; (onfulfilled: (value: boolean) => TResult1 | PromiseLike, onrejected: (reason: any) => TResult2 | PromiseLike): Promise; } +>undefined : undefined +>() => {} : () => void + +const p33 = p.then(undefined, () => {throw 1}); +>p33 : Promise +>p.then(undefined, () => {throw 1}) : Promise +>p.then : { (onfulfilled?: ((value: boolean) => boolean | PromiseLike) | null | undefined, onrejected?: ((reason: any) => boolean | PromiseLike) | null | undefined): Promise; (onfulfilled: ((value: boolean) => boolean | PromiseLike) | null | undefined, onrejected: (reason: any) => TResult | PromiseLike): Promise; (onfulfilled: (value: boolean) => TResult | PromiseLike, onrejected?: ((reason: any) => TResult | PromiseLike) | null | undefined): Promise; (onfulfilled: (value: boolean) => TResult1 | PromiseLike, onrejected: (reason: any) => TResult2 | PromiseLike): Promise; } +>p : Promise +>then : { (onfulfilled?: ((value: boolean) => boolean | PromiseLike) | null | undefined, onrejected?: ((reason: any) => boolean | PromiseLike) | null | undefined): Promise; (onfulfilled: ((value: boolean) => boolean | PromiseLike) | null | undefined, onrejected: (reason: any) => TResult | PromiseLike): Promise; (onfulfilled: (value: boolean) => TResult | PromiseLike, onrejected?: ((reason: any) => TResult | PromiseLike) | null | undefined): Promise; (onfulfilled: (value: boolean) => TResult1 | PromiseLike, onrejected: (reason: any) => TResult2 | PromiseLike): Promise; } +>undefined : undefined +>() => {throw 1} : () => never +>1 : 1 + +const p34 = p.then(undefined, () => Promise.resolve(1)); +>p34 : Promise +>p.then(undefined, () => Promise.resolve(1)) : Promise +>p.then : { (onfulfilled?: ((value: boolean) => boolean | PromiseLike) | null | undefined, onrejected?: ((reason: any) => boolean | PromiseLike) | null | undefined): Promise; (onfulfilled: ((value: boolean) => boolean | PromiseLike) | null | undefined, onrejected: (reason: any) => TResult | PromiseLike): Promise; (onfulfilled: (value: boolean) => TResult | PromiseLike, onrejected?: ((reason: any) => TResult | PromiseLike) | null | undefined): Promise; (onfulfilled: (value: boolean) => TResult1 | PromiseLike, onrejected: (reason: any) => TResult2 | PromiseLike): Promise; } +>p : Promise +>then : { (onfulfilled?: ((value: boolean) => boolean | PromiseLike) | null | undefined, onrejected?: ((reason: any) => boolean | PromiseLike) | null | undefined): Promise; (onfulfilled: ((value: boolean) => boolean | PromiseLike) | null | undefined, onrejected: (reason: any) => TResult | PromiseLike): Promise; (onfulfilled: (value: boolean) => TResult | PromiseLike, onrejected?: ((reason: any) => TResult | PromiseLike) | null | undefined): Promise; (onfulfilled: (value: boolean) => TResult1 | PromiseLike, onrejected: (reason: any) => TResult2 | PromiseLike): Promise; } +>undefined : undefined +>() => Promise.resolve(1) : () => Promise +>Promise.resolve(1) : Promise +>Promise.resolve : { (value: T | PromiseLike): Promise; (): Promise; } +>Promise : PromiseConstructor +>resolve : { (value: T | PromiseLike): Promise; (): Promise; } +>1 : 1 + +const p35 = p.then(undefined, () => Promise.reject(1)); +>p35 : Promise +>p.then(undefined, () => Promise.reject(1)) : Promise +>p.then : { (onfulfilled?: ((value: boolean) => boolean | PromiseLike) | null | undefined, onrejected?: ((reason: any) => boolean | PromiseLike) | null | undefined): Promise; (onfulfilled: ((value: boolean) => boolean | PromiseLike) | null | undefined, onrejected: (reason: any) => TResult | PromiseLike): Promise; (onfulfilled: (value: boolean) => TResult | PromiseLike, onrejected?: ((reason: any) => TResult | PromiseLike) | null | undefined): Promise; (onfulfilled: (value: boolean) => TResult1 | PromiseLike, onrejected: (reason: any) => TResult2 | PromiseLike): Promise; } +>p : Promise +>then : { (onfulfilled?: ((value: boolean) => boolean | PromiseLike) | null | undefined, onrejected?: ((reason: any) => boolean | PromiseLike) | null | undefined): Promise; (onfulfilled: ((value: boolean) => boolean | PromiseLike) | null | undefined, onrejected: (reason: any) => TResult | PromiseLike): Promise; (onfulfilled: (value: boolean) => TResult | PromiseLike, onrejected?: ((reason: any) => TResult | PromiseLike) | null | undefined): Promise; (onfulfilled: (value: boolean) => TResult1 | PromiseLike, onrejected: (reason: any) => TResult2 | PromiseLike): Promise; } +>undefined : undefined +>() => Promise.reject(1) : () => Promise +>Promise.reject(1) : Promise +>Promise.reject : { (reason: any): Promise; (reason: any): Promise; } +>Promise : PromiseConstructor +>reject : { (reason: any): Promise; (reason: any): Promise; } +>1 : 1 + +const p40 = p.then(() => "1", undefined); +>p40 : Promise<"1"> +>p.then(() => "1", undefined) : Promise<"1"> +>p.then : { (onfulfilled?: ((value: boolean) => boolean | PromiseLike) | null | undefined, onrejected?: ((reason: any) => boolean | PromiseLike) | null | undefined): Promise; (onfulfilled: ((value: boolean) => boolean | PromiseLike) | null | undefined, onrejected: (reason: any) => TResult | PromiseLike): Promise; (onfulfilled: (value: boolean) => TResult | PromiseLike, onrejected?: ((reason: any) => TResult | PromiseLike) | null | undefined): Promise; (onfulfilled: (value: boolean) => TResult1 | PromiseLike, onrejected: (reason: any) => TResult2 | PromiseLike): Promise; } +>p : Promise +>then : { (onfulfilled?: ((value: boolean) => boolean | PromiseLike) | null | undefined, onrejected?: ((reason: any) => boolean | PromiseLike) | null | undefined): Promise; (onfulfilled: ((value: boolean) => boolean | PromiseLike) | null | undefined, onrejected: (reason: any) => TResult | PromiseLike): Promise; (onfulfilled: (value: boolean) => TResult | PromiseLike, onrejected?: ((reason: any) => TResult | PromiseLike) | null | undefined): Promise; (onfulfilled: (value: boolean) => TResult1 | PromiseLike, onrejected: (reason: any) => TResult2 | PromiseLike): Promise; } +>() => "1" : () => "1" +>"1" : "1" +>undefined : undefined + +const p41 = p.then(() => "1", () => 1); +>p41 : Promise +>p.then(() => "1", () => 1) : Promise +>p.then : { (onfulfilled?: ((value: boolean) => boolean | PromiseLike) | null | undefined, onrejected?: ((reason: any) => boolean | PromiseLike) | null | undefined): Promise; (onfulfilled: ((value: boolean) => boolean | PromiseLike) | null | undefined, onrejected: (reason: any) => TResult | PromiseLike): Promise; (onfulfilled: (value: boolean) => TResult | PromiseLike, onrejected?: ((reason: any) => TResult | PromiseLike) | null | undefined): Promise; (onfulfilled: (value: boolean) => TResult1 | PromiseLike, onrejected: (reason: any) => TResult2 | PromiseLike): Promise; } +>p : Promise +>then : { (onfulfilled?: ((value: boolean) => boolean | PromiseLike) | null | undefined, onrejected?: ((reason: any) => boolean | PromiseLike) | null | undefined): Promise; (onfulfilled: ((value: boolean) => boolean | PromiseLike) | null | undefined, onrejected: (reason: any) => TResult | PromiseLike): Promise; (onfulfilled: (value: boolean) => TResult | PromiseLike, onrejected?: ((reason: any) => TResult | PromiseLike) | null | undefined): Promise; (onfulfilled: (value: boolean) => TResult1 | PromiseLike, onrejected: (reason: any) => TResult2 | PromiseLike): Promise; } +>() => "1" : () => "1" +>"1" : "1" +>() => 1 : () => number +>1 : 1 + +const p42 = p.then(() => "1", () => {}); +>p42 : Promise +>p.then(() => "1", () => {}) : Promise +>p.then : { (onfulfilled?: ((value: boolean) => boolean | PromiseLike) | null | undefined, onrejected?: ((reason: any) => boolean | PromiseLike) | null | undefined): Promise; (onfulfilled: ((value: boolean) => boolean | PromiseLike) | null | undefined, onrejected: (reason: any) => TResult | PromiseLike): Promise; (onfulfilled: (value: boolean) => TResult | PromiseLike, onrejected?: ((reason: any) => TResult | PromiseLike) | null | undefined): Promise; (onfulfilled: (value: boolean) => TResult1 | PromiseLike, onrejected: (reason: any) => TResult2 | PromiseLike): Promise; } +>p : Promise +>then : { (onfulfilled?: ((value: boolean) => boolean | PromiseLike) | null | undefined, onrejected?: ((reason: any) => boolean | PromiseLike) | null | undefined): Promise; (onfulfilled: ((value: boolean) => boolean | PromiseLike) | null | undefined, onrejected: (reason: any) => TResult | PromiseLike): Promise; (onfulfilled: (value: boolean) => TResult | PromiseLike, onrejected?: ((reason: any) => TResult | PromiseLike) | null | undefined): Promise; (onfulfilled: (value: boolean) => TResult1 | PromiseLike, onrejected: (reason: any) => TResult2 | PromiseLike): Promise; } +>() => "1" : () => "1" +>"1" : "1" +>() => {} : () => void + +const p43 = p.then(() => "1", () => {throw 1}); +>p43 : Promise<"1"> +>p.then(() => "1", () => {throw 1}) : Promise<"1"> +>p.then : { (onfulfilled?: ((value: boolean) => boolean | PromiseLike) | null | undefined, onrejected?: ((reason: any) => boolean | PromiseLike) | null | undefined): Promise; (onfulfilled: ((value: boolean) => boolean | PromiseLike) | null | undefined, onrejected: (reason: any) => TResult | PromiseLike): Promise; (onfulfilled: (value: boolean) => TResult | PromiseLike, onrejected?: ((reason: any) => TResult | PromiseLike) | null | undefined): Promise; (onfulfilled: (value: boolean) => TResult1 | PromiseLike, onrejected: (reason: any) => TResult2 | PromiseLike): Promise; } +>p : Promise +>then : { (onfulfilled?: ((value: boolean) => boolean | PromiseLike) | null | undefined, onrejected?: ((reason: any) => boolean | PromiseLike) | null | undefined): Promise; (onfulfilled: ((value: boolean) => boolean | PromiseLike) | null | undefined, onrejected: (reason: any) => TResult | PromiseLike): Promise; (onfulfilled: (value: boolean) => TResult | PromiseLike, onrejected?: ((reason: any) => TResult | PromiseLike) | null | undefined): Promise; (onfulfilled: (value: boolean) => TResult1 | PromiseLike, onrejected: (reason: any) => TResult2 | PromiseLike): Promise; } +>() => "1" : () => "1" +>"1" : "1" +>() => {throw 1} : () => never +>1 : 1 + +const p44 = p.then(() => "1", () => Promise.resolve(1)); +>p44 : Promise +>p.then(() => "1", () => Promise.resolve(1)) : Promise +>p.then : { (onfulfilled?: ((value: boolean) => boolean | PromiseLike) | null | undefined, onrejected?: ((reason: any) => boolean | PromiseLike) | null | undefined): Promise; (onfulfilled: ((value: boolean) => boolean | PromiseLike) | null | undefined, onrejected: (reason: any) => TResult | PromiseLike): Promise; (onfulfilled: (value: boolean) => TResult | PromiseLike, onrejected?: ((reason: any) => TResult | PromiseLike) | null | undefined): Promise; (onfulfilled: (value: boolean) => TResult1 | PromiseLike, onrejected: (reason: any) => TResult2 | PromiseLike): Promise; } +>p : Promise +>then : { (onfulfilled?: ((value: boolean) => boolean | PromiseLike) | null | undefined, onrejected?: ((reason: any) => boolean | PromiseLike) | null | undefined): Promise; (onfulfilled: ((value: boolean) => boolean | PromiseLike) | null | undefined, onrejected: (reason: any) => TResult | PromiseLike): Promise; (onfulfilled: (value: boolean) => TResult | PromiseLike, onrejected?: ((reason: any) => TResult | PromiseLike) | null | undefined): Promise; (onfulfilled: (value: boolean) => TResult1 | PromiseLike, onrejected: (reason: any) => TResult2 | PromiseLike): Promise; } +>() => "1" : () => "1" +>"1" : "1" +>() => Promise.resolve(1) : () => Promise +>Promise.resolve(1) : Promise +>Promise.resolve : { (value: T | PromiseLike): Promise; (): Promise; } +>Promise : PromiseConstructor +>resolve : { (value: T | PromiseLike): Promise; (): Promise; } +>1 : 1 + +const p45 = p.then(() => "1", () => Promise.reject(1)); +>p45 : Promise<"1"> +>p.then(() => "1", () => Promise.reject(1)) : Promise<"1"> +>p.then : { (onfulfilled?: ((value: boolean) => boolean | PromiseLike) | null | undefined, onrejected?: ((reason: any) => boolean | PromiseLike) | null | undefined): Promise; (onfulfilled: ((value: boolean) => boolean | PromiseLike) | null | undefined, onrejected: (reason: any) => TResult | PromiseLike): Promise; (onfulfilled: (value: boolean) => TResult | PromiseLike, onrejected?: ((reason: any) => TResult | PromiseLike) | null | undefined): Promise; (onfulfilled: (value: boolean) => TResult1 | PromiseLike, onrejected: (reason: any) => TResult2 | PromiseLike): Promise; } +>p : Promise +>then : { (onfulfilled?: ((value: boolean) => boolean | PromiseLike) | null | undefined, onrejected?: ((reason: any) => boolean | PromiseLike) | null | undefined): Promise; (onfulfilled: ((value: boolean) => boolean | PromiseLike) | null | undefined, onrejected: (reason: any) => TResult | PromiseLike): Promise; (onfulfilled: (value: boolean) => TResult | PromiseLike, onrejected?: ((reason: any) => TResult | PromiseLike) | null | undefined): Promise; (onfulfilled: (value: boolean) => TResult1 | PromiseLike, onrejected: (reason: any) => TResult2 | PromiseLike): Promise; } +>() => "1" : () => "1" +>"1" : "1" +>() => Promise.reject(1) : () => Promise +>Promise.reject(1) : Promise +>Promise.reject : { (reason: any): Promise; (reason: any): Promise; } +>Promise : PromiseConstructor +>reject : { (reason: any): Promise; (reason: any): Promise; } +>1 : 1 + +const p50 = p.then(() => {}, undefined); +>p50 : Promise +>p.then(() => {}, undefined) : Promise +>p.then : { (onfulfilled?: ((value: boolean) => boolean | PromiseLike) | null | undefined, onrejected?: ((reason: any) => boolean | PromiseLike) | null | undefined): Promise; (onfulfilled: ((value: boolean) => boolean | PromiseLike) | null | undefined, onrejected: (reason: any) => TResult | PromiseLike): Promise; (onfulfilled: (value: boolean) => TResult | PromiseLike, onrejected?: ((reason: any) => TResult | PromiseLike) | null | undefined): Promise; (onfulfilled: (value: boolean) => TResult1 | PromiseLike, onrejected: (reason: any) => TResult2 | PromiseLike): Promise; } +>p : Promise +>then : { (onfulfilled?: ((value: boolean) => boolean | PromiseLike) | null | undefined, onrejected?: ((reason: any) => boolean | PromiseLike) | null | undefined): Promise; (onfulfilled: ((value: boolean) => boolean | PromiseLike) | null | undefined, onrejected: (reason: any) => TResult | PromiseLike): Promise; (onfulfilled: (value: boolean) => TResult | PromiseLike, onrejected?: ((reason: any) => TResult | PromiseLike) | null | undefined): Promise; (onfulfilled: (value: boolean) => TResult1 | PromiseLike, onrejected: (reason: any) => TResult2 | PromiseLike): Promise; } +>() => {} : () => void +>undefined : undefined + +const p51 = p.then(() => {}, () => 1); +>p51 : Promise +>p.then(() => {}, () => 1) : Promise +>p.then : { (onfulfilled?: ((value: boolean) => boolean | PromiseLike) | null | undefined, onrejected?: ((reason: any) => boolean | PromiseLike) | null | undefined): Promise; (onfulfilled: ((value: boolean) => boolean | PromiseLike) | null | undefined, onrejected: (reason: any) => TResult | PromiseLike): Promise; (onfulfilled: (value: boolean) => TResult | PromiseLike, onrejected?: ((reason: any) => TResult | PromiseLike) | null | undefined): Promise; (onfulfilled: (value: boolean) => TResult1 | PromiseLike, onrejected: (reason: any) => TResult2 | PromiseLike): Promise; } +>p : Promise +>then : { (onfulfilled?: ((value: boolean) => boolean | PromiseLike) | null | undefined, onrejected?: ((reason: any) => boolean | PromiseLike) | null | undefined): Promise; (onfulfilled: ((value: boolean) => boolean | PromiseLike) | null | undefined, onrejected: (reason: any) => TResult | PromiseLike): Promise; (onfulfilled: (value: boolean) => TResult | PromiseLike, onrejected?: ((reason: any) => TResult | PromiseLike) | null | undefined): Promise; (onfulfilled: (value: boolean) => TResult1 | PromiseLike, onrejected: (reason: any) => TResult2 | PromiseLike): Promise; } +>() => {} : () => void +>() => 1 : () => number +>1 : 1 + +const p52 = p.then(() => {}, () => {}); +>p52 : Promise +>p.then(() => {}, () => {}) : Promise +>p.then : { (onfulfilled?: ((value: boolean) => boolean | PromiseLike) | null | undefined, onrejected?: ((reason: any) => boolean | PromiseLike) | null | undefined): Promise; (onfulfilled: ((value: boolean) => boolean | PromiseLike) | null | undefined, onrejected: (reason: any) => TResult | PromiseLike): Promise; (onfulfilled: (value: boolean) => TResult | PromiseLike, onrejected?: ((reason: any) => TResult | PromiseLike) | null | undefined): Promise; (onfulfilled: (value: boolean) => TResult1 | PromiseLike, onrejected: (reason: any) => TResult2 | PromiseLike): Promise; } +>p : Promise +>then : { (onfulfilled?: ((value: boolean) => boolean | PromiseLike) | null | undefined, onrejected?: ((reason: any) => boolean | PromiseLike) | null | undefined): Promise; (onfulfilled: ((value: boolean) => boolean | PromiseLike) | null | undefined, onrejected: (reason: any) => TResult | PromiseLike): Promise; (onfulfilled: (value: boolean) => TResult | PromiseLike, onrejected?: ((reason: any) => TResult | PromiseLike) | null | undefined): Promise; (onfulfilled: (value: boolean) => TResult1 | PromiseLike, onrejected: (reason: any) => TResult2 | PromiseLike): Promise; } +>() => {} : () => void +>() => {} : () => void + +const p53 = p.then(() => {}, () => {throw 1}); +>p53 : Promise +>p.then(() => {}, () => {throw 1}) : Promise +>p.then : { (onfulfilled?: ((value: boolean) => boolean | PromiseLike) | null | undefined, onrejected?: ((reason: any) => boolean | PromiseLike) | null | undefined): Promise; (onfulfilled: ((value: boolean) => boolean | PromiseLike) | null | undefined, onrejected: (reason: any) => TResult | PromiseLike): Promise; (onfulfilled: (value: boolean) => TResult | PromiseLike, onrejected?: ((reason: any) => TResult | PromiseLike) | null | undefined): Promise; (onfulfilled: (value: boolean) => TResult1 | PromiseLike, onrejected: (reason: any) => TResult2 | PromiseLike): Promise; } +>p : Promise +>then : { (onfulfilled?: ((value: boolean) => boolean | PromiseLike) | null | undefined, onrejected?: ((reason: any) => boolean | PromiseLike) | null | undefined): Promise; (onfulfilled: ((value: boolean) => boolean | PromiseLike) | null | undefined, onrejected: (reason: any) => TResult | PromiseLike): Promise; (onfulfilled: (value: boolean) => TResult | PromiseLike, onrejected?: ((reason: any) => TResult | PromiseLike) | null | undefined): Promise; (onfulfilled: (value: boolean) => TResult1 | PromiseLike, onrejected: (reason: any) => TResult2 | PromiseLike): Promise; } +>() => {} : () => void +>() => {throw 1} : () => never +>1 : 1 + +const p54 = p.then(() => {}, () => Promise.resolve(1)); +>p54 : Promise +>p.then(() => {}, () => Promise.resolve(1)) : Promise +>p.then : { (onfulfilled?: ((value: boolean) => boolean | PromiseLike) | null | undefined, onrejected?: ((reason: any) => boolean | PromiseLike) | null | undefined): Promise; (onfulfilled: ((value: boolean) => boolean | PromiseLike) | null | undefined, onrejected: (reason: any) => TResult | PromiseLike): Promise; (onfulfilled: (value: boolean) => TResult | PromiseLike, onrejected?: ((reason: any) => TResult | PromiseLike) | null | undefined): Promise; (onfulfilled: (value: boolean) => TResult1 | PromiseLike, onrejected: (reason: any) => TResult2 | PromiseLike): Promise; } +>p : Promise +>then : { (onfulfilled?: ((value: boolean) => boolean | PromiseLike) | null | undefined, onrejected?: ((reason: any) => boolean | PromiseLike) | null | undefined): Promise; (onfulfilled: ((value: boolean) => boolean | PromiseLike) | null | undefined, onrejected: (reason: any) => TResult | PromiseLike): Promise; (onfulfilled: (value: boolean) => TResult | PromiseLike, onrejected?: ((reason: any) => TResult | PromiseLike) | null | undefined): Promise; (onfulfilled: (value: boolean) => TResult1 | PromiseLike, onrejected: (reason: any) => TResult2 | PromiseLike): Promise; } +>() => {} : () => void +>() => Promise.resolve(1) : () => Promise +>Promise.resolve(1) : Promise +>Promise.resolve : { (value: T | PromiseLike): Promise; (): Promise; } +>Promise : PromiseConstructor +>resolve : { (value: T | PromiseLike): Promise; (): Promise; } +>1 : 1 + +const p55 = p.then(() => {}, () => Promise.reject(1)); +>p55 : Promise +>p.then(() => {}, () => Promise.reject(1)) : Promise +>p.then : { (onfulfilled?: ((value: boolean) => boolean | PromiseLike) | null | undefined, onrejected?: ((reason: any) => boolean | PromiseLike) | null | undefined): Promise; (onfulfilled: ((value: boolean) => boolean | PromiseLike) | null | undefined, onrejected: (reason: any) => TResult | PromiseLike): Promise; (onfulfilled: (value: boolean) => TResult | PromiseLike, onrejected?: ((reason: any) => TResult | PromiseLike) | null | undefined): Promise; (onfulfilled: (value: boolean) => TResult1 | PromiseLike, onrejected: (reason: any) => TResult2 | PromiseLike): Promise; } +>p : Promise +>then : { (onfulfilled?: ((value: boolean) => boolean | PromiseLike) | null | undefined, onrejected?: ((reason: any) => boolean | PromiseLike) | null | undefined): Promise; (onfulfilled: ((value: boolean) => boolean | PromiseLike) | null | undefined, onrejected: (reason: any) => TResult | PromiseLike): Promise; (onfulfilled: (value: boolean) => TResult | PromiseLike, onrejected?: ((reason: any) => TResult | PromiseLike) | null | undefined): Promise; (onfulfilled: (value: boolean) => TResult1 | PromiseLike, onrejected: (reason: any) => TResult2 | PromiseLike): Promise; } +>() => {} : () => void +>() => Promise.reject(1) : () => Promise +>Promise.reject(1) : Promise +>Promise.reject : { (reason: any): Promise; (reason: any): Promise; } +>Promise : PromiseConstructor +>reject : { (reason: any): Promise; (reason: any): Promise; } +>1 : 1 + +const p60 = p.then(() => {throw 1}, undefined); +>p60 : Promise +>p.then(() => {throw 1}, undefined) : Promise +>p.then : { (onfulfilled?: ((value: boolean) => boolean | PromiseLike) | null | undefined, onrejected?: ((reason: any) => boolean | PromiseLike) | null | undefined): Promise; (onfulfilled: ((value: boolean) => boolean | PromiseLike) | null | undefined, onrejected: (reason: any) => TResult | PromiseLike): Promise; (onfulfilled: (value: boolean) => TResult | PromiseLike, onrejected?: ((reason: any) => TResult | PromiseLike) | null | undefined): Promise; (onfulfilled: (value: boolean) => TResult1 | PromiseLike, onrejected: (reason: any) => TResult2 | PromiseLike): Promise; } +>p : Promise +>then : { (onfulfilled?: ((value: boolean) => boolean | PromiseLike) | null | undefined, onrejected?: ((reason: any) => boolean | PromiseLike) | null | undefined): Promise; (onfulfilled: ((value: boolean) => boolean | PromiseLike) | null | undefined, onrejected: (reason: any) => TResult | PromiseLike): Promise; (onfulfilled: (value: boolean) => TResult | PromiseLike, onrejected?: ((reason: any) => TResult | PromiseLike) | null | undefined): Promise; (onfulfilled: (value: boolean) => TResult1 | PromiseLike, onrejected: (reason: any) => TResult2 | PromiseLike): Promise; } +>() => {throw 1} : () => never +>1 : 1 +>undefined : undefined + +const p61 = p.then(() => {throw 1}, () => 1); +>p61 : Promise +>p.then(() => {throw 1}, () => 1) : Promise +>p.then : { (onfulfilled?: ((value: boolean) => boolean | PromiseLike) | null | undefined, onrejected?: ((reason: any) => boolean | PromiseLike) | null | undefined): Promise; (onfulfilled: ((value: boolean) => boolean | PromiseLike) | null | undefined, onrejected: (reason: any) => TResult | PromiseLike): Promise; (onfulfilled: (value: boolean) => TResult | PromiseLike, onrejected?: ((reason: any) => TResult | PromiseLike) | null | undefined): Promise; (onfulfilled: (value: boolean) => TResult1 | PromiseLike, onrejected: (reason: any) => TResult2 | PromiseLike): Promise; } +>p : Promise +>then : { (onfulfilled?: ((value: boolean) => boolean | PromiseLike) | null | undefined, onrejected?: ((reason: any) => boolean | PromiseLike) | null | undefined): Promise; (onfulfilled: ((value: boolean) => boolean | PromiseLike) | null | undefined, onrejected: (reason: any) => TResult | PromiseLike): Promise; (onfulfilled: (value: boolean) => TResult | PromiseLike, onrejected?: ((reason: any) => TResult | PromiseLike) | null | undefined): Promise; (onfulfilled: (value: boolean) => TResult1 | PromiseLike, onrejected: (reason: any) => TResult2 | PromiseLike): Promise; } +>() => {throw 1} : () => never +>1 : 1 +>() => 1 : () => 1 +>1 : 1 + +const p62 = p.then(() => {throw 1}, () => {}); +>p62 : Promise +>p.then(() => {throw 1}, () => {}) : Promise +>p.then : { (onfulfilled?: ((value: boolean) => boolean | PromiseLike) | null | undefined, onrejected?: ((reason: any) => boolean | PromiseLike) | null | undefined): Promise; (onfulfilled: ((value: boolean) => boolean | PromiseLike) | null | undefined, onrejected: (reason: any) => TResult | PromiseLike): Promise; (onfulfilled: (value: boolean) => TResult | PromiseLike, onrejected?: ((reason: any) => TResult | PromiseLike) | null | undefined): Promise; (onfulfilled: (value: boolean) => TResult1 | PromiseLike, onrejected: (reason: any) => TResult2 | PromiseLike): Promise; } +>p : Promise +>then : { (onfulfilled?: ((value: boolean) => boolean | PromiseLike) | null | undefined, onrejected?: ((reason: any) => boolean | PromiseLike) | null | undefined): Promise; (onfulfilled: ((value: boolean) => boolean | PromiseLike) | null | undefined, onrejected: (reason: any) => TResult | PromiseLike): Promise; (onfulfilled: (value: boolean) => TResult | PromiseLike, onrejected?: ((reason: any) => TResult | PromiseLike) | null | undefined): Promise; (onfulfilled: (value: boolean) => TResult1 | PromiseLike, onrejected: (reason: any) => TResult2 | PromiseLike): Promise; } +>() => {throw 1} : () => never +>1 : 1 +>() => {} : () => void + +const p63 = p.then(() => {throw 1}, () => {throw 1}); +>p63 : Promise +>p.then(() => {throw 1}, () => {throw 1}) : Promise +>p.then : { (onfulfilled?: ((value: boolean) => boolean | PromiseLike) | null | undefined, onrejected?: ((reason: any) => boolean | PromiseLike) | null | undefined): Promise; (onfulfilled: ((value: boolean) => boolean | PromiseLike) | null | undefined, onrejected: (reason: any) => TResult | PromiseLike): Promise; (onfulfilled: (value: boolean) => TResult | PromiseLike, onrejected?: ((reason: any) => TResult | PromiseLike) | null | undefined): Promise; (onfulfilled: (value: boolean) => TResult1 | PromiseLike, onrejected: (reason: any) => TResult2 | PromiseLike): Promise; } +>p : Promise +>then : { (onfulfilled?: ((value: boolean) => boolean | PromiseLike) | null | undefined, onrejected?: ((reason: any) => boolean | PromiseLike) | null | undefined): Promise; (onfulfilled: ((value: boolean) => boolean | PromiseLike) | null | undefined, onrejected: (reason: any) => TResult | PromiseLike): Promise; (onfulfilled: (value: boolean) => TResult | PromiseLike, onrejected?: ((reason: any) => TResult | PromiseLike) | null | undefined): Promise; (onfulfilled: (value: boolean) => TResult1 | PromiseLike, onrejected: (reason: any) => TResult2 | PromiseLike): Promise; } +>() => {throw 1} : () => never +>1 : 1 +>() => {throw 1} : () => never +>1 : 1 + +const p64 = p.then(() => {throw 1}, () => Promise.resolve(1)); +>p64 : Promise +>p.then(() => {throw 1}, () => Promise.resolve(1)) : Promise +>p.then : { (onfulfilled?: ((value: boolean) => boolean | PromiseLike) | null | undefined, onrejected?: ((reason: any) => boolean | PromiseLike) | null | undefined): Promise; (onfulfilled: ((value: boolean) => boolean | PromiseLike) | null | undefined, onrejected: (reason: any) => TResult | PromiseLike): Promise; (onfulfilled: (value: boolean) => TResult | PromiseLike, onrejected?: ((reason: any) => TResult | PromiseLike) | null | undefined): Promise; (onfulfilled: (value: boolean) => TResult1 | PromiseLike, onrejected: (reason: any) => TResult2 | PromiseLike): Promise; } +>p : Promise +>then : { (onfulfilled?: ((value: boolean) => boolean | PromiseLike) | null | undefined, onrejected?: ((reason: any) => boolean | PromiseLike) | null | undefined): Promise; (onfulfilled: ((value: boolean) => boolean | PromiseLike) | null | undefined, onrejected: (reason: any) => TResult | PromiseLike): Promise; (onfulfilled: (value: boolean) => TResult | PromiseLike, onrejected?: ((reason: any) => TResult | PromiseLike) | null | undefined): Promise; (onfulfilled: (value: boolean) => TResult1 | PromiseLike, onrejected: (reason: any) => TResult2 | PromiseLike): Promise; } +>() => {throw 1} : () => never +>1 : 1 +>() => Promise.resolve(1) : () => Promise +>Promise.resolve(1) : Promise +>Promise.resolve : { (value: T | PromiseLike): Promise; (): Promise; } +>Promise : PromiseConstructor +>resolve : { (value: T | PromiseLike): Promise; (): Promise; } +>1 : 1 + +const p65 = p.then(() => {throw 1}, () => Promise.reject(1)); +>p65 : Promise +>p.then(() => {throw 1}, () => Promise.reject(1)) : Promise +>p.then : { (onfulfilled?: ((value: boolean) => boolean | PromiseLike) | null | undefined, onrejected?: ((reason: any) => boolean | PromiseLike) | null | undefined): Promise; (onfulfilled: ((value: boolean) => boolean | PromiseLike) | null | undefined, onrejected: (reason: any) => TResult | PromiseLike): Promise; (onfulfilled: (value: boolean) => TResult | PromiseLike, onrejected?: ((reason: any) => TResult | PromiseLike) | null | undefined): Promise; (onfulfilled: (value: boolean) => TResult1 | PromiseLike, onrejected: (reason: any) => TResult2 | PromiseLike): Promise; } +>p : Promise +>then : { (onfulfilled?: ((value: boolean) => boolean | PromiseLike) | null | undefined, onrejected?: ((reason: any) => boolean | PromiseLike) | null | undefined): Promise; (onfulfilled: ((value: boolean) => boolean | PromiseLike) | null | undefined, onrejected: (reason: any) => TResult | PromiseLike): Promise; (onfulfilled: (value: boolean) => TResult | PromiseLike, onrejected?: ((reason: any) => TResult | PromiseLike) | null | undefined): Promise; (onfulfilled: (value: boolean) => TResult1 | PromiseLike, onrejected: (reason: any) => TResult2 | PromiseLike): Promise; } +>() => {throw 1} : () => never +>1 : 1 +>() => Promise.reject(1) : () => Promise +>Promise.reject(1) : Promise +>Promise.reject : { (reason: any): Promise; (reason: any): Promise; } +>Promise : PromiseConstructor +>reject : { (reason: any): Promise; (reason: any): Promise; } +>1 : 1 + +const p70 = p.then(() => Promise.resolve("1"), undefined); +>p70 : Promise +>p.then(() => Promise.resolve("1"), undefined) : Promise +>p.then : { (onfulfilled?: ((value: boolean) => boolean | PromiseLike) | null | undefined, onrejected?: ((reason: any) => boolean | PromiseLike) | null | undefined): Promise; (onfulfilled: ((value: boolean) => boolean | PromiseLike) | null | undefined, onrejected: (reason: any) => TResult | PromiseLike): Promise; (onfulfilled: (value: boolean) => TResult | PromiseLike, onrejected?: ((reason: any) => TResult | PromiseLike) | null | undefined): Promise; (onfulfilled: (value: boolean) => TResult1 | PromiseLike, onrejected: (reason: any) => TResult2 | PromiseLike): Promise; } +>p : Promise +>then : { (onfulfilled?: ((value: boolean) => boolean | PromiseLike) | null | undefined, onrejected?: ((reason: any) => boolean | PromiseLike) | null | undefined): Promise; (onfulfilled: ((value: boolean) => boolean | PromiseLike) | null | undefined, onrejected: (reason: any) => TResult | PromiseLike): Promise; (onfulfilled: (value: boolean) => TResult | PromiseLike, onrejected?: ((reason: any) => TResult | PromiseLike) | null | undefined): Promise; (onfulfilled: (value: boolean) => TResult1 | PromiseLike, onrejected: (reason: any) => TResult2 | PromiseLike): Promise; } +>() => Promise.resolve("1") : () => Promise +>Promise.resolve("1") : Promise +>Promise.resolve : { (value: T | PromiseLike): Promise; (): Promise; } +>Promise : PromiseConstructor +>resolve : { (value: T | PromiseLike): Promise; (): Promise; } +>"1" : "1" +>undefined : undefined + +const p71 = p.then(() => Promise.resolve("1"), () => 1); +>p71 : Promise +>p.then(() => Promise.resolve("1"), () => 1) : Promise +>p.then : { (onfulfilled?: ((value: boolean) => boolean | PromiseLike) | null | undefined, onrejected?: ((reason: any) => boolean | PromiseLike) | null | undefined): Promise; (onfulfilled: ((value: boolean) => boolean | PromiseLike) | null | undefined, onrejected: (reason: any) => TResult | PromiseLike): Promise; (onfulfilled: (value: boolean) => TResult | PromiseLike, onrejected?: ((reason: any) => TResult | PromiseLike) | null | undefined): Promise; (onfulfilled: (value: boolean) => TResult1 | PromiseLike, onrejected: (reason: any) => TResult2 | PromiseLike): Promise; } +>p : Promise +>then : { (onfulfilled?: ((value: boolean) => boolean | PromiseLike) | null | undefined, onrejected?: ((reason: any) => boolean | PromiseLike) | null | undefined): Promise; (onfulfilled: ((value: boolean) => boolean | PromiseLike) | null | undefined, onrejected: (reason: any) => TResult | PromiseLike): Promise; (onfulfilled: (value: boolean) => TResult | PromiseLike, onrejected?: ((reason: any) => TResult | PromiseLike) | null | undefined): Promise; (onfulfilled: (value: boolean) => TResult1 | PromiseLike, onrejected: (reason: any) => TResult2 | PromiseLike): Promise; } +>() => Promise.resolve("1") : () => Promise +>Promise.resolve("1") : Promise +>Promise.resolve : { (value: T | PromiseLike): Promise; (): Promise; } +>Promise : PromiseConstructor +>resolve : { (value: T | PromiseLike): Promise; (): Promise; } +>"1" : "1" +>() => 1 : () => number +>1 : 1 + +const p72 = p.then(() => Promise.resolve("1"), () => {}); +>p72 : Promise +>p.then(() => Promise.resolve("1"), () => {}) : Promise +>p.then : { (onfulfilled?: ((value: boolean) => boolean | PromiseLike) | null | undefined, onrejected?: ((reason: any) => boolean | PromiseLike) | null | undefined): Promise; (onfulfilled: ((value: boolean) => boolean | PromiseLike) | null | undefined, onrejected: (reason: any) => TResult | PromiseLike): Promise; (onfulfilled: (value: boolean) => TResult | PromiseLike, onrejected?: ((reason: any) => TResult | PromiseLike) | null | undefined): Promise; (onfulfilled: (value: boolean) => TResult1 | PromiseLike, onrejected: (reason: any) => TResult2 | PromiseLike): Promise; } +>p : Promise +>then : { (onfulfilled?: ((value: boolean) => boolean | PromiseLike) | null | undefined, onrejected?: ((reason: any) => boolean | PromiseLike) | null | undefined): Promise; (onfulfilled: ((value: boolean) => boolean | PromiseLike) | null | undefined, onrejected: (reason: any) => TResult | PromiseLike): Promise; (onfulfilled: (value: boolean) => TResult | PromiseLike, onrejected?: ((reason: any) => TResult | PromiseLike) | null | undefined): Promise; (onfulfilled: (value: boolean) => TResult1 | PromiseLike, onrejected: (reason: any) => TResult2 | PromiseLike): Promise; } +>() => Promise.resolve("1") : () => Promise +>Promise.resolve("1") : Promise +>Promise.resolve : { (value: T | PromiseLike): Promise; (): Promise; } +>Promise : PromiseConstructor +>resolve : { (value: T | PromiseLike): Promise; (): Promise; } +>"1" : "1" +>() => {} : () => void + +const p73 = p.then(() => Promise.resolve("1"), () => {throw 1}); +>p73 : Promise +>p.then(() => Promise.resolve("1"), () => {throw 1}) : Promise +>p.then : { (onfulfilled?: ((value: boolean) => boolean | PromiseLike) | null | undefined, onrejected?: ((reason: any) => boolean | PromiseLike) | null | undefined): Promise; (onfulfilled: ((value: boolean) => boolean | PromiseLike) | null | undefined, onrejected: (reason: any) => TResult | PromiseLike): Promise; (onfulfilled: (value: boolean) => TResult | PromiseLike, onrejected?: ((reason: any) => TResult | PromiseLike) | null | undefined): Promise; (onfulfilled: (value: boolean) => TResult1 | PromiseLike, onrejected: (reason: any) => TResult2 | PromiseLike): Promise; } +>p : Promise +>then : { (onfulfilled?: ((value: boolean) => boolean | PromiseLike) | null | undefined, onrejected?: ((reason: any) => boolean | PromiseLike) | null | undefined): Promise; (onfulfilled: ((value: boolean) => boolean | PromiseLike) | null | undefined, onrejected: (reason: any) => TResult | PromiseLike): Promise; (onfulfilled: (value: boolean) => TResult | PromiseLike, onrejected?: ((reason: any) => TResult | PromiseLike) | null | undefined): Promise; (onfulfilled: (value: boolean) => TResult1 | PromiseLike, onrejected: (reason: any) => TResult2 | PromiseLike): Promise; } +>() => Promise.resolve("1") : () => Promise +>Promise.resolve("1") : Promise +>Promise.resolve : { (value: T | PromiseLike): Promise; (): Promise; } +>Promise : PromiseConstructor +>resolve : { (value: T | PromiseLike): Promise; (): Promise; } +>"1" : "1" +>() => {throw 1} : () => never +>1 : 1 + +const p74 = p.then(() => Promise.resolve("1"), () => Promise.resolve(1)); +>p74 : Promise +>p.then(() => Promise.resolve("1"), () => Promise.resolve(1)) : Promise +>p.then : { (onfulfilled?: ((value: boolean) => boolean | PromiseLike) | null | undefined, onrejected?: ((reason: any) => boolean | PromiseLike) | null | undefined): Promise; (onfulfilled: ((value: boolean) => boolean | PromiseLike) | null | undefined, onrejected: (reason: any) => TResult | PromiseLike): Promise; (onfulfilled: (value: boolean) => TResult | PromiseLike, onrejected?: ((reason: any) => TResult | PromiseLike) | null | undefined): Promise; (onfulfilled: (value: boolean) => TResult1 | PromiseLike, onrejected: (reason: any) => TResult2 | PromiseLike): Promise; } +>p : Promise +>then : { (onfulfilled?: ((value: boolean) => boolean | PromiseLike) | null | undefined, onrejected?: ((reason: any) => boolean | PromiseLike) | null | undefined): Promise; (onfulfilled: ((value: boolean) => boolean | PromiseLike) | null | undefined, onrejected: (reason: any) => TResult | PromiseLike): Promise; (onfulfilled: (value: boolean) => TResult | PromiseLike, onrejected?: ((reason: any) => TResult | PromiseLike) | null | undefined): Promise; (onfulfilled: (value: boolean) => TResult1 | PromiseLike, onrejected: (reason: any) => TResult2 | PromiseLike): Promise; } +>() => Promise.resolve("1") : () => Promise +>Promise.resolve("1") : Promise +>Promise.resolve : { (value: T | PromiseLike): Promise; (): Promise; } +>Promise : PromiseConstructor +>resolve : { (value: T | PromiseLike): Promise; (): Promise; } +>"1" : "1" +>() => Promise.resolve(1) : () => Promise +>Promise.resolve(1) : Promise +>Promise.resolve : { (value: T | PromiseLike): Promise; (): Promise; } +>Promise : PromiseConstructor +>resolve : { (value: T | PromiseLike): Promise; (): Promise; } +>1 : 1 + +const p75 = p.then(() => Promise.resolve("1"), () => Promise.reject(1)); +>p75 : Promise +>p.then(() => Promise.resolve("1"), () => Promise.reject(1)) : Promise +>p.then : { (onfulfilled?: ((value: boolean) => boolean | PromiseLike) | null | undefined, onrejected?: ((reason: any) => boolean | PromiseLike) | null | undefined): Promise; (onfulfilled: ((value: boolean) => boolean | PromiseLike) | null | undefined, onrejected: (reason: any) => TResult | PromiseLike): Promise; (onfulfilled: (value: boolean) => TResult | PromiseLike, onrejected?: ((reason: any) => TResult | PromiseLike) | null | undefined): Promise; (onfulfilled: (value: boolean) => TResult1 | PromiseLike, onrejected: (reason: any) => TResult2 | PromiseLike): Promise; } +>p : Promise +>then : { (onfulfilled?: ((value: boolean) => boolean | PromiseLike) | null | undefined, onrejected?: ((reason: any) => boolean | PromiseLike) | null | undefined): Promise; (onfulfilled: ((value: boolean) => boolean | PromiseLike) | null | undefined, onrejected: (reason: any) => TResult | PromiseLike): Promise; (onfulfilled: (value: boolean) => TResult | PromiseLike, onrejected?: ((reason: any) => TResult | PromiseLike) | null | undefined): Promise; (onfulfilled: (value: boolean) => TResult1 | PromiseLike, onrejected: (reason: any) => TResult2 | PromiseLike): Promise; } +>() => Promise.resolve("1") : () => Promise +>Promise.resolve("1") : Promise +>Promise.resolve : { (value: T | PromiseLike): Promise; (): Promise; } +>Promise : PromiseConstructor +>resolve : { (value: T | PromiseLike): Promise; (): Promise; } +>"1" : "1" +>() => Promise.reject(1) : () => Promise +>Promise.reject(1) : Promise +>Promise.reject : { (reason: any): Promise; (reason: any): Promise; } +>Promise : PromiseConstructor +>reject : { (reason: any): Promise; (reason: any): Promise; } +>1 : 1 + +const p80 = p.then(() => Promise.reject(1), undefined); +>p80 : Promise +>p.then(() => Promise.reject(1), undefined) : Promise +>p.then : { (onfulfilled?: ((value: boolean) => boolean | PromiseLike) | null | undefined, onrejected?: ((reason: any) => boolean | PromiseLike) | null | undefined): Promise; (onfulfilled: ((value: boolean) => boolean | PromiseLike) | null | undefined, onrejected: (reason: any) => TResult | PromiseLike): Promise; (onfulfilled: (value: boolean) => TResult | PromiseLike, onrejected?: ((reason: any) => TResult | PromiseLike) | null | undefined): Promise; (onfulfilled: (value: boolean) => TResult1 | PromiseLike, onrejected: (reason: any) => TResult2 | PromiseLike): Promise; } +>p : Promise +>then : { (onfulfilled?: ((value: boolean) => boolean | PromiseLike) | null | undefined, onrejected?: ((reason: any) => boolean | PromiseLike) | null | undefined): Promise; (onfulfilled: ((value: boolean) => boolean | PromiseLike) | null | undefined, onrejected: (reason: any) => TResult | PromiseLike): Promise; (onfulfilled: (value: boolean) => TResult | PromiseLike, onrejected?: ((reason: any) => TResult | PromiseLike) | null | undefined): Promise; (onfulfilled: (value: boolean) => TResult1 | PromiseLike, onrejected: (reason: any) => TResult2 | PromiseLike): Promise; } +>() => Promise.reject(1) : () => Promise +>Promise.reject(1) : Promise +>Promise.reject : { (reason: any): Promise; (reason: any): Promise; } +>Promise : PromiseConstructor +>reject : { (reason: any): Promise; (reason: any): Promise; } +>1 : 1 +>undefined : undefined + +const p81 = p.then(() => Promise.reject(1), () => 1); +>p81 : Promise +>p.then(() => Promise.reject(1), () => 1) : Promise +>p.then : { (onfulfilled?: ((value: boolean) => boolean | PromiseLike) | null | undefined, onrejected?: ((reason: any) => boolean | PromiseLike) | null | undefined): Promise; (onfulfilled: ((value: boolean) => boolean | PromiseLike) | null | undefined, onrejected: (reason: any) => TResult | PromiseLike): Promise; (onfulfilled: (value: boolean) => TResult | PromiseLike, onrejected?: ((reason: any) => TResult | PromiseLike) | null | undefined): Promise; (onfulfilled: (value: boolean) => TResult1 | PromiseLike, onrejected: (reason: any) => TResult2 | PromiseLike): Promise; } +>p : Promise +>then : { (onfulfilled?: ((value: boolean) => boolean | PromiseLike) | null | undefined, onrejected?: ((reason: any) => boolean | PromiseLike) | null | undefined): Promise; (onfulfilled: ((value: boolean) => boolean | PromiseLike) | null | undefined, onrejected: (reason: any) => TResult | PromiseLike): Promise; (onfulfilled: (value: boolean) => TResult | PromiseLike, onrejected?: ((reason: any) => TResult | PromiseLike) | null | undefined): Promise; (onfulfilled: (value: boolean) => TResult1 | PromiseLike, onrejected: (reason: any) => TResult2 | PromiseLike): Promise; } +>() => Promise.reject(1) : () => Promise +>Promise.reject(1) : Promise +>Promise.reject : { (reason: any): Promise; (reason: any): Promise; } +>Promise : PromiseConstructor +>reject : { (reason: any): Promise; (reason: any): Promise; } +>1 : 1 +>() => 1 : () => 1 +>1 : 1 + +const p82 = p.then(() => Promise.reject(1), () => {}); +>p82 : Promise +>p.then(() => Promise.reject(1), () => {}) : Promise +>p.then : { (onfulfilled?: ((value: boolean) => boolean | PromiseLike) | null | undefined, onrejected?: ((reason: any) => boolean | PromiseLike) | null | undefined): Promise; (onfulfilled: ((value: boolean) => boolean | PromiseLike) | null | undefined, onrejected: (reason: any) => TResult | PromiseLike): Promise; (onfulfilled: (value: boolean) => TResult | PromiseLike, onrejected?: ((reason: any) => TResult | PromiseLike) | null | undefined): Promise; (onfulfilled: (value: boolean) => TResult1 | PromiseLike, onrejected: (reason: any) => TResult2 | PromiseLike): Promise; } +>p : Promise +>then : { (onfulfilled?: ((value: boolean) => boolean | PromiseLike) | null | undefined, onrejected?: ((reason: any) => boolean | PromiseLike) | null | undefined): Promise; (onfulfilled: ((value: boolean) => boolean | PromiseLike) | null | undefined, onrejected: (reason: any) => TResult | PromiseLike): Promise; (onfulfilled: (value: boolean) => TResult | PromiseLike, onrejected?: ((reason: any) => TResult | PromiseLike) | null | undefined): Promise; (onfulfilled: (value: boolean) => TResult1 | PromiseLike, onrejected: (reason: any) => TResult2 | PromiseLike): Promise; } +>() => Promise.reject(1) : () => Promise +>Promise.reject(1) : Promise +>Promise.reject : { (reason: any): Promise; (reason: any): Promise; } +>Promise : PromiseConstructor +>reject : { (reason: any): Promise; (reason: any): Promise; } +>1 : 1 +>() => {} : () => void + +const p83 = p.then(() => Promise.reject(1), () => {throw 1}); +>p83 : Promise +>p.then(() => Promise.reject(1), () => {throw 1}) : Promise +>p.then : { (onfulfilled?: ((value: boolean) => boolean | PromiseLike) | null | undefined, onrejected?: ((reason: any) => boolean | PromiseLike) | null | undefined): Promise; (onfulfilled: ((value: boolean) => boolean | PromiseLike) | null | undefined, onrejected: (reason: any) => TResult | PromiseLike): Promise; (onfulfilled: (value: boolean) => TResult | PromiseLike, onrejected?: ((reason: any) => TResult | PromiseLike) | null | undefined): Promise; (onfulfilled: (value: boolean) => TResult1 | PromiseLike, onrejected: (reason: any) => TResult2 | PromiseLike): Promise; } +>p : Promise +>then : { (onfulfilled?: ((value: boolean) => boolean | PromiseLike) | null | undefined, onrejected?: ((reason: any) => boolean | PromiseLike) | null | undefined): Promise; (onfulfilled: ((value: boolean) => boolean | PromiseLike) | null | undefined, onrejected: (reason: any) => TResult | PromiseLike): Promise; (onfulfilled: (value: boolean) => TResult | PromiseLike, onrejected?: ((reason: any) => TResult | PromiseLike) | null | undefined): Promise; (onfulfilled: (value: boolean) => TResult1 | PromiseLike, onrejected: (reason: any) => TResult2 | PromiseLike): Promise; } +>() => Promise.reject(1) : () => Promise +>Promise.reject(1) : Promise +>Promise.reject : { (reason: any): Promise; (reason: any): Promise; } +>Promise : PromiseConstructor +>reject : { (reason: any): Promise; (reason: any): Promise; } +>1 : 1 +>() => {throw 1} : () => never +>1 : 1 + +const p84 = p.then(() => Promise.reject(1), () => Promise.resolve(1)); +>p84 : Promise +>p.then(() => Promise.reject(1), () => Promise.resolve(1)) : Promise +>p.then : { (onfulfilled?: ((value: boolean) => boolean | PromiseLike) | null | undefined, onrejected?: ((reason: any) => boolean | PromiseLike) | null | undefined): Promise; (onfulfilled: ((value: boolean) => boolean | PromiseLike) | null | undefined, onrejected: (reason: any) => TResult | PromiseLike): Promise; (onfulfilled: (value: boolean) => TResult | PromiseLike, onrejected?: ((reason: any) => TResult | PromiseLike) | null | undefined): Promise; (onfulfilled: (value: boolean) => TResult1 | PromiseLike, onrejected: (reason: any) => TResult2 | PromiseLike): Promise; } +>p : Promise +>then : { (onfulfilled?: ((value: boolean) => boolean | PromiseLike) | null | undefined, onrejected?: ((reason: any) => boolean | PromiseLike) | null | undefined): Promise; (onfulfilled: ((value: boolean) => boolean | PromiseLike) | null | undefined, onrejected: (reason: any) => TResult | PromiseLike): Promise; (onfulfilled: (value: boolean) => TResult | PromiseLike, onrejected?: ((reason: any) => TResult | PromiseLike) | null | undefined): Promise; (onfulfilled: (value: boolean) => TResult1 | PromiseLike, onrejected: (reason: any) => TResult2 | PromiseLike): Promise; } +>() => Promise.reject(1) : () => Promise +>Promise.reject(1) : Promise +>Promise.reject : { (reason: any): Promise; (reason: any): Promise; } +>Promise : PromiseConstructor +>reject : { (reason: any): Promise; (reason: any): Promise; } +>1 : 1 +>() => Promise.resolve(1) : () => Promise +>Promise.resolve(1) : Promise +>Promise.resolve : { (value: T | PromiseLike): Promise; (): Promise; } +>Promise : PromiseConstructor +>resolve : { (value: T | PromiseLike): Promise; (): Promise; } +>1 : 1 + +const p85 = p.then(() => Promise.reject(1), () => Promise.reject(1)); +>p85 : Promise +>p.then(() => Promise.reject(1), () => Promise.reject(1)) : Promise +>p.then : { (onfulfilled?: ((value: boolean) => boolean | PromiseLike) | null | undefined, onrejected?: ((reason: any) => boolean | PromiseLike) | null | undefined): Promise; (onfulfilled: ((value: boolean) => boolean | PromiseLike) | null | undefined, onrejected: (reason: any) => TResult | PromiseLike): Promise; (onfulfilled: (value: boolean) => TResult | PromiseLike, onrejected?: ((reason: any) => TResult | PromiseLike) | null | undefined): Promise; (onfulfilled: (value: boolean) => TResult1 | PromiseLike, onrejected: (reason: any) => TResult2 | PromiseLike): Promise; } +>p : Promise +>then : { (onfulfilled?: ((value: boolean) => boolean | PromiseLike) | null | undefined, onrejected?: ((reason: any) => boolean | PromiseLike) | null | undefined): Promise; (onfulfilled: ((value: boolean) => boolean | PromiseLike) | null | undefined, onrejected: (reason: any) => TResult | PromiseLike): Promise; (onfulfilled: (value: boolean) => TResult | PromiseLike, onrejected?: ((reason: any) => TResult | PromiseLike) | null | undefined): Promise; (onfulfilled: (value: boolean) => TResult1 | PromiseLike, onrejected: (reason: any) => TResult2 | PromiseLike): Promise; } +>() => Promise.reject(1) : () => Promise +>Promise.reject(1) : Promise +>Promise.reject : { (reason: any): Promise; (reason: any): Promise; } +>Promise : PromiseConstructor +>reject : { (reason: any): Promise; (reason: any): Promise; } +>1 : 1 +>() => Promise.reject(1) : () => Promise +>Promise.reject(1) : Promise +>Promise.reject : { (reason: any): Promise; (reason: any): Promise; } +>Promise : PromiseConstructor +>reject : { (reason: any): Promise; (reason: any): Promise; } +>1 : 1 + diff --git a/tests/baselines/reference/promiseVoidErrorCallback.types b/tests/baselines/reference/promiseVoidErrorCallback.types index 94773394ade..65c9fd0b689 100644 --- a/tests/baselines/reference/promiseVoidErrorCallback.types +++ b/tests/baselines/reference/promiseVoidErrorCallback.types @@ -32,7 +32,7 @@ function f1(): Promise { >resolve : { (value: T | PromiseLike): Promise; (): Promise; } >{ __t1: "foo_t1" } : { __t1: string; } >__t1 : string ->"foo_t1" : string +>"foo_t1" : "foo_t1" } function f2(x: T1): T2 { @@ -48,20 +48,20 @@ function f2(x: T1): T2 { >x.__t1 : string >x : T1 >__t1 : string ->":foo_21" : string +>":foo_21" : ":foo_21" } var x3 = f1() >x3 : Promise<{ __t3: string; }> >f1() .then(f2, (e: Error) => { throw e;}) .then((x: T2) => { return { __t3: x.__t2 + "bar" };}) : Promise<{ __t3: string; }> ->f1() .then(f2, (e: Error) => { throw e;}) .then : { (onfulfilled: (value: T2) => TResult1 | PromiseLike, onrejected: (reason: any) => TResult2 | PromiseLike): Promise; (onfulfilled: (value: T2) => TResult | PromiseLike, onrejected: (reason: any) => TResult | PromiseLike): Promise; (onfulfilled: (value: T2) => TResult | PromiseLike): Promise; (): Promise; } +>f1() .then(f2, (e: Error) => { throw e;}) .then : { (onfulfilled?: (value: T2) => T2 | PromiseLike, onrejected?: (reason: any) => T2 | PromiseLike): Promise; (onfulfilled: (value: T2) => T2 | PromiseLike, onrejected: (reason: any) => TResult | PromiseLike): Promise; (onfulfilled: (value: T2) => TResult | PromiseLike, onrejected?: (reason: any) => TResult | PromiseLike): Promise; (onfulfilled: (value: T2) => TResult1 | PromiseLike, onrejected: (reason: any) => TResult2 | PromiseLike): Promise; } >f1() .then(f2, (e: Error) => { throw e;}) : Promise ->f1() .then : { (onfulfilled: (value: T1) => TResult1 | PromiseLike, onrejected: (reason: any) => TResult2 | PromiseLike): Promise; (onfulfilled: (value: T1) => TResult | PromiseLike, onrejected: (reason: any) => TResult | PromiseLike): Promise; (onfulfilled: (value: T1) => TResult | PromiseLike): Promise; (): Promise; } +>f1() .then : { (onfulfilled?: (value: T1) => T1 | PromiseLike, onrejected?: (reason: any) => T1 | PromiseLike): Promise; (onfulfilled: (value: T1) => T1 | PromiseLike, onrejected: (reason: any) => TResult | PromiseLike): Promise; (onfulfilled: (value: T1) => TResult | PromiseLike, onrejected?: (reason: any) => TResult | PromiseLike): Promise; (onfulfilled: (value: T1) => TResult1 | PromiseLike, onrejected: (reason: any) => TResult2 | PromiseLike): Promise; } >f1() : Promise >f1 : () => Promise .then(f2, (e: Error) => { ->then : { (onfulfilled: (value: T1) => TResult1 | PromiseLike, onrejected: (reason: any) => TResult2 | PromiseLike): Promise; (onfulfilled: (value: T1) => TResult | PromiseLike, onrejected: (reason: any) => TResult | PromiseLike): Promise; (onfulfilled: (value: T1) => TResult | PromiseLike): Promise; (): Promise; } +>then : { (onfulfilled?: (value: T1) => T1 | PromiseLike, onrejected?: (reason: any) => T1 | PromiseLike): Promise; (onfulfilled: (value: T1) => T1 | PromiseLike, onrejected: (reason: any) => TResult | PromiseLike): Promise; (onfulfilled: (value: T1) => TResult | PromiseLike, onrejected?: (reason: any) => TResult | PromiseLike): Promise; (onfulfilled: (value: T1) => TResult1 | PromiseLike, onrejected: (reason: any) => TResult2 | PromiseLike): Promise; } >f2 : (x: T1) => T2 >(e: Error) => { throw e;} : (e: Error) => never >e : Error @@ -72,7 +72,7 @@ var x3 = f1() }) .then((x: T2) => { ->then : { (onfulfilled: (value: T2) => TResult1 | PromiseLike, onrejected: (reason: any) => TResult2 | PromiseLike): Promise; (onfulfilled: (value: T2) => TResult | PromiseLike, onrejected: (reason: any) => TResult | PromiseLike): Promise; (onfulfilled: (value: T2) => TResult | PromiseLike): Promise; (): Promise; } +>then : { (onfulfilled?: (value: T2) => T2 | PromiseLike, onrejected?: (reason: any) => T2 | PromiseLike): Promise; (onfulfilled: (value: T2) => T2 | PromiseLike, onrejected: (reason: any) => TResult | PromiseLike): Promise; (onfulfilled: (value: T2) => TResult | PromiseLike, onrejected?: (reason: any) => TResult | PromiseLike): Promise; (onfulfilled: (value: T2) => TResult1 | PromiseLike, onrejected: (reason: any) => TResult2 | PromiseLike): Promise; } >(x: T2) => { return { __t3: x.__t2 + "bar" };} : (x: T2) => { __t3: string; } >x : T2 >T2 : T2 @@ -84,6 +84,6 @@ var x3 = f1() >x.__t2 : string >x : T2 >__t2 : string ->"bar" : string +>"bar" : "bar" }); diff --git a/tests/baselines/reference/propagationOfPromiseInitialization.types b/tests/baselines/reference/propagationOfPromiseInitialization.types index bd100f75b3e..0ec973474bc 100644 --- a/tests/baselines/reference/propagationOfPromiseInitialization.types +++ b/tests/baselines/reference/propagationOfPromiseInitialization.types @@ -33,7 +33,7 @@ foo.then((x) => { // x is inferred to be a number return "asdf"; ->"asdf" : string +>"asdf" : "asdf" }).then((x) => { >then : (successCallback: (promiseValue: string) => TResult, errorCallback?: (reason: any) => TResult) => IPromise @@ -47,7 +47,7 @@ foo.then((x) => { >length : number return 123; ->123 : number +>123 : 123 }); diff --git a/tests/baselines/reference/properties.types b/tests/baselines/reference/properties.types index d51ab4a95d2..99ff875a087 100644 --- a/tests/baselines/reference/properties.types +++ b/tests/baselines/reference/properties.types @@ -7,7 +7,7 @@ class MyClass >Count : number { return 42; ->42 : number +>42 : 42 } public set Count(value: number) diff --git a/tests/baselines/reference/propertyAccess6.types b/tests/baselines/reference/propertyAccess6.types index 18f39f447c5..b899f4c53ec 100644 --- a/tests/baselines/reference/propertyAccess6.types +++ b/tests/baselines/reference/propertyAccess6.types @@ -3,9 +3,9 @@ var foo: any; >foo : any foo.bar = 4; ->foo.bar = 4 : number +>foo.bar = 4 : 4 >foo.bar : any >foo : any >bar : any ->4 : number +>4 : 4 diff --git a/tests/baselines/reference/propertyAccessOnTypeParameterWithConstraints.types b/tests/baselines/reference/propertyAccessOnTypeParameterWithConstraints.types index d808cddef83..5faaf4d0216 100644 --- a/tests/baselines/reference/propertyAccessOnTypeParameterWithConstraints.types +++ b/tests/baselines/reference/propertyAccessOnTypeParameterWithConstraints.types @@ -19,7 +19,7 @@ class C { >x['getDate']() : number >x['getDate'] : () => number >x : T ->'getDate' : string +>'getDate' : "getDate" return a + x.getDate(); >a + x.getDate() : number @@ -71,7 +71,7 @@ var r2b = i.foo['getDate'](); >i.foo : Date >i : I >foo : Date ->'getDate' : string +>'getDate' : "getDate" var a: { >a : () => T @@ -96,7 +96,7 @@ var r3b = a()['getDate'](); >a()['getDate'] : () => number >a() : Date >a : () => T ->'getDate' : string +>'getDate' : "getDate" var b = { >b : { foo: (x: T) => number; } @@ -115,7 +115,7 @@ var b = { >x['getDate']() : number >x['getDate'] : () => number >x : T ->'getDate' : string +>'getDate' : "getDate" return a + x.getDate(); >a + x.getDate() : number diff --git a/tests/baselines/reference/propertyAccessOnTypeParameterWithConstraints2.types b/tests/baselines/reference/propertyAccessOnTypeParameterWithConstraints2.types index 9ea015cc9ce..ad2ba3e829d 100644 --- a/tests/baselines/reference/propertyAccessOnTypeParameterWithConstraints2.types +++ b/tests/baselines/reference/propertyAccessOnTypeParameterWithConstraints2.types @@ -6,7 +6,7 @@ class A { foo(): string { return ''; } >foo : () => string ->'' : string +>'' : "" } class B extends A { @@ -17,7 +17,7 @@ class B extends A { >bar : () => string return ''; ->'' : string +>'' : "" } } @@ -40,7 +40,7 @@ class C { >x['foo']() : string >x['foo'] : () => string >x : U ->'foo' : string +>'foo' : "foo" return a + x.foo(); >a + x.foo() : string @@ -61,7 +61,7 @@ class C { >x['foo']() : string >x['foo'] : () => string >x : U ->'foo' : string +>'foo' : "foo" return a + x.foo(); >a + x.foo() : string @@ -145,7 +145,7 @@ var r2b = i.foo['foo'](); >i.foo : B >i : I >foo : B ->'foo' : string +>'foo' : "foo" var a: { >a : { (): U; (x: U): U; (x: U, y: T): U; } @@ -198,7 +198,7 @@ var r3b = a()['foo'](); >a()['foo'] : () => string >a() : A >a : { (): U; (x: U): U; (x: U, y: T): U; } ->'foo' : string +>'foo' : "foo" // parameter supplied for type argument inference to succeed var aB = new B(); @@ -224,7 +224,7 @@ var r3d = a(aB, aB)['foo'](); >a : { (): U; (x: U): U; (x: U, y: T): U; } >aB : B >aB : B ->'foo' : string +>'foo' : "foo" var b = { >b : { foo: (x: U, y: T) => string; } @@ -247,7 +247,7 @@ var b = { >x['foo']() : string >x['foo'] : () => string >x : U ->'foo' : string +>'foo' : "foo" return a + x.foo(); >a + x.foo() : string diff --git a/tests/baselines/reference/propertyAccessOnTypeParameterWithConstraints3.types b/tests/baselines/reference/propertyAccessOnTypeParameterWithConstraints3.types index f2423f2bff8..30a17935fc1 100644 --- a/tests/baselines/reference/propertyAccessOnTypeParameterWithConstraints3.types +++ b/tests/baselines/reference/propertyAccessOnTypeParameterWithConstraints3.types @@ -6,7 +6,7 @@ class A { foo(): string { return ''; } >foo : () => string ->'' : string +>'' : "" } class B extends A { @@ -17,7 +17,7 @@ class B extends A { >bar : () => string return ''; ->'' : string +>'' : "" } } @@ -41,7 +41,7 @@ class C { >x['foo']() : string >x['foo'] : () => string >x : T ->'foo' : string +>'foo' : "foo" return a + x.foo(); >a + x.foo() : string @@ -63,7 +63,7 @@ class C { >x['foo']() : string >x['foo'] : () => string >x : U ->'foo' : string +>'foo' : "foo" return a + x.foo(); >a + x.foo() : string @@ -132,7 +132,7 @@ var r2b = i.foo['foo'](); >i.foo : B >i : I >foo : B ->'foo' : string +>'foo' : "foo" var a: { >a : { (): T; (x: U): U; } @@ -167,7 +167,7 @@ var r3b = a()['foo'](); >a()['foo'] : () => string >a() : A >a : { (): T; (x: U): U; } ->'foo' : string +>'foo' : "foo" // parameter supplied for type argument inference for U var r3c = a(new B()).foo(); // valid call to an invalid function, U is inferred as B, which has a foo @@ -188,7 +188,7 @@ var r3d = a(new B())['foo'](); // valid call to an invalid function, U is inferr >a : { (): T; (x: U): U; } >new B() : B >B : typeof B ->'foo' : string +>'foo' : "foo" var b = { >b : { foo: (x: T) => string; } @@ -210,7 +210,7 @@ var b = { >x['foo']() : string >x['foo'] : () => string >x : T ->'foo' : string +>'foo' : "foo" return a + x.foo(); >a + x.foo() : string diff --git a/tests/baselines/reference/propertyAccessOnTypeParameterWithoutConstraints.types b/tests/baselines/reference/propertyAccessOnTypeParameterWithoutConstraints.types index 9d25bebea37..2946b88b432 100644 --- a/tests/baselines/reference/propertyAccessOnTypeParameterWithoutConstraints.types +++ b/tests/baselines/reference/propertyAccessOnTypeParameterWithoutConstraints.types @@ -15,7 +15,7 @@ class C { >x['toString']() : string >x['toString'] : () => string >x : T ->'toString' : string +>'toString' : "toString" return a + x.toString(); >a + x.toString() : string @@ -64,7 +64,7 @@ var r2b = i.foo['toString'](); >i.foo : number >i : I >foo : number ->'toString' : string +>'toString' : "toString" var a: { >a : () => T @@ -87,7 +87,7 @@ var r3b: string = a()['toString'](); >a()['toString'] : () => string >a() : {} >a : () => T ->'toString' : string +>'toString' : "toString" var b = { >b : { foo: (x: T) => string; } @@ -105,7 +105,7 @@ var b = { >x['toString']() : string >x['toString'] : () => string >x : T ->'toString' : string +>'toString' : "toString" return a + x.toString(); >a + x.toString() : string @@ -123,5 +123,5 @@ var r4 = b.foo(1); >b.foo : (x: T) => string >b : { foo: (x: T) => string; } >foo : (x: T) => string ->1 : number +>1 : 1 diff --git a/tests/baselines/reference/propertyNamesOfReservedWords.types b/tests/baselines/reference/propertyNamesOfReservedWords.types index 2554a7f61dd..82780db2250 100644 --- a/tests/baselines/reference/propertyNamesOfReservedWords.types +++ b/tests/baselines/reference/propertyNamesOfReservedWords.types @@ -625,204 +625,204 @@ enum E { >E : E abstract, ->abstract : E +>abstract : E.abstract as, ->as : E +>as : E.as boolean, ->boolean : E +>boolean : E.boolean break, ->break : E +>break : E.break byte, ->byte : E +>byte : E.byte case, ->case : E +>case : E.case catch, ->catch : E +>catch : E.catch char, ->char : E +>char : E.char class, ->class : E +>class : E.class continue, ->continue : E +>continue : E.continue const, ->const : E +>const : E.const debugger, ->debugger : E +>debugger : E.debugger default, ->default : E +>default : E.default delete, ->delete : E +>delete : E.delete do, ->do : E +>do : E.do double, ->double : E +>double : E.double else, ->else : E +>else : E.else enum, ->enum : E +>enum : E.enum export, ->export : E +>export : E.export extends, ->extends : E +>extends : E.extends false, ->false : E +>false : E.false final, ->final : E +>final : E.final finally, ->finally : E +>finally : E.finally float, ->float : E +>float : E.float for, ->for : E +>for : E.for function, ->function : E +>function : E.function goto, ->goto : E +>goto : E.goto if, ->if : E +>if : E.if implements, ->implements : E +>implements : E.implements import, ->import : E +>import : E.import in, ->in : E +>in : E.in instanceof, ->instanceof : E +>instanceof : E.instanceof int, ->int : E +>int : E.int interface, ->interface : E +>interface : E.interface is, ->is : E +>is : E.is long, ->long : E +>long : E.long namespace, ->namespace : E +>namespace : E.namespace native, ->native : E +>native : E.native new, ->new : E +>new : E.new null, ->null : E +>null : E.null package, ->package : E +>package : E.package private, ->private : E +>private : E.private protected, ->protected : E +>protected : E.protected public, ->public : E +>public : E.public return, ->return : E +>return : E.return short, ->short : E +>short : E.short static, ->static : E +>static : E.static super, ->super : E +>super : E.super switch, ->switch : E +>switch : E.switch synchronized, ->synchronized : E +>synchronized : E.synchronized this, ->this : E +>this : E.this throw, ->throw : E +>throw : E.throw throws, ->throws : E +>throws : E.throws transient, ->transient : E +>transient : E.transient true, ->true : E +>true : E.true try, ->try : E +>try : E.try typeof, ->typeof : E +>typeof : E.typeof use, ->use : E +>use : E.use var, ->var : E +>var : E.var void, ->void : E +>void : E.void volatile, ->volatile : E +>volatile : E.volatile while, ->while : E +>while : E.while with, ->with : E +>with : E.with } var r7 = E.abstract; >r7 : E ->E.abstract : E +>E.abstract : E.abstract >E : typeof E ->abstract : E +>abstract : E.abstract var r8 = E.as; >r8 : E ->E.as : E +>E.as : E.as >E : typeof E ->as : E +>as : E.as diff --git a/tests/baselines/reference/propertyNamesWithStringLiteral.types b/tests/baselines/reference/propertyNamesWithStringLiteral.types index 9c3eb5f2015..4e3c9c6080c 100644 --- a/tests/baselines/reference/propertyNamesWithStringLiteral.types +++ b/tests/baselines/reference/propertyNamesWithStringLiteral.types @@ -35,7 +35,7 @@ var a = Color.namedColors["azure"]; >Color.namedColors : NamedColors >Color : typeof Color >namedColors : NamedColors ->"azure" : string +>"azure" : "azure" var a = Color.namedColors.blue; // Should not error >a : _Color @@ -51,5 +51,5 @@ var a = Color.namedColors["pale blue"]; // should not error >Color.namedColors : NamedColors >Color : typeof Color >namedColors : NamedColors ->"pale blue" : string +>"pale blue" : "pale blue" diff --git a/tests/baselines/reference/protoAsIndexInIndexExpression.types b/tests/baselines/reference/protoAsIndexInIndexExpression.types index 56650cbf4eb..b761aa2c7a7 100644 --- a/tests/baselines/reference/protoAsIndexInIndexExpression.types +++ b/tests/baselines/reference/protoAsIndexInIndexExpression.types @@ -17,7 +17,7 @@ WorkspacePrototype['__proto__'] = EntityPrototype; >WorkspacePrototype['__proto__'] = EntityPrototype : any >WorkspacePrototype['__proto__'] : any >WorkspacePrototype : { serialize: () => any; } ->'__proto__' : string +>'__proto__' : "___proto__" >EntityPrototype : any var o = { @@ -25,14 +25,14 @@ var o = { >{ "__proto__": 0} : { "__proto__": number; } "__proto__": 0 ->0 : number +>0 : 0 }; class C { >C : C "__proto__" = 0; ->0 : number +>0 : 0 } === tests/cases/compiler/protoAsIndexInIndexExpression_0.ts === export var x; diff --git a/tests/baselines/reference/protoInIndexer.types b/tests/baselines/reference/protoInIndexer.types index bfafc56404a..27f1f721fd3 100644 --- a/tests/baselines/reference/protoInIndexer.types +++ b/tests/baselines/reference/protoInIndexer.types @@ -7,7 +7,7 @@ class X { >this['__proto__'] = null : null >this['__proto__'] : any >this : this ->'__proto__' : string +>'__proto__' : "___proto__" >null : null } } diff --git a/tests/baselines/reference/prototypeOnConstructorFunctions.types b/tests/baselines/reference/prototypeOnConstructorFunctions.types index 8d1b16e7a21..949cb4d7499 100644 --- a/tests/baselines/reference/prototypeOnConstructorFunctions.types +++ b/tests/baselines/reference/prototypeOnConstructorFunctions.types @@ -15,7 +15,7 @@ var i: I1; i.const.prototype.prop = "yo"; ->i.const.prototype.prop = "yo" : string +>i.const.prototype.prop = "yo" : "yo" >i.const.prototype.prop : any >i.const.prototype : any >i.const : new (options?: any, element?: any) => any @@ -23,5 +23,5 @@ i.const.prototype.prop = "yo"; >const : new (options?: any, element?: any) => any >prototype : any >prop : any ->"yo" : string +>"yo" : "yo" diff --git a/tests/baselines/reference/qualifiedName_ImportDeclarations-entity-names-referencing-a-var.types b/tests/baselines/reference/qualifiedName_ImportDeclarations-entity-names-referencing-a-var.types index 7c05f6a1006..d507fb42323 100644 --- a/tests/baselines/reference/qualifiedName_ImportDeclarations-entity-names-referencing-a-var.types +++ b/tests/baselines/reference/qualifiedName_ImportDeclarations-entity-names-referencing-a-var.types @@ -4,7 +4,7 @@ module Alpha { export var x = 100; >x : number ->100 : number +>100 : 100 } module Beta { diff --git a/tests/baselines/reference/qualify.errors.txt b/tests/baselines/reference/qualify.errors.txt index c3447664c96..53c9927737f 100644 --- a/tests/baselines/reference/qualify.errors.txt +++ b/tests/baselines/reference/qualify.errors.txt @@ -1,5 +1,5 @@ -tests/cases/compiler/qualify.ts(21,13): error TS2322: Type 'number' is not assignable to type 'I'. -tests/cases/compiler/qualify.ts(30,13): error TS2322: Type 'number' is not assignable to type 'I2'. +tests/cases/compiler/qualify.ts(21,13): error TS2322: Type '3' is not assignable to type 'I'. +tests/cases/compiler/qualify.ts(30,13): error TS2322: Type '3' is not assignable to type 'I2'. tests/cases/compiler/qualify.ts(45,13): error TS2322: Type 'I4' is not assignable to type 'I3'. Property 'zeep' is missing in type 'I4'. tests/cases/compiler/qualify.ts(46,13): error TS2322: Type 'I4' is not assignable to type 'I3[]'. @@ -37,7 +37,7 @@ tests/cases/compiler/qualify.ts(58,5): error TS2322: Type 'I' is not assignable export module U { var z:I=3; ~ -!!! error TS2322: Type 'number' is not assignable to type 'I'. +!!! error TS2322: Type '3' is not assignable to type 'I'. export interface I2 { q; } @@ -48,7 +48,7 @@ tests/cases/compiler/qualify.ts(58,5): error TS2322: Type 'I' is not assignable export module U2 { var z:T.U.I2=3; ~ -!!! error TS2322: Type 'number' is not assignable to type 'I2'. +!!! error TS2322: Type '3' is not assignable to type 'I2'. } } diff --git a/tests/baselines/reference/quickInfoDisplayPartsArrowFunctionExpression.baseline b/tests/baselines/reference/quickInfoDisplayPartsArrowFunctionExpression.baseline new file mode 100644 index 00000000000..7ee4e5b25cd --- /dev/null +++ b/tests/baselines/reference/quickInfoDisplayPartsArrowFunctionExpression.baseline @@ -0,0 +1,514 @@ +[ + { + "marker": { + "fileName": "/tests/cases/fourslash/quickInfoDisplayPartsArrowFunctionExpression.ts", + "position": 4 + }, + "quickInfo": { + "kind": "var", + "kindModifiers": "", + "textSpan": { + "start": 4, + "length": 1 + }, + "displayParts": [ + { + "text": "var", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "x", + "kind": "localName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "(", + "kind": "punctuation" + }, + { + "text": "a", + "kind": "parameterName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "any", + "kind": "keyword" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "=>", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "number", + "kind": "keyword" + } + ], + "documentation": [] + } + }, + { + "marker": { + "fileName": "/tests/cases/fourslash/quickInfoDisplayPartsArrowFunctionExpression.ts", + "position": 8 + }, + "quickInfo": { + "kind": "parameter", + "kindModifiers": "", + "textSpan": { + "start": 8, + "length": 1 + }, + "displayParts": [ + { + "text": "(", + "kind": "punctuation" + }, + { + "text": "parameter", + "kind": "text" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "a", + "kind": "parameterName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "any", + "kind": "keyword" + } + ], + "documentation": [] + } + }, + { + "marker": { + "fileName": "/tests/cases/fourslash/quickInfoDisplayPartsArrowFunctionExpression.ts", + "position": 21 + }, + "quickInfo": { + "kind": "var", + "kindModifiers": "", + "textSpan": { + "start": 21, + "length": 1 + }, + "displayParts": [ + { + "text": "var", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "y", + "kind": "localName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "(", + "kind": "punctuation" + }, + { + "text": "a", + "kind": "parameterName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "any", + "kind": "keyword" + }, + { + "text": ",", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "b", + "kind": "parameterName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "any", + "kind": "keyword" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "=>", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "number", + "kind": "keyword" + } + ], + "documentation": [] + } + }, + { + "marker": { + "fileName": "/tests/cases/fourslash/quickInfoDisplayPartsArrowFunctionExpression.ts", + "position": 26 + }, + "quickInfo": { + "kind": "parameter", + "kindModifiers": "", + "textSpan": { + "start": 26, + "length": 1 + }, + "displayParts": [ + { + "text": "(", + "kind": "punctuation" + }, + { + "text": "parameter", + "kind": "text" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "a", + "kind": "parameterName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "any", + "kind": "keyword" + } + ], + "documentation": [] + } + }, + { + "marker": { + "fileName": "/tests/cases/fourslash/quickInfoDisplayPartsArrowFunctionExpression.ts", + "position": 29 + }, + "quickInfo": { + "kind": "parameter", + "kindModifiers": "", + "textSpan": { + "start": 29, + "length": 1 + }, + "displayParts": [ + { + "text": "(", + "kind": "punctuation" + }, + { + "text": "parameter", + "kind": "text" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "b", + "kind": "parameterName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "any", + "kind": "keyword" + } + ], + "documentation": [] + } + }, + { + "marker": { + "fileName": "/tests/cases/fourslash/quickInfoDisplayPartsArrowFunctionExpression.ts", + "position": 43 + }, + "quickInfo": { + "kind": "var", + "kindModifiers": "", + "textSpan": { + "start": 43, + "length": 1 + }, + "displayParts": [ + { + "text": "var", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "z", + "kind": "localName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "(", + "kind": "punctuation" + }, + { + "text": "a", + "kind": "parameterName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "number", + "kind": "keyword" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "=>", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "number", + "kind": "keyword" + } + ], + "documentation": [] + } + }, + { + "marker": { + "fileName": "/tests/cases/fourslash/quickInfoDisplayPartsArrowFunctionExpression.ts", + "position": 48 + }, + "quickInfo": { + "kind": "parameter", + "kindModifiers": "", + "textSpan": { + "start": 48, + "length": 1 + }, + "displayParts": [ + { + "text": "(", + "kind": "punctuation" + }, + { + "text": "parameter", + "kind": "text" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "a", + "kind": "parameterName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "number", + "kind": "keyword" + } + ], + "documentation": [] + } + }, + { + "marker": { + "fileName": "/tests/cases/fourslash/quickInfoDisplayPartsArrowFunctionExpression.ts", + "position": 70 + }, + "quickInfo": { + "kind": "var", + "kindModifiers": "", + "textSpan": { + "start": 70, + "length": 2 + }, + "displayParts": [ + { + "text": "var", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "z2", + "kind": "localName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "(", + "kind": "punctuation" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "=>", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "number", + "kind": "keyword" + } + ], + "documentation": [] + } + } +] \ No newline at end of file diff --git a/tests/baselines/reference/quickInfoDisplayPartsClass.baseline b/tests/baselines/reference/quickInfoDisplayPartsClass.baseline new file mode 100644 index 00000000000..0b048b737a6 --- /dev/null +++ b/tests/baselines/reference/quickInfoDisplayPartsClass.baseline @@ -0,0 +1,199 @@ +[ + { + "marker": { + "fileName": "/tests/cases/fourslash/quickInfoDisplayPartsClass.ts", + "position": 6 + }, + "quickInfo": { + "kind": "class", + "kindModifiers": "", + "textSpan": { + "start": 6, + "length": 1 + }, + "displayParts": [ + { + "text": "class", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "c", + "kind": "className" + } + ], + "documentation": [] + } + }, + { + "marker": { + "fileName": "/tests/cases/fourslash/quickInfoDisplayPartsClass.ts", + "position": 16 + }, + "quickInfo": { + "kind": "var", + "kindModifiers": "", + "textSpan": { + "start": 16, + "length": 9 + }, + "displayParts": [ + { + "text": "var", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "cInstance", + "kind": "localName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "c", + "kind": "className" + } + ], + "documentation": [] + } + }, + { + "marker": { + "fileName": "/tests/cases/fourslash/quickInfoDisplayPartsClass.ts", + "position": 32 + }, + "quickInfo": { + "kind": "constructor", + "kindModifiers": "", + "textSpan": { + "start": 32, + "length": 1 + }, + "displayParts": [ + { + "text": "constructor", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "c", + "kind": "className" + }, + { + "text": "(", + "kind": "punctuation" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "c", + "kind": "className" + } + ], + "documentation": [] + } + }, + { + "marker": { + "fileName": "/tests/cases/fourslash/quickInfoDisplayPartsClass.ts", + "position": 41 + }, + "quickInfo": { + "kind": "var", + "kindModifiers": "", + "textSpan": { + "start": 41, + "length": 4 + }, + "displayParts": [ + { + "text": "var", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "cVal", + "kind": "localName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "typeof", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "c", + "kind": "className" + } + ], + "documentation": [] + } + }, + { + "marker": { + "fileName": "/tests/cases/fourslash/quickInfoDisplayPartsClass.ts", + "position": 48 + }, + "quickInfo": { + "kind": "class", + "kindModifiers": "", + "textSpan": { + "start": 48, + "length": 1 + }, + "displayParts": [ + { + "text": "class", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "c", + "kind": "className" + } + ], + "documentation": [] + } + } +] \ No newline at end of file diff --git a/tests/baselines/reference/quickInfoDisplayPartsClassAccessors.baseline b/tests/baselines/reference/quickInfoDisplayPartsClassAccessors.baseline new file mode 100644 index 00000000000..b0c27fd9d28 --- /dev/null +++ b/tests/baselines/reference/quickInfoDisplayPartsClassAccessors.baseline @@ -0,0 +1,1738 @@ +[ + { + "marker": { + "fileName": "/tests/cases/fourslash/quickInfoDisplayPartsClassAccessors.ts", + "position": 25 + }, + "quickInfo": { + "kind": "property", + "kindModifiers": "public", + "textSpan": { + "start": 25, + "length": 14 + }, + "displayParts": [ + { + "text": "(", + "kind": "punctuation" + }, + { + "text": "property", + "kind": "text" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "c", + "kind": "className" + }, + { + "text": ".", + "kind": "punctuation" + }, + { + "text": "publicProperty", + "kind": "propertyName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "string", + "kind": "keyword" + } + ], + "documentation": [] + } + }, + { + "marker": { + "fileName": "/tests/cases/fourslash/quickInfoDisplayPartsClassAccessors.ts", + "position": 72 + }, + "quickInfo": { + "kind": "property", + "kindModifiers": "public", + "textSpan": { + "start": 72, + "length": 14 + }, + "displayParts": [ + { + "text": "(", + "kind": "punctuation" + }, + { + "text": "property", + "kind": "text" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "c", + "kind": "className" + }, + { + "text": ".", + "kind": "punctuation" + }, + { + "text": "publicProperty", + "kind": "propertyName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "string", + "kind": "keyword" + } + ], + "documentation": [] + } + }, + { + "marker": { + "fileName": "/tests/cases/fourslash/quickInfoDisplayPartsClassAccessors.ts", + "position": 118 + }, + "quickInfo": { + "kind": "property", + "kindModifiers": "private", + "textSpan": { + "start": 118, + "length": 15 + }, + "displayParts": [ + { + "text": "(", + "kind": "punctuation" + }, + { + "text": "property", + "kind": "text" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "c", + "kind": "className" + }, + { + "text": ".", + "kind": "punctuation" + }, + { + "text": "privateProperty", + "kind": "propertyName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "string", + "kind": "keyword" + } + ], + "documentation": [] + } + }, + { + "marker": { + "fileName": "/tests/cases/fourslash/quickInfoDisplayPartsClassAccessors.ts", + "position": 167 + }, + "quickInfo": { + "kind": "property", + "kindModifiers": "private", + "textSpan": { + "start": 167, + "length": 15 + }, + "displayParts": [ + { + "text": "(", + "kind": "punctuation" + }, + { + "text": "property", + "kind": "text" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "c", + "kind": "className" + }, + { + "text": ".", + "kind": "punctuation" + }, + { + "text": "privateProperty", + "kind": "propertyName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "string", + "kind": "keyword" + } + ], + "documentation": [] + } + }, + { + "marker": { + "fileName": "/tests/cases/fourslash/quickInfoDisplayPartsClassAccessors.ts", + "position": 216 + }, + "quickInfo": { + "kind": "property", + "kindModifiers": "protected", + "textSpan": { + "start": 216, + "length": 17 + }, + "displayParts": [ + { + "text": "(", + "kind": "punctuation" + }, + { + "text": "property", + "kind": "text" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "c", + "kind": "className" + }, + { + "text": ".", + "kind": "punctuation" + }, + { + "text": "protectedProperty", + "kind": "propertyName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "string", + "kind": "keyword" + } + ], + "documentation": [] + } + }, + { + "marker": { + "fileName": "/tests/cases/fourslash/quickInfoDisplayPartsClassAccessors.ts", + "position": 269 + }, + "quickInfo": { + "kind": "property", + "kindModifiers": "protected", + "textSpan": { + "start": 269, + "length": 17 + }, + "displayParts": [ + { + "text": "(", + "kind": "punctuation" + }, + { + "text": "property", + "kind": "text" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "c", + "kind": "className" + }, + { + "text": ".", + "kind": "punctuation" + }, + { + "text": "protectedProperty", + "kind": "propertyName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "string", + "kind": "keyword" + } + ], + "documentation": [] + } + }, + { + "marker": { + "fileName": "/tests/cases/fourslash/quickInfoDisplayPartsClassAccessors.ts", + "position": 317 + }, + "quickInfo": { + "kind": "property", + "kindModifiers": "static", + "textSpan": { + "start": 317, + "length": 14 + }, + "displayParts": [ + { + "text": "(", + "kind": "punctuation" + }, + { + "text": "property", + "kind": "text" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "c", + "kind": "className" + }, + { + "text": ".", + "kind": "punctuation" + }, + { + "text": "staticProperty", + "kind": "propertyName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "string", + "kind": "keyword" + } + ], + "documentation": [] + } + }, + { + "marker": { + "fileName": "/tests/cases/fourslash/quickInfoDisplayPartsClassAccessors.ts", + "position": 364 + }, + "quickInfo": { + "kind": "property", + "kindModifiers": "static", + "textSpan": { + "start": 364, + "length": 14 + }, + "displayParts": [ + { + "text": "(", + "kind": "punctuation" + }, + { + "text": "property", + "kind": "text" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "c", + "kind": "className" + }, + { + "text": ".", + "kind": "punctuation" + }, + { + "text": "staticProperty", + "kind": "propertyName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "string", + "kind": "keyword" + } + ], + "documentation": [] + } + }, + { + "marker": { + "fileName": "/tests/cases/fourslash/quickInfoDisplayPartsClassAccessors.ts", + "position": 418 + }, + "quickInfo": { + "kind": "property", + "kindModifiers": "private,static", + "textSpan": { + "start": 418, + "length": 21 + }, + "displayParts": [ + { + "text": "(", + "kind": "punctuation" + }, + { + "text": "property", + "kind": "text" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "c", + "kind": "className" + }, + { + "text": ".", + "kind": "punctuation" + }, + { + "text": "privateStaticProperty", + "kind": "propertyName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "string", + "kind": "keyword" + } + ], + "documentation": [] + } + }, + { + "marker": { + "fileName": "/tests/cases/fourslash/quickInfoDisplayPartsClassAccessors.ts", + "position": 480 + }, + "quickInfo": { + "kind": "property", + "kindModifiers": "private,static", + "textSpan": { + "start": 480, + "length": 21 + }, + "displayParts": [ + { + "text": "(", + "kind": "punctuation" + }, + { + "text": "property", + "kind": "text" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "c", + "kind": "className" + }, + { + "text": ".", + "kind": "punctuation" + }, + { + "text": "privateStaticProperty", + "kind": "propertyName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "string", + "kind": "keyword" + } + ], + "documentation": [] + } + }, + { + "marker": { + "fileName": "/tests/cases/fourslash/quickInfoDisplayPartsClassAccessors.ts", + "position": 542 + }, + "quickInfo": { + "kind": "property", + "kindModifiers": "protected,static", + "textSpan": { + "start": 542, + "length": 23 + }, + "displayParts": [ + { + "text": "(", + "kind": "punctuation" + }, + { + "text": "property", + "kind": "text" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "c", + "kind": "className" + }, + { + "text": ".", + "kind": "punctuation" + }, + { + "text": "protectedStaticProperty", + "kind": "propertyName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "string", + "kind": "keyword" + } + ], + "documentation": [] + } + }, + { + "marker": { + "fileName": "/tests/cases/fourslash/quickInfoDisplayPartsClassAccessors.ts", + "position": 608 + }, + "quickInfo": { + "kind": "property", + "kindModifiers": "protected,static", + "textSpan": { + "start": 608, + "length": 23 + }, + "displayParts": [ + { + "text": "(", + "kind": "punctuation" + }, + { + "text": "property", + "kind": "text" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "c", + "kind": "className" + }, + { + "text": ".", + "kind": "punctuation" + }, + { + "text": "protectedStaticProperty", + "kind": "propertyName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "string", + "kind": "keyword" + } + ], + "documentation": [] + } + }, + { + "marker": { + "fileName": "/tests/cases/fourslash/quickInfoDisplayPartsClassAccessors.ts", + "position": 703 + }, + "quickInfo": { + "kind": "property", + "kindModifiers": "public", + "textSpan": { + "start": 703, + "length": 14 + }, + "displayParts": [ + { + "text": "(", + "kind": "punctuation" + }, + { + "text": "property", + "kind": "text" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "c", + "kind": "className" + }, + { + "text": ".", + "kind": "punctuation" + }, + { + "text": "publicProperty", + "kind": "propertyName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "string", + "kind": "keyword" + } + ], + "documentation": [] + } + }, + { + "marker": { + "fileName": "/tests/cases/fourslash/quickInfoDisplayPartsClassAccessors.ts", + "position": 736 + }, + "quickInfo": { + "kind": "property", + "kindModifiers": "private", + "textSpan": { + "start": 736, + "length": 15 + }, + "displayParts": [ + { + "text": "(", + "kind": "punctuation" + }, + { + "text": "property", + "kind": "text" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "c", + "kind": "className" + }, + { + "text": ".", + "kind": "punctuation" + }, + { + "text": "privateProperty", + "kind": "propertyName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "string", + "kind": "keyword" + } + ], + "documentation": [] + } + }, + { + "marker": { + "fileName": "/tests/cases/fourslash/quickInfoDisplayPartsClassAccessors.ts", + "position": 770 + }, + "quickInfo": { + "kind": "property", + "kindModifiers": "protected", + "textSpan": { + "start": 770, + "length": 17 + }, + "displayParts": [ + { + "text": "(", + "kind": "punctuation" + }, + { + "text": "property", + "kind": "text" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "c", + "kind": "className" + }, + { + "text": ".", + "kind": "punctuation" + }, + { + "text": "protectedProperty", + "kind": "propertyName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "string", + "kind": "keyword" + } + ], + "documentation": [] + } + }, + { + "marker": { + "fileName": "/tests/cases/fourslash/quickInfoDisplayPartsClassAccessors.ts", + "position": 803 + }, + "quickInfo": { + "kind": "property", + "kindModifiers": "static", + "textSpan": { + "start": 803, + "length": 14 + }, + "displayParts": [ + { + "text": "(", + "kind": "punctuation" + }, + { + "text": "property", + "kind": "text" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "c", + "kind": "className" + }, + { + "text": ".", + "kind": "punctuation" + }, + { + "text": "staticProperty", + "kind": "propertyName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "string", + "kind": "keyword" + } + ], + "documentation": [] + } + }, + { + "marker": { + "fileName": "/tests/cases/fourslash/quickInfoDisplayPartsClassAccessors.ts", + "position": 833 + }, + "quickInfo": { + "kind": "property", + "kindModifiers": "private,static", + "textSpan": { + "start": 833, + "length": 21 + }, + "displayParts": [ + { + "text": "(", + "kind": "punctuation" + }, + { + "text": "property", + "kind": "text" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "c", + "kind": "className" + }, + { + "text": ".", + "kind": "punctuation" + }, + { + "text": "privateStaticProperty", + "kind": "propertyName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "string", + "kind": "keyword" + } + ], + "documentation": [] + } + }, + { + "marker": { + "fileName": "/tests/cases/fourslash/quickInfoDisplayPartsClassAccessors.ts", + "position": 870 + }, + "quickInfo": { + "kind": "property", + "kindModifiers": "protected,static", + "textSpan": { + "start": 870, + "length": 23 + }, + "displayParts": [ + { + "text": "(", + "kind": "punctuation" + }, + { + "text": "property", + "kind": "text" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "c", + "kind": "className" + }, + { + "text": ".", + "kind": "punctuation" + }, + { + "text": "protectedStaticProperty", + "kind": "propertyName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "string", + "kind": "keyword" + } + ], + "documentation": [] + } + }, + { + "marker": { + "fileName": "/tests/cases/fourslash/quickInfoDisplayPartsClassAccessors.ts", + "position": 908 + }, + "quickInfo": { + "kind": "property", + "kindModifiers": "public", + "textSpan": { + "start": 908, + "length": 14 + }, + "displayParts": [ + { + "text": "(", + "kind": "punctuation" + }, + { + "text": "property", + "kind": "text" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "c", + "kind": "className" + }, + { + "text": ".", + "kind": "punctuation" + }, + { + "text": "publicProperty", + "kind": "propertyName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "string", + "kind": "keyword" + } + ], + "documentation": [] + } + }, + { + "marker": { + "fileName": "/tests/cases/fourslash/quickInfoDisplayPartsClassAccessors.ts", + "position": 942 + }, + "quickInfo": { + "kind": "property", + "kindModifiers": "private", + "textSpan": { + "start": 942, + "length": 15 + }, + "displayParts": [ + { + "text": "(", + "kind": "punctuation" + }, + { + "text": "property", + "kind": "text" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "c", + "kind": "className" + }, + { + "text": ".", + "kind": "punctuation" + }, + { + "text": "privateProperty", + "kind": "propertyName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "string", + "kind": "keyword" + } + ], + "documentation": [] + } + }, + { + "marker": { + "fileName": "/tests/cases/fourslash/quickInfoDisplayPartsClassAccessors.ts", + "position": 977 + }, + "quickInfo": { + "kind": "property", + "kindModifiers": "protected", + "textSpan": { + "start": 977, + "length": 17 + }, + "displayParts": [ + { + "text": "(", + "kind": "punctuation" + }, + { + "text": "property", + "kind": "text" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "c", + "kind": "className" + }, + { + "text": ".", + "kind": "punctuation" + }, + { + "text": "protectedProperty", + "kind": "propertyName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "string", + "kind": "keyword" + } + ], + "documentation": [] + } + }, + { + "marker": { + "fileName": "/tests/cases/fourslash/quickInfoDisplayPartsClassAccessors.ts", + "position": 1011 + }, + "quickInfo": { + "kind": "property", + "kindModifiers": "static", + "textSpan": { + "start": 1011, + "length": 14 + }, + "displayParts": [ + { + "text": "(", + "kind": "punctuation" + }, + { + "text": "property", + "kind": "text" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "c", + "kind": "className" + }, + { + "text": ".", + "kind": "punctuation" + }, + { + "text": "staticProperty", + "kind": "propertyName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "string", + "kind": "keyword" + } + ], + "documentation": [] + } + }, + { + "marker": { + "fileName": "/tests/cases/fourslash/quickInfoDisplayPartsClassAccessors.ts", + "position": 1042 + }, + "quickInfo": { + "kind": "property", + "kindModifiers": "private,static", + "textSpan": { + "start": 1042, + "length": 21 + }, + "displayParts": [ + { + "text": "(", + "kind": "punctuation" + }, + { + "text": "property", + "kind": "text" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "c", + "kind": "className" + }, + { + "text": ".", + "kind": "punctuation" + }, + { + "text": "privateStaticProperty", + "kind": "propertyName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "string", + "kind": "keyword" + } + ], + "documentation": [] + } + }, + { + "marker": { + "fileName": "/tests/cases/fourslash/quickInfoDisplayPartsClassAccessors.ts", + "position": 1080 + }, + "quickInfo": { + "kind": "property", + "kindModifiers": "protected,static", + "textSpan": { + "start": 1080, + "length": 23 + }, + "displayParts": [ + { + "text": "(", + "kind": "punctuation" + }, + { + "text": "property", + "kind": "text" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "c", + "kind": "className" + }, + { + "text": ".", + "kind": "punctuation" + }, + { + "text": "protectedStaticProperty", + "kind": "propertyName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "string", + "kind": "keyword" + } + ], + "documentation": [] + } + }, + { + "marker": { + "fileName": "/tests/cases/fourslash/quickInfoDisplayPartsClassAccessors.ts", + "position": 1162 + }, + "quickInfo": { + "kind": "var", + "kindModifiers": "", + "textSpan": { + "start": 1162, + "length": 9 + }, + "displayParts": [ + { + "text": "var", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "cInstance", + "kind": "localName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "c", + "kind": "className" + } + ], + "documentation": [] + } + }, + { + "marker": { + "fileName": "/tests/cases/fourslash/quickInfoDisplayPartsClassAccessors.ts", + "position": 1172 + }, + "quickInfo": { + "kind": "property", + "kindModifiers": "public", + "textSpan": { + "start": 1172, + "length": 14 + }, + "displayParts": [ + { + "text": "(", + "kind": "punctuation" + }, + { + "text": "property", + "kind": "text" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "c", + "kind": "className" + }, + { + "text": ".", + "kind": "punctuation" + }, + { + "text": "publicProperty", + "kind": "propertyName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "string", + "kind": "keyword" + } + ], + "documentation": [] + } + }, + { + "marker": { + "fileName": "/tests/cases/fourslash/quickInfoDisplayPartsClassAccessors.ts", + "position": 1192 + }, + "quickInfo": { + "kind": "class", + "kindModifiers": "", + "textSpan": { + "start": 1192, + "length": 1 + }, + "displayParts": [ + { + "text": "class", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "c", + "kind": "className" + } + ], + "documentation": [] + } + }, + { + "marker": { + "fileName": "/tests/cases/fourslash/quickInfoDisplayPartsClassAccessors.ts", + "position": 1194 + }, + "quickInfo": { + "kind": "property", + "kindModifiers": "static", + "textSpan": { + "start": 1194, + "length": 14 + }, + "displayParts": [ + { + "text": "(", + "kind": "punctuation" + }, + { + "text": "property", + "kind": "text" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "c", + "kind": "className" + }, + { + "text": ".", + "kind": "punctuation" + }, + { + "text": "staticProperty", + "kind": "propertyName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "string", + "kind": "keyword" + } + ], + "documentation": [] + } + }, + { + "marker": { + "fileName": "/tests/cases/fourslash/quickInfoDisplayPartsClassAccessors.ts", + "position": 1210 + }, + "quickInfo": { + "kind": "var", + "kindModifiers": "", + "textSpan": { + "start": 1210, + "length": 9 + }, + "displayParts": [ + { + "text": "var", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "cInstance", + "kind": "localName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "c", + "kind": "className" + } + ], + "documentation": [] + } + }, + { + "marker": { + "fileName": "/tests/cases/fourslash/quickInfoDisplayPartsClassAccessors.ts", + "position": 1220 + }, + "quickInfo": { + "kind": "property", + "kindModifiers": "public", + "textSpan": { + "start": 1220, + "length": 14 + }, + "displayParts": [ + { + "text": "(", + "kind": "punctuation" + }, + { + "text": "property", + "kind": "text" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "c", + "kind": "className" + }, + { + "text": ".", + "kind": "punctuation" + }, + { + "text": "publicProperty", + "kind": "propertyName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "string", + "kind": "keyword" + } + ], + "documentation": [] + } + }, + { + "marker": { + "fileName": "/tests/cases/fourslash/quickInfoDisplayPartsClassAccessors.ts", + "position": 1240 + }, + "quickInfo": { + "kind": "class", + "kindModifiers": "", + "textSpan": { + "start": 1240, + "length": 1 + }, + "displayParts": [ + { + "text": "class", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "c", + "kind": "className" + } + ], + "documentation": [] + } + }, + { + "marker": { + "fileName": "/tests/cases/fourslash/quickInfoDisplayPartsClassAccessors.ts", + "position": 1242 + }, + "quickInfo": { + "kind": "property", + "kindModifiers": "static", + "textSpan": { + "start": 1242, + "length": 14 + }, + "displayParts": [ + { + "text": "(", + "kind": "punctuation" + }, + { + "text": "property", + "kind": "text" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "c", + "kind": "className" + }, + { + "text": ".", + "kind": "punctuation" + }, + { + "text": "staticProperty", + "kind": "propertyName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "string", + "kind": "keyword" + } + ], + "documentation": [] + } + } +] \ No newline at end of file diff --git a/tests/baselines/reference/quickInfoDisplayPartsClassConstructor.baseline b/tests/baselines/reference/quickInfoDisplayPartsClassConstructor.baseline new file mode 100644 index 00000000000..76ca00a4048 --- /dev/null +++ b/tests/baselines/reference/quickInfoDisplayPartsClassConstructor.baseline @@ -0,0 +1,1696 @@ +[ + { + "marker": { + "fileName": "/tests/cases/fourslash/quickInfoDisplayPartsClassConstructor.ts", + "position": 14 + }, + "quickInfo": { + "kind": "constructor", + "kindModifiers": "", + "textSpan": { + "start": 14, + "length": 11 + }, + "displayParts": [ + { + "text": "constructor", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "c", + "kind": "className" + }, + { + "text": "(", + "kind": "punctuation" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "c", + "kind": "className" + } + ], + "documentation": [] + } + }, + { + "marker": { + "fileName": "/tests/cases/fourslash/quickInfoDisplayPartsClassConstructor.ts", + "position": 42 + }, + "quickInfo": { + "kind": "var", + "kindModifiers": "", + "textSpan": { + "start": 42, + "length": 9 + }, + "displayParts": [ + { + "text": "var", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "cInstance", + "kind": "localName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "c", + "kind": "className" + } + ], + "documentation": [] + } + }, + { + "marker": { + "fileName": "/tests/cases/fourslash/quickInfoDisplayPartsClassConstructor.ts", + "position": 58 + }, + "quickInfo": { + "kind": "constructor", + "kindModifiers": "", + "textSpan": { + "start": 58, + "length": 1 + }, + "displayParts": [ + { + "text": "constructor", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "c", + "kind": "className" + }, + { + "text": "(", + "kind": "punctuation" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "c", + "kind": "className" + } + ], + "documentation": [] + } + }, + { + "marker": { + "fileName": "/tests/cases/fourslash/quickInfoDisplayPartsClassConstructor.ts", + "position": 67 + }, + "quickInfo": { + "kind": "var", + "kindModifiers": "", + "textSpan": { + "start": 67, + "length": 4 + }, + "displayParts": [ + { + "text": "var", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "cVal", + "kind": "localName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "typeof", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "c", + "kind": "className" + } + ], + "documentation": [] + } + }, + { + "marker": { + "fileName": "/tests/cases/fourslash/quickInfoDisplayPartsClassConstructor.ts", + "position": 74 + }, + "quickInfo": { + "kind": "class", + "kindModifiers": "", + "textSpan": { + "start": 74, + "length": 1 + }, + "displayParts": [ + { + "text": "class", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "c", + "kind": "className" + } + ], + "documentation": [] + } + }, + { + "marker": { + "fileName": "/tests/cases/fourslash/quickInfoDisplayPartsClassConstructor.ts", + "position": 104 + }, + "quickInfo": { + "kind": "constructor", + "kindModifiers": "", + "textSpan": { + "start": 104, + "length": 11 + }, + "displayParts": [ + { + "text": "constructor", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "cWithOverloads", + "kind": "className" + }, + { + "text": "(", + "kind": "punctuation" + }, + { + "text": "x", + "kind": "parameterName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "string", + "kind": "keyword" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "cWithOverloads", + "kind": "className" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "(", + "kind": "punctuation" + }, + { + "text": "+", + "kind": "operator" + }, + { + "text": "1", + "kind": "numericLiteral" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "overload", + "kind": "text" + }, + { + "text": ")", + "kind": "punctuation" + } + ], + "documentation": [] + } + }, + { + "marker": { + "fileName": "/tests/cases/fourslash/quickInfoDisplayPartsClassConstructor.ts", + "position": 132 + }, + "quickInfo": { + "kind": "constructor", + "kindModifiers": "", + "textSpan": { + "start": 132, + "length": 11 + }, + "displayParts": [ + { + "text": "constructor", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "cWithOverloads", + "kind": "className" + }, + { + "text": "(", + "kind": "punctuation" + }, + { + "text": "x", + "kind": "parameterName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "number", + "kind": "keyword" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "cWithOverloads", + "kind": "className" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "(", + "kind": "punctuation" + }, + { + "text": "+", + "kind": "operator" + }, + { + "text": "1", + "kind": "numericLiteral" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "overload", + "kind": "text" + }, + { + "text": ")", + "kind": "punctuation" + } + ], + "documentation": [] + } + }, + { + "marker": { + "fileName": "/tests/cases/fourslash/quickInfoDisplayPartsClassConstructor.ts", + "position": 160 + }, + "quickInfo": { + "kind": "constructor", + "kindModifiers": "", + "textSpan": { + "start": 160, + "length": 11 + }, + "displayParts": [ + { + "text": "constructor", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "cWithOverloads", + "kind": "className" + }, + { + "text": "(", + "kind": "punctuation" + }, + { + "text": "x", + "kind": "parameterName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "string", + "kind": "keyword" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "cWithOverloads", + "kind": "className" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "(", + "kind": "punctuation" + }, + { + "text": "+", + "kind": "operator" + }, + { + "text": "1", + "kind": "numericLiteral" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "overload", + "kind": "text" + }, + { + "text": ")", + "kind": "punctuation" + } + ], + "documentation": [] + } + }, + { + "marker": { + "fileName": "/tests/cases/fourslash/quickInfoDisplayPartsClassConstructor.ts", + "position": 194 + }, + "quickInfo": { + "kind": "var", + "kindModifiers": "", + "textSpan": { + "start": 194, + "length": 22 + }, + "displayParts": [ + { + "text": "var", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "cWithOverloadsInstance", + "kind": "localName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "cWithOverloads", + "kind": "className" + } + ], + "documentation": [] + } + }, + { + "marker": { + "fileName": "/tests/cases/fourslash/quickInfoDisplayPartsClassConstructor.ts", + "position": 223 + }, + "quickInfo": { + "kind": "constructor", + "kindModifiers": "", + "textSpan": { + "start": 223, + "length": 14 + }, + "displayParts": [ + { + "text": "constructor", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "cWithOverloads", + "kind": "className" + }, + { + "text": "(", + "kind": "punctuation" + }, + { + "text": "x", + "kind": "parameterName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "string", + "kind": "keyword" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "cWithOverloads", + "kind": "className" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "(", + "kind": "punctuation" + }, + { + "text": "+", + "kind": "operator" + }, + { + "text": "1", + "kind": "numericLiteral" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "overload", + "kind": "text" + }, + { + "text": ")", + "kind": "punctuation" + } + ], + "documentation": [] + } + }, + { + "marker": { + "fileName": "/tests/cases/fourslash/quickInfoDisplayPartsClassConstructor.ts", + "position": 252 + }, + "quickInfo": { + "kind": "var", + "kindModifiers": "", + "textSpan": { + "start": 252, + "length": 23 + }, + "displayParts": [ + { + "text": "var", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "cWithOverloadsInstance2", + "kind": "localName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "cWithOverloads", + "kind": "className" + } + ], + "documentation": [] + } + }, + { + "marker": { + "fileName": "/tests/cases/fourslash/quickInfoDisplayPartsClassConstructor.ts", + "position": 282 + }, + "quickInfo": { + "kind": "constructor", + "kindModifiers": "", + "textSpan": { + "start": 282, + "length": 14 + }, + "displayParts": [ + { + "text": "constructor", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "cWithOverloads", + "kind": "className" + }, + { + "text": "(", + "kind": "punctuation" + }, + { + "text": "x", + "kind": "parameterName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "number", + "kind": "keyword" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "cWithOverloads", + "kind": "className" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "(", + "kind": "punctuation" + }, + { + "text": "+", + "kind": "operator" + }, + { + "text": "1", + "kind": "numericLiteral" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "overload", + "kind": "text" + }, + { + "text": ")", + "kind": "punctuation" + } + ], + "documentation": [] + } + }, + { + "marker": { + "fileName": "/tests/cases/fourslash/quickInfoDisplayPartsClassConstructor.ts", + "position": 306 + }, + "quickInfo": { + "kind": "var", + "kindModifiers": "", + "textSpan": { + "start": 306, + "length": 17 + }, + "displayParts": [ + { + "text": "var", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "cWithOverloadsVal", + "kind": "localName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "typeof", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "cWithOverloads", + "kind": "className" + } + ], + "documentation": [] + } + }, + { + "marker": { + "fileName": "/tests/cases/fourslash/quickInfoDisplayPartsClassConstructor.ts", + "position": 326 + }, + "quickInfo": { + "kind": "class", + "kindModifiers": "", + "textSpan": { + "start": 326, + "length": 14 + }, + "displayParts": [ + { + "text": "class", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "cWithOverloads", + "kind": "className" + } + ], + "documentation": [] + } + }, + { + "marker": { + "fileName": "/tests/cases/fourslash/quickInfoDisplayPartsClassConstructor.ts", + "position": 377 + }, + "quickInfo": { + "kind": "constructor", + "kindModifiers": "", + "textSpan": { + "start": 377, + "length": 11 + }, + "displayParts": [ + { + "text": "constructor", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "cWithMultipleOverloads", + "kind": "className" + }, + { + "text": "(", + "kind": "punctuation" + }, + { + "text": "x", + "kind": "parameterName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "string", + "kind": "keyword" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "cWithMultipleOverloads", + "kind": "className" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "(", + "kind": "punctuation" + }, + { + "text": "+", + "kind": "operator" + }, + { + "text": "2", + "kind": "numericLiteral" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "overloads", + "kind": "text" + }, + { + "text": ")", + "kind": "punctuation" + } + ], + "documentation": [] + } + }, + { + "marker": { + "fileName": "/tests/cases/fourslash/quickInfoDisplayPartsClassConstructor.ts", + "position": 405 + }, + "quickInfo": { + "kind": "constructor", + "kindModifiers": "", + "textSpan": { + "start": 405, + "length": 11 + }, + "displayParts": [ + { + "text": "constructor", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "cWithMultipleOverloads", + "kind": "className" + }, + { + "text": "(", + "kind": "punctuation" + }, + { + "text": "x", + "kind": "parameterName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "number", + "kind": "keyword" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "cWithMultipleOverloads", + "kind": "className" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "(", + "kind": "punctuation" + }, + { + "text": "+", + "kind": "operator" + }, + { + "text": "2", + "kind": "numericLiteral" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "overloads", + "kind": "text" + }, + { + "text": ")", + "kind": "punctuation" + } + ], + "documentation": [] + } + }, + { + "marker": { + "fileName": "/tests/cases/fourslash/quickInfoDisplayPartsClassConstructor.ts", + "position": 433 + }, + "quickInfo": { + "kind": "constructor", + "kindModifiers": "", + "textSpan": { + "start": 433, + "length": 11 + }, + "displayParts": [ + { + "text": "constructor", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "cWithMultipleOverloads", + "kind": "className" + }, + { + "text": "(", + "kind": "punctuation" + }, + { + "text": "x", + "kind": "parameterName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "boolean", + "kind": "keyword" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "cWithMultipleOverloads", + "kind": "className" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "(", + "kind": "punctuation" + }, + { + "text": "+", + "kind": "operator" + }, + { + "text": "2", + "kind": "numericLiteral" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "overloads", + "kind": "text" + }, + { + "text": ")", + "kind": "punctuation" + } + ], + "documentation": [] + } + }, + { + "marker": { + "fileName": "/tests/cases/fourslash/quickInfoDisplayPartsClassConstructor.ts", + "position": 462 + }, + "quickInfo": { + "kind": "constructor", + "kindModifiers": "", + "textSpan": { + "start": 462, + "length": 11 + }, + "displayParts": [ + { + "text": "constructor", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "cWithMultipleOverloads", + "kind": "className" + }, + { + "text": "(", + "kind": "punctuation" + }, + { + "text": "x", + "kind": "parameterName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "string", + "kind": "keyword" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "cWithMultipleOverloads", + "kind": "className" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "(", + "kind": "punctuation" + }, + { + "text": "+", + "kind": "operator" + }, + { + "text": "2", + "kind": "numericLiteral" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "overloads", + "kind": "text" + }, + { + "text": ")", + "kind": "punctuation" + } + ], + "documentation": [] + } + }, + { + "marker": { + "fileName": "/tests/cases/fourslash/quickInfoDisplayPartsClassConstructor.ts", + "position": 496 + }, + "quickInfo": { + "kind": "var", + "kindModifiers": "", + "textSpan": { + "start": 496, + "length": 30 + }, + "displayParts": [ + { + "text": "var", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "cWithMultipleOverloadsInstance", + "kind": "localName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "cWithMultipleOverloads", + "kind": "className" + } + ], + "documentation": [] + } + }, + { + "marker": { + "fileName": "/tests/cases/fourslash/quickInfoDisplayPartsClassConstructor.ts", + "position": 533 + }, + "quickInfo": { + "kind": "constructor", + "kindModifiers": "", + "textSpan": { + "start": 533, + "length": 22 + }, + "displayParts": [ + { + "text": "constructor", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "cWithMultipleOverloads", + "kind": "className" + }, + { + "text": "(", + "kind": "punctuation" + }, + { + "text": "x", + "kind": "parameterName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "string", + "kind": "keyword" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "cWithMultipleOverloads", + "kind": "className" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "(", + "kind": "punctuation" + }, + { + "text": "+", + "kind": "operator" + }, + { + "text": "2", + "kind": "numericLiteral" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "overloads", + "kind": "text" + }, + { + "text": ")", + "kind": "punctuation" + } + ], + "documentation": [] + } + }, + { + "marker": { + "fileName": "/tests/cases/fourslash/quickInfoDisplayPartsClassConstructor.ts", + "position": 570 + }, + "quickInfo": { + "kind": "var", + "kindModifiers": "", + "textSpan": { + "start": 570, + "length": 31 + }, + "displayParts": [ + { + "text": "var", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "cWithMultipleOverloadsInstance2", + "kind": "localName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "cWithMultipleOverloads", + "kind": "className" + } + ], + "documentation": [] + } + }, + { + "marker": { + "fileName": "/tests/cases/fourslash/quickInfoDisplayPartsClassConstructor.ts", + "position": 608 + }, + "quickInfo": { + "kind": "constructor", + "kindModifiers": "", + "textSpan": { + "start": 608, + "length": 22 + }, + "displayParts": [ + { + "text": "constructor", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "cWithMultipleOverloads", + "kind": "className" + }, + { + "text": "(", + "kind": "punctuation" + }, + { + "text": "x", + "kind": "parameterName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "number", + "kind": "keyword" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "cWithMultipleOverloads", + "kind": "className" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "(", + "kind": "punctuation" + }, + { + "text": "+", + "kind": "operator" + }, + { + "text": "2", + "kind": "numericLiteral" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "overloads", + "kind": "text" + }, + { + "text": ")", + "kind": "punctuation" + } + ], + "documentation": [] + } + }, + { + "marker": { + "fileName": "/tests/cases/fourslash/quickInfoDisplayPartsClassConstructor.ts", + "position": 640 + }, + "quickInfo": { + "kind": "var", + "kindModifiers": "", + "textSpan": { + "start": 640, + "length": 31 + }, + "displayParts": [ + { + "text": "var", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "cWithMultipleOverloadsInstance3", + "kind": "localName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "cWithMultipleOverloads", + "kind": "className" + } + ], + "documentation": [] + } + }, + { + "marker": { + "fileName": "/tests/cases/fourslash/quickInfoDisplayPartsClassConstructor.ts", + "position": 678 + }, + "quickInfo": { + "kind": "constructor", + "kindModifiers": "", + "textSpan": { + "start": 678, + "length": 22 + }, + "displayParts": [ + { + "text": "constructor", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "cWithMultipleOverloads", + "kind": "className" + }, + { + "text": "(", + "kind": "punctuation" + }, + { + "text": "x", + "kind": "parameterName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "boolean", + "kind": "keyword" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "cWithMultipleOverloads", + "kind": "className" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "(", + "kind": "punctuation" + }, + { + "text": "+", + "kind": "operator" + }, + { + "text": "2", + "kind": "numericLiteral" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "overloads", + "kind": "text" + }, + { + "text": ")", + "kind": "punctuation" + } + ], + "documentation": [] + } + }, + { + "marker": { + "fileName": "/tests/cases/fourslash/quickInfoDisplayPartsClassConstructor.ts", + "position": 712 + }, + "quickInfo": { + "kind": "var", + "kindModifiers": "", + "textSpan": { + "start": 712, + "length": 25 + }, + "displayParts": [ + { + "text": "var", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "cWithMultipleOverloadsVal", + "kind": "localName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "typeof", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "cWithMultipleOverloads", + "kind": "className" + } + ], + "documentation": [] + } + }, + { + "marker": { + "fileName": "/tests/cases/fourslash/quickInfoDisplayPartsClassConstructor.ts", + "position": 740 + }, + "quickInfo": { + "kind": "class", + "kindModifiers": "", + "textSpan": { + "start": 740, + "length": 22 + }, + "displayParts": [ + { + "text": "class", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "cWithMultipleOverloads", + "kind": "className" + } + ], + "documentation": [] + } + } +] \ No newline at end of file diff --git a/tests/baselines/reference/quickInfoDisplayPartsClassMethod.baseline b/tests/baselines/reference/quickInfoDisplayPartsClassMethod.baseline new file mode 100644 index 00000000000..d6f3f187d02 --- /dev/null +++ b/tests/baselines/reference/quickInfoDisplayPartsClassMethod.baseline @@ -0,0 +1,982 @@ +[ + { + "marker": { + "fileName": "/tests/cases/fourslash/quickInfoDisplayPartsClassMethod.ts", + "position": 21 + }, + "quickInfo": { + "kind": "method", + "kindModifiers": "public", + "textSpan": { + "start": 21, + "length": 12 + }, + "displayParts": [ + { + "text": "(", + "kind": "punctuation" + }, + { + "text": "method", + "kind": "text" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "c", + "kind": "className" + }, + { + "text": ".", + "kind": "punctuation" + }, + { + "text": "publicMethod", + "kind": "methodName" + }, + { + "text": "(", + "kind": "punctuation" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "void", + "kind": "keyword" + } + ], + "documentation": [] + } + }, + { + "marker": { + "fileName": "/tests/cases/fourslash/quickInfoDisplayPartsClassMethod.ts", + "position": 52 + }, + "quickInfo": { + "kind": "method", + "kindModifiers": "private", + "textSpan": { + "start": 52, + "length": 13 + }, + "displayParts": [ + { + "text": "(", + "kind": "punctuation" + }, + { + "text": "method", + "kind": "text" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "c", + "kind": "className" + }, + { + "text": ".", + "kind": "punctuation" + }, + { + "text": "privateMethod", + "kind": "methodName" + }, + { + "text": "(", + "kind": "punctuation" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "void", + "kind": "keyword" + } + ], + "documentation": [] + } + }, + { + "marker": { + "fileName": "/tests/cases/fourslash/quickInfoDisplayPartsClassMethod.ts", + "position": 86 + }, + "quickInfo": { + "kind": "method", + "kindModifiers": "protected", + "textSpan": { + "start": 86, + "length": 15 + }, + "displayParts": [ + { + "text": "(", + "kind": "punctuation" + }, + { + "text": "method", + "kind": "text" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "c", + "kind": "className" + }, + { + "text": ".", + "kind": "punctuation" + }, + { + "text": "protectedMethod", + "kind": "methodName" + }, + { + "text": "(", + "kind": "punctuation" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "void", + "kind": "keyword" + } + ], + "documentation": [] + } + }, + { + "marker": { + "fileName": "/tests/cases/fourslash/quickInfoDisplayPartsClassMethod.ts", + "position": 119 + }, + "quickInfo": { + "kind": "method", + "kindModifiers": "static", + "textSpan": { + "start": 119, + "length": 12 + }, + "displayParts": [ + { + "text": "(", + "kind": "punctuation" + }, + { + "text": "method", + "kind": "text" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "c", + "kind": "className" + }, + { + "text": ".", + "kind": "punctuation" + }, + { + "text": "staticMethod", + "kind": "methodName" + }, + { + "text": "(", + "kind": "punctuation" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "void", + "kind": "keyword" + } + ], + "documentation": [] + } + }, + { + "marker": { + "fileName": "/tests/cases/fourslash/quickInfoDisplayPartsClassMethod.ts", + "position": 157 + }, + "quickInfo": { + "kind": "method", + "kindModifiers": "private,static", + "textSpan": { + "start": 157, + "length": 19 + }, + "displayParts": [ + { + "text": "(", + "kind": "punctuation" + }, + { + "text": "method", + "kind": "text" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "c", + "kind": "className" + }, + { + "text": ".", + "kind": "punctuation" + }, + { + "text": "privateStaticMethod", + "kind": "methodName" + }, + { + "text": "(", + "kind": "punctuation" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "void", + "kind": "keyword" + } + ], + "documentation": [] + } + }, + { + "marker": { + "fileName": "/tests/cases/fourslash/quickInfoDisplayPartsClassMethod.ts", + "position": 204 + }, + "quickInfo": { + "kind": "method", + "kindModifiers": "protected,static", + "textSpan": { + "start": 204, + "length": 21 + }, + "displayParts": [ + { + "text": "(", + "kind": "punctuation" + }, + { + "text": "method", + "kind": "text" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "c", + "kind": "className" + }, + { + "text": ".", + "kind": "punctuation" + }, + { + "text": "protectedStaticMethod", + "kind": "methodName" + }, + { + "text": "(", + "kind": "punctuation" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "void", + "kind": "keyword" + } + ], + "documentation": [] + } + }, + { + "marker": { + "fileName": "/tests/cases/fourslash/quickInfoDisplayPartsClassMethod.ts", + "position": 260 + }, + "quickInfo": { + "kind": "method", + "kindModifiers": "public", + "textSpan": { + "start": 260, + "length": 12 + }, + "displayParts": [ + { + "text": "(", + "kind": "punctuation" + }, + { + "text": "method", + "kind": "text" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "c", + "kind": "className" + }, + { + "text": ".", + "kind": "punctuation" + }, + { + "text": "publicMethod", + "kind": "methodName" + }, + { + "text": "(", + "kind": "punctuation" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "void", + "kind": "keyword" + } + ], + "documentation": [] + } + }, + { + "marker": { + "fileName": "/tests/cases/fourslash/quickInfoDisplayPartsClassMethod.ts", + "position": 289 + }, + "quickInfo": { + "kind": "method", + "kindModifiers": "private", + "textSpan": { + "start": 289, + "length": 13 + }, + "displayParts": [ + { + "text": "(", + "kind": "punctuation" + }, + { + "text": "method", + "kind": "text" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "c", + "kind": "className" + }, + { + "text": ".", + "kind": "punctuation" + }, + { + "text": "privateMethod", + "kind": "methodName" + }, + { + "text": "(", + "kind": "punctuation" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "void", + "kind": "keyword" + } + ], + "documentation": [] + } + }, + { + "marker": { + "fileName": "/tests/cases/fourslash/quickInfoDisplayPartsClassMethod.ts", + "position": 319 + }, + "quickInfo": { + "kind": "method", + "kindModifiers": "protected", + "textSpan": { + "start": 319, + "length": 15 + }, + "displayParts": [ + { + "text": "(", + "kind": "punctuation" + }, + { + "text": "method", + "kind": "text" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "c", + "kind": "className" + }, + { + "text": ".", + "kind": "punctuation" + }, + { + "text": "protectedMethod", + "kind": "methodName" + }, + { + "text": "(", + "kind": "punctuation" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "void", + "kind": "keyword" + } + ], + "documentation": [] + } + }, + { + "marker": { + "fileName": "/tests/cases/fourslash/quickInfoDisplayPartsClassMethod.ts", + "position": 348 + }, + "quickInfo": { + "kind": "method", + "kindModifiers": "static", + "textSpan": { + "start": 348, + "length": 12 + }, + "displayParts": [ + { + "text": "(", + "kind": "punctuation" + }, + { + "text": "method", + "kind": "text" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "c", + "kind": "className" + }, + { + "text": ".", + "kind": "punctuation" + }, + { + "text": "staticMethod", + "kind": "methodName" + }, + { + "text": "(", + "kind": "punctuation" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "void", + "kind": "keyword" + } + ], + "documentation": [] + } + }, + { + "marker": { + "fileName": "/tests/cases/fourslash/quickInfoDisplayPartsClassMethod.ts", + "position": 374 + }, + "quickInfo": { + "kind": "method", + "kindModifiers": "private,static", + "textSpan": { + "start": 374, + "length": 19 + }, + "displayParts": [ + { + "text": "(", + "kind": "punctuation" + }, + { + "text": "method", + "kind": "text" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "c", + "kind": "className" + }, + { + "text": ".", + "kind": "punctuation" + }, + { + "text": "privateStaticMethod", + "kind": "methodName" + }, + { + "text": "(", + "kind": "punctuation" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "void", + "kind": "keyword" + } + ], + "documentation": [] + } + }, + { + "marker": { + "fileName": "/tests/cases/fourslash/quickInfoDisplayPartsClassMethod.ts", + "position": 407 + }, + "quickInfo": { + "kind": "method", + "kindModifiers": "protected,static", + "textSpan": { + "start": 407, + "length": 21 + }, + "displayParts": [ + { + "text": "(", + "kind": "punctuation" + }, + { + "text": "method", + "kind": "text" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "c", + "kind": "className" + }, + { + "text": ".", + "kind": "punctuation" + }, + { + "text": "protectedStaticMethod", + "kind": "methodName" + }, + { + "text": "(", + "kind": "punctuation" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "void", + "kind": "keyword" + } + ], + "documentation": [] + } + }, + { + "marker": { + "fileName": "/tests/cases/fourslash/quickInfoDisplayPartsClassMethod.ts", + "position": 465 + }, + "quickInfo": { + "kind": "var", + "kindModifiers": "", + "textSpan": { + "start": 465, + "length": 9 + }, + "displayParts": [ + { + "text": "var", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "cInstance", + "kind": "localName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "c", + "kind": "className" + } + ], + "documentation": [] + } + }, + { + "marker": { + "fileName": "/tests/cases/fourslash/quickInfoDisplayPartsClassMethod.ts", + "position": 475 + }, + "quickInfo": { + "kind": "method", + "kindModifiers": "public", + "textSpan": { + "start": 475, + "length": 12 + }, + "displayParts": [ + { + "text": "(", + "kind": "punctuation" + }, + { + "text": "method", + "kind": "text" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "c", + "kind": "className" + }, + { + "text": ".", + "kind": "punctuation" + }, + { + "text": "publicMethod", + "kind": "methodName" + }, + { + "text": "(", + "kind": "punctuation" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "void", + "kind": "keyword" + } + ], + "documentation": [] + } + }, + { + "marker": { + "fileName": "/tests/cases/fourslash/quickInfoDisplayPartsClassMethod.ts", + "position": 491 + }, + "quickInfo": { + "kind": "class", + "kindModifiers": "", + "textSpan": { + "start": 491, + "length": 1 + }, + "displayParts": [ + { + "text": "class", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "c", + "kind": "className" + } + ], + "documentation": [] + } + }, + { + "marker": { + "fileName": "/tests/cases/fourslash/quickInfoDisplayPartsClassMethod.ts", + "position": 493 + }, + "quickInfo": { + "kind": "method", + "kindModifiers": "static", + "textSpan": { + "start": 493, + "length": 12 + }, + "displayParts": [ + { + "text": "(", + "kind": "punctuation" + }, + { + "text": "method", + "kind": "text" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "c", + "kind": "className" + }, + { + "text": ".", + "kind": "punctuation" + }, + { + "text": "staticMethod", + "kind": "methodName" + }, + { + "text": "(", + "kind": "punctuation" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "void", + "kind": "keyword" + } + ], + "documentation": [] + } + } +] \ No newline at end of file diff --git a/tests/baselines/reference/quickInfoDisplayPartsClassProperty.baseline b/tests/baselines/reference/quickInfoDisplayPartsClassProperty.baseline new file mode 100644 index 00000000000..b49fb80c38a --- /dev/null +++ b/tests/baselines/reference/quickInfoDisplayPartsClassProperty.baseline @@ -0,0 +1,870 @@ +[ + { + "marker": { + "fileName": "/tests/cases/fourslash/quickInfoDisplayPartsClassProperty.ts", + "position": 21 + }, + "quickInfo": { + "kind": "property", + "kindModifiers": "public", + "textSpan": { + "start": 21, + "length": 14 + }, + "displayParts": [ + { + "text": "(", + "kind": "punctuation" + }, + { + "text": "property", + "kind": "text" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "c", + "kind": "className" + }, + { + "text": ".", + "kind": "punctuation" + }, + { + "text": "publicProperty", + "kind": "propertyName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "string", + "kind": "keyword" + } + ], + "documentation": [] + } + }, + { + "marker": { + "fileName": "/tests/cases/fourslash/quickInfoDisplayPartsClassProperty.ts", + "position": 57 + }, + "quickInfo": { + "kind": "property", + "kindModifiers": "private", + "textSpan": { + "start": 57, + "length": 15 + }, + "displayParts": [ + { + "text": "(", + "kind": "punctuation" + }, + { + "text": "property", + "kind": "text" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "c", + "kind": "className" + }, + { + "text": ".", + "kind": "punctuation" + }, + { + "text": "privateProperty", + "kind": "propertyName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "string", + "kind": "keyword" + } + ], + "documentation": [] + } + }, + { + "marker": { + "fileName": "/tests/cases/fourslash/quickInfoDisplayPartsClassProperty.ts", + "position": 96 + }, + "quickInfo": { + "kind": "property", + "kindModifiers": "protected", + "textSpan": { + "start": 96, + "length": 17 + }, + "displayParts": [ + { + "text": "(", + "kind": "punctuation" + }, + { + "text": "property", + "kind": "text" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "c", + "kind": "className" + }, + { + "text": ".", + "kind": "punctuation" + }, + { + "text": "protectedProperty", + "kind": "propertyName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "string", + "kind": "keyword" + } + ], + "documentation": [] + } + }, + { + "marker": { + "fileName": "/tests/cases/fourslash/quickInfoDisplayPartsClassProperty.ts", + "position": 134 + }, + "quickInfo": { + "kind": "property", + "kindModifiers": "static", + "textSpan": { + "start": 134, + "length": 14 + }, + "displayParts": [ + { + "text": "(", + "kind": "punctuation" + }, + { + "text": "property", + "kind": "text" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "c", + "kind": "className" + }, + { + "text": ".", + "kind": "punctuation" + }, + { + "text": "staticProperty", + "kind": "propertyName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "string", + "kind": "keyword" + } + ], + "documentation": [] + } + }, + { + "marker": { + "fileName": "/tests/cases/fourslash/quickInfoDisplayPartsClassProperty.ts", + "position": 177 + }, + "quickInfo": { + "kind": "property", + "kindModifiers": "private,static", + "textSpan": { + "start": 177, + "length": 21 + }, + "displayParts": [ + { + "text": "(", + "kind": "punctuation" + }, + { + "text": "property", + "kind": "text" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "c", + "kind": "className" + }, + { + "text": ".", + "kind": "punctuation" + }, + { + "text": "privateStaticProperty", + "kind": "propertyName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "string", + "kind": "keyword" + } + ], + "documentation": [] + } + }, + { + "marker": { + "fileName": "/tests/cases/fourslash/quickInfoDisplayPartsClassProperty.ts", + "position": 229 + }, + "quickInfo": { + "kind": "property", + "kindModifiers": "protected,static", + "textSpan": { + "start": 229, + "length": 23 + }, + "displayParts": [ + { + "text": "(", + "kind": "punctuation" + }, + { + "text": "property", + "kind": "text" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "c", + "kind": "className" + }, + { + "text": ".", + "kind": "punctuation" + }, + { + "text": "protectedStaticProperty", + "kind": "propertyName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "string", + "kind": "keyword" + } + ], + "documentation": [] + } + }, + { + "marker": { + "fileName": "/tests/cases/fourslash/quickInfoDisplayPartsClassProperty.ts", + "position": 290 + }, + "quickInfo": { + "kind": "property", + "kindModifiers": "public", + "textSpan": { + "start": 290, + "length": 14 + }, + "displayParts": [ + { + "text": "(", + "kind": "punctuation" + }, + { + "text": "property", + "kind": "text" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "c", + "kind": "className" + }, + { + "text": ".", + "kind": "punctuation" + }, + { + "text": "publicProperty", + "kind": "propertyName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "string", + "kind": "keyword" + } + ], + "documentation": [] + } + }, + { + "marker": { + "fileName": "/tests/cases/fourslash/quickInfoDisplayPartsClassProperty.ts", + "position": 319 + }, + "quickInfo": { + "kind": "property", + "kindModifiers": "private", + "textSpan": { + "start": 319, + "length": 15 + }, + "displayParts": [ + { + "text": "(", + "kind": "punctuation" + }, + { + "text": "property", + "kind": "text" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "c", + "kind": "className" + }, + { + "text": ".", + "kind": "punctuation" + }, + { + "text": "privateProperty", + "kind": "propertyName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "string", + "kind": "keyword" + } + ], + "documentation": [] + } + }, + { + "marker": { + "fileName": "/tests/cases/fourslash/quickInfoDisplayPartsClassProperty.ts", + "position": 349 + }, + "quickInfo": { + "kind": "property", + "kindModifiers": "protected", + "textSpan": { + "start": 349, + "length": 17 + }, + "displayParts": [ + { + "text": "(", + "kind": "punctuation" + }, + { + "text": "property", + "kind": "text" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "c", + "kind": "className" + }, + { + "text": ".", + "kind": "punctuation" + }, + { + "text": "protectedProperty", + "kind": "propertyName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "string", + "kind": "keyword" + } + ], + "documentation": [] + } + }, + { + "marker": { + "fileName": "/tests/cases/fourslash/quickInfoDisplayPartsClassProperty.ts", + "position": 378 + }, + "quickInfo": { + "kind": "property", + "kindModifiers": "static", + "textSpan": { + "start": 378, + "length": 14 + }, + "displayParts": [ + { + "text": "(", + "kind": "punctuation" + }, + { + "text": "property", + "kind": "text" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "c", + "kind": "className" + }, + { + "text": ".", + "kind": "punctuation" + }, + { + "text": "staticProperty", + "kind": "propertyName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "string", + "kind": "keyword" + } + ], + "documentation": [] + } + }, + { + "marker": { + "fileName": "/tests/cases/fourslash/quickInfoDisplayPartsClassProperty.ts", + "position": 404 + }, + "quickInfo": { + "kind": "property", + "kindModifiers": "private,static", + "textSpan": { + "start": 404, + "length": 21 + }, + "displayParts": [ + { + "text": "(", + "kind": "punctuation" + }, + { + "text": "property", + "kind": "text" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "c", + "kind": "className" + }, + { + "text": ".", + "kind": "punctuation" + }, + { + "text": "privateStaticProperty", + "kind": "propertyName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "string", + "kind": "keyword" + } + ], + "documentation": [] + } + }, + { + "marker": { + "fileName": "/tests/cases/fourslash/quickInfoDisplayPartsClassProperty.ts", + "position": 437 + }, + "quickInfo": { + "kind": "property", + "kindModifiers": "protected,static", + "textSpan": { + "start": 437, + "length": 23 + }, + "displayParts": [ + { + "text": "(", + "kind": "punctuation" + }, + { + "text": "property", + "kind": "text" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "c", + "kind": "className" + }, + { + "text": ".", + "kind": "punctuation" + }, + { + "text": "protectedStaticProperty", + "kind": "propertyName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "string", + "kind": "keyword" + } + ], + "documentation": [] + } + }, + { + "marker": { + "fileName": "/tests/cases/fourslash/quickInfoDisplayPartsClassProperty.ts", + "position": 495 + }, + "quickInfo": { + "kind": "var", + "kindModifiers": "", + "textSpan": { + "start": 495, + "length": 9 + }, + "displayParts": [ + { + "text": "var", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "cInstance", + "kind": "localName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "c", + "kind": "className" + } + ], + "documentation": [] + } + }, + { + "marker": { + "fileName": "/tests/cases/fourslash/quickInfoDisplayPartsClassProperty.ts", + "position": 505 + }, + "quickInfo": { + "kind": "property", + "kindModifiers": "public", + "textSpan": { + "start": 505, + "length": 14 + }, + "displayParts": [ + { + "text": "(", + "kind": "punctuation" + }, + { + "text": "property", + "kind": "text" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "c", + "kind": "className" + }, + { + "text": ".", + "kind": "punctuation" + }, + { + "text": "publicProperty", + "kind": "propertyName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "string", + "kind": "keyword" + } + ], + "documentation": [] + } + }, + { + "marker": { + "fileName": "/tests/cases/fourslash/quickInfoDisplayPartsClassProperty.ts", + "position": 521 + }, + "quickInfo": { + "kind": "class", + "kindModifiers": "", + "textSpan": { + "start": 521, + "length": 1 + }, + "displayParts": [ + { + "text": "class", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "c", + "kind": "className" + } + ], + "documentation": [] + } + }, + { + "marker": { + "fileName": "/tests/cases/fourslash/quickInfoDisplayPartsClassProperty.ts", + "position": 523 + }, + "quickInfo": { + "kind": "property", + "kindModifiers": "static", + "textSpan": { + "start": 523, + "length": 14 + }, + "displayParts": [ + { + "text": "(", + "kind": "punctuation" + }, + { + "text": "property", + "kind": "text" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "c", + "kind": "className" + }, + { + "text": ".", + "kind": "punctuation" + }, + { + "text": "staticProperty", + "kind": "propertyName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "string", + "kind": "keyword" + } + ], + "documentation": [] + } + } +] \ No newline at end of file diff --git a/tests/baselines/reference/quickInfoDisplayPartsConst.baseline b/tests/baselines/reference/quickInfoDisplayPartsConst.baseline new file mode 100644 index 00000000000..7493d001bd3 --- /dev/null +++ b/tests/baselines/reference/quickInfoDisplayPartsConst.baseline @@ -0,0 +1,1186 @@ +[ + { + "marker": { + "fileName": "/tests/cases/fourslash/quickInfoDisplayPartsConst.ts", + "position": 6 + }, + "quickInfo": { + "kind": "const", + "kindModifiers": "", + "textSpan": { + "start": 6, + "length": 1 + }, + "displayParts": [ + { + "text": "const", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "a", + "kind": "localName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "10", + "kind": "stringLiteral" + } + ], + "documentation": [] + } + }, + { + "marker": { + "fileName": "/tests/cases/fourslash/quickInfoDisplayPartsConst.ts", + "position": 41 + }, + "quickInfo": { + "kind": "const", + "kindModifiers": "", + "textSpan": { + "start": 41, + "length": 1 + }, + "displayParts": [ + { + "text": "const", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "b", + "kind": "localName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "10", + "kind": "stringLiteral" + } + ], + "documentation": [] + } + }, + { + "marker": { + "fileName": "/tests/cases/fourslash/quickInfoDisplayPartsConst.ts", + "position": 45 + }, + "quickInfo": { + "kind": "const", + "kindModifiers": "", + "textSpan": { + "start": 45, + "length": 1 + }, + "displayParts": [ + { + "text": "const", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "a", + "kind": "localName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "10", + "kind": "stringLiteral" + } + ], + "documentation": [] + } + }, + { + "marker": { + "fileName": "/tests/cases/fourslash/quickInfoDisplayPartsConst.ts", + "position": 75 + }, + "quickInfo": { + "kind": "const", + "kindModifiers": "", + "textSpan": { + "start": 75, + "length": 2 + }, + "displayParts": [ + { + "text": "const", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "b1", + "kind": "localName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "10", + "kind": "stringLiteral" + } + ], + "documentation": [] + } + }, + { + "marker": { + "fileName": "/tests/cases/fourslash/quickInfoDisplayPartsConst.ts", + "position": 113 + }, + "quickInfo": { + "kind": "const", + "kindModifiers": "", + "textSpan": { + "start": 113, + "length": 1 + }, + "displayParts": [ + { + "text": "const", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "c", + "kind": "localName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "10", + "kind": "stringLiteral" + } + ], + "documentation": [] + } + }, + { + "marker": { + "fileName": "/tests/cases/fourslash/quickInfoDisplayPartsConst.ts", + "position": 138 + }, + "quickInfo": { + "kind": "const", + "kindModifiers": "export", + "textSpan": { + "start": 138, + "length": 1 + }, + "displayParts": [ + { + "text": "const", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "m", + "kind": "moduleName" + }, + { + "text": ".", + "kind": "punctuation" + }, + { + "text": "d", + "kind": "localName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "10", + "kind": "stringLiteral" + } + ], + "documentation": [] + } + }, + { + "marker": { + "fileName": "/tests/cases/fourslash/quickInfoDisplayPartsConst.ts", + "position": 173 + }, + "quickInfo": { + "kind": "const", + "kindModifiers": "", + "textSpan": { + "start": 173, + "length": 1 + }, + "displayParts": [ + { + "text": "const", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "e", + "kind": "localName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "10", + "kind": "stringLiteral" + } + ], + "documentation": [] + } + }, + { + "marker": { + "fileName": "/tests/cases/fourslash/quickInfoDisplayPartsConst.ts", + "position": 195 + }, + "quickInfo": { + "kind": "const", + "kindModifiers": "", + "textSpan": { + "start": 195, + "length": 1 + }, + "displayParts": [ + { + "text": "const", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "f", + "kind": "localName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "(", + "kind": "punctuation" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "=>", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "number", + "kind": "keyword" + } + ], + "documentation": [] + } + }, + { + "marker": { + "fileName": "/tests/cases/fourslash/quickInfoDisplayPartsConst.ts", + "position": 229 + }, + "quickInfo": { + "kind": "const", + "kindModifiers": "", + "textSpan": { + "start": 229, + "length": 1 + }, + "displayParts": [ + { + "text": "const", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "g", + "kind": "localName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "(", + "kind": "punctuation" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "=>", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "number", + "kind": "keyword" + } + ], + "documentation": [] + } + }, + { + "marker": { + "fileName": "/tests/cases/fourslash/quickInfoDisplayPartsConst.ts", + "position": 233 + }, + "quickInfo": { + "kind": "const", + "kindModifiers": "", + "textSpan": { + "start": 233, + "length": 1 + }, + "displayParts": [ + { + "text": "const", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "f", + "kind": "localName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "(", + "kind": "punctuation" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "=>", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "number", + "kind": "keyword" + } + ], + "documentation": [] + } + }, + { + "marker": { + "fileName": "/tests/cases/fourslash/quickInfoDisplayPartsConst.ts", + "position": 236 + }, + "quickInfo": { + "kind": "const", + "kindModifiers": "", + "textSpan": { + "start": 236, + "length": 1 + }, + "displayParts": [ + { + "text": "const", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "f", + "kind": "localName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "(", + "kind": "punctuation" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "=>", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "number", + "kind": "keyword" + } + ], + "documentation": [] + } + }, + { + "marker": { + "fileName": "/tests/cases/fourslash/quickInfoDisplayPartsConst.ts", + "position": 247 + }, + "quickInfo": { + "kind": "const", + "kindModifiers": "", + "textSpan": { + "start": 247, + "length": 1 + }, + "displayParts": [ + { + "text": "const", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "h", + "kind": "localName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "{", + "kind": "punctuation" + }, + { + "text": "\n", + "kind": "lineBreak" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "(", + "kind": "punctuation" + }, + { + "text": "a", + "kind": "parameterName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "string", + "kind": "keyword" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "number", + "kind": "keyword" + }, + { + "text": ";", + "kind": "punctuation" + }, + { + "text": "\n", + "kind": "lineBreak" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "(", + "kind": "punctuation" + }, + { + "text": "a", + "kind": "parameterName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "number", + "kind": "keyword" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "string", + "kind": "keyword" + }, + { + "text": ";", + "kind": "punctuation" + }, + { + "text": "\n", + "kind": "lineBreak" + }, + { + "text": "}", + "kind": "punctuation" + } + ], + "documentation": [] + } + }, + { + "marker": { + "fileName": "/tests/cases/fourslash/quickInfoDisplayPartsConst.ts", + "position": 312 + }, + "quickInfo": { + "kind": "const", + "kindModifiers": "", + "textSpan": { + "start": 312, + "length": 1 + }, + "displayParts": [ + { + "text": "const", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "i", + "kind": "localName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "{", + "kind": "punctuation" + }, + { + "text": "\n", + "kind": "lineBreak" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "(", + "kind": "punctuation" + }, + { + "text": "a", + "kind": "parameterName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "string", + "kind": "keyword" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "number", + "kind": "keyword" + }, + { + "text": ";", + "kind": "punctuation" + }, + { + "text": "\n", + "kind": "lineBreak" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "(", + "kind": "punctuation" + }, + { + "text": "a", + "kind": "parameterName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "number", + "kind": "keyword" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "string", + "kind": "keyword" + }, + { + "text": ";", + "kind": "punctuation" + }, + { + "text": "\n", + "kind": "lineBreak" + }, + { + "text": "}", + "kind": "punctuation" + } + ], + "documentation": [] + } + }, + { + "marker": { + "fileName": "/tests/cases/fourslash/quickInfoDisplayPartsConst.ts", + "position": 316 + }, + "quickInfo": { + "kind": "const", + "kindModifiers": "", + "textSpan": { + "start": 316, + "length": 1 + }, + "displayParts": [ + { + "text": "const", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "h", + "kind": "localName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "{", + "kind": "punctuation" + }, + { + "text": "\n", + "kind": "lineBreak" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "(", + "kind": "punctuation" + }, + { + "text": "a", + "kind": "parameterName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "string", + "kind": "keyword" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "number", + "kind": "keyword" + }, + { + "text": ";", + "kind": "punctuation" + }, + { + "text": "\n", + "kind": "lineBreak" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "(", + "kind": "punctuation" + }, + { + "text": "a", + "kind": "parameterName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "number", + "kind": "keyword" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "string", + "kind": "keyword" + }, + { + "text": ";", + "kind": "punctuation" + }, + { + "text": "\n", + "kind": "lineBreak" + }, + { + "text": "}", + "kind": "punctuation" + } + ], + "documentation": [] + } + }, + { + "marker": { + "fileName": "/tests/cases/fourslash/quickInfoDisplayPartsConst.ts", + "position": 319 + }, + "quickInfo": { + "kind": "const", + "kindModifiers": "", + "textSpan": { + "start": 319, + "length": 1 + }, + "displayParts": [ + { + "text": "const", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "h", + "kind": "localName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "(", + "kind": "punctuation" + }, + { + "text": "a", + "kind": "parameterName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "number", + "kind": "keyword" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "=>", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "string", + "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": [] + } + }, + { + "marker": { + "fileName": "/tests/cases/fourslash/quickInfoDisplayPartsConst.ts", + "position": 326 + }, + "quickInfo": { + "kind": "const", + "kindModifiers": "", + "textSpan": { + "start": 326, + "length": 1 + }, + "displayParts": [ + { + "text": "const", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "h", + "kind": "localName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "(", + "kind": "punctuation" + }, + { + "text": "a", + "kind": "parameterName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "string", + "kind": "keyword" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "=>", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "number", + "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": [] + } + } +] \ No newline at end of file diff --git a/tests/baselines/reference/quickInfoDisplayPartsEnum1.baseline b/tests/baselines/reference/quickInfoDisplayPartsEnum1.baseline new file mode 100644 index 00000000000..142840b9f01 --- /dev/null +++ b/tests/baselines/reference/quickInfoDisplayPartsEnum1.baseline @@ -0,0 +1,1392 @@ +[ + { + "marker": { + "fileName": "/tests/cases/fourslash/quickInfoDisplayPartsEnum1.ts", + "position": 5 + }, + "quickInfo": { + "kind": "enum", + "kindModifiers": "", + "textSpan": { + "start": 5, + "length": 1 + }, + "displayParts": [ + { + "text": "enum", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "E", + "kind": "enumName" + } + ], + "documentation": [] + } + }, + { + "marker": { + "fileName": "/tests/cases/fourslash/quickInfoDisplayPartsEnum1.ts", + "position": 13 + }, + "quickInfo": { + "kind": "var", + "kindModifiers": "", + "textSpan": { + "start": 13, + "length": 2 + }, + "displayParts": [ + { + "text": "(", + "kind": "punctuation" + }, + { + "text": "enum member", + "kind": "text" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "E", + "kind": "enumName" + }, + { + "text": ".", + "kind": "punctuation" + }, + { + "text": "e1", + "kind": "enumMemberName" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "=", + "kind": "operator" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "0", + "kind": "numericLiteral" + } + ], + "documentation": [] + } + }, + { + "marker": { + "fileName": "/tests/cases/fourslash/quickInfoDisplayPartsEnum1.ts", + "position": 21 + }, + "quickInfo": { + "kind": "var", + "kindModifiers": "", + "textSpan": { + "start": 21, + "length": 2 + }, + "displayParts": [ + { + "text": "(", + "kind": "punctuation" + }, + { + "text": "enum member", + "kind": "text" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "E", + "kind": "enumName" + }, + { + "text": ".", + "kind": "punctuation" + }, + { + "text": "e2", + "kind": "enumMemberName" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "=", + "kind": "operator" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "10", + "kind": "numericLiteral" + } + ], + "documentation": [] + } + }, + { + "marker": { + "fileName": "/tests/cases/fourslash/quickInfoDisplayPartsEnum1.ts", + "position": 34 + }, + "quickInfo": { + "kind": "var", + "kindModifiers": "", + "textSpan": { + "start": 34, + "length": 2 + }, + "displayParts": [ + { + "text": "(", + "kind": "punctuation" + }, + { + "text": "enum member", + "kind": "text" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "E", + "kind": "enumName" + }, + { + "text": ".", + "kind": "punctuation" + }, + { + "text": "e3", + "kind": "enumMemberName" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "=", + "kind": "operator" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "11", + "kind": "numericLiteral" + } + ], + "documentation": [] + } + }, + { + "marker": { + "fileName": "/tests/cases/fourslash/quickInfoDisplayPartsEnum1.ts", + "position": 43 + }, + "quickInfo": { + "kind": "var", + "kindModifiers": "", + "textSpan": { + "start": 43, + "length": 9 + }, + "displayParts": [ + { + "text": "var", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "eInstance", + "kind": "localName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "E", + "kind": "enumName" + } + ], + "documentation": [] + } + }, + { + "marker": { + "fileName": "/tests/cases/fourslash/quickInfoDisplayPartsEnum1.ts", + "position": 54 + }, + "quickInfo": { + "kind": "enum", + "kindModifiers": "", + "textSpan": { + "start": 54, + "length": 1 + }, + "displayParts": [ + { + "text": "enum", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "E", + "kind": "enumName" + } + ], + "documentation": [] + } + }, + { + "marker": { + "fileName": "/tests/cases/fourslash/quickInfoDisplayPartsEnum1.ts", + "position": 57 + }, + "quickInfo": { + "kind": "var", + "kindModifiers": "", + "textSpan": { + "start": 57, + "length": 9 + }, + "displayParts": [ + { + "text": "var", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "eInstance", + "kind": "localName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "E", + "kind": "enumName" + } + ], + "documentation": [] + } + }, + { + "marker": { + "fileName": "/tests/cases/fourslash/quickInfoDisplayPartsEnum1.ts", + "position": 69 + }, + "quickInfo": { + "kind": "enum", + "kindModifiers": "", + "textSpan": { + "start": 69, + "length": 1 + }, + "displayParts": [ + { + "text": "enum", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "E", + "kind": "enumName" + } + ], + "documentation": [] + } + }, + { + "marker": { + "fileName": "/tests/cases/fourslash/quickInfoDisplayPartsEnum1.ts", + "position": 71 + }, + "quickInfo": { + "kind": "var", + "kindModifiers": "", + "textSpan": { + "start": 71, + "length": 2 + }, + "displayParts": [ + { + "text": "(", + "kind": "punctuation" + }, + { + "text": "enum member", + "kind": "text" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "E", + "kind": "enumName" + }, + { + "text": ".", + "kind": "punctuation" + }, + { + "text": "e1", + "kind": "enumMemberName" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "=", + "kind": "operator" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "0", + "kind": "numericLiteral" + } + ], + "documentation": [] + } + }, + { + "marker": { + "fileName": "/tests/cases/fourslash/quickInfoDisplayPartsEnum1.ts", + "position": 75 + }, + "quickInfo": { + "kind": "var", + "kindModifiers": "", + "textSpan": { + "start": 75, + "length": 9 + }, + "displayParts": [ + { + "text": "var", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "eInstance", + "kind": "localName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "E", + "kind": "enumName" + } + ], + "documentation": [] + } + }, + { + "marker": { + "fileName": "/tests/cases/fourslash/quickInfoDisplayPartsEnum1.ts", + "position": 87 + }, + "quickInfo": { + "kind": "enum", + "kindModifiers": "", + "textSpan": { + "start": 87, + "length": 1 + }, + "displayParts": [ + { + "text": "enum", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "E", + "kind": "enumName" + } + ], + "documentation": [] + } + }, + { + "marker": { + "fileName": "/tests/cases/fourslash/quickInfoDisplayPartsEnum1.ts", + "position": 89 + }, + "quickInfo": { + "kind": "var", + "kindModifiers": "", + "textSpan": { + "start": 89, + "length": 2 + }, + "displayParts": [ + { + "text": "(", + "kind": "punctuation" + }, + { + "text": "enum member", + "kind": "text" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "E", + "kind": "enumName" + }, + { + "text": ".", + "kind": "punctuation" + }, + { + "text": "e2", + "kind": "enumMemberName" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "=", + "kind": "operator" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "10", + "kind": "numericLiteral" + } + ], + "documentation": [] + } + }, + { + "marker": { + "fileName": "/tests/cases/fourslash/quickInfoDisplayPartsEnum1.ts", + "position": 93 + }, + "quickInfo": { + "kind": "var", + "kindModifiers": "", + "textSpan": { + "start": 93, + "length": 9 + }, + "displayParts": [ + { + "text": "var", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "eInstance", + "kind": "localName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "E", + "kind": "enumName" + } + ], + "documentation": [] + } + }, + { + "marker": { + "fileName": "/tests/cases/fourslash/quickInfoDisplayPartsEnum1.ts", + "position": 105 + }, + "quickInfo": { + "kind": "enum", + "kindModifiers": "", + "textSpan": { + "start": 105, + "length": 1 + }, + "displayParts": [ + { + "text": "enum", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "E", + "kind": "enumName" + } + ], + "documentation": [] + } + }, + { + "marker": { + "fileName": "/tests/cases/fourslash/quickInfoDisplayPartsEnum1.ts", + "position": 107 + }, + "quickInfo": { + "kind": "var", + "kindModifiers": "", + "textSpan": { + "start": 107, + "length": 2 + }, + "displayParts": [ + { + "text": "(", + "kind": "punctuation" + }, + { + "text": "enum member", + "kind": "text" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "E", + "kind": "enumName" + }, + { + "text": ".", + "kind": "punctuation" + }, + { + "text": "e3", + "kind": "enumMemberName" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "=", + "kind": "operator" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "11", + "kind": "numericLiteral" + } + ], + "documentation": [] + } + }, + { + "marker": { + "fileName": "/tests/cases/fourslash/quickInfoDisplayPartsEnum1.ts", + "position": 122 + }, + "quickInfo": { + "kind": "enum", + "kindModifiers": "", + "textSpan": { + "start": 122, + "length": 6 + }, + "displayParts": [ + { + "text": "const", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "enum", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "constE", + "kind": "enumName" + } + ], + "documentation": [] + } + }, + { + "marker": { + "fileName": "/tests/cases/fourslash/quickInfoDisplayPartsEnum1.ts", + "position": 135 + }, + "quickInfo": { + "kind": "var", + "kindModifiers": "", + "textSpan": { + "start": 135, + "length": 2 + }, + "displayParts": [ + { + "text": "(", + "kind": "punctuation" + }, + { + "text": "enum member", + "kind": "text" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "constE", + "kind": "enumName" + }, + { + "text": ".", + "kind": "punctuation" + }, + { + "text": "e1", + "kind": "enumMemberName" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "=", + "kind": "operator" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "0", + "kind": "numericLiteral" + } + ], + "documentation": [] + } + }, + { + "marker": { + "fileName": "/tests/cases/fourslash/quickInfoDisplayPartsEnum1.ts", + "position": 143 + }, + "quickInfo": { + "kind": "var", + "kindModifiers": "", + "textSpan": { + "start": 143, + "length": 2 + }, + "displayParts": [ + { + "text": "(", + "kind": "punctuation" + }, + { + "text": "enum member", + "kind": "text" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "constE", + "kind": "enumName" + }, + { + "text": ".", + "kind": "punctuation" + }, + { + "text": "e2", + "kind": "enumMemberName" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "=", + "kind": "operator" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "10", + "kind": "numericLiteral" + } + ], + "documentation": [] + } + }, + { + "marker": { + "fileName": "/tests/cases/fourslash/quickInfoDisplayPartsEnum1.ts", + "position": 156 + }, + "quickInfo": { + "kind": "var", + "kindModifiers": "", + "textSpan": { + "start": 156, + "length": 2 + }, + "displayParts": [ + { + "text": "(", + "kind": "punctuation" + }, + { + "text": "enum member", + "kind": "text" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "constE", + "kind": "enumName" + }, + { + "text": ".", + "kind": "punctuation" + }, + { + "text": "e3", + "kind": "enumMemberName" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "=", + "kind": "operator" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "11", + "kind": "numericLiteral" + } + ], + "documentation": [] + } + }, + { + "marker": { + "fileName": "/tests/cases/fourslash/quickInfoDisplayPartsEnum1.ts", + "position": 165 + }, + "quickInfo": { + "kind": "var", + "kindModifiers": "", + "textSpan": { + "start": 165, + "length": 10 + }, + "displayParts": [ + { + "text": "var", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "eInstance1", + "kind": "localName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "constE", + "kind": "enumName" + } + ], + "documentation": [] + } + }, + { + "marker": { + "fileName": "/tests/cases/fourslash/quickInfoDisplayPartsEnum1.ts", + "position": 177 + }, + "quickInfo": { + "kind": "enum", + "kindModifiers": "", + "textSpan": { + "start": 177, + "length": 6 + }, + "displayParts": [ + { + "text": "const", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "enum", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "constE", + "kind": "enumName" + } + ], + "documentation": [] + } + }, + { + "marker": { + "fileName": "/tests/cases/fourslash/quickInfoDisplayPartsEnum1.ts", + "position": 185 + }, + "quickInfo": { + "kind": "var", + "kindModifiers": "", + "textSpan": { + "start": 185, + "length": 10 + }, + "displayParts": [ + { + "text": "var", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "eInstance1", + "kind": "localName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "constE", + "kind": "enumName" + } + ], + "documentation": [] + } + }, + { + "marker": { + "fileName": "/tests/cases/fourslash/quickInfoDisplayPartsEnum1.ts", + "position": 198 + }, + "quickInfo": { + "kind": "enum", + "kindModifiers": "", + "textSpan": { + "start": 198, + "length": 6 + }, + "displayParts": [ + { + "text": "const", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "enum", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "constE", + "kind": "enumName" + } + ], + "documentation": [] + } + }, + { + "marker": { + "fileName": "/tests/cases/fourslash/quickInfoDisplayPartsEnum1.ts", + "position": 205 + }, + "quickInfo": { + "kind": "var", + "kindModifiers": "", + "textSpan": { + "start": 205, + "length": 2 + }, + "displayParts": [ + { + "text": "(", + "kind": "punctuation" + }, + { + "text": "enum member", + "kind": "text" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "constE", + "kind": "enumName" + }, + { + "text": ".", + "kind": "punctuation" + }, + { + "text": "e1", + "kind": "enumMemberName" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "=", + "kind": "operator" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "0", + "kind": "numericLiteral" + } + ], + "documentation": [] + } + }, + { + "marker": { + "fileName": "/tests/cases/fourslash/quickInfoDisplayPartsEnum1.ts", + "position": 209 + }, + "quickInfo": { + "kind": "var", + "kindModifiers": "", + "textSpan": { + "start": 209, + "length": 10 + }, + "displayParts": [ + { + "text": "var", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "eInstance1", + "kind": "localName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "constE", + "kind": "enumName" + } + ], + "documentation": [] + } + }, + { + "marker": { + "fileName": "/tests/cases/fourslash/quickInfoDisplayPartsEnum1.ts", + "position": 222 + }, + "quickInfo": { + "kind": "enum", + "kindModifiers": "", + "textSpan": { + "start": 222, + "length": 6 + }, + "displayParts": [ + { + "text": "const", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "enum", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "constE", + "kind": "enumName" + } + ], + "documentation": [] + } + }, + { + "marker": { + "fileName": "/tests/cases/fourslash/quickInfoDisplayPartsEnum1.ts", + "position": 229 + }, + "quickInfo": { + "kind": "var", + "kindModifiers": "", + "textSpan": { + "start": 229, + "length": 2 + }, + "displayParts": [ + { + "text": "(", + "kind": "punctuation" + }, + { + "text": "enum member", + "kind": "text" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "constE", + "kind": "enumName" + }, + { + "text": ".", + "kind": "punctuation" + }, + { + "text": "e2", + "kind": "enumMemberName" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "=", + "kind": "operator" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "10", + "kind": "numericLiteral" + } + ], + "documentation": [] + } + }, + { + "marker": { + "fileName": "/tests/cases/fourslash/quickInfoDisplayPartsEnum1.ts", + "position": 233 + }, + "quickInfo": { + "kind": "var", + "kindModifiers": "", + "textSpan": { + "start": 233, + "length": 10 + }, + "displayParts": [ + { + "text": "var", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "eInstance1", + "kind": "localName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "constE", + "kind": "enumName" + } + ], + "documentation": [] + } + }, + { + "marker": { + "fileName": "/tests/cases/fourslash/quickInfoDisplayPartsEnum1.ts", + "position": 246 + }, + "quickInfo": { + "kind": "enum", + "kindModifiers": "", + "textSpan": { + "start": 246, + "length": 6 + }, + "displayParts": [ + { + "text": "const", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "enum", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "constE", + "kind": "enumName" + } + ], + "documentation": [] + } + }, + { + "marker": { + "fileName": "/tests/cases/fourslash/quickInfoDisplayPartsEnum1.ts", + "position": 253 + }, + "quickInfo": { + "kind": "var", + "kindModifiers": "", + "textSpan": { + "start": 253, + "length": 2 + }, + "displayParts": [ + { + "text": "(", + "kind": "punctuation" + }, + { + "text": "enum member", + "kind": "text" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "constE", + "kind": "enumName" + }, + { + "text": ".", + "kind": "punctuation" + }, + { + "text": "e3", + "kind": "enumMemberName" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "=", + "kind": "operator" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "11", + "kind": "numericLiteral" + } + ], + "documentation": [] + } + } +] \ No newline at end of file diff --git a/tests/baselines/reference/quickInfoDisplayPartsEnum2.baseline b/tests/baselines/reference/quickInfoDisplayPartsEnum2.baseline new file mode 100644 index 00000000000..efdff818b0f --- /dev/null +++ b/tests/baselines/reference/quickInfoDisplayPartsEnum2.baseline @@ -0,0 +1,1440 @@ +[ + { + "marker": { + "fileName": "/tests/cases/fourslash/quickInfoDisplayPartsEnum2.ts", + "position": 5 + }, + "quickInfo": { + "kind": "enum", + "kindModifiers": "", + "textSpan": { + "start": 5, + "length": 1 + }, + "displayParts": [ + { + "text": "enum", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "E", + "kind": "enumName" + } + ], + "documentation": [] + } + }, + { + "marker": { + "fileName": "/tests/cases/fourslash/quickInfoDisplayPartsEnum2.ts", + "position": 13 + }, + "quickInfo": { + "kind": "var", + "kindModifiers": "", + "textSpan": { + "start": 13, + "length": 4 + }, + "displayParts": [ + { + "text": "(", + "kind": "punctuation" + }, + { + "text": "enum member", + "kind": "text" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "E", + "kind": "enumName" + }, + { + "text": "[", + "kind": "punctuation" + }, + { + "text": "\"e1\"", + "kind": "stringLiteral" + }, + { + "text": "]", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "=", + "kind": "operator" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "0", + "kind": "numericLiteral" + } + ], + "documentation": [] + } + }, + { + "marker": { + "fileName": "/tests/cases/fourslash/quickInfoDisplayPartsEnum2.ts", + "position": 23 + }, + "quickInfo": { + "kind": "var", + "kindModifiers": "", + "textSpan": { + "start": 23, + "length": 4 + }, + "displayParts": [ + { + "text": "(", + "kind": "punctuation" + }, + { + "text": "enum member", + "kind": "text" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "E", + "kind": "enumName" + }, + { + "text": "[", + "kind": "punctuation" + }, + { + "text": "'e2'", + "kind": "stringLiteral" + }, + { + "text": "]", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "=", + "kind": "operator" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "10", + "kind": "numericLiteral" + } + ], + "documentation": [] + } + }, + { + "marker": { + "fileName": "/tests/cases/fourslash/quickInfoDisplayPartsEnum2.ts", + "position": 38 + }, + "quickInfo": { + "kind": "var", + "kindModifiers": "", + "textSpan": { + "start": 38, + "length": 4 + }, + "displayParts": [ + { + "text": "(", + "kind": "punctuation" + }, + { + "text": "enum member", + "kind": "text" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "E", + "kind": "enumName" + }, + { + "text": "[", + "kind": "punctuation" + }, + { + "text": "\"e3\"", + "kind": "stringLiteral" + }, + { + "text": "]", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "=", + "kind": "operator" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "11", + "kind": "numericLiteral" + } + ], + "documentation": [] + } + }, + { + "marker": { + "fileName": "/tests/cases/fourslash/quickInfoDisplayPartsEnum2.ts", + "position": 49 + }, + "quickInfo": { + "kind": "var", + "kindModifiers": "", + "textSpan": { + "start": 49, + "length": 9 + }, + "displayParts": [ + { + "text": "var", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "eInstance", + "kind": "localName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "E", + "kind": "enumName" + } + ], + "documentation": [] + } + }, + { + "marker": { + "fileName": "/tests/cases/fourslash/quickInfoDisplayPartsEnum2.ts", + "position": 60 + }, + "quickInfo": { + "kind": "enum", + "kindModifiers": "", + "textSpan": { + "start": 60, + "length": 1 + }, + "displayParts": [ + { + "text": "enum", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "E", + "kind": "enumName" + } + ], + "documentation": [] + } + }, + { + "marker": { + "fileName": "/tests/cases/fourslash/quickInfoDisplayPartsEnum2.ts", + "position": 63 + }, + "quickInfo": { + "kind": "var", + "kindModifiers": "", + "textSpan": { + "start": 63, + "length": 9 + }, + "displayParts": [ + { + "text": "var", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "eInstance", + "kind": "localName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "E", + "kind": "enumName" + } + ], + "documentation": [] + } + }, + { + "marker": { + "fileName": "/tests/cases/fourslash/quickInfoDisplayPartsEnum2.ts", + "position": 75 + }, + "quickInfo": { + "kind": "enum", + "kindModifiers": "", + "textSpan": { + "start": 75, + "length": 1 + }, + "displayParts": [ + { + "text": "enum", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "E", + "kind": "enumName" + } + ], + "documentation": [] + } + }, + { + "marker": { + "fileName": "/tests/cases/fourslash/quickInfoDisplayPartsEnum2.ts", + "position": 77 + }, + "quickInfo": { + "kind": "var", + "kindModifiers": "", + "textSpan": { + "start": 77, + "length": 2 + }, + "displayParts": [ + { + "text": "(", + "kind": "punctuation" + }, + { + "text": "enum member", + "kind": "text" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "E", + "kind": "enumName" + }, + { + "text": "[", + "kind": "punctuation" + }, + { + "text": "\"e1\"", + "kind": "stringLiteral" + }, + { + "text": "]", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "=", + "kind": "operator" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "0", + "kind": "numericLiteral" + } + ], + "documentation": [] + } + }, + { + "marker": { + "fileName": "/tests/cases/fourslash/quickInfoDisplayPartsEnum2.ts", + "position": 81 + }, + "quickInfo": { + "kind": "var", + "kindModifiers": "", + "textSpan": { + "start": 81, + "length": 9 + }, + "displayParts": [ + { + "text": "var", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "eInstance", + "kind": "localName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "E", + "kind": "enumName" + } + ], + "documentation": [] + } + }, + { + "marker": { + "fileName": "/tests/cases/fourslash/quickInfoDisplayPartsEnum2.ts", + "position": 93 + }, + "quickInfo": { + "kind": "enum", + "kindModifiers": "", + "textSpan": { + "start": 93, + "length": 1 + }, + "displayParts": [ + { + "text": "enum", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "E", + "kind": "enumName" + } + ], + "documentation": [] + } + }, + { + "marker": { + "fileName": "/tests/cases/fourslash/quickInfoDisplayPartsEnum2.ts", + "position": 95 + }, + "quickInfo": { + "kind": "var", + "kindModifiers": "", + "textSpan": { + "start": 95, + "length": 2 + }, + "displayParts": [ + { + "text": "(", + "kind": "punctuation" + }, + { + "text": "enum member", + "kind": "text" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "E", + "kind": "enumName" + }, + { + "text": "[", + "kind": "punctuation" + }, + { + "text": "'e2'", + "kind": "stringLiteral" + }, + { + "text": "]", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "=", + "kind": "operator" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "10", + "kind": "numericLiteral" + } + ], + "documentation": [] + } + }, + { + "marker": { + "fileName": "/tests/cases/fourslash/quickInfoDisplayPartsEnum2.ts", + "position": 99 + }, + "quickInfo": { + "kind": "var", + "kindModifiers": "", + "textSpan": { + "start": 99, + "length": 9 + }, + "displayParts": [ + { + "text": "var", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "eInstance", + "kind": "localName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "E", + "kind": "enumName" + } + ], + "documentation": [] + } + }, + { + "marker": { + "fileName": "/tests/cases/fourslash/quickInfoDisplayPartsEnum2.ts", + "position": 111 + }, + "quickInfo": { + "kind": "enum", + "kindModifiers": "", + "textSpan": { + "start": 111, + "length": 1 + }, + "displayParts": [ + { + "text": "enum", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "E", + "kind": "enumName" + } + ], + "documentation": [] + } + }, + { + "marker": { + "fileName": "/tests/cases/fourslash/quickInfoDisplayPartsEnum2.ts", + "position": 113 + }, + "quickInfo": { + "kind": "var", + "kindModifiers": "", + "textSpan": { + "start": 113, + "length": 2 + }, + "displayParts": [ + { + "text": "(", + "kind": "punctuation" + }, + { + "text": "enum member", + "kind": "text" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "E", + "kind": "enumName" + }, + { + "text": "[", + "kind": "punctuation" + }, + { + "text": "\"e3\"", + "kind": "stringLiteral" + }, + { + "text": "]", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "=", + "kind": "operator" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "11", + "kind": "numericLiteral" + } + ], + "documentation": [] + } + }, + { + "marker": { + "fileName": "/tests/cases/fourslash/quickInfoDisplayPartsEnum2.ts", + "position": 128 + }, + "quickInfo": { + "kind": "enum", + "kindModifiers": "", + "textSpan": { + "start": 128, + "length": 6 + }, + "displayParts": [ + { + "text": "const", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "enum", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "constE", + "kind": "enumName" + } + ], + "documentation": [] + } + }, + { + "marker": { + "fileName": "/tests/cases/fourslash/quickInfoDisplayPartsEnum2.ts", + "position": 141 + }, + "quickInfo": { + "kind": "var", + "kindModifiers": "", + "textSpan": { + "start": 141, + "length": 4 + }, + "displayParts": [ + { + "text": "(", + "kind": "punctuation" + }, + { + "text": "enum member", + "kind": "text" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "constE", + "kind": "enumName" + }, + { + "text": "[", + "kind": "punctuation" + }, + { + "text": "\"e1\"", + "kind": "stringLiteral" + }, + { + "text": "]", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "=", + "kind": "operator" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "0", + "kind": "numericLiteral" + } + ], + "documentation": [] + } + }, + { + "marker": { + "fileName": "/tests/cases/fourslash/quickInfoDisplayPartsEnum2.ts", + "position": 151 + }, + "quickInfo": { + "kind": "var", + "kindModifiers": "", + "textSpan": { + "start": 151, + "length": 4 + }, + "displayParts": [ + { + "text": "(", + "kind": "punctuation" + }, + { + "text": "enum member", + "kind": "text" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "constE", + "kind": "enumName" + }, + { + "text": "[", + "kind": "punctuation" + }, + { + "text": "'e2'", + "kind": "stringLiteral" + }, + { + "text": "]", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "=", + "kind": "operator" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "10", + "kind": "numericLiteral" + } + ], + "documentation": [] + } + }, + { + "marker": { + "fileName": "/tests/cases/fourslash/quickInfoDisplayPartsEnum2.ts", + "position": 166 + }, + "quickInfo": { + "kind": "var", + "kindModifiers": "", + "textSpan": { + "start": 166, + "length": 4 + }, + "displayParts": [ + { + "text": "(", + "kind": "punctuation" + }, + { + "text": "enum member", + "kind": "text" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "constE", + "kind": "enumName" + }, + { + "text": "[", + "kind": "punctuation" + }, + { + "text": "\"e3\"", + "kind": "stringLiteral" + }, + { + "text": "]", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "=", + "kind": "operator" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "11", + "kind": "numericLiteral" + } + ], + "documentation": [] + } + }, + { + "marker": { + "fileName": "/tests/cases/fourslash/quickInfoDisplayPartsEnum2.ts", + "position": 177 + }, + "quickInfo": { + "kind": "var", + "kindModifiers": "", + "textSpan": { + "start": 177, + "length": 10 + }, + "displayParts": [ + { + "text": "var", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "eInstance1", + "kind": "localName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "constE", + "kind": "enumName" + } + ], + "documentation": [] + } + }, + { + "marker": { + "fileName": "/tests/cases/fourslash/quickInfoDisplayPartsEnum2.ts", + "position": 189 + }, + "quickInfo": { + "kind": "enum", + "kindModifiers": "", + "textSpan": { + "start": 189, + "length": 6 + }, + "displayParts": [ + { + "text": "const", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "enum", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "constE", + "kind": "enumName" + } + ], + "documentation": [] + } + }, + { + "marker": { + "fileName": "/tests/cases/fourslash/quickInfoDisplayPartsEnum2.ts", + "position": 197 + }, + "quickInfo": { + "kind": "var", + "kindModifiers": "", + "textSpan": { + "start": 197, + "length": 10 + }, + "displayParts": [ + { + "text": "var", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "eInstance1", + "kind": "localName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "constE", + "kind": "enumName" + } + ], + "documentation": [] + } + }, + { + "marker": { + "fileName": "/tests/cases/fourslash/quickInfoDisplayPartsEnum2.ts", + "position": 210 + }, + "quickInfo": { + "kind": "enum", + "kindModifiers": "", + "textSpan": { + "start": 210, + "length": 6 + }, + "displayParts": [ + { + "text": "const", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "enum", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "constE", + "kind": "enumName" + } + ], + "documentation": [] + } + }, + { + "marker": { + "fileName": "/tests/cases/fourslash/quickInfoDisplayPartsEnum2.ts", + "position": 217 + }, + "quickInfo": { + "kind": "var", + "kindModifiers": "", + "textSpan": { + "start": 217, + "length": 2 + }, + "displayParts": [ + { + "text": "(", + "kind": "punctuation" + }, + { + "text": "enum member", + "kind": "text" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "constE", + "kind": "enumName" + }, + { + "text": "[", + "kind": "punctuation" + }, + { + "text": "\"e1\"", + "kind": "stringLiteral" + }, + { + "text": "]", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "=", + "kind": "operator" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "0", + "kind": "numericLiteral" + } + ], + "documentation": [] + } + }, + { + "marker": { + "fileName": "/tests/cases/fourslash/quickInfoDisplayPartsEnum2.ts", + "position": 221 + }, + "quickInfo": { + "kind": "var", + "kindModifiers": "", + "textSpan": { + "start": 221, + "length": 10 + }, + "displayParts": [ + { + "text": "var", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "eInstance1", + "kind": "localName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "constE", + "kind": "enumName" + } + ], + "documentation": [] + } + }, + { + "marker": { + "fileName": "/tests/cases/fourslash/quickInfoDisplayPartsEnum2.ts", + "position": 234 + }, + "quickInfo": { + "kind": "enum", + "kindModifiers": "", + "textSpan": { + "start": 234, + "length": 6 + }, + "displayParts": [ + { + "text": "const", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "enum", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "constE", + "kind": "enumName" + } + ], + "documentation": [] + } + }, + { + "marker": { + "fileName": "/tests/cases/fourslash/quickInfoDisplayPartsEnum2.ts", + "position": 241 + }, + "quickInfo": { + "kind": "var", + "kindModifiers": "", + "textSpan": { + "start": 241, + "length": 2 + }, + "displayParts": [ + { + "text": "(", + "kind": "punctuation" + }, + { + "text": "enum member", + "kind": "text" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "constE", + "kind": "enumName" + }, + { + "text": "[", + "kind": "punctuation" + }, + { + "text": "'e2'", + "kind": "stringLiteral" + }, + { + "text": "]", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "=", + "kind": "operator" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "10", + "kind": "numericLiteral" + } + ], + "documentation": [] + } + }, + { + "marker": { + "fileName": "/tests/cases/fourslash/quickInfoDisplayPartsEnum2.ts", + "position": 245 + }, + "quickInfo": { + "kind": "var", + "kindModifiers": "", + "textSpan": { + "start": 245, + "length": 10 + }, + "displayParts": [ + { + "text": "var", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "eInstance1", + "kind": "localName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "constE", + "kind": "enumName" + } + ], + "documentation": [] + } + }, + { + "marker": { + "fileName": "/tests/cases/fourslash/quickInfoDisplayPartsEnum2.ts", + "position": 258 + }, + "quickInfo": { + "kind": "enum", + "kindModifiers": "", + "textSpan": { + "start": 258, + "length": 6 + }, + "displayParts": [ + { + "text": "const", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "enum", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "constE", + "kind": "enumName" + } + ], + "documentation": [] + } + }, + { + "marker": { + "fileName": "/tests/cases/fourslash/quickInfoDisplayPartsEnum2.ts", + "position": 265 + }, + "quickInfo": { + "kind": "var", + "kindModifiers": "", + "textSpan": { + "start": 265, + "length": 2 + }, + "displayParts": [ + { + "text": "(", + "kind": "punctuation" + }, + { + "text": "enum member", + "kind": "text" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "constE", + "kind": "enumName" + }, + { + "text": "[", + "kind": "punctuation" + }, + { + "text": "\"e3\"", + "kind": "stringLiteral" + }, + { + "text": "]", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "=", + "kind": "operator" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "11", + "kind": "numericLiteral" + } + ], + "documentation": [] + } + } +] \ No newline at end of file diff --git a/tests/baselines/reference/quickInfoDisplayPartsEnum3.baseline b/tests/baselines/reference/quickInfoDisplayPartsEnum3.baseline new file mode 100644 index 00000000000..919816394e2 --- /dev/null +++ b/tests/baselines/reference/quickInfoDisplayPartsEnum3.baseline @@ -0,0 +1,1440 @@ +[ + { + "marker": { + "fileName": "/tests/cases/fourslash/quickInfoDisplayPartsEnum3.ts", + "position": 5 + }, + "quickInfo": { + "kind": "enum", + "kindModifiers": "", + "textSpan": { + "start": 5, + "length": 1 + }, + "displayParts": [ + { + "text": "enum", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "E", + "kind": "enumName" + } + ], + "documentation": [] + } + }, + { + "marker": { + "fileName": "/tests/cases/fourslash/quickInfoDisplayPartsEnum3.ts", + "position": 13 + }, + "quickInfo": { + "kind": "var", + "kindModifiers": "", + "textSpan": { + "start": 13, + "length": 4 + }, + "displayParts": [ + { + "text": "(", + "kind": "punctuation" + }, + { + "text": "enum member", + "kind": "text" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "E", + "kind": "enumName" + }, + { + "text": "[", + "kind": "punctuation" + }, + { + "text": "\"e1\"", + "kind": "stringLiteral" + }, + { + "text": "]", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "=", + "kind": "operator" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "0", + "kind": "numericLiteral" + } + ], + "documentation": [] + } + }, + { + "marker": { + "fileName": "/tests/cases/fourslash/quickInfoDisplayPartsEnum3.ts", + "position": 23 + }, + "quickInfo": { + "kind": "var", + "kindModifiers": "", + "textSpan": { + "start": 23, + "length": 4 + }, + "displayParts": [ + { + "text": "(", + "kind": "punctuation" + }, + { + "text": "enum member", + "kind": "text" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "E", + "kind": "enumName" + }, + { + "text": "[", + "kind": "punctuation" + }, + { + "text": "'e2'", + "kind": "stringLiteral" + }, + { + "text": "]", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "=", + "kind": "operator" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "10", + "kind": "numericLiteral" + } + ], + "documentation": [] + } + }, + { + "marker": { + "fileName": "/tests/cases/fourslash/quickInfoDisplayPartsEnum3.ts", + "position": 38 + }, + "quickInfo": { + "kind": "var", + "kindModifiers": "", + "textSpan": { + "start": 38, + "length": 4 + }, + "displayParts": [ + { + "text": "(", + "kind": "punctuation" + }, + { + "text": "enum member", + "kind": "text" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "E", + "kind": "enumName" + }, + { + "text": "[", + "kind": "punctuation" + }, + { + "text": "\"e3\"", + "kind": "stringLiteral" + }, + { + "text": "]", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "=", + "kind": "operator" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "11", + "kind": "numericLiteral" + } + ], + "documentation": [] + } + }, + { + "marker": { + "fileName": "/tests/cases/fourslash/quickInfoDisplayPartsEnum3.ts", + "position": 49 + }, + "quickInfo": { + "kind": "var", + "kindModifiers": "", + "textSpan": { + "start": 49, + "length": 9 + }, + "displayParts": [ + { + "text": "var", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "eInstance", + "kind": "localName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "E", + "kind": "enumName" + } + ], + "documentation": [] + } + }, + { + "marker": { + "fileName": "/tests/cases/fourslash/quickInfoDisplayPartsEnum3.ts", + "position": 60 + }, + "quickInfo": { + "kind": "enum", + "kindModifiers": "", + "textSpan": { + "start": 60, + "length": 1 + }, + "displayParts": [ + { + "text": "enum", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "E", + "kind": "enumName" + } + ], + "documentation": [] + } + }, + { + "marker": { + "fileName": "/tests/cases/fourslash/quickInfoDisplayPartsEnum3.ts", + "position": 63 + }, + "quickInfo": { + "kind": "var", + "kindModifiers": "", + "textSpan": { + "start": 63, + "length": 9 + }, + "displayParts": [ + { + "text": "var", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "eInstance", + "kind": "localName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "E", + "kind": "enumName" + } + ], + "documentation": [] + } + }, + { + "marker": { + "fileName": "/tests/cases/fourslash/quickInfoDisplayPartsEnum3.ts", + "position": 75 + }, + "quickInfo": { + "kind": "enum", + "kindModifiers": "", + "textSpan": { + "start": 75, + "length": 1 + }, + "displayParts": [ + { + "text": "enum", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "E", + "kind": "enumName" + } + ], + "documentation": [] + } + }, + { + "marker": { + "fileName": "/tests/cases/fourslash/quickInfoDisplayPartsEnum3.ts", + "position": 77 + }, + "quickInfo": { + "kind": "var", + "kindModifiers": "", + "textSpan": { + "start": 77, + "length": 4 + }, + "displayParts": [ + { + "text": "(", + "kind": "punctuation" + }, + { + "text": "enum member", + "kind": "text" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "E", + "kind": "enumName" + }, + { + "text": "[", + "kind": "punctuation" + }, + { + "text": "\"e1\"", + "kind": "stringLiteral" + }, + { + "text": "]", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "=", + "kind": "operator" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "0", + "kind": "numericLiteral" + } + ], + "documentation": [] + } + }, + { + "marker": { + "fileName": "/tests/cases/fourslash/quickInfoDisplayPartsEnum3.ts", + "position": 84 + }, + "quickInfo": { + "kind": "var", + "kindModifiers": "", + "textSpan": { + "start": 84, + "length": 9 + }, + "displayParts": [ + { + "text": "var", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "eInstance", + "kind": "localName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "E", + "kind": "enumName" + } + ], + "documentation": [] + } + }, + { + "marker": { + "fileName": "/tests/cases/fourslash/quickInfoDisplayPartsEnum3.ts", + "position": 96 + }, + "quickInfo": { + "kind": "enum", + "kindModifiers": "", + "textSpan": { + "start": 96, + "length": 1 + }, + "displayParts": [ + { + "text": "enum", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "E", + "kind": "enumName" + } + ], + "documentation": [] + } + }, + { + "marker": { + "fileName": "/tests/cases/fourslash/quickInfoDisplayPartsEnum3.ts", + "position": 98 + }, + "quickInfo": { + "kind": "var", + "kindModifiers": "", + "textSpan": { + "start": 98, + "length": 4 + }, + "displayParts": [ + { + "text": "(", + "kind": "punctuation" + }, + { + "text": "enum member", + "kind": "text" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "E", + "kind": "enumName" + }, + { + "text": "[", + "kind": "punctuation" + }, + { + "text": "'e2'", + "kind": "stringLiteral" + }, + { + "text": "]", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "=", + "kind": "operator" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "10", + "kind": "numericLiteral" + } + ], + "documentation": [] + } + }, + { + "marker": { + "fileName": "/tests/cases/fourslash/quickInfoDisplayPartsEnum3.ts", + "position": 105 + }, + "quickInfo": { + "kind": "var", + "kindModifiers": "", + "textSpan": { + "start": 105, + "length": 9 + }, + "displayParts": [ + { + "text": "var", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "eInstance", + "kind": "localName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "E", + "kind": "enumName" + } + ], + "documentation": [] + } + }, + { + "marker": { + "fileName": "/tests/cases/fourslash/quickInfoDisplayPartsEnum3.ts", + "position": 117 + }, + "quickInfo": { + "kind": "enum", + "kindModifiers": "", + "textSpan": { + "start": 117, + "length": 1 + }, + "displayParts": [ + { + "text": "enum", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "E", + "kind": "enumName" + } + ], + "documentation": [] + } + }, + { + "marker": { + "fileName": "/tests/cases/fourslash/quickInfoDisplayPartsEnum3.ts", + "position": 119 + }, + "quickInfo": { + "kind": "var", + "kindModifiers": "", + "textSpan": { + "start": 119, + "length": 4 + }, + "displayParts": [ + { + "text": "(", + "kind": "punctuation" + }, + { + "text": "enum member", + "kind": "text" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "E", + "kind": "enumName" + }, + { + "text": "[", + "kind": "punctuation" + }, + { + "text": "\"e3\"", + "kind": "stringLiteral" + }, + { + "text": "]", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "=", + "kind": "operator" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "11", + "kind": "numericLiteral" + } + ], + "documentation": [] + } + }, + { + "marker": { + "fileName": "/tests/cases/fourslash/quickInfoDisplayPartsEnum3.ts", + "position": 137 + }, + "quickInfo": { + "kind": "enum", + "kindModifiers": "", + "textSpan": { + "start": 137, + "length": 6 + }, + "displayParts": [ + { + "text": "const", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "enum", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "constE", + "kind": "enumName" + } + ], + "documentation": [] + } + }, + { + "marker": { + "fileName": "/tests/cases/fourslash/quickInfoDisplayPartsEnum3.ts", + "position": 150 + }, + "quickInfo": { + "kind": "var", + "kindModifiers": "", + "textSpan": { + "start": 150, + "length": 4 + }, + "displayParts": [ + { + "text": "(", + "kind": "punctuation" + }, + { + "text": "enum member", + "kind": "text" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "constE", + "kind": "enumName" + }, + { + "text": "[", + "kind": "punctuation" + }, + { + "text": "\"e1\"", + "kind": "stringLiteral" + }, + { + "text": "]", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "=", + "kind": "operator" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "0", + "kind": "numericLiteral" + } + ], + "documentation": [] + } + }, + { + "marker": { + "fileName": "/tests/cases/fourslash/quickInfoDisplayPartsEnum3.ts", + "position": 160 + }, + "quickInfo": { + "kind": "var", + "kindModifiers": "", + "textSpan": { + "start": 160, + "length": 4 + }, + "displayParts": [ + { + "text": "(", + "kind": "punctuation" + }, + { + "text": "enum member", + "kind": "text" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "constE", + "kind": "enumName" + }, + { + "text": "[", + "kind": "punctuation" + }, + { + "text": "'e2'", + "kind": "stringLiteral" + }, + { + "text": "]", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "=", + "kind": "operator" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "10", + "kind": "numericLiteral" + } + ], + "documentation": [] + } + }, + { + "marker": { + "fileName": "/tests/cases/fourslash/quickInfoDisplayPartsEnum3.ts", + "position": 175 + }, + "quickInfo": { + "kind": "var", + "kindModifiers": "", + "textSpan": { + "start": 175, + "length": 4 + }, + "displayParts": [ + { + "text": "(", + "kind": "punctuation" + }, + { + "text": "enum member", + "kind": "text" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "constE", + "kind": "enumName" + }, + { + "text": "[", + "kind": "punctuation" + }, + { + "text": "\"e3\"", + "kind": "stringLiteral" + }, + { + "text": "]", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "=", + "kind": "operator" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "11", + "kind": "numericLiteral" + } + ], + "documentation": [] + } + }, + { + "marker": { + "fileName": "/tests/cases/fourslash/quickInfoDisplayPartsEnum3.ts", + "position": 186 + }, + "quickInfo": { + "kind": "var", + "kindModifiers": "", + "textSpan": { + "start": 186, + "length": 10 + }, + "displayParts": [ + { + "text": "var", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "eInstance1", + "kind": "localName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "constE", + "kind": "enumName" + } + ], + "documentation": [] + } + }, + { + "marker": { + "fileName": "/tests/cases/fourslash/quickInfoDisplayPartsEnum3.ts", + "position": 198 + }, + "quickInfo": { + "kind": "enum", + "kindModifiers": "", + "textSpan": { + "start": 198, + "length": 6 + }, + "displayParts": [ + { + "text": "const", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "enum", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "constE", + "kind": "enumName" + } + ], + "documentation": [] + } + }, + { + "marker": { + "fileName": "/tests/cases/fourslash/quickInfoDisplayPartsEnum3.ts", + "position": 206 + }, + "quickInfo": { + "kind": "var", + "kindModifiers": "", + "textSpan": { + "start": 206, + "length": 10 + }, + "displayParts": [ + { + "text": "var", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "eInstance1", + "kind": "localName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "constE", + "kind": "enumName" + } + ], + "documentation": [] + } + }, + { + "marker": { + "fileName": "/tests/cases/fourslash/quickInfoDisplayPartsEnum3.ts", + "position": 219 + }, + "quickInfo": { + "kind": "enum", + "kindModifiers": "", + "textSpan": { + "start": 219, + "length": 6 + }, + "displayParts": [ + { + "text": "const", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "enum", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "constE", + "kind": "enumName" + } + ], + "documentation": [] + } + }, + { + "marker": { + "fileName": "/tests/cases/fourslash/quickInfoDisplayPartsEnum3.ts", + "position": 226 + }, + "quickInfo": { + "kind": "var", + "kindModifiers": "", + "textSpan": { + "start": 226, + "length": 4 + }, + "displayParts": [ + { + "text": "(", + "kind": "punctuation" + }, + { + "text": "enum member", + "kind": "text" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "constE", + "kind": "enumName" + }, + { + "text": "[", + "kind": "punctuation" + }, + { + "text": "\"e1\"", + "kind": "stringLiteral" + }, + { + "text": "]", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "=", + "kind": "operator" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "0", + "kind": "numericLiteral" + } + ], + "documentation": [] + } + }, + { + "marker": { + "fileName": "/tests/cases/fourslash/quickInfoDisplayPartsEnum3.ts", + "position": 233 + }, + "quickInfo": { + "kind": "var", + "kindModifiers": "", + "textSpan": { + "start": 233, + "length": 10 + }, + "displayParts": [ + { + "text": "var", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "eInstance1", + "kind": "localName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "constE", + "kind": "enumName" + } + ], + "documentation": [] + } + }, + { + "marker": { + "fileName": "/tests/cases/fourslash/quickInfoDisplayPartsEnum3.ts", + "position": 246 + }, + "quickInfo": { + "kind": "enum", + "kindModifiers": "", + "textSpan": { + "start": 246, + "length": 6 + }, + "displayParts": [ + { + "text": "const", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "enum", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "constE", + "kind": "enumName" + } + ], + "documentation": [] + } + }, + { + "marker": { + "fileName": "/tests/cases/fourslash/quickInfoDisplayPartsEnum3.ts", + "position": 253 + }, + "quickInfo": { + "kind": "var", + "kindModifiers": "", + "textSpan": { + "start": 253, + "length": 4 + }, + "displayParts": [ + { + "text": "(", + "kind": "punctuation" + }, + { + "text": "enum member", + "kind": "text" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "constE", + "kind": "enumName" + }, + { + "text": "[", + "kind": "punctuation" + }, + { + "text": "'e2'", + "kind": "stringLiteral" + }, + { + "text": "]", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "=", + "kind": "operator" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "10", + "kind": "numericLiteral" + } + ], + "documentation": [] + } + }, + { + "marker": { + "fileName": "/tests/cases/fourslash/quickInfoDisplayPartsEnum3.ts", + "position": 260 + }, + "quickInfo": { + "kind": "var", + "kindModifiers": "", + "textSpan": { + "start": 260, + "length": 10 + }, + "displayParts": [ + { + "text": "var", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "eInstance1", + "kind": "localName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "constE", + "kind": "enumName" + } + ], + "documentation": [] + } + }, + { + "marker": { + "fileName": "/tests/cases/fourslash/quickInfoDisplayPartsEnum3.ts", + "position": 273 + }, + "quickInfo": { + "kind": "enum", + "kindModifiers": "", + "textSpan": { + "start": 273, + "length": 6 + }, + "displayParts": [ + { + "text": "const", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "enum", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "constE", + "kind": "enumName" + } + ], + "documentation": [] + } + }, + { + "marker": { + "fileName": "/tests/cases/fourslash/quickInfoDisplayPartsEnum3.ts", + "position": 280 + }, + "quickInfo": { + "kind": "var", + "kindModifiers": "", + "textSpan": { + "start": 280, + "length": 4 + }, + "displayParts": [ + { + "text": "(", + "kind": "punctuation" + }, + { + "text": "enum member", + "kind": "text" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "constE", + "kind": "enumName" + }, + { + "text": "[", + "kind": "punctuation" + }, + { + "text": "\"e3\"", + "kind": "stringLiteral" + }, + { + "text": "]", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "=", + "kind": "operator" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "11", + "kind": "numericLiteral" + } + ], + "documentation": [] + } + } +] \ No newline at end of file diff --git a/tests/baselines/reference/quickInfoDisplayPartsExternalModuleAlias_file0.baseline b/tests/baselines/reference/quickInfoDisplayPartsExternalModuleAlias_file0.baseline new file mode 100644 index 00000000000..78667e7c6e6 --- /dev/null +++ b/tests/baselines/reference/quickInfoDisplayPartsExternalModuleAlias_file0.baseline @@ -0,0 +1,288 @@ +[ + { + "marker": { + "fileName": "/tests/cases/fourslash/quickInfoDisplayPartsExternalModuleAlias_file1.ts", + "position": 7 + }, + "quickInfo": { + "kind": "alias", + "kindModifiers": "", + "textSpan": { + "start": 7, + "length": 2 + }, + "displayParts": [ + { + "text": "import", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "a1", + "kind": "aliasName" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "=", + "kind": "operator" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "require", + "kind": "keyword" + }, + { + "text": "(", + "kind": "punctuation" + }, + { + "text": "\"./quickInfoDisplayPartsExternalModuleAlias_file0\"", + "kind": "stringLiteral" + }, + { + "text": ")", + "kind": "punctuation" + } + ], + "documentation": [] + } + }, + { + "marker": { + "fileName": "/tests/cases/fourslash/quickInfoDisplayPartsExternalModuleAlias_file1.ts", + "position": 20 + }, + "quickInfo": { + "kind": "module", + "kindModifiers": "", + "textSpan": { + "start": 20, + "length": 50 + }, + "displayParts": [ + { + "text": "module", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "a1", + "kind": "aliasName" + } + ], + "documentation": [] + } + }, + { + "marker": { + "fileName": "/tests/cases/fourslash/quickInfoDisplayPartsExternalModuleAlias_file1.ts", + "position": 77 + }, + "quickInfo": { + "kind": "alias", + "kindModifiers": "", + "textSpan": { + "start": 77, + "length": 2 + }, + "displayParts": [ + { + "text": "import", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "a1", + "kind": "aliasName" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "=", + "kind": "operator" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "require", + "kind": "keyword" + }, + { + "text": "(", + "kind": "punctuation" + }, + { + "text": "\"./quickInfoDisplayPartsExternalModuleAlias_file0\"", + "kind": "stringLiteral" + }, + { + "text": ")", + "kind": "punctuation" + } + ], + "documentation": [] + } + }, + { + "marker": { + "fileName": "/tests/cases/fourslash/quickInfoDisplayPartsExternalModuleAlias_file1.ts", + "position": 102 + }, + "quickInfo": { + "kind": "alias", + "kindModifiers": "export", + "textSpan": { + "start": 102, + "length": 2 + }, + "displayParts": [ + { + "text": "import", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "a2", + "kind": "aliasName" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "=", + "kind": "operator" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "require", + "kind": "keyword" + }, + { + "text": "(", + "kind": "punctuation" + }, + { + "text": "\"./quickInfoDisplayPartsExternalModuleAlias_file0\"", + "kind": "stringLiteral" + }, + { + "text": ")", + "kind": "punctuation" + } + ], + "documentation": [] + } + }, + { + "marker": { + "fileName": "/tests/cases/fourslash/quickInfoDisplayPartsExternalModuleAlias_file1.ts", + "position": 115 + }, + "quickInfo": { + "kind": "module", + "kindModifiers": "", + "textSpan": { + "start": 115, + "length": 50 + }, + "displayParts": [ + { + "text": "module", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "a1", + "kind": "aliasName" + } + ], + "documentation": [] + } + }, + { + "marker": { + "fileName": "/tests/cases/fourslash/quickInfoDisplayPartsExternalModuleAlias_file1.ts", + "position": 172 + }, + "quickInfo": { + "kind": "alias", + "kindModifiers": "export", + "textSpan": { + "start": 172, + "length": 2 + }, + "displayParts": [ + { + "text": "import", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "a2", + "kind": "aliasName" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "=", + "kind": "operator" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "require", + "kind": "keyword" + }, + { + "text": "(", + "kind": "punctuation" + }, + { + "text": "\"./quickInfoDisplayPartsExternalModuleAlias_file0\"", + "kind": "stringLiteral" + }, + { + "text": ")", + "kind": "punctuation" + } + ], + "documentation": [] + } + } +] \ No newline at end of file diff --git a/tests/baselines/reference/quickInfoDisplayPartsExternalModules.baseline b/tests/baselines/reference/quickInfoDisplayPartsExternalModules.baseline new file mode 100644 index 00000000000..fa548470a76 --- /dev/null +++ b/tests/baselines/reference/quickInfoDisplayPartsExternalModules.baseline @@ -0,0 +1,687 @@ +[ + { + "marker": { + "fileName": "/tests/cases/fourslash/quickInfoDisplayPartsExternalModules.ts", + "position": 17 + }, + "quickInfo": { + "kind": "module", + "kindModifiers": "export", + "textSpan": { + "start": 17, + "length": 1 + }, + "displayParts": [ + { + "text": "namespace", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "m", + "kind": "moduleName" + } + ], + "documentation": [] + } + }, + { + "marker": { + "fileName": "/tests/cases/fourslash/quickInfoDisplayPartsExternalModules.ts", + "position": 29 + }, + "quickInfo": { + "kind": "var", + "kindModifiers": "", + "textSpan": { + "start": 29, + "length": 26 + }, + "displayParts": [ + { + "text": "var", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "namespaceElemWithoutExport", + "kind": "localName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "number", + "kind": "keyword" + } + ], + "documentation": [] + } + }, + { + "marker": { + "fileName": "/tests/cases/fourslash/quickInfoDisplayPartsExternalModules.ts", + "position": 77 + }, + "quickInfo": { + "kind": "var", + "kindModifiers": "export", + "textSpan": { + "start": 77, + "length": 23 + }, + "displayParts": [ + { + "text": "var", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "m", + "kind": "moduleName" + }, + { + "text": ".", + "kind": "punctuation" + }, + { + "text": "namespaceElemWithExport", + "kind": "localName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "number", + "kind": "keyword" + } + ], + "documentation": [] + } + }, + { + "marker": { + "fileName": "/tests/cases/fourslash/quickInfoDisplayPartsExternalModules.ts", + "position": 120 + }, + "quickInfo": { + "kind": "var", + "kindModifiers": "export", + "textSpan": { + "start": 120, + "length": 1 + }, + "displayParts": [ + { + "text": "var", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "a", + "kind": "localName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "typeof", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "m", + "kind": "moduleName" + } + ], + "documentation": [] + } + }, + { + "marker": { + "fileName": "/tests/cases/fourslash/quickInfoDisplayPartsExternalModules.ts", + "position": 124 + }, + "quickInfo": { + "kind": "module", + "kindModifiers": "export", + "textSpan": { + "start": 124, + "length": 1 + }, + "displayParts": [ + { + "text": "namespace", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "m", + "kind": "moduleName" + } + ], + "documentation": [] + } + }, + { + "marker": { + "fileName": "/tests/cases/fourslash/quickInfoDisplayPartsExternalModules.ts", + "position": 138 + }, + "quickInfo": { + "kind": "var", + "kindModifiers": "export", + "textSpan": { + "start": 138, + "length": 1 + }, + "displayParts": [ + { + "text": "var", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "b", + "kind": "localName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "typeof", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "m", + "kind": "moduleName" + } + ], + "documentation": [] + } + }, + { + "marker": { + "fileName": "/tests/cases/fourslash/quickInfoDisplayPartsExternalModules.ts", + "position": 148 + }, + "quickInfo": { + "kind": "module", + "kindModifiers": "export", + "textSpan": { + "start": 148, + "length": 1 + }, + "displayParts": [ + { + "text": "namespace", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "m", + "kind": "moduleName" + } + ], + "documentation": [] + } + }, + { + "marker": { + "fileName": "/tests/cases/fourslash/quickInfoDisplayPartsExternalModules.ts", + "position": 168 + }, + "quickInfo": { + "kind": "module", + "kindModifiers": "export", + "textSpan": { + "start": 168, + "length": 2 + }, + "displayParts": [ + { + "text": "namespace", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "m1", + "kind": "moduleName" + } + ], + "documentation": [] + } + }, + { + "marker": { + "fileName": "/tests/cases/fourslash/quickInfoDisplayPartsExternalModules.ts", + "position": 171 + }, + "quickInfo": { + "kind": "module", + "kindModifiers": "export", + "textSpan": { + "start": 171, + "length": 2 + }, + "displayParts": [ + { + "text": "namespace", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "m1", + "kind": "moduleName" + }, + { + "text": ".", + "kind": "punctuation" + }, + { + "text": "m2", + "kind": "moduleName" + } + ], + "documentation": [] + } + }, + { + "marker": { + "fileName": "/tests/cases/fourslash/quickInfoDisplayPartsExternalModules.ts", + "position": 184 + }, + "quickInfo": { + "kind": "var", + "kindModifiers": "", + "textSpan": { + "start": 184, + "length": 26 + }, + "displayParts": [ + { + "text": "var", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "namespaceElemWithoutExport", + "kind": "localName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "number", + "kind": "keyword" + } + ], + "documentation": [] + } + }, + { + "marker": { + "fileName": "/tests/cases/fourslash/quickInfoDisplayPartsExternalModules.ts", + "position": 232 + }, + "quickInfo": { + "kind": "var", + "kindModifiers": "export", + "textSpan": { + "start": 232, + "length": 23 + }, + "displayParts": [ + { + "text": "var", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "m1", + "kind": "moduleName" + }, + { + "text": ".", + "kind": "punctuation" + }, + { + "text": "m2", + "kind": "moduleName" + }, + { + "text": ".", + "kind": "punctuation" + }, + { + "text": "namespaceElemWithExport", + "kind": "localName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "number", + "kind": "keyword" + } + ], + "documentation": [] + } + }, + { + "marker": { + "fileName": "/tests/cases/fourslash/quickInfoDisplayPartsExternalModules.ts", + "position": 275 + }, + "quickInfo": { + "kind": "var", + "kindModifiers": "export", + "textSpan": { + "start": 275, + "length": 1 + }, + "displayParts": [ + { + "text": "var", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "x", + "kind": "localName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "typeof", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "m1", + "kind": "moduleName" + }, + { + "text": ".", + "kind": "punctuation" + }, + { + "text": "m2", + "kind": "moduleName" + } + ], + "documentation": [] + } + }, + { + "marker": { + "fileName": "/tests/cases/fourslash/quickInfoDisplayPartsExternalModules.ts", + "position": 279 + }, + "quickInfo": { + "kind": "module", + "kindModifiers": "export", + "textSpan": { + "start": 279, + "length": 2 + }, + "displayParts": [ + { + "text": "namespace", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "m1", + "kind": "moduleName" + } + ], + "documentation": [] + } + }, + { + "marker": { + "fileName": "/tests/cases/fourslash/quickInfoDisplayPartsExternalModules.ts", + "position": 282 + }, + "quickInfo": { + "kind": "module", + "kindModifiers": "export", + "textSpan": { + "start": 282, + "length": 2 + }, + "displayParts": [ + { + "text": "namespace", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "m1", + "kind": "moduleName" + }, + { + "text": ".", + "kind": "punctuation" + }, + { + "text": "m2", + "kind": "moduleName" + } + ], + "documentation": [] + } + }, + { + "marker": { + "fileName": "/tests/cases/fourslash/quickInfoDisplayPartsExternalModules.ts", + "position": 297 + }, + "quickInfo": { + "kind": "var", + "kindModifiers": "export", + "textSpan": { + "start": 297, + "length": 1 + }, + "displayParts": [ + { + "text": "var", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "y", + "kind": "localName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "typeof", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "m1", + "kind": "moduleName" + }, + { + "text": ".", + "kind": "punctuation" + }, + { + "text": "m2", + "kind": "moduleName" + } + ], + "documentation": [] + } + }, + { + "marker": { + "fileName": "/tests/cases/fourslash/quickInfoDisplayPartsExternalModules.ts", + "position": 307 + }, + "quickInfo": { + "kind": "module", + "kindModifiers": "export", + "textSpan": { + "start": 307, + "length": 2 + }, + "displayParts": [ + { + "text": "namespace", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "m1", + "kind": "moduleName" + } + ], + "documentation": [] + } + }, + { + "marker": { + "fileName": "/tests/cases/fourslash/quickInfoDisplayPartsExternalModules.ts", + "position": 310 + }, + "quickInfo": { + "kind": "module", + "kindModifiers": "export", + "textSpan": { + "start": 310, + "length": 2 + }, + "displayParts": [ + { + "text": "namespace", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "m1", + "kind": "moduleName" + }, + { + "text": ".", + "kind": "punctuation" + }, + { + "text": "m2", + "kind": "moduleName" + } + ], + "documentation": [] + } + } +] \ No newline at end of file diff --git a/tests/baselines/reference/quickInfoDisplayPartsFunction.baseline b/tests/baselines/reference/quickInfoDisplayPartsFunction.baseline new file mode 100644 index 00000000000..6ac80589629 --- /dev/null +++ b/tests/baselines/reference/quickInfoDisplayPartsFunction.baseline @@ -0,0 +1,1432 @@ +[ + { + "marker": { + "fileName": "/tests/cases/fourslash/quickInfoDisplayPartsFunction.ts", + "position": 9 + }, + "quickInfo": { + "kind": "function", + "kindModifiers": "", + "textSpan": { + "start": 9, + "length": 3 + }, + "displayParts": [ + { + "text": "function", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "foo", + "kind": "functionName" + }, + { + "text": "(", + "kind": "punctuation" + }, + { + "text": "param", + "kind": "parameterName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "string", + "kind": "keyword" + }, + { + "text": ",", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "optionalParam", + "kind": "parameterName" + }, + { + "text": "?", + "kind": "punctuation" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "string", + "kind": "keyword" + }, + { + "text": ",", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "paramWithInitializer", + "kind": "parameterName" + }, + { + "text": "?", + "kind": "punctuation" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "string", + "kind": "keyword" + }, + { + "text": ",", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "...", + "kind": "punctuation" + }, + { + "text": "restParam", + "kind": "parameterName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "string", + "kind": "keyword" + }, + { + "text": "[", + "kind": "punctuation" + }, + { + "text": "]", + "kind": "punctuation" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "void", + "kind": "keyword" + } + ], + "documentation": [] + } + }, + { + "marker": { + "fileName": "/tests/cases/fourslash/quickInfoDisplayPartsFunction.ts", + "position": 121 + }, + "quickInfo": { + "kind": "function", + "kindModifiers": "", + "textSpan": { + "start": 121, + "length": 15 + }, + "displayParts": [ + { + "text": "function", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "foowithoverload", + "kind": "functionName" + }, + { + "text": "(", + "kind": "punctuation" + }, + { + "text": "a", + "kind": "parameterName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "string", + "kind": "keyword" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "string", + "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": [] + } + }, + { + "marker": { + "fileName": "/tests/cases/fourslash/quickInfoDisplayPartsFunction.ts", + "position": 166 + }, + "quickInfo": { + "kind": "function", + "kindModifiers": "", + "textSpan": { + "start": 166, + "length": 15 + }, + "displayParts": [ + { + "text": "function", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "foowithoverload", + "kind": "functionName" + }, + { + "text": "(", + "kind": "punctuation" + }, + { + "text": "a", + "kind": "parameterName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "number", + "kind": "keyword" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "number", + "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": [] + } + }, + { + "marker": { + "fileName": "/tests/cases/fourslash/quickInfoDisplayPartsFunction.ts", + "position": 211 + }, + "quickInfo": { + "kind": "function", + "kindModifiers": "", + "textSpan": { + "start": 211, + "length": 15 + }, + "displayParts": [ + { + "text": "function", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "foowithoverload", + "kind": "functionName" + }, + { + "text": "(", + "kind": "punctuation" + }, + { + "text": "a", + "kind": "parameterName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "string", + "kind": "keyword" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "string", + "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": [] + } + }, + { + "marker": { + "fileName": "/tests/cases/fourslash/quickInfoDisplayPartsFunction.ts", + "position": 267 + }, + "quickInfo": { + "kind": "function", + "kindModifiers": "", + "textSpan": { + "start": 267, + "length": 16 + }, + "displayParts": [ + { + "text": "function", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "foowith3overload", + "kind": "functionName" + }, + { + "text": "(", + "kind": "punctuation" + }, + { + "text": "a", + "kind": "parameterName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "string", + "kind": "keyword" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "string", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "(", + "kind": "punctuation" + }, + { + "text": "+", + "kind": "operator" + }, + { + "text": "2", + "kind": "numericLiteral" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "overloads", + "kind": "text" + }, + { + "text": ")", + "kind": "punctuation" + } + ], + "documentation": [] + } + }, + { + "marker": { + "fileName": "/tests/cases/fourslash/quickInfoDisplayPartsFunction.ts", + "position": 313 + }, + "quickInfo": { + "kind": "function", + "kindModifiers": "", + "textSpan": { + "start": 313, + "length": 16 + }, + "displayParts": [ + { + "text": "function", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "foowith3overload", + "kind": "functionName" + }, + { + "text": "(", + "kind": "punctuation" + }, + { + "text": "a", + "kind": "parameterName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "number", + "kind": "keyword" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "number", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "(", + "kind": "punctuation" + }, + { + "text": "+", + "kind": "operator" + }, + { + "text": "2", + "kind": "numericLiteral" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "overloads", + "kind": "text" + }, + { + "text": ")", + "kind": "punctuation" + } + ], + "documentation": [] + } + }, + { + "marker": { + "fileName": "/tests/cases/fourslash/quickInfoDisplayPartsFunction.ts", + "position": 359 + }, + "quickInfo": { + "kind": "function", + "kindModifiers": "", + "textSpan": { + "start": 359, + "length": 16 + }, + "displayParts": [ + { + "text": "function", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "foowith3overload", + "kind": "functionName" + }, + { + "text": "(", + "kind": "punctuation" + }, + { + "text": "a", + "kind": "parameterName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "boolean", + "kind": "keyword" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "boolean", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "(", + "kind": "punctuation" + }, + { + "text": "+", + "kind": "operator" + }, + { + "text": "2", + "kind": "numericLiteral" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "overloads", + "kind": "text" + }, + { + "text": ")", + "kind": "punctuation" + } + ], + "documentation": [] + } + }, + { + "marker": { + "fileName": "/tests/cases/fourslash/quickInfoDisplayPartsFunction.ts", + "position": 407 + }, + "quickInfo": { + "kind": "function", + "kindModifiers": "", + "textSpan": { + "start": 407, + "length": 16 + }, + "displayParts": [ + { + "text": "function", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "foowith3overload", + "kind": "functionName" + }, + { + "text": "(", + "kind": "punctuation" + }, + { + "text": "a", + "kind": "parameterName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "string", + "kind": "keyword" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "string", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "(", + "kind": "punctuation" + }, + { + "text": "+", + "kind": "operator" + }, + { + "text": "2", + "kind": "numericLiteral" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "overloads", + "kind": "text" + }, + { + "text": ")", + "kind": "punctuation" + } + ], + "documentation": [] + } + }, + { + "marker": { + "fileName": "/tests/cases/fourslash/quickInfoDisplayPartsFunction.ts", + "position": 455 + }, + "quickInfo": { + "kind": "function", + "kindModifiers": "", + "textSpan": { + "start": 455, + "length": 3 + }, + "displayParts": [ + { + "text": "function", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "foo", + "kind": "functionName" + }, + { + "text": "(", + "kind": "punctuation" + }, + { + "text": "param", + "kind": "parameterName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "string", + "kind": "keyword" + }, + { + "text": ",", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "optionalParam", + "kind": "parameterName" + }, + { + "text": "?", + "kind": "punctuation" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "string", + "kind": "keyword" + }, + { + "text": ",", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "paramWithInitializer", + "kind": "parameterName" + }, + { + "text": "?", + "kind": "punctuation" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "string", + "kind": "keyword" + }, + { + "text": ",", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "...", + "kind": "punctuation" + }, + { + "text": "restParam", + "kind": "parameterName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "string", + "kind": "keyword" + }, + { + "text": "[", + "kind": "punctuation" + }, + { + "text": "]", + "kind": "punctuation" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "void", + "kind": "keyword" + } + ], + "documentation": [] + } + }, + { + "marker": { + "fileName": "/tests/cases/fourslash/quickInfoDisplayPartsFunction.ts", + "position": 469 + }, + "quickInfo": { + "kind": "function", + "kindModifiers": "", + "textSpan": { + "start": 469, + "length": 15 + }, + "displayParts": [ + { + "text": "function", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "foowithoverload", + "kind": "functionName" + }, + { + "text": "(", + "kind": "punctuation" + }, + { + "text": "a", + "kind": "parameterName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "string", + "kind": "keyword" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "string", + "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": [] + } + }, + { + "marker": { + "fileName": "/tests/cases/fourslash/quickInfoDisplayPartsFunction.ts", + "position": 495 + }, + "quickInfo": { + "kind": "function", + "kindModifiers": "", + "textSpan": { + "start": 495, + "length": 15 + }, + "displayParts": [ + { + "text": "function", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "foowithoverload", + "kind": "functionName" + }, + { + "text": "(", + "kind": "punctuation" + }, + { + "text": "a", + "kind": "parameterName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "number", + "kind": "keyword" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "number", + "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": [] + } + }, + { + "marker": { + "fileName": "/tests/cases/fourslash/quickInfoDisplayPartsFunction.ts", + "position": 516 + }, + "quickInfo": { + "kind": "function", + "kindModifiers": "", + "textSpan": { + "start": 516, + "length": 16 + }, + "displayParts": [ + { + "text": "function", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "foowith3overload", + "kind": "functionName" + }, + { + "text": "(", + "kind": "punctuation" + }, + { + "text": "a", + "kind": "parameterName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "string", + "kind": "keyword" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "string", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "(", + "kind": "punctuation" + }, + { + "text": "+", + "kind": "operator" + }, + { + "text": "2", + "kind": "numericLiteral" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "overloads", + "kind": "text" + }, + { + "text": ")", + "kind": "punctuation" + } + ], + "documentation": [] + } + }, + { + "marker": { + "fileName": "/tests/cases/fourslash/quickInfoDisplayPartsFunction.ts", + "position": 543 + }, + "quickInfo": { + "kind": "function", + "kindModifiers": "", + "textSpan": { + "start": 543, + "length": 16 + }, + "displayParts": [ + { + "text": "function", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "foowith3overload", + "kind": "functionName" + }, + { + "text": "(", + "kind": "punctuation" + }, + { + "text": "a", + "kind": "parameterName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "number", + "kind": "keyword" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "number", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "(", + "kind": "punctuation" + }, + { + "text": "+", + "kind": "operator" + }, + { + "text": "2", + "kind": "numericLiteral" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "overloads", + "kind": "text" + }, + { + "text": ")", + "kind": "punctuation" + } + ], + "documentation": [] + } + }, + { + "marker": { + "fileName": "/tests/cases/fourslash/quickInfoDisplayPartsFunction.ts", + "position": 565 + }, + "quickInfo": { + "kind": "function", + "kindModifiers": "", + "textSpan": { + "start": 565, + "length": 16 + }, + "displayParts": [ + { + "text": "function", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "foowith3overload", + "kind": "functionName" + }, + { + "text": "(", + "kind": "punctuation" + }, + { + "text": "a", + "kind": "parameterName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "boolean", + "kind": "keyword" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "boolean", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "(", + "kind": "punctuation" + }, + { + "text": "+", + "kind": "operator" + }, + { + "text": "2", + "kind": "numericLiteral" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "overloads", + "kind": "text" + }, + { + "text": ")", + "kind": "punctuation" + } + ], + "documentation": [] + } + } +] \ No newline at end of file diff --git a/tests/baselines/reference/quickInfoDisplayPartsFunctionExpression.baseline b/tests/baselines/reference/quickInfoDisplayPartsFunctionExpression.baseline new file mode 100644 index 00000000000..ec943e3ac7c --- /dev/null +++ b/tests/baselines/reference/quickInfoDisplayPartsFunctionExpression.baseline @@ -0,0 +1,352 @@ +[ + { + "marker": { + "fileName": "/tests/cases/fourslash/quickInfoDisplayPartsFunctionExpression.ts", + "position": 4 + }, + "quickInfo": { + "kind": "var", + "kindModifiers": "", + "textSpan": { + "start": 4, + "length": 1 + }, + "displayParts": [ + { + "text": "var", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "x", + "kind": "localName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "(", + "kind": "punctuation" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "=>", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "void", + "kind": "keyword" + } + ], + "documentation": [] + } + }, + { + "marker": { + "fileName": "/tests/cases/fourslash/quickInfoDisplayPartsFunctionExpression.ts", + "position": 17 + }, + "quickInfo": { + "kind": "local function", + "kindModifiers": "", + "textSpan": { + "start": 17, + "length": 3 + }, + "displayParts": [ + { + "text": "(", + "kind": "punctuation" + }, + { + "text": "local function", + "kind": "text" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "foo", + "kind": "functionName" + }, + { + "text": "(", + "kind": "punctuation" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "void", + "kind": "keyword" + } + ], + "documentation": [] + } + }, + { + "marker": { + "fileName": "/tests/cases/fourslash/quickInfoDisplayPartsFunctionExpression.ts", + "position": 29 + }, + "quickInfo": { + "kind": "local function", + "kindModifiers": "", + "textSpan": { + "start": 29, + "length": 3 + }, + "displayParts": [ + { + "text": "(", + "kind": "punctuation" + }, + { + "text": "local function", + "kind": "text" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "foo", + "kind": "functionName" + }, + { + "text": "(", + "kind": "punctuation" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "void", + "kind": "keyword" + } + ], + "documentation": [] + } + }, + { + "marker": { + "fileName": "/tests/cases/fourslash/quickInfoDisplayPartsFunctionExpression.ts", + "position": 43 + }, + "quickInfo": { + "kind": "var", + "kindModifiers": "", + "textSpan": { + "start": 43, + "length": 1 + }, + "displayParts": [ + { + "text": "var", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "y", + "kind": "localName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "(", + "kind": "punctuation" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "=>", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "void", + "kind": "keyword" + } + ], + "documentation": [] + } + }, + { + "marker": { + "fileName": "/tests/cases/fourslash/quickInfoDisplayPartsFunctionExpression.ts", + "position": 74 + }, + "quickInfo": { + "kind": "local function", + "kindModifiers": "", + "textSpan": { + "start": 74, + "length": 4 + }, + "displayParts": [ + { + "text": "(", + "kind": "punctuation" + }, + { + "text": "local function", + "kind": "text" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "foo1", + "kind": "functionName" + }, + { + "text": "(", + "kind": "punctuation" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "void", + "kind": "keyword" + } + ], + "documentation": [] + } + }, + { + "marker": { + "fileName": "/tests/cases/fourslash/quickInfoDisplayPartsFunctionExpression.ts", + "position": 87 + }, + "quickInfo": { + "kind": "local function", + "kindModifiers": "", + "textSpan": { + "start": 87, + "length": 4 + }, + "displayParts": [ + { + "text": "(", + "kind": "punctuation" + }, + { + "text": "local function", + "kind": "text" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "foo1", + "kind": "functionName" + }, + { + "text": "(", + "kind": "punctuation" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "void", + "kind": "keyword" + } + ], + "documentation": [] + } + } +] \ No newline at end of file diff --git a/tests/baselines/reference/quickInfoDisplayPartsInterface.baseline b/tests/baselines/reference/quickInfoDisplayPartsInterface.baseline new file mode 100644 index 00000000000..43b9faa9540 --- /dev/null +++ b/tests/baselines/reference/quickInfoDisplayPartsInterface.baseline @@ -0,0 +1,101 @@ +[ + { + "marker": { + "fileName": "/tests/cases/fourslash/quickInfoDisplayPartsInterface.ts", + "position": 10 + }, + "quickInfo": { + "kind": "interface", + "kindModifiers": "", + "textSpan": { + "start": 10, + "length": 1 + }, + "displayParts": [ + { + "text": "interface", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "i", + "kind": "interfaceName" + } + ], + "documentation": [] + } + }, + { + "marker": { + "fileName": "/tests/cases/fourslash/quickInfoDisplayPartsInterface.ts", + "position": 20 + }, + "quickInfo": { + "kind": "var", + "kindModifiers": "", + "textSpan": { + "start": 20, + "length": 9 + }, + "displayParts": [ + { + "text": "var", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "iInstance", + "kind": "localName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "i", + "kind": "interfaceName" + } + ], + "documentation": [] + } + }, + { + "marker": { + "fileName": "/tests/cases/fourslash/quickInfoDisplayPartsInterface.ts", + "position": 31 + }, + "quickInfo": { + "kind": "interface", + "kindModifiers": "", + "textSpan": { + "start": 31, + "length": 1 + }, + "displayParts": [ + { + "text": "interface", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "i", + "kind": "interfaceName" + } + ], + "documentation": [] + } + } +] \ No newline at end of file diff --git a/tests/baselines/reference/quickInfoDisplayPartsInterfaceMembers.baseline b/tests/baselines/reference/quickInfoDisplayPartsInterfaceMembers.baseline new file mode 100644 index 00000000000..170c7ed0bff --- /dev/null +++ b/tests/baselines/reference/quickInfoDisplayPartsInterfaceMembers.baseline @@ -0,0 +1,507 @@ +[ + { + "marker": { + "fileName": "/tests/cases/fourslash/quickInfoDisplayPartsInterfaceMembers.ts", + "position": 18 + }, + "quickInfo": { + "kind": "property", + "kindModifiers": "", + "textSpan": { + "start": 18, + "length": 8 + }, + "displayParts": [ + { + "text": "(", + "kind": "punctuation" + }, + { + "text": "property", + "kind": "text" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "I", + "kind": "interfaceName" + }, + { + "text": ".", + "kind": "punctuation" + }, + { + "text": "property", + "kind": "propertyName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "string", + "kind": "keyword" + } + ], + "documentation": [] + } + }, + { + "marker": { + "fileName": "/tests/cases/fourslash/quickInfoDisplayPartsInterfaceMembers.ts", + "position": 40 + }, + "quickInfo": { + "kind": "method", + "kindModifiers": "", + "textSpan": { + "start": 40, + "length": 6 + }, + "displayParts": [ + { + "text": "(", + "kind": "punctuation" + }, + { + "text": "method", + "kind": "text" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "I", + "kind": "interfaceName" + }, + { + "text": ".", + "kind": "punctuation" + }, + { + "text": "method", + "kind": "methodName" + }, + { + "text": "(", + "kind": "punctuation" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "string", + "kind": "keyword" + } + ], + "documentation": [] + } + }, + { + "marker": { + "fileName": "/tests/cases/fourslash/quickInfoDisplayPartsInterfaceMembers.ts", + "position": 109 + }, + "quickInfo": { + "kind": "var", + "kindModifiers": "", + "textSpan": { + "start": 109, + "length": 9 + }, + "displayParts": [ + { + "text": "var", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "iInstance", + "kind": "localName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "I", + "kind": "interfaceName" + } + ], + "documentation": [] + } + }, + { + "marker": { + "fileName": "/tests/cases/fourslash/quickInfoDisplayPartsInterfaceMembers.ts", + "position": 119 + }, + "quickInfo": { + "kind": "property", + "kindModifiers": "", + "textSpan": { + "start": 119, + "length": 8 + }, + "displayParts": [ + { + "text": "(", + "kind": "punctuation" + }, + { + "text": "property", + "kind": "text" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "I", + "kind": "interfaceName" + }, + { + "text": ".", + "kind": "punctuation" + }, + { + "text": "property", + "kind": "propertyName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "string", + "kind": "keyword" + } + ], + "documentation": [] + } + }, + { + "marker": { + "fileName": "/tests/cases/fourslash/quickInfoDisplayPartsInterfaceMembers.ts", + "position": 130 + }, + "quickInfo": { + "kind": "var", + "kindModifiers": "", + "textSpan": { + "start": 130, + "length": 9 + }, + "displayParts": [ + { + "text": "var", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "iInstance", + "kind": "localName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "I", + "kind": "interfaceName" + } + ], + "documentation": [] + } + }, + { + "marker": { + "fileName": "/tests/cases/fourslash/quickInfoDisplayPartsInterfaceMembers.ts", + "position": 140 + }, + "quickInfo": { + "kind": "method", + "kindModifiers": "", + "textSpan": { + "start": 140, + "length": 6 + }, + "displayParts": [ + { + "text": "(", + "kind": "punctuation" + }, + { + "text": "method", + "kind": "text" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "I", + "kind": "interfaceName" + }, + { + "text": ".", + "kind": "punctuation" + }, + { + "text": "method", + "kind": "methodName" + }, + { + "text": "(", + "kind": "punctuation" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "string", + "kind": "keyword" + } + ], + "documentation": [] + } + }, + { + "marker": { + "fileName": "/tests/cases/fourslash/quickInfoDisplayPartsInterfaceMembers.ts", + "position": 150 + }, + "quickInfo": { + "kind": "var", + "kindModifiers": "", + "textSpan": { + "start": 150, + "length": 9 + }, + "displayParts": [ + { + "text": "var", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "iInstance", + "kind": "localName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "I", + "kind": "interfaceName" + }, + { + "text": "(", + "kind": "punctuation" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "=>", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "string", + "kind": "keyword" + } + ], + "documentation": [] + } + }, + { + "marker": { + "fileName": "/tests/cases/fourslash/quickInfoDisplayPartsInterfaceMembers.ts", + "position": 167 + }, + "quickInfo": { + "kind": "var", + "kindModifiers": "", + "textSpan": { + "start": 167, + "length": 15 + }, + "displayParts": [ + { + "text": "var", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "anotherInstance", + "kind": "localName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "I", + "kind": "interfaceName" + } + ], + "documentation": [] + } + }, + { + "marker": { + "fileName": "/tests/cases/fourslash/quickInfoDisplayPartsInterfaceMembers.ts", + "position": 189 + }, + "quickInfo": { + "kind": "var", + "kindModifiers": "", + "textSpan": { + "start": 189, + "length": 9 + }, + "displayParts": [ + { + "text": "var", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "iInstance", + "kind": "localName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "new", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "I", + "kind": "interfaceName" + }, + { + "text": "(", + "kind": "punctuation" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "=>", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "I", + "kind": "interfaceName" + } + ], + "documentation": [] + } + } +] \ No newline at end of file diff --git a/tests/baselines/reference/quickInfoDisplayPartsLet.baseline b/tests/baselines/reference/quickInfoDisplayPartsLet.baseline new file mode 100644 index 00000000000..2153c0b132b --- /dev/null +++ b/tests/baselines/reference/quickInfoDisplayPartsLet.baseline @@ -0,0 +1,1186 @@ +[ + { + "marker": { + "fileName": "/tests/cases/fourslash/quickInfoDisplayPartsLet.ts", + "position": 4 + }, + "quickInfo": { + "kind": "let", + "kindModifiers": "", + "textSpan": { + "start": 4, + "length": 1 + }, + "displayParts": [ + { + "text": "let", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "a", + "kind": "localName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "number", + "kind": "keyword" + } + ], + "documentation": [] + } + }, + { + "marker": { + "fileName": "/tests/cases/fourslash/quickInfoDisplayPartsLet.ts", + "position": 37 + }, + "quickInfo": { + "kind": "let", + "kindModifiers": "", + "textSpan": { + "start": 37, + "length": 1 + }, + "displayParts": [ + { + "text": "let", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "b", + "kind": "localName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "number", + "kind": "keyword" + } + ], + "documentation": [] + } + }, + { + "marker": { + "fileName": "/tests/cases/fourslash/quickInfoDisplayPartsLet.ts", + "position": 41 + }, + "quickInfo": { + "kind": "let", + "kindModifiers": "", + "textSpan": { + "start": 41, + "length": 1 + }, + "displayParts": [ + { + "text": "let", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "a", + "kind": "localName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "number", + "kind": "keyword" + } + ], + "documentation": [] + } + }, + { + "marker": { + "fileName": "/tests/cases/fourslash/quickInfoDisplayPartsLet.ts", + "position": 69 + }, + "quickInfo": { + "kind": "let", + "kindModifiers": "", + "textSpan": { + "start": 69, + "length": 2 + }, + "displayParts": [ + { + "text": "let", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "b1", + "kind": "localName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "number", + "kind": "keyword" + } + ], + "documentation": [] + } + }, + { + "marker": { + "fileName": "/tests/cases/fourslash/quickInfoDisplayPartsLet.ts", + "position": 105 + }, + "quickInfo": { + "kind": "let", + "kindModifiers": "", + "textSpan": { + "start": 105, + "length": 1 + }, + "displayParts": [ + { + "text": "let", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "c", + "kind": "localName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "number", + "kind": "keyword" + } + ], + "documentation": [] + } + }, + { + "marker": { + "fileName": "/tests/cases/fourslash/quickInfoDisplayPartsLet.ts", + "position": 128 + }, + "quickInfo": { + "kind": "let", + "kindModifiers": "export", + "textSpan": { + "start": 128, + "length": 1 + }, + "displayParts": [ + { + "text": "let", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "m", + "kind": "moduleName" + }, + { + "text": ".", + "kind": "punctuation" + }, + { + "text": "d", + "kind": "localName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "number", + "kind": "keyword" + } + ], + "documentation": [] + } + }, + { + "marker": { + "fileName": "/tests/cases/fourslash/quickInfoDisplayPartsLet.ts", + "position": 161 + }, + "quickInfo": { + "kind": "let", + "kindModifiers": "", + "textSpan": { + "start": 161, + "length": 1 + }, + "displayParts": [ + { + "text": "let", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "e", + "kind": "localName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "number", + "kind": "keyword" + } + ], + "documentation": [] + } + }, + { + "marker": { + "fileName": "/tests/cases/fourslash/quickInfoDisplayPartsLet.ts", + "position": 181 + }, + "quickInfo": { + "kind": "let", + "kindModifiers": "", + "textSpan": { + "start": 181, + "length": 1 + }, + "displayParts": [ + { + "text": "let", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "f", + "kind": "localName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "(", + "kind": "punctuation" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "=>", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "number", + "kind": "keyword" + } + ], + "documentation": [] + } + }, + { + "marker": { + "fileName": "/tests/cases/fourslash/quickInfoDisplayPartsLet.ts", + "position": 202 + }, + "quickInfo": { + "kind": "let", + "kindModifiers": "", + "textSpan": { + "start": 202, + "length": 1 + }, + "displayParts": [ + { + "text": "let", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "g", + "kind": "localName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "(", + "kind": "punctuation" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "=>", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "number", + "kind": "keyword" + } + ], + "documentation": [] + } + }, + { + "marker": { + "fileName": "/tests/cases/fourslash/quickInfoDisplayPartsLet.ts", + "position": 206 + }, + "quickInfo": { + "kind": "let", + "kindModifiers": "", + "textSpan": { + "start": 206, + "length": 1 + }, + "displayParts": [ + { + "text": "let", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "f", + "kind": "localName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "(", + "kind": "punctuation" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "=>", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "number", + "kind": "keyword" + } + ], + "documentation": [] + } + }, + { + "marker": { + "fileName": "/tests/cases/fourslash/quickInfoDisplayPartsLet.ts", + "position": 209 + }, + "quickInfo": { + "kind": "let", + "kindModifiers": "", + "textSpan": { + "start": 209, + "length": 1 + }, + "displayParts": [ + { + "text": "let", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "f", + "kind": "localName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "(", + "kind": "punctuation" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "=>", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "number", + "kind": "keyword" + } + ], + "documentation": [] + } + }, + { + "marker": { + "fileName": "/tests/cases/fourslash/quickInfoDisplayPartsLet.ts", + "position": 218 + }, + "quickInfo": { + "kind": "let", + "kindModifiers": "", + "textSpan": { + "start": 218, + "length": 1 + }, + "displayParts": [ + { + "text": "let", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "h", + "kind": "localName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "{", + "kind": "punctuation" + }, + { + "text": "\n", + "kind": "lineBreak" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "(", + "kind": "punctuation" + }, + { + "text": "a", + "kind": "parameterName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "string", + "kind": "keyword" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "number", + "kind": "keyword" + }, + { + "text": ";", + "kind": "punctuation" + }, + { + "text": "\n", + "kind": "lineBreak" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "(", + "kind": "punctuation" + }, + { + "text": "a", + "kind": "parameterName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "number", + "kind": "keyword" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "string", + "kind": "keyword" + }, + { + "text": ";", + "kind": "punctuation" + }, + { + "text": "\n", + "kind": "lineBreak" + }, + { + "text": "}", + "kind": "punctuation" + } + ], + "documentation": [] + } + }, + { + "marker": { + "fileName": "/tests/cases/fourslash/quickInfoDisplayPartsLet.ts", + "position": 272 + }, + "quickInfo": { + "kind": "let", + "kindModifiers": "", + "textSpan": { + "start": 272, + "length": 1 + }, + "displayParts": [ + { + "text": "let", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "i", + "kind": "localName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "{", + "kind": "punctuation" + }, + { + "text": "\n", + "kind": "lineBreak" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "(", + "kind": "punctuation" + }, + { + "text": "a", + "kind": "parameterName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "string", + "kind": "keyword" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "number", + "kind": "keyword" + }, + { + "text": ";", + "kind": "punctuation" + }, + { + "text": "\n", + "kind": "lineBreak" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "(", + "kind": "punctuation" + }, + { + "text": "a", + "kind": "parameterName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "number", + "kind": "keyword" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "string", + "kind": "keyword" + }, + { + "text": ";", + "kind": "punctuation" + }, + { + "text": "\n", + "kind": "lineBreak" + }, + { + "text": "}", + "kind": "punctuation" + } + ], + "documentation": [] + } + }, + { + "marker": { + "fileName": "/tests/cases/fourslash/quickInfoDisplayPartsLet.ts", + "position": 276 + }, + "quickInfo": { + "kind": "let", + "kindModifiers": "", + "textSpan": { + "start": 276, + "length": 1 + }, + "displayParts": [ + { + "text": "let", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "h", + "kind": "localName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "{", + "kind": "punctuation" + }, + { + "text": "\n", + "kind": "lineBreak" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "(", + "kind": "punctuation" + }, + { + "text": "a", + "kind": "parameterName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "string", + "kind": "keyword" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "number", + "kind": "keyword" + }, + { + "text": ";", + "kind": "punctuation" + }, + { + "text": "\n", + "kind": "lineBreak" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "(", + "kind": "punctuation" + }, + { + "text": "a", + "kind": "parameterName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "number", + "kind": "keyword" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "string", + "kind": "keyword" + }, + { + "text": ";", + "kind": "punctuation" + }, + { + "text": "\n", + "kind": "lineBreak" + }, + { + "text": "}", + "kind": "punctuation" + } + ], + "documentation": [] + } + }, + { + "marker": { + "fileName": "/tests/cases/fourslash/quickInfoDisplayPartsLet.ts", + "position": 279 + }, + "quickInfo": { + "kind": "let", + "kindModifiers": "", + "textSpan": { + "start": 279, + "length": 1 + }, + "displayParts": [ + { + "text": "let", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "h", + "kind": "localName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "(", + "kind": "punctuation" + }, + { + "text": "a", + "kind": "parameterName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "number", + "kind": "keyword" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "=>", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "string", + "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": [] + } + }, + { + "marker": { + "fileName": "/tests/cases/fourslash/quickInfoDisplayPartsLet.ts", + "position": 286 + }, + "quickInfo": { + "kind": "let", + "kindModifiers": "", + "textSpan": { + "start": 286, + "length": 1 + }, + "displayParts": [ + { + "text": "let", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "h", + "kind": "localName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "(", + "kind": "punctuation" + }, + { + "text": "a", + "kind": "parameterName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "string", + "kind": "keyword" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "=>", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "number", + "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": [] + } + } +] \ No newline at end of file diff --git a/tests/baselines/reference/quickInfoDisplayPartsLiteralLikeNames01.baseline b/tests/baselines/reference/quickInfoDisplayPartsLiteralLikeNames01.baseline new file mode 100644 index 00000000000..71b971b7340 --- /dev/null +++ b/tests/baselines/reference/quickInfoDisplayPartsLiteralLikeNames01.baseline @@ -0,0 +1,672 @@ +[ + { + "marker": { + "fileName": "/tests/cases/fourslash/quickInfoDisplayPartsLiteralLikeNames01.ts", + "position": 21 + }, + "quickInfo": { + "kind": "method", + "kindModifiers": "public", + "textSpan": { + "start": 21, + "length": 1 + }, + "displayParts": [ + { + "text": "(", + "kind": "punctuation" + }, + { + "text": "method", + "kind": "text" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "C", + "kind": "className" + }, + { + "text": "[", + "kind": "punctuation" + }, + { + "text": "1", + "kind": "methodName" + }, + { + "text": "]", + "kind": "punctuation" + }, + { + "text": "(", + "kind": "punctuation" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "void", + "kind": "keyword" + } + ], + "documentation": [] + } + }, + { + "marker": { + "fileName": "/tests/cases/fourslash/quickInfoDisplayPartsLiteralLikeNames01.ts", + "position": 41 + }, + "quickInfo": { + "kind": "method", + "kindModifiers": "private", + "textSpan": { + "start": 41, + "length": 8 + }, + "displayParts": [ + { + "text": "(", + "kind": "punctuation" + }, + { + "text": "method", + "kind": "text" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "C", + "kind": "className" + }, + { + "text": ".", + "kind": "punctuation" + }, + { + "text": "Infinity", + "kind": "methodName" + }, + { + "text": "(", + "kind": "punctuation" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "void", + "kind": "keyword" + } + ], + "documentation": [] + } + }, + { + "marker": { + "fileName": "/tests/cases/fourslash/quickInfoDisplayPartsLiteralLikeNames01.ts", + "position": 70 + }, + "quickInfo": { + "kind": "method", + "kindModifiers": "protected", + "textSpan": { + "start": 70, + "length": 3 + }, + "displayParts": [ + { + "text": "(", + "kind": "punctuation" + }, + { + "text": "method", + "kind": "text" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "C", + "kind": "className" + }, + { + "text": ".", + "kind": "punctuation" + }, + { + "text": "NaN", + "kind": "methodName" + }, + { + "text": "(", + "kind": "punctuation" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "void", + "kind": "keyword" + } + ], + "documentation": [] + } + }, + { + "marker": { + "fileName": "/tests/cases/fourslash/quickInfoDisplayPartsLiteralLikeNames01.ts", + "position": 91 + }, + "quickInfo": { + "kind": "method", + "kindModifiers": "static", + "textSpan": { + "start": 91, + "length": 19 + }, + "displayParts": [ + { + "text": "(", + "kind": "punctuation" + }, + { + "text": "method", + "kind": "text" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "C", + "kind": "className" + }, + { + "text": "[", + "kind": "punctuation" + }, + { + "text": "\"stringLiteralName\"", + "kind": "stringLiteral" + }, + { + "text": "]", + "kind": "punctuation" + }, + { + "text": "(", + "kind": "punctuation" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "void", + "kind": "keyword" + } + ], + "documentation": [] + } + }, + { + "marker": { + "fileName": "/tests/cases/fourslash/quickInfoDisplayPartsLiteralLikeNames01.ts", + "position": 145 + }, + "quickInfo": { + "kind": "method", + "kindModifiers": "public", + "textSpan": { + "start": 145, + "length": 1 + }, + "displayParts": [ + { + "text": "(", + "kind": "punctuation" + }, + { + "text": "method", + "kind": "text" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "C", + "kind": "className" + }, + { + "text": "[", + "kind": "punctuation" + }, + { + "text": "1", + "kind": "methodName" + }, + { + "text": "]", + "kind": "punctuation" + }, + { + "text": "(", + "kind": "punctuation" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "void", + "kind": "keyword" + } + ], + "documentation": [] + } + }, + { + "marker": { + "fileName": "/tests/cases/fourslash/quickInfoDisplayPartsLiteralLikeNames01.ts", + "position": 164 + }, + "quickInfo": { + "kind": "method", + "kindModifiers": "public", + "textSpan": { + "start": 164, + "length": 3 + }, + "displayParts": [ + { + "text": "(", + "kind": "punctuation" + }, + { + "text": "method", + "kind": "text" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "C", + "kind": "className" + }, + { + "text": "[", + "kind": "punctuation" + }, + { + "text": "1", + "kind": "methodName" + }, + { + "text": "]", + "kind": "punctuation" + }, + { + "text": "(", + "kind": "punctuation" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "void", + "kind": "keyword" + } + ], + "documentation": [] + } + }, + { + "marker": { + "fileName": "/tests/cases/fourslash/quickInfoDisplayPartsLiteralLikeNames01.ts", + "position": 185 + }, + "quickInfo": { + "kind": "method", + "kindModifiers": "private", + "textSpan": { + "start": 185, + "length": 8 + }, + "displayParts": [ + { + "text": "(", + "kind": "punctuation" + }, + { + "text": "method", + "kind": "text" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "C", + "kind": "className" + }, + { + "text": ".", + "kind": "punctuation" + }, + { + "text": "Infinity", + "kind": "methodName" + }, + { + "text": "(", + "kind": "punctuation" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "void", + "kind": "keyword" + } + ], + "documentation": [] + } + }, + { + "marker": { + "fileName": "/tests/cases/fourslash/quickInfoDisplayPartsLiteralLikeNames01.ts", + "position": 210 + }, + "quickInfo": { + "kind": "method", + "kindModifiers": "private", + "textSpan": { + "start": 210, + "length": 10 + }, + "displayParts": [ + { + "text": "(", + "kind": "punctuation" + }, + { + "text": "method", + "kind": "text" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "C", + "kind": "className" + }, + { + "text": ".", + "kind": "punctuation" + }, + { + "text": "Infinity", + "kind": "methodName" + }, + { + "text": "(", + "kind": "punctuation" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "void", + "kind": "keyword" + } + ], + "documentation": [] + } + }, + { + "marker": { + "fileName": "/tests/cases/fourslash/quickInfoDisplayPartsLiteralLikeNames01.ts", + "position": 238 + }, + "quickInfo": { + "kind": "method", + "kindModifiers": "protected", + "textSpan": { + "start": 238, + "length": 3 + }, + "displayParts": [ + { + "text": "(", + "kind": "punctuation" + }, + { + "text": "method", + "kind": "text" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "C", + "kind": "className" + }, + { + "text": ".", + "kind": "punctuation" + }, + { + "text": "NaN", + "kind": "methodName" + }, + { + "text": "(", + "kind": "punctuation" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "void", + "kind": "keyword" + } + ], + "documentation": [] + } + }, + { + "marker": { + "fileName": "/tests/cases/fourslash/quickInfoDisplayPartsLiteralLikeNames01.ts", + "position": 255 + }, + "quickInfo": { + "kind": "method", + "kindModifiers": "static", + "textSpan": { + "start": 255, + "length": 17 + }, + "displayParts": [ + { + "text": "(", + "kind": "punctuation" + }, + { + "text": "method", + "kind": "text" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "C", + "kind": "className" + }, + { + "text": "[", + "kind": "punctuation" + }, + { + "text": "\"stringLiteralName\"", + "kind": "stringLiteral" + }, + { + "text": "]", + "kind": "punctuation" + }, + { + "text": "(", + "kind": "punctuation" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "void", + "kind": "keyword" + } + ], + "documentation": [] + } + } +] \ No newline at end of file diff --git a/tests/baselines/reference/quickInfoDisplayPartsLocalFunction.baseline b/tests/baselines/reference/quickInfoDisplayPartsLocalFunction.baseline new file mode 100644 index 00000000000..65c3dc88390 --- /dev/null +++ b/tests/baselines/reference/quickInfoDisplayPartsLocalFunction.baseline @@ -0,0 +1,1642 @@ +[ + { + "marker": { + "fileName": "/tests/cases/fourslash/quickInfoDisplayPartsLocalFunction.ts", + "position": 9 + }, + "quickInfo": { + "kind": "function", + "kindModifiers": "", + "textSpan": { + "start": 9, + "length": 8 + }, + "displayParts": [ + { + "text": "function", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "outerFoo", + "kind": "functionName" + }, + { + "text": "(", + "kind": "punctuation" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "void", + "kind": "keyword" + } + ], + "documentation": [] + } + }, + { + "marker": { + "fileName": "/tests/cases/fourslash/quickInfoDisplayPartsLocalFunction.ts", + "position": 35 + }, + "quickInfo": { + "kind": "local function", + "kindModifiers": "", + "textSpan": { + "start": 35, + "length": 3 + }, + "displayParts": [ + { + "text": "(", + "kind": "punctuation" + }, + { + "text": "local function", + "kind": "text" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "foo", + "kind": "functionName" + }, + { + "text": "(", + "kind": "punctuation" + }, + { + "text": "param", + "kind": "parameterName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "string", + "kind": "keyword" + }, + { + "text": ",", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "optionalParam", + "kind": "parameterName" + }, + { + "text": "?", + "kind": "punctuation" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "string", + "kind": "keyword" + }, + { + "text": ",", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "paramWithInitializer", + "kind": "parameterName" + }, + { + "text": "?", + "kind": "punctuation" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "string", + "kind": "keyword" + }, + { + "text": ",", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "...", + "kind": "punctuation" + }, + { + "text": "restParam", + "kind": "parameterName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "string", + "kind": "keyword" + }, + { + "text": "[", + "kind": "punctuation" + }, + { + "text": "]", + "kind": "punctuation" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "void", + "kind": "keyword" + } + ], + "documentation": [] + } + }, + { + "marker": { + "fileName": "/tests/cases/fourslash/quickInfoDisplayPartsLocalFunction.ts", + "position": 155 + }, + "quickInfo": { + "kind": "local function", + "kindModifiers": "", + "textSpan": { + "start": 155, + "length": 15 + }, + "displayParts": [ + { + "text": "(", + "kind": "punctuation" + }, + { + "text": "local function", + "kind": "text" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "foowithoverload", + "kind": "functionName" + }, + { + "text": "(", + "kind": "punctuation" + }, + { + "text": "a", + "kind": "parameterName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "string", + "kind": "keyword" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "string", + "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": [] + } + }, + { + "marker": { + "fileName": "/tests/cases/fourslash/quickInfoDisplayPartsLocalFunction.ts", + "position": 204 + }, + "quickInfo": { + "kind": "local function", + "kindModifiers": "", + "textSpan": { + "start": 204, + "length": 15 + }, + "displayParts": [ + { + "text": "(", + "kind": "punctuation" + }, + { + "text": "local function", + "kind": "text" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "foowithoverload", + "kind": "functionName" + }, + { + "text": "(", + "kind": "punctuation" + }, + { + "text": "a", + "kind": "parameterName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "number", + "kind": "keyword" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "number", + "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": [] + } + }, + { + "marker": { + "fileName": "/tests/cases/fourslash/quickInfoDisplayPartsLocalFunction.ts", + "position": 253 + }, + "quickInfo": { + "kind": "local function", + "kindModifiers": "", + "textSpan": { + "start": 253, + "length": 15 + }, + "displayParts": [ + { + "text": "(", + "kind": "punctuation" + }, + { + "text": "local function", + "kind": "text" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "foowithoverload", + "kind": "functionName" + }, + { + "text": "(", + "kind": "punctuation" + }, + { + "text": "a", + "kind": "parameterName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "string", + "kind": "keyword" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "string", + "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": [] + } + }, + { + "marker": { + "fileName": "/tests/cases/fourslash/quickInfoDisplayPartsLocalFunction.ts", + "position": 321 + }, + "quickInfo": { + "kind": "local function", + "kindModifiers": "", + "textSpan": { + "start": 321, + "length": 16 + }, + "displayParts": [ + { + "text": "(", + "kind": "punctuation" + }, + { + "text": "local function", + "kind": "text" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "foowith3overload", + "kind": "functionName" + }, + { + "text": "(", + "kind": "punctuation" + }, + { + "text": "a", + "kind": "parameterName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "string", + "kind": "keyword" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "string", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "(", + "kind": "punctuation" + }, + { + "text": "+", + "kind": "operator" + }, + { + "text": "2", + "kind": "numericLiteral" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "overloads", + "kind": "text" + }, + { + "text": ")", + "kind": "punctuation" + } + ], + "documentation": [] + } + }, + { + "marker": { + "fileName": "/tests/cases/fourslash/quickInfoDisplayPartsLocalFunction.ts", + "position": 371 + }, + "quickInfo": { + "kind": "local function", + "kindModifiers": "", + "textSpan": { + "start": 371, + "length": 16 + }, + "displayParts": [ + { + "text": "(", + "kind": "punctuation" + }, + { + "text": "local function", + "kind": "text" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "foowith3overload", + "kind": "functionName" + }, + { + "text": "(", + "kind": "punctuation" + }, + { + "text": "a", + "kind": "parameterName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "number", + "kind": "keyword" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "number", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "(", + "kind": "punctuation" + }, + { + "text": "+", + "kind": "operator" + }, + { + "text": "2", + "kind": "numericLiteral" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "overloads", + "kind": "text" + }, + { + "text": ")", + "kind": "punctuation" + } + ], + "documentation": [] + } + }, + { + "marker": { + "fileName": "/tests/cases/fourslash/quickInfoDisplayPartsLocalFunction.ts", + "position": 421 + }, + "quickInfo": { + "kind": "local function", + "kindModifiers": "", + "textSpan": { + "start": 421, + "length": 16 + }, + "displayParts": [ + { + "text": "(", + "kind": "punctuation" + }, + { + "text": "local function", + "kind": "text" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "foowith3overload", + "kind": "functionName" + }, + { + "text": "(", + "kind": "punctuation" + }, + { + "text": "a", + "kind": "parameterName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "boolean", + "kind": "keyword" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "boolean", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "(", + "kind": "punctuation" + }, + { + "text": "+", + "kind": "operator" + }, + { + "text": "2", + "kind": "numericLiteral" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "overloads", + "kind": "text" + }, + { + "text": ")", + "kind": "punctuation" + } + ], + "documentation": [] + } + }, + { + "marker": { + "fileName": "/tests/cases/fourslash/quickInfoDisplayPartsLocalFunction.ts", + "position": 473 + }, + "quickInfo": { + "kind": "local function", + "kindModifiers": "", + "textSpan": { + "start": 473, + "length": 16 + }, + "displayParts": [ + { + "text": "(", + "kind": "punctuation" + }, + { + "text": "local function", + "kind": "text" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "foowith3overload", + "kind": "functionName" + }, + { + "text": "(", + "kind": "punctuation" + }, + { + "text": "a", + "kind": "parameterName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "string", + "kind": "keyword" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "string", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "(", + "kind": "punctuation" + }, + { + "text": "+", + "kind": "operator" + }, + { + "text": "2", + "kind": "numericLiteral" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "overloads", + "kind": "text" + }, + { + "text": ")", + "kind": "punctuation" + } + ], + "documentation": [] + } + }, + { + "marker": { + "fileName": "/tests/cases/fourslash/quickInfoDisplayPartsLocalFunction.ts", + "position": 533 + }, + "quickInfo": { + "kind": "local function", + "kindModifiers": "", + "textSpan": { + "start": 533, + "length": 3 + }, + "displayParts": [ + { + "text": "(", + "kind": "punctuation" + }, + { + "text": "local function", + "kind": "text" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "foo", + "kind": "functionName" + }, + { + "text": "(", + "kind": "punctuation" + }, + { + "text": "param", + "kind": "parameterName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "string", + "kind": "keyword" + }, + { + "text": ",", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "optionalParam", + "kind": "parameterName" + }, + { + "text": "?", + "kind": "punctuation" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "string", + "kind": "keyword" + }, + { + "text": ",", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "paramWithInitializer", + "kind": "parameterName" + }, + { + "text": "?", + "kind": "punctuation" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "string", + "kind": "keyword" + }, + { + "text": ",", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "...", + "kind": "punctuation" + }, + { + "text": "restParam", + "kind": "parameterName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "string", + "kind": "keyword" + }, + { + "text": "[", + "kind": "punctuation" + }, + { + "text": "]", + "kind": "punctuation" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "void", + "kind": "keyword" + } + ], + "documentation": [] + } + }, + { + "marker": { + "fileName": "/tests/cases/fourslash/quickInfoDisplayPartsLocalFunction.ts", + "position": 551 + }, + "quickInfo": { + "kind": "local function", + "kindModifiers": "", + "textSpan": { + "start": 551, + "length": 15 + }, + "displayParts": [ + { + "text": "(", + "kind": "punctuation" + }, + { + "text": "local function", + "kind": "text" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "foowithoverload", + "kind": "functionName" + }, + { + "text": "(", + "kind": "punctuation" + }, + { + "text": "a", + "kind": "parameterName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "string", + "kind": "keyword" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "string", + "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": [] + } + }, + { + "marker": { + "fileName": "/tests/cases/fourslash/quickInfoDisplayPartsLocalFunction.ts", + "position": 581 + }, + "quickInfo": { + "kind": "local function", + "kindModifiers": "", + "textSpan": { + "start": 581, + "length": 15 + }, + "displayParts": [ + { + "text": "(", + "kind": "punctuation" + }, + { + "text": "local function", + "kind": "text" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "foowithoverload", + "kind": "functionName" + }, + { + "text": "(", + "kind": "punctuation" + }, + { + "text": "a", + "kind": "parameterName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "number", + "kind": "keyword" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "number", + "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": [] + } + }, + { + "marker": { + "fileName": "/tests/cases/fourslash/quickInfoDisplayPartsLocalFunction.ts", + "position": 606 + }, + "quickInfo": { + "kind": "local function", + "kindModifiers": "", + "textSpan": { + "start": 606, + "length": 16 + }, + "displayParts": [ + { + "text": "(", + "kind": "punctuation" + }, + { + "text": "local function", + "kind": "text" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "foowith3overload", + "kind": "functionName" + }, + { + "text": "(", + "kind": "punctuation" + }, + { + "text": "a", + "kind": "parameterName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "string", + "kind": "keyword" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "string", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "(", + "kind": "punctuation" + }, + { + "text": "+", + "kind": "operator" + }, + { + "text": "2", + "kind": "numericLiteral" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "overloads", + "kind": "text" + }, + { + "text": ")", + "kind": "punctuation" + } + ], + "documentation": [] + } + }, + { + "marker": { + "fileName": "/tests/cases/fourslash/quickInfoDisplayPartsLocalFunction.ts", + "position": 637 + }, + "quickInfo": { + "kind": "local function", + "kindModifiers": "", + "textSpan": { + "start": 637, + "length": 16 + }, + "displayParts": [ + { + "text": "(", + "kind": "punctuation" + }, + { + "text": "local function", + "kind": "text" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "foowith3overload", + "kind": "functionName" + }, + { + "text": "(", + "kind": "punctuation" + }, + { + "text": "a", + "kind": "parameterName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "number", + "kind": "keyword" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "number", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "(", + "kind": "punctuation" + }, + { + "text": "+", + "kind": "operator" + }, + { + "text": "2", + "kind": "numericLiteral" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "overloads", + "kind": "text" + }, + { + "text": ")", + "kind": "punctuation" + } + ], + "documentation": [] + } + }, + { + "marker": { + "fileName": "/tests/cases/fourslash/quickInfoDisplayPartsLocalFunction.ts", + "position": 663 + }, + "quickInfo": { + "kind": "local function", + "kindModifiers": "", + "textSpan": { + "start": 663, + "length": 16 + }, + "displayParts": [ + { + "text": "(", + "kind": "punctuation" + }, + { + "text": "local function", + "kind": "text" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "foowith3overload", + "kind": "functionName" + }, + { + "text": "(", + "kind": "punctuation" + }, + { + "text": "a", + "kind": "parameterName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "boolean", + "kind": "keyword" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "boolean", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "(", + "kind": "punctuation" + }, + { + "text": "+", + "kind": "operator" + }, + { + "text": "2", + "kind": "numericLiteral" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "overloads", + "kind": "text" + }, + { + "text": ")", + "kind": "punctuation" + } + ], + "documentation": [] + } + }, + { + "marker": { + "fileName": "/tests/cases/fourslash/quickInfoDisplayPartsLocalFunction.ts", + "position": 689 + }, + "quickInfo": { + "kind": "function", + "kindModifiers": "", + "textSpan": { + "start": 689, + "length": 8 + }, + "displayParts": [ + { + "text": "function", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "outerFoo", + "kind": "functionName" + }, + { + "text": "(", + "kind": "punctuation" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "void", + "kind": "keyword" + } + ], + "documentation": [] + } + } +] \ No newline at end of file diff --git a/tests/baselines/reference/quickInfoDisplayPartsModules.baseline b/tests/baselines/reference/quickInfoDisplayPartsModules.baseline new file mode 100644 index 00000000000..e2f04ea75e8 --- /dev/null +++ b/tests/baselines/reference/quickInfoDisplayPartsModules.baseline @@ -0,0 +1,687 @@ +[ + { + "marker": { + "fileName": "/tests/cases/fourslash/quickInfoDisplayPartsModules.ts", + "position": 10 + }, + "quickInfo": { + "kind": "module", + "kindModifiers": "", + "textSpan": { + "start": 10, + "length": 1 + }, + "displayParts": [ + { + "text": "namespace", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "m", + "kind": "moduleName" + } + ], + "documentation": [] + } + }, + { + "marker": { + "fileName": "/tests/cases/fourslash/quickInfoDisplayPartsModules.ts", + "position": 22 + }, + "quickInfo": { + "kind": "var", + "kindModifiers": "", + "textSpan": { + "start": 22, + "length": 26 + }, + "displayParts": [ + { + "text": "var", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "namespaceElemWithoutExport", + "kind": "localName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "number", + "kind": "keyword" + } + ], + "documentation": [] + } + }, + { + "marker": { + "fileName": "/tests/cases/fourslash/quickInfoDisplayPartsModules.ts", + "position": 70 + }, + "quickInfo": { + "kind": "var", + "kindModifiers": "export", + "textSpan": { + "start": 70, + "length": 23 + }, + "displayParts": [ + { + "text": "var", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "m", + "kind": "moduleName" + }, + { + "text": ".", + "kind": "punctuation" + }, + { + "text": "namespaceElemWithExport", + "kind": "localName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "number", + "kind": "keyword" + } + ], + "documentation": [] + } + }, + { + "marker": { + "fileName": "/tests/cases/fourslash/quickInfoDisplayPartsModules.ts", + "position": 106 + }, + "quickInfo": { + "kind": "var", + "kindModifiers": "", + "textSpan": { + "start": 106, + "length": 1 + }, + "displayParts": [ + { + "text": "var", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "a", + "kind": "localName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "typeof", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "m", + "kind": "moduleName" + } + ], + "documentation": [] + } + }, + { + "marker": { + "fileName": "/tests/cases/fourslash/quickInfoDisplayPartsModules.ts", + "position": 110 + }, + "quickInfo": { + "kind": "module", + "kindModifiers": "", + "textSpan": { + "start": 110, + "length": 1 + }, + "displayParts": [ + { + "text": "namespace", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "m", + "kind": "moduleName" + } + ], + "documentation": [] + } + }, + { + "marker": { + "fileName": "/tests/cases/fourslash/quickInfoDisplayPartsModules.ts", + "position": 117 + }, + "quickInfo": { + "kind": "var", + "kindModifiers": "", + "textSpan": { + "start": 117, + "length": 1 + }, + "displayParts": [ + { + "text": "var", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "b", + "kind": "localName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "typeof", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "m", + "kind": "moduleName" + } + ], + "documentation": [] + } + }, + { + "marker": { + "fileName": "/tests/cases/fourslash/quickInfoDisplayPartsModules.ts", + "position": 127 + }, + "quickInfo": { + "kind": "module", + "kindModifiers": "", + "textSpan": { + "start": 127, + "length": 1 + }, + "displayParts": [ + { + "text": "namespace", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "m", + "kind": "moduleName" + } + ], + "documentation": [] + } + }, + { + "marker": { + "fileName": "/tests/cases/fourslash/quickInfoDisplayPartsModules.ts", + "position": 140 + }, + "quickInfo": { + "kind": "module", + "kindModifiers": "", + "textSpan": { + "start": 140, + "length": 2 + }, + "displayParts": [ + { + "text": "namespace", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "m1", + "kind": "moduleName" + } + ], + "documentation": [] + } + }, + { + "marker": { + "fileName": "/tests/cases/fourslash/quickInfoDisplayPartsModules.ts", + "position": 143 + }, + "quickInfo": { + "kind": "module", + "kindModifiers": "export", + "textSpan": { + "start": 143, + "length": 2 + }, + "displayParts": [ + { + "text": "namespace", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "m1", + "kind": "moduleName" + }, + { + "text": ".", + "kind": "punctuation" + }, + { + "text": "m2", + "kind": "moduleName" + } + ], + "documentation": [] + } + }, + { + "marker": { + "fileName": "/tests/cases/fourslash/quickInfoDisplayPartsModules.ts", + "position": 156 + }, + "quickInfo": { + "kind": "var", + "kindModifiers": "", + "textSpan": { + "start": 156, + "length": 26 + }, + "displayParts": [ + { + "text": "var", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "namespaceElemWithoutExport", + "kind": "localName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "number", + "kind": "keyword" + } + ], + "documentation": [] + } + }, + { + "marker": { + "fileName": "/tests/cases/fourslash/quickInfoDisplayPartsModules.ts", + "position": 204 + }, + "quickInfo": { + "kind": "var", + "kindModifiers": "export", + "textSpan": { + "start": 204, + "length": 23 + }, + "displayParts": [ + { + "text": "var", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "m1", + "kind": "moduleName" + }, + { + "text": ".", + "kind": "punctuation" + }, + { + "text": "m2", + "kind": "moduleName" + }, + { + "text": ".", + "kind": "punctuation" + }, + { + "text": "namespaceElemWithExport", + "kind": "localName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "number", + "kind": "keyword" + } + ], + "documentation": [] + } + }, + { + "marker": { + "fileName": "/tests/cases/fourslash/quickInfoDisplayPartsModules.ts", + "position": 240 + }, + "quickInfo": { + "kind": "var", + "kindModifiers": "", + "textSpan": { + "start": 240, + "length": 1 + }, + "displayParts": [ + { + "text": "var", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "x", + "kind": "localName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "typeof", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "m1", + "kind": "moduleName" + }, + { + "text": ".", + "kind": "punctuation" + }, + { + "text": "m2", + "kind": "moduleName" + } + ], + "documentation": [] + } + }, + { + "marker": { + "fileName": "/tests/cases/fourslash/quickInfoDisplayPartsModules.ts", + "position": 244 + }, + "quickInfo": { + "kind": "module", + "kindModifiers": "", + "textSpan": { + "start": 244, + "length": 2 + }, + "displayParts": [ + { + "text": "namespace", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "m1", + "kind": "moduleName" + } + ], + "documentation": [] + } + }, + { + "marker": { + "fileName": "/tests/cases/fourslash/quickInfoDisplayPartsModules.ts", + "position": 247 + }, + "quickInfo": { + "kind": "module", + "kindModifiers": "export", + "textSpan": { + "start": 247, + "length": 2 + }, + "displayParts": [ + { + "text": "namespace", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "m1", + "kind": "moduleName" + }, + { + "text": ".", + "kind": "punctuation" + }, + { + "text": "m2", + "kind": "moduleName" + } + ], + "documentation": [] + } + }, + { + "marker": { + "fileName": "/tests/cases/fourslash/quickInfoDisplayPartsModules.ts", + "position": 255 + }, + "quickInfo": { + "kind": "var", + "kindModifiers": "", + "textSpan": { + "start": 255, + "length": 1 + }, + "displayParts": [ + { + "text": "var", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "y", + "kind": "localName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "typeof", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "m1", + "kind": "moduleName" + }, + { + "text": ".", + "kind": "punctuation" + }, + { + "text": "m2", + "kind": "moduleName" + } + ], + "documentation": [] + } + }, + { + "marker": { + "fileName": "/tests/cases/fourslash/quickInfoDisplayPartsModules.ts", + "position": 265 + }, + "quickInfo": { + "kind": "module", + "kindModifiers": "", + "textSpan": { + "start": 265, + "length": 2 + }, + "displayParts": [ + { + "text": "namespace", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "m1", + "kind": "moduleName" + } + ], + "documentation": [] + } + }, + { + "marker": { + "fileName": "/tests/cases/fourslash/quickInfoDisplayPartsModules.ts", + "position": 268 + }, + "quickInfo": { + "kind": "module", + "kindModifiers": "export", + "textSpan": { + "start": 268, + "length": 2 + }, + "displayParts": [ + { + "text": "namespace", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "m1", + "kind": "moduleName" + }, + { + "text": ".", + "kind": "punctuation" + }, + { + "text": "m2", + "kind": "moduleName" + } + ], + "documentation": [] + } + } +] \ No newline at end of file diff --git a/tests/baselines/reference/quickInfoDisplayPartsParameters.baseline b/tests/baselines/reference/quickInfoDisplayPartsParameters.baseline new file mode 100644 index 00000000000..45f6128c2b1 --- /dev/null +++ b/tests/baselines/reference/quickInfoDisplayPartsParameters.baseline @@ -0,0 +1,567 @@ +[ + { + "marker": { + "fileName": "/tests/cases/fourslash/quickInfoDisplayPartsParameters.ts", + "position": 9 + }, + "quickInfo": { + "kind": "function", + "kindModifiers": "", + "textSpan": { + "start": 9, + "length": 3 + }, + "displayParts": [ + { + "text": "function", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "foo", + "kind": "functionName" + }, + { + "text": "(", + "kind": "punctuation" + }, + { + "text": "param", + "kind": "parameterName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "string", + "kind": "keyword" + }, + { + "text": ",", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "optionalParam", + "kind": "parameterName" + }, + { + "text": "?", + "kind": "punctuation" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "string", + "kind": "keyword" + }, + { + "text": ",", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "paramWithInitializer", + "kind": "parameterName" + }, + { + "text": "?", + "kind": "punctuation" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "string", + "kind": "keyword" + }, + { + "text": ",", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "...", + "kind": "punctuation" + }, + { + "text": "restParam", + "kind": "parameterName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "string", + "kind": "keyword" + }, + { + "text": "[", + "kind": "punctuation" + }, + { + "text": "]", + "kind": "punctuation" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "void", + "kind": "keyword" + } + ], + "documentation": [] + } + }, + { + "marker": { + "fileName": "/tests/cases/fourslash/quickInfoDisplayPartsParameters.ts", + "position": 13 + }, + "quickInfo": { + "kind": "parameter", + "kindModifiers": "", + "textSpan": { + "start": 13, + "length": 5 + }, + "displayParts": [ + { + "text": "(", + "kind": "punctuation" + }, + { + "text": "parameter", + "kind": "text" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "param", + "kind": "parameterName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "string", + "kind": "keyword" + } + ], + "documentation": [] + } + }, + { + "marker": { + "fileName": "/tests/cases/fourslash/quickInfoDisplayPartsParameters.ts", + "position": 28 + }, + "quickInfo": { + "kind": "parameter", + "kindModifiers": "", + "textSpan": { + "start": 28, + "length": 13 + }, + "displayParts": [ + { + "text": "(", + "kind": "punctuation" + }, + { + "text": "parameter", + "kind": "text" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "optionalParam", + "kind": "parameterName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "string", + "kind": "keyword" + } + ], + "documentation": [] + } + }, + { + "marker": { + "fileName": "/tests/cases/fourslash/quickInfoDisplayPartsParameters.ts", + "position": 52 + }, + "quickInfo": { + "kind": "parameter", + "kindModifiers": "", + "textSpan": { + "start": 52, + "length": 20 + }, + "displayParts": [ + { + "text": "(", + "kind": "punctuation" + }, + { + "text": "parameter", + "kind": "text" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "paramWithInitializer", + "kind": "parameterName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "string", + "kind": "keyword" + } + ], + "documentation": [] + } + }, + { + "marker": { + "fileName": "/tests/cases/fourslash/quickInfoDisplayPartsParameters.ts", + "position": 87 + }, + "quickInfo": { + "kind": "parameter", + "kindModifiers": "", + "textSpan": { + "start": 87, + "length": 9 + }, + "displayParts": [ + { + "text": "(", + "kind": "punctuation" + }, + { + "text": "parameter", + "kind": "text" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "restParam", + "kind": "parameterName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "string", + "kind": "keyword" + }, + { + "text": "[", + "kind": "punctuation" + }, + { + "text": "]", + "kind": "punctuation" + } + ], + "documentation": [] + } + }, + { + "marker": { + "fileName": "/tests/cases/fourslash/quickInfoDisplayPartsParameters.ts", + "position": 114 + }, + "quickInfo": { + "kind": "parameter", + "kindModifiers": "", + "textSpan": { + "start": 114, + "length": 5 + }, + "displayParts": [ + { + "text": "(", + "kind": "punctuation" + }, + { + "text": "parameter", + "kind": "text" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "param", + "kind": "parameterName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "string", + "kind": "keyword" + } + ], + "documentation": [] + } + }, + { + "marker": { + "fileName": "/tests/cases/fourslash/quickInfoDisplayPartsParameters.ts", + "position": 135 + }, + "quickInfo": { + "kind": "parameter", + "kindModifiers": "", + "textSpan": { + "start": 135, + "length": 13 + }, + "displayParts": [ + { + "text": "(", + "kind": "punctuation" + }, + { + "text": "parameter", + "kind": "text" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "optionalParam", + "kind": "parameterName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "string", + "kind": "keyword" + } + ], + "documentation": [] + } + }, + { + "marker": { + "fileName": "/tests/cases/fourslash/quickInfoDisplayPartsParameters.ts", + "position": 164 + }, + "quickInfo": { + "kind": "parameter", + "kindModifiers": "", + "textSpan": { + "start": 164, + "length": 20 + }, + "displayParts": [ + { + "text": "(", + "kind": "punctuation" + }, + { + "text": "parameter", + "kind": "text" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "paramWithInitializer", + "kind": "parameterName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "string", + "kind": "keyword" + } + ], + "documentation": [] + } + }, + { + "marker": { + "fileName": "/tests/cases/fourslash/quickInfoDisplayPartsParameters.ts", + "position": 200 + }, + "quickInfo": { + "kind": "parameter", + "kindModifiers": "", + "textSpan": { + "start": 200, + "length": 9 + }, + "displayParts": [ + { + "text": "(", + "kind": "punctuation" + }, + { + "text": "parameter", + "kind": "text" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "restParam", + "kind": "parameterName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "string", + "kind": "keyword" + }, + { + "text": "[", + "kind": "punctuation" + }, + { + "text": "]", + "kind": "punctuation" + } + ], + "documentation": [] + } + } +] \ No newline at end of file diff --git a/tests/baselines/reference/quickInfoDisplayPartsTypeAlias.baseline b/tests/baselines/reference/quickInfoDisplayPartsTypeAlias.baseline new file mode 100644 index 00000000000..49a97ac6773 --- /dev/null +++ b/tests/baselines/reference/quickInfoDisplayPartsTypeAlias.baseline @@ -0,0 +1,240 @@ +[ + { + "marker": { + "fileName": "/tests/cases/fourslash/quickInfoDisplayPartsTypeAlias.ts", + "position": 6 + }, + "quickInfo": { + "kind": "class", + "kindModifiers": "", + "textSpan": { + "start": 6, + "length": 1 + }, + "displayParts": [ + { + "text": "class", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "c", + "kind": "className" + } + ], + "documentation": [] + } + }, + { + "marker": { + "fileName": "/tests/cases/fourslash/quickInfoDisplayPartsTypeAlias.ts", + "position": 17 + }, + "quickInfo": { + "kind": "type", + "kindModifiers": "", + "textSpan": { + "start": 17, + "length": 2 + }, + "displayParts": [ + { + "text": "type", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "t1", + "kind": "aliasName" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "=", + "kind": "operator" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "c", + "kind": "className" + } + ], + "documentation": [] + } + }, + { + "marker": { + "fileName": "/tests/cases/fourslash/quickInfoDisplayPartsTypeAlias.ts", + "position": 22 + }, + "quickInfo": { + "kind": "class", + "kindModifiers": "", + "textSpan": { + "start": 22, + "length": 1 + }, + "displayParts": [ + { + "text": "class", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "c", + "kind": "className" + } + ], + "documentation": [] + } + }, + { + "marker": { + "fileName": "/tests/cases/fourslash/quickInfoDisplayPartsTypeAlias.ts", + "position": 29 + }, + "quickInfo": { + "kind": "var", + "kindModifiers": "", + "textSpan": { + "start": 29, + "length": 9 + }, + "displayParts": [ + { + "text": "var", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "cInstance", + "kind": "localName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "c", + "kind": "className" + } + ], + "documentation": [] + } + }, + { + "marker": { + "fileName": "/tests/cases/fourslash/quickInfoDisplayPartsTypeAlias.ts", + "position": 40 + }, + "quickInfo": { + "kind": "type", + "kindModifiers": "", + "textSpan": { + "start": 40, + "length": 2 + }, + "displayParts": [ + { + "text": "type", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "t1", + "kind": "aliasName" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "=", + "kind": "operator" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "c", + "kind": "className" + } + ], + "documentation": [] + } + }, + { + "marker": { + "fileName": "/tests/cases/fourslash/quickInfoDisplayPartsTypeAlias.ts", + "position": 49 + }, + "quickInfo": { + "kind": "constructor", + "kindModifiers": "", + "textSpan": { + "start": 49, + "length": 1 + }, + "displayParts": [ + { + "text": "constructor", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "c", + "kind": "className" + }, + { + "text": "(", + "kind": "punctuation" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "c", + "kind": "className" + } + ], + "documentation": [] + } + } +] \ No newline at end of file diff --git a/tests/baselines/reference/quickInfoDisplayPartsTypeParameterInClass.baseline b/tests/baselines/reference/quickInfoDisplayPartsTypeParameterInClass.baseline new file mode 100644 index 00000000000..48bd280a1b5 --- /dev/null +++ b/tests/baselines/reference/quickInfoDisplayPartsTypeParameterInClass.baseline @@ -0,0 +1,3519 @@ +[ + { + "marker": { + "fileName": "/tests/cases/fourslash/quickInfoDisplayPartsTypeParameterInClass.ts", + "position": 6 + }, + "quickInfo": { + "kind": "class", + "kindModifiers": "", + "textSpan": { + "start": 6, + "length": 1 + }, + "displayParts": [ + { + "text": "class", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "c", + "kind": "className" + }, + { + "text": "<", + "kind": "punctuation" + }, + { + "text": "T", + "kind": "typeParameterName" + }, + { + "text": ">", + "kind": "punctuation" + } + ], + "documentation": [] + } + }, + { + "marker": { + "fileName": "/tests/cases/fourslash/quickInfoDisplayPartsTypeParameterInClass.ts", + "position": 8 + }, + "quickInfo": { + "kind": "type parameter", + "kindModifiers": "", + "textSpan": { + "start": 8, + "length": 1 + }, + "displayParts": [ + { + "text": "(", + "kind": "punctuation" + }, + { + "text": "type parameter", + "kind": "text" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "T", + "kind": "typeParameterName" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "in", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "c", + "kind": "className" + }, + { + "text": "<", + "kind": "punctuation" + }, + { + "text": "T", + "kind": "typeParameterName" + }, + { + "text": ">", + "kind": "punctuation" + } + ], + "documentation": [] + } + }, + { + "marker": { + "fileName": "/tests/cases/fourslash/quickInfoDisplayPartsTypeParameterInClass.ts", + "position": 17 + }, + "quickInfo": { + "kind": "constructor", + "kindModifiers": "", + "textSpan": { + "start": 17, + "length": 11 + }, + "displayParts": [ + { + "text": "constructor", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "c", + "kind": "className" + }, + { + "text": "<", + "kind": "punctuation" + }, + { + "text": "T", + "kind": "typeParameterName" + }, + { + "text": ">", + "kind": "punctuation" + }, + { + "text": "(", + "kind": "punctuation" + }, + { + "text": "a", + "kind": "parameterName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "T", + "kind": "typeParameterName" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "c", + "kind": "className" + }, + { + "text": "<", + "kind": "punctuation" + }, + { + "text": "T", + "kind": "typeParameterName" + }, + { + "text": ">", + "kind": "punctuation" + } + ], + "documentation": [] + } + }, + { + "marker": { + "fileName": "/tests/cases/fourslash/quickInfoDisplayPartsTypeParameterInClass.ts", + "position": 29 + }, + "quickInfo": { + "kind": "parameter", + "kindModifiers": "", + "textSpan": { + "start": 29, + "length": 1 + }, + "displayParts": [ + { + "text": "(", + "kind": "punctuation" + }, + { + "text": "parameter", + "kind": "text" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "a", + "kind": "parameterName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "T", + "kind": "typeParameterName" + } + ], + "documentation": [] + } + }, + { + "marker": { + "fileName": "/tests/cases/fourslash/quickInfoDisplayPartsTypeParameterInClass.ts", + "position": 32 + }, + "quickInfo": { + "kind": "type parameter", + "kindModifiers": "", + "textSpan": { + "start": 32, + "length": 1 + }, + "displayParts": [ + { + "text": "(", + "kind": "punctuation" + }, + { + "text": "type parameter", + "kind": "text" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "T", + "kind": "typeParameterName" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "in", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "c", + "kind": "className" + }, + { + "text": "<", + "kind": "punctuation" + }, + { + "text": "T", + "kind": "typeParameterName" + }, + { + "text": ">", + "kind": "punctuation" + } + ], + "documentation": [] + } + }, + { + "marker": { + "fileName": "/tests/cases/fourslash/quickInfoDisplayPartsTypeParameterInClass.ts", + "position": 47 + }, + "quickInfo": { + "kind": "method", + "kindModifiers": "", + "textSpan": { + "start": 47, + "length": 6 + }, + "displayParts": [ + { + "text": "(", + "kind": "punctuation" + }, + { + "text": "method", + "kind": "text" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "c", + "kind": "className" + }, + { + "text": "<", + "kind": "punctuation" + }, + { + "text": "T", + "kind": "typeParameterName" + }, + { + "text": ">", + "kind": "punctuation" + }, + { + "text": ".", + "kind": "punctuation" + }, + { + "text": "method", + "kind": "methodName" + }, + { + "text": "<", + "kind": "punctuation" + }, + { + "text": "U", + "kind": "typeParameterName" + }, + { + "text": ">", + "kind": "punctuation" + }, + { + "text": "(", + "kind": "punctuation" + }, + { + "text": "a", + "kind": "parameterName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "U", + "kind": "typeParameterName" + }, + { + "text": ",", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "b", + "kind": "parameterName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "T", + "kind": "typeParameterName" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "U", + "kind": "typeParameterName" + } + ], + "documentation": [] + } + }, + { + "marker": { + "fileName": "/tests/cases/fourslash/quickInfoDisplayPartsTypeParameterInClass.ts", + "position": 54 + }, + "quickInfo": { + "kind": "type parameter", + "kindModifiers": "", + "textSpan": { + "start": 54, + "length": 1 + }, + "displayParts": [ + { + "text": "(", + "kind": "punctuation" + }, + { + "text": "type parameter", + "kind": "text" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "U", + "kind": "typeParameterName" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "in", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "c", + "kind": "className" + }, + { + "text": "<", + "kind": "punctuation" + }, + { + "text": "T", + "kind": "typeParameterName" + }, + { + "text": ">", + "kind": "punctuation" + }, + { + "text": ".", + "kind": "punctuation" + }, + { + "text": "method", + "kind": "methodName" + }, + { + "text": "<", + "kind": "punctuation" + }, + { + "text": "U", + "kind": "typeParameterName" + }, + { + "text": ">", + "kind": "punctuation" + }, + { + "text": "(", + "kind": "punctuation" + }, + { + "text": "a", + "kind": "parameterName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "U", + "kind": "typeParameterName" + }, + { + "text": ",", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "b", + "kind": "parameterName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "T", + "kind": "typeParameterName" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "U", + "kind": "typeParameterName" + } + ], + "documentation": [] + } + }, + { + "marker": { + "fileName": "/tests/cases/fourslash/quickInfoDisplayPartsTypeParameterInClass.ts", + "position": 57 + }, + "quickInfo": { + "kind": "parameter", + "kindModifiers": "", + "textSpan": { + "start": 57, + "length": 1 + }, + "displayParts": [ + { + "text": "(", + "kind": "punctuation" + }, + { + "text": "parameter", + "kind": "text" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "a", + "kind": "parameterName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "U", + "kind": "typeParameterName" + } + ], + "documentation": [] + } + }, + { + "marker": { + "fileName": "/tests/cases/fourslash/quickInfoDisplayPartsTypeParameterInClass.ts", + "position": 60 + }, + "quickInfo": { + "kind": "type parameter", + "kindModifiers": "", + "textSpan": { + "start": 60, + "length": 1 + }, + "displayParts": [ + { + "text": "(", + "kind": "punctuation" + }, + { + "text": "type parameter", + "kind": "text" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "U", + "kind": "typeParameterName" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "in", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "c", + "kind": "className" + }, + { + "text": "<", + "kind": "punctuation" + }, + { + "text": "T", + "kind": "typeParameterName" + }, + { + "text": ">", + "kind": "punctuation" + }, + { + "text": ".", + "kind": "punctuation" + }, + { + "text": "method", + "kind": "methodName" + }, + { + "text": "<", + "kind": "punctuation" + }, + { + "text": "U", + "kind": "typeParameterName" + }, + { + "text": ">", + "kind": "punctuation" + }, + { + "text": "(", + "kind": "punctuation" + }, + { + "text": "a", + "kind": "parameterName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "U", + "kind": "typeParameterName" + }, + { + "text": ",", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "b", + "kind": "parameterName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "T", + "kind": "typeParameterName" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "U", + "kind": "typeParameterName" + } + ], + "documentation": [] + } + }, + { + "marker": { + "fileName": "/tests/cases/fourslash/quickInfoDisplayPartsTypeParameterInClass.ts", + "position": 63 + }, + "quickInfo": { + "kind": "parameter", + "kindModifiers": "", + "textSpan": { + "start": 63, + "length": 1 + }, + "displayParts": [ + { + "text": "(", + "kind": "punctuation" + }, + { + "text": "parameter", + "kind": "text" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "b", + "kind": "parameterName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "T", + "kind": "typeParameterName" + } + ], + "documentation": [] + } + }, + { + "marker": { + "fileName": "/tests/cases/fourslash/quickInfoDisplayPartsTypeParameterInClass.ts", + "position": 66 + }, + "quickInfo": { + "kind": "type parameter", + "kindModifiers": "", + "textSpan": { + "start": 66, + "length": 1 + }, + "displayParts": [ + { + "text": "(", + "kind": "punctuation" + }, + { + "text": "type parameter", + "kind": "text" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "T", + "kind": "typeParameterName" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "in", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "c", + "kind": "className" + }, + { + "text": "<", + "kind": "punctuation" + }, + { + "text": "T", + "kind": "typeParameterName" + }, + { + "text": ">", + "kind": "punctuation" + } + ], + "documentation": [] + } + }, + { + "marker": { + "fileName": "/tests/cases/fourslash/quickInfoDisplayPartsTypeParameterInClass.ts", + "position": 86 + }, + "quickInfo": { + "kind": "parameter", + "kindModifiers": "", + "textSpan": { + "start": 86, + "length": 1 + }, + "displayParts": [ + { + "text": "(", + "kind": "punctuation" + }, + { + "text": "parameter", + "kind": "text" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "a", + "kind": "parameterName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "U", + "kind": "typeParameterName" + } + ], + "documentation": [] + } + }, + { + "marker": { + "fileName": "/tests/cases/fourslash/quickInfoDisplayPartsTypeParameterInClass.ts", + "position": 101 + }, + "quickInfo": { + "kind": "var", + "kindModifiers": "", + "textSpan": { + "start": 101, + "length": 9 + }, + "displayParts": [ + { + "text": "var", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "cInstance", + "kind": "localName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "c", + "kind": "className" + }, + { + "text": "<", + "kind": "punctuation" + }, + { + "text": "string", + "kind": "keyword" + }, + { + "text": ">", + "kind": "punctuation" + } + ], + "documentation": [] + } + }, + { + "marker": { + "fileName": "/tests/cases/fourslash/quickInfoDisplayPartsTypeParameterInClass.ts", + "position": 117 + }, + "quickInfo": { + "kind": "constructor", + "kindModifiers": "", + "textSpan": { + "start": 117, + "length": 1 + }, + "displayParts": [ + { + "text": "constructor", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "c", + "kind": "className" + }, + { + "text": "<", + "kind": "punctuation" + }, + { + "text": "string", + "kind": "keyword" + }, + { + "text": ">", + "kind": "punctuation" + }, + { + "text": "(", + "kind": "punctuation" + }, + { + "text": "a", + "kind": "parameterName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "string", + "kind": "keyword" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "c", + "kind": "className" + }, + { + "text": "<", + "kind": "punctuation" + }, + { + "text": "string", + "kind": "keyword" + }, + { + "text": ">", + "kind": "punctuation" + } + ], + "documentation": [] + } + }, + { + "marker": { + "fileName": "/tests/cases/fourslash/quickInfoDisplayPartsTypeParameterInClass.ts", + "position": 133 + }, + "quickInfo": { + "kind": "var", + "kindModifiers": "", + "textSpan": { + "start": 133, + "length": 4 + }, + "displayParts": [ + { + "text": "var", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "cVal", + "kind": "localName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "typeof", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "c", + "kind": "className" + } + ], + "documentation": [] + } + }, + { + "marker": { + "fileName": "/tests/cases/fourslash/quickInfoDisplayPartsTypeParameterInClass.ts", + "position": 140 + }, + "quickInfo": { + "kind": "class", + "kindModifiers": "", + "textSpan": { + "start": 140, + "length": 1 + }, + "displayParts": [ + { + "text": "class", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "c", + "kind": "className" + }, + { + "text": "<", + "kind": "punctuation" + }, + { + "text": "T", + "kind": "typeParameterName" + }, + { + "text": ">", + "kind": "punctuation" + } + ], + "documentation": [] + } + }, + { + "marker": { + "fileName": "/tests/cases/fourslash/quickInfoDisplayPartsTypeParameterInClass.ts", + "position": 143 + }, + "quickInfo": { + "kind": "var", + "kindModifiers": "", + "textSpan": { + "start": 143, + "length": 9 + }, + "displayParts": [ + { + "text": "var", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "cInstance", + "kind": "localName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "c", + "kind": "className" + }, + { + "text": "<", + "kind": "punctuation" + }, + { + "text": "string", + "kind": "keyword" + }, + { + "text": ">", + "kind": "punctuation" + } + ], + "documentation": [] + } + }, + { + "marker": { + "fileName": "/tests/cases/fourslash/quickInfoDisplayPartsTypeParameterInClass.ts", + "position": 153 + }, + "quickInfo": { + "kind": "method", + "kindModifiers": "", + "textSpan": { + "start": 153, + "length": 6 + }, + "displayParts": [ + { + "text": "(", + "kind": "punctuation" + }, + { + "text": "method", + "kind": "text" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "c", + "kind": "className" + }, + { + "text": "<", + "kind": "punctuation" + }, + { + "text": "string", + "kind": "keyword" + }, + { + "text": ">", + "kind": "punctuation" + }, + { + "text": ".", + "kind": "punctuation" + }, + { + "text": "method", + "kind": "methodName" + }, + { + "text": "<", + "kind": "punctuation" + }, + { + "text": "\"hello\"", + "kind": "stringLiteral" + }, + { + "text": ">", + "kind": "punctuation" + }, + { + "text": "(", + "kind": "punctuation" + }, + { + "text": "a", + "kind": "parameterName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "\"hello\"", + "kind": "stringLiteral" + }, + { + "text": ",", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "b", + "kind": "parameterName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "string", + "kind": "keyword" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "\"hello\"", + "kind": "stringLiteral" + } + ], + "documentation": [] + } + }, + { + "marker": { + "fileName": "/tests/cases/fourslash/quickInfoDisplayPartsTypeParameterInClass.ts", + "position": 185 + }, + "quickInfo": { + "kind": "class", + "kindModifiers": "", + "textSpan": { + "start": 185, + "length": 2 + }, + "displayParts": [ + { + "text": "class", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "c2", + "kind": "className" + }, + { + "text": "<", + "kind": "punctuation" + }, + { + "text": "T", + "kind": "typeParameterName" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "extends", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "c", + "kind": "className" + }, + { + "text": "<", + "kind": "punctuation" + }, + { + "text": "string", + "kind": "keyword" + }, + { + "text": ">", + "kind": "punctuation" + }, + { + "text": ">", + "kind": "punctuation" + } + ], + "documentation": [] + } + }, + { + "marker": { + "fileName": "/tests/cases/fourslash/quickInfoDisplayPartsTypeParameterInClass.ts", + "position": 188 + }, + "quickInfo": { + "kind": "type parameter", + "kindModifiers": "", + "textSpan": { + "start": 188, + "length": 1 + }, + "displayParts": [ + { + "text": "(", + "kind": "punctuation" + }, + { + "text": "type parameter", + "kind": "text" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "T", + "kind": "typeParameterName" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "in", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "c2", + "kind": "className" + }, + { + "text": "<", + "kind": "punctuation" + }, + { + "text": "T", + "kind": "typeParameterName" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "extends", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "c", + "kind": "className" + }, + { + "text": "<", + "kind": "punctuation" + }, + { + "text": "string", + "kind": "keyword" + }, + { + "text": ">", + "kind": "punctuation" + }, + { + "text": ">", + "kind": "punctuation" + } + ], + "documentation": [] + } + }, + { + "marker": { + "fileName": "/tests/cases/fourslash/quickInfoDisplayPartsTypeParameterInClass.ts", + "position": 198 + }, + "quickInfo": { + "kind": "class", + "kindModifiers": "", + "textSpan": { + "start": 198, + "length": 1 + }, + "displayParts": [ + { + "text": "class", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "c", + "kind": "className" + }, + { + "text": "<", + "kind": "punctuation" + }, + { + "text": "T", + "kind": "typeParameterName" + }, + { + "text": ">", + "kind": "punctuation" + } + ], + "documentation": [] + } + }, + { + "marker": { + "fileName": "/tests/cases/fourslash/quickInfoDisplayPartsTypeParameterInClass.ts", + "position": 215 + }, + "quickInfo": { + "kind": "constructor", + "kindModifiers": "", + "textSpan": { + "start": 215, + "length": 11 + }, + "displayParts": [ + { + "text": "constructor", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "c2", + "kind": "className" + }, + { + "text": "<", + "kind": "punctuation" + }, + { + "text": "T", + "kind": "typeParameterName" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "extends", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "c", + "kind": "className" + }, + { + "text": "<", + "kind": "punctuation" + }, + { + "text": "string", + "kind": "keyword" + }, + { + "text": ">", + "kind": "punctuation" + }, + { + "text": ">", + "kind": "punctuation" + }, + { + "text": "(", + "kind": "punctuation" + }, + { + "text": "a", + "kind": "parameterName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "T", + "kind": "typeParameterName" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "c2", + "kind": "className" + }, + { + "text": "<", + "kind": "punctuation" + }, + { + "text": "T", + "kind": "typeParameterName" + }, + { + "text": ">", + "kind": "punctuation" + } + ], + "documentation": [] + } + }, + { + "marker": { + "fileName": "/tests/cases/fourslash/quickInfoDisplayPartsTypeParameterInClass.ts", + "position": 227 + }, + "quickInfo": { + "kind": "parameter", + "kindModifiers": "", + "textSpan": { + "start": 227, + "length": 1 + }, + "displayParts": [ + { + "text": "(", + "kind": "punctuation" + }, + { + "text": "parameter", + "kind": "text" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "a", + "kind": "parameterName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "T", + "kind": "typeParameterName" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "extends", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "c", + "kind": "className" + }, + { + "text": "<", + "kind": "punctuation" + }, + { + "text": "string", + "kind": "keyword" + }, + { + "text": ">", + "kind": "punctuation" + } + ], + "documentation": [] + } + }, + { + "marker": { + "fileName": "/tests/cases/fourslash/quickInfoDisplayPartsTypeParameterInClass.ts", + "position": 230 + }, + "quickInfo": { + "kind": "type parameter", + "kindModifiers": "", + "textSpan": { + "start": 230, + "length": 1 + }, + "displayParts": [ + { + "text": "(", + "kind": "punctuation" + }, + { + "text": "type parameter", + "kind": "text" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "T", + "kind": "typeParameterName" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "in", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "c2", + "kind": "className" + }, + { + "text": "<", + "kind": "punctuation" + }, + { + "text": "T", + "kind": "typeParameterName" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "extends", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "c", + "kind": "className" + }, + { + "text": "<", + "kind": "punctuation" + }, + { + "text": "string", + "kind": "keyword" + }, + { + "text": ">", + "kind": "punctuation" + }, + { + "text": ">", + "kind": "punctuation" + } + ], + "documentation": [] + } + }, + { + "marker": { + "fileName": "/tests/cases/fourslash/quickInfoDisplayPartsTypeParameterInClass.ts", + "position": 245 + }, + "quickInfo": { + "kind": "method", + "kindModifiers": "", + "textSpan": { + "start": 245, + "length": 6 + }, + "displayParts": [ + { + "text": "(", + "kind": "punctuation" + }, + { + "text": "method", + "kind": "text" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "c2", + "kind": "className" + }, + { + "text": "<", + "kind": "punctuation" + }, + { + "text": "T", + "kind": "typeParameterName" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "extends", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "c", + "kind": "className" + }, + { + "text": "<", + "kind": "punctuation" + }, + { + "text": "string", + "kind": "keyword" + }, + { + "text": ">", + "kind": "punctuation" + }, + { + "text": ">", + "kind": "punctuation" + }, + { + "text": ".", + "kind": "punctuation" + }, + { + "text": "method", + "kind": "methodName" + }, + { + "text": "<", + "kind": "punctuation" + }, + { + "text": "U", + "kind": "typeParameterName" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "extends", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "c", + "kind": "className" + }, + { + "text": "<", + "kind": "punctuation" + }, + { + "text": "string", + "kind": "keyword" + }, + { + "text": ">", + "kind": "punctuation" + }, + { + "text": ">", + "kind": "punctuation" + }, + { + "text": "(", + "kind": "punctuation" + }, + { + "text": "a", + "kind": "parameterName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "U", + "kind": "typeParameterName" + }, + { + "text": ",", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "b", + "kind": "parameterName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "T", + "kind": "typeParameterName" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "U", + "kind": "typeParameterName" + } + ], + "documentation": [] + } + }, + { + "marker": { + "fileName": "/tests/cases/fourslash/quickInfoDisplayPartsTypeParameterInClass.ts", + "position": 252 + }, + "quickInfo": { + "kind": "type parameter", + "kindModifiers": "", + "textSpan": { + "start": 252, + "length": 1 + }, + "displayParts": [ + { + "text": "(", + "kind": "punctuation" + }, + { + "text": "type parameter", + "kind": "text" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "U", + "kind": "typeParameterName" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "in", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "c2", + "kind": "className" + }, + { + "text": "<", + "kind": "punctuation" + }, + { + "text": "T", + "kind": "typeParameterName" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "extends", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "c", + "kind": "className" + }, + { + "text": "<", + "kind": "punctuation" + }, + { + "text": "string", + "kind": "keyword" + }, + { + "text": ">", + "kind": "punctuation" + }, + { + "text": ">", + "kind": "punctuation" + }, + { + "text": ".", + "kind": "punctuation" + }, + { + "text": "method", + "kind": "methodName" + }, + { + "text": "<", + "kind": "punctuation" + }, + { + "text": "U", + "kind": "typeParameterName" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "extends", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "c", + "kind": "className" + }, + { + "text": "<", + "kind": "punctuation" + }, + { + "text": "string", + "kind": "keyword" + }, + { + "text": ">", + "kind": "punctuation" + }, + { + "text": ">", + "kind": "punctuation" + }, + { + "text": "(", + "kind": "punctuation" + }, + { + "text": "a", + "kind": "parameterName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "U", + "kind": "typeParameterName" + }, + { + "text": ",", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "b", + "kind": "parameterName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "T", + "kind": "typeParameterName" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "U", + "kind": "typeParameterName" + } + ], + "documentation": [] + } + }, + { + "marker": { + "fileName": "/tests/cases/fourslash/quickInfoDisplayPartsTypeParameterInClass.ts", + "position": 262 + }, + "quickInfo": { + "kind": "class", + "kindModifiers": "", + "textSpan": { + "start": 262, + "length": 1 + }, + "displayParts": [ + { + "text": "class", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "c", + "kind": "className" + }, + { + "text": "<", + "kind": "punctuation" + }, + { + "text": "T", + "kind": "typeParameterName" + }, + { + "text": ">", + "kind": "punctuation" + } + ], + "documentation": [] + } + }, + { + "marker": { + "fileName": "/tests/cases/fourslash/quickInfoDisplayPartsTypeParameterInClass.ts", + "position": 273 + }, + "quickInfo": { + "kind": "parameter", + "kindModifiers": "", + "textSpan": { + "start": 273, + "length": 1 + }, + "displayParts": [ + { + "text": "(", + "kind": "punctuation" + }, + { + "text": "parameter", + "kind": "text" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "a", + "kind": "parameterName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "U", + "kind": "typeParameterName" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "extends", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "c", + "kind": "className" + }, + { + "text": "<", + "kind": "punctuation" + }, + { + "text": "string", + "kind": "keyword" + }, + { + "text": ">", + "kind": "punctuation" + } + ], + "documentation": [] + } + }, + { + "marker": { + "fileName": "/tests/cases/fourslash/quickInfoDisplayPartsTypeParameterInClass.ts", + "position": 276 + }, + "quickInfo": { + "kind": "type parameter", + "kindModifiers": "", + "textSpan": { + "start": 276, + "length": 1 + }, + "displayParts": [ + { + "text": "(", + "kind": "punctuation" + }, + { + "text": "type parameter", + "kind": "text" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "U", + "kind": "typeParameterName" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "in", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "c2", + "kind": "className" + }, + { + "text": "<", + "kind": "punctuation" + }, + { + "text": "T", + "kind": "typeParameterName" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "extends", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "c", + "kind": "className" + }, + { + "text": "<", + "kind": "punctuation" + }, + { + "text": "string", + "kind": "keyword" + }, + { + "text": ">", + "kind": "punctuation" + }, + { + "text": ">", + "kind": "punctuation" + }, + { + "text": ".", + "kind": "punctuation" + }, + { + "text": "method", + "kind": "methodName" + }, + { + "text": "<", + "kind": "punctuation" + }, + { + "text": "U", + "kind": "typeParameterName" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "extends", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "c", + "kind": "className" + }, + { + "text": "<", + "kind": "punctuation" + }, + { + "text": "string", + "kind": "keyword" + }, + { + "text": ">", + "kind": "punctuation" + }, + { + "text": ">", + "kind": "punctuation" + }, + { + "text": "(", + "kind": "punctuation" + }, + { + "text": "a", + "kind": "parameterName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "U", + "kind": "typeParameterName" + }, + { + "text": ",", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "b", + "kind": "parameterName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "T", + "kind": "typeParameterName" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "U", + "kind": "typeParameterName" + } + ], + "documentation": [] + } + }, + { + "marker": { + "fileName": "/tests/cases/fourslash/quickInfoDisplayPartsTypeParameterInClass.ts", + "position": 279 + }, + "quickInfo": { + "kind": "parameter", + "kindModifiers": "", + "textSpan": { + "start": 279, + "length": 1 + }, + "displayParts": [ + { + "text": "(", + "kind": "punctuation" + }, + { + "text": "parameter", + "kind": "text" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "b", + "kind": "parameterName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "T", + "kind": "typeParameterName" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "extends", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "c", + "kind": "className" + }, + { + "text": "<", + "kind": "punctuation" + }, + { + "text": "string", + "kind": "keyword" + }, + { + "text": ">", + "kind": "punctuation" + } + ], + "documentation": [] + } + }, + { + "marker": { + "fileName": "/tests/cases/fourslash/quickInfoDisplayPartsTypeParameterInClass.ts", + "position": 282 + }, + "quickInfo": { + "kind": "type parameter", + "kindModifiers": "", + "textSpan": { + "start": 282, + "length": 1 + }, + "displayParts": [ + { + "text": "(", + "kind": "punctuation" + }, + { + "text": "type parameter", + "kind": "text" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "T", + "kind": "typeParameterName" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "in", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "c2", + "kind": "className" + }, + { + "text": "<", + "kind": "punctuation" + }, + { + "text": "T", + "kind": "typeParameterName" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "extends", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "c", + "kind": "className" + }, + { + "text": "<", + "kind": "punctuation" + }, + { + "text": "string", + "kind": "keyword" + }, + { + "text": ">", + "kind": "punctuation" + }, + { + "text": ">", + "kind": "punctuation" + } + ], + "documentation": [] + } + }, + { + "marker": { + "fileName": "/tests/cases/fourslash/quickInfoDisplayPartsTypeParameterInClass.ts", + "position": 302 + }, + "quickInfo": { + "kind": "parameter", + "kindModifiers": "", + "textSpan": { + "start": 302, + "length": 1 + }, + "displayParts": [ + { + "text": "(", + "kind": "punctuation" + }, + { + "text": "parameter", + "kind": "text" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "a", + "kind": "parameterName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "U", + "kind": "typeParameterName" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "extends", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "c", + "kind": "className" + }, + { + "text": "<", + "kind": "punctuation" + }, + { + "text": "string", + "kind": "keyword" + }, + { + "text": ">", + "kind": "punctuation" + } + ], + "documentation": [] + } + }, + { + "marker": { + "fileName": "/tests/cases/fourslash/quickInfoDisplayPartsTypeParameterInClass.ts", + "position": 317 + }, + "quickInfo": { + "kind": "var", + "kindModifiers": "", + "textSpan": { + "start": 317, + "length": 10 + }, + "displayParts": [ + { + "text": "var", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "cInstance1", + "kind": "localName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "c2", + "kind": "className" + }, + { + "text": "<", + "kind": "punctuation" + }, + { + "text": "c", + "kind": "className" + }, + { + "text": "<", + "kind": "punctuation" + }, + { + "text": "string", + "kind": "keyword" + }, + { + "text": ">", + "kind": "punctuation" + }, + { + "text": ">", + "kind": "punctuation" + } + ], + "documentation": [] + } + }, + { + "marker": { + "fileName": "/tests/cases/fourslash/quickInfoDisplayPartsTypeParameterInClass.ts", + "position": 334 + }, + "quickInfo": { + "kind": "constructor", + "kindModifiers": "", + "textSpan": { + "start": 334, + "length": 2 + }, + "displayParts": [ + { + "text": "constructor", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "c2", + "kind": "className" + }, + { + "text": "<", + "kind": "punctuation" + }, + { + "text": "c", + "kind": "className" + }, + { + "text": "<", + "kind": "punctuation" + }, + { + "text": "string", + "kind": "keyword" + }, + { + "text": ">", + "kind": "punctuation" + }, + { + "text": ">", + "kind": "punctuation" + }, + { + "text": "(", + "kind": "punctuation" + }, + { + "text": "a", + "kind": "parameterName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "c", + "kind": "className" + }, + { + "text": "<", + "kind": "punctuation" + }, + { + "text": "string", + "kind": "keyword" + }, + { + "text": ">", + "kind": "punctuation" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "c2", + "kind": "className" + }, + { + "text": "<", + "kind": "punctuation" + }, + { + "text": "c", + "kind": "className" + }, + { + "text": "<", + "kind": "punctuation" + }, + { + "text": "string", + "kind": "keyword" + }, + { + "text": ">", + "kind": "punctuation" + }, + { + "text": ">", + "kind": "punctuation" + } + ], + "documentation": [] + } + }, + { + "marker": { + "fileName": "/tests/cases/fourslash/quickInfoDisplayPartsTypeParameterInClass.ts", + "position": 337 + }, + "quickInfo": { + "kind": "var", + "kindModifiers": "", + "textSpan": { + "start": 337, + "length": 9 + }, + "displayParts": [ + { + "text": "var", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "cInstance", + "kind": "localName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "c", + "kind": "className" + }, + { + "text": "<", + "kind": "punctuation" + }, + { + "text": "string", + "kind": "keyword" + }, + { + "text": ">", + "kind": "punctuation" + } + ], + "documentation": [] + } + }, + { + "marker": { + "fileName": "/tests/cases/fourslash/quickInfoDisplayPartsTypeParameterInClass.ts", + "position": 353 + }, + "quickInfo": { + "kind": "var", + "kindModifiers": "", + "textSpan": { + "start": 353, + "length": 5 + }, + "displayParts": [ + { + "text": "var", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "cVal2", + "kind": "localName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "typeof", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "c2", + "kind": "className" + } + ], + "documentation": [] + } + }, + { + "marker": { + "fileName": "/tests/cases/fourslash/quickInfoDisplayPartsTypeParameterInClass.ts", + "position": 361 + }, + "quickInfo": { + "kind": "class", + "kindModifiers": "", + "textSpan": { + "start": 361, + "length": 2 + }, + "displayParts": [ + { + "text": "class", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "c2", + "kind": "className" + }, + { + "text": "<", + "kind": "punctuation" + }, + { + "text": "T", + "kind": "typeParameterName" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "extends", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "c", + "kind": "className" + }, + { + "text": "<", + "kind": "punctuation" + }, + { + "text": "string", + "kind": "keyword" + }, + { + "text": ">", + "kind": "punctuation" + }, + { + "text": ">", + "kind": "punctuation" + } + ], + "documentation": [] + } + }, + { + "marker": { + "fileName": "/tests/cases/fourslash/quickInfoDisplayPartsTypeParameterInClass.ts", + "position": 365 + }, + "quickInfo": { + "kind": "var", + "kindModifiers": "", + "textSpan": { + "start": 365, + "length": 10 + }, + "displayParts": [ + { + "text": "var", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "cInstance1", + "kind": "localName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "c2", + "kind": "className" + }, + { + "text": "<", + "kind": "punctuation" + }, + { + "text": "c", + "kind": "className" + }, + { + "text": "<", + "kind": "punctuation" + }, + { + "text": "string", + "kind": "keyword" + }, + { + "text": ">", + "kind": "punctuation" + }, + { + "text": ">", + "kind": "punctuation" + } + ], + "documentation": [] + } + }, + { + "marker": { + "fileName": "/tests/cases/fourslash/quickInfoDisplayPartsTypeParameterInClass.ts", + "position": 376 + }, + "quickInfo": { + "kind": "method", + "kindModifiers": "", + "textSpan": { + "start": 376, + "length": 6 + }, + "displayParts": [ + { + "text": "(", + "kind": "punctuation" + }, + { + "text": "method", + "kind": "text" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "c2", + "kind": "className" + }, + { + "text": "<", + "kind": "punctuation" + }, + { + "text": "c", + "kind": "className" + }, + { + "text": "<", + "kind": "punctuation" + }, + { + "text": "string", + "kind": "keyword" + }, + { + "text": ">", + "kind": "punctuation" + }, + { + "text": ">", + "kind": "punctuation" + }, + { + "text": ".", + "kind": "punctuation" + }, + { + "text": "method", + "kind": "methodName" + }, + { + "text": "<", + "kind": "punctuation" + }, + { + "text": "c", + "kind": "className" + }, + { + "text": "<", + "kind": "punctuation" + }, + { + "text": "string", + "kind": "keyword" + }, + { + "text": ">", + "kind": "punctuation" + }, + { + "text": ">", + "kind": "punctuation" + }, + { + "text": "(", + "kind": "punctuation" + }, + { + "text": "a", + "kind": "parameterName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "c", + "kind": "className" + }, + { + "text": "<", + "kind": "punctuation" + }, + { + "text": "string", + "kind": "keyword" + }, + { + "text": ">", + "kind": "punctuation" + }, + { + "text": ",", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "b", + "kind": "parameterName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "c", + "kind": "className" + }, + { + "text": "<", + "kind": "punctuation" + }, + { + "text": "string", + "kind": "keyword" + }, + { + "text": ">", + "kind": "punctuation" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "c", + "kind": "className" + }, + { + "text": "<", + "kind": "punctuation" + }, + { + "text": "string", + "kind": "keyword" + }, + { + "text": ">", + "kind": "punctuation" + } + ], + "documentation": [] + } + }, + { + "marker": { + "fileName": "/tests/cases/fourslash/quickInfoDisplayPartsTypeParameterInClass.ts", + "position": 383 + }, + "quickInfo": { + "kind": "var", + "kindModifiers": "", + "textSpan": { + "start": 383, + "length": 9 + }, + "displayParts": [ + { + "text": "var", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "cInstance", + "kind": "localName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "c", + "kind": "className" + }, + { + "text": "<", + "kind": "punctuation" + }, + { + "text": "string", + "kind": "keyword" + }, + { + "text": ">", + "kind": "punctuation" + } + ], + "documentation": [] + } + }, + { + "marker": { + "fileName": "/tests/cases/fourslash/quickInfoDisplayPartsTypeParameterInClass.ts", + "position": 394 + }, + "quickInfo": { + "kind": "var", + "kindModifiers": "", + "textSpan": { + "start": 394, + "length": 9 + }, + "displayParts": [ + { + "text": "var", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "cInstance", + "kind": "localName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "c", + "kind": "className" + }, + { + "text": "<", + "kind": "punctuation" + }, + { + "text": "string", + "kind": "keyword" + }, + { + "text": ">", + "kind": "punctuation" + } + ], + "documentation": [] + } + } +] \ No newline at end of file diff --git a/tests/baselines/reference/quickInfoDisplayPartsTypeParameterInFunction.baseline b/tests/baselines/reference/quickInfoDisplayPartsTypeParameterInFunction.baseline new file mode 100644 index 00000000000..278e9396fb6 --- /dev/null +++ b/tests/baselines/reference/quickInfoDisplayPartsTypeParameterInFunction.baseline @@ -0,0 +1,990 @@ +[ + { + "marker": { + "fileName": "/tests/cases/fourslash/quickInfoDisplayPartsTypeParameterInFunction.ts", + "position": 9 + }, + "quickInfo": { + "kind": "function", + "kindModifiers": "", + "textSpan": { + "start": 9, + "length": 3 + }, + "displayParts": [ + { + "text": "function", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "foo", + "kind": "functionName" + }, + { + "text": "<", + "kind": "punctuation" + }, + { + "text": "U", + "kind": "typeParameterName" + }, + { + "text": ">", + "kind": "punctuation" + }, + { + "text": "(", + "kind": "punctuation" + }, + { + "text": "a", + "kind": "parameterName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "U", + "kind": "typeParameterName" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "U", + "kind": "typeParameterName" + } + ], + "documentation": [] + } + }, + { + "marker": { + "fileName": "/tests/cases/fourslash/quickInfoDisplayPartsTypeParameterInFunction.ts", + "position": 13 + }, + "quickInfo": { + "kind": "type parameter", + "kindModifiers": "", + "textSpan": { + "start": 13, + "length": 1 + }, + "displayParts": [ + { + "text": "(", + "kind": "punctuation" + }, + { + "text": "type parameter", + "kind": "text" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "U", + "kind": "typeParameterName" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "in", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "foo", + "kind": "functionName" + }, + { + "text": "<", + "kind": "punctuation" + }, + { + "text": "U", + "kind": "typeParameterName" + }, + { + "text": ">", + "kind": "punctuation" + }, + { + "text": "(", + "kind": "punctuation" + }, + { + "text": "a", + "kind": "parameterName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "U", + "kind": "typeParameterName" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "U", + "kind": "typeParameterName" + } + ], + "documentation": [] + } + }, + { + "marker": { + "fileName": "/tests/cases/fourslash/quickInfoDisplayPartsTypeParameterInFunction.ts", + "position": 16 + }, + "quickInfo": { + "kind": "parameter", + "kindModifiers": "", + "textSpan": { + "start": 16, + "length": 1 + }, + "displayParts": [ + { + "text": "(", + "kind": "punctuation" + }, + { + "text": "parameter", + "kind": "text" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "a", + "kind": "parameterName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "U", + "kind": "typeParameterName" + } + ], + "documentation": [] + } + }, + { + "marker": { + "fileName": "/tests/cases/fourslash/quickInfoDisplayPartsTypeParameterInFunction.ts", + "position": 19 + }, + "quickInfo": { + "kind": "type parameter", + "kindModifiers": "", + "textSpan": { + "start": 19, + "length": 1 + }, + "displayParts": [ + { + "text": "(", + "kind": "punctuation" + }, + { + "text": "type parameter", + "kind": "text" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "U", + "kind": "typeParameterName" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "in", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "foo", + "kind": "functionName" + }, + { + "text": "<", + "kind": "punctuation" + }, + { + "text": "U", + "kind": "typeParameterName" + }, + { + "text": ">", + "kind": "punctuation" + }, + { + "text": "(", + "kind": "punctuation" + }, + { + "text": "a", + "kind": "parameterName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "U", + "kind": "typeParameterName" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "U", + "kind": "typeParameterName" + } + ], + "documentation": [] + } + }, + { + "marker": { + "fileName": "/tests/cases/fourslash/quickInfoDisplayPartsTypeParameterInFunction.ts", + "position": 35 + }, + "quickInfo": { + "kind": "parameter", + "kindModifiers": "", + "textSpan": { + "start": 35, + "length": 1 + }, + "displayParts": [ + { + "text": "(", + "kind": "punctuation" + }, + { + "text": "parameter", + "kind": "text" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "a", + "kind": "parameterName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "U", + "kind": "typeParameterName" + } + ], + "documentation": [] + } + }, + { + "marker": { + "fileName": "/tests/cases/fourslash/quickInfoDisplayPartsTypeParameterInFunction.ts", + "position": 40 + }, + "quickInfo": { + "kind": "function", + "kindModifiers": "", + "textSpan": { + "start": 40, + "length": 3 + }, + "displayParts": [ + { + "text": "function", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "foo", + "kind": "functionName" + }, + { + "text": "<", + "kind": "punctuation" + }, + { + "text": "\"Hello\"", + "kind": "stringLiteral" + }, + { + "text": ">", + "kind": "punctuation" + }, + { + "text": "(", + "kind": "punctuation" + }, + { + "text": "a", + "kind": "parameterName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "\"Hello\"", + "kind": "stringLiteral" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "\"Hello\"", + "kind": "stringLiteral" + } + ], + "documentation": [] + } + }, + { + "marker": { + "fileName": "/tests/cases/fourslash/quickInfoDisplayPartsTypeParameterInFunction.ts", + "position": 63 + }, + "quickInfo": { + "kind": "function", + "kindModifiers": "", + "textSpan": { + "start": 63, + "length": 4 + }, + "displayParts": [ + { + "text": "function", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "foo2", + "kind": "functionName" + }, + { + "text": "<", + "kind": "punctuation" + }, + { + "text": "U", + "kind": "typeParameterName" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "extends", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "string", + "kind": "keyword" + }, + { + "text": ">", + "kind": "punctuation" + }, + { + "text": "(", + "kind": "punctuation" + }, + { + "text": "a", + "kind": "parameterName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "U", + "kind": "typeParameterName" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "U", + "kind": "typeParameterName" + } + ], + "documentation": [] + } + }, + { + "marker": { + "fileName": "/tests/cases/fourslash/quickInfoDisplayPartsTypeParameterInFunction.ts", + "position": 68 + }, + "quickInfo": { + "kind": "type parameter", + "kindModifiers": "", + "textSpan": { + "start": 68, + "length": 1 + }, + "displayParts": [ + { + "text": "(", + "kind": "punctuation" + }, + { + "text": "type parameter", + "kind": "text" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "U", + "kind": "typeParameterName" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "in", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "foo2", + "kind": "functionName" + }, + { + "text": "<", + "kind": "punctuation" + }, + { + "text": "U", + "kind": "typeParameterName" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "extends", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "string", + "kind": "keyword" + }, + { + "text": ">", + "kind": "punctuation" + }, + { + "text": "(", + "kind": "punctuation" + }, + { + "text": "a", + "kind": "parameterName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "U", + "kind": "typeParameterName" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "U", + "kind": "typeParameterName" + } + ], + "documentation": [] + } + }, + { + "marker": { + "fileName": "/tests/cases/fourslash/quickInfoDisplayPartsTypeParameterInFunction.ts", + "position": 86 + }, + "quickInfo": { + "kind": "parameter", + "kindModifiers": "", + "textSpan": { + "start": 86, + "length": 1 + }, + "displayParts": [ + { + "text": "(", + "kind": "punctuation" + }, + { + "text": "parameter", + "kind": "text" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "a", + "kind": "parameterName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "U", + "kind": "typeParameterName" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "extends", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "string", + "kind": "keyword" + } + ], + "documentation": [] + } + }, + { + "marker": { + "fileName": "/tests/cases/fourslash/quickInfoDisplayPartsTypeParameterInFunction.ts", + "position": 89 + }, + "quickInfo": { + "kind": "type parameter", + "kindModifiers": "", + "textSpan": { + "start": 89, + "length": 1 + }, + "displayParts": [ + { + "text": "(", + "kind": "punctuation" + }, + { + "text": "type parameter", + "kind": "text" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "U", + "kind": "typeParameterName" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "in", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "foo2", + "kind": "functionName" + }, + { + "text": "<", + "kind": "punctuation" + }, + { + "text": "U", + "kind": "typeParameterName" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "extends", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "string", + "kind": "keyword" + }, + { + "text": ">", + "kind": "punctuation" + }, + { + "text": "(", + "kind": "punctuation" + }, + { + "text": "a", + "kind": "parameterName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "U", + "kind": "typeParameterName" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "U", + "kind": "typeParameterName" + } + ], + "documentation": [] + } + }, + { + "marker": { + "fileName": "/tests/cases/fourslash/quickInfoDisplayPartsTypeParameterInFunction.ts", + "position": 105 + }, + "quickInfo": { + "kind": "parameter", + "kindModifiers": "", + "textSpan": { + "start": 105, + "length": 1 + }, + "displayParts": [ + { + "text": "(", + "kind": "punctuation" + }, + { + "text": "parameter", + "kind": "text" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "a", + "kind": "parameterName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "U", + "kind": "typeParameterName" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "extends", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "string", + "kind": "keyword" + } + ], + "documentation": [] + } + }, + { + "marker": { + "fileName": "/tests/cases/fourslash/quickInfoDisplayPartsTypeParameterInFunction.ts", + "position": 110 + }, + "quickInfo": { + "kind": "function", + "kindModifiers": "", + "textSpan": { + "start": 110, + "length": 4 + }, + "displayParts": [ + { + "text": "function", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "foo2", + "kind": "functionName" + }, + { + "text": "<", + "kind": "punctuation" + }, + { + "text": "\"hello\"", + "kind": "stringLiteral" + }, + { + "text": ">", + "kind": "punctuation" + }, + { + "text": "(", + "kind": "punctuation" + }, + { + "text": "a", + "kind": "parameterName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "\"hello\"", + "kind": "stringLiteral" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "\"hello\"", + "kind": "stringLiteral" + } + ], + "documentation": [] + } + } +] \ No newline at end of file diff --git a/tests/baselines/reference/quickInfoDisplayPartsTypeParameterInFunctionLikeInTypeAlias.baseline b/tests/baselines/reference/quickInfoDisplayPartsTypeParameterInFunctionLikeInTypeAlias.baseline new file mode 100644 index 00000000000..50f0ac16a1c --- /dev/null +++ b/tests/baselines/reference/quickInfoDisplayPartsTypeParameterInFunctionLikeInTypeAlias.baseline @@ -0,0 +1,221 @@ +[ + { + "marker": { + "fileName": "/tests/cases/fourslash/quickInfoDisplayPartsTypeParameterInFunctionLikeInTypeAlias.ts", + "position": 30 + }, + "quickInfo": { + "kind": "type parameter", + "kindModifiers": "", + "textSpan": { + "start": 30, + "length": 1 + }, + "displayParts": [ + { + "text": "(", + "kind": "punctuation" + }, + { + "text": "type parameter", + "kind": "text" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "A", + "kind": "typeParameterName" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "in", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "type", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "MixinCtor", + "kind": "aliasName" + }, + { + "text": "<", + "kind": "punctuation" + }, + { + "text": "A", + "kind": "typeParameterName" + }, + { + "text": ">", + "kind": "punctuation" + } + ], + "documentation": [] + } + }, + { + "marker": { + "fileName": "/tests/cases/fourslash/quickInfoDisplayPartsTypeParameterInFunctionLikeInTypeAlias.ts", + "position": 59 + }, + "quickInfo": { + "kind": "type parameter", + "kindModifiers": "", + "textSpan": { + "start": 59, + "length": 1 + }, + "displayParts": [ + { + "text": "(", + "kind": "punctuation" + }, + { + "text": "type parameter", + "kind": "text" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "A", + "kind": "typeParameterName" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "in", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "type", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "MixinCtor", + "kind": "aliasName" + }, + { + "text": "<", + "kind": "punctuation" + }, + { + "text": "A", + "kind": "typeParameterName" + }, + { + "text": ">", + "kind": "punctuation" + } + ], + "documentation": [] + } + }, + { + "marker": { + "fileName": "/tests/cases/fourslash/quickInfoDisplayPartsTypeParameterInFunctionLikeInTypeAlias.ts", + "position": 139 + }, + "quickInfo": { + "kind": "type parameter", + "kindModifiers": "", + "textSpan": { + "start": 139, + "length": 1 + }, + "displayParts": [ + { + "text": "(", + "kind": "punctuation" + }, + { + "text": "type parameter", + "kind": "text" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "A", + "kind": "typeParameterName" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "in", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "type", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "MixinCtor", + "kind": "aliasName" + }, + { + "text": "<", + "kind": "punctuation" + }, + { + "text": "A", + "kind": "typeParameterName" + }, + { + "text": ">", + "kind": "punctuation" + } + ], + "documentation": [] + } + } +] \ No newline at end of file diff --git a/tests/baselines/reference/quickInfoDisplayPartsTypeParameterInInterface.baseline b/tests/baselines/reference/quickInfoDisplayPartsTypeParameterInInterface.baseline new file mode 100644 index 00000000000..1306ed9cc97 --- /dev/null +++ b/tests/baselines/reference/quickInfoDisplayPartsTypeParameterInInterface.baseline @@ -0,0 +1,6287 @@ +[ + { + "marker": { + "fileName": "/tests/cases/fourslash/quickInfoDisplayPartsTypeParameterInInterface.ts", + "position": 10 + }, + "quickInfo": { + "kind": "interface", + "kindModifiers": "", + "textSpan": { + "start": 10, + "length": 1 + }, + "displayParts": [ + { + "text": "interface", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "I", + "kind": "interfaceName" + }, + { + "text": "<", + "kind": "punctuation" + }, + { + "text": "T", + "kind": "typeParameterName" + }, + { + "text": ">", + "kind": "punctuation" + } + ], + "documentation": [] + } + }, + { + "marker": { + "fileName": "/tests/cases/fourslash/quickInfoDisplayPartsTypeParameterInInterface.ts", + "position": 12 + }, + "quickInfo": { + "kind": "type parameter", + "kindModifiers": "", + "textSpan": { + "start": 12, + "length": 1 + }, + "displayParts": [ + { + "text": "(", + "kind": "punctuation" + }, + { + "text": "type parameter", + "kind": "text" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "T", + "kind": "typeParameterName" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "in", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "I", + "kind": "interfaceName" + }, + { + "text": "<", + "kind": "punctuation" + }, + { + "text": "T", + "kind": "typeParameterName" + }, + { + "text": ">", + "kind": "punctuation" + } + ], + "documentation": [] + } + }, + { + "marker": { + "fileName": "/tests/cases/fourslash/quickInfoDisplayPartsTypeParameterInInterface.ts", + "position": 26 + }, + "quickInfo": { + "kind": "type parameter", + "kindModifiers": "", + "textSpan": { + "start": 26, + "length": 1 + }, + "displayParts": [ + { + "text": "(", + "kind": "punctuation" + }, + { + "text": "type parameter", + "kind": "text" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "U", + "kind": "typeParameterName" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "in", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "new", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "<", + "kind": "punctuation" + }, + { + "text": "U", + "kind": "typeParameterName" + }, + { + "text": ">", + "kind": "punctuation" + }, + { + "text": "(", + "kind": "punctuation" + }, + { + "text": "a", + "kind": "parameterName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "U", + "kind": "typeParameterName" + }, + { + "text": ",", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "b", + "kind": "parameterName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "T", + "kind": "typeParameterName" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "U", + "kind": "typeParameterName" + } + ], + "documentation": [] + } + }, + { + "marker": { + "fileName": "/tests/cases/fourslash/quickInfoDisplayPartsTypeParameterInInterface.ts", + "position": 29 + }, + "quickInfo": { + "kind": "parameter", + "kindModifiers": "", + "textSpan": { + "start": 29, + "length": 1 + }, + "displayParts": [ + { + "text": "(", + "kind": "punctuation" + }, + { + "text": "parameter", + "kind": "text" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "a", + "kind": "parameterName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "U", + "kind": "typeParameterName" + } + ], + "documentation": [] + } + }, + { + "marker": { + "fileName": "/tests/cases/fourslash/quickInfoDisplayPartsTypeParameterInInterface.ts", + "position": 32 + }, + "quickInfo": { + "kind": "type parameter", + "kindModifiers": "", + "textSpan": { + "start": 32, + "length": 1 + }, + "displayParts": [ + { + "text": "(", + "kind": "punctuation" + }, + { + "text": "type parameter", + "kind": "text" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "U", + "kind": "typeParameterName" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "in", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "new", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "<", + "kind": "punctuation" + }, + { + "text": "U", + "kind": "typeParameterName" + }, + { + "text": ">", + "kind": "punctuation" + }, + { + "text": "(", + "kind": "punctuation" + }, + { + "text": "a", + "kind": "parameterName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "U", + "kind": "typeParameterName" + }, + { + "text": ",", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "b", + "kind": "parameterName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "T", + "kind": "typeParameterName" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "U", + "kind": "typeParameterName" + } + ], + "documentation": [] + } + }, + { + "marker": { + "fileName": "/tests/cases/fourslash/quickInfoDisplayPartsTypeParameterInInterface.ts", + "position": 35 + }, + "quickInfo": { + "kind": "parameter", + "kindModifiers": "", + "textSpan": { + "start": 35, + "length": 1 + }, + "displayParts": [ + { + "text": "(", + "kind": "punctuation" + }, + { + "text": "parameter", + "kind": "text" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "b", + "kind": "parameterName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "T", + "kind": "typeParameterName" + } + ], + "documentation": [] + } + }, + { + "marker": { + "fileName": "/tests/cases/fourslash/quickInfoDisplayPartsTypeParameterInInterface.ts", + "position": 38 + }, + "quickInfo": { + "kind": "type parameter", + "kindModifiers": "", + "textSpan": { + "start": 38, + "length": 1 + }, + "displayParts": [ + { + "text": "(", + "kind": "punctuation" + }, + { + "text": "type parameter", + "kind": "text" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "T", + "kind": "typeParameterName" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "in", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "I", + "kind": "interfaceName" + }, + { + "text": "<", + "kind": "punctuation" + }, + { + "text": "T", + "kind": "typeParameterName" + }, + { + "text": ">", + "kind": "punctuation" + } + ], + "documentation": [] + } + }, + { + "marker": { + "fileName": "/tests/cases/fourslash/quickInfoDisplayPartsTypeParameterInInterface.ts", + "position": 42 + }, + "quickInfo": { + "kind": "type parameter", + "kindModifiers": "", + "textSpan": { + "start": 42, + "length": 1 + }, + "displayParts": [ + { + "text": "(", + "kind": "punctuation" + }, + { + "text": "type parameter", + "kind": "text" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "U", + "kind": "typeParameterName" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "in", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "new", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "<", + "kind": "punctuation" + }, + { + "text": "U", + "kind": "typeParameterName" + }, + { + "text": ">", + "kind": "punctuation" + }, + { + "text": "(", + "kind": "punctuation" + }, + { + "text": "a", + "kind": "parameterName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "U", + "kind": "typeParameterName" + }, + { + "text": ",", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "b", + "kind": "parameterName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "T", + "kind": "typeParameterName" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "U", + "kind": "typeParameterName" + } + ], + "documentation": [] + } + }, + { + "marker": { + "fileName": "/tests/cases/fourslash/quickInfoDisplayPartsTypeParameterInInterface.ts", + "position": 50 + }, + "quickInfo": { + "kind": "type parameter", + "kindModifiers": "", + "textSpan": { + "start": 50, + "length": 1 + }, + "displayParts": [ + { + "text": "(", + "kind": "punctuation" + }, + { + "text": "type parameter", + "kind": "text" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "U", + "kind": "typeParameterName" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "in", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "<", + "kind": "punctuation" + }, + { + "text": "U", + "kind": "typeParameterName" + }, + { + "text": ">", + "kind": "punctuation" + }, + { + "text": "(", + "kind": "punctuation" + }, + { + "text": "a", + "kind": "parameterName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "U", + "kind": "typeParameterName" + }, + { + "text": ",", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "b", + "kind": "parameterName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "T", + "kind": "typeParameterName" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "U", + "kind": "typeParameterName" + } + ], + "documentation": [] + } + }, + { + "marker": { + "fileName": "/tests/cases/fourslash/quickInfoDisplayPartsTypeParameterInInterface.ts", + "position": 53 + }, + "quickInfo": { + "kind": "parameter", + "kindModifiers": "", + "textSpan": { + "start": 53, + "length": 1 + }, + "displayParts": [ + { + "text": "(", + "kind": "punctuation" + }, + { + "text": "parameter", + "kind": "text" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "a", + "kind": "parameterName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "U", + "kind": "typeParameterName" + } + ], + "documentation": [] + } + }, + { + "marker": { + "fileName": "/tests/cases/fourslash/quickInfoDisplayPartsTypeParameterInInterface.ts", + "position": 56 + }, + "quickInfo": { + "kind": "type parameter", + "kindModifiers": "", + "textSpan": { + "start": 56, + "length": 1 + }, + "displayParts": [ + { + "text": "(", + "kind": "punctuation" + }, + { + "text": "type parameter", + "kind": "text" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "U", + "kind": "typeParameterName" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "in", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "<", + "kind": "punctuation" + }, + { + "text": "U", + "kind": "typeParameterName" + }, + { + "text": ">", + "kind": "punctuation" + }, + { + "text": "(", + "kind": "punctuation" + }, + { + "text": "a", + "kind": "parameterName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "U", + "kind": "typeParameterName" + }, + { + "text": ",", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "b", + "kind": "parameterName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "T", + "kind": "typeParameterName" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "U", + "kind": "typeParameterName" + } + ], + "documentation": [] + } + }, + { + "marker": { + "fileName": "/tests/cases/fourslash/quickInfoDisplayPartsTypeParameterInInterface.ts", + "position": 59 + }, + "quickInfo": { + "kind": "parameter", + "kindModifiers": "", + "textSpan": { + "start": 59, + "length": 1 + }, + "displayParts": [ + { + "text": "(", + "kind": "punctuation" + }, + { + "text": "parameter", + "kind": "text" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "b", + "kind": "parameterName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "T", + "kind": "typeParameterName" + } + ], + "documentation": [] + } + }, + { + "marker": { + "fileName": "/tests/cases/fourslash/quickInfoDisplayPartsTypeParameterInInterface.ts", + "position": 62 + }, + "quickInfo": { + "kind": "type parameter", + "kindModifiers": "", + "textSpan": { + "start": 62, + "length": 1 + }, + "displayParts": [ + { + "text": "(", + "kind": "punctuation" + }, + { + "text": "type parameter", + "kind": "text" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "T", + "kind": "typeParameterName" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "in", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "I", + "kind": "interfaceName" + }, + { + "text": "<", + "kind": "punctuation" + }, + { + "text": "T", + "kind": "typeParameterName" + }, + { + "text": ">", + "kind": "punctuation" + } + ], + "documentation": [] + } + }, + { + "marker": { + "fileName": "/tests/cases/fourslash/quickInfoDisplayPartsTypeParameterInInterface.ts", + "position": 66 + }, + "quickInfo": { + "kind": "type parameter", + "kindModifiers": "", + "textSpan": { + "start": 66, + "length": 1 + }, + "displayParts": [ + { + "text": "(", + "kind": "punctuation" + }, + { + "text": "type parameter", + "kind": "text" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "U", + "kind": "typeParameterName" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "in", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "<", + "kind": "punctuation" + }, + { + "text": "U", + "kind": "typeParameterName" + }, + { + "text": ">", + "kind": "punctuation" + }, + { + "text": "(", + "kind": "punctuation" + }, + { + "text": "a", + "kind": "parameterName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "U", + "kind": "typeParameterName" + }, + { + "text": ",", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "b", + "kind": "parameterName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "T", + "kind": "typeParameterName" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "U", + "kind": "typeParameterName" + } + ], + "documentation": [] + } + }, + { + "marker": { + "fileName": "/tests/cases/fourslash/quickInfoDisplayPartsTypeParameterInInterface.ts", + "position": 73 + }, + "quickInfo": { + "kind": "method", + "kindModifiers": "", + "textSpan": { + "start": 73, + "length": 6 + }, + "displayParts": [ + { + "text": "(", + "kind": "punctuation" + }, + { + "text": "method", + "kind": "text" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "I", + "kind": "interfaceName" + }, + { + "text": "<", + "kind": "punctuation" + }, + { + "text": "T", + "kind": "typeParameterName" + }, + { + "text": ">", + "kind": "punctuation" + }, + { + "text": ".", + "kind": "punctuation" + }, + { + "text": "method", + "kind": "methodName" + }, + { + "text": "<", + "kind": "punctuation" + }, + { + "text": "U", + "kind": "typeParameterName" + }, + { + "text": ">", + "kind": "punctuation" + }, + { + "text": "(", + "kind": "punctuation" + }, + { + "text": "a", + "kind": "parameterName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "U", + "kind": "typeParameterName" + }, + { + "text": ",", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "b", + "kind": "parameterName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "T", + "kind": "typeParameterName" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "U", + "kind": "typeParameterName" + } + ], + "documentation": [] + } + }, + { + "marker": { + "fileName": "/tests/cases/fourslash/quickInfoDisplayPartsTypeParameterInInterface.ts", + "position": 80 + }, + "quickInfo": { + "kind": "type parameter", + "kindModifiers": "", + "textSpan": { + "start": 80, + "length": 1 + }, + "displayParts": [ + { + "text": "(", + "kind": "punctuation" + }, + { + "text": "type parameter", + "kind": "text" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "U", + "kind": "typeParameterName" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "in", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "I", + "kind": "interfaceName" + }, + { + "text": "<", + "kind": "punctuation" + }, + { + "text": "T", + "kind": "typeParameterName" + }, + { + "text": ">", + "kind": "punctuation" + }, + { + "text": ".", + "kind": "punctuation" + }, + { + "text": "method", + "kind": "methodName" + }, + { + "text": "<", + "kind": "punctuation" + }, + { + "text": "U", + "kind": "typeParameterName" + }, + { + "text": ">", + "kind": "punctuation" + }, + { + "text": "(", + "kind": "punctuation" + }, + { + "text": "a", + "kind": "parameterName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "U", + "kind": "typeParameterName" + }, + { + "text": ",", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "b", + "kind": "parameterName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "T", + "kind": "typeParameterName" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "U", + "kind": "typeParameterName" + } + ], + "documentation": [] + } + }, + { + "marker": { + "fileName": "/tests/cases/fourslash/quickInfoDisplayPartsTypeParameterInInterface.ts", + "position": 83 + }, + "quickInfo": { + "kind": "parameter", + "kindModifiers": "", + "textSpan": { + "start": 83, + "length": 1 + }, + "displayParts": [ + { + "text": "(", + "kind": "punctuation" + }, + { + "text": "parameter", + "kind": "text" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "a", + "kind": "parameterName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "U", + "kind": "typeParameterName" + } + ], + "documentation": [] + } + }, + { + "marker": { + "fileName": "/tests/cases/fourslash/quickInfoDisplayPartsTypeParameterInInterface.ts", + "position": 86 + }, + "quickInfo": { + "kind": "type parameter", + "kindModifiers": "", + "textSpan": { + "start": 86, + "length": 1 + }, + "displayParts": [ + { + "text": "(", + "kind": "punctuation" + }, + { + "text": "type parameter", + "kind": "text" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "U", + "kind": "typeParameterName" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "in", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "I", + "kind": "interfaceName" + }, + { + "text": "<", + "kind": "punctuation" + }, + { + "text": "T", + "kind": "typeParameterName" + }, + { + "text": ">", + "kind": "punctuation" + }, + { + "text": ".", + "kind": "punctuation" + }, + { + "text": "method", + "kind": "methodName" + }, + { + "text": "<", + "kind": "punctuation" + }, + { + "text": "U", + "kind": "typeParameterName" + }, + { + "text": ">", + "kind": "punctuation" + }, + { + "text": "(", + "kind": "punctuation" + }, + { + "text": "a", + "kind": "parameterName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "U", + "kind": "typeParameterName" + }, + { + "text": ",", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "b", + "kind": "parameterName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "T", + "kind": "typeParameterName" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "U", + "kind": "typeParameterName" + } + ], + "documentation": [] + } + }, + { + "marker": { + "fileName": "/tests/cases/fourslash/quickInfoDisplayPartsTypeParameterInInterface.ts", + "position": 89 + }, + "quickInfo": { + "kind": "parameter", + "kindModifiers": "", + "textSpan": { + "start": 89, + "length": 1 + }, + "displayParts": [ + { + "text": "(", + "kind": "punctuation" + }, + { + "text": "parameter", + "kind": "text" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "b", + "kind": "parameterName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "T", + "kind": "typeParameterName" + } + ], + "documentation": [] + } + }, + { + "marker": { + "fileName": "/tests/cases/fourslash/quickInfoDisplayPartsTypeParameterInInterface.ts", + "position": 92 + }, + "quickInfo": { + "kind": "type parameter", + "kindModifiers": "", + "textSpan": { + "start": 92, + "length": 1 + }, + "displayParts": [ + { + "text": "(", + "kind": "punctuation" + }, + { + "text": "type parameter", + "kind": "text" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "T", + "kind": "typeParameterName" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "in", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "I", + "kind": "interfaceName" + }, + { + "text": "<", + "kind": "punctuation" + }, + { + "text": "T", + "kind": "typeParameterName" + }, + { + "text": ">", + "kind": "punctuation" + } + ], + "documentation": [] + } + }, + { + "marker": { + "fileName": "/tests/cases/fourslash/quickInfoDisplayPartsTypeParameterInInterface.ts", + "position": 96 + }, + "quickInfo": { + "kind": "type parameter", + "kindModifiers": "", + "textSpan": { + "start": 96, + "length": 1 + }, + "displayParts": [ + { + "text": "(", + "kind": "punctuation" + }, + { + "text": "type parameter", + "kind": "text" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "U", + "kind": "typeParameterName" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "in", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "I", + "kind": "interfaceName" + }, + { + "text": "<", + "kind": "punctuation" + }, + { + "text": "T", + "kind": "typeParameterName" + }, + { + "text": ">", + "kind": "punctuation" + }, + { + "text": ".", + "kind": "punctuation" + }, + { + "text": "method", + "kind": "methodName" + }, + { + "text": "<", + "kind": "punctuation" + }, + { + "text": "U", + "kind": "typeParameterName" + }, + { + "text": ">", + "kind": "punctuation" + }, + { + "text": "(", + "kind": "punctuation" + }, + { + "text": "a", + "kind": "parameterName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "U", + "kind": "typeParameterName" + }, + { + "text": ",", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "b", + "kind": "parameterName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "T", + "kind": "typeParameterName" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "U", + "kind": "typeParameterName" + } + ], + "documentation": [] + } + }, + { + "marker": { + "fileName": "/tests/cases/fourslash/quickInfoDisplayPartsTypeParameterInInterface.ts", + "position": 105 + }, + "quickInfo": { + "kind": "var", + "kindModifiers": "", + "textSpan": { + "start": 105, + "length": 4 + }, + "displayParts": [ + { + "text": "var", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "iVal", + "kind": "localName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "I", + "kind": "interfaceName" + }, + { + "text": "<", + "kind": "punctuation" + }, + { + "text": "string", + "kind": "keyword" + }, + { + "text": ">", + "kind": "punctuation" + } + ], + "documentation": [] + } + }, + { + "marker": { + "fileName": "/tests/cases/fourslash/quickInfoDisplayPartsTypeParameterInInterface.ts", + "position": 111 + }, + "quickInfo": { + "kind": "interface", + "kindModifiers": "", + "textSpan": { + "start": 111, + "length": 1 + }, + "displayParts": [ + { + "text": "interface", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "I", + "kind": "interfaceName" + }, + { + "text": "<", + "kind": "punctuation" + }, + { + "text": "T", + "kind": "typeParameterName" + }, + { + "text": ">", + "kind": "punctuation" + } + ], + "documentation": [] + } + }, + { + "marker": { + "fileName": "/tests/cases/fourslash/quickInfoDisplayPartsTypeParameterInInterface.ts", + "position": 126 + }, + "quickInfo": { + "kind": "var", + "kindModifiers": "", + "textSpan": { + "start": 126, + "length": 4 + }, + "displayParts": [ + { + "text": "var", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "iVal", + "kind": "localName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "new", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "I", + "kind": "interfaceName" + }, + { + "text": "<", + "kind": "punctuation" + }, + { + "text": "\"hello\"", + "kind": "stringLiteral" + }, + { + "text": ">", + "kind": "punctuation" + }, + { + "text": "(", + "kind": "punctuation" + }, + { + "text": "a", + "kind": "parameterName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "\"hello\"", + "kind": "stringLiteral" + }, + { + "text": ",", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "b", + "kind": "parameterName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "string", + "kind": "keyword" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "=>", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "\"hello\"", + "kind": "stringLiteral" + } + ], + "documentation": [] + } + }, + { + "marker": { + "fileName": "/tests/cases/fourslash/quickInfoDisplayPartsTypeParameterInInterface.ts", + "position": 150 + }, + "quickInfo": { + "kind": "var", + "kindModifiers": "", + "textSpan": { + "start": 150, + "length": 4 + }, + "displayParts": [ + { + "text": "var", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "iVal", + "kind": "localName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "I", + "kind": "interfaceName" + }, + { + "text": "<", + "kind": "punctuation" + }, + { + "text": "\"hello\"", + "kind": "stringLiteral" + }, + { + "text": ">", + "kind": "punctuation" + }, + { + "text": "(", + "kind": "punctuation" + }, + { + "text": "a", + "kind": "parameterName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "\"hello\"", + "kind": "stringLiteral" + }, + { + "text": ",", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "b", + "kind": "parameterName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "string", + "kind": "keyword" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "=>", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "\"hello\"", + "kind": "stringLiteral" + } + ], + "documentation": [] + } + }, + { + "marker": { + "fileName": "/tests/cases/fourslash/quickInfoDisplayPartsTypeParameterInInterface.ts", + "position": 174 + }, + "quickInfo": { + "kind": "var", + "kindModifiers": "", + "textSpan": { + "start": 174, + "length": 4 + }, + "displayParts": [ + { + "text": "var", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "iVal", + "kind": "localName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "I", + "kind": "interfaceName" + }, + { + "text": "<", + "kind": "punctuation" + }, + { + "text": "string", + "kind": "keyword" + }, + { + "text": ">", + "kind": "punctuation" + } + ], + "documentation": [] + } + }, + { + "marker": { + "fileName": "/tests/cases/fourslash/quickInfoDisplayPartsTypeParameterInInterface.ts", + "position": 179 + }, + "quickInfo": { + "kind": "method", + "kindModifiers": "", + "textSpan": { + "start": 179, + "length": 6 + }, + "displayParts": [ + { + "text": "(", + "kind": "punctuation" + }, + { + "text": "method", + "kind": "text" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "I", + "kind": "interfaceName" + }, + { + "text": "<", + "kind": "punctuation" + }, + { + "text": "string", + "kind": "keyword" + }, + { + "text": ">", + "kind": "punctuation" + }, + { + "text": ".", + "kind": "punctuation" + }, + { + "text": "method", + "kind": "methodName" + }, + { + "text": "<", + "kind": "punctuation" + }, + { + "text": "\"hello\"", + "kind": "stringLiteral" + }, + { + "text": ">", + "kind": "punctuation" + }, + { + "text": "(", + "kind": "punctuation" + }, + { + "text": "a", + "kind": "parameterName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "\"hello\"", + "kind": "stringLiteral" + }, + { + "text": ",", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "b", + "kind": "parameterName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "string", + "kind": "keyword" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "\"hello\"", + "kind": "stringLiteral" + } + ], + "documentation": [] + } + }, + { + "marker": { + "fileName": "/tests/cases/fourslash/quickInfoDisplayPartsTypeParameterInInterface.ts", + "position": 215 + }, + "quickInfo": { + "kind": "interface", + "kindModifiers": "", + "textSpan": { + "start": 215, + "length": 2 + }, + "displayParts": [ + { + "text": "interface", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "I1", + "kind": "interfaceName" + }, + { + "text": "<", + "kind": "punctuation" + }, + { + "text": "T", + "kind": "typeParameterName" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "extends", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "I", + "kind": "interfaceName" + }, + { + "text": "<", + "kind": "punctuation" + }, + { + "text": "string", + "kind": "keyword" + }, + { + "text": ">", + "kind": "punctuation" + }, + { + "text": ">", + "kind": "punctuation" + } + ], + "documentation": [] + } + }, + { + "marker": { + "fileName": "/tests/cases/fourslash/quickInfoDisplayPartsTypeParameterInInterface.ts", + "position": 218 + }, + "quickInfo": { + "kind": "type parameter", + "kindModifiers": "", + "textSpan": { + "start": 218, + "length": 1 + }, + "displayParts": [ + { + "text": "(", + "kind": "punctuation" + }, + { + "text": "type parameter", + "kind": "text" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "T", + "kind": "typeParameterName" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "in", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "I1", + "kind": "interfaceName" + }, + { + "text": "<", + "kind": "punctuation" + }, + { + "text": "T", + "kind": "typeParameterName" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "extends", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "I", + "kind": "interfaceName" + }, + { + "text": "<", + "kind": "punctuation" + }, + { + "text": "string", + "kind": "keyword" + }, + { + "text": ">", + "kind": "punctuation" + }, + { + "text": ">", + "kind": "punctuation" + } + ], + "documentation": [] + } + }, + { + "marker": { + "fileName": "/tests/cases/fourslash/quickInfoDisplayPartsTypeParameterInInterface.ts", + "position": 228 + }, + "quickInfo": { + "kind": "interface", + "kindModifiers": "", + "textSpan": { + "start": 228, + "length": 1 + }, + "displayParts": [ + { + "text": "interface", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "I", + "kind": "interfaceName" + }, + { + "text": "<", + "kind": "punctuation" + }, + { + "text": "T", + "kind": "typeParameterName" + }, + { + "text": ">", + "kind": "punctuation" + } + ], + "documentation": [] + } + }, + { + "marker": { + "fileName": "/tests/cases/fourslash/quickInfoDisplayPartsTypeParameterInInterface.ts", + "position": 250 + }, + "quickInfo": { + "kind": "type parameter", + "kindModifiers": "", + "textSpan": { + "start": 250, + "length": 1 + }, + "displayParts": [ + { + "text": "(", + "kind": "punctuation" + }, + { + "text": "type parameter", + "kind": "text" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "U", + "kind": "typeParameterName" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "in", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "new", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "<", + "kind": "punctuation" + }, + { + "text": "U", + "kind": "typeParameterName" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "extends", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "I", + "kind": "interfaceName" + }, + { + "text": "<", + "kind": "punctuation" + }, + { + "text": "string", + "kind": "keyword" + }, + { + "text": ">", + "kind": "punctuation" + }, + { + "text": ">", + "kind": "punctuation" + }, + { + "text": "(", + "kind": "punctuation" + }, + { + "text": "a", + "kind": "parameterName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "U", + "kind": "typeParameterName" + }, + { + "text": ",", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "b", + "kind": "parameterName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "T", + "kind": "typeParameterName" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "U", + "kind": "typeParameterName" + } + ], + "documentation": [] + } + }, + { + "marker": { + "fileName": "/tests/cases/fourslash/quickInfoDisplayPartsTypeParameterInInterface.ts", + "position": 260 + }, + "quickInfo": { + "kind": "interface", + "kindModifiers": "", + "textSpan": { + "start": 260, + "length": 1 + }, + "displayParts": [ + { + "text": "interface", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "I", + "kind": "interfaceName" + }, + { + "text": "<", + "kind": "punctuation" + }, + { + "text": "T", + "kind": "typeParameterName" + }, + { + "text": ">", + "kind": "punctuation" + } + ], + "documentation": [] + } + }, + { + "marker": { + "fileName": "/tests/cases/fourslash/quickInfoDisplayPartsTypeParameterInInterface.ts", + "position": 271 + }, + "quickInfo": { + "kind": "parameter", + "kindModifiers": "", + "textSpan": { + "start": 271, + "length": 1 + }, + "displayParts": [ + { + "text": "(", + "kind": "punctuation" + }, + { + "text": "parameter", + "kind": "text" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "a", + "kind": "parameterName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "U", + "kind": "typeParameterName" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "extends", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "I", + "kind": "interfaceName" + }, + { + "text": "<", + "kind": "punctuation" + }, + { + "text": "string", + "kind": "keyword" + }, + { + "text": ">", + "kind": "punctuation" + } + ], + "documentation": [] + } + }, + { + "marker": { + "fileName": "/tests/cases/fourslash/quickInfoDisplayPartsTypeParameterInInterface.ts", + "position": 274 + }, + "quickInfo": { + "kind": "type parameter", + "kindModifiers": "", + "textSpan": { + "start": 274, + "length": 1 + }, + "displayParts": [ + { + "text": "(", + "kind": "punctuation" + }, + { + "text": "type parameter", + "kind": "text" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "U", + "kind": "typeParameterName" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "in", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "new", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "<", + "kind": "punctuation" + }, + { + "text": "U", + "kind": "typeParameterName" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "extends", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "I", + "kind": "interfaceName" + }, + { + "text": "<", + "kind": "punctuation" + }, + { + "text": "string", + "kind": "keyword" + }, + { + "text": ">", + "kind": "punctuation" + }, + { + "text": ">", + "kind": "punctuation" + }, + { + "text": "(", + "kind": "punctuation" + }, + { + "text": "a", + "kind": "parameterName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "U", + "kind": "typeParameterName" + }, + { + "text": ",", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "b", + "kind": "parameterName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "T", + "kind": "typeParameterName" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "U", + "kind": "typeParameterName" + } + ], + "documentation": [] + } + }, + { + "marker": { + "fileName": "/tests/cases/fourslash/quickInfoDisplayPartsTypeParameterInInterface.ts", + "position": 277 + }, + "quickInfo": { + "kind": "parameter", + "kindModifiers": "", + "textSpan": { + "start": 277, + "length": 1 + }, + "displayParts": [ + { + "text": "(", + "kind": "punctuation" + }, + { + "text": "parameter", + "kind": "text" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "b", + "kind": "parameterName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "T", + "kind": "typeParameterName" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "extends", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "I", + "kind": "interfaceName" + }, + { + "text": "<", + "kind": "punctuation" + }, + { + "text": "string", + "kind": "keyword" + }, + { + "text": ">", + "kind": "punctuation" + } + ], + "documentation": [] + } + }, + { + "marker": { + "fileName": "/tests/cases/fourslash/quickInfoDisplayPartsTypeParameterInInterface.ts", + "position": 280 + }, + "quickInfo": { + "kind": "type parameter", + "kindModifiers": "", + "textSpan": { + "start": 280, + "length": 1 + }, + "displayParts": [ + { + "text": "(", + "kind": "punctuation" + }, + { + "text": "type parameter", + "kind": "text" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "T", + "kind": "typeParameterName" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "in", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "I1", + "kind": "interfaceName" + }, + { + "text": "<", + "kind": "punctuation" + }, + { + "text": "T", + "kind": "typeParameterName" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "extends", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "I", + "kind": "interfaceName" + }, + { + "text": "<", + "kind": "punctuation" + }, + { + "text": "string", + "kind": "keyword" + }, + { + "text": ">", + "kind": "punctuation" + }, + { + "text": ">", + "kind": "punctuation" + } + ], + "documentation": [] + } + }, + { + "marker": { + "fileName": "/tests/cases/fourslash/quickInfoDisplayPartsTypeParameterInInterface.ts", + "position": 284 + }, + "quickInfo": { + "kind": "type parameter", + "kindModifiers": "", + "textSpan": { + "start": 284, + "length": 1 + }, + "displayParts": [ + { + "text": "(", + "kind": "punctuation" + }, + { + "text": "type parameter", + "kind": "text" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "U", + "kind": "typeParameterName" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "in", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "new", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "<", + "kind": "punctuation" + }, + { + "text": "U", + "kind": "typeParameterName" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "extends", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "I", + "kind": "interfaceName" + }, + { + "text": "<", + "kind": "punctuation" + }, + { + "text": "string", + "kind": "keyword" + }, + { + "text": ">", + "kind": "punctuation" + }, + { + "text": ">", + "kind": "punctuation" + }, + { + "text": "(", + "kind": "punctuation" + }, + { + "text": "a", + "kind": "parameterName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "U", + "kind": "typeParameterName" + }, + { + "text": ",", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "b", + "kind": "parameterName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "T", + "kind": "typeParameterName" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "U", + "kind": "typeParameterName" + } + ], + "documentation": [] + } + }, + { + "marker": { + "fileName": "/tests/cases/fourslash/quickInfoDisplayPartsTypeParameterInInterface.ts", + "position": 292 + }, + "quickInfo": { + "kind": "type parameter", + "kindModifiers": "", + "textSpan": { + "start": 292, + "length": 1 + }, + "displayParts": [ + { + "text": "(", + "kind": "punctuation" + }, + { + "text": "type parameter", + "kind": "text" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "U", + "kind": "typeParameterName" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "in", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "<", + "kind": "punctuation" + }, + { + "text": "U", + "kind": "typeParameterName" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "extends", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "I", + "kind": "interfaceName" + }, + { + "text": "<", + "kind": "punctuation" + }, + { + "text": "string", + "kind": "keyword" + }, + { + "text": ">", + "kind": "punctuation" + }, + { + "text": ">", + "kind": "punctuation" + }, + { + "text": "(", + "kind": "punctuation" + }, + { + "text": "a", + "kind": "parameterName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "U", + "kind": "typeParameterName" + }, + { + "text": ",", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "b", + "kind": "parameterName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "T", + "kind": "typeParameterName" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "U", + "kind": "typeParameterName" + } + ], + "documentation": [] + } + }, + { + "marker": { + "fileName": "/tests/cases/fourslash/quickInfoDisplayPartsTypeParameterInInterface.ts", + "position": 302 + }, + "quickInfo": { + "kind": "interface", + "kindModifiers": "", + "textSpan": { + "start": 302, + "length": 1 + }, + "displayParts": [ + { + "text": "interface", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "I", + "kind": "interfaceName" + }, + { + "text": "<", + "kind": "punctuation" + }, + { + "text": "T", + "kind": "typeParameterName" + }, + { + "text": ">", + "kind": "punctuation" + } + ], + "documentation": [] + } + }, + { + "marker": { + "fileName": "/tests/cases/fourslash/quickInfoDisplayPartsTypeParameterInInterface.ts", + "position": 313 + }, + "quickInfo": { + "kind": "parameter", + "kindModifiers": "", + "textSpan": { + "start": 313, + "length": 1 + }, + "displayParts": [ + { + "text": "(", + "kind": "punctuation" + }, + { + "text": "parameter", + "kind": "text" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "a", + "kind": "parameterName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "U", + "kind": "typeParameterName" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "extends", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "I", + "kind": "interfaceName" + }, + { + "text": "<", + "kind": "punctuation" + }, + { + "text": "string", + "kind": "keyword" + }, + { + "text": ">", + "kind": "punctuation" + } + ], + "documentation": [] + } + }, + { + "marker": { + "fileName": "/tests/cases/fourslash/quickInfoDisplayPartsTypeParameterInInterface.ts", + "position": 316 + }, + "quickInfo": { + "kind": "type parameter", + "kindModifiers": "", + "textSpan": { + "start": 316, + "length": 1 + }, + "displayParts": [ + { + "text": "(", + "kind": "punctuation" + }, + { + "text": "type parameter", + "kind": "text" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "U", + "kind": "typeParameterName" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "in", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "<", + "kind": "punctuation" + }, + { + "text": "U", + "kind": "typeParameterName" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "extends", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "I", + "kind": "interfaceName" + }, + { + "text": "<", + "kind": "punctuation" + }, + { + "text": "string", + "kind": "keyword" + }, + { + "text": ">", + "kind": "punctuation" + }, + { + "text": ">", + "kind": "punctuation" + }, + { + "text": "(", + "kind": "punctuation" + }, + { + "text": "a", + "kind": "parameterName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "U", + "kind": "typeParameterName" + }, + { + "text": ",", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "b", + "kind": "parameterName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "T", + "kind": "typeParameterName" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "U", + "kind": "typeParameterName" + } + ], + "documentation": [] + } + }, + { + "marker": { + "fileName": "/tests/cases/fourslash/quickInfoDisplayPartsTypeParameterInInterface.ts", + "position": 319 + }, + "quickInfo": { + "kind": "parameter", + "kindModifiers": "", + "textSpan": { + "start": 319, + "length": 1 + }, + "displayParts": [ + { + "text": "(", + "kind": "punctuation" + }, + { + "text": "parameter", + "kind": "text" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "b", + "kind": "parameterName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "T", + "kind": "typeParameterName" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "extends", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "I", + "kind": "interfaceName" + }, + { + "text": "<", + "kind": "punctuation" + }, + { + "text": "string", + "kind": "keyword" + }, + { + "text": ">", + "kind": "punctuation" + } + ], + "documentation": [] + } + }, + { + "marker": { + "fileName": "/tests/cases/fourslash/quickInfoDisplayPartsTypeParameterInInterface.ts", + "position": 322 + }, + "quickInfo": { + "kind": "type parameter", + "kindModifiers": "", + "textSpan": { + "start": 322, + "length": 1 + }, + "displayParts": [ + { + "text": "(", + "kind": "punctuation" + }, + { + "text": "type parameter", + "kind": "text" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "T", + "kind": "typeParameterName" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "in", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "I1", + "kind": "interfaceName" + }, + { + "text": "<", + "kind": "punctuation" + }, + { + "text": "T", + "kind": "typeParameterName" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "extends", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "I", + "kind": "interfaceName" + }, + { + "text": "<", + "kind": "punctuation" + }, + { + "text": "string", + "kind": "keyword" + }, + { + "text": ">", + "kind": "punctuation" + }, + { + "text": ">", + "kind": "punctuation" + } + ], + "documentation": [] + } + }, + { + "marker": { + "fileName": "/tests/cases/fourslash/quickInfoDisplayPartsTypeParameterInInterface.ts", + "position": 326 + }, + "quickInfo": { + "kind": "type parameter", + "kindModifiers": "", + "textSpan": { + "start": 326, + "length": 1 + }, + "displayParts": [ + { + "text": "(", + "kind": "punctuation" + }, + { + "text": "type parameter", + "kind": "text" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "U", + "kind": "typeParameterName" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "in", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "<", + "kind": "punctuation" + }, + { + "text": "U", + "kind": "typeParameterName" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "extends", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "I", + "kind": "interfaceName" + }, + { + "text": "<", + "kind": "punctuation" + }, + { + "text": "string", + "kind": "keyword" + }, + { + "text": ">", + "kind": "punctuation" + }, + { + "text": ">", + "kind": "punctuation" + }, + { + "text": "(", + "kind": "punctuation" + }, + { + "text": "a", + "kind": "parameterName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "U", + "kind": "typeParameterName" + }, + { + "text": ",", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "b", + "kind": "parameterName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "T", + "kind": "typeParameterName" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "U", + "kind": "typeParameterName" + } + ], + "documentation": [] + } + }, + { + "marker": { + "fileName": "/tests/cases/fourslash/quickInfoDisplayPartsTypeParameterInInterface.ts", + "position": 333 + }, + "quickInfo": { + "kind": "method", + "kindModifiers": "", + "textSpan": { + "start": 333, + "length": 6 + }, + "displayParts": [ + { + "text": "(", + "kind": "punctuation" + }, + { + "text": "method", + "kind": "text" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "I1", + "kind": "interfaceName" + }, + { + "text": "<", + "kind": "punctuation" + }, + { + "text": "T", + "kind": "typeParameterName" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "extends", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "I", + "kind": "interfaceName" + }, + { + "text": "<", + "kind": "punctuation" + }, + { + "text": "string", + "kind": "keyword" + }, + { + "text": ">", + "kind": "punctuation" + }, + { + "text": ">", + "kind": "punctuation" + }, + { + "text": ".", + "kind": "punctuation" + }, + { + "text": "method", + "kind": "methodName" + }, + { + "text": "<", + "kind": "punctuation" + }, + { + "text": "U", + "kind": "typeParameterName" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "extends", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "I", + "kind": "interfaceName" + }, + { + "text": "<", + "kind": "punctuation" + }, + { + "text": "string", + "kind": "keyword" + }, + { + "text": ">", + "kind": "punctuation" + }, + { + "text": ">", + "kind": "punctuation" + }, + { + "text": "(", + "kind": "punctuation" + }, + { + "text": "a", + "kind": "parameterName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "U", + "kind": "typeParameterName" + }, + { + "text": ",", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "b", + "kind": "parameterName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "T", + "kind": "typeParameterName" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "U", + "kind": "typeParameterName" + } + ], + "documentation": [] + } + }, + { + "marker": { + "fileName": "/tests/cases/fourslash/quickInfoDisplayPartsTypeParameterInInterface.ts", + "position": 340 + }, + "quickInfo": { + "kind": "type parameter", + "kindModifiers": "", + "textSpan": { + "start": 340, + "length": 1 + }, + "displayParts": [ + { + "text": "(", + "kind": "punctuation" + }, + { + "text": "type parameter", + "kind": "text" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "U", + "kind": "typeParameterName" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "in", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "I1", + "kind": "interfaceName" + }, + { + "text": "<", + "kind": "punctuation" + }, + { + "text": "T", + "kind": "typeParameterName" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "extends", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "I", + "kind": "interfaceName" + }, + { + "text": "<", + "kind": "punctuation" + }, + { + "text": "string", + "kind": "keyword" + }, + { + "text": ">", + "kind": "punctuation" + }, + { + "text": ">", + "kind": "punctuation" + }, + { + "text": ".", + "kind": "punctuation" + }, + { + "text": "method", + "kind": "methodName" + }, + { + "text": "<", + "kind": "punctuation" + }, + { + "text": "U", + "kind": "typeParameterName" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "extends", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "I", + "kind": "interfaceName" + }, + { + "text": "<", + "kind": "punctuation" + }, + { + "text": "string", + "kind": "keyword" + }, + { + "text": ">", + "kind": "punctuation" + }, + { + "text": ">", + "kind": "punctuation" + }, + { + "text": "(", + "kind": "punctuation" + }, + { + "text": "a", + "kind": "parameterName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "U", + "kind": "typeParameterName" + }, + { + "text": ",", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "b", + "kind": "parameterName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "T", + "kind": "typeParameterName" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "U", + "kind": "typeParameterName" + } + ], + "documentation": [] + } + }, + { + "marker": { + "fileName": "/tests/cases/fourslash/quickInfoDisplayPartsTypeParameterInInterface.ts", + "position": 350 + }, + "quickInfo": { + "kind": "interface", + "kindModifiers": "", + "textSpan": { + "start": 350, + "length": 1 + }, + "displayParts": [ + { + "text": "interface", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "I", + "kind": "interfaceName" + }, + { + "text": "<", + "kind": "punctuation" + }, + { + "text": "T", + "kind": "typeParameterName" + }, + { + "text": ">", + "kind": "punctuation" + } + ], + "documentation": [] + } + }, + { + "marker": { + "fileName": "/tests/cases/fourslash/quickInfoDisplayPartsTypeParameterInInterface.ts", + "position": 361 + }, + "quickInfo": { + "kind": "parameter", + "kindModifiers": "", + "textSpan": { + "start": 361, + "length": 1 + }, + "displayParts": [ + { + "text": "(", + "kind": "punctuation" + }, + { + "text": "parameter", + "kind": "text" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "a", + "kind": "parameterName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "U", + "kind": "typeParameterName" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "extends", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "I", + "kind": "interfaceName" + }, + { + "text": "<", + "kind": "punctuation" + }, + { + "text": "string", + "kind": "keyword" + }, + { + "text": ">", + "kind": "punctuation" + } + ], + "documentation": [] + } + }, + { + "marker": { + "fileName": "/tests/cases/fourslash/quickInfoDisplayPartsTypeParameterInInterface.ts", + "position": 364 + }, + "quickInfo": { + "kind": "type parameter", + "kindModifiers": "", + "textSpan": { + "start": 364, + "length": 1 + }, + "displayParts": [ + { + "text": "(", + "kind": "punctuation" + }, + { + "text": "type parameter", + "kind": "text" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "U", + "kind": "typeParameterName" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "in", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "I1", + "kind": "interfaceName" + }, + { + "text": "<", + "kind": "punctuation" + }, + { + "text": "T", + "kind": "typeParameterName" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "extends", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "I", + "kind": "interfaceName" + }, + { + "text": "<", + "kind": "punctuation" + }, + { + "text": "string", + "kind": "keyword" + }, + { + "text": ">", + "kind": "punctuation" + }, + { + "text": ">", + "kind": "punctuation" + }, + { + "text": ".", + "kind": "punctuation" + }, + { + "text": "method", + "kind": "methodName" + }, + { + "text": "<", + "kind": "punctuation" + }, + { + "text": "U", + "kind": "typeParameterName" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "extends", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "I", + "kind": "interfaceName" + }, + { + "text": "<", + "kind": "punctuation" + }, + { + "text": "string", + "kind": "keyword" + }, + { + "text": ">", + "kind": "punctuation" + }, + { + "text": ">", + "kind": "punctuation" + }, + { + "text": "(", + "kind": "punctuation" + }, + { + "text": "a", + "kind": "parameterName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "U", + "kind": "typeParameterName" + }, + { + "text": ",", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "b", + "kind": "parameterName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "T", + "kind": "typeParameterName" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "U", + "kind": "typeParameterName" + } + ], + "documentation": [] + } + }, + { + "marker": { + "fileName": "/tests/cases/fourslash/quickInfoDisplayPartsTypeParameterInInterface.ts", + "position": 367 + }, + "quickInfo": { + "kind": "parameter", + "kindModifiers": "", + "textSpan": { + "start": 367, + "length": 1 + }, + "displayParts": [ + { + "text": "(", + "kind": "punctuation" + }, + { + "text": "parameter", + "kind": "text" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "b", + "kind": "parameterName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "T", + "kind": "typeParameterName" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "extends", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "I", + "kind": "interfaceName" + }, + { + "text": "<", + "kind": "punctuation" + }, + { + "text": "string", + "kind": "keyword" + }, + { + "text": ">", + "kind": "punctuation" + } + ], + "documentation": [] + } + }, + { + "marker": { + "fileName": "/tests/cases/fourslash/quickInfoDisplayPartsTypeParameterInInterface.ts", + "position": 370 + }, + "quickInfo": { + "kind": "type parameter", + "kindModifiers": "", + "textSpan": { + "start": 370, + "length": 1 + }, + "displayParts": [ + { + "text": "(", + "kind": "punctuation" + }, + { + "text": "type parameter", + "kind": "text" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "T", + "kind": "typeParameterName" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "in", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "I1", + "kind": "interfaceName" + }, + { + "text": "<", + "kind": "punctuation" + }, + { + "text": "T", + "kind": "typeParameterName" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "extends", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "I", + "kind": "interfaceName" + }, + { + "text": "<", + "kind": "punctuation" + }, + { + "text": "string", + "kind": "keyword" + }, + { + "text": ">", + "kind": "punctuation" + }, + { + "text": ">", + "kind": "punctuation" + } + ], + "documentation": [] + } + }, + { + "marker": { + "fileName": "/tests/cases/fourslash/quickInfoDisplayPartsTypeParameterInInterface.ts", + "position": 374 + }, + "quickInfo": { + "kind": "type parameter", + "kindModifiers": "", + "textSpan": { + "start": 374, + "length": 1 + }, + "displayParts": [ + { + "text": "(", + "kind": "punctuation" + }, + { + "text": "type parameter", + "kind": "text" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "U", + "kind": "typeParameterName" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "in", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "I1", + "kind": "interfaceName" + }, + { + "text": "<", + "kind": "punctuation" + }, + { + "text": "T", + "kind": "typeParameterName" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "extends", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "I", + "kind": "interfaceName" + }, + { + "text": "<", + "kind": "punctuation" + }, + { + "text": "string", + "kind": "keyword" + }, + { + "text": ">", + "kind": "punctuation" + }, + { + "text": ">", + "kind": "punctuation" + }, + { + "text": ".", + "kind": "punctuation" + }, + { + "text": "method", + "kind": "methodName" + }, + { + "text": "<", + "kind": "punctuation" + }, + { + "text": "U", + "kind": "typeParameterName" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "extends", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "I", + "kind": "interfaceName" + }, + { + "text": "<", + "kind": "punctuation" + }, + { + "text": "string", + "kind": "keyword" + }, + { + "text": ">", + "kind": "punctuation" + }, + { + "text": ">", + "kind": "punctuation" + }, + { + "text": "(", + "kind": "punctuation" + }, + { + "text": "a", + "kind": "parameterName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "U", + "kind": "typeParameterName" + }, + { + "text": ",", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "b", + "kind": "parameterName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "T", + "kind": "typeParameterName" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "U", + "kind": "typeParameterName" + } + ], + "documentation": [] + } + }, + { + "marker": { + "fileName": "/tests/cases/fourslash/quickInfoDisplayPartsTypeParameterInInterface.ts", + "position": 383 + }, + "quickInfo": { + "kind": "var", + "kindModifiers": "", + "textSpan": { + "start": 383, + "length": 5 + }, + "displayParts": [ + { + "text": "var", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "iVal1", + "kind": "localName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "I1", + "kind": "interfaceName" + }, + { + "text": "<", + "kind": "punctuation" + }, + { + "text": "I", + "kind": "interfaceName" + }, + { + "text": "<", + "kind": "punctuation" + }, + { + "text": "string", + "kind": "keyword" + }, + { + "text": ">", + "kind": "punctuation" + }, + { + "text": ">", + "kind": "punctuation" + } + ], + "documentation": [] + } + }, + { + "marker": { + "fileName": "/tests/cases/fourslash/quickInfoDisplayPartsTypeParameterInInterface.ts", + "position": 390 + }, + "quickInfo": { + "kind": "interface", + "kindModifiers": "", + "textSpan": { + "start": 390, + "length": 2 + }, + "displayParts": [ + { + "text": "interface", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "I1", + "kind": "interfaceName" + }, + { + "text": "<", + "kind": "punctuation" + }, + { + "text": "T", + "kind": "typeParameterName" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "extends", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "I", + "kind": "interfaceName" + }, + { + "text": "<", + "kind": "punctuation" + }, + { + "text": "string", + "kind": "keyword" + }, + { + "text": ">", + "kind": "punctuation" + }, + { + "text": ">", + "kind": "punctuation" + } + ], + "documentation": [] + } + }, + { + "marker": { + "fileName": "/tests/cases/fourslash/quickInfoDisplayPartsTypeParameterInInterface.ts", + "position": 393 + }, + "quickInfo": { + "kind": "interface", + "kindModifiers": "", + "textSpan": { + "start": 393, + "length": 1 + }, + "displayParts": [ + { + "text": "interface", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "I", + "kind": "interfaceName" + }, + { + "text": "<", + "kind": "punctuation" + }, + { + "text": "T", + "kind": "typeParameterName" + }, + { + "text": ">", + "kind": "punctuation" + } + ], + "documentation": [] + } + }, + { + "marker": { + "fileName": "/tests/cases/fourslash/quickInfoDisplayPartsTypeParameterInInterface.ts", + "position": 409 + }, + "quickInfo": { + "kind": "var", + "kindModifiers": "", + "textSpan": { + "start": 409, + "length": 5 + }, + "displayParts": [ + { + "text": "var", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "iVal1", + "kind": "localName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "new", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "I1", + "kind": "interfaceName" + }, + { + "text": "<", + "kind": "punctuation" + }, + { + "text": "I", + "kind": "interfaceName" + }, + { + "text": "<", + "kind": "punctuation" + }, + { + "text": "string", + "kind": "keyword" + }, + { + "text": ">", + "kind": "punctuation" + }, + { + "text": ">", + "kind": "punctuation" + }, + { + "text": "(", + "kind": "punctuation" + }, + { + "text": "a", + "kind": "parameterName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "I", + "kind": "interfaceName" + }, + { + "text": "<", + "kind": "punctuation" + }, + { + "text": "string", + "kind": "keyword" + }, + { + "text": ">", + "kind": "punctuation" + }, + { + "text": ",", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "b", + "kind": "parameterName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "I", + "kind": "interfaceName" + }, + { + "text": "<", + "kind": "punctuation" + }, + { + "text": "string", + "kind": "keyword" + }, + { + "text": ">", + "kind": "punctuation" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "=>", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "I", + "kind": "interfaceName" + }, + { + "text": "<", + "kind": "punctuation" + }, + { + "text": "string", + "kind": "keyword" + }, + { + "text": ">", + "kind": "punctuation" + } + ], + "documentation": [] + } + }, + { + "marker": { + "fileName": "/tests/cases/fourslash/quickInfoDisplayPartsTypeParameterInInterface.ts", + "position": 415 + }, + "quickInfo": { + "kind": "var", + "kindModifiers": "", + "textSpan": { + "start": 415, + "length": 4 + }, + "displayParts": [ + { + "text": "var", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "iVal", + "kind": "localName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "I", + "kind": "interfaceName" + }, + { + "text": "<", + "kind": "punctuation" + }, + { + "text": "string", + "kind": "keyword" + }, + { + "text": ">", + "kind": "punctuation" + } + ], + "documentation": [] + } + }, + { + "marker": { + "fileName": "/tests/cases/fourslash/quickInfoDisplayPartsTypeParameterInInterface.ts", + "position": 421 + }, + "quickInfo": { + "kind": "var", + "kindModifiers": "", + "textSpan": { + "start": 421, + "length": 4 + }, + "displayParts": [ + { + "text": "var", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "iVal", + "kind": "localName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "I", + "kind": "interfaceName" + }, + { + "text": "<", + "kind": "punctuation" + }, + { + "text": "string", + "kind": "keyword" + }, + { + "text": ">", + "kind": "punctuation" + } + ], + "documentation": [] + } + }, + { + "marker": { + "fileName": "/tests/cases/fourslash/quickInfoDisplayPartsTypeParameterInInterface.ts", + "position": 428 + }, + "quickInfo": { + "kind": "var", + "kindModifiers": "", + "textSpan": { + "start": 428, + "length": 5 + }, + "displayParts": [ + { + "text": "var", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "iVal1", + "kind": "localName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "I1", + "kind": "interfaceName" + }, + { + "text": "<", + "kind": "punctuation" + }, + { + "text": "I", + "kind": "interfaceName" + }, + { + "text": "<", + "kind": "punctuation" + }, + { + "text": "string", + "kind": "keyword" + }, + { + "text": ">", + "kind": "punctuation" + }, + { + "text": ">", + "kind": "punctuation" + }, + { + "text": "(", + "kind": "punctuation" + }, + { + "text": "a", + "kind": "parameterName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "I", + "kind": "interfaceName" + }, + { + "text": "<", + "kind": "punctuation" + }, + { + "text": "string", + "kind": "keyword" + }, + { + "text": ">", + "kind": "punctuation" + }, + { + "text": ",", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "b", + "kind": "parameterName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "I", + "kind": "interfaceName" + }, + { + "text": "<", + "kind": "punctuation" + }, + { + "text": "string", + "kind": "keyword" + }, + { + "text": ">", + "kind": "punctuation" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "=>", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "I", + "kind": "interfaceName" + }, + { + "text": "<", + "kind": "punctuation" + }, + { + "text": "string", + "kind": "keyword" + }, + { + "text": ">", + "kind": "punctuation" + } + ], + "documentation": [] + } + }, + { + "marker": { + "fileName": "/tests/cases/fourslash/quickInfoDisplayPartsTypeParameterInInterface.ts", + "position": 434 + }, + "quickInfo": { + "kind": "var", + "kindModifiers": "", + "textSpan": { + "start": 434, + "length": 4 + }, + "displayParts": [ + { + "text": "var", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "iVal", + "kind": "localName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "I", + "kind": "interfaceName" + }, + { + "text": "<", + "kind": "punctuation" + }, + { + "text": "string", + "kind": "keyword" + }, + { + "text": ">", + "kind": "punctuation" + } + ], + "documentation": [] + } + }, + { + "marker": { + "fileName": "/tests/cases/fourslash/quickInfoDisplayPartsTypeParameterInInterface.ts", + "position": 440 + }, + "quickInfo": { + "kind": "var", + "kindModifiers": "", + "textSpan": { + "start": 440, + "length": 4 + }, + "displayParts": [ + { + "text": "var", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "iVal", + "kind": "localName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "I", + "kind": "interfaceName" + }, + { + "text": "<", + "kind": "punctuation" + }, + { + "text": "string", + "kind": "keyword" + }, + { + "text": ">", + "kind": "punctuation" + } + ], + "documentation": [] + } + }, + { + "marker": { + "fileName": "/tests/cases/fourslash/quickInfoDisplayPartsTypeParameterInInterface.ts", + "position": 447 + }, + "quickInfo": { + "kind": "var", + "kindModifiers": "", + "textSpan": { + "start": 447, + "length": 5 + }, + "displayParts": [ + { + "text": "var", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "iVal1", + "kind": "localName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "I1", + "kind": "interfaceName" + }, + { + "text": "<", + "kind": "punctuation" + }, + { + "text": "I", + "kind": "interfaceName" + }, + { + "text": "<", + "kind": "punctuation" + }, + { + "text": "string", + "kind": "keyword" + }, + { + "text": ">", + "kind": "punctuation" + }, + { + "text": ">", + "kind": "punctuation" + } + ], + "documentation": [] + } + }, + { + "marker": { + "fileName": "/tests/cases/fourslash/quickInfoDisplayPartsTypeParameterInInterface.ts", + "position": 453 + }, + "quickInfo": { + "kind": "method", + "kindModifiers": "", + "textSpan": { + "start": 453, + "length": 6 + }, + "displayParts": [ + { + "text": "(", + "kind": "punctuation" + }, + { + "text": "method", + "kind": "text" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "I1", + "kind": "interfaceName" + }, + { + "text": "<", + "kind": "punctuation" + }, + { + "text": "I", + "kind": "interfaceName" + }, + { + "text": "<", + "kind": "punctuation" + }, + { + "text": "string", + "kind": "keyword" + }, + { + "text": ">", + "kind": "punctuation" + }, + { + "text": ">", + "kind": "punctuation" + }, + { + "text": ".", + "kind": "punctuation" + }, + { + "text": "method", + "kind": "methodName" + }, + { + "text": "<", + "kind": "punctuation" + }, + { + "text": "I", + "kind": "interfaceName" + }, + { + "text": "<", + "kind": "punctuation" + }, + { + "text": "string", + "kind": "keyword" + }, + { + "text": ">", + "kind": "punctuation" + }, + { + "text": ">", + "kind": "punctuation" + }, + { + "text": "(", + "kind": "punctuation" + }, + { + "text": "a", + "kind": "parameterName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "I", + "kind": "interfaceName" + }, + { + "text": "<", + "kind": "punctuation" + }, + { + "text": "string", + "kind": "keyword" + }, + { + "text": ">", + "kind": "punctuation" + }, + { + "text": ",", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "b", + "kind": "parameterName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "I", + "kind": "interfaceName" + }, + { + "text": "<", + "kind": "punctuation" + }, + { + "text": "string", + "kind": "keyword" + }, + { + "text": ">", + "kind": "punctuation" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "I", + "kind": "interfaceName" + }, + { + "text": "<", + "kind": "punctuation" + }, + { + "text": "string", + "kind": "keyword" + }, + { + "text": ">", + "kind": "punctuation" + } + ], + "documentation": [] + } + }, + { + "marker": { + "fileName": "/tests/cases/fourslash/quickInfoDisplayPartsTypeParameterInInterface.ts", + "position": 460 + }, + "quickInfo": { + "kind": "var", + "kindModifiers": "", + "textSpan": { + "start": 460, + "length": 4 + }, + "displayParts": [ + { + "text": "var", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "iVal", + "kind": "localName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "I", + "kind": "interfaceName" + }, + { + "text": "<", + "kind": "punctuation" + }, + { + "text": "string", + "kind": "keyword" + }, + { + "text": ">", + "kind": "punctuation" + } + ], + "documentation": [] + } + }, + { + "marker": { + "fileName": "/tests/cases/fourslash/quickInfoDisplayPartsTypeParameterInInterface.ts", + "position": 466 + }, + "quickInfo": { + "kind": "var", + "kindModifiers": "", + "textSpan": { + "start": 466, + "length": 4 + }, + "displayParts": [ + { + "text": "var", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "iVal", + "kind": "localName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "I", + "kind": "interfaceName" + }, + { + "text": "<", + "kind": "punctuation" + }, + { + "text": "string", + "kind": "keyword" + }, + { + "text": ">", + "kind": "punctuation" + } + ], + "documentation": [] + } + } +] \ No newline at end of file diff --git a/tests/baselines/reference/quickInfoDisplayPartsTypeParameterInTypeAlias.baseline b/tests/baselines/reference/quickInfoDisplayPartsTypeParameterInTypeAlias.baseline new file mode 100644 index 00000000000..e6f1d451288 --- /dev/null +++ b/tests/baselines/reference/quickInfoDisplayPartsTypeParameterInTypeAlias.baseline @@ -0,0 +1,472 @@ +[ + { + "marker": { + "fileName": "/tests/cases/fourslash/quickInfoDisplayPartsTypeParameterInTypeAlias.ts", + "position": 5 + }, + "quickInfo": { + "kind": "type", + "kindModifiers": "", + "textSpan": { + "start": 5, + "length": 4 + }, + "displayParts": [ + { + "text": "type", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "List", + "kind": "aliasName" + }, + { + "text": "<", + "kind": "punctuation" + }, + { + "text": "T", + "kind": "typeParameterName" + }, + { + "text": ">", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "=", + "kind": "operator" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "T", + "kind": "typeParameterName" + }, + { + "text": "[", + "kind": "punctuation" + }, + { + "text": "]", + "kind": "punctuation" + } + ], + "documentation": [] + } + }, + { + "marker": { + "fileName": "/tests/cases/fourslash/quickInfoDisplayPartsTypeParameterInTypeAlias.ts", + "position": 10 + }, + "quickInfo": { + "kind": "type parameter", + "kindModifiers": "", + "textSpan": { + "start": 10, + "length": 1 + }, + "displayParts": [ + { + "text": "(", + "kind": "punctuation" + }, + { + "text": "type parameter", + "kind": "text" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "T", + "kind": "typeParameterName" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "in", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "type", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "List", + "kind": "aliasName" + }, + { + "text": "<", + "kind": "punctuation" + }, + { + "text": "T", + "kind": "typeParameterName" + }, + { + "text": ">", + "kind": "punctuation" + } + ], + "documentation": [] + } + }, + { + "marker": { + "fileName": "/tests/cases/fourslash/quickInfoDisplayPartsTypeParameterInTypeAlias.ts", + "position": 15 + }, + "quickInfo": { + "kind": "type parameter", + "kindModifiers": "", + "textSpan": { + "start": 15, + "length": 1 + }, + "displayParts": [ + { + "text": "(", + "kind": "punctuation" + }, + { + "text": "type parameter", + "kind": "text" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "T", + "kind": "typeParameterName" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "in", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "type", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "List", + "kind": "aliasName" + }, + { + "text": "<", + "kind": "punctuation" + }, + { + "text": "T", + "kind": "typeParameterName" + }, + { + "text": ">", + "kind": "punctuation" + } + ], + "documentation": [] + } + }, + { + "marker": { + "fileName": "/tests/cases/fourslash/quickInfoDisplayPartsTypeParameterInTypeAlias.ts", + "position": 24 + }, + "quickInfo": { + "kind": "type", + "kindModifiers": "", + "textSpan": { + "start": 24, + "length": 5 + }, + "displayParts": [ + { + "text": "type", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "List2", + "kind": "aliasName" + }, + { + "text": "<", + "kind": "punctuation" + }, + { + "text": "T", + "kind": "typeParameterName" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "extends", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "string", + "kind": "keyword" + }, + { + "text": ">", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "=", + "kind": "operator" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "T", + "kind": "typeParameterName" + }, + { + "text": "[", + "kind": "punctuation" + }, + { + "text": "]", + "kind": "punctuation" + } + ], + "documentation": [] + } + }, + { + "marker": { + "fileName": "/tests/cases/fourslash/quickInfoDisplayPartsTypeParameterInTypeAlias.ts", + "position": 30 + }, + "quickInfo": { + "kind": "type parameter", + "kindModifiers": "", + "textSpan": { + "start": 30, + "length": 1 + }, + "displayParts": [ + { + "text": "(", + "kind": "punctuation" + }, + { + "text": "type parameter", + "kind": "text" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "T", + "kind": "typeParameterName" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "in", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "type", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "List2", + "kind": "aliasName" + }, + { + "text": "<", + "kind": "punctuation" + }, + { + "text": "T", + "kind": "typeParameterName" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "extends", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "string", + "kind": "keyword" + }, + { + "text": ">", + "kind": "punctuation" + } + ], + "documentation": [] + } + }, + { + "marker": { + "fileName": "/tests/cases/fourslash/quickInfoDisplayPartsTypeParameterInTypeAlias.ts", + "position": 50 + }, + "quickInfo": { + "kind": "type parameter", + "kindModifiers": "", + "textSpan": { + "start": 50, + "length": 1 + }, + "displayParts": [ + { + "text": "(", + "kind": "punctuation" + }, + { + "text": "type parameter", + "kind": "text" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "T", + "kind": "typeParameterName" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "in", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "type", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "List2", + "kind": "aliasName" + }, + { + "text": "<", + "kind": "punctuation" + }, + { + "text": "T", + "kind": "typeParameterName" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "extends", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "string", + "kind": "keyword" + }, + { + "text": ">", + "kind": "punctuation" + } + ], + "documentation": [] + } + } +] \ No newline at end of file diff --git a/tests/baselines/reference/quickInfoDisplayPartsVar.baseline b/tests/baselines/reference/quickInfoDisplayPartsVar.baseline new file mode 100644 index 00000000000..b56e1b31542 --- /dev/null +++ b/tests/baselines/reference/quickInfoDisplayPartsVar.baseline @@ -0,0 +1,1112 @@ +[ + { + "marker": { + "fileName": "/tests/cases/fourslash/quickInfoDisplayPartsVar.ts", + "position": 4 + }, + "quickInfo": { + "kind": "var", + "kindModifiers": "", + "textSpan": { + "start": 4, + "length": 1 + }, + "displayParts": [ + { + "text": "var", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "a", + "kind": "localName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "number", + "kind": "keyword" + } + ], + "documentation": [] + } + }, + { + "marker": { + "fileName": "/tests/cases/fourslash/quickInfoDisplayPartsVar.ts", + "position": 37 + }, + "quickInfo": { + "kind": "local var", + "kindModifiers": "", + "textSpan": { + "start": 37, + "length": 1 + }, + "displayParts": [ + { + "text": "(", + "kind": "punctuation" + }, + { + "text": "local var", + "kind": "text" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "b", + "kind": "localName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "number", + "kind": "keyword" + } + ], + "documentation": [] + } + }, + { + "marker": { + "fileName": "/tests/cases/fourslash/quickInfoDisplayPartsVar.ts", + "position": 41 + }, + "quickInfo": { + "kind": "var", + "kindModifiers": "", + "textSpan": { + "start": 41, + "length": 1 + }, + "displayParts": [ + { + "text": "var", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "a", + "kind": "localName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "number", + "kind": "keyword" + } + ], + "documentation": [] + } + }, + { + "marker": { + "fileName": "/tests/cases/fourslash/quickInfoDisplayPartsVar.ts", + "position": 65 + }, + "quickInfo": { + "kind": "var", + "kindModifiers": "", + "textSpan": { + "start": 65, + "length": 1 + }, + "displayParts": [ + { + "text": "var", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "c", + "kind": "localName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "number", + "kind": "keyword" + } + ], + "documentation": [] + } + }, + { + "marker": { + "fileName": "/tests/cases/fourslash/quickInfoDisplayPartsVar.ts", + "position": 88 + }, + "quickInfo": { + "kind": "var", + "kindModifiers": "export", + "textSpan": { + "start": 88, + "length": 1 + }, + "displayParts": [ + { + "text": "var", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "m", + "kind": "moduleName" + }, + { + "text": ".", + "kind": "punctuation" + }, + { + "text": "d", + "kind": "localName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "number", + "kind": "keyword" + } + ], + "documentation": [] + } + }, + { + "marker": { + "fileName": "/tests/cases/fourslash/quickInfoDisplayPartsVar.ts", + "position": 102 + }, + "quickInfo": { + "kind": "var", + "kindModifiers": "", + "textSpan": { + "start": 102, + "length": 1 + }, + "displayParts": [ + { + "text": "var", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "f", + "kind": "localName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "(", + "kind": "punctuation" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "=>", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "number", + "kind": "keyword" + } + ], + "documentation": [] + } + }, + { + "marker": { + "fileName": "/tests/cases/fourslash/quickInfoDisplayPartsVar.ts", + "position": 123 + }, + "quickInfo": { + "kind": "var", + "kindModifiers": "", + "textSpan": { + "start": 123, + "length": 1 + }, + "displayParts": [ + { + "text": "var", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "g", + "kind": "localName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "(", + "kind": "punctuation" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "=>", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "number", + "kind": "keyword" + } + ], + "documentation": [] + } + }, + { + "marker": { + "fileName": "/tests/cases/fourslash/quickInfoDisplayPartsVar.ts", + "position": 127 + }, + "quickInfo": { + "kind": "var", + "kindModifiers": "", + "textSpan": { + "start": 127, + "length": 1 + }, + "displayParts": [ + { + "text": "var", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "f", + "kind": "localName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "(", + "kind": "punctuation" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "=>", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "number", + "kind": "keyword" + } + ], + "documentation": [] + } + }, + { + "marker": { + "fileName": "/tests/cases/fourslash/quickInfoDisplayPartsVar.ts", + "position": 130 + }, + "quickInfo": { + "kind": "var", + "kindModifiers": "", + "textSpan": { + "start": 130, + "length": 1 + }, + "displayParts": [ + { + "text": "var", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "f", + "kind": "localName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "(", + "kind": "punctuation" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "=>", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "number", + "kind": "keyword" + } + ], + "documentation": [] + } + }, + { + "marker": { + "fileName": "/tests/cases/fourslash/quickInfoDisplayPartsVar.ts", + "position": 139 + }, + "quickInfo": { + "kind": "var", + "kindModifiers": "", + "textSpan": { + "start": 139, + "length": 1 + }, + "displayParts": [ + { + "text": "var", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "h", + "kind": "localName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "{", + "kind": "punctuation" + }, + { + "text": "\n", + "kind": "lineBreak" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "(", + "kind": "punctuation" + }, + { + "text": "a", + "kind": "parameterName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "string", + "kind": "keyword" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "number", + "kind": "keyword" + }, + { + "text": ";", + "kind": "punctuation" + }, + { + "text": "\n", + "kind": "lineBreak" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "(", + "kind": "punctuation" + }, + { + "text": "a", + "kind": "parameterName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "number", + "kind": "keyword" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "string", + "kind": "keyword" + }, + { + "text": ";", + "kind": "punctuation" + }, + { + "text": "\n", + "kind": "lineBreak" + }, + { + "text": "}", + "kind": "punctuation" + } + ], + "documentation": [] + } + }, + { + "marker": { + "fileName": "/tests/cases/fourslash/quickInfoDisplayPartsVar.ts", + "position": 193 + }, + "quickInfo": { + "kind": "var", + "kindModifiers": "", + "textSpan": { + "start": 193, + "length": 1 + }, + "displayParts": [ + { + "text": "var", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "i", + "kind": "localName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "{", + "kind": "punctuation" + }, + { + "text": "\n", + "kind": "lineBreak" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "(", + "kind": "punctuation" + }, + { + "text": "a", + "kind": "parameterName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "string", + "kind": "keyword" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "number", + "kind": "keyword" + }, + { + "text": ";", + "kind": "punctuation" + }, + { + "text": "\n", + "kind": "lineBreak" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "(", + "kind": "punctuation" + }, + { + "text": "a", + "kind": "parameterName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "number", + "kind": "keyword" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "string", + "kind": "keyword" + }, + { + "text": ";", + "kind": "punctuation" + }, + { + "text": "\n", + "kind": "lineBreak" + }, + { + "text": "}", + "kind": "punctuation" + } + ], + "documentation": [] + } + }, + { + "marker": { + "fileName": "/tests/cases/fourslash/quickInfoDisplayPartsVar.ts", + "position": 197 + }, + "quickInfo": { + "kind": "var", + "kindModifiers": "", + "textSpan": { + "start": 197, + "length": 1 + }, + "displayParts": [ + { + "text": "var", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "h", + "kind": "localName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "{", + "kind": "punctuation" + }, + { + "text": "\n", + "kind": "lineBreak" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "(", + "kind": "punctuation" + }, + { + "text": "a", + "kind": "parameterName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "string", + "kind": "keyword" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "number", + "kind": "keyword" + }, + { + "text": ";", + "kind": "punctuation" + }, + { + "text": "\n", + "kind": "lineBreak" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "(", + "kind": "punctuation" + }, + { + "text": "a", + "kind": "parameterName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "number", + "kind": "keyword" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "string", + "kind": "keyword" + }, + { + "text": ";", + "kind": "punctuation" + }, + { + "text": "\n", + "kind": "lineBreak" + }, + { + "text": "}", + "kind": "punctuation" + } + ], + "documentation": [] + } + }, + { + "marker": { + "fileName": "/tests/cases/fourslash/quickInfoDisplayPartsVar.ts", + "position": 200 + }, + "quickInfo": { + "kind": "var", + "kindModifiers": "", + "textSpan": { + "start": 200, + "length": 1 + }, + "displayParts": [ + { + "text": "var", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "h", + "kind": "localName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "(", + "kind": "punctuation" + }, + { + "text": "a", + "kind": "parameterName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "number", + "kind": "keyword" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "=>", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "string", + "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": [] + } + }, + { + "marker": { + "fileName": "/tests/cases/fourslash/quickInfoDisplayPartsVar.ts", + "position": 207 + }, + "quickInfo": { + "kind": "var", + "kindModifiers": "", + "textSpan": { + "start": 207, + "length": 1 + }, + "displayParts": [ + { + "text": "var", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "h", + "kind": "localName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "(", + "kind": "punctuation" + }, + { + "text": "a", + "kind": "parameterName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "string", + "kind": "keyword" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "=>", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "number", + "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": [] + } + } +] \ No newline at end of file diff --git a/tests/baselines/reference/quickInfoDisplayPartsVar.shims-pp.baseline b/tests/baselines/reference/quickInfoDisplayPartsVar.shims-pp.baseline new file mode 100644 index 00000000000..dfe65565790 --- /dev/null +++ b/tests/baselines/reference/quickInfoDisplayPartsVar.shims-pp.baseline @@ -0,0 +1,1112 @@ +[ + { + "marker": { + "fileName": "/tests/cases/fourslash/shims-pp/quickInfoDisplayPartsVar.ts", + "position": 4 + }, + "quickInfo": { + "kind": "var", + "kindModifiers": "", + "textSpan": { + "start": 4, + "length": 1 + }, + "displayParts": [ + { + "text": "var", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "a", + "kind": "localName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "number", + "kind": "keyword" + } + ], + "documentation": [] + } + }, + { + "marker": { + "fileName": "/tests/cases/fourslash/shims-pp/quickInfoDisplayPartsVar.ts", + "position": 37 + }, + "quickInfo": { + "kind": "local var", + "kindModifiers": "", + "textSpan": { + "start": 37, + "length": 1 + }, + "displayParts": [ + { + "text": "(", + "kind": "punctuation" + }, + { + "text": "local var", + "kind": "text" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "b", + "kind": "localName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "number", + "kind": "keyword" + } + ], + "documentation": [] + } + }, + { + "marker": { + "fileName": "/tests/cases/fourslash/shims-pp/quickInfoDisplayPartsVar.ts", + "position": 41 + }, + "quickInfo": { + "kind": "var", + "kindModifiers": "", + "textSpan": { + "start": 41, + "length": 1 + }, + "displayParts": [ + { + "text": "var", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "a", + "kind": "localName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "number", + "kind": "keyword" + } + ], + "documentation": [] + } + }, + { + "marker": { + "fileName": "/tests/cases/fourslash/shims-pp/quickInfoDisplayPartsVar.ts", + "position": 65 + }, + "quickInfo": { + "kind": "var", + "kindModifiers": "", + "textSpan": { + "start": 65, + "length": 1 + }, + "displayParts": [ + { + "text": "var", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "c", + "kind": "localName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "number", + "kind": "keyword" + } + ], + "documentation": [] + } + }, + { + "marker": { + "fileName": "/tests/cases/fourslash/shims-pp/quickInfoDisplayPartsVar.ts", + "position": 88 + }, + "quickInfo": { + "kind": "var", + "kindModifiers": "export", + "textSpan": { + "start": 88, + "length": 1 + }, + "displayParts": [ + { + "text": "var", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "m", + "kind": "moduleName" + }, + { + "text": ".", + "kind": "punctuation" + }, + { + "text": "d", + "kind": "localName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "number", + "kind": "keyword" + } + ], + "documentation": [] + } + }, + { + "marker": { + "fileName": "/tests/cases/fourslash/shims-pp/quickInfoDisplayPartsVar.ts", + "position": 102 + }, + "quickInfo": { + "kind": "var", + "kindModifiers": "", + "textSpan": { + "start": 102, + "length": 1 + }, + "displayParts": [ + { + "text": "var", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "f", + "kind": "localName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "(", + "kind": "punctuation" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "=>", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "number", + "kind": "keyword" + } + ], + "documentation": [] + } + }, + { + "marker": { + "fileName": "/tests/cases/fourslash/shims-pp/quickInfoDisplayPartsVar.ts", + "position": 123 + }, + "quickInfo": { + "kind": "var", + "kindModifiers": "", + "textSpan": { + "start": 123, + "length": 1 + }, + "displayParts": [ + { + "text": "var", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "g", + "kind": "localName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "(", + "kind": "punctuation" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "=>", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "number", + "kind": "keyword" + } + ], + "documentation": [] + } + }, + { + "marker": { + "fileName": "/tests/cases/fourslash/shims-pp/quickInfoDisplayPartsVar.ts", + "position": 127 + }, + "quickInfo": { + "kind": "var", + "kindModifiers": "", + "textSpan": { + "start": 127, + "length": 1 + }, + "displayParts": [ + { + "text": "var", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "f", + "kind": "localName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "(", + "kind": "punctuation" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "=>", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "number", + "kind": "keyword" + } + ], + "documentation": [] + } + }, + { + "marker": { + "fileName": "/tests/cases/fourslash/shims-pp/quickInfoDisplayPartsVar.ts", + "position": 130 + }, + "quickInfo": { + "kind": "var", + "kindModifiers": "", + "textSpan": { + "start": 130, + "length": 1 + }, + "displayParts": [ + { + "text": "var", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "f", + "kind": "localName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "(", + "kind": "punctuation" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "=>", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "number", + "kind": "keyword" + } + ], + "documentation": [] + } + }, + { + "marker": { + "fileName": "/tests/cases/fourslash/shims-pp/quickInfoDisplayPartsVar.ts", + "position": 139 + }, + "quickInfo": { + "kind": "var", + "kindModifiers": "", + "textSpan": { + "start": 139, + "length": 1 + }, + "displayParts": [ + { + "text": "var", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "h", + "kind": "localName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "{", + "kind": "punctuation" + }, + { + "text": "\n", + "kind": "lineBreak" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "(", + "kind": "punctuation" + }, + { + "text": "a", + "kind": "parameterName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "string", + "kind": "keyword" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "number", + "kind": "keyword" + }, + { + "text": ";", + "kind": "punctuation" + }, + { + "text": "\n", + "kind": "lineBreak" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "(", + "kind": "punctuation" + }, + { + "text": "a", + "kind": "parameterName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "number", + "kind": "keyword" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "string", + "kind": "keyword" + }, + { + "text": ";", + "kind": "punctuation" + }, + { + "text": "\n", + "kind": "lineBreak" + }, + { + "text": "}", + "kind": "punctuation" + } + ], + "documentation": [] + } + }, + { + "marker": { + "fileName": "/tests/cases/fourslash/shims-pp/quickInfoDisplayPartsVar.ts", + "position": 193 + }, + "quickInfo": { + "kind": "var", + "kindModifiers": "", + "textSpan": { + "start": 193, + "length": 1 + }, + "displayParts": [ + { + "text": "var", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "i", + "kind": "localName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "{", + "kind": "punctuation" + }, + { + "text": "\n", + "kind": "lineBreak" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "(", + "kind": "punctuation" + }, + { + "text": "a", + "kind": "parameterName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "string", + "kind": "keyword" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "number", + "kind": "keyword" + }, + { + "text": ";", + "kind": "punctuation" + }, + { + "text": "\n", + "kind": "lineBreak" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "(", + "kind": "punctuation" + }, + { + "text": "a", + "kind": "parameterName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "number", + "kind": "keyword" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "string", + "kind": "keyword" + }, + { + "text": ";", + "kind": "punctuation" + }, + { + "text": "\n", + "kind": "lineBreak" + }, + { + "text": "}", + "kind": "punctuation" + } + ], + "documentation": [] + } + }, + { + "marker": { + "fileName": "/tests/cases/fourslash/shims-pp/quickInfoDisplayPartsVar.ts", + "position": 197 + }, + "quickInfo": { + "kind": "var", + "kindModifiers": "", + "textSpan": { + "start": 197, + "length": 1 + }, + "displayParts": [ + { + "text": "var", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "h", + "kind": "localName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "{", + "kind": "punctuation" + }, + { + "text": "\n", + "kind": "lineBreak" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "(", + "kind": "punctuation" + }, + { + "text": "a", + "kind": "parameterName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "string", + "kind": "keyword" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "number", + "kind": "keyword" + }, + { + "text": ";", + "kind": "punctuation" + }, + { + "text": "\n", + "kind": "lineBreak" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "(", + "kind": "punctuation" + }, + { + "text": "a", + "kind": "parameterName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "number", + "kind": "keyword" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "string", + "kind": "keyword" + }, + { + "text": ";", + "kind": "punctuation" + }, + { + "text": "\n", + "kind": "lineBreak" + }, + { + "text": "}", + "kind": "punctuation" + } + ], + "documentation": [] + } + }, + { + "marker": { + "fileName": "/tests/cases/fourslash/shims-pp/quickInfoDisplayPartsVar.ts", + "position": 200 + }, + "quickInfo": { + "kind": "var", + "kindModifiers": "", + "textSpan": { + "start": 200, + "length": 1 + }, + "displayParts": [ + { + "text": "var", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "h", + "kind": "localName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "(", + "kind": "punctuation" + }, + { + "text": "a", + "kind": "parameterName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "number", + "kind": "keyword" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "=>", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "string", + "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": [] + } + }, + { + "marker": { + "fileName": "/tests/cases/fourslash/shims-pp/quickInfoDisplayPartsVar.ts", + "position": 207 + }, + "quickInfo": { + "kind": "var", + "kindModifiers": "", + "textSpan": { + "start": 207, + "length": 1 + }, + "displayParts": [ + { + "text": "var", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "h", + "kind": "localName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "(", + "kind": "punctuation" + }, + { + "text": "a", + "kind": "parameterName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "string", + "kind": "keyword" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "=>", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "number", + "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": [] + } + } +] \ No newline at end of file diff --git a/tests/baselines/reference/quickInfoDisplayPartsVar.shims.baseline b/tests/baselines/reference/quickInfoDisplayPartsVar.shims.baseline new file mode 100644 index 00000000000..249772f416e --- /dev/null +++ b/tests/baselines/reference/quickInfoDisplayPartsVar.shims.baseline @@ -0,0 +1,1112 @@ +[ + { + "marker": { + "fileName": "/tests/cases/fourslash/shims/quickInfoDisplayPartsVar.ts", + "position": 4 + }, + "quickInfo": { + "kind": "var", + "kindModifiers": "", + "textSpan": { + "start": 4, + "length": 1 + }, + "displayParts": [ + { + "text": "var", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "a", + "kind": "localName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "number", + "kind": "keyword" + } + ], + "documentation": [] + } + }, + { + "marker": { + "fileName": "/tests/cases/fourslash/shims/quickInfoDisplayPartsVar.ts", + "position": 37 + }, + "quickInfo": { + "kind": "local var", + "kindModifiers": "", + "textSpan": { + "start": 37, + "length": 1 + }, + "displayParts": [ + { + "text": "(", + "kind": "punctuation" + }, + { + "text": "local var", + "kind": "text" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "b", + "kind": "localName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "number", + "kind": "keyword" + } + ], + "documentation": [] + } + }, + { + "marker": { + "fileName": "/tests/cases/fourslash/shims/quickInfoDisplayPartsVar.ts", + "position": 41 + }, + "quickInfo": { + "kind": "var", + "kindModifiers": "", + "textSpan": { + "start": 41, + "length": 1 + }, + "displayParts": [ + { + "text": "var", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "a", + "kind": "localName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "number", + "kind": "keyword" + } + ], + "documentation": [] + } + }, + { + "marker": { + "fileName": "/tests/cases/fourslash/shims/quickInfoDisplayPartsVar.ts", + "position": 65 + }, + "quickInfo": { + "kind": "var", + "kindModifiers": "", + "textSpan": { + "start": 65, + "length": 1 + }, + "displayParts": [ + { + "text": "var", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "c", + "kind": "localName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "number", + "kind": "keyword" + } + ], + "documentation": [] + } + }, + { + "marker": { + "fileName": "/tests/cases/fourslash/shims/quickInfoDisplayPartsVar.ts", + "position": 88 + }, + "quickInfo": { + "kind": "var", + "kindModifiers": "export", + "textSpan": { + "start": 88, + "length": 1 + }, + "displayParts": [ + { + "text": "var", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "m", + "kind": "moduleName" + }, + { + "text": ".", + "kind": "punctuation" + }, + { + "text": "d", + "kind": "localName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "number", + "kind": "keyword" + } + ], + "documentation": [] + } + }, + { + "marker": { + "fileName": "/tests/cases/fourslash/shims/quickInfoDisplayPartsVar.ts", + "position": 102 + }, + "quickInfo": { + "kind": "var", + "kindModifiers": "", + "textSpan": { + "start": 102, + "length": 1 + }, + "displayParts": [ + { + "text": "var", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "f", + "kind": "localName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "(", + "kind": "punctuation" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "=>", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "number", + "kind": "keyword" + } + ], + "documentation": [] + } + }, + { + "marker": { + "fileName": "/tests/cases/fourslash/shims/quickInfoDisplayPartsVar.ts", + "position": 123 + }, + "quickInfo": { + "kind": "var", + "kindModifiers": "", + "textSpan": { + "start": 123, + "length": 1 + }, + "displayParts": [ + { + "text": "var", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "g", + "kind": "localName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "(", + "kind": "punctuation" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "=>", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "number", + "kind": "keyword" + } + ], + "documentation": [] + } + }, + { + "marker": { + "fileName": "/tests/cases/fourslash/shims/quickInfoDisplayPartsVar.ts", + "position": 127 + }, + "quickInfo": { + "kind": "var", + "kindModifiers": "", + "textSpan": { + "start": 127, + "length": 1 + }, + "displayParts": [ + { + "text": "var", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "f", + "kind": "localName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "(", + "kind": "punctuation" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "=>", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "number", + "kind": "keyword" + } + ], + "documentation": [] + } + }, + { + "marker": { + "fileName": "/tests/cases/fourslash/shims/quickInfoDisplayPartsVar.ts", + "position": 130 + }, + "quickInfo": { + "kind": "var", + "kindModifiers": "", + "textSpan": { + "start": 130, + "length": 1 + }, + "displayParts": [ + { + "text": "var", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "f", + "kind": "localName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "(", + "kind": "punctuation" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "=>", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "number", + "kind": "keyword" + } + ], + "documentation": [] + } + }, + { + "marker": { + "fileName": "/tests/cases/fourslash/shims/quickInfoDisplayPartsVar.ts", + "position": 139 + }, + "quickInfo": { + "kind": "var", + "kindModifiers": "", + "textSpan": { + "start": 139, + "length": 1 + }, + "displayParts": [ + { + "text": "var", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "h", + "kind": "localName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "{", + "kind": "punctuation" + }, + { + "text": "\n", + "kind": "lineBreak" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "(", + "kind": "punctuation" + }, + { + "text": "a", + "kind": "parameterName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "string", + "kind": "keyword" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "number", + "kind": "keyword" + }, + { + "text": ";", + "kind": "punctuation" + }, + { + "text": "\n", + "kind": "lineBreak" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "(", + "kind": "punctuation" + }, + { + "text": "a", + "kind": "parameterName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "number", + "kind": "keyword" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "string", + "kind": "keyword" + }, + { + "text": ";", + "kind": "punctuation" + }, + { + "text": "\n", + "kind": "lineBreak" + }, + { + "text": "}", + "kind": "punctuation" + } + ], + "documentation": [] + } + }, + { + "marker": { + "fileName": "/tests/cases/fourslash/shims/quickInfoDisplayPartsVar.ts", + "position": 193 + }, + "quickInfo": { + "kind": "var", + "kindModifiers": "", + "textSpan": { + "start": 193, + "length": 1 + }, + "displayParts": [ + { + "text": "var", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "i", + "kind": "localName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "{", + "kind": "punctuation" + }, + { + "text": "\n", + "kind": "lineBreak" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "(", + "kind": "punctuation" + }, + { + "text": "a", + "kind": "parameterName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "string", + "kind": "keyword" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "number", + "kind": "keyword" + }, + { + "text": ";", + "kind": "punctuation" + }, + { + "text": "\n", + "kind": "lineBreak" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "(", + "kind": "punctuation" + }, + { + "text": "a", + "kind": "parameterName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "number", + "kind": "keyword" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "string", + "kind": "keyword" + }, + { + "text": ";", + "kind": "punctuation" + }, + { + "text": "\n", + "kind": "lineBreak" + }, + { + "text": "}", + "kind": "punctuation" + } + ], + "documentation": [] + } + }, + { + "marker": { + "fileName": "/tests/cases/fourslash/shims/quickInfoDisplayPartsVar.ts", + "position": 197 + }, + "quickInfo": { + "kind": "var", + "kindModifiers": "", + "textSpan": { + "start": 197, + "length": 1 + }, + "displayParts": [ + { + "text": "var", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "h", + "kind": "localName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "{", + "kind": "punctuation" + }, + { + "text": "\n", + "kind": "lineBreak" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "(", + "kind": "punctuation" + }, + { + "text": "a", + "kind": "parameterName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "string", + "kind": "keyword" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "number", + "kind": "keyword" + }, + { + "text": ";", + "kind": "punctuation" + }, + { + "text": "\n", + "kind": "lineBreak" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "(", + "kind": "punctuation" + }, + { + "text": "a", + "kind": "parameterName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "number", + "kind": "keyword" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "string", + "kind": "keyword" + }, + { + "text": ";", + "kind": "punctuation" + }, + { + "text": "\n", + "kind": "lineBreak" + }, + { + "text": "}", + "kind": "punctuation" + } + ], + "documentation": [] + } + }, + { + "marker": { + "fileName": "/tests/cases/fourslash/shims/quickInfoDisplayPartsVar.ts", + "position": 200 + }, + "quickInfo": { + "kind": "var", + "kindModifiers": "", + "textSpan": { + "start": 200, + "length": 1 + }, + "displayParts": [ + { + "text": "var", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "h", + "kind": "localName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "(", + "kind": "punctuation" + }, + { + "text": "a", + "kind": "parameterName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "number", + "kind": "keyword" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "=>", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "string", + "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": [] + } + }, + { + "marker": { + "fileName": "/tests/cases/fourslash/shims/quickInfoDisplayPartsVar.ts", + "position": 207 + }, + "quickInfo": { + "kind": "var", + "kindModifiers": "", + "textSpan": { + "start": 207, + "length": 1 + }, + "displayParts": [ + { + "text": "var", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "h", + "kind": "localName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "(", + "kind": "punctuation" + }, + { + "text": "a", + "kind": "parameterName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "string", + "kind": "keyword" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "=>", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "number", + "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": [] + } + } +] \ No newline at end of file diff --git a/tests/baselines/reference/quickInfoDisplayPartsVarWithStringTypes01.baseline b/tests/baselines/reference/quickInfoDisplayPartsVarWithStringTypes01.baseline new file mode 100644 index 00000000000..3c46a6ba6bd --- /dev/null +++ b/tests/baselines/reference/quickInfoDisplayPartsVarWithStringTypes01.baseline @@ -0,0 +1,141 @@ +[ + { + "marker": { + "fileName": "/tests/cases/fourslash/quickInfoDisplayPartsVarWithStringTypes01.ts", + "position": 4 + }, + "quickInfo": { + "kind": "let", + "kindModifiers": "", + "textSpan": { + "start": 4, + "length": 5 + }, + "displayParts": [ + { + "text": "let", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "hello", + "kind": "localName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "\"hello\"", + "kind": "stringLiteral" + } + ], + "documentation": [] + } + }, + { + "marker": { + "fileName": "/tests/cases/fourslash/quickInfoDisplayPartsVarWithStringTypes01.ts", + "position": 44 + }, + "quickInfo": { + "kind": "let", + "kindModifiers": "", + "textSpan": { + "start": 44, + "length": 5 + }, + "displayParts": [ + { + "text": "let", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "world", + "kind": "localName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "\"world\"", + "kind": "stringLiteral" + } + ], + "documentation": [] + } + }, + { + "marker": { + "fileName": "/tests/cases/fourslash/quickInfoDisplayPartsVarWithStringTypes01.ts", + "position": 74 + }, + "quickInfo": { + "kind": "let", + "kindModifiers": "", + "textSpan": { + "start": 74, + "length": 12 + }, + "displayParts": [ + { + "text": "let", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "helloOrWorld", + "kind": "localName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "\"hello\"", + "kind": "stringLiteral" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "|", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "\"world\"", + "kind": "stringLiteral" + } + ], + "documentation": [] + } + } +] \ No newline at end of file diff --git a/tests/baselines/reference/quotedPropertyName1.types b/tests/baselines/reference/quotedPropertyName1.types index 4a4e73529b3..a142d607a75 100644 --- a/tests/baselines/reference/quotedPropertyName1.types +++ b/tests/baselines/reference/quotedPropertyName1.types @@ -3,5 +3,5 @@ class Test1 { >Test1 : Test1 "prop1" = 0; ->0 : number +>0 : 0 } diff --git a/tests/baselines/reference/quotedPropertyName2.types b/tests/baselines/reference/quotedPropertyName2.types index fe737758e3e..16b116a5e22 100644 --- a/tests/baselines/reference/quotedPropertyName2.types +++ b/tests/baselines/reference/quotedPropertyName2.types @@ -3,5 +3,5 @@ class Test1 { >Test1 : Test1 static "prop1" = 0; ->0 : number +>0 : 0 } diff --git a/tests/baselines/reference/quotedPropertyName3.types b/tests/baselines/reference/quotedPropertyName3.types index 7c957372e0d..f5f1d47bbc8 100644 --- a/tests/baselines/reference/quotedPropertyName3.types +++ b/tests/baselines/reference/quotedPropertyName3.types @@ -11,7 +11,7 @@ class Test { >() => this["prop1"] : () => number >this["prop1"] : number >this : this ->"prop1" : string +>"prop1" : "prop1" var y: number = x(); >y : number diff --git a/tests/baselines/reference/randomSemicolons1.types b/tests/baselines/reference/randomSemicolons1.types index 48a7c307314..4a246eeed21 100644 --- a/tests/baselines/reference/randomSemicolons1.types +++ b/tests/baselines/reference/randomSemicolons1.types @@ -2,7 +2,7 @@ ; ; var a = 1; >a : number ->1 : number +>1 : 1 ; diff --git a/tests/baselines/reference/reachabilityCheckWithEmptyDefault.types b/tests/baselines/reference/reachabilityCheckWithEmptyDefault.types index 37a6d11b598..72c23eae972 100644 --- a/tests/baselines/reference/reachabilityCheckWithEmptyDefault.types +++ b/tests/baselines/reference/reachabilityCheckWithEmptyDefault.types @@ -18,5 +18,5 @@ function foo(x: any) { print('1'); >print('1') : void >print : (s: string) => void ->'1' : string +>'1' : "1" } diff --git a/tests/baselines/reference/reactNamespaceJSXEmit.types b/tests/baselines/reference/reactNamespaceJSXEmit.types index 06c803ef7fd..d2bd88e8fbd 100644 --- a/tests/baselines/reference/reactNamespaceJSXEmit.types +++ b/tests/baselines/reference/reactNamespaceJSXEmit.types @@ -37,5 +37,5 @@ declare var x: any; >Bar : any >x : any >y : any ->2 : number +>2 : 2 diff --git a/tests/baselines/reference/readonlyInDeclarationFile.types b/tests/baselines/reference/readonlyInDeclarationFile.types index 7a3e11577c8..ca83a0a4c01 100644 --- a/tests/baselines/reference/readonlyInDeclarationFile.types +++ b/tests/baselines/reference/readonlyInDeclarationFile.types @@ -29,19 +29,19 @@ class C { private get b1() { return 1 } >b1 : number ->1 : number +>1 : 1 protected get b2() { return 1 } >b2 : number ->1 : number +>1 : 1 public get b3() { return 1 } >b3 : number ->1 : number +>1 : 1 private get c1() { return 1 } >c1 : number ->1 : number +>1 : 1 private set c1(value) { } >c1 : number @@ -49,7 +49,7 @@ class C { protected get c2() { return 1 } >c2 : number ->1 : number +>1 : 1 protected set c2(value) { } >c2 : number @@ -57,7 +57,7 @@ class C { public get c3() { return 1 } >c3 : number ->1 : number +>1 : 1 public set c3(value) { } >c3 : number @@ -74,19 +74,19 @@ class C { private static get t1() { return 1 } >t1 : number ->1 : number +>1 : 1 protected static get t2() { return 1 } >t2 : number ->1 : number +>1 : 1 public static get t3() { return 1 } >t3 : number ->1 : number +>1 : 1 private static get u1() { return 1 } >u1 : number ->1 : number +>1 : 1 private static set u1(value) { } >u1 : number @@ -94,7 +94,7 @@ class C { protected static get u2() { return 1 } >u2 : number ->1 : number +>1 : 1 protected static set u2(value) { } >u2 : number @@ -102,7 +102,7 @@ class C { public static get u3() { return 1 } >u3 : number ->1 : number +>1 : 1 public static set u3(value) { } >u3 : number @@ -128,11 +128,11 @@ function f() { get x() { return 1; }, >x : number ->1 : number +>1 : 1 get y() { return 1; }, >y : number ->1 : number +>1 : 1 set y(value) { } >y : number diff --git a/tests/baselines/reference/reboundBaseClassSymbol.types b/tests/baselines/reference/reboundBaseClassSymbol.types index 9c62d838f42..602907cb5b3 100644 --- a/tests/baselines/reference/reboundBaseClassSymbol.types +++ b/tests/baselines/reference/reboundBaseClassSymbol.types @@ -8,7 +8,7 @@ module Foo { var A = 1; >A : number ->1 : number +>1 : 1 interface B extends A { b: string; } >B : B diff --git a/tests/baselines/reference/recursiveClassInstantiationsWithDefaultConstructors.types b/tests/baselines/reference/recursiveClassInstantiationsWithDefaultConstructors.types index 482ec707e49..3e74ba7f57b 100644 --- a/tests/baselines/reference/recursiveClassInstantiationsWithDefaultConstructors.types +++ b/tests/baselines/reference/recursiveClassInstantiationsWithDefaultConstructors.types @@ -14,7 +14,7 @@ export class MemberName { public prefix: string = ""; >prefix : string ->"" : string +>"" : "" } export class MemberNameArray extends MemberName { >MemberNameArray : MemberNameArray diff --git a/tests/baselines/reference/recursiveComplicatedClasses.types b/tests/baselines/reference/recursiveComplicatedClasses.types index 1bb48a3c0c9..ea590daca5a 100644 --- a/tests/baselines/reference/recursiveComplicatedClasses.types +++ b/tests/baselines/reference/recursiveComplicatedClasses.types @@ -14,7 +14,7 @@ function aEnclosesB(a: Symbol) { >Symbol : Symbol return true; ->true : boolean +>true : true } class Symbol { diff --git a/tests/baselines/reference/recursiveFunctionTypes.errors.txt b/tests/baselines/reference/recursiveFunctionTypes.errors.txt index 8d5303c0669..8614f747016 100644 --- a/tests/baselines/reference/recursiveFunctionTypes.errors.txt +++ b/tests/baselines/reference/recursiveFunctionTypes.errors.txt @@ -1,23 +1,23 @@ -tests/cases/compiler/recursiveFunctionTypes.ts(1,35): error TS2322: Type 'number' is not assignable to type '() => typeof fn'. +tests/cases/compiler/recursiveFunctionTypes.ts(1,35): error TS2322: Type '1' is not assignable to type '() => typeof fn'. tests/cases/compiler/recursiveFunctionTypes.ts(3,5): error TS2322: Type '() => typeof fn' is not assignable to type 'number'. tests/cases/compiler/recursiveFunctionTypes.ts(4,5): error TS2322: Type '() => typeof fn' is not assignable to type '() => number'. Type '() => typeof fn' is not assignable to type 'number'. tests/cases/compiler/recursiveFunctionTypes.ts(11,16): error TS2355: A function whose declared type is neither 'void' nor 'any' must return a value. tests/cases/compiler/recursiveFunctionTypes.ts(12,16): error TS2355: A function whose declared type is neither 'void' nor 'any' must return a value. tests/cases/compiler/recursiveFunctionTypes.ts(17,5): error TS2322: Type '() => I' is not assignable to type 'number'. -tests/cases/compiler/recursiveFunctionTypes.ts(22,5): error TS2345: Argument of type 'number' is not assignable to parameter of type '(t: typeof g) => void'. -tests/cases/compiler/recursiveFunctionTypes.ts(25,1): error TS2322: Type 'number' is not assignable to type '() => any'. +tests/cases/compiler/recursiveFunctionTypes.ts(22,5): error TS2345: Argument of type '3' is not assignable to parameter of type '(t: typeof g) => void'. +tests/cases/compiler/recursiveFunctionTypes.ts(25,1): error TS2322: Type '3' is not assignable to type '() => any'. tests/cases/compiler/recursiveFunctionTypes.ts(30,10): error TS2394: Overload signature is not compatible with function implementation. tests/cases/compiler/recursiveFunctionTypes.ts(33,1): error TS2346: Supplied parameters do not match any signature of call target. -tests/cases/compiler/recursiveFunctionTypes.ts(34,4): error TS2345: Argument of type 'string' is not assignable to parameter of type '{ (): typeof f6; (a: typeof f6): () => number; }'. +tests/cases/compiler/recursiveFunctionTypes.ts(34,4): error TS2345: Argument of type '""' is not assignable to parameter of type '{ (): typeof f6; (a: typeof f6): () => number; }'. tests/cases/compiler/recursiveFunctionTypes.ts(42,1): error TS2346: Supplied parameters do not match any signature of call target. -tests/cases/compiler/recursiveFunctionTypes.ts(43,4): error TS2345: Argument of type 'string' is not assignable to parameter of type '{ (): typeof f7; (a: typeof f7): () => number; (a: number): number; (a?: typeof f7): typeof f7; }'. +tests/cases/compiler/recursiveFunctionTypes.ts(43,4): error TS2345: Argument of type '""' is not assignable to parameter of type '{ (): typeof f7; (a: typeof f7): () => number; (a: number): number; (a?: typeof f7): typeof f7; }'. ==== tests/cases/compiler/recursiveFunctionTypes.ts (13 errors) ==== function fn(): typeof fn { return 1; } ~ -!!! error TS2322: Type 'number' is not assignable to type '() => typeof fn'. +!!! error TS2322: Type '1' is not assignable to type '() => typeof fn'. var x: number = fn; // error ~ @@ -51,12 +51,12 @@ tests/cases/compiler/recursiveFunctionTypes.ts(43,4): error TS2345: Argument of } C.g(3); // error ~ -!!! error TS2345: Argument of type 'number' is not assignable to parameter of type '(t: typeof g) => void'. +!!! error TS2345: Argument of type '3' is not assignable to parameter of type '(t: typeof g) => void'. var f4: () => typeof f4; f4 = 3; // error ~~ -!!! error TS2322: Type 'number' is not assignable to type '() => any'. +!!! error TS2322: Type '3' is not assignable to type '() => any'. function f5() { return f5; } @@ -71,7 +71,7 @@ tests/cases/compiler/recursiveFunctionTypes.ts(43,4): error TS2345: Argument of !!! error TS2346: Supplied parameters do not match any signature of call target. f6(""); // ok (function takes an any param) ~~ -!!! error TS2345: Argument of type 'string' is not assignable to parameter of type '{ (): typeof f6; (a: typeof f6): () => number; }'. +!!! error TS2345: Argument of type '""' is not assignable to parameter of type '{ (): typeof f6; (a: typeof f6): () => number; }'. f6(); // ok declare function f7(): typeof f7; @@ -84,5 +84,5 @@ tests/cases/compiler/recursiveFunctionTypes.ts(43,4): error TS2345: Argument of !!! error TS2346: Supplied parameters do not match any signature of call target. f7(""); // ok (function takes an any param) ~~ -!!! error TS2345: Argument of type 'string' is not assignable to parameter of type '{ (): typeof f7; (a: typeof f7): () => number; (a: number): number; (a?: typeof f7): typeof f7; }'. +!!! error TS2345: Argument of type '""' is not assignable to parameter of type '{ (): typeof f7; (a: typeof f7): () => number; (a: number): number; (a?: typeof f7): typeof f7; }'. f7(); // ok \ No newline at end of file diff --git a/tests/baselines/reference/recursiveInference1.types b/tests/baselines/reference/recursiveInference1.types index 58bb13d18e7..7144dd17abe 100644 --- a/tests/baselines/reference/recursiveInference1.types +++ b/tests/baselines/reference/recursiveInference1.types @@ -5,23 +5,23 @@ function fib(x:number) { return x <= 1 ? x : fib(x - 1) + fib(x - 2); } >x <= 1 ? x : fib(x - 1) + fib(x - 2) : any >x <= 1 : boolean >x : number ->1 : number +>1 : 1 >x : number >fib(x - 1) + fib(x - 2) : any >fib(x - 1) : any >fib : (x: number) => any >x - 1 : number >x : number ->1 : number +>1 : 1 >fib(x - 2) : any >fib : (x: number) => any >x - 2 : number >x : number ->2 : number +>2 : 2 var result = fib(5); >result : any >fib(5) : any >fib : (x: number) => any ->5 : number +>5 : 5 diff --git a/tests/baselines/reference/recursiveInitializer.types b/tests/baselines/reference/recursiveInitializer.types index f5bc2338902..ad6b8059b6c 100644 --- a/tests/baselines/reference/recursiveInitializer.types +++ b/tests/baselines/reference/recursiveInitializer.types @@ -22,7 +22,7 @@ var s1 = s1 + ''; >s1 : any >s1 + '' : string >s1 : any ->'' : string +>'' : "" var s2 /* any */ = s2 + s2; >s2 : any @@ -39,7 +39,7 @@ var s3 : string = s3 + s3; var s4 = '' + s4; >s4 : any >'' + s4 : string ->'' : string +>'' : "" >s4 : any // boolean unless otherwise specified diff --git a/tests/baselines/reference/recursiveMods.types b/tests/baselines/reference/recursiveMods.types index d4db816daf7..45e803fee1e 100644 --- a/tests/baselines/reference/recursiveMods.types +++ b/tests/baselines/reference/recursiveMods.types @@ -15,7 +15,7 @@ export module Foo { >C : C if (true) { return Bar();} ->true : boolean +>true : true >Bar() : C >Bar : () => C diff --git a/tests/baselines/reference/regExpWithSlashInCharClass.types b/tests/baselines/reference/regExpWithSlashInCharClass.types index fafe6e1be69..e866f2bc229 100644 --- a/tests/baselines/reference/regExpWithSlashInCharClass.types +++ b/tests/baselines/reference/regExpWithSlashInCharClass.types @@ -3,26 +3,26 @@ var foo1 = "a/".replace(/.[/]/, ""); >foo1 : string >"a/".replace(/.[/]/, "") : string >"a/".replace : { (searchValue: string, replaceValue: string): string; (searchValue: string, replacer: (substring: string, ...args: any[]) => string): string; (searchValue: RegExp, replaceValue: string): string; (searchValue: RegExp, replacer: (substring: string, ...args: any[]) => string): string; } ->"a/" : string +>"a/" : "a/" >replace : { (searchValue: string, replaceValue: string): string; (searchValue: string, replacer: (substring: string, ...args: any[]) => string): string; (searchValue: RegExp, replaceValue: string): string; (searchValue: RegExp, replacer: (substring: string, ...args: any[]) => string): string; } >/.[/]/ : RegExp ->"" : string +>"" : "" var foo2 = "a//".replace(/.[//]/g, ""); >foo2 : string >"a//".replace(/.[//]/g, "") : string >"a//".replace : { (searchValue: string, replaceValue: string): string; (searchValue: string, replacer: (substring: string, ...args: any[]) => string): string; (searchValue: RegExp, replaceValue: string): string; (searchValue: RegExp, replacer: (substring: string, ...args: any[]) => string): string; } ->"a//" : string +>"a//" : "a//" >replace : { (searchValue: string, replaceValue: string): string; (searchValue: string, replacer: (substring: string, ...args: any[]) => string): string; (searchValue: RegExp, replaceValue: string): string; (searchValue: RegExp, replacer: (substring: string, ...args: any[]) => string): string; } >/.[//]/g : RegExp ->"" : string +>"" : "" var foo3 = "a/".replace(/.[/no sleep /till/]/, "bugfix"); >foo3 : string >"a/".replace(/.[/no sleep /till/]/, "bugfix") : string >"a/".replace : { (searchValue: string, replaceValue: string): string; (searchValue: string, replacer: (substring: string, ...args: any[]) => string): string; (searchValue: RegExp, replaceValue: string): string; (searchValue: RegExp, replacer: (substring: string, ...args: any[]) => string): string; } ->"a/" : string +>"a/" : "a/" >replace : { (searchValue: string, replaceValue: string): string; (searchValue: string, replacer: (substring: string, ...args: any[]) => string): string; (searchValue: RegExp, replaceValue: string): string; (searchValue: RegExp, replacer: (substring: string, ...args: any[]) => string): string; } >/.[/no sleep /till/]/ : RegExp ->"bugfix" : string +>"bugfix" : "bugfix" diff --git a/tests/baselines/reference/relativePathToDeclarationFile.types b/tests/baselines/reference/relativePathToDeclarationFile.types index ef77acc85b4..0c196814b08 100644 --- a/tests/baselines/reference/relativePathToDeclarationFile.types +++ b/tests/baselines/reference/relativePathToDeclarationFile.types @@ -27,7 +27,7 @@ if(foo.M2.x){ >M2 : typeof other.M2 >x : string >charCodeAt : (index: number) => number ->0 : number +>0 : 0 } === tests/cases/conformance/externalModules/test/foo.d.ts === diff --git a/tests/baselines/reference/requireEmitSemicolon.types b/tests/baselines/reference/requireEmitSemicolon.types index 43ca9ef29c8..541cd67cb85 100644 --- a/tests/baselines/reference/requireEmitSemicolon.types +++ b/tests/baselines/reference/requireEmitSemicolon.types @@ -23,7 +23,7 @@ export module Database { >P : typeof P >Models : typeof P.Models >Person : typeof P.Models.Person ->"Rock" : string +>"Rock" : "Rock" } } } diff --git a/tests/baselines/reference/requiredInitializedParameter3.types b/tests/baselines/reference/requiredInitializedParameter3.types index aa37f5e13dd..92b35e2c83c 100644 --- a/tests/baselines/reference/requiredInitializedParameter3.types +++ b/tests/baselines/reference/requiredInitializedParameter3.types @@ -13,6 +13,6 @@ class C1 implements I1 { method(a = 0, b?) { } >method : (a?: number, b?: any) => void >a : number ->0 : number +>0 : 0 >b : any } diff --git a/tests/baselines/reference/requiredInitializedParameter4.types b/tests/baselines/reference/requiredInitializedParameter4.types index c483146a1ba..5465c9d1820 100644 --- a/tests/baselines/reference/requiredInitializedParameter4.types +++ b/tests/baselines/reference/requiredInitializedParameter4.types @@ -5,6 +5,6 @@ class C1 { method(a = 0, b) { } >method : (a: number, b: any) => void >a : number ->0 : number +>0 : 0 >b : any } diff --git a/tests/baselines/reference/reservedNamesInAliases.errors.txt b/tests/baselines/reference/reservedNamesInAliases.errors.txt index 5c17158053e..b6565427395 100644 --- a/tests/baselines/reference/reservedNamesInAliases.errors.txt +++ b/tests/baselines/reference/reservedNamesInAliases.errors.txt @@ -5,7 +5,7 @@ tests/cases/conformance/types/typeAliases/reservedNamesInAliases.ts(5,6): error tests/cases/conformance/types/typeAliases/reservedNamesInAliases.ts(6,1): error TS2304: Cannot find name 'type'. tests/cases/conformance/types/typeAliases/reservedNamesInAliases.ts(6,6): error TS1005: ';' expected. tests/cases/conformance/types/typeAliases/reservedNamesInAliases.ts(6,11): error TS1109: Expression expected. -tests/cases/conformance/types/typeAliases/reservedNamesInAliases.ts(6,13): error TS2304: Cannot find name 'I'. +tests/cases/conformance/types/typeAliases/reservedNamesInAliases.ts(6,13): error TS2693: 'I' only refers to a type, but is being used as a value here. ==== tests/cases/conformance/types/typeAliases/reservedNamesInAliases.ts (8 errors) ==== @@ -30,4 +30,4 @@ tests/cases/conformance/types/typeAliases/reservedNamesInAliases.ts(6,13): error ~ !!! error TS1109: Expression expected. ~ -!!! error TS2304: Cannot find name 'I'. \ No newline at end of file +!!! error TS2693: 'I' only refers to a type, but is being used as a value here. \ No newline at end of file diff --git a/tests/baselines/reference/reservedWords.types b/tests/baselines/reference/reservedWords.types index 4c76e056ce2..ae5a391bc58 100644 --- a/tests/baselines/reference/reservedWords.types +++ b/tests/baselines/reference/reservedWords.types @@ -5,19 +5,19 @@ var obj = { if: 0, >if : number ->0 : number +>0 : 0 debugger: 2, >debugger : number ->2 : number +>2 : 2 break: 3, >break : number ->3 : number +>3 : 3 function: 4 >function : number ->4 : number +>4 : 4 } //This compiles. @@ -28,22 +28,22 @@ var obj2 = { if: 0, >if : number ->0 : number +>0 : 0 while: 1, >while : number ->1 : number +>1 : 1 debugger: 2, >debugger : number ->2 : number +>2 : 2 break: 3, >break : number ->3 : number +>3 : 3 function: 4 >function : number ->4 : number +>4 : 4 } diff --git a/tests/baselines/reference/restElementWithAssignmentPattern5.types b/tests/baselines/reference/restElementWithAssignmentPattern5.types index c5cbc9ad206..298bc2e4363 100644 --- a/tests/baselines/reference/restElementWithAssignmentPattern5.types +++ b/tests/baselines/reference/restElementWithAssignmentPattern5.types @@ -11,6 +11,6 @@ var s: string, s2: string; >s : string >s2 : string >["", ""] : string[] ->"" : string ->"" : string +>"" : "" +>"" : "" diff --git a/tests/baselines/reference/restParameterNoTypeAnnotation.types b/tests/baselines/reference/restParameterNoTypeAnnotation.types index eed17802d57..e4944ec32cf 100644 --- a/tests/baselines/reference/restParameterNoTypeAnnotation.types +++ b/tests/baselines/reference/restParameterNoTypeAnnotation.types @@ -7,7 +7,7 @@ function foo(...rest) { >x : number >rest[0] : any >rest : any[] ->0 : number +>0 : 0 return x; >x : number diff --git a/tests/baselines/reference/returnInConstructor1.errors.txt b/tests/baselines/reference/returnInConstructor1.errors.txt index 30f629f9f8a..a7d3fd05204 100644 --- a/tests/baselines/reference/returnInConstructor1.errors.txt +++ b/tests/baselines/reference/returnInConstructor1.errors.txt @@ -1,6 +1,6 @@ -tests/cases/compiler/returnInConstructor1.ts(11,16): error TS2322: Type 'number' is not assignable to type 'B'. +tests/cases/compiler/returnInConstructor1.ts(11,16): error TS2322: Type '1' is not assignable to type 'B'. tests/cases/compiler/returnInConstructor1.ts(11,16): error TS2409: Return type of constructor signature must be assignable to the instance type of the class -tests/cases/compiler/returnInConstructor1.ts(25,16): error TS2322: Type 'string' is not assignable to type 'D'. +tests/cases/compiler/returnInConstructor1.ts(25,16): error TS2322: Type '"test"' is not assignable to type 'D'. tests/cases/compiler/returnInConstructor1.ts(25,16): error TS2409: Return type of constructor signature must be assignable to the instance type of the class tests/cases/compiler/returnInConstructor1.ts(39,16): error TS2322: Type '{ foo: number; }' is not assignable to type 'F'. Types of property 'foo' are incompatible. @@ -25,7 +25,7 @@ tests/cases/compiler/returnInConstructor1.ts(55,16): error TS2409: Return type o constructor() { return 1; // error ~ -!!! error TS2322: Type 'number' is not assignable to type 'B'. +!!! error TS2322: Type '1' is not assignable to type 'B'. ~ !!! error TS2409: Return type of constructor signature must be assignable to the instance type of the class } @@ -43,7 +43,7 @@ tests/cases/compiler/returnInConstructor1.ts(55,16): error TS2409: Return type o constructor() { return "test"; // error ~~~~~~ -!!! error TS2322: Type 'string' is not assignable to type 'D'. +!!! error TS2322: Type '"test"' is not assignable to type 'D'. ~~~~~~ !!! error TS2409: Return type of constructor signature must be assignable to the instance type of the class } diff --git a/tests/baselines/reference/returnStatement1.types b/tests/baselines/reference/returnStatement1.types index b7e166ffa75..0c909551043 100644 --- a/tests/baselines/reference/returnStatement1.types +++ b/tests/baselines/reference/returnStatement1.types @@ -13,6 +13,6 @@ function f() { }; ("harmless extra line"); ->("harmless extra line") : string ->"harmless extra line" : string +>("harmless extra line") : "harmless extra line" +>"harmless extra line" : "harmless extra line" } diff --git a/tests/baselines/reference/returnStatements.types b/tests/baselines/reference/returnStatements.types index e5332b2e6ac..b75104dd666 100644 --- a/tests/baselines/reference/returnStatements.types +++ b/tests/baselines/reference/returnStatements.types @@ -2,11 +2,11 @@ // all the following should be valid function fn1(): number { return 1; } >fn1 : () => number ->1 : number +>1 : 1 function fn2(): string { return ''; } >fn2 : () => string ->'' : string +>'' : "" function fn3(): void { return undefined; } >fn3 : () => void @@ -17,14 +17,14 @@ function fn4(): void { return; } function fn5(): boolean { return true; } >fn5 : () => boolean ->true : boolean +>true : true function fn6(): Date { return new Date(12); } >fn6 : () => Date >Date : Date >new Date(12) : Date >Date : DateConstructor ->12 : number +>12 : 12 function fn7(): any { return null; } >fn7 : () => any @@ -59,7 +59,7 @@ function fn10(): I { return { id: 12 }; } >I : I >{ id: 12 } : { id: number; } >id : number ->12 : number +>12 : 12 function fn11(): I { return new C(); } >fn11 : () => I diff --git a/tests/baselines/reference/returnTypeParameter.errors.txt b/tests/baselines/reference/returnTypeParameter.errors.txt index 1bd9f6a63f6..24b9e725de8 100644 --- a/tests/baselines/reference/returnTypeParameter.errors.txt +++ b/tests/baselines/reference/returnTypeParameter.errors.txt @@ -1,5 +1,5 @@ tests/cases/compiler/returnTypeParameter.ts(1,22): error TS2355: A function whose declared type is neither 'void' nor 'any' must return a value. -tests/cases/compiler/returnTypeParameter.ts(2,34): error TS2304: Cannot find name 'T'. +tests/cases/compiler/returnTypeParameter.ts(2,34): error TS2693: 'T' only refers to a type, but is being used as a value here. ==== tests/cases/compiler/returnTypeParameter.ts (2 errors) ==== @@ -8,4 +8,4 @@ tests/cases/compiler/returnTypeParameter.ts(2,34): error TS2304: Cannot find nam !!! error TS2355: A function whose declared type is neither 'void' nor 'any' must return a value. function f2(a: T): T { return T; } // bug was that this satisfied the return statement requirement ~ -!!! error TS2304: Cannot find name 'T'. \ No newline at end of file +!!! error TS2693: 'T' only refers to a type, but is being used as a value here. \ No newline at end of file diff --git a/tests/baselines/reference/reverseInferenceInContextualInstantiation.types b/tests/baselines/reference/reverseInferenceInContextualInstantiation.types index 881f6c6941f..d4a0b43919c 100644 --- a/tests/baselines/reference/reverseInferenceInContextualInstantiation.types +++ b/tests/baselines/reference/reverseInferenceInContextualInstantiation.types @@ -6,7 +6,7 @@ function compare(a: T, b: T): number { return 0; } >T : T >b : T >T : T ->0 : number +>0 : 0 var x: number[]; >x : number[] diff --git a/tests/baselines/reference/reversedRecusiveTypeInstantiation.types b/tests/baselines/reference/reversedRecusiveTypeInstantiation.types index fcbdab34e5a..2b647369cf4 100644 --- a/tests/baselines/reference/reversedRecusiveTypeInstantiation.types +++ b/tests/baselines/reference/reversedRecusiveTypeInstantiation.types @@ -24,12 +24,12 @@ var a : A >A : A a.zPos2Pos1.xPos1 = 1 ->a.zPos2Pos1.xPos1 = 1 : number +>a.zPos2Pos1.xPos1 = 1 : 1 >a.zPos2Pos1.xPos1 : number >a.zPos2Pos1 : A >a : A >zPos2Pos1 : A >xPos1 : number ->1 : number +>1 : 1 diff --git a/tests/baselines/reference/scannerES3NumericLiteral1.types b/tests/baselines/reference/scannerES3NumericLiteral1.types index 0a1108c7ca9..99b10d56ad6 100644 --- a/tests/baselines/reference/scannerES3NumericLiteral1.types +++ b/tests/baselines/reference/scannerES3NumericLiteral1.types @@ -1,4 +1,4 @@ === tests/cases/conformance/scanner/ecmascript3/scannerES3NumericLiteral1.ts === 0 ->0 : number +>0 : 0 diff --git a/tests/baselines/reference/scannerES3NumericLiteral2.types b/tests/baselines/reference/scannerES3NumericLiteral2.types index 8fae044c217..802e9fb7f33 100644 --- a/tests/baselines/reference/scannerES3NumericLiteral2.types +++ b/tests/baselines/reference/scannerES3NumericLiteral2.types @@ -1,4 +1,4 @@ === tests/cases/conformance/scanner/ecmascript3/scannerES3NumericLiteral2.ts === 01 ->01 : number +>01 : 1 diff --git a/tests/baselines/reference/scannerES3NumericLiteral5.types b/tests/baselines/reference/scannerES3NumericLiteral5.types index 2a5367e5b17..8e0d45c8085 100644 --- a/tests/baselines/reference/scannerES3NumericLiteral5.types +++ b/tests/baselines/reference/scannerES3NumericLiteral5.types @@ -1,4 +1,4 @@ === tests/cases/conformance/scanner/ecmascript3/scannerES3NumericLiteral5.ts === 1e0 ->1e0 : number +>1e0 : 1 diff --git a/tests/baselines/reference/scannerES3NumericLiteral7.types b/tests/baselines/reference/scannerES3NumericLiteral7.types index d5ffa0ea131..b39a4c58be9 100644 --- a/tests/baselines/reference/scannerES3NumericLiteral7.types +++ b/tests/baselines/reference/scannerES3NumericLiteral7.types @@ -1,4 +1,4 @@ === tests/cases/conformance/scanner/ecmascript3/scannerES3NumericLiteral7.ts === 1e+0 ->1e+0 : number +>1e+0 : 1 diff --git a/tests/baselines/reference/scannerEnum1.types b/tests/baselines/reference/scannerEnum1.types index d75899a75f1..c0b195db637 100644 --- a/tests/baselines/reference/scannerEnum1.types +++ b/tests/baselines/reference/scannerEnum1.types @@ -3,10 +3,10 @@ >CodeGenTarget : CodeGenTarget ES3 = 0, ->ES3 : CodeGenTarget ->0 : number +>ES3 : CodeGenTarget.ES3 +>0 : 0 ES5 = 1, ->ES5 : CodeGenTarget ->1 : number +>ES5 : CodeGenTarget.ES5 +>1 : 1 } diff --git a/tests/baselines/reference/scannerNumericLiteral1.types b/tests/baselines/reference/scannerNumericLiteral1.types index a3eebc411fa..06663789f3f 100644 --- a/tests/baselines/reference/scannerNumericLiteral1.types +++ b/tests/baselines/reference/scannerNumericLiteral1.types @@ -1,4 +1,4 @@ === tests/cases/conformance/scanner/ecmascript5/scannerNumericLiteral1.ts === 0 ->0 : number +>0 : 0 diff --git a/tests/baselines/reference/scannerNumericLiteral5.types b/tests/baselines/reference/scannerNumericLiteral5.types index 86ab1a903e0..31fe2e5149d 100644 --- a/tests/baselines/reference/scannerNumericLiteral5.types +++ b/tests/baselines/reference/scannerNumericLiteral5.types @@ -1,4 +1,4 @@ === tests/cases/conformance/scanner/ecmascript5/scannerNumericLiteral5.ts === 1e0 ->1e0 : number +>1e0 : 1 diff --git a/tests/baselines/reference/scannerNumericLiteral7.types b/tests/baselines/reference/scannerNumericLiteral7.types index 25ce9275290..e2824f8cf94 100644 --- a/tests/baselines/reference/scannerNumericLiteral7.types +++ b/tests/baselines/reference/scannerNumericLiteral7.types @@ -1,4 +1,4 @@ === tests/cases/conformance/scanner/ecmascript5/scannerNumericLiteral7.ts === 1e+0 ->1e+0 : number +>1e+0 : 1 diff --git a/tests/baselines/reference/scannerStringLiteralWithContainingNullCharacter1.types b/tests/baselines/reference/scannerStringLiteralWithContainingNullCharacter1.types index 43eadd8c291..9d17f416c39 100644 Binary files a/tests/baselines/reference/scannerStringLiteralWithContainingNullCharacter1.types and b/tests/baselines/reference/scannerStringLiteralWithContainingNullCharacter1.types differ diff --git a/tests/baselines/reference/scannerUnicodeEscapeInKeyword1.types b/tests/baselines/reference/scannerUnicodeEscapeInKeyword1.types index a73ee57b791..eb9516e6e25 100644 --- a/tests/baselines/reference/scannerUnicodeEscapeInKeyword1.types +++ b/tests/baselines/reference/scannerUnicodeEscapeInKeyword1.types @@ -1,5 +1,5 @@ === tests/cases/conformance/scanner/ecmascript5/scannerUnicodeEscapeInKeyword1.ts === \u0076ar x = "hello"; >x : string ->"hello" : string +>"hello" : "hello" diff --git a/tests/baselines/reference/selfInCallback.types b/tests/baselines/reference/selfInCallback.types index 6010a64d80f..2d3385e3be6 100644 --- a/tests/baselines/reference/selfInCallback.types +++ b/tests/baselines/reference/selfInCallback.types @@ -4,7 +4,7 @@ class C { public p1 = 0; >p1 : number ->0 : number +>0 : 0 public callback(cb:()=>void) {cb();} >callback : (cb: () => void) => void @@ -25,6 +25,6 @@ class C { >this.p1 : number >this : this >p1 : number ->1 : number +>1 : 1 } } diff --git a/tests/baselines/reference/selfInLambdas.types b/tests/baselines/reference/selfInLambdas.types index 3addf07c75a..614ebc16e68 100644 --- a/tests/baselines/reference/selfInLambdas.types +++ b/tests/baselines/reference/selfInLambdas.types @@ -28,7 +28,7 @@ var o = { counter: 0, >counter : number ->0 : number +>0 : 0 start: function() { >start : () => void @@ -67,7 +67,7 @@ class X { private value = "value"; >value : string ->"value" : string +>"value" : "value" public foo() { >foo : () => void diff --git a/tests/baselines/reference/shebang.types b/tests/baselines/reference/shebang.types index 5fd6f0533ec..b1a175d53dc 100644 --- a/tests/baselines/reference/shebang.types +++ b/tests/baselines/reference/shebang.types @@ -2,5 +2,5 @@ #!/usr/bin/env node var foo = 'I wish the generated JS to be executed in node'; >foo : string ->'I wish the generated JS to be executed in node' : string +>'I wish the generated JS to be executed in node' : "I wish the generated JS to be executed in node" diff --git a/tests/baselines/reference/shorthandOfExportedEntity01_targetES2015_CommonJS.js b/tests/baselines/reference/shorthandOfExportedEntity01_targetES2015_CommonJS.js index 9e057951b3a..df23dba8776 100644 --- a/tests/baselines/reference/shorthandOfExportedEntity01_targetES2015_CommonJS.js +++ b/tests/baselines/reference/shorthandOfExportedEntity01_targetES2015_CommonJS.js @@ -17,5 +17,5 @@ exports.foo = foo; //// [shorthandOfExportedEntity01_targetES2015_CommonJS.d.ts] -export declare const test: string; +export declare const test: "test"; export declare function foo(): void; diff --git a/tests/baselines/reference/shorthandOfExportedEntity01_targetES2015_CommonJS.types b/tests/baselines/reference/shorthandOfExportedEntity01_targetES2015_CommonJS.types index dcc04015993..f299632b3ef 100644 --- a/tests/baselines/reference/shorthandOfExportedEntity01_targetES2015_CommonJS.types +++ b/tests/baselines/reference/shorthandOfExportedEntity01_targetES2015_CommonJS.types @@ -1,8 +1,8 @@ === tests/cases/compiler/shorthandOfExportedEntity01_targetES2015_CommonJS.ts === export const test = "test"; ->test : string ->"test" : string +>test : "test" +>"test" : "test" export function foo () { >foo : () => void @@ -10,6 +10,6 @@ export function foo () { const x = { test }; >x : { test: string; } >{ test } : { test: string; } ->test : string +>test : "test" } diff --git a/tests/baselines/reference/shorthandOfExportedEntity02_targetES5_CommonJS.js b/tests/baselines/reference/shorthandOfExportedEntity02_targetES5_CommonJS.js index 764739705c4..a594a1b6de5 100644 --- a/tests/baselines/reference/shorthandOfExportedEntity02_targetES5_CommonJS.js +++ b/tests/baselines/reference/shorthandOfExportedEntity02_targetES5_CommonJS.js @@ -17,5 +17,5 @@ exports.foo = foo; //// [shorthandOfExportedEntity02_targetES5_CommonJS.d.ts] -export declare const test: string; +export declare const test: "test"; export declare function foo(): void; diff --git a/tests/baselines/reference/shorthandOfExportedEntity02_targetES5_CommonJS.types b/tests/baselines/reference/shorthandOfExportedEntity02_targetES5_CommonJS.types index 27d16e2166f..effe8e89da4 100644 --- a/tests/baselines/reference/shorthandOfExportedEntity02_targetES5_CommonJS.types +++ b/tests/baselines/reference/shorthandOfExportedEntity02_targetES5_CommonJS.types @@ -1,8 +1,8 @@ === tests/cases/compiler/shorthandOfExportedEntity02_targetES5_CommonJS.ts === export const test = "test"; ->test : string ->"test" : string +>test : "test" +>"test" : "test" export function foo () { >foo : () => void @@ -10,6 +10,6 @@ export function foo () { const x = { test }; >x : { test: string; } >{ test } : { test: string; } ->test : string +>test : "test" } diff --git a/tests/baselines/reference/shorthandPropertyAssignmentsInDestructuring.errors.txt b/tests/baselines/reference/shorthandPropertyAssignmentsInDestructuring.errors.txt index 7ac5fe9a26c..ce029a49f18 100644 --- a/tests/baselines/reference/shorthandPropertyAssignmentsInDestructuring.errors.txt +++ b/tests/baselines/reference/shorthandPropertyAssignmentsInDestructuring.errors.txt @@ -1,13 +1,15 @@ tests/cases/compiler/shorthandPropertyAssignmentsInDestructuring.ts(16,9): error TS2459: Type '{}' has no property 's1' and no string index signature. tests/cases/compiler/shorthandPropertyAssignmentsInDestructuring.ts(22,9): error TS2459: Type '{}' has no property 's1' and no string index signature. -tests/cases/compiler/shorthandPropertyAssignmentsInDestructuring.ts(40,9): error TS2322: Type 'number' is not assignable to type 'string'. -tests/cases/compiler/shorthandPropertyAssignmentsInDestructuring.ts(46,12): error TS2322: Type 'number' is not assignable to type 'string'. -tests/cases/compiler/shorthandPropertyAssignmentsInDestructuring.ts(72,5): error TS2322: Type 'number' is not assignable to type 'string'. +tests/cases/compiler/shorthandPropertyAssignmentsInDestructuring.ts(40,9): error TS2322: Type '5' is not assignable to type 'string'. +tests/cases/compiler/shorthandPropertyAssignmentsInDestructuring.ts(46,12): error TS2322: Type '5' is not assignable to type 'string'. +tests/cases/compiler/shorthandPropertyAssignmentsInDestructuring.ts(72,5): error TS2322: Type '5' is not assignable to type 'string'. +tests/cases/compiler/shorthandPropertyAssignmentsInDestructuring.ts(77,8): error TS2322: Type '5' is not assignable to type 'string'. tests/cases/compiler/shorthandPropertyAssignmentsInDestructuring.ts(77,8): error TS2322: Type 'number' is not assignable to type 'string'. -tests/cases/compiler/shorthandPropertyAssignmentsInDestructuring.ts(82,5): error TS2322: Type 'number' is not assignable to type 'string'. +tests/cases/compiler/shorthandPropertyAssignmentsInDestructuring.ts(82,5): error TS2322: Type '5' is not assignable to type 'string'. tests/cases/compiler/shorthandPropertyAssignmentsInDestructuring.ts(82,13): error TS2322: Type '{ x: number; }' is not assignable to type '{ x: string; }'. Types of property 'x' are incompatible. Type 'number' is not assignable to type 'string'. +tests/cases/compiler/shorthandPropertyAssignmentsInDestructuring.ts(87,8): error TS2322: Type '5' is not assignable to type 'string'. tests/cases/compiler/shorthandPropertyAssignmentsInDestructuring.ts(87,8): error TS2322: Type 'number' is not assignable to type 'string'. tests/cases/compiler/shorthandPropertyAssignmentsInDestructuring.ts(87,19): error TS2322: Type '{ x: number; }' is not assignable to type '{ x: string; }'. Types of property 'x' are incompatible. @@ -16,7 +18,7 @@ tests/cases/compiler/shorthandPropertyAssignmentsInDestructuring.ts(113,12): err tests/cases/compiler/shorthandPropertyAssignmentsInDestructuring.ts(113,14): error TS1312: '=' can only be used in an object literal property inside a destructuring assignment. -==== tests/cases/compiler/shorthandPropertyAssignmentsInDestructuring.ts (12 errors) ==== +==== tests/cases/compiler/shorthandPropertyAssignmentsInDestructuring.ts (14 errors) ==== (function() { @@ -62,7 +64,7 @@ tests/cases/compiler/shorthandPropertyAssignmentsInDestructuring.ts(113,14): err var s3: string; for ({ s3 = 5 } of [{ s3: "" }]) { ~~ -!!! error TS2322: Type 'number' is not assignable to type 'string'. +!!! error TS2322: Type '5' is not assignable to type 'string'. } }); @@ -70,7 +72,7 @@ tests/cases/compiler/shorthandPropertyAssignmentsInDestructuring.ts(113,14): err var s3: string; for ({ s3:s3 = 5 } of [{ s3: "" }]) { ~~ -!!! error TS2322: Type 'number' is not assignable to type 'string'. +!!! error TS2322: Type '5' is not assignable to type 'string'. } }); @@ -98,13 +100,15 @@ tests/cases/compiler/shorthandPropertyAssignmentsInDestructuring.ts(113,14): err let y1: string; ({ y1 = 5 } = {}) ~~ -!!! error TS2322: Type 'number' is not assignable to type 'string'. +!!! error TS2322: Type '5' is not assignable to type 'string'. }); (function() { let y1: string; ({ y1:y1 = 5 } = {}) ~~ +!!! error TS2322: Type '5' is not assignable to type 'string'. + ~~ !!! error TS2322: Type 'number' is not assignable to type 'string'. }); @@ -112,7 +116,7 @@ tests/cases/compiler/shorthandPropertyAssignmentsInDestructuring.ts(113,14): err let y2: string, y3: { x: string }; ({ y2 = 5, y3 = { x: 1 } } = {}) ~~ -!!! error TS2322: Type 'number' is not assignable to type 'string'. +!!! error TS2322: Type '5' is not assignable to type 'string'. ~~ !!! error TS2322: Type '{ x: number; }' is not assignable to type '{ x: string; }'. !!! error TS2322: Types of property 'x' are incompatible. @@ -123,6 +127,8 @@ tests/cases/compiler/shorthandPropertyAssignmentsInDestructuring.ts(113,14): err let y2: string, y3: { x: string }; ({ y2:y2 = 5, y3:y3 = { x: 1 } } = {}) ~~ +!!! error TS2322: Type '5' is not assignable to type 'string'. + ~~ !!! error TS2322: Type 'number' is not assignable to type 'string'. ~~ !!! error TS2322: Type '{ x: number; }' is not assignable to type '{ x: string; }'. diff --git a/tests/baselines/reference/shorthandPropertyAssignmentsInDestructuring_ES6.errors.txt b/tests/baselines/reference/shorthandPropertyAssignmentsInDestructuring_ES6.errors.txt index 7e6b6b35d7f..0a61eed7326 100644 --- a/tests/baselines/reference/shorthandPropertyAssignmentsInDestructuring_ES6.errors.txt +++ b/tests/baselines/reference/shorthandPropertyAssignmentsInDestructuring_ES6.errors.txt @@ -1,13 +1,15 @@ tests/cases/compiler/shorthandPropertyAssignmentsInDestructuring_ES6.ts(16,9): error TS2459: Type '{}' has no property 's1' and no string index signature. tests/cases/compiler/shorthandPropertyAssignmentsInDestructuring_ES6.ts(22,9): error TS2459: Type '{}' has no property 's1' and no string index signature. -tests/cases/compiler/shorthandPropertyAssignmentsInDestructuring_ES6.ts(40,9): error TS2322: Type 'number' is not assignable to type 'string'. -tests/cases/compiler/shorthandPropertyAssignmentsInDestructuring_ES6.ts(46,12): error TS2322: Type 'number' is not assignable to type 'string'. -tests/cases/compiler/shorthandPropertyAssignmentsInDestructuring_ES6.ts(72,5): error TS2322: Type 'number' is not assignable to type 'string'. +tests/cases/compiler/shorthandPropertyAssignmentsInDestructuring_ES6.ts(40,9): error TS2322: Type '5' is not assignable to type 'string'. +tests/cases/compiler/shorthandPropertyAssignmentsInDestructuring_ES6.ts(46,12): error TS2322: Type '5' is not assignable to type 'string'. +tests/cases/compiler/shorthandPropertyAssignmentsInDestructuring_ES6.ts(72,5): error TS2322: Type '5' is not assignable to type 'string'. +tests/cases/compiler/shorthandPropertyAssignmentsInDestructuring_ES6.ts(77,8): error TS2322: Type '5' is not assignable to type 'string'. tests/cases/compiler/shorthandPropertyAssignmentsInDestructuring_ES6.ts(77,8): error TS2322: Type 'number' is not assignable to type 'string'. -tests/cases/compiler/shorthandPropertyAssignmentsInDestructuring_ES6.ts(82,5): error TS2322: Type 'number' is not assignable to type 'string'. +tests/cases/compiler/shorthandPropertyAssignmentsInDestructuring_ES6.ts(82,5): error TS2322: Type '5' is not assignable to type 'string'. tests/cases/compiler/shorthandPropertyAssignmentsInDestructuring_ES6.ts(82,13): error TS2322: Type '{ x: number; }' is not assignable to type '{ x: string; }'. Types of property 'x' are incompatible. Type 'number' is not assignable to type 'string'. +tests/cases/compiler/shorthandPropertyAssignmentsInDestructuring_ES6.ts(87,8): error TS2322: Type '5' is not assignable to type 'string'. tests/cases/compiler/shorthandPropertyAssignmentsInDestructuring_ES6.ts(87,8): error TS2322: Type 'number' is not assignable to type 'string'. tests/cases/compiler/shorthandPropertyAssignmentsInDestructuring_ES6.ts(87,19): error TS2322: Type '{ x: number; }' is not assignable to type '{ x: string; }'. Types of property 'x' are incompatible. @@ -16,7 +18,7 @@ tests/cases/compiler/shorthandPropertyAssignmentsInDestructuring_ES6.ts(113,12): tests/cases/compiler/shorthandPropertyAssignmentsInDestructuring_ES6.ts(113,14): error TS1312: '=' can only be used in an object literal property inside a destructuring assignment. -==== tests/cases/compiler/shorthandPropertyAssignmentsInDestructuring_ES6.ts (12 errors) ==== +==== tests/cases/compiler/shorthandPropertyAssignmentsInDestructuring_ES6.ts (14 errors) ==== (function() { @@ -62,7 +64,7 @@ tests/cases/compiler/shorthandPropertyAssignmentsInDestructuring_ES6.ts(113,14): var s3: string; for ({ s3 = 5 } of [{ s3: "" }]) { ~~ -!!! error TS2322: Type 'number' is not assignable to type 'string'. +!!! error TS2322: Type '5' is not assignable to type 'string'. } }); @@ -70,7 +72,7 @@ tests/cases/compiler/shorthandPropertyAssignmentsInDestructuring_ES6.ts(113,14): var s3: string; for ({ s3:s3 = 5 } of [{ s3: "" }]) { ~~ -!!! error TS2322: Type 'number' is not assignable to type 'string'. +!!! error TS2322: Type '5' is not assignable to type 'string'. } }); @@ -98,13 +100,15 @@ tests/cases/compiler/shorthandPropertyAssignmentsInDestructuring_ES6.ts(113,14): let y1: string; ({ y1 = 5 } = {}) ~~ -!!! error TS2322: Type 'number' is not assignable to type 'string'. +!!! error TS2322: Type '5' is not assignable to type 'string'. }); (function() { let y1: string; ({ y1:y1 = 5 } = {}) ~~ +!!! error TS2322: Type '5' is not assignable to type 'string'. + ~~ !!! error TS2322: Type 'number' is not assignable to type 'string'. }); @@ -112,7 +116,7 @@ tests/cases/compiler/shorthandPropertyAssignmentsInDestructuring_ES6.ts(113,14): let y2: string, y3: { x: string }; ({ y2 = 5, y3 = { x: 1 } } = {}) ~~ -!!! error TS2322: Type 'number' is not assignable to type 'string'. +!!! error TS2322: Type '5' is not assignable to type 'string'. ~~ !!! error TS2322: Type '{ x: number; }' is not assignable to type '{ x: string; }'. !!! error TS2322: Types of property 'x' are incompatible. @@ -123,6 +127,8 @@ tests/cases/compiler/shorthandPropertyAssignmentsInDestructuring_ES6.ts(113,14): let y2: string, y3: { x: string }; ({ y2:y2 = 5, y3:y3 = { x: 1 } } = {}) ~~ +!!! error TS2322: Type '5' is not assignable to type 'string'. + ~~ !!! error TS2322: Type 'number' is not assignable to type 'string'. ~~ !!! error TS2322: Type '{ x: number; }' is not assignable to type '{ x: string; }'. diff --git a/tests/baselines/reference/signaturesUseJSDocForOptionalParameters.types b/tests/baselines/reference/signaturesUseJSDocForOptionalParameters.types index 48d44bb5406..f8822397306 100644 --- a/tests/baselines/reference/signaturesUseJSDocForOptionalParameters.types +++ b/tests/baselines/reference/signaturesUseJSDocForOptionalParameters.types @@ -40,7 +40,7 @@ let c1 = pInst.optionalParam('hello') >pInst.optionalParam : (required: string, notRequired?: string) => { prop: null; optionalParam: any; } >pInst : { prop: null; optionalParam: (required: string, notRequired?: string) => typeof MyClass; } >optionalParam : (required: string, notRequired?: string) => { prop: null; optionalParam: any; } ->'hello' : string +>'hello' : "hello" let c2 = pInst.optionalParam('hello', null) >c2 : { prop: null; optionalParam: (required: string, notRequired?: string) => typeof MyClass; } @@ -48,6 +48,6 @@ let c2 = pInst.optionalParam('hello', null) >pInst.optionalParam : (required: string, notRequired?: string) => { prop: null; optionalParam: any; } >pInst : { prop: null; optionalParam: (required: string, notRequired?: string) => typeof MyClass; } >optionalParam : (required: string, notRequired?: string) => { prop: null; optionalParam: any; } ->'hello' : string +>'hello' : "hello" >null : null diff --git a/tests/baselines/reference/singleLineCommentInConciseArrowFunctionES3.types b/tests/baselines/reference/singleLineCommentInConciseArrowFunctionES3.types index e8c449e7bb8..09efdfa2fec 100644 --- a/tests/baselines/reference/singleLineCommentInConciseArrowFunctionES3.types +++ b/tests/baselines/reference/singleLineCommentInConciseArrowFunctionES3.types @@ -7,5 +7,5 @@ function test() { // some comments here; 123; ->123 : number +>123 : 123 } diff --git a/tests/baselines/reference/sourceMap-Comments.types b/tests/baselines/reference/sourceMap-Comments.types index b1681c05aad..088be00e43d 100644 --- a/tests/baselines/reference/sourceMap-Comments.types +++ b/tests/baselines/reference/sourceMap-Comments.types @@ -11,7 +11,7 @@ module sas.tools { let f: number = 2; >f : number ->2 : number +>2 : 2 switch (f) { >f : number diff --git a/tests/baselines/reference/sourceMap-FileWithComments.types b/tests/baselines/reference/sourceMap-FileWithComments.types index 6f9ca201085..2198fa9a590 100644 --- a/tests/baselines/reference/sourceMap-FileWithComments.types +++ b/tests/baselines/reference/sourceMap-FileWithComments.types @@ -50,14 +50,14 @@ module Shapes { >origin : Point >new Point(0, 0) : Point >Point : typeof Point ->0 : number ->0 : number +>0 : 0 +>0 : 0 } // Variable comment after class var a = 10; >a : number ->10 : number +>10 : 10 export function foo() { >foo : () => void @@ -68,7 +68,7 @@ module Shapes { */ var b = 10; >b : number ->10 : number +>10 : 10 } /** Local Variable */ @@ -79,8 +79,8 @@ var p: IPoint = new Shapes.Point(3, 4); >Shapes.Point : typeof Shapes.Point >Shapes : typeof Shapes >Point : typeof Shapes.Point ->3 : number ->4 : number +>3 : 3 +>4 : 4 var dist = p.getDist(); >dist : number diff --git a/tests/baselines/reference/sourceMap-InterfacePrecedingVariableDeclaration1.types b/tests/baselines/reference/sourceMap-InterfacePrecedingVariableDeclaration1.types index fb361a53bd5..5faca1a4ddb 100644 --- a/tests/baselines/reference/sourceMap-InterfacePrecedingVariableDeclaration1.types +++ b/tests/baselines/reference/sourceMap-InterfacePrecedingVariableDeclaration1.types @@ -5,5 +5,5 @@ interface I {} var x = 0; >x : number ->0 : number +>0 : 0 diff --git a/tests/baselines/reference/sourceMap-LineBreaks.types b/tests/baselines/reference/sourceMap-LineBreaks.types index 1e0220906da..41dc77a36bf 100644 --- a/tests/baselines/reference/sourceMap-LineBreaks.types +++ b/tests/baselines/reference/sourceMap-LineBreaks.types @@ -1,40 +1,40 @@ === tests/cases/compiler/sourceMap-LineBreaks.ts === var endsWithlineSeparator = 10; 
var endsWithParagraphSeparator = 10; 
var endsWithNextLine = 1;…var endsWithLineFeed = 1; >endsWithlineSeparator : number ->10 : number +>10 : 10 var endsWithCarriageReturnLineFeed = 1; >endsWithParagraphSeparator : number ->10 : number +>10 : 10 var endsWithCarriageReturn = 1; var endsWithLineFeedCarriageReturn = 1; >endsWithNextLine : number ->1 : number +>1 : 1 >endsWithLineFeed : number ->1 : number +>1 : 1 var endsWithLineFeedCarriageReturnLineFeed = 1; >endsWithCarriageReturnLineFeed : number ->1 : number +>1 : 1 >endsWithCarriageReturn : number ->1 : number +>1 : 1 var stringLiteralWithLineFeed = "line 1\ >endsWithLineFeedCarriageReturn : number ->1 : number +>1 : 1 line 2"; var stringLiteralWithCarriageReturnLineFeed = "line 1\ >endsWithLineFeedCarriageReturnLineFeed : number ->1 : number +>1 : 1 line 2"; var stringLiteralWithCarriageReturn = "line 1\ line 2"; >stringLiteralWithLineFeed : string ->"line 1\line 2" : string +>"line 1\line 2" : "line 1line 2" var stringLiteralWithLineSeparator = "line 1\
line 2";
var stringLiteralWithParagraphSeparator = "line 1\
line 2";
var stringLiteralWithNextLine = "line 1\…line 2"; >stringLiteralWithCarriageReturnLineFeed : string ->"line 1\line 2" : string +>"line 1\line 2" : "line 1line 2" diff --git a/tests/baselines/reference/sourceMap-StringLiteralWithNewLine.types b/tests/baselines/reference/sourceMap-StringLiteralWithNewLine.types index 827f523e277..26bfd605b95 100644 --- a/tests/baselines/reference/sourceMap-StringLiteralWithNewLine.types +++ b/tests/baselines/reference/sourceMap-StringLiteralWithNewLine.types @@ -19,11 +19,11 @@ module Foo { var x = "test1"; >x : string ->"test1" : string +>"test1" : "test1" var y = "test 2\ >y : string ->"test 2\isn't this a lot of fun" : string +>"test 2\isn't this a lot of fun" : "test 2isn't this a lot of fun" isn't this a lot of fun"; var z = window.document; diff --git a/tests/baselines/reference/sourceMapForFunctionInInternalModuleWithCommentPrecedingStatement01.types b/tests/baselines/reference/sourceMapForFunctionInInternalModuleWithCommentPrecedingStatement01.types index db4f2c320b4..1c28536dafc 100644 --- a/tests/baselines/reference/sourceMapForFunctionInInternalModuleWithCommentPrecedingStatement01.types +++ b/tests/baselines/reference/sourceMapForFunctionInInternalModuleWithCommentPrecedingStatement01.types @@ -8,6 +8,6 @@ module Q { // Test this var a = 1; >a : number ->1 : number +>1 : 1 } } diff --git a/tests/baselines/reference/sourceMapForFunctionWithCommentPrecedingStatement01.types b/tests/baselines/reference/sourceMapForFunctionWithCommentPrecedingStatement01.types index 5e3d01a6b5b..c4625f115dd 100644 --- a/tests/baselines/reference/sourceMapForFunctionWithCommentPrecedingStatement01.types +++ b/tests/baselines/reference/sourceMapForFunctionWithCommentPrecedingStatement01.types @@ -5,5 +5,5 @@ function P() { // Test this var a = 1; >a : number ->1 : number +>1 : 1 } diff --git a/tests/baselines/reference/sourceMapSample.errors.txt b/tests/baselines/reference/sourceMapSample.errors.txt index 25072de7c0e..1b8feba3156 100644 --- a/tests/baselines/reference/sourceMapSample.errors.txt +++ b/tests/baselines/reference/sourceMapSample.errors.txt @@ -1,4 +1,4 @@ -tests/cases/compiler/sourceMapSample.ts(14,45): error TS2305: Module 'Foo.Bar' has no exported member 'Greeter'. +tests/cases/compiler/sourceMapSample.ts(14,45): error TS2694: Namespace 'Foo.Bar' has no exported member 'Greeter'. ==== tests/cases/compiler/sourceMapSample.ts (1 errors) ==== @@ -17,7 +17,7 @@ tests/cases/compiler/sourceMapSample.ts(14,45): error TS2305: Module 'Foo.Bar' h function foo(greeting: string): Foo.Bar.Greeter { ~~~~~~~ -!!! error TS2305: Module 'Foo.Bar' has no exported member 'Greeter'. +!!! error TS2694: Namespace 'Foo.Bar' has no exported member 'Greeter'. return new Greeter(greeting); } diff --git a/tests/baselines/reference/sourceMapValidationClass.types b/tests/baselines/reference/sourceMapValidationClass.types index 3e5234b0d6e..f6d80f39416 100644 --- a/tests/baselines/reference/sourceMapValidationClass.types +++ b/tests/baselines/reference/sourceMapValidationClass.types @@ -12,18 +12,18 @@ class Greeter { return "

" + this.greeting + "

"; >"

" + this.greeting + "

" : string >"

" + this.greeting : string ->"

" : string +>"

" : "

" >this.greeting : string >this : this >greeting : string ->"

" : string +>"" : "" } private x: string; >x : string private x1: number = 10; >x1 : number ->10 : number +>10 : 10 private fn() { >fn : () => string diff --git a/tests/baselines/reference/sourceMapValidationClassWithDefaultConstructor.types b/tests/baselines/reference/sourceMapValidationClassWithDefaultConstructor.types index 5cca47a0a41..a50677684dc 100644 --- a/tests/baselines/reference/sourceMapValidationClassWithDefaultConstructor.types +++ b/tests/baselines/reference/sourceMapValidationClassWithDefaultConstructor.types @@ -4,9 +4,9 @@ class Greeter { public a = 10; >a : number ->10 : number +>10 : 10 public nameA = "Ten"; >nameA : string ->"Ten" : string +>"Ten" : "Ten" } diff --git a/tests/baselines/reference/sourceMapValidationClassWithDefaultConstructorAndCapturedThisStatement.types b/tests/baselines/reference/sourceMapValidationClassWithDefaultConstructorAndCapturedThisStatement.types index a20410aa842..7c686c48059 100644 --- a/tests/baselines/reference/sourceMapValidationClassWithDefaultConstructorAndCapturedThisStatement.types +++ b/tests/baselines/reference/sourceMapValidationClassWithDefaultConstructorAndCapturedThisStatement.types @@ -4,7 +4,7 @@ class Greeter { public a = 10; >a : number ->10 : number +>10 : 10 public returnA = () => this.a; >returnA : () => number diff --git a/tests/baselines/reference/sourceMapValidationClassWithDefaultConstructorAndExtendsClause.types b/tests/baselines/reference/sourceMapValidationClassWithDefaultConstructorAndExtendsClause.types index 12d8d56cf6e..2ff310b28f6 100644 --- a/tests/baselines/reference/sourceMapValidationClassWithDefaultConstructorAndExtendsClause.types +++ b/tests/baselines/reference/sourceMapValidationClassWithDefaultConstructorAndExtendsClause.types @@ -9,9 +9,9 @@ class Greeter extends AbstractGreeter { public a = 10; >a : number ->10 : number +>10 : 10 public nameA = "Ten"; >nameA : string ->"Ten" : string +>"Ten" : "Ten" } diff --git a/tests/baselines/reference/sourceMapValidationClasses.types b/tests/baselines/reference/sourceMapValidationClasses.types index 5b3512c06c1..590f6d07c16 100644 --- a/tests/baselines/reference/sourceMapValidationClasses.types +++ b/tests/baselines/reference/sourceMapValidationClasses.types @@ -4,7 +4,7 @@ module Foo.Bar { >Bar : typeof Bar "use strict"; ->"use strict" : string +>"use strict" : "use strict" class Greeter { >Greeter : Greeter @@ -19,11 +19,11 @@ module Foo.Bar { return "

" + this.greeting + "

"; >"

" + this.greeting + "

" : string >"

" + this.greeting : string ->"

" : string +>"

" : "

" >this.greeting : string >this : this >greeting : string ->"

" : string +>"" : "" } } @@ -43,7 +43,7 @@ module Foo.Bar { >greeter : Greeter >new Greeter("Hello, world!") : Greeter >Greeter : typeof Greeter ->"Hello, world!" : string +>"Hello, world!" : "Hello, world!" var str = greeter.greet(); >str : string @@ -66,14 +66,14 @@ module Foo.Bar { >greeters[0] = new Greeter(greeting) : Greeter >greeters[0] : Greeter >greeters : Greeter[] ->0 : number +>0 : 0 >new Greeter(greeting) : Greeter >Greeter : typeof Greeter >greeting : string for (var i = 0; i < restGreetings.length; i++) { >i : number ->0 : number +>0 : 0 >i < restGreetings.length : boolean >i : number >restGreetings.length : number @@ -102,14 +102,14 @@ module Foo.Bar { >b : Greeter[] >foo2("Hello", "World", "!") : Greeter[] >foo2 : (greeting: string, ...restGreetings: string[]) => Greeter[] ->"Hello" : string ->"World" : string ->"!" : string +>"Hello" : "Hello" +>"World" : "World" +>"!" : "!" // This is simple signle line comment for (var j = 0; j < b.length; j++) { >j : number ->0 : number +>0 : 0 >j < b.length : boolean >j : number >b.length : number diff --git a/tests/baselines/reference/sourceMapValidationDecorators.types b/tests/baselines/reference/sourceMapValidationDecorators.types index 2fc05972307..8e807786e78 100644 --- a/tests/baselines/reference/sourceMapValidationDecorators.types +++ b/tests/baselines/reference/sourceMapValidationDecorators.types @@ -48,7 +48,7 @@ declare function ParameterDecorator2(x: number): (target: Object, key: string | @ClassDecorator2(10) >ClassDecorator2(10) : (target: Function) => void >ClassDecorator2 : (x: number) => (target: Function) => void ->10 : number +>10 : 10 class Greeter { >Greeter : Greeter @@ -60,7 +60,7 @@ class Greeter { @ParameterDecorator2(20) >ParameterDecorator2(20) : (target: Object, key: string | symbol, paramIndex: number) => void >ParameterDecorator2 : (x: number) => (target: Object, key: string | symbol, paramIndex: number) => void ->20 : number +>20 : 20 public greeting: string, >greeting : string @@ -71,7 +71,7 @@ class Greeter { @ParameterDecorator2(30) >ParameterDecorator2(30) : (target: Object, key: string | symbol, paramIndex: number) => void >ParameterDecorator2 : (x: number) => (target: Object, key: string | symbol, paramIndex: number) => void ->30 : number +>30 : 30 ...b: string[]) { >b : string[] @@ -83,7 +83,7 @@ class Greeter { @PropertyDecorator2(40) >PropertyDecorator2(40) : (target: Object, key: string | symbol, descriptor?: PropertyDescriptor) => void >PropertyDecorator2 : (x: number) => (target: Object, key: string | symbol, descriptor?: PropertyDescriptor) => void ->40 : number +>40 : 40 greet() { >greet : () => string @@ -91,11 +91,11 @@ class Greeter { return "

" + this.greeting + "

"; >"

" + this.greeting + "

" : string >"

" + this.greeting : string ->"

" : string +>"

" : "

" >this.greeting : string >this : this >greeting : string ->"

" : string +>"" : "" } @PropertyDecorator1 @@ -104,7 +104,7 @@ class Greeter { @PropertyDecorator2(50) >PropertyDecorator2(50) : (target: Object, key: string | symbol, descriptor?: PropertyDescriptor) => void >PropertyDecorator2 : (x: number) => (target: Object, key: string | symbol, descriptor?: PropertyDescriptor) => void ->50 : number +>50 : 50 private x: string; >x : string @@ -115,11 +115,11 @@ class Greeter { @PropertyDecorator2(60) >PropertyDecorator2(60) : (target: Object, key: string | symbol, descriptor?: PropertyDescriptor) => void >PropertyDecorator2 : (x: number) => (target: Object, key: string | symbol, descriptor?: PropertyDescriptor) => void ->60 : number +>60 : 60 private static x1: number = 10; >x1 : number ->10 : number +>10 : 10 private fn( >fn : (x: number) => string @@ -130,7 +130,7 @@ class Greeter { @ParameterDecorator2(70) >ParameterDecorator2(70) : (target: Object, key: string | symbol, paramIndex: number) => void >ParameterDecorator2 : (x: number) => (target: Object, key: string | symbol, paramIndex: number) => void ->70 : number +>70 : 70 x: number) { >x : number @@ -147,7 +147,7 @@ class Greeter { @PropertyDecorator2(80) >PropertyDecorator2(80) : (target: Object, key: string | symbol, descriptor?: PropertyDescriptor) => void >PropertyDecorator2 : (x: number) => (target: Object, key: string | symbol, descriptor?: PropertyDescriptor) => void ->80 : number +>80 : 80 get greetings() { >greetings : string @@ -167,7 +167,7 @@ class Greeter { @ParameterDecorator2(90) >ParameterDecorator2(90) : (target: Object, key: string | symbol, paramIndex: number) => void >ParameterDecorator2 : (x: number) => (target: Object, key: string | symbol, paramIndex: number) => void ->90 : number +>90 : 90 greetings: string) { >greetings : string diff --git a/tests/baselines/reference/sourceMapValidationDestructuringForArrayBindingPattern.types b/tests/baselines/reference/sourceMapValidationDestructuringForArrayBindingPattern.types index c2a88a68838..00ecd2659ee 100644 --- a/tests/baselines/reference/sourceMapValidationDestructuringForArrayBindingPattern.types +++ b/tests/baselines/reference/sourceMapValidationDestructuringForArrayBindingPattern.types @@ -16,9 +16,9 @@ let robotA: Robot = [1, "mower", "mowing"]; >robotA : [number, string, string] >Robot : [number, string, string] >[1, "mower", "mowing"] : [number, string, string] ->1 : number ->"mower" : string ->"mowing" : string +>1 : 1 +>"mower" : "mower" +>"mowing" : "mowing" function getRobot() { >getRobot : () => [number, string, string] @@ -31,19 +31,19 @@ let multiRobotA: MultiSkilledRobot = ["mower", ["mowing", ""]]; >multiRobotA : [string, [string, string]] >MultiSkilledRobot : [string, [string, string]] >["mower", ["mowing", ""]] : [string, [string, string]] ->"mower" : string +>"mower" : "mower" >["mowing", ""] : [string, string] ->"mowing" : string ->"" : string +>"mowing" : "mowing" +>"" : "" let multiRobotB: MultiSkilledRobot = ["trimmer", ["trimming", "edging"]]; >multiRobotB : [string, [string, string]] >MultiSkilledRobot : [string, [string, string]] >["trimmer", ["trimming", "edging"]] : [string, [string, string]] ->"trimmer" : string +>"trimmer" : "trimmer" >["trimming", "edging"] : [string, string] ->"trimming" : string ->"edging" : string +>"trimming" : "trimming" +>"edging" : "edging" function getMultiRobot() { >getMultiRobot : () => [string, [string, string]] @@ -57,10 +57,10 @@ for (let [, nameA] = robotA, i = 0; i < 1; i++) { >nameA : string >robotA : [number, string, string] >i : number ->0 : number +>0 : 0 >i < 1 : boolean >i : number ->1 : number +>1 : 1 >i++ : number >i : number @@ -77,10 +77,10 @@ for (let [, nameA] = getRobot(), i = 0; i < 1; i++) { >getRobot() : [number, string, string] >getRobot : () => [number, string, string] >i : number ->0 : number +>0 : 0 >i < 1 : boolean >i : number ->1 : number +>1 : 1 >i++ : number >i : number @@ -95,14 +95,14 @@ for (let [, nameA] = [2, "trimmer", "trimming"], i = 0; i < 1; i++) { > : undefined >nameA : string >[2, "trimmer", "trimming"] : [number, string, string] ->2 : number ->"trimmer" : string ->"trimming" : string +>2 : 2 +>"trimmer" : "trimmer" +>"trimming" : "trimming" >i : number ->0 : number +>0 : 0 >i < 1 : boolean >i : number ->1 : number +>1 : 1 >i++ : number >i : number @@ -119,10 +119,10 @@ for (let [, [primarySkillA, secondarySkillA]] = multiRobotA, i = 0; i < 1; i++) >secondarySkillA : string >multiRobotA : [string, [string, string]] >i : number ->0 : number +>0 : 0 >i < 1 : boolean >i : number ->1 : number +>1 : 1 >i++ : number >i : number @@ -140,10 +140,10 @@ for (let [, [primarySkillA, secondarySkillA]] = getMultiRobot(), i = 0; i < 1; i >getMultiRobot() : [string, [string, string]] >getMultiRobot : () => [string, [string, string]] >i : number ->0 : number +>0 : 0 >i < 1 : boolean >i : number ->1 : number +>1 : 1 >i++ : number >i : number @@ -159,15 +159,15 @@ for (let [, [primarySkillA, secondarySkillA]] = ["trimmer", ["trimming", "edging >primarySkillA : string >secondarySkillA : string >["trimmer", ["trimming", "edging"]] : [string, [string, string]] ->"trimmer" : string +>"trimmer" : "trimmer" >["trimming", "edging"] : [string, string] ->"trimming" : string ->"edging" : string +>"trimming" : "trimming" +>"edging" : "edging" >i : number ->0 : number +>0 : 0 >i < 1 : boolean >i : number ->1 : number +>1 : 1 >i++ : number >i : number @@ -183,10 +183,10 @@ for (let [numberB] = robotA, i = 0; i < 1; i++) { >numberB : number >robotA : [number, string, string] >i : number ->0 : number +>0 : 0 >i < 1 : boolean >i : number ->1 : number +>1 : 1 >i++ : number >i : number @@ -202,10 +202,10 @@ for (let [numberB] = getRobot(), i = 0; i < 1; i++) { >getRobot() : [number, string, string] >getRobot : () => [number, string, string] >i : number ->0 : number +>0 : 0 >i < 1 : boolean >i : number ->1 : number +>1 : 1 >i++ : number >i : number @@ -219,14 +219,14 @@ for (let [numberB] = getRobot(), i = 0; i < 1; i++) { for (let [numberB] = [2, "trimmer", "trimming"], i = 0; i < 1; i++) { >numberB : number >[2, "trimmer", "trimming"] : [number, string, string] ->2 : number ->"trimmer" : string ->"trimming" : string +>2 : 2 +>"trimmer" : "trimmer" +>"trimming" : "trimming" >i : number ->0 : number +>0 : 0 >i < 1 : boolean >i : number ->1 : number +>1 : 1 >i++ : number >i : number @@ -241,10 +241,10 @@ for (let [nameB] = multiRobotA, i = 0; i < 1; i++) { >nameB : string >multiRobotA : [string, [string, string]] >i : number ->0 : number +>0 : 0 >i < 1 : boolean >i : number ->1 : number +>1 : 1 >i++ : number >i : number @@ -260,10 +260,10 @@ for (let [nameB] = getMultiRobot(), i = 0; i < 1; i++) { >getMultiRobot() : [string, [string, string]] >getMultiRobot : () => [string, [string, string]] >i : number ->0 : number +>0 : 0 >i < 1 : boolean >i : number ->1 : number +>1 : 1 >i++ : number >i : number @@ -277,15 +277,15 @@ for (let [nameB] = getMultiRobot(), i = 0; i < 1; i++) { for (let [nameB] = ["trimmer", ["trimming", "edging"]], i = 0; i < 1; i++) { >nameB : string >["trimmer", ["trimming", "edging"]] : [string, string[]] ->"trimmer" : string +>"trimmer" : "trimmer" >["trimming", "edging"] : string[] ->"trimming" : string ->"edging" : string +>"trimming" : "trimming" +>"edging" : "edging" >i : number ->0 : number +>0 : 0 >i < 1 : boolean >i : number ->1 : number +>1 : 1 >i++ : number >i : number @@ -303,10 +303,10 @@ for (let [numberA2, nameA2, skillA2] = robotA, i = 0; i < 1; i++) { >skillA2 : string >robotA : [number, string, string] >i : number ->0 : number +>0 : 0 >i < 1 : boolean >i : number ->1 : number +>1 : 1 >i++ : number >i : number @@ -324,10 +324,10 @@ for (let [numberA2, nameA2, skillA2] = getRobot(), i = 0; i < 1; i++) { >getRobot() : [number, string, string] >getRobot : () => [number, string, string] >i : number ->0 : number +>0 : 0 >i < 1 : boolean >i : number ->1 : number +>1 : 1 >i++ : number >i : number @@ -343,14 +343,14 @@ for (let [numberA2, nameA2, skillA2] = [2, "trimmer", "trimming"], i = 0; i < 1; >nameA2 : string >skillA2 : string >[2, "trimmer", "trimming"] : [number, string, string] ->2 : number ->"trimmer" : string ->"trimming" : string +>2 : 2 +>"trimmer" : "trimmer" +>"trimming" : "trimming" >i : number ->0 : number +>0 : 0 >i < 1 : boolean >i : number ->1 : number +>1 : 1 >i++ : number >i : number @@ -367,10 +367,10 @@ for (let [nameMA, [primarySkillA, secondarySkillA]] = multiRobotA, i = 0; i < 1; >secondarySkillA : string >multiRobotA : [string, [string, string]] >i : number ->0 : number +>0 : 0 >i < 1 : boolean >i : number ->1 : number +>1 : 1 >i++ : number >i : number @@ -388,10 +388,10 @@ for (let [nameMA, [primarySkillA, secondarySkillA]] = getMultiRobot(), i = 0; i >getMultiRobot() : [string, [string, string]] >getMultiRobot : () => [string, [string, string]] >i : number ->0 : number +>0 : 0 >i < 1 : boolean >i : number ->1 : number +>1 : 1 >i++ : number >i : number @@ -407,15 +407,15 @@ for (let [nameMA, [primarySkillA, secondarySkillA]] = ["trimmer", ["trimming", " >primarySkillA : string >secondarySkillA : string >["trimmer", ["trimming", "edging"]] : [string, [string, string]] ->"trimmer" : string +>"trimmer" : "trimmer" >["trimming", "edging"] : [string, string] ->"trimming" : string ->"edging" : string +>"trimming" : "trimming" +>"edging" : "edging" >i : number ->0 : number +>0 : 0 >i < 1 : boolean >i : number ->1 : number +>1 : 1 >i++ : number >i : number @@ -432,10 +432,10 @@ for (let [numberA3, ...robotAInfo] = robotA, i = 0; i < 1; i++) { >robotAInfo : (string | number)[] >robotA : [number, string, string] >i : number ->0 : number +>0 : 0 >i < 1 : boolean >i : number ->1 : number +>1 : 1 >i++ : number >i : number @@ -452,10 +452,10 @@ for (let [numberA3, ...robotAInfo] = getRobot(), i = 0; i < 1; i++) { >getRobot() : [number, string, string] >getRobot : () => [number, string, string] >i : number ->0 : number +>0 : 0 >i < 1 : boolean >i : number ->1 : number +>1 : 1 >i++ : number >i : number @@ -470,14 +470,14 @@ for (let [numberA3, ...robotAInfo] = [2, "trimmer", "trimming"], i = 0; i < 1; i >numberA3 : string | number >robotAInfo : (string | number)[] >[2, "trimmer", "trimming"] : (string | number)[] ->2 : number ->"trimmer" : string ->"trimming" : string +>2 : 2 +>"trimmer" : "trimmer" +>"trimming" : "trimming" >i : number ->0 : number +>0 : 0 >i < 1 : boolean >i : number ->1 : number +>1 : 1 >i++ : number >i : number @@ -492,10 +492,10 @@ for (let [...multiRobotAInfo] = multiRobotA, i = 0; i < 1; i++) { >multiRobotAInfo : (string | [string, string])[] >multiRobotA : [string, [string, string]] >i : number ->0 : number +>0 : 0 >i < 1 : boolean >i : number ->1 : number +>1 : 1 >i++ : number >i : number @@ -511,10 +511,10 @@ for (let [...multiRobotAInfo] = getMultiRobot(), i = 0; i < 1; i++) { >getMultiRobot() : [string, [string, string]] >getMultiRobot : () => [string, [string, string]] >i : number ->0 : number +>0 : 0 >i < 1 : boolean >i : number ->1 : number +>1 : 1 >i++ : number >i : number @@ -528,15 +528,15 @@ for (let [...multiRobotAInfo] = getMultiRobot(), i = 0; i < 1; i++) { for (let [...multiRobotAInfo] = ["trimmer", ["trimming", "edging"]], i = 0; i < 1; i++) { >multiRobotAInfo : (string | string[])[] >["trimmer", ["trimming", "edging"]] : (string | string[])[] ->"trimmer" : string +>"trimmer" : "trimmer" >["trimming", "edging"] : string[] ->"trimming" : string ->"edging" : string +>"trimming" : "trimming" +>"edging" : "edging" >i : number ->0 : number +>0 : 0 >i < 1 : boolean >i : number ->1 : number +>1 : 1 >i++ : number >i : number diff --git a/tests/baselines/reference/sourceMapValidationDestructuringForArrayBindingPattern2.types b/tests/baselines/reference/sourceMapValidationDestructuringForArrayBindingPattern2.types index e9f7a0a7406..f317fa2a83c 100644 --- a/tests/baselines/reference/sourceMapValidationDestructuringForArrayBindingPattern2.types +++ b/tests/baselines/reference/sourceMapValidationDestructuringForArrayBindingPattern2.types @@ -16,9 +16,9 @@ let robotA: Robot = [1, "mower", "mowing"]; >robotA : [number, string, string] >Robot : [number, string, string] >[1, "mower", "mowing"] : [number, string, string] ->1 : number ->"mower" : string ->"mowing" : string +>1 : 1 +>"mower" : "mower" +>"mowing" : "mowing" function getRobot() { >getRobot : () => [number, string, string] @@ -31,19 +31,19 @@ let multiRobotA: MultiSkilledRobot = ["mower", ["mowing", ""]]; >multiRobotA : [string, [string, string]] >MultiSkilledRobot : [string, [string, string]] >["mower", ["mowing", ""]] : [string, [string, string]] ->"mower" : string +>"mower" : "mower" >["mowing", ""] : [string, string] ->"mowing" : string ->"" : string +>"mowing" : "mowing" +>"" : "" let multiRobotB: MultiSkilledRobot = ["trimmer", ["trimming", "edging"]]; >multiRobotB : [string, [string, string]] >MultiSkilledRobot : [string, [string, string]] >["trimmer", ["trimming", "edging"]] : [string, [string, string]] ->"trimmer" : string +>"trimmer" : "trimmer" >["trimming", "edging"] : [string, string] ->"trimming" : string ->"edging" : string +>"trimming" : "trimming" +>"edging" : "edging" function getMultiRobot() { >getMultiRobot : () => [string, [string, string]] @@ -76,18 +76,18 @@ let i: number; >i : number for ([, nameA] = robotA, i = 0; i < 1; i++) { ->[, nameA] = robotA, i = 0 : number +>[, nameA] = robotA, i = 0 : 0 >[, nameA] = robotA : [number, string, string] >[, nameA] : [undefined, string] > : undefined >nameA : string >robotA : [number, string, string] ->i = 0 : number +>i = 0 : 0 >i : number ->0 : number +>0 : 0 >i < 1 : boolean >i : number ->1 : number +>1 : 1 >i++ : number >i : number @@ -99,19 +99,19 @@ for ([, nameA] = robotA, i = 0; i < 1; i++) { >nameA : string } for ([, nameA] = getRobot(), i = 0; i < 1; i++) { ->[, nameA] = getRobot(), i = 0 : number +>[, nameA] = getRobot(), i = 0 : 0 >[, nameA] = getRobot() : [number, string, string] >[, nameA] : [undefined, string] > : undefined >nameA : string >getRobot() : [number, string, string] >getRobot : () => [number, string, string] ->i = 0 : number +>i = 0 : 0 >i : number ->0 : number +>0 : 0 >i < 1 : boolean >i : number ->1 : number +>1 : 1 >i++ : number >i : number @@ -123,21 +123,21 @@ for ([, nameA] = getRobot(), i = 0; i < 1; i++) { >nameA : string } for ([, nameA] = [2, "trimmer", "trimming"], i = 0; i < 1; i++) { ->[, nameA] = [2, "trimmer", "trimming"], i = 0 : number +>[, nameA] = [2, "trimmer", "trimming"], i = 0 : 0 >[, nameA] = [2, "trimmer", "trimming"] : [number, string, string] >[, nameA] : [undefined, string] > : undefined >nameA : string >[2, "trimmer", "trimming"] : [number, string, string] ->2 : number ->"trimmer" : string ->"trimming" : string ->i = 0 : number +>2 : 2 +>"trimmer" : "trimmer" +>"trimming" : "trimming" +>i = 0 : 0 >i : number ->0 : number +>0 : 0 >i < 1 : boolean >i : number ->1 : number +>1 : 1 >i++ : number >i : number @@ -149,7 +149,7 @@ for ([, nameA] = [2, "trimmer", "trimming"], i = 0; i < 1; i++) { >nameA : string } for ([, [primarySkillA, secondarySkillA]] = multiRobotA, i = 0; i < 1; i++) { ->[, [primarySkillA, secondarySkillA]] = multiRobotA, i = 0 : number +>[, [primarySkillA, secondarySkillA]] = multiRobotA, i = 0 : 0 >[, [primarySkillA, secondarySkillA]] = multiRobotA : [string, [string, string]] >[, [primarySkillA, secondarySkillA]] : [undefined, [string, string]] > : undefined @@ -157,12 +157,12 @@ for ([, [primarySkillA, secondarySkillA]] = multiRobotA, i = 0; i < 1; i++) { >primarySkillA : string >secondarySkillA : string >multiRobotA : [string, [string, string]] ->i = 0 : number +>i = 0 : 0 >i : number ->0 : number +>0 : 0 >i < 1 : boolean >i : number ->1 : number +>1 : 1 >i++ : number >i : number @@ -174,7 +174,7 @@ for ([, [primarySkillA, secondarySkillA]] = multiRobotA, i = 0; i < 1; i++) { >primarySkillA : string } for ([, [primarySkillA, secondarySkillA]] = getMultiRobot(), i = 0; i < 1; i++) { ->[, [primarySkillA, secondarySkillA]] = getMultiRobot(), i = 0 : number +>[, [primarySkillA, secondarySkillA]] = getMultiRobot(), i = 0 : 0 >[, [primarySkillA, secondarySkillA]] = getMultiRobot() : [string, [string, string]] >[, [primarySkillA, secondarySkillA]] : [undefined, [string, string]] > : undefined @@ -183,12 +183,12 @@ for ([, [primarySkillA, secondarySkillA]] = getMultiRobot(), i = 0; i < 1; i++) >secondarySkillA : string >getMultiRobot() : [string, [string, string]] >getMultiRobot : () => [string, [string, string]] ->i = 0 : number +>i = 0 : 0 >i : number ->0 : number +>0 : 0 >i < 1 : boolean >i : number ->1 : number +>1 : 1 >i++ : number >i : number @@ -200,7 +200,7 @@ for ([, [primarySkillA, secondarySkillA]] = getMultiRobot(), i = 0; i < 1; i++) >primarySkillA : string } for ([, [primarySkillA, secondarySkillA]] = ["trimmer", ["trimming", "edging"]], i = 0; i < 1; i++) { ->[, [primarySkillA, secondarySkillA]] = ["trimmer", ["trimming", "edging"]], i = 0 : number +>[, [primarySkillA, secondarySkillA]] = ["trimmer", ["trimming", "edging"]], i = 0 : 0 >[, [primarySkillA, secondarySkillA]] = ["trimmer", ["trimming", "edging"]] : [string, [string, string]] >[, [primarySkillA, secondarySkillA]] : [undefined, [string, string]] > : undefined @@ -208,16 +208,16 @@ for ([, [primarySkillA, secondarySkillA]] = ["trimmer", ["trimming", "edging"]], >primarySkillA : string >secondarySkillA : string >["trimmer", ["trimming", "edging"]] : [string, [string, string]] ->"trimmer" : string +>"trimmer" : "trimmer" >["trimming", "edging"] : [string, string] ->"trimming" : string ->"edging" : string ->i = 0 : number +>"trimming" : "trimming" +>"edging" : "edging" +>i = 0 : 0 >i : number ->0 : number +>0 : 0 >i < 1 : boolean >i : number ->1 : number +>1 : 1 >i++ : number >i : number @@ -230,17 +230,17 @@ for ([, [primarySkillA, secondarySkillA]] = ["trimmer", ["trimming", "edging"]], } for ([numberB] = robotA, i = 0; i < 1; i++) { ->[numberB] = robotA, i = 0 : number +>[numberB] = robotA, i = 0 : 0 >[numberB] = robotA : [number, string, string] >[numberB] : [number] >numberB : number >robotA : [number, string, string] ->i = 0 : number +>i = 0 : 0 >i : number ->0 : number +>0 : 0 >i < 1 : boolean >i : number ->1 : number +>1 : 1 >i++ : number >i : number @@ -252,18 +252,18 @@ for ([numberB] = robotA, i = 0; i < 1; i++) { >numberB : number } for ([numberB] = getRobot(), i = 0; i < 1; i++) { ->[numberB] = getRobot(), i = 0 : number +>[numberB] = getRobot(), i = 0 : 0 >[numberB] = getRobot() : [number, string, string] >[numberB] : [number] >numberB : number >getRobot() : [number, string, string] >getRobot : () => [number, string, string] ->i = 0 : number +>i = 0 : 0 >i : number ->0 : number +>0 : 0 >i < 1 : boolean >i : number ->1 : number +>1 : 1 >i++ : number >i : number @@ -275,20 +275,20 @@ for ([numberB] = getRobot(), i = 0; i < 1; i++) { >numberB : number } for ([numberB] = [2, "trimmer", "trimming"], i = 0; i < 1; i++) { ->[numberB] = [2, "trimmer", "trimming"], i = 0 : number +>[numberB] = [2, "trimmer", "trimming"], i = 0 : 0 >[numberB] = [2, "trimmer", "trimming"] : [number, string, string] >[numberB] : [number] >numberB : number >[2, "trimmer", "trimming"] : [number, string, string] ->2 : number ->"trimmer" : string ->"trimming" : string ->i = 0 : number +>2 : 2 +>"trimmer" : "trimmer" +>"trimming" : "trimming" +>i = 0 : 0 >i : number ->0 : number +>0 : 0 >i < 1 : boolean >i : number ->1 : number +>1 : 1 >i++ : number >i : number @@ -300,17 +300,17 @@ for ([numberB] = [2, "trimmer", "trimming"], i = 0; i < 1; i++) { >numberB : number } for ([nameB] = multiRobotA, i = 0; i < 1; i++) { ->[nameB] = multiRobotA, i = 0 : number +>[nameB] = multiRobotA, i = 0 : 0 >[nameB] = multiRobotA : [string, [string, string]] >[nameB] : [string] >nameB : string >multiRobotA : [string, [string, string]] ->i = 0 : number +>i = 0 : 0 >i : number ->0 : number +>0 : 0 >i < 1 : boolean >i : number ->1 : number +>1 : 1 >i++ : number >i : number @@ -322,18 +322,18 @@ for ([nameB] = multiRobotA, i = 0; i < 1; i++) { >nameB : string } for ([nameB] = getMultiRobot(), i = 0; i < 1; i++) { ->[nameB] = getMultiRobot(), i = 0 : number +>[nameB] = getMultiRobot(), i = 0 : 0 >[nameB] = getMultiRobot() : [string, [string, string]] >[nameB] : [string] >nameB : string >getMultiRobot() : [string, [string, string]] >getMultiRobot : () => [string, [string, string]] ->i = 0 : number +>i = 0 : 0 >i : number ->0 : number +>0 : 0 >i < 1 : boolean >i : number ->1 : number +>1 : 1 >i++ : number >i : number @@ -345,21 +345,21 @@ for ([nameB] = getMultiRobot(), i = 0; i < 1; i++) { >nameB : string } for ([nameB] = ["trimmer", ["trimming", "edging"]], i = 0; i < 1; i++) { ->[nameB] = ["trimmer", ["trimming", "edging"]], i = 0 : number +>[nameB] = ["trimmer", ["trimming", "edging"]], i = 0 : 0 >[nameB] = ["trimmer", ["trimming", "edging"]] : [string, string[]] >[nameB] : [string] >nameB : string >["trimmer", ["trimming", "edging"]] : [string, string[]] ->"trimmer" : string +>"trimmer" : "trimmer" >["trimming", "edging"] : string[] ->"trimming" : string ->"edging" : string ->i = 0 : number +>"trimming" : "trimming" +>"edging" : "edging" +>i = 0 : 0 >i : number ->0 : number +>0 : 0 >i < 1 : boolean >i : number ->1 : number +>1 : 1 >i++ : number >i : number @@ -372,19 +372,19 @@ for ([nameB] = ["trimmer", ["trimming", "edging"]], i = 0; i < 1; i++) { } for ([numberA2, nameA2, skillA2] = robotA, i = 0; i < 1; i++) { ->[numberA2, nameA2, skillA2] = robotA, i = 0 : number +>[numberA2, nameA2, skillA2] = robotA, i = 0 : 0 >[numberA2, nameA2, skillA2] = robotA : [number, string, string] >[numberA2, nameA2, skillA2] : [number, string, string] >numberA2 : number >nameA2 : string >skillA2 : string >robotA : [number, string, string] ->i = 0 : number +>i = 0 : 0 >i : number ->0 : number +>0 : 0 >i < 1 : boolean >i : number ->1 : number +>1 : 1 >i++ : number >i : number @@ -396,7 +396,7 @@ for ([numberA2, nameA2, skillA2] = robotA, i = 0; i < 1; i++) { >nameA2 : string } for ([numberA2, nameA2, skillA2] = getRobot(), i = 0; i < 1; i++) { ->[numberA2, nameA2, skillA2] = getRobot(), i = 0 : number +>[numberA2, nameA2, skillA2] = getRobot(), i = 0 : 0 >[numberA2, nameA2, skillA2] = getRobot() : [number, string, string] >[numberA2, nameA2, skillA2] : [number, string, string] >numberA2 : number @@ -404,12 +404,12 @@ for ([numberA2, nameA2, skillA2] = getRobot(), i = 0; i < 1; i++) { >skillA2 : string >getRobot() : [number, string, string] >getRobot : () => [number, string, string] ->i = 0 : number +>i = 0 : 0 >i : number ->0 : number +>0 : 0 >i < 1 : boolean >i : number ->1 : number +>1 : 1 >i++ : number >i : number @@ -421,22 +421,22 @@ for ([numberA2, nameA2, skillA2] = getRobot(), i = 0; i < 1; i++) { >nameA2 : string } for ([numberA2, nameA2, skillA2] = [2, "trimmer", "trimming"], i = 0; i < 1; i++) { ->[numberA2, nameA2, skillA2] = [2, "trimmer", "trimming"], i = 0 : number +>[numberA2, nameA2, skillA2] = [2, "trimmer", "trimming"], i = 0 : 0 >[numberA2, nameA2, skillA2] = [2, "trimmer", "trimming"] : [number, string, string] >[numberA2, nameA2, skillA2] : [number, string, string] >numberA2 : number >nameA2 : string >skillA2 : string >[2, "trimmer", "trimming"] : [number, string, string] ->2 : number ->"trimmer" : string ->"trimming" : string ->i = 0 : number +>2 : 2 +>"trimmer" : "trimmer" +>"trimming" : "trimming" +>i = 0 : 0 >i : number ->0 : number +>0 : 0 >i < 1 : boolean >i : number ->1 : number +>1 : 1 >i++ : number >i : number @@ -448,7 +448,7 @@ for ([numberA2, nameA2, skillA2] = [2, "trimmer", "trimming"], i = 0; i < 1; i++ >nameA2 : string } for ([nameMA, [primarySkillA, secondarySkillA]] = multiRobotA, i = 0; i < 1; i++) { ->[nameMA, [primarySkillA, secondarySkillA]] = multiRobotA, i = 0 : number +>[nameMA, [primarySkillA, secondarySkillA]] = multiRobotA, i = 0 : 0 >[nameMA, [primarySkillA, secondarySkillA]] = multiRobotA : [string, [string, string]] >[nameMA, [primarySkillA, secondarySkillA]] : [string, [string, string]] >nameMA : string @@ -456,12 +456,12 @@ for ([nameMA, [primarySkillA, secondarySkillA]] = multiRobotA, i = 0; i < 1; i++ >primarySkillA : string >secondarySkillA : string >multiRobotA : [string, [string, string]] ->i = 0 : number +>i = 0 : 0 >i : number ->0 : number +>0 : 0 >i < 1 : boolean >i : number ->1 : number +>1 : 1 >i++ : number >i : number @@ -473,7 +473,7 @@ for ([nameMA, [primarySkillA, secondarySkillA]] = multiRobotA, i = 0; i < 1; i++ >nameMA : string } for ([nameMA, [primarySkillA, secondarySkillA]] = getMultiRobot(), i = 0; i < 1; i++) { ->[nameMA, [primarySkillA, secondarySkillA]] = getMultiRobot(), i = 0 : number +>[nameMA, [primarySkillA, secondarySkillA]] = getMultiRobot(), i = 0 : 0 >[nameMA, [primarySkillA, secondarySkillA]] = getMultiRobot() : [string, [string, string]] >[nameMA, [primarySkillA, secondarySkillA]] : [string, [string, string]] >nameMA : string @@ -482,12 +482,12 @@ for ([nameMA, [primarySkillA, secondarySkillA]] = getMultiRobot(), i = 0; i < 1; >secondarySkillA : string >getMultiRobot() : [string, [string, string]] >getMultiRobot : () => [string, [string, string]] ->i = 0 : number +>i = 0 : 0 >i : number ->0 : number +>0 : 0 >i < 1 : boolean >i : number ->1 : number +>1 : 1 >i++ : number >i : number @@ -499,7 +499,7 @@ for ([nameMA, [primarySkillA, secondarySkillA]] = getMultiRobot(), i = 0; i < 1; >nameMA : string } for ([nameMA, [primarySkillA, secondarySkillA]] = ["trimmer", ["trimming", "edging"]], i = 0; i < 1; i++) { ->[nameMA, [primarySkillA, secondarySkillA]] = ["trimmer", ["trimming", "edging"]], i = 0 : number +>[nameMA, [primarySkillA, secondarySkillA]] = ["trimmer", ["trimming", "edging"]], i = 0 : 0 >[nameMA, [primarySkillA, secondarySkillA]] = ["trimmer", ["trimming", "edging"]] : [string, [string, string]] >[nameMA, [primarySkillA, secondarySkillA]] : [string, [string, string]] >nameMA : string @@ -507,16 +507,16 @@ for ([nameMA, [primarySkillA, secondarySkillA]] = ["trimmer", ["trimming", "edgi >primarySkillA : string >secondarySkillA : string >["trimmer", ["trimming", "edging"]] : [string, [string, string]] ->"trimmer" : string +>"trimmer" : "trimmer" >["trimming", "edging"] : [string, string] ->"trimming" : string ->"edging" : string ->i = 0 : number +>"trimming" : "trimming" +>"edging" : "edging" +>i = 0 : 0 >i : number ->0 : number +>0 : 0 >i < 1 : boolean >i : number ->1 : number +>1 : 1 >i++ : number >i : number @@ -529,19 +529,19 @@ for ([nameMA, [primarySkillA, secondarySkillA]] = ["trimmer", ["trimming", "edgi } for ([numberA3, ...robotAInfo] = robotA, i = 0; i < 1; i++) { ->[numberA3, ...robotAInfo] = robotA, i = 0 : number +>[numberA3, ...robotAInfo] = robotA, i = 0 : 0 >[numberA3, ...robotAInfo] = robotA : [number, string, string] >[numberA3, ...robotAInfo] : (string | number)[] >numberA3 : number >...robotAInfo : string | number >robotAInfo : (string | number)[] >robotA : [number, string, string] ->i = 0 : number +>i = 0 : 0 >i : number ->0 : number +>0 : 0 >i < 1 : boolean >i : number ->1 : number +>1 : 1 >i++ : number >i : number @@ -553,7 +553,7 @@ for ([numberA3, ...robotAInfo] = robotA, i = 0; i < 1; i++) { >numberA3 : number } for ([numberA3, ...robotAInfo] = getRobot(), i = 0; i < 1; i++) { ->[numberA3, ...robotAInfo] = getRobot(), i = 0 : number +>[numberA3, ...robotAInfo] = getRobot(), i = 0 : 0 >[numberA3, ...robotAInfo] = getRobot() : [number, string, string] >[numberA3, ...robotAInfo] : (string | number)[] >numberA3 : number @@ -561,12 +561,12 @@ for ([numberA3, ...robotAInfo] = getRobot(), i = 0; i < 1; i++) { >robotAInfo : (string | number)[] >getRobot() : [number, string, string] >getRobot : () => [number, string, string] ->i = 0 : number +>i = 0 : 0 >i : number ->0 : number +>0 : 0 >i < 1 : boolean >i : number ->1 : number +>1 : 1 >i++ : number >i : number @@ -578,7 +578,7 @@ for ([numberA3, ...robotAInfo] = getRobot(), i = 0; i < 1; i++) { >numberA3 : number } for ([numberA3, ...robotAInfo] = [2, "trimmer", "trimming"], i = 0; i < 1; i++) { ->[numberA3, ...robotAInfo] = [2, "trimmer", "trimming"], i = 0 : number +>[numberA3, ...robotAInfo] = [2, "trimmer", "trimming"], i = 0 : 0 >[numberA3, ...robotAInfo] = [2, "trimmer", "trimming"] : [number, string, string] >[numberA3, ...robotAInfo] : (string | number)[] >numberA3 : number @@ -587,15 +587,15 @@ for ([numberA3, ...robotAInfo] = [2, "trimmer", "trimming"], i = 0; i < 1 >[2, "trimmer", "trimming"] : [number, string, string] >Robot : [number, string, string] >[2, "trimmer", "trimming"] : [number, string, string] ->2 : number ->"trimmer" : string ->"trimming" : string ->i = 0 : number +>2 : 2 +>"trimmer" : "trimmer" +>"trimming" : "trimming" +>i = 0 : 0 >i : number ->0 : number +>0 : 0 >i < 1 : boolean >i : number ->1 : number +>1 : 1 >i++ : number >i : number @@ -607,18 +607,18 @@ for ([numberA3, ...robotAInfo] = [2, "trimmer", "trimming"], i = 0; i < 1 >numberA3 : number } for ([...multiRobotAInfo] = multiRobotA, i = 0; i < 1; i++) { ->[...multiRobotAInfo] = multiRobotA, i = 0 : number +>[...multiRobotAInfo] = multiRobotA, i = 0 : 0 >[...multiRobotAInfo] = multiRobotA : [string, [string, string]] >[...multiRobotAInfo] : (string | [string, string])[] >...multiRobotAInfo : string | [string, string] >multiRobotAInfo : (string | [string, string])[] >multiRobotA : [string, [string, string]] ->i = 0 : number +>i = 0 : 0 >i : number ->0 : number +>0 : 0 >i < 1 : boolean >i : number ->1 : number +>1 : 1 >i++ : number >i : number @@ -630,19 +630,19 @@ for ([...multiRobotAInfo] = multiRobotA, i = 0; i < 1; i++) { >multiRobotAInfo : (string | [string, string])[] } for ([...multiRobotAInfo] = getMultiRobot(), i = 0; i < 1; i++) { ->[...multiRobotAInfo] = getMultiRobot(), i = 0 : number +>[...multiRobotAInfo] = getMultiRobot(), i = 0 : 0 >[...multiRobotAInfo] = getMultiRobot() : [string, [string, string]] >[...multiRobotAInfo] : (string | [string, string])[] >...multiRobotAInfo : string | [string, string] >multiRobotAInfo : (string | [string, string])[] >getMultiRobot() : [string, [string, string]] >getMultiRobot : () => [string, [string, string]] ->i = 0 : number +>i = 0 : 0 >i : number ->0 : number +>0 : 0 >i < 1 : boolean >i : number ->1 : number +>1 : 1 >i++ : number >i : number @@ -654,7 +654,7 @@ for ([...multiRobotAInfo] = getMultiRobot(), i = 0; i < 1; i++) { >multiRobotAInfo : (string | [string, string])[] } for ([...multiRobotAInfo] = ["trimmer", ["trimming", "edging"]], i = 0; i < 1; i++) { ->[...multiRobotAInfo] = ["trimmer", ["trimming", "edging"]], i = 0 : number +>[...multiRobotAInfo] = ["trimmer", ["trimming", "edging"]], i = 0 : 0 >[...multiRobotAInfo] = ["trimmer", ["trimming", "edging"]] : [string, [string, string]] >[...multiRobotAInfo] : (string | [string, string])[] >...multiRobotAInfo : string | [string, string] @@ -662,16 +662,16 @@ for ([...multiRobotAInfo] = ["trimmer", ["trimming", "edging" >["trimmer", ["trimming", "edging"]] : [string, [string, string]] >MultiSkilledRobot : [string, [string, string]] >["trimmer", ["trimming", "edging"]] : [string, [string, string]] ->"trimmer" : string +>"trimmer" : "trimmer" >["trimming", "edging"] : [string, string] ->"trimming" : string ->"edging" : string ->i = 0 : number +>"trimming" : "trimming" +>"edging" : "edging" +>i = 0 : 0 >i : number ->0 : number +>0 : 0 >i < 1 : boolean >i : number ->1 : number +>1 : 1 >i++ : number >i : number diff --git a/tests/baselines/reference/sourceMapValidationDestructuringForArrayBindingPatternDefaultValues.types b/tests/baselines/reference/sourceMapValidationDestructuringForArrayBindingPatternDefaultValues.types index 700e7b9f863..443f22bbab8 100644 --- a/tests/baselines/reference/sourceMapValidationDestructuringForArrayBindingPatternDefaultValues.types +++ b/tests/baselines/reference/sourceMapValidationDestructuringForArrayBindingPatternDefaultValues.types @@ -16,9 +16,9 @@ let robotA: Robot = [1, "mower", "mowing"]; >robotA : [number, string, string] >Robot : [number, string, string] >[1, "mower", "mowing"] : [number, string, string] ->1 : number ->"mower" : string ->"mowing" : string +>1 : 1 +>"mower" : "mower" +>"mowing" : "mowing" function getRobot() { >getRobot : () => [number, string, string] @@ -31,19 +31,19 @@ let multiRobotA: MultiSkilledRobot = ["mower", ["mowing", ""]]; >multiRobotA : [string, string[]] >MultiSkilledRobot : [string, string[]] >["mower", ["mowing", ""]] : [string, string[]] ->"mower" : string +>"mower" : "mower" >["mowing", ""] : string[] ->"mowing" : string ->"" : string +>"mowing" : "mowing" +>"" : "" let multiRobotB: MultiSkilledRobot = ["trimmer", ["trimming", "edging"]]; >multiRobotB : [string, string[]] >MultiSkilledRobot : [string, string[]] >["trimmer", ["trimming", "edging"]] : [string, string[]] ->"trimmer" : string +>"trimmer" : "trimmer" >["trimming", "edging"] : string[] ->"trimming" : string ->"edging" : string +>"trimming" : "trimming" +>"edging" : "edging" function getMultiRobot() { >getMultiRobot : () => [string, string[]] @@ -55,13 +55,13 @@ function getMultiRobot() { for (let [, nameA ="name"] = robotA, i = 0; i < 1; i++) { > : undefined >nameA : string ->"name" : string +>"name" : "name" >robotA : [number, string, string] >i : number ->0 : number +>0 : 0 >i < 1 : boolean >i : number ->1 : number +>1 : 1 >i++ : number >i : number @@ -75,14 +75,14 @@ for (let [, nameA ="name"] = robotA, i = 0; i < 1; i++) { for (let [, nameA = "name"] = getRobot(), i = 0; i < 1; i++) { > : undefined >nameA : string ->"name" : string +>"name" : "name" >getRobot() : [number, string, string] >getRobot : () => [number, string, string] >i : number ->0 : number +>0 : 0 >i < 1 : boolean >i : number ->1 : number +>1 : 1 >i++ : number >i : number @@ -96,16 +96,16 @@ for (let [, nameA = "name"] = getRobot(), i = 0; i < 1; i++) { for (let [, nameA = "name"] = [2, "trimmer", "trimming"], i = 0; i < 1; i++) { > : undefined >nameA : string ->"name" : string +>"name" : "name" >[2, "trimmer", "trimming"] : [number, string, string] ->2 : number ->"trimmer" : string ->"trimming" : string +>2 : 2 +>"trimmer" : "trimmer" +>"trimming" : "trimming" >i : number ->0 : number +>0 : 0 >i < 1 : boolean >i : number ->1 : number +>1 : 1 >i++ : number >i : number @@ -121,22 +121,22 @@ for (let [, [ primarySkillA = "primary", >primarySkillA : string ->"primary" : string +>"primary" : "primary" secondarySkillA = "secondary" >secondarySkillA : string ->"secondary" : string +>"secondary" : "secondary" ] = ["none", "none"]] = multiRobotA, i = 0; i < 1; i++) { >["none", "none"] : [string, string] ->"none" : string ->"none" : string +>"none" : "none" +>"none" : "none" >multiRobotA : [string, string[]] >i : number ->0 : number +>0 : 0 >i < 1 : boolean >i : number ->1 : number +>1 : 1 >i++ : number >i : number @@ -152,23 +152,23 @@ for (let [, [ primarySkillA = "primary", >primarySkillA : string ->"primary" : string +>"primary" : "primary" secondarySkillA = "secondary" >secondarySkillA : string ->"secondary" : string +>"secondary" : "secondary" ] = ["none", "none"]] = getMultiRobot(), i = 0; i < 1; i++) { >["none", "none"] : [string, string] ->"none" : string ->"none" : string +>"none" : "none" +>"none" : "none" >getMultiRobot() : [string, string[]] >getMultiRobot : () => [string, string[]] >i : number ->0 : number +>0 : 0 >i < 1 : boolean >i : number ->1 : number +>1 : 1 >i++ : number >i : number @@ -184,26 +184,26 @@ for (let [, [ primarySkillA = "primary", >primarySkillA : string ->"primary" : string +>"primary" : "primary" secondarySkillA = "secondary" >secondarySkillA : string ->"secondary" : string +>"secondary" : "secondary" ] = ["none", "none"]] = ["trimmer", ["trimming", "edging"]], i = 0; i < 1; i++) { >["none", "none"] : [string, string] ->"none" : string ->"none" : string +>"none" : "none" +>"none" : "none" >["trimmer", ["trimming", "edging"]] : [string, [string, string]] ->"trimmer" : string +>"trimmer" : "trimmer" >["trimming", "edging"] : [string, string] ->"trimming" : string ->"edging" : string +>"trimming" : "trimming" +>"edging" : "edging" >i : number ->0 : number +>0 : 0 >i < 1 : boolean >i : number ->1 : number +>1 : 1 >i++ : number >i : number @@ -217,14 +217,14 @@ for (let [, [ for (let [numberB = -1] = robotA, i = 0; i < 1; i++) { >numberB : number ->-1 : number ->1 : number +>-1 : -1 +>1 : 1 >robotA : [number, string, string] >i : number ->0 : number +>0 : 0 >i < 1 : boolean >i : number ->1 : number +>1 : 1 >i++ : number >i : number @@ -237,15 +237,15 @@ for (let [numberB = -1] = robotA, i = 0; i < 1; i++) { } for (let [numberB = -1] = getRobot(), i = 0; i < 1; i++) { >numberB : number ->-1 : number ->1 : number +>-1 : -1 +>1 : 1 >getRobot() : [number, string, string] >getRobot : () => [number, string, string] >i : number ->0 : number +>0 : 0 >i < 1 : boolean >i : number ->1 : number +>1 : 1 >i++ : number >i : number @@ -258,17 +258,17 @@ for (let [numberB = -1] = getRobot(), i = 0; i < 1; i++) { } for (let [numberB = -1] = [2, "trimmer", "trimming"], i = 0; i < 1; i++) { >numberB : number ->-1 : number ->1 : number +>-1 : -1 +>1 : 1 >[2, "trimmer", "trimming"] : [number, string, string] ->2 : number ->"trimmer" : string ->"trimming" : string +>2 : 2 +>"trimmer" : "trimmer" +>"trimming" : "trimming" >i : number ->0 : number +>0 : 0 >i < 1 : boolean >i : number ->1 : number +>1 : 1 >i++ : number >i : number @@ -281,13 +281,13 @@ for (let [numberB = -1] = [2, "trimmer", "trimming"], i = 0; i < 1; i++) { } for (let [nameB = "name"] = multiRobotA, i = 0; i < 1; i++) { >nameB : string ->"name" : string +>"name" : "name" >multiRobotA : [string, string[]] >i : number ->0 : number +>0 : 0 >i < 1 : boolean >i : number ->1 : number +>1 : 1 >i++ : number >i : number @@ -300,14 +300,14 @@ for (let [nameB = "name"] = multiRobotA, i = 0; i < 1; i++) { } for (let [nameB = "name"] = getMultiRobot(), i = 0; i < 1; i++) { >nameB : string ->"name" : string +>"name" : "name" >getMultiRobot() : [string, string[]] >getMultiRobot : () => [string, string[]] >i : number ->0 : number +>0 : 0 >i < 1 : boolean >i : number ->1 : number +>1 : 1 >i++ : number >i : number @@ -320,17 +320,17 @@ for (let [nameB = "name"] = getMultiRobot(), i = 0; i < 1; i++) { } for (let [nameB = "name"] = ["trimmer", ["trimming", "edging"]], i = 0; i < 1; i++) { >nameB : string ->"name" : string +>"name" : "name" >["trimmer", ["trimming", "edging"]] : [string, string[]] ->"trimmer" : string +>"trimmer" : "trimmer" >["trimming", "edging"] : string[] ->"trimming" : string ->"edging" : string +>"trimming" : "trimming" +>"edging" : "edging" >i : number ->0 : number +>0 : 0 >i < 1 : boolean >i : number ->1 : number +>1 : 1 >i++ : number >i : number @@ -344,18 +344,18 @@ for (let [nameB = "name"] = ["trimmer", ["trimming", "edging"]], i = 0; i < 1; i for (let [numberA2 = -1, nameA2 = "name", skillA2 = "skill"] = robotA, i = 0; i < 1; i++) { >numberA2 : number ->-1 : number ->1 : number +>-1 : -1 +>1 : 1 >nameA2 : string ->"name" : string +>"name" : "name" >skillA2 : string ->"skill" : string +>"skill" : "skill" >robotA : [number, string, string] >i : number ->0 : number +>0 : 0 >i < 1 : boolean >i : number ->1 : number +>1 : 1 >i++ : number >i : number @@ -368,19 +368,19 @@ for (let [numberA2 = -1, nameA2 = "name", skillA2 = "skill"] = robotA, i = 0; i } for (let [numberA2 = -1, nameA2 = "name", skillA2 = "skill"] = getRobot(), i = 0; i < 1; i++) { >numberA2 : number ->-1 : number ->1 : number +>-1 : -1 +>1 : 1 >nameA2 : string ->"name" : string +>"name" : "name" >skillA2 : string ->"skill" : string +>"skill" : "skill" >getRobot() : [number, string, string] >getRobot : () => [number, string, string] >i : number ->0 : number +>0 : 0 >i < 1 : boolean >i : number ->1 : number +>1 : 1 >i++ : number >i : number @@ -393,21 +393,21 @@ for (let [numberA2 = -1, nameA2 = "name", skillA2 = "skill"] = getRobot(), i = 0 } for (let [numberA2 = -1, nameA2 = "name", skillA2 = "skill"] = [2, "trimmer", "trimming"], i = 0; i < 1; i++) { >numberA2 : number ->-1 : number ->1 : number +>-1 : -1 +>1 : 1 >nameA2 : string ->"name" : string +>"name" : "name" >skillA2 : string ->"skill" : string +>"skill" : "skill" >[2, "trimmer", "trimming"] : [number, string, string] ->2 : number ->"trimmer" : string ->"trimming" : string +>2 : 2 +>"trimmer" : "trimmer" +>"trimming" : "trimming" >i : number ->0 : number +>0 : 0 >i < 1 : boolean >i : number ->1 : number +>1 : 1 >i++ : number >i : number @@ -421,29 +421,29 @@ for (let [numberA2 = -1, nameA2 = "name", skillA2 = "skill"] = [2, "trimmer", "t for (let [nameMA = "noName", >nameMA : string ->"noName" : string +>"noName" : "noName" [ primarySkillA = "primary", >primarySkillA : string ->"primary" : string +>"primary" : "primary" secondarySkillA = "secondary" >secondarySkillA : string ->"secondary" : string +>"secondary" : "secondary" ] = ["none", "none"] >["none", "none"] : [string, string] ->"none" : string ->"none" : string +>"none" : "none" +>"none" : "none" ] = multiRobotA, i = 0; i < 1; i++) { >multiRobotA : [string, string[]] >i : number ->0 : number +>0 : 0 >i < 1 : boolean >i : number ->1 : number +>1 : 1 >i++ : number >i : number @@ -456,30 +456,30 @@ for (let } for (let [nameMA = "noName", >nameMA : string ->"noName" : string +>"noName" : "noName" [ primarySkillA = "primary", >primarySkillA : string ->"primary" : string +>"primary" : "primary" secondarySkillA = "secondary" >secondarySkillA : string ->"secondary" : string +>"secondary" : "secondary" ] = ["none", "none"] >["none", "none"] : [string, string] ->"none" : string ->"none" : string +>"none" : "none" +>"none" : "none" ] = getMultiRobot(), i = 0; i < 1; i++) { >getMultiRobot() : [string, string[]] >getMultiRobot : () => [string, string[]] >i : number ->0 : number +>0 : 0 >i < 1 : boolean >i : number ->1 : number +>1 : 1 >i++ : number >i : number @@ -492,33 +492,33 @@ for (let [nameMA = "noName", } for (let [nameMA = "noName", >nameMA : string ->"noName" : string +>"noName" : "noName" [ primarySkillA = "primary", >primarySkillA : string ->"primary" : string +>"primary" : "primary" secondarySkillA = "secondary" >secondarySkillA : string ->"secondary" : string +>"secondary" : "secondary" ] = ["none", "none"] >["none", "none"] : [string, string] ->"none" : string ->"none" : string +>"none" : "none" +>"none" : "none" ] = ["trimmer", ["trimming", "edging"]], i = 0; i < 1; i++) { >["trimmer", ["trimming", "edging"]] : [string, [string, string]] ->"trimmer" : string +>"trimmer" : "trimmer" >["trimming", "edging"] : [string, string] ->"trimming" : string ->"edging" : string +>"trimming" : "trimming" +>"edging" : "edging" >i : number ->0 : number +>0 : 0 >i < 1 : boolean >i : number ->1 : number +>1 : 1 >i++ : number >i : number @@ -532,15 +532,15 @@ for (let [nameMA = "noName", for (let [numberA3 = -1, ...robotAInfo] = robotA, i = 0; i < 1; i++) { >numberA3 : number ->-1 : number ->1 : number +>-1 : -1 +>1 : 1 >robotAInfo : (string | number)[] >robotA : [number, string, string] >i : number ->0 : number +>0 : 0 >i < 1 : boolean >i : number ->1 : number +>1 : 1 >i++ : number >i : number @@ -553,16 +553,16 @@ for (let [numberA3 = -1, ...robotAInfo] = robotA, i = 0; i < 1; i++) { } for (let [numberA3 = -1, ...robotAInfo] = getRobot(), i = 0; i < 1; i++) { >numberA3 : number ->-1 : number ->1 : number +>-1 : -1 +>1 : 1 >robotAInfo : (string | number)[] >getRobot() : [number, string, string] >getRobot : () => [number, string, string] >i : number ->0 : number +>0 : 0 >i < 1 : boolean >i : number ->1 : number +>1 : 1 >i++ : number >i : number @@ -575,18 +575,18 @@ for (let [numberA3 = -1, ...robotAInfo] = getRobot(), i = 0; i < 1; i++) { } for (let [numberA3 = -1, ...robotAInfo] = [2, "trimmer", "trimming"], i = 0; i < 1; i++) { >numberA3 : string | number ->-1 : number ->1 : number +>-1 : -1 +>1 : 1 >robotAInfo : (string | number)[] >[2, "trimmer", "trimming"] : (string | number)[] ->2 : number ->"trimmer" : string ->"trimming" : string +>2 : 2 +>"trimmer" : "trimmer" +>"trimming" : "trimming" >i : number ->0 : number +>0 : 0 >i < 1 : boolean >i : number ->1 : number +>1 : 1 >i++ : number >i : number diff --git a/tests/baselines/reference/sourceMapValidationDestructuringForArrayBindingPatternDefaultValues2.types b/tests/baselines/reference/sourceMapValidationDestructuringForArrayBindingPatternDefaultValues2.types index 93d149a6bde..0795142c677 100644 --- a/tests/baselines/reference/sourceMapValidationDestructuringForArrayBindingPatternDefaultValues2.types +++ b/tests/baselines/reference/sourceMapValidationDestructuringForArrayBindingPatternDefaultValues2.types @@ -16,9 +16,9 @@ let robotA: Robot = [1, "mower", "mowing"]; >robotA : [number, string, string] >Robot : [number, string, string] >[1, "mower", "mowing"] : [number, string, string] ->1 : number ->"mower" : string ->"mowing" : string +>1 : 1 +>"mower" : "mower" +>"mowing" : "mowing" function getRobot() { >getRobot : () => [number, string, string] @@ -31,19 +31,19 @@ let multiRobotA: MultiSkilledRobot = ["mower", ["mowing", ""]]; >multiRobotA : [string, [string, string]] >MultiSkilledRobot : [string, [string, string]] >["mower", ["mowing", ""]] : [string, [string, string]] ->"mower" : string +>"mower" : "mower" >["mowing", ""] : [string, string] ->"mowing" : string ->"" : string +>"mowing" : "mowing" +>"" : "" let multiRobotB: MultiSkilledRobot = ["trimmer", ["trimming", "edging"]]; >multiRobotB : [string, [string, string]] >MultiSkilledRobot : [string, [string, string]] >["trimmer", ["trimming", "edging"]] : [string, [string, string]] ->"trimmer" : string +>"trimmer" : "trimmer" >["trimming", "edging"] : [string, string] ->"trimming" : string ->"edging" : string +>"trimming" : "trimming" +>"edging" : "edging" function getMultiRobot() { >getMultiRobot : () => [string, [string, string]] @@ -76,20 +76,20 @@ let i: number; >i : number for ([, nameA = "name"] = robotA, i = 0; i < 1; i++) { ->[, nameA = "name"] = robotA, i = 0 : number +>[, nameA = "name"] = robotA, i = 0 : 0 >[, nameA = "name"] = robotA : [number, string, string] >[, nameA = "name"] : [undefined, string] > : undefined ->nameA = "name" : string +>nameA = "name" : "name" >nameA : string ->"name" : string +>"name" : "name" >robotA : [number, string, string] ->i = 0 : number +>i = 0 : 0 >i : number ->0 : number +>0 : 0 >i < 1 : boolean >i : number ->1 : number +>1 : 1 >i++ : number >i : number @@ -101,21 +101,21 @@ for ([, nameA = "name"] = robotA, i = 0; i < 1; i++) { >nameA : string } for ([, nameA = "name"] = getRobot(), i = 0; i < 1; i++) { ->[, nameA = "name"] = getRobot(), i = 0 : number +>[, nameA = "name"] = getRobot(), i = 0 : 0 >[, nameA = "name"] = getRobot() : [number, string, string] >[, nameA = "name"] : [undefined, string] > : undefined ->nameA = "name" : string +>nameA = "name" : "name" >nameA : string ->"name" : string +>"name" : "name" >getRobot() : [number, string, string] >getRobot : () => [number, string, string] ->i = 0 : number +>i = 0 : 0 >i : number ->0 : number +>0 : 0 >i < 1 : boolean >i : number ->1 : number +>1 : 1 >i++ : number >i : number @@ -127,23 +127,23 @@ for ([, nameA = "name"] = getRobot(), i = 0; i < 1; i++) { >nameA : string } for ([, nameA = "name"] = [2, "trimmer", "trimming"], i = 0; i < 1; i++) { ->[, nameA = "name"] = [2, "trimmer", "trimming"], i = 0 : number +>[, nameA = "name"] = [2, "trimmer", "trimming"], i = 0 : 0 >[, nameA = "name"] = [2, "trimmer", "trimming"] : [number, string, string] >[, nameA = "name"] : [undefined, string] > : undefined ->nameA = "name" : string +>nameA = "name" : "name" >nameA : string ->"name" : string +>"name" : "name" >[2, "trimmer", "trimming"] : [number, string, string] ->2 : number ->"trimmer" : string ->"trimming" : string ->i = 0 : number +>2 : 2 +>"trimmer" : "trimmer" +>"trimming" : "trimming" +>i = 0 : 0 >i : number ->0 : number +>0 : 0 >i < 1 : boolean >i : number ->1 : number +>1 : 1 >i++ : number >i : number @@ -155,7 +155,7 @@ for ([, nameA = "name"] = [2, "trimmer", "trimming"], i = 0; i < 1; i++) { >nameA : string } for ([, [ ->[, [ primarySkillA = "primary", secondarySkillA = "secondary"] = ["none", "none"]] = multiRobotA, i = 0 : number +>[, [ primarySkillA = "primary", secondarySkillA = "secondary"] = ["none", "none"]] = multiRobotA, i = 0 : 0 >[, [ primarySkillA = "primary", secondarySkillA = "secondary"] = ["none", "none"]] = multiRobotA : [string, [string, string]] >[, [ primarySkillA = "primary", secondarySkillA = "secondary"] = ["none", "none"]] : [undefined, [string, string]] > : undefined @@ -163,26 +163,26 @@ for ([, [ >[ primarySkillA = "primary", secondarySkillA = "secondary"] : [string, string] primarySkillA = "primary", ->primarySkillA = "primary" : string +>primarySkillA = "primary" : "primary" >primarySkillA : string ->"primary" : string +>"primary" : "primary" secondarySkillA = "secondary" ->secondarySkillA = "secondary" : string +>secondarySkillA = "secondary" : "secondary" >secondarySkillA : string ->"secondary" : string +>"secondary" : "secondary" ] = ["none", "none"]] = multiRobotA, i = 0; i < 1; i++) { >["none", "none"] : [string, string] ->"none" : string ->"none" : string +>"none" : "none" +>"none" : "none" >multiRobotA : [string, [string, string]] ->i = 0 : number +>i = 0 : 0 >i : number ->0 : number +>0 : 0 >i < 1 : boolean >i : number ->1 : number +>1 : 1 >i++ : number >i : number @@ -194,7 +194,7 @@ for ([, [ >primarySkillA : string } for ([, [ ->[, [ primarySkillA = "primary", secondarySkillA = "secondary"] = ["none", "none"]] = getMultiRobot(), i = 0 : number +>[, [ primarySkillA = "primary", secondarySkillA = "secondary"] = ["none", "none"]] = getMultiRobot(), i = 0 : 0 >[, [ primarySkillA = "primary", secondarySkillA = "secondary"] = ["none", "none"]] = getMultiRobot() : [string, [string, string]] >[, [ primarySkillA = "primary", secondarySkillA = "secondary"] = ["none", "none"]] : [undefined, [string, string]] > : undefined @@ -202,27 +202,27 @@ for ([, [ >[ primarySkillA = "primary", secondarySkillA = "secondary"] : [string, string] primarySkillA = "primary", ->primarySkillA = "primary" : string +>primarySkillA = "primary" : "primary" >primarySkillA : string ->"primary" : string +>"primary" : "primary" secondarySkillA = "secondary" ->secondarySkillA = "secondary" : string +>secondarySkillA = "secondary" : "secondary" >secondarySkillA : string ->"secondary" : string +>"secondary" : "secondary" ] = ["none", "none"]] = getMultiRobot(), i = 0; i < 1; i++) { >["none", "none"] : [string, string] ->"none" : string ->"none" : string +>"none" : "none" +>"none" : "none" >getMultiRobot() : [string, [string, string]] >getMultiRobot : () => [string, [string, string]] ->i = 0 : number +>i = 0 : 0 >i : number ->0 : number +>0 : 0 >i < 1 : boolean >i : number ->1 : number +>1 : 1 >i++ : number >i : number @@ -234,7 +234,7 @@ for ([, [ >primarySkillA : string } for ([, [ ->[, [ primarySkillA = "primary", secondarySkillA = "secondary"] = ["none", "none"]] = ["trimmer", ["trimming", "edging"]], i = 0 : number +>[, [ primarySkillA = "primary", secondarySkillA = "secondary"] = ["none", "none"]] = ["trimmer", ["trimming", "edging"]], i = 0 : 0 >[, [ primarySkillA = "primary", secondarySkillA = "secondary"] = ["none", "none"]] = ["trimmer", ["trimming", "edging"]] : [string, [string, string]] >[, [ primarySkillA = "primary", secondarySkillA = "secondary"] = ["none", "none"]] : [undefined, [string, string]] > : undefined @@ -242,30 +242,30 @@ for ([, [ >[ primarySkillA = "primary", secondarySkillA = "secondary"] : [string, string] primarySkillA = "primary", ->primarySkillA = "primary" : string +>primarySkillA = "primary" : "primary" >primarySkillA : string ->"primary" : string +>"primary" : "primary" secondarySkillA = "secondary" ->secondarySkillA = "secondary" : string +>secondarySkillA = "secondary" : "secondary" >secondarySkillA : string ->"secondary" : string +>"secondary" : "secondary" ] = ["none", "none"]] = ["trimmer", ["trimming", "edging"]], i = 0; i < 1; i++) { >["none", "none"] : [string, string] ->"none" : string ->"none" : string +>"none" : "none" +>"none" : "none" >["trimmer", ["trimming", "edging"]] : [string, [string, string]] ->"trimmer" : string +>"trimmer" : "trimmer" >["trimming", "edging"] : [string, string] ->"trimming" : string ->"edging" : string ->i = 0 : number +>"trimming" : "trimming" +>"edging" : "edging" +>i = 0 : 0 >i : number ->0 : number +>0 : 0 >i < 1 : boolean >i : number ->1 : number +>1 : 1 >i++ : number >i : number @@ -278,20 +278,20 @@ for ([, [ } for ([numberB = -1] = robotA, i = 0; i < 1; i++) { ->[numberB = -1] = robotA, i = 0 : number +>[numberB = -1] = robotA, i = 0 : 0 >[numberB = -1] = robotA : [number, string, string] >[numberB = -1] : [number] ->numberB = -1 : number +>numberB = -1 : -1 >numberB : number ->-1 : number ->1 : number +>-1 : -1 +>1 : 1 >robotA : [number, string, string] ->i = 0 : number +>i = 0 : 0 >i : number ->0 : number +>0 : 0 >i < 1 : boolean >i : number ->1 : number +>1 : 1 >i++ : number >i : number @@ -303,21 +303,21 @@ for ([numberB = -1] = robotA, i = 0; i < 1; i++) { >numberB : number } for ([numberB = -1] = getRobot(), i = 0; i < 1; i++) { ->[numberB = -1] = getRobot(), i = 0 : number +>[numberB = -1] = getRobot(), i = 0 : 0 >[numberB = -1] = getRobot() : [number, string, string] >[numberB = -1] : [number] ->numberB = -1 : number +>numberB = -1 : -1 >numberB : number ->-1 : number ->1 : number +>-1 : -1 +>1 : 1 >getRobot() : [number, string, string] >getRobot : () => [number, string, string] ->i = 0 : number +>i = 0 : 0 >i : number ->0 : number +>0 : 0 >i < 1 : boolean >i : number ->1 : number +>1 : 1 >i++ : number >i : number @@ -329,23 +329,23 @@ for ([numberB = -1] = getRobot(), i = 0; i < 1; i++) { >numberB : number } for ([numberB = -1] = [2, "trimmer", "trimming"], i = 0; i < 1; i++) { ->[numberB = -1] = [2, "trimmer", "trimming"], i = 0 : number +>[numberB = -1] = [2, "trimmer", "trimming"], i = 0 : 0 >[numberB = -1] = [2, "trimmer", "trimming"] : [number, string, string] >[numberB = -1] : [number] ->numberB = -1 : number +>numberB = -1 : -1 >numberB : number ->-1 : number ->1 : number +>-1 : -1 +>1 : 1 >[2, "trimmer", "trimming"] : [number, string, string] ->2 : number ->"trimmer" : string ->"trimming" : string ->i = 0 : number +>2 : 2 +>"trimmer" : "trimmer" +>"trimming" : "trimming" +>i = 0 : 0 >i : number ->0 : number +>0 : 0 >i < 1 : boolean >i : number ->1 : number +>1 : 1 >i++ : number >i : number @@ -357,19 +357,19 @@ for ([numberB = -1] = [2, "trimmer", "trimming"], i = 0; i < 1; i++) { >numberB : number } for ([nameB = "name"] = multiRobotA, i = 0; i < 1; i++) { ->[nameB = "name"] = multiRobotA, i = 0 : number +>[nameB = "name"] = multiRobotA, i = 0 : 0 >[nameB = "name"] = multiRobotA : [string, [string, string]] >[nameB = "name"] : [string] ->nameB = "name" : string +>nameB = "name" : "name" >nameB : string ->"name" : string +>"name" : "name" >multiRobotA : [string, [string, string]] ->i = 0 : number +>i = 0 : 0 >i : number ->0 : number +>0 : 0 >i < 1 : boolean >i : number ->1 : number +>1 : 1 >i++ : number >i : number @@ -381,20 +381,20 @@ for ([nameB = "name"] = multiRobotA, i = 0; i < 1; i++) { >nameB : string } for ([nameB = "name"] = getMultiRobot(), i = 0; i < 1; i++) { ->[nameB = "name"] = getMultiRobot(), i = 0 : number +>[nameB = "name"] = getMultiRobot(), i = 0 : 0 >[nameB = "name"] = getMultiRobot() : [string, [string, string]] >[nameB = "name"] : [string] ->nameB = "name" : string +>nameB = "name" : "name" >nameB : string ->"name" : string +>"name" : "name" >getMultiRobot() : [string, [string, string]] >getMultiRobot : () => [string, [string, string]] ->i = 0 : number +>i = 0 : 0 >i : number ->0 : number +>0 : 0 >i < 1 : boolean >i : number ->1 : number +>1 : 1 >i++ : number >i : number @@ -406,23 +406,23 @@ for ([nameB = "name"] = getMultiRobot(), i = 0; i < 1; i++) { >nameB : string } for ([nameB = "name"] = ["trimmer", ["trimming", "edging"]], i = 0; i < 1; i++) { ->[nameB = "name"] = ["trimmer", ["trimming", "edging"]], i = 0 : number +>[nameB = "name"] = ["trimmer", ["trimming", "edging"]], i = 0 : 0 >[nameB = "name"] = ["trimmer", ["trimming", "edging"]] : [string, string[]] >[nameB = "name"] : [string] ->nameB = "name" : string +>nameB = "name" : "name" >nameB : string ->"name" : string +>"name" : "name" >["trimmer", ["trimming", "edging"]] : [string, string[]] ->"trimmer" : string +>"trimmer" : "trimmer" >["trimming", "edging"] : string[] ->"trimming" : string ->"edging" : string ->i = 0 : number +>"trimming" : "trimming" +>"edging" : "edging" +>i = 0 : 0 >i : number ->0 : number +>0 : 0 >i < 1 : boolean >i : number ->1 : number +>1 : 1 >i++ : number >i : number @@ -435,26 +435,26 @@ for ([nameB = "name"] = ["trimmer", ["trimming", "edging"]], i = 0; i < 1; i++) } for ([numberA2 = -1, nameA2 = "name", skillA2 = "skill"] = robotA, i = 0; i < 1; i++) { ->[numberA2 = -1, nameA2 = "name", skillA2 = "skill"] = robotA, i = 0 : number +>[numberA2 = -1, nameA2 = "name", skillA2 = "skill"] = robotA, i = 0 : 0 >[numberA2 = -1, nameA2 = "name", skillA2 = "skill"] = robotA : [number, string, string] >[numberA2 = -1, nameA2 = "name", skillA2 = "skill"] : [number, string, string] ->numberA2 = -1 : number +>numberA2 = -1 : -1 >numberA2 : number ->-1 : number ->1 : number ->nameA2 = "name" : string +>-1 : -1 +>1 : 1 +>nameA2 = "name" : "name" >nameA2 : string ->"name" : string ->skillA2 = "skill" : string +>"name" : "name" +>skillA2 = "skill" : "skill" >skillA2 : string ->"skill" : string +>"skill" : "skill" >robotA : [number, string, string] ->i = 0 : number +>i = 0 : 0 >i : number ->0 : number +>0 : 0 >i < 1 : boolean >i : number ->1 : number +>1 : 1 >i++ : number >i : number @@ -466,27 +466,27 @@ for ([numberA2 = -1, nameA2 = "name", skillA2 = "skill"] = robotA, i = 0; i < 1; >nameA2 : string } for ([numberA2 = -1, nameA2 = "name", skillA2 = "skill"] = getRobot(), i = 0; i < 1; i++) { ->[numberA2 = -1, nameA2 = "name", skillA2 = "skill"] = getRobot(), i = 0 : number +>[numberA2 = -1, nameA2 = "name", skillA2 = "skill"] = getRobot(), i = 0 : 0 >[numberA2 = -1, nameA2 = "name", skillA2 = "skill"] = getRobot() : [number, string, string] >[numberA2 = -1, nameA2 = "name", skillA2 = "skill"] : [number, string, string] ->numberA2 = -1 : number +>numberA2 = -1 : -1 >numberA2 : number ->-1 : number ->1 : number ->nameA2 = "name" : string +>-1 : -1 +>1 : 1 +>nameA2 = "name" : "name" >nameA2 : string ->"name" : string ->skillA2 = "skill" : string +>"name" : "name" +>skillA2 = "skill" : "skill" >skillA2 : string ->"skill" : string +>"skill" : "skill" >getRobot() : [number, string, string] >getRobot : () => [number, string, string] ->i = 0 : number +>i = 0 : 0 >i : number ->0 : number +>0 : 0 >i < 1 : boolean >i : number ->1 : number +>1 : 1 >i++ : number >i : number @@ -498,29 +498,29 @@ for ([numberA2 = -1, nameA2 = "name", skillA2 = "skill"] = getRobot(), i = 0; i >nameA2 : string } for ([numberA2 = -1, nameA2 = "name", skillA2 = "skill"] = [2, "trimmer", "trimming"], i = 0; i < 1; i++) { ->[numberA2 = -1, nameA2 = "name", skillA2 = "skill"] = [2, "trimmer", "trimming"], i = 0 : number +>[numberA2 = -1, nameA2 = "name", skillA2 = "skill"] = [2, "trimmer", "trimming"], i = 0 : 0 >[numberA2 = -1, nameA2 = "name", skillA2 = "skill"] = [2, "trimmer", "trimming"] : [number, string, string] >[numberA2 = -1, nameA2 = "name", skillA2 = "skill"] : [number, string, string] ->numberA2 = -1 : number +>numberA2 = -1 : -1 >numberA2 : number ->-1 : number ->1 : number ->nameA2 = "name" : string +>-1 : -1 +>1 : 1 +>nameA2 = "name" : "name" >nameA2 : string ->"name" : string ->skillA2 = "skill" : string +>"name" : "name" +>skillA2 = "skill" : "skill" >skillA2 : string ->"skill" : string +>"skill" : "skill" >[2, "trimmer", "trimming"] : [number, string, string] ->2 : number ->"trimmer" : string ->"trimming" : string ->i = 0 : number +>2 : 2 +>"trimmer" : "trimmer" +>"trimming" : "trimming" +>i = 0 : 0 >i : number ->0 : number +>0 : 0 >i < 1 : boolean >i : number ->1 : number +>1 : 1 >i++ : number >i : number @@ -534,29 +534,29 @@ for ([numberA2 = -1, nameA2 = "name", skillA2 = "skill"] = [2, "trimmer", "trimm for (let [nameMA = "noName", >nameMA : string ->"noName" : string +>"noName" : "noName" [ primarySkillA = "primary", >primarySkillA : string ->"primary" : string +>"primary" : "primary" secondarySkillA = "secondary" >secondarySkillA : string ->"secondary" : string +>"secondary" : "secondary" ] = ["none", "none"] >["none", "none"] : [string, string] ->"none" : string ->"none" : string +>"none" : "none" +>"none" : "none" ] = multiRobotA, i = 0; i < 1; i++) { >multiRobotA : [string, [string, string]] >i : number ->0 : number +>0 : 0 >i < 1 : boolean >i : number ->1 : number +>1 : 1 >i++ : number >i : number @@ -568,41 +568,41 @@ for (let >nameMA : string } for ([nameMA = "noName", ->[nameMA = "noName", [ primarySkillA = "primary", secondarySkillA = "secondary" ] = ["none", "none"]] = getMultiRobot(), i = 0 : number +>[nameMA = "noName", [ primarySkillA = "primary", secondarySkillA = "secondary" ] = ["none", "none"]] = getMultiRobot(), i = 0 : 0 >[nameMA = "noName", [ primarySkillA = "primary", secondarySkillA = "secondary" ] = ["none", "none"]] = getMultiRobot() : [string, [string, string]] >[nameMA = "noName", [ primarySkillA = "primary", secondarySkillA = "secondary" ] = ["none", "none"]] : [string, [string, string]] ->nameMA = "noName" : string +>nameMA = "noName" : "noName" >nameMA : string ->"noName" : string +>"noName" : "noName" [ >[ primarySkillA = "primary", secondarySkillA = "secondary" ] = ["none", "none"] : [string, string] >[ primarySkillA = "primary", secondarySkillA = "secondary" ] : [string, string] primarySkillA = "primary", ->primarySkillA = "primary" : string +>primarySkillA = "primary" : "primary" >primarySkillA : string ->"primary" : string +>"primary" : "primary" secondarySkillA = "secondary" ->secondarySkillA = "secondary" : string +>secondarySkillA = "secondary" : "secondary" >secondarySkillA : string ->"secondary" : string +>"secondary" : "secondary" ] = ["none", "none"] >["none", "none"] : [string, string] ->"none" : string ->"none" : string +>"none" : "none" +>"none" : "none" ] = getMultiRobot(), i = 0; i < 1; i++) { >getMultiRobot() : [string, [string, string]] >getMultiRobot : () => [string, [string, string]] ->i = 0 : number +>i = 0 : 0 >i : number ->0 : number +>0 : 0 >i < 1 : boolean >i : number ->1 : number +>1 : 1 >i++ : number >i : number @@ -614,44 +614,44 @@ for ([nameMA = "noName", >nameMA : string } for ([nameMA = "noName", ->[nameMA = "noName", [ primarySkillA = "primary", secondarySkillA = "secondary" ] = ["none", "none"]] = ["trimmer", ["trimming", "edging"]], i = 0 : number +>[nameMA = "noName", [ primarySkillA = "primary", secondarySkillA = "secondary" ] = ["none", "none"]] = ["trimmer", ["trimming", "edging"]], i = 0 : 0 >[nameMA = "noName", [ primarySkillA = "primary", secondarySkillA = "secondary" ] = ["none", "none"]] = ["trimmer", ["trimming", "edging"]] : [string, [string, string]] >[nameMA = "noName", [ primarySkillA = "primary", secondarySkillA = "secondary" ] = ["none", "none"]] : [string, [string, string]] ->nameMA = "noName" : string +>nameMA = "noName" : "noName" >nameMA : string ->"noName" : string +>"noName" : "noName" [ >[ primarySkillA = "primary", secondarySkillA = "secondary" ] = ["none", "none"] : [string, string] >[ primarySkillA = "primary", secondarySkillA = "secondary" ] : [string, string] primarySkillA = "primary", ->primarySkillA = "primary" : string +>primarySkillA = "primary" : "primary" >primarySkillA : string ->"primary" : string +>"primary" : "primary" secondarySkillA = "secondary" ->secondarySkillA = "secondary" : string +>secondarySkillA = "secondary" : "secondary" >secondarySkillA : string ->"secondary" : string +>"secondary" : "secondary" ] = ["none", "none"] >["none", "none"] : [string, string] ->"none" : string ->"none" : string +>"none" : "none" +>"none" : "none" ] = ["trimmer", ["trimming", "edging"]], i = 0; i < 1; i++) { >["trimmer", ["trimming", "edging"]] : [string, [string, string]] ->"trimmer" : string +>"trimmer" : "trimmer" >["trimming", "edging"] : [string, string] ->"trimming" : string ->"edging" : string ->i = 0 : number +>"trimming" : "trimming" +>"edging" : "edging" +>i = 0 : 0 >i : number ->0 : number +>0 : 0 >i < 1 : boolean >i : number ->1 : number +>1 : 1 >i++ : number >i : number @@ -664,22 +664,22 @@ for ([nameMA = "noName", } for ([numberA3 = -1, ...robotAInfo] = robotA, i = 0; i < 1; i++) { ->[numberA3 = -1, ...robotAInfo] = robotA, i = 0 : number +>[numberA3 = -1, ...robotAInfo] = robotA, i = 0 : 0 >[numberA3 = -1, ...robotAInfo] = robotA : [number, string, string] >[numberA3 = -1, ...robotAInfo] : (string | number)[] ->numberA3 = -1 : number +>numberA3 = -1 : -1 >numberA3 : number ->-1 : number ->1 : number +>-1 : -1 +>1 : 1 >...robotAInfo : string | number >robotAInfo : (string | number)[] >robotA : [number, string, string] ->i = 0 : number +>i = 0 : 0 >i : number ->0 : number +>0 : 0 >i < 1 : boolean >i : number ->1 : number +>1 : 1 >i++ : number >i : number @@ -691,23 +691,23 @@ for ([numberA3 = -1, ...robotAInfo] = robotA, i = 0; i < 1; i++) { >numberA3 : number } for ([numberA3 = -1, ...robotAInfo] = getRobot(), i = 0; i < 1; i++) { ->[numberA3 = -1, ...robotAInfo] = getRobot(), i = 0 : number +>[numberA3 = -1, ...robotAInfo] = getRobot(), i = 0 : 0 >[numberA3 = -1, ...robotAInfo] = getRobot() : [number, string, string] >[numberA3 = -1, ...robotAInfo] : (string | number)[] ->numberA3 = -1 : number +>numberA3 = -1 : -1 >numberA3 : number ->-1 : number ->1 : number +>-1 : -1 +>1 : 1 >...robotAInfo : string | number >robotAInfo : (string | number)[] >getRobot() : [number, string, string] >getRobot : () => [number, string, string] ->i = 0 : number +>i = 0 : 0 >i : number ->0 : number +>0 : 0 >i < 1 : boolean >i : number ->1 : number +>1 : 1 >i++ : number >i : number @@ -719,27 +719,27 @@ for ([numberA3 = -1, ...robotAInfo] = getRobot(), i = 0; i < 1; i++) { >numberA3 : number } for ([numberA3 = -1, ...robotAInfo] = [2, "trimmer", "trimming"], i = 0; i < 1; i++) { ->[numberA3 = -1, ...robotAInfo] = [2, "trimmer", "trimming"], i = 0 : number +>[numberA3 = -1, ...robotAInfo] = [2, "trimmer", "trimming"], i = 0 : 0 >[numberA3 = -1, ...robotAInfo] = [2, "trimmer", "trimming"] : [number, string, string] >[numberA3 = -1, ...robotAInfo] : (string | number)[] ->numberA3 = -1 : number +>numberA3 = -1 : -1 >numberA3 : number ->-1 : number ->1 : number +>-1 : -1 +>1 : 1 >...robotAInfo : string | number >robotAInfo : (string | number)[] >[2, "trimmer", "trimming"] : [number, string, string] >Robot : [number, string, string] >[2, "trimmer", "trimming"] : [number, string, string] ->2 : number ->"trimmer" : string ->"trimming" : string ->i = 0 : number +>2 : 2 +>"trimmer" : "trimmer" +>"trimming" : "trimming" +>i = 0 : 0 >i : number ->0 : number +>0 : 0 >i < 1 : boolean >i : number ->1 : number +>1 : 1 >i++ : number >i : number diff --git a/tests/baselines/reference/sourceMapValidationDestructuringForObjectBindingPattern.types b/tests/baselines/reference/sourceMapValidationDestructuringForObjectBindingPattern.types index 21a7122e564..3a78d92033b 100644 --- a/tests/baselines/reference/sourceMapValidationDestructuringForObjectBindingPattern.types +++ b/tests/baselines/reference/sourceMapValidationDestructuringForObjectBindingPattern.types @@ -39,22 +39,22 @@ let robot: Robot = { name: "mower", skill: "mowing" }; >Robot : Robot >{ name: "mower", skill: "mowing" } : { name: string; skill: string; } >name : string ->"mower" : string +>"mower" : "mower" >skill : string ->"mowing" : string +>"mowing" : "mowing" let multiRobot: MultiRobot = { name: "mower", skills: { primary: "mowing", secondary: "none" } }; >multiRobot : MultiRobot >MultiRobot : MultiRobot >{ name: "mower", skills: { primary: "mowing", secondary: "none" } } : { name: string; skills: { primary: string; secondary: string; }; } >name : string ->"mower" : string +>"mower" : "mower" >skills : { primary: string; secondary: string; } >{ primary: "mowing", secondary: "none" } : { primary: string; secondary: string; } >primary : string ->"mowing" : string +>"mowing" : "mowing" >secondary : string ->"none" : string +>"none" : "none" function getRobot() { >getRobot : () => Robot @@ -74,10 +74,10 @@ for (let {name: nameA } = robot, i = 0; i < 1; i++) { >nameA : string >robot : Robot >i : number ->0 : number +>0 : 0 >i < 1 : boolean >i : number ->1 : number +>1 : 1 >i++ : number >i : number @@ -94,10 +94,10 @@ for (let {name: nameA } = getRobot(), i = 0; i < 1; i++) { >getRobot() : Robot >getRobot : () => Robot >i : number ->0 : number +>0 : 0 >i < 1 : boolean >i : number ->1 : number +>1 : 1 >i++ : number >i : number @@ -115,14 +115,14 @@ for (let {name: nameA } = { name: "trimmer", skill: "trimming" }, i = 0; >Robot : Robot >{ name: "trimmer", skill: "trimming" } : { name: string; skill: string; } >name : string ->"trimmer" : string +>"trimmer" : "trimmer" >skill : string ->"trimming" : string +>"trimming" : "trimming" >i : number ->0 : number +>0 : 0 >i < 1 : boolean >i : number ->1 : number +>1 : 1 >i++ : number >i : number @@ -141,10 +141,10 @@ for (let { skills: { primary: primaryA, secondary: secondaryA } } = multiRobot, >secondaryA : string >multiRobot : MultiRobot >i : number ->0 : number +>0 : 0 >i < 1 : boolean >i : number ->1 : number +>1 : 1 >i++ : number >i : number @@ -164,10 +164,10 @@ for (let { skills: { primary: primaryA, secondary: secondaryA } } = getMultiRobo >getMultiRobot() : MultiRobot >getMultiRobot : () => MultiRobot >i : number ->0 : number +>0 : 0 >i < 1 : boolean >i : number ->1 : number +>1 : 1 >i++ : number >i : number @@ -190,20 +190,20 @@ for (let { skills: { primary: primaryA, secondary: secondaryA } } = >MultiRobot : MultiRobot >{ name: "trimmer", skills: { primary: "trimming", secondary: "edging" } } : { name: string; skills: { primary: string; secondary: string; }; } >name : string ->"trimmer" : string +>"trimmer" : "trimmer" >skills : { primary: string; secondary: string; } >{ primary: "trimming", secondary: "edging" } : { primary: string; secondary: string; } >primary : string ->"trimming" : string +>"trimming" : "trimming" >secondary : string ->"edging" : string +>"edging" : "edging" i = 0; i < 1; i++) { >i : number ->0 : number +>0 : 0 >i < 1 : boolean >i : number ->1 : number +>1 : 1 >i++ : number >i : number @@ -222,10 +222,10 @@ for (let {name: nameA, skill: skillA } = robot, i = 0; i < 1; i++) { >skillA : string >robot : Robot >i : number ->0 : number +>0 : 0 >i < 1 : boolean >i : number ->1 : number +>1 : 1 >i++ : number >i : number @@ -244,10 +244,10 @@ for (let {name: nameA, skill: skillA } = getRobot(), i = 0; i < 1; i++) { >getRobot() : Robot >getRobot : () => Robot >i : number ->0 : number +>0 : 0 >i < 1 : boolean >i : number ->1 : number +>1 : 1 >i++ : number >i : number @@ -267,14 +267,14 @@ for (let {name: nameA, skill: skillA } = { name: "trimmer", skill: "trimm >Robot : Robot >{ name: "trimmer", skill: "trimming" } : { name: string; skill: string; } >name : string ->"trimmer" : string +>"trimmer" : "trimmer" >skill : string ->"trimming" : string +>"trimming" : "trimming" >i : number ->0 : number +>0 : 0 >i < 1 : boolean >i : number ->1 : number +>1 : 1 >i++ : number >i : number @@ -295,10 +295,10 @@ for (let {name: nameA, skills: { primary: primaryA, secondary: secondaryA } } = >secondaryA : string >multiRobot : MultiRobot >i : number ->0 : number +>0 : 0 >i < 1 : boolean >i : number ->1 : number +>1 : 1 >i++ : number >i : number @@ -320,10 +320,10 @@ for (let {name: nameA, skills: { primary: primaryA, secondary: secondaryA } } = >getMultiRobot() : MultiRobot >getMultiRobot : () => MultiRobot >i : number ->0 : number +>0 : 0 >i < 1 : boolean >i : number ->1 : number +>1 : 1 >i++ : number >i : number @@ -348,20 +348,20 @@ for (let {name: nameA, skills: { primary: primaryA, secondary: secondaryA } } = >MultiRobot : MultiRobot >{ name: "trimmer", skills: { primary: "trimming", secondary: "edging" } } : { name: string; skills: { primary: string; secondary: string; }; } >name : string ->"trimmer" : string +>"trimmer" : "trimmer" >skills : { primary: string; secondary: string; } >{ primary: "trimming", secondary: "edging" } : { primary: string; secondary: string; } >primary : string ->"trimming" : string +>"trimming" : "trimming" >secondary : string ->"edging" : string +>"edging" : "edging" i = 0; i < 1; i++) { >i : number ->0 : number +>0 : 0 >i < 1 : boolean >i : number ->1 : number +>1 : 1 >i++ : number >i : number diff --git a/tests/baselines/reference/sourceMapValidationDestructuringForObjectBindingPattern2.types b/tests/baselines/reference/sourceMapValidationDestructuringForObjectBindingPattern2.types index 81beb06d3d7..49ae5c61944 100644 --- a/tests/baselines/reference/sourceMapValidationDestructuringForObjectBindingPattern2.types +++ b/tests/baselines/reference/sourceMapValidationDestructuringForObjectBindingPattern2.types @@ -39,22 +39,22 @@ let robot: Robot = { name: "mower", skill: "mowing" }; >Robot : Robot >{ name: "mower", skill: "mowing" } : { name: string; skill: string; } >name : string ->"mower" : string +>"mower" : "mower" >skill : string ->"mowing" : string +>"mowing" : "mowing" let multiRobot: MultiRobot = { name: "mower", skills: { primary: "mowing", secondary: "none" } }; >multiRobot : MultiRobot >MultiRobot : MultiRobot >{ name: "mower", skills: { primary: "mowing", secondary: "none" } } : { name: string; skills: { primary: string; secondary: string; }; } >name : string ->"mower" : string +>"mower" : "mower" >skills : { primary: string; secondary: string; } >{ primary: "mowing", secondary: "none" } : { primary: string; secondary: string; } >primary : string ->"mowing" : string +>"mowing" : "mowing" >secondary : string ->"none" : string +>"none" : "none" function getRobot() { >getRobot : () => Robot @@ -83,18 +83,18 @@ let name: string, primary: string, secondary: string, skill: string; >skill : string for ({ name: nameA } = robot, i = 0; i < 1; i++) { ->{ name: nameA } = robot, i = 0 : number +>{ name: nameA } = robot, i = 0 : 0 >{ name: nameA } = robot : Robot >{ name: nameA } : { name: string; } >name : string >nameA : string >robot : Robot ->i = 0 : number +>i = 0 : 0 >i : number ->0 : number +>0 : 0 >i < 1 : boolean >i : number ->1 : number +>1 : 1 >i++ : number >i : number @@ -106,19 +106,19 @@ for ({ name: nameA } = robot, i = 0; i < 1; i++) { >nameA : string } for ({ name: nameA } = getRobot(), i = 0; i < 1; i++) { ->{ name: nameA } = getRobot(), i = 0 : number +>{ name: nameA } = getRobot(), i = 0 : 0 >{ name: nameA } = getRobot() : Robot >{ name: nameA } : { name: string; } >name : string >nameA : string >getRobot() : Robot >getRobot : () => Robot ->i = 0 : number +>i = 0 : 0 >i : number ->0 : number +>0 : 0 >i < 1 : boolean >i : number ->1 : number +>1 : 1 >i++ : number >i : number @@ -130,7 +130,7 @@ for ({ name: nameA } = getRobot(), i = 0; i < 1; i++) { >nameA : string } for ({ name: nameA } = { name: "trimmer", skill: "trimming" }, i = 0; i < 1; i++) { ->{ name: nameA } = { name: "trimmer", skill: "trimming" }, i = 0 : number +>{ name: nameA } = { name: "trimmer", skill: "trimming" }, i = 0 : 0 >{ name: nameA } = { name: "trimmer", skill: "trimming" } : Robot >{ name: nameA } : { name: string; } >name : string @@ -139,15 +139,15 @@ for ({ name: nameA } = { name: "trimmer", skill: "trimming" }, i = 0; i < >Robot : Robot >{ name: "trimmer", skill: "trimming" } : { name: string; skill: string; } >name : string ->"trimmer" : string +>"trimmer" : "trimmer" >skill : string ->"trimming" : string ->i = 0 : number +>"trimming" : "trimming" +>i = 0 : 0 >i : number ->0 : number +>0 : 0 >i < 1 : boolean >i : number ->1 : number +>1 : 1 >i++ : number >i : number @@ -159,7 +159,7 @@ for ({ name: nameA } = { name: "trimmer", skill: "trimming" }, i = 0; i < >nameA : string } for ({ skills: { primary: primaryA, secondary: secondaryA } } = multiRobot, i = 0; i < 1; i++) { ->{ skills: { primary: primaryA, secondary: secondaryA } } = multiRobot, i = 0 : number +>{ skills: { primary: primaryA, secondary: secondaryA } } = multiRobot, i = 0 : 0 >{ skills: { primary: primaryA, secondary: secondaryA } } = multiRobot : MultiRobot >{ skills: { primary: primaryA, secondary: secondaryA } } : { skills: { primary: string; secondary: string; }; } >skills : { primary: string; secondary: string; } @@ -169,12 +169,12 @@ for ({ skills: { primary: primaryA, secondary: secondaryA } } = multiRobot, i = >secondary : string >secondaryA : string >multiRobot : MultiRobot ->i = 0 : number +>i = 0 : 0 >i : number ->0 : number +>0 : 0 >i < 1 : boolean >i : number ->1 : number +>1 : 1 >i++ : number >i : number @@ -186,7 +186,7 @@ for ({ skills: { primary: primaryA, secondary: secondaryA } } = multiRobot, i = >primaryA : string } for ({ skills: { primary: primaryA, secondary: secondaryA } } = getMultiRobot(), i = 0; i < 1; i++) { ->{ skills: { primary: primaryA, secondary: secondaryA } } = getMultiRobot(), i = 0 : number +>{ skills: { primary: primaryA, secondary: secondaryA } } = getMultiRobot(), i = 0 : 0 >{ skills: { primary: primaryA, secondary: secondaryA } } = getMultiRobot() : MultiRobot >{ skills: { primary: primaryA, secondary: secondaryA } } : { skills: { primary: string; secondary: string; }; } >skills : { primary: string; secondary: string; } @@ -197,12 +197,12 @@ for ({ skills: { primary: primaryA, secondary: secondaryA } } = getMultiRobot(), >secondaryA : string >getMultiRobot() : MultiRobot >getMultiRobot : () => MultiRobot ->i = 0 : number +>i = 0 : 0 >i : number ->0 : number +>0 : 0 >i < 1 : boolean >i : number ->1 : number +>1 : 1 >i++ : number >i : number @@ -214,7 +214,7 @@ for ({ skills: { primary: primaryA, secondary: secondaryA } } = getMultiRobot(), >primaryA : string } for ({ skills: { primary: primaryA, secondary: secondaryA } } = ->{ skills: { primary: primaryA, secondary: secondaryA } } = { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }, i = 0 : number +>{ skills: { primary: primaryA, secondary: secondaryA } } = { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }, i = 0 : 0 >{ skills: { primary: primaryA, secondary: secondaryA } } = { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } } : MultiRobot >{ skills: { primary: primaryA, secondary: secondaryA } } : { skills: { primary: string; secondary: string; }; } >skills : { primary: string; secondary: string; } @@ -229,21 +229,21 @@ for ({ skills: { primary: primaryA, secondary: secondaryA } } = >MultiRobot : MultiRobot >{ name: "trimmer", skills: { primary: "trimming", secondary: "edging" } } : { name: string; skills: { primary: string; secondary: string; }; } >name : string ->"trimmer" : string +>"trimmer" : "trimmer" >skills : { primary: string; secondary: string; } >{ primary: "trimming", secondary: "edging" } : { primary: string; secondary: string; } >primary : string ->"trimming" : string +>"trimming" : "trimming" >secondary : string ->"edging" : string +>"edging" : "edging" i = 0; i < 1; i++) { ->i = 0 : number +>i = 0 : 0 >i : number ->0 : number +>0 : 0 >i < 1 : boolean >i : number ->1 : number +>1 : 1 >i++ : number >i : number @@ -255,17 +255,17 @@ for ({ skills: { primary: primaryA, secondary: secondaryA } } = >primaryA : string } for ({ name } = robot, i = 0; i < 1; i++) { ->{ name } = robot, i = 0 : number +>{ name } = robot, i = 0 : 0 >{ name } = robot : Robot >{ name } : { name: string; } >name : string >robot : Robot ->i = 0 : number +>i = 0 : 0 >i : number ->0 : number +>0 : 0 >i < 1 : boolean >i : number ->1 : number +>1 : 1 >i++ : number >i : number @@ -277,18 +277,18 @@ for ({ name } = robot, i = 0; i < 1; i++) { >nameA : string } for ({ name } = getRobot(), i = 0; i < 1; i++) { ->{ name } = getRobot(), i = 0 : number +>{ name } = getRobot(), i = 0 : 0 >{ name } = getRobot() : Robot >{ name } : { name: string; } >name : string >getRobot() : Robot >getRobot : () => Robot ->i = 0 : number +>i = 0 : 0 >i : number ->0 : number +>0 : 0 >i < 1 : boolean >i : number ->1 : number +>1 : 1 >i++ : number >i : number @@ -300,7 +300,7 @@ for ({ name } = getRobot(), i = 0; i < 1; i++) { >nameA : string } for ({ name } = { name: "trimmer", skill: "trimming" }, i = 0; i < 1; i++) { ->{ name } = { name: "trimmer", skill: "trimming" }, i = 0 : number +>{ name } = { name: "trimmer", skill: "trimming" }, i = 0 : 0 >{ name } = { name: "trimmer", skill: "trimming" } : Robot >{ name } : { name: string; } >name : string @@ -308,15 +308,15 @@ for ({ name } = { name: "trimmer", skill: "trimming" }, i = 0; i < 1; i++ >Robot : Robot >{ name: "trimmer", skill: "trimming" } : { name: string; skill: string; } >name : string ->"trimmer" : string +>"trimmer" : "trimmer" >skill : string ->"trimming" : string ->i = 0 : number +>"trimming" : "trimming" +>i = 0 : 0 >i : number ->0 : number +>0 : 0 >i < 1 : boolean >i : number ->1 : number +>1 : 1 >i++ : number >i : number @@ -328,7 +328,7 @@ for ({ name } = { name: "trimmer", skill: "trimming" }, i = 0; i < 1; i++ >nameA : string } for ({ skills: { primary, secondary } } = multiRobot, i = 0; i < 1; i++) { ->{ skills: { primary, secondary } } = multiRobot, i = 0 : number +>{ skills: { primary, secondary } } = multiRobot, i = 0 : 0 >{ skills: { primary, secondary } } = multiRobot : MultiRobot >{ skills: { primary, secondary } } : { skills: { primary: string; secondary: string; }; } >skills : { primary: string; secondary: string; } @@ -336,12 +336,12 @@ for ({ skills: { primary, secondary } } = multiRobot, i = 0; i < 1; i++) { >primary : string >secondary : string >multiRobot : MultiRobot ->i = 0 : number +>i = 0 : 0 >i : number ->0 : number +>0 : 0 >i < 1 : boolean >i : number ->1 : number +>1 : 1 >i++ : number >i : number @@ -353,7 +353,7 @@ for ({ skills: { primary, secondary } } = multiRobot, i = 0; i < 1; i++) { >primaryA : string } for ({ skills: { primary, secondary } } = getMultiRobot(), i = 0; i < 1; i++) { ->{ skills: { primary, secondary } } = getMultiRobot(), i = 0 : number +>{ skills: { primary, secondary } } = getMultiRobot(), i = 0 : 0 >{ skills: { primary, secondary } } = getMultiRobot() : MultiRobot >{ skills: { primary, secondary } } : { skills: { primary: string; secondary: string; }; } >skills : { primary: string; secondary: string; } @@ -362,12 +362,12 @@ for ({ skills: { primary, secondary } } = getMultiRobot(), i = 0; i < 1; i++) { >secondary : string >getMultiRobot() : MultiRobot >getMultiRobot : () => MultiRobot ->i = 0 : number +>i = 0 : 0 >i : number ->0 : number +>0 : 0 >i < 1 : boolean >i : number ->1 : number +>1 : 1 >i++ : number >i : number @@ -379,7 +379,7 @@ for ({ skills: { primary, secondary } } = getMultiRobot(), i = 0; i < 1; i++) { >primaryA : string } for ({ skills: { primary, secondary } } = ->{ skills: { primary, secondary } } = { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }, i = 0 : number +>{ skills: { primary, secondary } } = { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }, i = 0 : 0 >{ skills: { primary, secondary } } = { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } } : MultiRobot >{ skills: { primary, secondary } } : { skills: { primary: string; secondary: string; }; } >skills : { primary: string; secondary: string; } @@ -392,21 +392,21 @@ for ({ skills: { primary, secondary } } = >MultiRobot : MultiRobot >{ name: "trimmer", skills: { primary: "trimming", secondary: "edging" } } : { name: string; skills: { primary: string; secondary: string; }; } >name : string ->"trimmer" : string +>"trimmer" : "trimmer" >skills : { primary: string; secondary: string; } >{ primary: "trimming", secondary: "edging" } : { primary: string; secondary: string; } >primary : string ->"trimming" : string +>"trimming" : "trimming" >secondary : string ->"edging" : string +>"edging" : "edging" i = 0; i < 1; i++) { ->i = 0 : number +>i = 0 : 0 >i : number ->0 : number +>0 : 0 >i < 1 : boolean >i : number ->1 : number +>1 : 1 >i++ : number >i : number @@ -420,7 +420,7 @@ for ({ skills: { primary, secondary } } = for ({ name: nameA, skill: skillA } = robot, i = 0; i < 1; i++) { ->{ name: nameA, skill: skillA } = robot, i = 0 : number +>{ name: nameA, skill: skillA } = robot, i = 0 : 0 >{ name: nameA, skill: skillA } = robot : Robot >{ name: nameA, skill: skillA } : { name: string; skill: string; } >name : string @@ -428,12 +428,12 @@ for ({ name: nameA, skill: skillA } = robot, i = 0; i < 1; i++) { >skill : string >skillA : string >robot : Robot ->i = 0 : number +>i = 0 : 0 >i : number ->0 : number +>0 : 0 >i < 1 : boolean >i : number ->1 : number +>1 : 1 >i++ : number >i : number @@ -445,7 +445,7 @@ for ({ name: nameA, skill: skillA } = robot, i = 0; i < 1; i++) { >nameA : string } for ({ name: nameA, skill: skillA } = getRobot(), i = 0; i < 1; i++) { ->{ name: nameA, skill: skillA } = getRobot(), i = 0 : number +>{ name: nameA, skill: skillA } = getRobot(), i = 0 : 0 >{ name: nameA, skill: skillA } = getRobot() : Robot >{ name: nameA, skill: skillA } : { name: string; skill: string; } >name : string @@ -454,12 +454,12 @@ for ({ name: nameA, skill: skillA } = getRobot(), i = 0; i < 1; i++) { >skillA : string >getRobot() : Robot >getRobot : () => Robot ->i = 0 : number +>i = 0 : 0 >i : number ->0 : number +>0 : 0 >i < 1 : boolean >i : number ->1 : number +>1 : 1 >i++ : number >i : number @@ -471,7 +471,7 @@ for ({ name: nameA, skill: skillA } = getRobot(), i = 0; i < 1; i++) { >nameA : string } for ({ name: nameA, skill: skillA } = { name: "trimmer", skill: "trimming" }, i = 0; i < 1; i++) { ->{ name: nameA, skill: skillA } = { name: "trimmer", skill: "trimming" }, i = 0 : number +>{ name: nameA, skill: skillA } = { name: "trimmer", skill: "trimming" }, i = 0 : 0 >{ name: nameA, skill: skillA } = { name: "trimmer", skill: "trimming" } : Robot >{ name: nameA, skill: skillA } : { name: string; skill: string; } >name : string @@ -482,15 +482,15 @@ for ({ name: nameA, skill: skillA } = { name: "trimmer", skill: "trimming >Robot : Robot >{ name: "trimmer", skill: "trimming" } : { name: string; skill: string; } >name : string ->"trimmer" : string +>"trimmer" : "trimmer" >skill : string ->"trimming" : string ->i = 0 : number +>"trimming" : "trimming" +>i = 0 : 0 >i : number ->0 : number +>0 : 0 >i < 1 : boolean >i : number ->1 : number +>1 : 1 >i++ : number >i : number @@ -502,7 +502,7 @@ for ({ name: nameA, skill: skillA } = { name: "trimmer", skill: "trimming >nameA : string } for ({ name: nameA, skills: { primary: primaryA, secondary: secondaryA } } = multiRobot, i = 0; i < 1; i++) { ->{ name: nameA, skills: { primary: primaryA, secondary: secondaryA } } = multiRobot, i = 0 : number +>{ name: nameA, skills: { primary: primaryA, secondary: secondaryA } } = multiRobot, i = 0 : 0 >{ name: nameA, skills: { primary: primaryA, secondary: secondaryA } } = multiRobot : MultiRobot >{ name: nameA, skills: { primary: primaryA, secondary: secondaryA } } : { name: string; skills: { primary: string; secondary: string; }; } >name : string @@ -514,12 +514,12 @@ for ({ name: nameA, skills: { primary: primaryA, secondary: secondaryA } } = mul >secondary : string >secondaryA : string >multiRobot : MultiRobot ->i = 0 : number +>i = 0 : 0 >i : number ->0 : number +>0 : 0 >i < 1 : boolean >i : number ->1 : number +>1 : 1 >i++ : number >i : number @@ -531,7 +531,7 @@ for ({ name: nameA, skills: { primary: primaryA, secondary: secondaryA } } = mul >primaryA : string } for ({ name: nameA, skills: { primary: primaryA, secondary: secondaryA } } = getMultiRobot(), i = 0; i < 1; i++) { ->{ name: nameA, skills: { primary: primaryA, secondary: secondaryA } } = getMultiRobot(), i = 0 : number +>{ name: nameA, skills: { primary: primaryA, secondary: secondaryA } } = getMultiRobot(), i = 0 : 0 >{ name: nameA, skills: { primary: primaryA, secondary: secondaryA } } = getMultiRobot() : MultiRobot >{ name: nameA, skills: { primary: primaryA, secondary: secondaryA } } : { name: string; skills: { primary: string; secondary: string; }; } >name : string @@ -544,12 +544,12 @@ for ({ name: nameA, skills: { primary: primaryA, secondary: secondaryA } } = get >secondaryA : string >getMultiRobot() : MultiRobot >getMultiRobot : () => MultiRobot ->i = 0 : number +>i = 0 : 0 >i : number ->0 : number +>0 : 0 >i < 1 : boolean >i : number ->1 : number +>1 : 1 >i++ : number >i : number @@ -561,7 +561,7 @@ for ({ name: nameA, skills: { primary: primaryA, secondary: secondaryA } } = get >primaryA : string } for ({ name: nameA, skills: { primary: primaryA, secondary: secondaryA } } = ->{ name: nameA, skills: { primary: primaryA, secondary: secondaryA } } = { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }, i = 0 : number +>{ name: nameA, skills: { primary: primaryA, secondary: secondaryA } } = { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }, i = 0 : 0 >{ name: nameA, skills: { primary: primaryA, secondary: secondaryA } } = { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } } : MultiRobot >{ name: nameA, skills: { primary: primaryA, secondary: secondaryA } } : { name: string; skills: { primary: string; secondary: string; }; } >name : string @@ -578,21 +578,21 @@ for ({ name: nameA, skills: { primary: primaryA, secondary: secondaryA } } = >MultiRobot : MultiRobot >{ name: "trimmer", skills: { primary: "trimming", secondary: "edging" } } : { name: string; skills: { primary: string; secondary: string; }; } >name : string ->"trimmer" : string +>"trimmer" : "trimmer" >skills : { primary: string; secondary: string; } >{ primary: "trimming", secondary: "edging" } : { primary: string; secondary: string; } >primary : string ->"trimming" : string +>"trimming" : "trimming" >secondary : string ->"edging" : string +>"edging" : "edging" i = 0; i < 1; i++) { ->i = 0 : number +>i = 0 : 0 >i : number ->0 : number +>0 : 0 >i < 1 : boolean >i : number ->1 : number +>1 : 1 >i++ : number >i : number @@ -604,18 +604,18 @@ for ({ name: nameA, skills: { primary: primaryA, secondary: secondaryA } } = >primaryA : string } for ({ name, skill } = robot, i = 0; i < 1; i++) { ->{ name, skill } = robot, i = 0 : number +>{ name, skill } = robot, i = 0 : 0 >{ name, skill } = robot : Robot >{ name, skill } : { name: string; skill: string; } >name : string >skill : string >robot : Robot ->i = 0 : number +>i = 0 : 0 >i : number ->0 : number +>0 : 0 >i < 1 : boolean >i : number ->1 : number +>1 : 1 >i++ : number >i : number @@ -627,19 +627,19 @@ for ({ name, skill } = robot, i = 0; i < 1; i++) { >nameA : string } for ({ name, skill } = getRobot(), i = 0; i < 1; i++) { ->{ name, skill } = getRobot(), i = 0 : number +>{ name, skill } = getRobot(), i = 0 : 0 >{ name, skill } = getRobot() : Robot >{ name, skill } : { name: string; skill: string; } >name : string >skill : string >getRobot() : Robot >getRobot : () => Robot ->i = 0 : number +>i = 0 : 0 >i : number ->0 : number +>0 : 0 >i < 1 : boolean >i : number ->1 : number +>1 : 1 >i++ : number >i : number @@ -651,7 +651,7 @@ for ({ name, skill } = getRobot(), i = 0; i < 1; i++) { >nameA : string } for ({ name, skill } = { name: "trimmer", skill: "trimming" }, i = 0; i < 1; i++) { ->{ name, skill } = { name: "trimmer", skill: "trimming" }, i = 0 : number +>{ name, skill } = { name: "trimmer", skill: "trimming" }, i = 0 : 0 >{ name, skill } = { name: "trimmer", skill: "trimming" } : Robot >{ name, skill } : { name: string; skill: string; } >name : string @@ -660,15 +660,15 @@ for ({ name, skill } = { name: "trimmer", skill: "trimming" }, i = 0; i < >Robot : Robot >{ name: "trimmer", skill: "trimming" } : { name: string; skill: string; } >name : string ->"trimmer" : string +>"trimmer" : "trimmer" >skill : string ->"trimming" : string ->i = 0 : number +>"trimming" : "trimming" +>i = 0 : 0 >i : number ->0 : number +>0 : 0 >i < 1 : boolean >i : number ->1 : number +>1 : 1 >i++ : number >i : number @@ -680,7 +680,7 @@ for ({ name, skill } = { name: "trimmer", skill: "trimming" }, i = 0; i < >nameA : string } for ({ name, skills: { primary, secondary } } = multiRobot, i = 0; i < 1; i++) { ->{ name, skills: { primary, secondary } } = multiRobot, i = 0 : number +>{ name, skills: { primary, secondary } } = multiRobot, i = 0 : 0 >{ name, skills: { primary, secondary } } = multiRobot : MultiRobot >{ name, skills: { primary, secondary } } : { name: string; skills: { primary: string; secondary: string; }; } >name : string @@ -689,12 +689,12 @@ for ({ name, skills: { primary, secondary } } = multiRobot, i = 0; i < 1; i++) { >primary : string >secondary : string >multiRobot : MultiRobot ->i = 0 : number +>i = 0 : 0 >i : number ->0 : number +>0 : 0 >i < 1 : boolean >i : number ->1 : number +>1 : 1 >i++ : number >i : number @@ -706,7 +706,7 @@ for ({ name, skills: { primary, secondary } } = multiRobot, i = 0; i < 1; i++) { >primaryA : string } for ({ name, skills: { primary, secondary } } = getMultiRobot(), i = 0; i < 1; i++) { ->{ name, skills: { primary, secondary } } = getMultiRobot(), i = 0 : number +>{ name, skills: { primary, secondary } } = getMultiRobot(), i = 0 : 0 >{ name, skills: { primary, secondary } } = getMultiRobot() : MultiRobot >{ name, skills: { primary, secondary } } : { name: string; skills: { primary: string; secondary: string; }; } >name : string @@ -716,12 +716,12 @@ for ({ name, skills: { primary, secondary } } = getMultiRobot(), i = 0; i < 1; i >secondary : string >getMultiRobot() : MultiRobot >getMultiRobot : () => MultiRobot ->i = 0 : number +>i = 0 : 0 >i : number ->0 : number +>0 : 0 >i < 1 : boolean >i : number ->1 : number +>1 : 1 >i++ : number >i : number @@ -733,7 +733,7 @@ for ({ name, skills: { primary, secondary } } = getMultiRobot(), i = 0; i < 1; i >primaryA : string } for ({ name, skills: { primary, secondary } } = ->{ name, skills: { primary, secondary } } = { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }, i = 0 : number +>{ name, skills: { primary, secondary } } = { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }, i = 0 : 0 >{ name, skills: { primary, secondary } } = { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } } : MultiRobot >{ name, skills: { primary, secondary } } : { name: string; skills: { primary: string; secondary: string; }; } >name : string @@ -747,21 +747,21 @@ for ({ name, skills: { primary, secondary } } = >MultiRobot : MultiRobot >{ name: "trimmer", skills: { primary: "trimming", secondary: "edging" } } : { name: string; skills: { primary: string; secondary: string; }; } >name : string ->"trimmer" : string +>"trimmer" : "trimmer" >skills : { primary: string; secondary: string; } >{ primary: "trimming", secondary: "edging" } : { primary: string; secondary: string; } >primary : string ->"trimming" : string +>"trimming" : "trimming" >secondary : string ->"edging" : string +>"edging" : "edging" i = 0; i < 1; i++) { ->i = 0 : number +>i = 0 : 0 >i : number ->0 : number +>0 : 0 >i < 1 : boolean >i : number ->1 : number +>1 : 1 >i++ : number >i : number diff --git a/tests/baselines/reference/sourceMapValidationDestructuringForObjectBindingPatternDefaultValues.types b/tests/baselines/reference/sourceMapValidationDestructuringForObjectBindingPatternDefaultValues.types index c9e76f88581..261ccd36396 100644 --- a/tests/baselines/reference/sourceMapValidationDestructuringForObjectBindingPatternDefaultValues.types +++ b/tests/baselines/reference/sourceMapValidationDestructuringForObjectBindingPatternDefaultValues.types @@ -39,22 +39,22 @@ let robot: Robot = { name: "mower", skill: "mowing" }; >Robot : Robot >{ name: "mower", skill: "mowing" } : { name: string; skill: string; } >name : string ->"mower" : string +>"mower" : "mower" >skill : string ->"mowing" : string +>"mowing" : "mowing" let multiRobot: MultiRobot = { name: "mower", skills: { primary: "mowing", secondary: "none" } }; >multiRobot : MultiRobot >MultiRobot : MultiRobot >{ name: "mower", skills: { primary: "mowing", secondary: "none" } } : { name: string; skills: { primary: string; secondary: string; }; } >name : string ->"mower" : string +>"mower" : "mower" >skills : { primary: string; secondary: string; } >{ primary: "mowing", secondary: "none" } : { primary: string; secondary: string; } >primary : string ->"mowing" : string +>"mowing" : "mowing" >secondary : string ->"none" : string +>"none" : "none" function getRobot() { >getRobot : () => Robot @@ -72,13 +72,13 @@ function getMultiRobot() { for (let {name: nameA= "noName" } = robot, i = 0; i < 1; i++) { >name : any >nameA : string ->"noName" : string +>"noName" : "noName" >robot : Robot >i : number ->0 : number +>0 : 0 >i < 1 : boolean >i : number ->1 : number +>1 : 1 >i++ : number >i : number @@ -92,14 +92,14 @@ for (let {name: nameA= "noName" } = robot, i = 0; i < 1; i++) { for (let {name: nameA = "noName" } = getRobot(), i = 0; i < 1; i++) { >name : any >nameA : string ->"noName" : string +>"noName" : "noName" >getRobot() : Robot >getRobot : () => Robot >i : number ->0 : number +>0 : 0 >i < 1 : boolean >i : number ->1 : number +>1 : 1 >i++ : number >i : number @@ -113,19 +113,19 @@ for (let {name: nameA = "noName" } = getRobot(), i = 0; i < 1; i++) { for (let {name: nameA = "noName" } = { name: "trimmer", skill: "trimming" }, i = 0; i < 1; i++) { >name : any >nameA : string ->"noName" : string +>"noName" : "noName" >{ name: "trimmer", skill: "trimming" } : Robot >Robot : Robot >{ name: "trimmer", skill: "trimming" } : { name: string; skill: string; } >name : string ->"trimmer" : string +>"trimmer" : "trimmer" >skill : string ->"trimming" : string +>"trimming" : "trimming" >i : number ->0 : number +>0 : 0 >i < 1 : boolean >i : number ->1 : number +>1 : 1 >i++ : number >i : number @@ -143,27 +143,27 @@ for (let { primary: primaryA = "primary", >primary : any >primaryA : string ->"primary" : string +>"primary" : "primary" secondary: secondaryA = "secondary" >secondary : any >secondaryA : string ->"secondary" : string +>"secondary" : "secondary" } = { primary: "none", secondary: "none" } >{ primary: "none", secondary: "none" } : { primary?: string; secondary?: string; } >primary : string ->"none" : string +>"none" : "none" >secondary : string ->"none" : string +>"none" : "none" } = multiRobot, i = 0; i < 1; i++) { >multiRobot : MultiRobot >i : number ->0 : number +>0 : 0 >i < 1 : boolean >i : number ->1 : number +>1 : 1 >i++ : number >i : number @@ -181,28 +181,28 @@ for (let { primary: primaryA = "primary", >primary : any >primaryA : string ->"primary" : string +>"primary" : "primary" secondary: secondaryA = "secondary" >secondary : any >secondaryA : string ->"secondary" : string +>"secondary" : "secondary" } = { primary: "none", secondary: "none" } >{ primary: "none", secondary: "none" } : { primary?: string; secondary?: string; } >primary : string ->"none" : string +>"none" : "none" >secondary : string ->"none" : string +>"none" : "none" } = getMultiRobot(), i = 0; i < 1; i++) { >getMultiRobot() : MultiRobot >getMultiRobot : () => MultiRobot >i : number ->0 : number +>0 : 0 >i < 1 : boolean >i : number ->1 : number +>1 : 1 >i++ : number >i : number @@ -220,39 +220,39 @@ for (let { primary: primaryA = "primary", >primary : any >primaryA : string ->"primary" : string +>"primary" : "primary" secondary: secondaryA = "secondary" >secondary : any >secondaryA : string ->"secondary" : string +>"secondary" : "secondary" } = { primary: "none", secondary: "none" } >{ primary: "none", secondary: "none" } : { primary?: string; secondary?: string; } >primary : string ->"none" : string +>"none" : "none" >secondary : string ->"none" : string +>"none" : "none" } = { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }, >{ name: "trimmer", skills: { primary: "trimming", secondary: "edging" } } : MultiRobot >MultiRobot : MultiRobot >{ name: "trimmer", skills: { primary: "trimming", secondary: "edging" } } : { name: string; skills: { primary: string; secondary: string; }; } >name : string ->"trimmer" : string +>"trimmer" : "trimmer" >skills : { primary: string; secondary: string; } >{ primary: "trimming", secondary: "edging" } : { primary: string; secondary: string; } >primary : string ->"trimming" : string +>"trimming" : "trimming" >secondary : string ->"edging" : string +>"edging" : "edging" i = 0; i < 1; i++) { >i : number ->0 : number +>0 : 0 >i < 1 : boolean >i : number ->1 : number +>1 : 1 >i++ : number >i : number @@ -267,16 +267,16 @@ for (let { for (let {name: nameA = "noName", skill: skillA = "skill" } = robot, i = 0; i < 1; i++) { >name : any >nameA : string ->"noName" : string +>"noName" : "noName" >skill : any >skillA : string ->"skill" : string +>"skill" : "skill" >robot : Robot >i : number ->0 : number +>0 : 0 >i < 1 : boolean >i : number ->1 : number +>1 : 1 >i++ : number >i : number @@ -290,17 +290,17 @@ for (let {name: nameA = "noName", skill: skillA = "skill" } = robot, i = 0; i < for (let {name: nameA = "noName", skill: skillA = "skill" } = getRobot(), i = 0; i < 1; i++) { >name : any >nameA : string ->"noName" : string +>"noName" : "noName" >skill : any >skillA : string ->"skill" : string +>"skill" : "skill" >getRobot() : Robot >getRobot : () => Robot >i : number ->0 : number +>0 : 0 >i < 1 : boolean >i : number ->1 : number +>1 : 1 >i++ : number >i : number @@ -314,22 +314,22 @@ for (let {name: nameA = "noName", skill: skillA = "skill" } = getRobot(), i = 0; for (let {name: nameA = "noName", skill: skillA = "skill" } = { name: "trimmer", skill: "trimming" }, i = 0; i < 1; i++) { >name : any >nameA : string ->"noName" : string +>"noName" : "noName" >skill : any >skillA : string ->"skill" : string +>"skill" : "skill" >{ name: "trimmer", skill: "trimming" } : Robot >Robot : Robot >{ name: "trimmer", skill: "trimming" } : { name: string; skill: string; } >name : string ->"trimmer" : string +>"trimmer" : "trimmer" >skill : string ->"trimming" : string +>"trimming" : "trimming" >i : number ->0 : number +>0 : 0 >i < 1 : boolean >i : number ->1 : number +>1 : 1 >i++ : number >i : number @@ -344,7 +344,7 @@ for (let { name: nameA = "noName", >name : any >nameA : string ->"noName" : string +>"noName" : "noName" skills: { >skills : any @@ -352,27 +352,27 @@ for (let { primary: primaryA = "primary", >primary : any >primaryA : string ->"primary" : string +>"primary" : "primary" secondary: secondaryA = "secondary" >secondary : any >secondaryA : string ->"secondary" : string +>"secondary" : "secondary" } = { primary: "none", secondary: "none" } >{ primary: "none", secondary: "none" } : { primary?: string; secondary?: string; } >primary : string ->"none" : string +>"none" : "none" >secondary : string ->"none" : string +>"none" : "none" } = multiRobot, i = 0; i < 1; i++) { >multiRobot : MultiRobot >i : number ->0 : number +>0 : 0 >i < 1 : boolean >i : number ->1 : number +>1 : 1 >i++ : number >i : number @@ -387,7 +387,7 @@ for (let { name: nameA = "noName", >name : any >nameA : string ->"noName" : string +>"noName" : "noName" skills: { >skills : any @@ -395,28 +395,28 @@ for (let { primary: primaryA = "primary", >primary : any >primaryA : string ->"primary" : string +>"primary" : "primary" secondary: secondaryA = "secondary" >secondary : any >secondaryA : string ->"secondary" : string +>"secondary" : "secondary" } = { primary: "none", secondary: "none" } >{ primary: "none", secondary: "none" } : { primary?: string; secondary?: string; } >primary : string ->"none" : string +>"none" : "none" >secondary : string ->"none" : string +>"none" : "none" } = getMultiRobot(), i = 0; i < 1; i++) { >getMultiRobot() : MultiRobot >getMultiRobot : () => MultiRobot >i : number ->0 : number +>0 : 0 >i < 1 : boolean >i : number ->1 : number +>1 : 1 >i++ : number >i : number @@ -431,7 +431,7 @@ for (let { name: nameA = "noName", >name : any >nameA : string ->"noName" : string +>"noName" : "noName" skills: { >skills : any @@ -439,39 +439,39 @@ for (let { primary: primaryA = "primary", >primary : any >primaryA : string ->"primary" : string +>"primary" : "primary" secondary: secondaryA = "secondary" >secondary : any >secondaryA : string ->"secondary" : string +>"secondary" : "secondary" } = { primary: "none", secondary: "none" } >{ primary: "none", secondary: "none" } : { primary?: string; secondary?: string; } >primary : string ->"none" : string +>"none" : "none" >secondary : string ->"none" : string +>"none" : "none" } = { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }, >{ name: "trimmer", skills: { primary: "trimming", secondary: "edging" } } : MultiRobot >MultiRobot : MultiRobot >{ name: "trimmer", skills: { primary: "trimming", secondary: "edging" } } : { name: string; skills: { primary: string; secondary: string; }; } >name : string ->"trimmer" : string +>"trimmer" : "trimmer" >skills : { primary: string; secondary: string; } >{ primary: "trimming", secondary: "edging" } : { primary: string; secondary: string; } >primary : string ->"trimming" : string +>"trimming" : "trimming" >secondary : string ->"edging" : string +>"edging" : "edging" i = 0; i < 1; i++) { >i : number ->0 : number +>0 : 0 >i < 1 : boolean >i : number ->1 : number +>1 : 1 >i++ : number >i : number diff --git a/tests/baselines/reference/sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.types b/tests/baselines/reference/sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.types index aa8c95bae01..c5f2c806def 100644 --- a/tests/baselines/reference/sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.types +++ b/tests/baselines/reference/sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.types @@ -39,22 +39,22 @@ let robot: Robot = { name: "mower", skill: "mowing" }; >Robot : Robot >{ name: "mower", skill: "mowing" } : { name: string; skill: string; } >name : string ->"mower" : string +>"mower" : "mower" >skill : string ->"mowing" : string +>"mowing" : "mowing" let multiRobot: MultiRobot = { name: "mower", skills: { primary: "mowing", secondary: "none" } }; >multiRobot : MultiRobot >MultiRobot : MultiRobot >{ name: "mower", skills: { primary: "mowing", secondary: "none" } } : { name: string; skills: { primary: string; secondary: string; }; } >name : string ->"mower" : string +>"mower" : "mower" >skills : { primary: string; secondary: string; } >{ primary: "mowing", secondary: "none" } : { primary: string; secondary: string; } >primary : string ->"mowing" : string +>"mowing" : "mowing" >secondary : string ->"none" : string +>"none" : "none" function getRobot() { >getRobot : () => Robot @@ -83,20 +83,20 @@ let name: string, primary: string, secondary: string, skill: string; >skill : string for ({name: nameA = "noName" } = robot, i = 0; i < 1; i++) { ->{name: nameA = "noName" } = robot, i = 0 : number +>{name: nameA = "noName" } = robot, i = 0 : 0 >{name: nameA = "noName" } = robot : Robot >{name: nameA = "noName" } : { name?: string; } >name : string ->nameA = "noName" : string +>nameA = "noName" : "noName" >nameA : string ->"noName" : string +>"noName" : "noName" >robot : Robot ->i = 0 : number +>i = 0 : 0 >i : number ->0 : number +>0 : 0 >i < 1 : boolean >i : number ->1 : number +>1 : 1 >i++ : number >i : number @@ -108,21 +108,21 @@ for ({name: nameA = "noName" } = robot, i = 0; i < 1; i++) { >nameA : string } for ({name: nameA = "noName" } = getRobot(), i = 0; i < 1; i++) { ->{name: nameA = "noName" } = getRobot(), i = 0 : number +>{name: nameA = "noName" } = getRobot(), i = 0 : 0 >{name: nameA = "noName" } = getRobot() : Robot >{name: nameA = "noName" } : { name?: string; } >name : string ->nameA = "noName" : string +>nameA = "noName" : "noName" >nameA : string ->"noName" : string +>"noName" : "noName" >getRobot() : Robot >getRobot : () => Robot ->i = 0 : number +>i = 0 : 0 >i : number ->0 : number +>0 : 0 >i < 1 : boolean >i : number ->1 : number +>1 : 1 >i++ : number >i : number @@ -134,26 +134,26 @@ for ({name: nameA = "noName" } = getRobot(), i = 0; i < 1; i++) { >nameA : string } for ({name: nameA = "noName" } = { name: "trimmer", skill: "trimming" }, i = 0; i < 1; i++) { ->{name: nameA = "noName" } = { name: "trimmer", skill: "trimming" }, i = 0 : number +>{name: nameA = "noName" } = { name: "trimmer", skill: "trimming" }, i = 0 : 0 >{name: nameA = "noName" } = { name: "trimmer", skill: "trimming" } : Robot >{name: nameA = "noName" } : { name?: string; } >name : string ->nameA = "noName" : string +>nameA = "noName" : "noName" >nameA : string ->"noName" : string +>"noName" : "noName" >{ name: "trimmer", skill: "trimming" } : Robot >Robot : Robot >{ name: "trimmer", skill: "trimming" } : { name: string; skill: string; } >name : string ->"trimmer" : string +>"trimmer" : "trimmer" >skill : string ->"trimming" : string ->i = 0 : number +>"trimming" : "trimming" +>i = 0 : 0 >i : number ->0 : number +>0 : 0 >i < 1 : boolean >i : number ->1 : number +>1 : 1 >i++ : number >i : number @@ -165,7 +165,7 @@ for ({name: nameA = "noName" } = { name: "trimmer", skill: "trimming" }, >nameA : string } for ({ ->{ skills: { primary: primaryA = "primary", secondary: secondaryA = "secondary" } = { primary: "none", secondary: "none" }} = multiRobot, i = 0 : number +>{ skills: { primary: primaryA = "primary", secondary: secondaryA = "secondary" } = { primary: "none", secondary: "none" }} = multiRobot, i = 0 : 0 >{ skills: { primary: primaryA = "primary", secondary: secondaryA = "secondary" } = { primary: "none", secondary: "none" }} = multiRobot : MultiRobot >{ skills: { primary: primaryA = "primary", secondary: secondaryA = "secondary" } = { primary: "none", secondary: "none" }} : { skills?: { primary?: string; secondary?: string; }; } @@ -176,31 +176,31 @@ for ({ primary: primaryA = "primary", >primary : string ->primaryA = "primary" : string +>primaryA = "primary" : "primary" >primaryA : string ->"primary" : string +>"primary" : "primary" secondary: secondaryA = "secondary" >secondary : string ->secondaryA = "secondary" : string +>secondaryA = "secondary" : "secondary" >secondaryA : string ->"secondary" : string +>"secondary" : "secondary" } = { primary: "none", secondary: "none" } >{ primary: "none", secondary: "none" } : { primary?: string; secondary?: string; } >primary : string ->"none" : string +>"none" : "none" >secondary : string ->"none" : string +>"none" : "none" } = multiRobot, i = 0; i < 1; i++) { >multiRobot : MultiRobot ->i = 0 : number +>i = 0 : 0 >i : number ->0 : number +>0 : 0 >i < 1 : boolean >i : number ->1 : number +>1 : 1 >i++ : number >i : number @@ -212,7 +212,7 @@ for ({ >primaryA : string } for ({ ->{ skills: { primary: primaryA = "primary", secondary: secondaryA = "secondary" } = { primary: "none", secondary: "none" }} = getMultiRobot(), i = 0 : number +>{ skills: { primary: primaryA = "primary", secondary: secondaryA = "secondary" } = { primary: "none", secondary: "none" }} = getMultiRobot(), i = 0 : 0 >{ skills: { primary: primaryA = "primary", secondary: secondaryA = "secondary" } = { primary: "none", secondary: "none" }} = getMultiRobot() : MultiRobot >{ skills: { primary: primaryA = "primary", secondary: secondaryA = "secondary" } = { primary: "none", secondary: "none" }} : { skills?: { primary?: string; secondary?: string; }; } @@ -223,32 +223,32 @@ for ({ primary: primaryA = "primary", >primary : string ->primaryA = "primary" : string +>primaryA = "primary" : "primary" >primaryA : string ->"primary" : string +>"primary" : "primary" secondary: secondaryA = "secondary" >secondary : string ->secondaryA = "secondary" : string +>secondaryA = "secondary" : "secondary" >secondaryA : string ->"secondary" : string +>"secondary" : "secondary" } = { primary: "none", secondary: "none" } >{ primary: "none", secondary: "none" } : { primary?: string; secondary?: string; } >primary : string ->"none" : string +>"none" : "none" >secondary : string ->"none" : string +>"none" : "none" } = getMultiRobot(), i = 0; i < 1; i++) { >getMultiRobot() : MultiRobot >getMultiRobot : () => MultiRobot ->i = 0 : number +>i = 0 : 0 >i : number ->0 : number +>0 : 0 >i < 1 : boolean >i : number ->1 : number +>1 : 1 >i++ : number >i : number @@ -260,7 +260,7 @@ for ({ >primaryA : string } for ({ ->{ skills: { primary: primaryA = "primary", secondary: secondaryA = "secondary" } = { primary: "none", secondary: "none" }} = { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }, i = 0 : number +>{ skills: { primary: primaryA = "primary", secondary: secondaryA = "secondary" } = { primary: "none", secondary: "none" }} = { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }, i = 0 : 0 >{ skills: { primary: primaryA = "primary", secondary: secondaryA = "secondary" } = { primary: "none", secondary: "none" }} = { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } } : MultiRobot >{ skills: { primary: primaryA = "primary", secondary: secondaryA = "secondary" } = { primary: "none", secondary: "none" }} : { skills?: { primary?: string; secondary?: string; }; } @@ -271,43 +271,43 @@ for ({ primary: primaryA = "primary", >primary : string ->primaryA = "primary" : string +>primaryA = "primary" : "primary" >primaryA : string ->"primary" : string +>"primary" : "primary" secondary: secondaryA = "secondary" >secondary : string ->secondaryA = "secondary" : string +>secondaryA = "secondary" : "secondary" >secondaryA : string ->"secondary" : string +>"secondary" : "secondary" } = { primary: "none", secondary: "none" } >{ primary: "none", secondary: "none" } : { primary?: string; secondary?: string; } >primary : string ->"none" : string +>"none" : "none" >secondary : string ->"none" : string +>"none" : "none" } = { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }, >{ name: "trimmer", skills: { primary: "trimming", secondary: "edging" } } : MultiRobot >MultiRobot : MultiRobot >{ name: "trimmer", skills: { primary: "trimming", secondary: "edging" } } : { name: string; skills: { primary: string; secondary: string; }; } >name : string ->"trimmer" : string +>"trimmer" : "trimmer" >skills : { primary: string; secondary: string; } >{ primary: "trimming", secondary: "edging" } : { primary: string; secondary: string; } >primary : string ->"trimming" : string +>"trimming" : "trimming" >secondary : string ->"edging" : string +>"edging" : "edging" i = 0; i < 1; i++) { ->i = 0 : number +>i = 0 : 0 >i : number ->0 : number +>0 : 0 >i < 1 : boolean >i : number ->1 : number +>1 : 1 >i++ : number >i : number @@ -320,17 +320,17 @@ for ({ } for ({ name = "noName" } = robot, i = 0; i < 1; i++) { ->{ name = "noName" } = robot, i = 0 : number +>{ name = "noName" } = robot, i = 0 : 0 >{ name = "noName" } = robot : Robot >{ name = "noName" } : { name?: string; } >name : string >robot : Robot ->i = 0 : number +>i = 0 : 0 >i : number ->0 : number +>0 : 0 >i < 1 : boolean >i : number ->1 : number +>1 : 1 >i++ : number >i : number @@ -342,18 +342,18 @@ for ({ name = "noName" } = robot, i = 0; i < 1; i++) { >nameA : string } for ({ name = "noName" } = getRobot(), i = 0; i < 1; i++) { ->{ name = "noName" } = getRobot(), i = 0 : number +>{ name = "noName" } = getRobot(), i = 0 : 0 >{ name = "noName" } = getRobot() : Robot >{ name = "noName" } : { name?: string; } >name : string >getRobot() : Robot >getRobot : () => Robot ->i = 0 : number +>i = 0 : 0 >i : number ->0 : number +>0 : 0 >i < 1 : boolean >i : number ->1 : number +>1 : 1 >i++ : number >i : number @@ -365,7 +365,7 @@ for ({ name = "noName" } = getRobot(), i = 0; i < 1; i++) { >nameA : string } for ({ name = "noName" } = { name: "trimmer", skill: "trimming" }, i = 0; i < 1; i++) { ->{ name = "noName" } = { name: "trimmer", skill: "trimming" }, i = 0 : number +>{ name = "noName" } = { name: "trimmer", skill: "trimming" }, i = 0 : 0 >{ name = "noName" } = { name: "trimmer", skill: "trimming" } : Robot >{ name = "noName" } : { name?: string; } >name : string @@ -373,15 +373,15 @@ for ({ name = "noName" } = { name: "trimmer", skill: "trimming" }, i = 0; >Robot : Robot >{ name: "trimmer", skill: "trimming" } : { name: string; skill: string; } >name : string ->"trimmer" : string +>"trimmer" : "trimmer" >skill : string ->"trimming" : string ->i = 0 : number +>"trimming" : "trimming" +>i = 0 : 0 >i : number ->0 : number +>0 : 0 >i < 1 : boolean >i : number ->1 : number +>1 : 1 >i++ : number >i : number @@ -393,7 +393,7 @@ for ({ name = "noName" } = { name: "trimmer", skill: "trimming" }, i = 0; >nameA : string } for ({ ->{ skills: { primary = "primary", secondary = "secondary" } = { primary: "none", secondary: "none" }} = multiRobot, i = 0 : number +>{ skills: { primary = "primary", secondary = "secondary" } = { primary: "none", secondary: "none" }} = multiRobot, i = 0 : 0 >{ skills: { primary = "primary", secondary = "secondary" } = { primary: "none", secondary: "none" }} = multiRobot : MultiRobot >{ skills: { primary = "primary", secondary = "secondary" } = { primary: "none", secondary: "none" }} : { skills?: { primary?: string; secondary?: string; }; } @@ -411,18 +411,18 @@ for ({ } = { primary: "none", secondary: "none" } >{ primary: "none", secondary: "none" } : { primary?: string; secondary?: string; } >primary : string ->"none" : string +>"none" : "none" >secondary : string ->"none" : string +>"none" : "none" } = multiRobot, i = 0; i < 1; i++) { >multiRobot : MultiRobot ->i = 0 : number +>i = 0 : 0 >i : number ->0 : number +>0 : 0 >i < 1 : boolean >i : number ->1 : number +>1 : 1 >i++ : number >i : number @@ -434,7 +434,7 @@ for ({ >primaryA : string } for ({ ->{ skills: { primary = "primary", secondary = "secondary" } = { primary: "none", secondary: "none" }} = getMultiRobot(), i = 0 : number +>{ skills: { primary = "primary", secondary = "secondary" } = { primary: "none", secondary: "none" }} = getMultiRobot(), i = 0 : 0 >{ skills: { primary = "primary", secondary = "secondary" } = { primary: "none", secondary: "none" }} = getMultiRobot() : MultiRobot >{ skills: { primary = "primary", secondary = "secondary" } = { primary: "none", secondary: "none" }} : { skills?: { primary?: string; secondary?: string; }; } @@ -452,19 +452,19 @@ for ({ } = { primary: "none", secondary: "none" } >{ primary: "none", secondary: "none" } : { primary?: string; secondary?: string; } >primary : string ->"none" : string +>"none" : "none" >secondary : string ->"none" : string +>"none" : "none" } = getMultiRobot(), i = 0; i < 1; i++) { >getMultiRobot() : MultiRobot >getMultiRobot : () => MultiRobot ->i = 0 : number +>i = 0 : 0 >i : number ->0 : number +>0 : 0 >i < 1 : boolean >i : number ->1 : number +>1 : 1 >i++ : number >i : number @@ -476,7 +476,7 @@ for ({ >primaryA : string } for ({ ->{ skills: { primary = "primary", secondary = "secondary" } = { primary: "none", secondary: "none" }} = { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }, i = 0 : number +>{ skills: { primary = "primary", secondary = "secondary" } = { primary: "none", secondary: "none" }} = { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }, i = 0 : 0 >{ skills: { primary = "primary", secondary = "secondary" } = { primary: "none", secondary: "none" }} = { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } } : MultiRobot >{ skills: { primary = "primary", secondary = "secondary" } = { primary: "none", secondary: "none" }} : { skills?: { primary?: string; secondary?: string; }; } @@ -494,30 +494,30 @@ for ({ } = { primary: "none", secondary: "none" } >{ primary: "none", secondary: "none" } : { primary?: string; secondary?: string; } >primary : string ->"none" : string +>"none" : "none" >secondary : string ->"none" : string +>"none" : "none" } = { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }, >{ name: "trimmer", skills: { primary: "trimming", secondary: "edging" } } : MultiRobot >MultiRobot : MultiRobot >{ name: "trimmer", skills: { primary: "trimming", secondary: "edging" } } : { name: string; skills: { primary: string; secondary: string; }; } >name : string ->"trimmer" : string +>"trimmer" : "trimmer" >skills : { primary: string; secondary: string; } >{ primary: "trimming", secondary: "edging" } : { primary: string; secondary: string; } >primary : string ->"trimming" : string +>"trimming" : "trimming" >secondary : string ->"edging" : string +>"edging" : "edging" i = 0; i < 1; i++) { ->i = 0 : number +>i = 0 : 0 >i : number ->0 : number +>0 : 0 >i < 1 : boolean >i : number ->1 : number +>1 : 1 >i++ : number >i : number @@ -531,24 +531,24 @@ for ({ for ({name: nameA = "noName", skill: skillA = "skill" } = robot, i = 0; i < 1; i++) { ->{name: nameA = "noName", skill: skillA = "skill" } = robot, i = 0 : number +>{name: nameA = "noName", skill: skillA = "skill" } = robot, i = 0 : 0 >{name: nameA = "noName", skill: skillA = "skill" } = robot : Robot >{name: nameA = "noName", skill: skillA = "skill" } : { name?: string; skill?: string; } >name : string ->nameA = "noName" : string +>nameA = "noName" : "noName" >nameA : string ->"noName" : string +>"noName" : "noName" >skill : string ->skillA = "skill" : string +>skillA = "skill" : "skill" >skillA : string ->"skill" : string +>"skill" : "skill" >robot : Robot ->i = 0 : number +>i = 0 : 0 >i : number ->0 : number +>0 : 0 >i < 1 : boolean >i : number ->1 : number +>1 : 1 >i++ : number >i : number @@ -560,25 +560,25 @@ for ({name: nameA = "noName", skill: skillA = "skill" } = robot, i = 0; i < 1; i >nameA : string } for ({name: nameA = "noName", skill: skillA = "skill" } = getRobot(), i = 0; i < 1; i++) { ->{name: nameA = "noName", skill: skillA = "skill" } = getRobot(), i = 0 : number +>{name: nameA = "noName", skill: skillA = "skill" } = getRobot(), i = 0 : 0 >{name: nameA = "noName", skill: skillA = "skill" } = getRobot() : Robot >{name: nameA = "noName", skill: skillA = "skill" } : { name?: string; skill?: string; } >name : string ->nameA = "noName" : string +>nameA = "noName" : "noName" >nameA : string ->"noName" : string +>"noName" : "noName" >skill : string ->skillA = "skill" : string +>skillA = "skill" : "skill" >skillA : string ->"skill" : string +>"skill" : "skill" >getRobot() : Robot >getRobot : () => Robot ->i = 0 : number +>i = 0 : 0 >i : number ->0 : number +>0 : 0 >i < 1 : boolean >i : number ->1 : number +>1 : 1 >i++ : number >i : number @@ -590,30 +590,30 @@ for ({name: nameA = "noName", skill: skillA = "skill" } = getRobot(), i = 0; i < >nameA : string } for ({name: nameA = "noName", skill: skillA = "skill" } = { name: "trimmer", skill: "trimming" }, i = 0; i < 1; i++) { ->{name: nameA = "noName", skill: skillA = "skill" } = { name: "trimmer", skill: "trimming" }, i = 0 : number +>{name: nameA = "noName", skill: skillA = "skill" } = { name: "trimmer", skill: "trimming" }, i = 0 : 0 >{name: nameA = "noName", skill: skillA = "skill" } = { name: "trimmer", skill: "trimming" } : Robot >{name: nameA = "noName", skill: skillA = "skill" } : { name?: string; skill?: string; } >name : string ->nameA = "noName" : string +>nameA = "noName" : "noName" >nameA : string ->"noName" : string +>"noName" : "noName" >skill : string ->skillA = "skill" : string +>skillA = "skill" : "skill" >skillA : string ->"skill" : string +>"skill" : "skill" >{ name: "trimmer", skill: "trimming" } : Robot >Robot : Robot >{ name: "trimmer", skill: "trimming" } : { name: string; skill: string; } >name : string ->"trimmer" : string +>"trimmer" : "trimmer" >skill : string ->"trimming" : string ->i = 0 : number +>"trimming" : "trimming" +>i = 0 : 0 >i : number ->0 : number +>0 : 0 >i < 1 : boolean >i : number ->1 : number +>1 : 1 >i++ : number >i : number @@ -625,15 +625,15 @@ for ({name: nameA = "noName", skill: skillA = "skill" } = { name: "trimme >nameA : string } for ({ ->{ name: nameA = "noName", skills: { primary: primaryA = "primary", secondary: secondaryA = "secondary" } = { primary: "none", secondary: "none" }} = multiRobot, i = 0 : number +>{ name: nameA = "noName", skills: { primary: primaryA = "primary", secondary: secondaryA = "secondary" } = { primary: "none", secondary: "none" }} = multiRobot, i = 0 : 0 >{ name: nameA = "noName", skills: { primary: primaryA = "primary", secondary: secondaryA = "secondary" } = { primary: "none", secondary: "none" }} = multiRobot : MultiRobot >{ name: nameA = "noName", skills: { primary: primaryA = "primary", secondary: secondaryA = "secondary" } = { primary: "none", secondary: "none" }} : { name?: string; skills?: { primary?: string; secondary?: string; }; } name: nameA = "noName", >name : string ->nameA = "noName" : string +>nameA = "noName" : "noName" >nameA : string ->"noName" : string +>"noName" : "noName" skills: { >skills : { primary?: string; secondary?: string; } @@ -642,31 +642,31 @@ for ({ primary: primaryA = "primary", >primary : string ->primaryA = "primary" : string +>primaryA = "primary" : "primary" >primaryA : string ->"primary" : string +>"primary" : "primary" secondary: secondaryA = "secondary" >secondary : string ->secondaryA = "secondary" : string +>secondaryA = "secondary" : "secondary" >secondaryA : string ->"secondary" : string +>"secondary" : "secondary" } = { primary: "none", secondary: "none" } >{ primary: "none", secondary: "none" } : { primary?: string; secondary?: string; } >primary : string ->"none" : string +>"none" : "none" >secondary : string ->"none" : string +>"none" : "none" } = multiRobot, i = 0; i < 1; i++) { >multiRobot : MultiRobot ->i = 0 : number +>i = 0 : 0 >i : number ->0 : number +>0 : 0 >i < 1 : boolean >i : number ->1 : number +>1 : 1 >i++ : number >i : number @@ -678,15 +678,15 @@ for ({ >primaryA : string } for ({ ->{ name: nameA = "noName", skills: { primary: primaryA = "primary", secondary: secondaryA = "secondary" } = { primary: "none", secondary: "none" }} = getMultiRobot(), i = 0 : number +>{ name: nameA = "noName", skills: { primary: primaryA = "primary", secondary: secondaryA = "secondary" } = { primary: "none", secondary: "none" }} = getMultiRobot(), i = 0 : 0 >{ name: nameA = "noName", skills: { primary: primaryA = "primary", secondary: secondaryA = "secondary" } = { primary: "none", secondary: "none" }} = getMultiRobot() : MultiRobot >{ name: nameA = "noName", skills: { primary: primaryA = "primary", secondary: secondaryA = "secondary" } = { primary: "none", secondary: "none" }} : { name?: string; skills?: { primary?: string; secondary?: string; }; } name: nameA = "noName", >name : string ->nameA = "noName" : string +>nameA = "noName" : "noName" >nameA : string ->"noName" : string +>"noName" : "noName" skills: { >skills : { primary?: string; secondary?: string; } @@ -695,32 +695,32 @@ for ({ primary: primaryA = "primary", >primary : string ->primaryA = "primary" : string +>primaryA = "primary" : "primary" >primaryA : string ->"primary" : string +>"primary" : "primary" secondary: secondaryA = "secondary" >secondary : string ->secondaryA = "secondary" : string +>secondaryA = "secondary" : "secondary" >secondaryA : string ->"secondary" : string +>"secondary" : "secondary" } = { primary: "none", secondary: "none" } >{ primary: "none", secondary: "none" } : { primary?: string; secondary?: string; } >primary : string ->"none" : string +>"none" : "none" >secondary : string ->"none" : string +>"none" : "none" } = getMultiRobot(), i = 0; i < 1; i++) { >getMultiRobot() : MultiRobot >getMultiRobot : () => MultiRobot ->i = 0 : number +>i = 0 : 0 >i : number ->0 : number +>0 : 0 >i < 1 : boolean >i : number ->1 : number +>1 : 1 >i++ : number >i : number @@ -732,15 +732,15 @@ for ({ >primaryA : string } for ({ ->{ name: nameA = "noName", skills: { primary: primaryA = "primary", secondary: secondaryA = "secondary" } = { primary: "none", secondary: "none" }} = { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }, i = 0 : number +>{ name: nameA = "noName", skills: { primary: primaryA = "primary", secondary: secondaryA = "secondary" } = { primary: "none", secondary: "none" }} = { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }, i = 0 : 0 >{ name: nameA = "noName", skills: { primary: primaryA = "primary", secondary: secondaryA = "secondary" } = { primary: "none", secondary: "none" }} = { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } } : MultiRobot >{ name: nameA = "noName", skills: { primary: primaryA = "primary", secondary: secondaryA = "secondary" } = { primary: "none", secondary: "none" }} : { name?: string; skills?: { primary?: string; secondary?: string; }; } name: nameA = "noName", >name : string ->nameA = "noName" : string +>nameA = "noName" : "noName" >nameA : string ->"noName" : string +>"noName" : "noName" skills: { >skills : { primary?: string; secondary?: string; } @@ -749,43 +749,43 @@ for ({ primary: primaryA = "primary", >primary : string ->primaryA = "primary" : string +>primaryA = "primary" : "primary" >primaryA : string ->"primary" : string +>"primary" : "primary" secondary: secondaryA = "secondary" >secondary : string ->secondaryA = "secondary" : string +>secondaryA = "secondary" : "secondary" >secondaryA : string ->"secondary" : string +>"secondary" : "secondary" } = { primary: "none", secondary: "none" } >{ primary: "none", secondary: "none" } : { primary?: string; secondary?: string; } >primary : string ->"none" : string +>"none" : "none" >secondary : string ->"none" : string +>"none" : "none" } = { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }, >{ name: "trimmer", skills: { primary: "trimming", secondary: "edging" } } : MultiRobot >MultiRobot : MultiRobot >{ name: "trimmer", skills: { primary: "trimming", secondary: "edging" } } : { name: string; skills: { primary: string; secondary: string; }; } >name : string ->"trimmer" : string +>"trimmer" : "trimmer" >skills : { primary: string; secondary: string; } >{ primary: "trimming", secondary: "edging" } : { primary: string; secondary: string; } >primary : string ->"trimming" : string +>"trimming" : "trimming" >secondary : string ->"edging" : string +>"edging" : "edging" i = 0; i < 1; i++) { ->i = 0 : number +>i = 0 : 0 >i : number ->0 : number +>0 : 0 >i < 1 : boolean >i : number ->1 : number +>1 : 1 >i++ : number >i : number @@ -798,18 +798,18 @@ for ({ } for ({ name = "noName", skill = "skill" } = robot, i = 0; i < 1; i++) { ->{ name = "noName", skill = "skill" } = robot, i = 0 : number +>{ name = "noName", skill = "skill" } = robot, i = 0 : 0 >{ name = "noName", skill = "skill" } = robot : Robot >{ name = "noName", skill = "skill" } : { name?: string; skill?: string; } >name : string >skill : string >robot : Robot ->i = 0 : number +>i = 0 : 0 >i : number ->0 : number +>0 : 0 >i < 1 : boolean >i : number ->1 : number +>1 : 1 >i++ : number >i : number @@ -821,19 +821,19 @@ for ({ name = "noName", skill = "skill" } = robot, i = 0; i < 1; i++) { >nameA : string } for ({ name = "noName", skill = "skill" } = getRobot(), i = 0; i < 1; i++) { ->{ name = "noName", skill = "skill" } = getRobot(), i = 0 : number +>{ name = "noName", skill = "skill" } = getRobot(), i = 0 : 0 >{ name = "noName", skill = "skill" } = getRobot() : Robot >{ name = "noName", skill = "skill" } : { name?: string; skill?: string; } >name : string >skill : string >getRobot() : Robot >getRobot : () => Robot ->i = 0 : number +>i = 0 : 0 >i : number ->0 : number +>0 : 0 >i < 1 : boolean >i : number ->1 : number +>1 : 1 >i++ : number >i : number @@ -845,7 +845,7 @@ for ({ name = "noName", skill = "skill" } = getRobot(), i = 0; i < 1; i++) { >nameA : string } for ({ name = "noName", skill = "skill" } = { name: "trimmer", skill: "trimming" }, i = 0; i < 1; i++) { ->{ name = "noName", skill = "skill" } = { name: "trimmer", skill: "trimming" }, i = 0 : number +>{ name = "noName", skill = "skill" } = { name: "trimmer", skill: "trimming" }, i = 0 : 0 >{ name = "noName", skill = "skill" } = { name: "trimmer", skill: "trimming" } : Robot >{ name = "noName", skill = "skill" } : { name?: string; skill?: string; } >name : string @@ -854,15 +854,15 @@ for ({ name = "noName", skill = "skill" } = { name: "trimmer", skill: "tr >Robot : Robot >{ name: "trimmer", skill: "trimming" } : { name: string; skill: string; } >name : string ->"trimmer" : string +>"trimmer" : "trimmer" >skill : string ->"trimming" : string ->i = 0 : number +>"trimming" : "trimming" +>i = 0 : 0 >i : number ->0 : number +>0 : 0 >i < 1 : boolean >i : number ->1 : number +>1 : 1 >i++ : number >i : number @@ -874,7 +874,7 @@ for ({ name = "noName", skill = "skill" } = { name: "trimmer", skill: "tr >nameA : string } for ({ ->{ name = "noName", skills: { primary = "primary", secondary = "secondary" } = { primary: "none", secondary: "none" }} = multiRobot, i = 0 : number +>{ name = "noName", skills: { primary = "primary", secondary = "secondary" } = { primary: "none", secondary: "none" }} = multiRobot, i = 0 : 0 >{ name = "noName", skills: { primary = "primary", secondary = "secondary" } = { primary: "none", secondary: "none" }} = multiRobot : MultiRobot >{ name = "noName", skills: { primary = "primary", secondary = "secondary" } = { primary: "none", secondary: "none" }} : { name?: string; skills?: { primary?: string; secondary?: string; }; } @@ -895,18 +895,18 @@ for ({ } = { primary: "none", secondary: "none" } >{ primary: "none", secondary: "none" } : { primary?: string; secondary?: string; } >primary : string ->"none" : string +>"none" : "none" >secondary : string ->"none" : string +>"none" : "none" } = multiRobot, i = 0; i < 1; i++) { >multiRobot : MultiRobot ->i = 0 : number +>i = 0 : 0 >i : number ->0 : number +>0 : 0 >i < 1 : boolean >i : number ->1 : number +>1 : 1 >i++ : number >i : number @@ -918,7 +918,7 @@ for ({ >primaryA : string } for ({ ->{ name = "noName", skills: { primary = "primary", secondary = "secondary" } = { primary: "none", secondary: "none" }} = getMultiRobot(), i = 0 : number +>{ name = "noName", skills: { primary = "primary", secondary = "secondary" } = { primary: "none", secondary: "none" }} = getMultiRobot(), i = 0 : 0 >{ name = "noName", skills: { primary = "primary", secondary = "secondary" } = { primary: "none", secondary: "none" }} = getMultiRobot() : MultiRobot >{ name = "noName", skills: { primary = "primary", secondary = "secondary" } = { primary: "none", secondary: "none" }} : { name?: string; skills?: { primary?: string; secondary?: string; }; } @@ -939,19 +939,19 @@ for ({ } = { primary: "none", secondary: "none" } >{ primary: "none", secondary: "none" } : { primary?: string; secondary?: string; } >primary : string ->"none" : string +>"none" : "none" >secondary : string ->"none" : string +>"none" : "none" } = getMultiRobot(), i = 0; i < 1; i++) { >getMultiRobot() : MultiRobot >getMultiRobot : () => MultiRobot ->i = 0 : number +>i = 0 : 0 >i : number ->0 : number +>0 : 0 >i < 1 : boolean >i : number ->1 : number +>1 : 1 >i++ : number >i : number @@ -963,7 +963,7 @@ for ({ >primaryA : string } for ({ ->{ name = "noName", skills: { primary = "primary", secondary = "secondary" } = { primary: "none", secondary: "none" }} = { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }, i = 0 : number +>{ name = "noName", skills: { primary = "primary", secondary = "secondary" } = { primary: "none", secondary: "none" }} = { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }, i = 0 : 0 >{ name = "noName", skills: { primary = "primary", secondary = "secondary" } = { primary: "none", secondary: "none" }} = { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } } : MultiRobot >{ name = "noName", skills: { primary = "primary", secondary = "secondary" } = { primary: "none", secondary: "none" }} : { name?: string; skills?: { primary?: string; secondary?: string; }; } @@ -984,30 +984,30 @@ for ({ } = { primary: "none", secondary: "none" } >{ primary: "none", secondary: "none" } : { primary?: string; secondary?: string; } >primary : string ->"none" : string +>"none" : "none" >secondary : string ->"none" : string +>"none" : "none" } = { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }, >{ name: "trimmer", skills: { primary: "trimming", secondary: "edging" } } : MultiRobot >MultiRobot : MultiRobot >{ name: "trimmer", skills: { primary: "trimming", secondary: "edging" } } : { name: string; skills: { primary: string; secondary: string; }; } >name : string ->"trimmer" : string +>"trimmer" : "trimmer" >skills : { primary: string; secondary: string; } >{ primary: "trimming", secondary: "edging" } : { primary: string; secondary: string; } >primary : string ->"trimming" : string +>"trimming" : "trimming" >secondary : string ->"edging" : string +>"edging" : "edging" i = 0; i < 1; i++) { ->i = 0 : number +>i = 0 : 0 >i : number ->0 : number +>0 : 0 >i < 1 : boolean >i : number ->1 : number +>1 : 1 >i++ : number >i : number diff --git a/tests/baselines/reference/sourceMapValidationDestructuringForOfArrayBindingPattern.types b/tests/baselines/reference/sourceMapValidationDestructuringForOfArrayBindingPattern.types index aebfe16dcde..41dc32d2648 100644 --- a/tests/baselines/reference/sourceMapValidationDestructuringForOfArrayBindingPattern.types +++ b/tests/baselines/reference/sourceMapValidationDestructuringForOfArrayBindingPattern.types @@ -16,17 +16,17 @@ let robotA: Robot = [1, "mower", "mowing"]; >robotA : [number, string, string] >Robot : [number, string, string] >[1, "mower", "mowing"] : [number, string, string] ->1 : number ->"mower" : string ->"mowing" : string +>1 : 1 +>"mower" : "mower" +>"mowing" : "mowing" let robotB: Robot = [2, "trimmer", "trimming"]; >robotB : [number, string, string] >Robot : [number, string, string] >[2, "trimmer", "trimming"] : [number, string, string] ->2 : number ->"trimmer" : string ->"trimming" : string +>2 : 2 +>"trimmer" : "trimmer" +>"trimming" : "trimming" let robots = [robotA, robotB]; >robots : [number, string, string][] @@ -45,19 +45,19 @@ let multiRobotA: MultiSkilledRobot = ["mower", ["mowing", ""]]; >multiRobotA : [string, [string, string]] >MultiSkilledRobot : [string, [string, string]] >["mower", ["mowing", ""]] : [string, [string, string]] ->"mower" : string +>"mower" : "mower" >["mowing", ""] : [string, string] ->"mowing" : string ->"" : string +>"mowing" : "mowing" +>"" : "" let multiRobotB: MultiSkilledRobot = ["trimmer", ["trimming", "edging"]]; >multiRobotB : [string, [string, string]] >MultiSkilledRobot : [string, [string, string]] >["trimmer", ["trimming", "edging"]] : [string, [string, string]] ->"trimmer" : string +>"trimmer" : "trimmer" >["trimming", "edging"] : [string, string] ->"trimming" : string ->"edging" : string +>"trimming" : "trimming" +>"edging" : "edging" let multiRobots = [multiRobotA, multiRobotB]; >multiRobots : [string, [string, string]][] diff --git a/tests/baselines/reference/sourceMapValidationDestructuringForOfArrayBindingPattern2.types b/tests/baselines/reference/sourceMapValidationDestructuringForOfArrayBindingPattern2.types index be84bbe3459..abc08ee63d4 100644 --- a/tests/baselines/reference/sourceMapValidationDestructuringForOfArrayBindingPattern2.types +++ b/tests/baselines/reference/sourceMapValidationDestructuringForOfArrayBindingPattern2.types @@ -16,17 +16,17 @@ let robotA: Robot = [1, "mower", "mowing"]; >robotA : [number, string, string] >Robot : [number, string, string] >[1, "mower", "mowing"] : [number, string, string] ->1 : number ->"mower" : string ->"mowing" : string +>1 : 1 +>"mower" : "mower" +>"mowing" : "mowing" let robotB: Robot = [2, "trimmer", "trimming"]; >robotB : [number, string, string] >Robot : [number, string, string] >[2, "trimmer", "trimming"] : [number, string, string] ->2 : number ->"trimmer" : string ->"trimming" : string +>2 : 2 +>"trimmer" : "trimmer" +>"trimming" : "trimming" let robots = [robotA, robotB]; >robots : [number, string, string][] @@ -45,19 +45,19 @@ let multiRobotA: MultiSkilledRobot = ["mower", ["mowing", ""]]; >multiRobotA : [string, [string, string]] >MultiSkilledRobot : [string, [string, string]] >["mower", ["mowing", ""]] : [string, [string, string]] ->"mower" : string +>"mower" : "mower" >["mowing", ""] : [string, string] ->"mowing" : string ->"" : string +>"mowing" : "mowing" +>"" : "" let multiRobotB: MultiSkilledRobot = ["trimmer", ["trimming", "edging"]]; >multiRobotB : [string, [string, string]] >MultiSkilledRobot : [string, [string, string]] >["trimmer", ["trimming", "edging"]] : [string, [string, string]] ->"trimmer" : string +>"trimmer" : "trimmer" >["trimming", "edging"] : [string, string] ->"trimming" : string ->"edging" : string +>"trimming" : "trimming" +>"edging" : "edging" let multiRobots = [multiRobotA, multiRobotB]; >multiRobots : [string, [string, string]][] diff --git a/tests/baselines/reference/sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues.types b/tests/baselines/reference/sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues.types index 80ba5df531f..e82c981033e 100644 --- a/tests/baselines/reference/sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues.types +++ b/tests/baselines/reference/sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues.types @@ -16,17 +16,17 @@ let robotA: Robot = [1, "mower", "mowing"]; >robotA : [number, string, string] >Robot : [number, string, string] >[1, "mower", "mowing"] : [number, string, string] ->1 : number ->"mower" : string ->"mowing" : string +>1 : 1 +>"mower" : "mower" +>"mowing" : "mowing" let robotB: Robot = [2, "trimmer", "trimming"]; >robotB : [number, string, string] >Robot : [number, string, string] >[2, "trimmer", "trimming"] : [number, string, string] ->2 : number ->"trimmer" : string ->"trimming" : string +>2 : 2 +>"trimmer" : "trimmer" +>"trimming" : "trimming" let robots = [robotA, robotB]; >robots : [number, string, string][] @@ -45,19 +45,19 @@ let multiRobotA: MultiSkilledRobot = ["mower", ["mowing", ""]]; >multiRobotA : [string, [string, string]] >MultiSkilledRobot : [string, [string, string]] >["mower", ["mowing", ""]] : [string, [string, string]] ->"mower" : string +>"mower" : "mower" >["mowing", ""] : [string, string] ->"mowing" : string ->"" : string +>"mowing" : "mowing" +>"" : "" let multiRobotB: MultiSkilledRobot = ["trimmer", ["trimming", "edging"]]; >multiRobotB : [string, [string, string]] >MultiSkilledRobot : [string, [string, string]] >["trimmer", ["trimming", "edging"]] : [string, [string, string]] ->"trimmer" : string +>"trimmer" : "trimmer" >["trimming", "edging"] : [string, string] ->"trimming" : string ->"edging" : string +>"trimming" : "trimming" +>"edging" : "edging" let multiRobots = [multiRobotA, multiRobotB]; >multiRobots : [string, [string, string]][] @@ -75,7 +75,7 @@ function getMultiRobots() { for (let [, nameA = "noName"] of robots) { > : undefined >nameA : string ->"noName" : string +>"noName" : "noName" >robots : [number, string, string][] console.log(nameA); @@ -88,7 +88,7 @@ for (let [, nameA = "noName"] of robots) { for (let [, nameA = "noName"] of getRobots()) { > : undefined >nameA : string ->"noName" : string +>"noName" : "noName" >getRobots() : [number, string, string][] >getRobots : () => [number, string, string][] @@ -102,7 +102,7 @@ for (let [, nameA = "noName"] of getRobots()) { for (let [, nameA = "noName"] of [robotA, robotB]) { > : undefined >nameA : string ->"noName" : string +>"noName" : "noName" >[robotA, robotB] : [number, string, string][] >robotA : [number, string, string] >robotB : [number, string, string] @@ -119,16 +119,16 @@ for (let [, [ primarySkillA = "primary", >primarySkillA : string ->"primary" : string +>"primary" : "primary" secondarySkillA = "secondary" >secondarySkillA : string ->"secondary" : string +>"secondary" : "secondary" ] = ["skill1", "skill2"]] of multiRobots) { >["skill1", "skill2"] : [string, string] ->"skill1" : string ->"skill2" : string +>"skill1" : "skill1" +>"skill2" : "skill2" >multiRobots : [string, [string, string]][] console.log(primarySkillA); @@ -143,16 +143,16 @@ for (let [, [ primarySkillA = "primary", >primarySkillA : string ->"primary" : string +>"primary" : "primary" secondarySkillA = "secondary" >secondarySkillA : string ->"secondary" : string +>"secondary" : "secondary" ] = ["skill1", "skill2"]] of getMultiRobots()) { >["skill1", "skill2"] : [string, string] ->"skill1" : string ->"skill2" : string +>"skill1" : "skill1" +>"skill2" : "skill2" >getMultiRobots() : [string, [string, string]][] >getMultiRobots : () => [string, [string, string]][] @@ -168,16 +168,16 @@ for (let [, [ primarySkillA = "primary", >primarySkillA : string ->"primary" : string +>"primary" : "primary" secondarySkillA = "secondary" >secondarySkillA : string ->"secondary" : string +>"secondary" : "secondary" ] = ["skill1", "skill2"]] of [multiRobotA, multiRobotB]) { >["skill1", "skill2"] : [string, string] ->"skill1" : string ->"skill2" : string +>"skill1" : "skill1" +>"skill2" : "skill2" >[multiRobotA, multiRobotB] : [string, [string, string]][] >multiRobotA : [string, [string, string]] >multiRobotB : [string, [string, string]] @@ -192,8 +192,8 @@ for (let [, [ for (let [numberB = -1] of robots) { >numberB : number ->-1 : number ->1 : number +>-1 : -1 +>1 : 1 >robots : [number, string, string][] console.log(numberB); @@ -205,8 +205,8 @@ for (let [numberB = -1] of robots) { } for (let [numberB = -1] of getRobots()) { >numberB : number ->-1 : number ->1 : number +>-1 : -1 +>1 : 1 >getRobots() : [number, string, string][] >getRobots : () => [number, string, string][] @@ -219,8 +219,8 @@ for (let [numberB = -1] of getRobots()) { } for (let [numberB = -1] of [robotA, robotB]) { >numberB : number ->-1 : number ->1 : number +>-1 : -1 +>1 : 1 >[robotA, robotB] : [number, string, string][] >robotA : [number, string, string] >robotB : [number, string, string] @@ -234,7 +234,7 @@ for (let [numberB = -1] of [robotA, robotB]) { } for (let [nameB = "noName"] of multiRobots) { >nameB : string ->"noName" : string +>"noName" : "noName" >multiRobots : [string, [string, string]][] console.log(nameB); @@ -246,7 +246,7 @@ for (let [nameB = "noName"] of multiRobots) { } for (let [nameB = "noName"] of getMultiRobots()) { >nameB : string ->"noName" : string +>"noName" : "noName" >getMultiRobots() : [string, [string, string]][] >getMultiRobots : () => [string, [string, string]][] @@ -259,7 +259,7 @@ for (let [nameB = "noName"] of getMultiRobots()) { } for (let [nameB = "noName"] of [multiRobotA, multiRobotB]) { >nameB : string ->"noName" : string +>"noName" : "noName" >[multiRobotA, multiRobotB] : [string, [string, string]][] >multiRobotA : [string, [string, string]] >multiRobotB : [string, [string, string]] @@ -274,12 +274,12 @@ for (let [nameB = "noName"] of [multiRobotA, multiRobotB]) { for (let [numberA2 = -1, nameA2 = "noName", skillA2 = "skill"] of robots) { >numberA2 : number ->-1 : number ->1 : number +>-1 : -1 +>1 : 1 >nameA2 : string ->"noName" : string +>"noName" : "noName" >skillA2 : string ->"skill" : string +>"skill" : "skill" >robots : [number, string, string][] console.log(nameA2); @@ -291,12 +291,12 @@ for (let [numberA2 = -1, nameA2 = "noName", skillA2 = "skill"] of robots) { } for (let [numberA2 = -1, nameA2 = "noName", skillA2 = "skill"] of getRobots()) { >numberA2 : number ->-1 : number ->1 : number +>-1 : -1 +>1 : 1 >nameA2 : string ->"noName" : string +>"noName" : "noName" >skillA2 : string ->"skill" : string +>"skill" : "skill" >getRobots() : [number, string, string][] >getRobots : () => [number, string, string][] @@ -309,12 +309,12 @@ for (let [numberA2 = -1, nameA2 = "noName", skillA2 = "skill"] of getRobots()) { } for (let [numberA2 = -1, nameA2 = "noName", skillA2 = "skill"] of [robotA, robotB]) { >numberA2 : number ->-1 : number ->1 : number +>-1 : -1 +>1 : 1 >nameA2 : string ->"noName" : string +>"noName" : "noName" >skillA2 : string ->"skill" : string +>"skill" : "skill" >[robotA, robotB] : [number, string, string][] >robotA : [number, string, string] >robotB : [number, string, string] @@ -328,20 +328,20 @@ for (let [numberA2 = -1, nameA2 = "noName", skillA2 = "skill"] of [robotA, robot } for (let [nameMA = "noName", [ >nameMA : string ->"noName" : string +>"noName" : "noName" primarySkillA = "primary", >primarySkillA : string ->"primary" : string +>"primary" : "primary" secondarySkillA = "secondary" >secondarySkillA : string ->"secondary" : string +>"secondary" : "secondary" ] = ["skill1", "skill2"]] of multiRobots) { >["skill1", "skill2"] : [string, string] ->"skill1" : string ->"skill2" : string +>"skill1" : "skill1" +>"skill2" : "skill2" >multiRobots : [string, [string, string]][] console.log(nameMA); @@ -353,20 +353,20 @@ for (let [nameMA = "noName", [ } for (let [nameMA = "noName", [ >nameMA : string ->"noName" : string +>"noName" : "noName" primarySkillA = "primary", >primarySkillA : string ->"primary" : string +>"primary" : "primary" secondarySkillA = "secondary" >secondarySkillA : string ->"secondary" : string +>"secondary" : "secondary" ] = ["skill1", "skill2"]] of getMultiRobots()) { >["skill1", "skill2"] : [string, string] ->"skill1" : string ->"skill2" : string +>"skill1" : "skill1" +>"skill2" : "skill2" >getMultiRobots() : [string, [string, string]][] >getMultiRobots : () => [string, [string, string]][] @@ -379,20 +379,20 @@ for (let [nameMA = "noName", [ } for (let [nameMA = "noName", [ >nameMA : string ->"noName" : string +>"noName" : "noName" primarySkillA = "primary", >primarySkillA : string ->"primary" : string +>"primary" : "primary" secondarySkillA = "secondary" >secondarySkillA : string ->"secondary" : string +>"secondary" : "secondary" ] = ["skill1", "skill2"]] of [multiRobotA, multiRobotB]) { >["skill1", "skill2"] : [string, string] ->"skill1" : string ->"skill2" : string +>"skill1" : "skill1" +>"skill2" : "skill2" >[multiRobotA, multiRobotB] : [string, [string, string]][] >multiRobotA : [string, [string, string]] >multiRobotB : [string, [string, string]] @@ -407,8 +407,8 @@ for (let [nameMA = "noName", [ for (let [numberA3 = -1, ...robotAInfo] of robots) { >numberA3 : number ->-1 : number ->1 : number +>-1 : -1 +>1 : 1 >robotAInfo : (string | number)[] >robots : [number, string, string][] @@ -421,8 +421,8 @@ for (let [numberA3 = -1, ...robotAInfo] of robots) { } for (let [numberA3 = -1, ...robotAInfo] of getRobots()) { >numberA3 : number ->-1 : number ->1 : number +>-1 : -1 +>1 : 1 >robotAInfo : (string | number)[] >getRobots() : [number, string, string][] >getRobots : () => [number, string, string][] @@ -436,8 +436,8 @@ for (let [numberA3 = -1, ...robotAInfo] of getRobots()) { } for (let [numberA3 = -1, ...robotAInfo] of [robotA, robotB]) { >numberA3 : number ->-1 : number ->1 : number +>-1 : -1 +>1 : 1 >robotAInfo : (string | number)[] >[robotA, robotB] : [number, string, string][] >robotA : [number, string, string] diff --git a/tests/baselines/reference/sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues2.types b/tests/baselines/reference/sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues2.types index 257663d7fe3..dad997dac4f 100644 --- a/tests/baselines/reference/sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues2.types +++ b/tests/baselines/reference/sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues2.types @@ -16,17 +16,17 @@ let robotA: Robot = [1, "mower", "mowing"]; >robotA : [number, string, string] >Robot : [number, string, string] >[1, "mower", "mowing"] : [number, string, string] ->1 : number ->"mower" : string ->"mowing" : string +>1 : 1 +>"mower" : "mower" +>"mowing" : "mowing" let robotB: Robot = [2, "trimmer", "trimming"]; >robotB : [number, string, string] >Robot : [number, string, string] >[2, "trimmer", "trimming"] : [number, string, string] ->2 : number ->"trimmer" : string ->"trimming" : string +>2 : 2 +>"trimmer" : "trimmer" +>"trimming" : "trimming" let robots = [robotA, robotB]; >robots : [number, string, string][] @@ -45,19 +45,19 @@ let multiRobotA: MultiSkilledRobot = ["mower", ["mowing", ""]]; >multiRobotA : [string, [string, string]] >MultiSkilledRobot : [string, [string, string]] >["mower", ["mowing", ""]] : [string, [string, string]] ->"mower" : string +>"mower" : "mower" >["mowing", ""] : [string, string] ->"mowing" : string ->"" : string +>"mowing" : "mowing" +>"" : "" let multiRobotB: MultiSkilledRobot = ["trimmer", ["trimming", "edging"]]; >multiRobotB : [string, [string, string]] >MultiSkilledRobot : [string, [string, string]] >["trimmer", ["trimming", "edging"]] : [string, [string, string]] ->"trimmer" : string +>"trimmer" : "trimmer" >["trimming", "edging"] : [string, string] ->"trimming" : string ->"edging" : string +>"trimming" : "trimming" +>"edging" : "edging" let multiRobots = [multiRobotA, multiRobotB]; >multiRobots : [string, [string, string]][] @@ -95,9 +95,9 @@ let numberA3: number, robotAInfo: (number | string)[], multiRobotAInfo: (string for ([, nameA = "noName"] of robots) { >[, nameA = "noName"] : [undefined, string] > : undefined ->nameA = "noName" : string +>nameA = "noName" : "noName" >nameA : string ->"noName" : string +>"noName" : "noName" >robots : [number, string, string][] console.log(nameA); @@ -110,9 +110,9 @@ for ([, nameA = "noName"] of robots) { for ([, nameA = "noName"] of getRobots()) { >[, nameA = "noName"] : [undefined, string] > : undefined ->nameA = "noName" : string +>nameA = "noName" : "noName" >nameA : string ->"noName" : string +>"noName" : "noName" >getRobots() : [number, string, string][] >getRobots : () => [number, string, string][] @@ -126,9 +126,9 @@ for ([, nameA = "noName"] of getRobots()) { for ([, nameA = "noName"] of [robotA, robotB]) { >[, nameA = "noName"] : [undefined, string] > : undefined ->nameA = "noName" : string +>nameA = "noName" : "noName" >nameA : string ->"noName" : string +>"noName" : "noName" >[robotA, robotB] : [number, string, string][] >robotA : [number, string, string] >robotB : [number, string, string] @@ -147,19 +147,19 @@ for ([, [ >[ primarySkillA = "primary", secondarySkillA = "secondary"] : [string, string] primarySkillA = "primary", ->primarySkillA = "primary" : string +>primarySkillA = "primary" : "primary" >primarySkillA : string ->"primary" : string +>"primary" : "primary" secondarySkillA = "secondary" ->secondarySkillA = "secondary" : string +>secondarySkillA = "secondary" : "secondary" >secondarySkillA : string ->"secondary" : string +>"secondary" : "secondary" ] = ["skill1", "skill2"]] of multiRobots) { >["skill1", "skill2"] : [string, string] ->"skill1" : string ->"skill2" : string +>"skill1" : "skill1" +>"skill2" : "skill2" >multiRobots : [string, [string, string]][] console.log(primarySkillA); @@ -176,19 +176,19 @@ for ([, [ >[ primarySkillA = "primary", secondarySkillA = "secondary"] : [string, string] primarySkillA = "primary", ->primarySkillA = "primary" : string +>primarySkillA = "primary" : "primary" >primarySkillA : string ->"primary" : string +>"primary" : "primary" secondarySkillA = "secondary" ->secondarySkillA = "secondary" : string +>secondarySkillA = "secondary" : "secondary" >secondarySkillA : string ->"secondary" : string +>"secondary" : "secondary" ] = ["skill1", "skill2"]] of getMultiRobots()) { >["skill1", "skill2"] : [string, string] ->"skill1" : string ->"skill2" : string +>"skill1" : "skill1" +>"skill2" : "skill2" >getMultiRobots() : [string, [string, string]][] >getMultiRobots : () => [string, [string, string]][] @@ -206,19 +206,19 @@ for ([, [ >[ primarySkillA = "primary", secondarySkillA = "secondary"] : [string, string] primarySkillA = "primary", ->primarySkillA = "primary" : string +>primarySkillA = "primary" : "primary" >primarySkillA : string ->"primary" : string +>"primary" : "primary" secondarySkillA = "secondary" ->secondarySkillA = "secondary" : string +>secondarySkillA = "secondary" : "secondary" >secondarySkillA : string ->"secondary" : string +>"secondary" : "secondary" ] = ["skill1", "skill2"]] of [multiRobotA, multiRobotB]) { >["skill1", "skill2"] : [string, string] ->"skill1" : string ->"skill2" : string +>"skill1" : "skill1" +>"skill2" : "skill2" >[multiRobotA, multiRobotB] : [string, [string, string]][] >multiRobotA : [string, [string, string]] >multiRobotB : [string, [string, string]] @@ -233,10 +233,10 @@ for ([, [ for ([numberB = -1] of robots) { >[numberB = -1] : [number] ->numberB = -1 : number +>numberB = -1 : -1 >numberB : number ->-1 : number ->1 : number +>-1 : -1 +>1 : 1 >robots : [number, string, string][] console.log(numberB); @@ -248,10 +248,10 @@ for ([numberB = -1] of robots) { } for ([numberB = -1] of getRobots()) { >[numberB = -1] : [number] ->numberB = -1 : number +>numberB = -1 : -1 >numberB : number ->-1 : number ->1 : number +>-1 : -1 +>1 : 1 >getRobots() : [number, string, string][] >getRobots : () => [number, string, string][] @@ -264,10 +264,10 @@ for ([numberB = -1] of getRobots()) { } for ([numberB = -1] of [robotA, robotB]) { >[numberB = -1] : [number] ->numberB = -1 : number +>numberB = -1 : -1 >numberB : number ->-1 : number ->1 : number +>-1 : -1 +>1 : 1 >[robotA, robotB] : [number, string, string][] >robotA : [number, string, string] >robotB : [number, string, string] @@ -281,9 +281,9 @@ for ([numberB = -1] of [robotA, robotB]) { } for ([nameB = "noName"] of multiRobots) { >[nameB = "noName"] : [string] ->nameB = "noName" : string +>nameB = "noName" : "noName" >nameB : string ->"noName" : string +>"noName" : "noName" >multiRobots : [string, [string, string]][] console.log(nameB); @@ -295,9 +295,9 @@ for ([nameB = "noName"] of multiRobots) { } for ([nameB = "noName"] of getMultiRobots()) { >[nameB = "noName"] : [string] ->nameB = "noName" : string +>nameB = "noName" : "noName" >nameB : string ->"noName" : string +>"noName" : "noName" >getMultiRobots() : [string, [string, string]][] >getMultiRobots : () => [string, [string, string]][] @@ -310,9 +310,9 @@ for ([nameB = "noName"] of getMultiRobots()) { } for ([nameB = "noName"] of [multiRobotA, multiRobotB]) { >[nameB = "noName"] : [string] ->nameB = "noName" : string +>nameB = "noName" : "noName" >nameB : string ->"noName" : string +>"noName" : "noName" >[multiRobotA, multiRobotB] : [string, [string, string]][] >multiRobotA : [string, [string, string]] >multiRobotB : [string, [string, string]] @@ -327,16 +327,16 @@ for ([nameB = "noName"] of [multiRobotA, multiRobotB]) { for ([numberA2 = -1, nameA2 = "noName", skillA2 = "skill"] of robots) { >[numberA2 = -1, nameA2 = "noName", skillA2 = "skill"] : [number, string, string] ->numberA2 = -1 : number +>numberA2 = -1 : -1 >numberA2 : number ->-1 : number ->1 : number ->nameA2 = "noName" : string +>-1 : -1 +>1 : 1 +>nameA2 = "noName" : "noName" >nameA2 : string ->"noName" : string ->skillA2 = "skill" : string +>"noName" : "noName" +>skillA2 = "skill" : "skill" >skillA2 : string ->"skill" : string +>"skill" : "skill" >robots : [number, string, string][] console.log(nameA2); @@ -348,16 +348,16 @@ for ([numberA2 = -1, nameA2 = "noName", skillA2 = "skill"] of robots) { } for ([numberA2 = -1, nameA2 = "noName", skillA2 = "skill"] of getRobots()) { >[numberA2 = -1, nameA2 = "noName", skillA2 = "skill"] : [number, string, string] ->numberA2 = -1 : number +>numberA2 = -1 : -1 >numberA2 : number ->-1 : number ->1 : number ->nameA2 = "noName" : string +>-1 : -1 +>1 : 1 +>nameA2 = "noName" : "noName" >nameA2 : string ->"noName" : string ->skillA2 = "skill" : string +>"noName" : "noName" +>skillA2 = "skill" : "skill" >skillA2 : string ->"skill" : string +>"skill" : "skill" >getRobots() : [number, string, string][] >getRobots : () => [number, string, string][] @@ -370,16 +370,16 @@ for ([numberA2 = -1, nameA2 = "noName", skillA2 = "skill"] of getRobots()) { } for ([numberA2 = -1, nameA2 = "noName", skillA2 = "skill"] of [robotA, robotB]) { >[numberA2 = -1, nameA2 = "noName", skillA2 = "skill"] : [number, string, string] ->numberA2 = -1 : number +>numberA2 = -1 : -1 >numberA2 : number ->-1 : number ->1 : number ->nameA2 = "noName" : string +>-1 : -1 +>1 : 1 +>nameA2 = "noName" : "noName" >nameA2 : string ->"noName" : string ->skillA2 = "skill" : string +>"noName" : "noName" +>skillA2 = "skill" : "skill" >skillA2 : string ->"skill" : string +>"skill" : "skill" >[robotA, robotB] : [number, string, string][] >robotA : [number, string, string] >robotB : [number, string, string] @@ -393,26 +393,26 @@ for ([numberA2 = -1, nameA2 = "noName", skillA2 = "skill"] of [robotA, robotB]) } for ([nameMA = "noName", [ >[nameMA = "noName", [ primarySkillA = "primary", secondarySkillA = "secondary"] = ["skill1", "skill2"]] : [string, [string, string]] ->nameMA = "noName" : string +>nameMA = "noName" : "noName" >nameMA : string ->"noName" : string +>"noName" : "noName" >[ primarySkillA = "primary", secondarySkillA = "secondary"] = ["skill1", "skill2"] : [string, string] >[ primarySkillA = "primary", secondarySkillA = "secondary"] : [string, string] primarySkillA = "primary", ->primarySkillA = "primary" : string +>primarySkillA = "primary" : "primary" >primarySkillA : string ->"primary" : string +>"primary" : "primary" secondarySkillA = "secondary" ->secondarySkillA = "secondary" : string +>secondarySkillA = "secondary" : "secondary" >secondarySkillA : string ->"secondary" : string +>"secondary" : "secondary" ] = ["skill1", "skill2"]] of multiRobots) { >["skill1", "skill2"] : [string, string] ->"skill1" : string ->"skill2" : string +>"skill1" : "skill1" +>"skill2" : "skill2" >multiRobots : [string, [string, string]][] console.log(nameMA); @@ -424,26 +424,26 @@ for ([nameMA = "noName", [ } for ([nameMA = "noName", [ >[nameMA = "noName", [ primarySkillA = "primary", secondarySkillA = "secondary"] = ["skill1", "skill2"]] : [string, [string, string]] ->nameMA = "noName" : string +>nameMA = "noName" : "noName" >nameMA : string ->"noName" : string +>"noName" : "noName" >[ primarySkillA = "primary", secondarySkillA = "secondary"] = ["skill1", "skill2"] : [string, string] >[ primarySkillA = "primary", secondarySkillA = "secondary"] : [string, string] primarySkillA = "primary", ->primarySkillA = "primary" : string +>primarySkillA = "primary" : "primary" >primarySkillA : string ->"primary" : string +>"primary" : "primary" secondarySkillA = "secondary" ->secondarySkillA = "secondary" : string +>secondarySkillA = "secondary" : "secondary" >secondarySkillA : string ->"secondary" : string +>"secondary" : "secondary" ] = ["skill1", "skill2"]] of getMultiRobots()) { >["skill1", "skill2"] : [string, string] ->"skill1" : string ->"skill2" : string +>"skill1" : "skill1" +>"skill2" : "skill2" >getMultiRobots() : [string, [string, string]][] >getMultiRobots : () => [string, [string, string]][] @@ -456,26 +456,26 @@ for ([nameMA = "noName", [ } for ([nameMA = "noName", [ >[nameMA = "noName", [ primarySkillA = "primary", secondarySkillA = "secondary"] = ["skill1", "skill2"]] : [string, [string, string]] ->nameMA = "noName" : string +>nameMA = "noName" : "noName" >nameMA : string ->"noName" : string +>"noName" : "noName" >[ primarySkillA = "primary", secondarySkillA = "secondary"] = ["skill1", "skill2"] : [string, string] >[ primarySkillA = "primary", secondarySkillA = "secondary"] : [string, string] primarySkillA = "primary", ->primarySkillA = "primary" : string +>primarySkillA = "primary" : "primary" >primarySkillA : string ->"primary" : string +>"primary" : "primary" secondarySkillA = "secondary" ->secondarySkillA = "secondary" : string +>secondarySkillA = "secondary" : "secondary" >secondarySkillA : string ->"secondary" : string +>"secondary" : "secondary" ] = ["skill1", "skill2"]] of [multiRobotA, multiRobotB]) { >["skill1", "skill2"] : [string, string] ->"skill1" : string ->"skill2" : string +>"skill1" : "skill1" +>"skill2" : "skill2" >[multiRobotA, multiRobotB] : [string, [string, string]][] >multiRobotA : [string, [string, string]] >multiRobotB : [string, [string, string]] @@ -490,10 +490,10 @@ for ([nameMA = "noName", [ for ([numberA3 = -1, ...robotAInfo] of robots) { >[numberA3 = -1, ...robotAInfo] : (string | number)[] ->numberA3 = -1 : number +>numberA3 = -1 : -1 >numberA3 : number ->-1 : number ->1 : number +>-1 : -1 +>1 : 1 >...robotAInfo : string | number >robotAInfo : (string | number)[] >robots : [number, string, string][] @@ -507,10 +507,10 @@ for ([numberA3 = -1, ...robotAInfo] of robots) { } for ([numberA3 = -1, ...robotAInfo] of getRobots()) { >[numberA3 = -1, ...robotAInfo] : (string | number)[] ->numberA3 = -1 : number +>numberA3 = -1 : -1 >numberA3 : number ->-1 : number ->1 : number +>-1 : -1 +>1 : 1 >...robotAInfo : string | number >robotAInfo : (string | number)[] >getRobots() : [number, string, string][] @@ -525,10 +525,10 @@ for ([numberA3 = -1, ...robotAInfo] of getRobots()) { } for ([numberA3 = -1, ...robotAInfo] of [robotA, robotB]) { >[numberA3 = -1, ...robotAInfo] : (string | number)[] ->numberA3 = -1 : number +>numberA3 = -1 : -1 >numberA3 : number ->-1 : number ->1 : number +>-1 : -1 +>1 : 1 >...robotAInfo : string | number >robotAInfo : (string | number)[] >[robotA, robotB] : [number, string, string][] diff --git a/tests/baselines/reference/sourceMapValidationDestructuringForOfObjectBindingPattern.types b/tests/baselines/reference/sourceMapValidationDestructuringForOfObjectBindingPattern.types index 17c060225dc..26d570974df 100644 --- a/tests/baselines/reference/sourceMapValidationDestructuringForOfObjectBindingPattern.types +++ b/tests/baselines/reference/sourceMapValidationDestructuringForOfObjectBindingPattern.types @@ -40,14 +40,14 @@ let robots: Robot[] = [{ name: "mower", skill: "mowing" }, { name: "trimmer", sk >[{ name: "mower", skill: "mowing" }, { name: "trimmer", skill: "trimming" }] : { name: string; skill: string; }[] >{ name: "mower", skill: "mowing" } : { name: string; skill: string; } >name : string ->"mower" : string +>"mower" : "mower" >skill : string ->"mowing" : string +>"mowing" : "mowing" >{ name: "trimmer", skill: "trimming" } : { name: string; skill: string; } >name : string ->"trimmer" : string +>"trimmer" : "trimmer" >skill : string ->"trimming" : string +>"trimming" : "trimming" let multiRobots: MultiRobot[] = [{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, >multiRobots : MultiRobot[] @@ -55,24 +55,24 @@ let multiRobots: MultiRobot[] = [{ name: "mower", skills: { primary: "mowing", s >[{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }] : { name: string; skills: { primary: string; secondary: string; }; }[] >{ name: "mower", skills: { primary: "mowing", secondary: "none" } } : { name: string; skills: { primary: string; secondary: string; }; } >name : string ->"mower" : string +>"mower" : "mower" >skills : { primary: string; secondary: string; } >{ primary: "mowing", secondary: "none" } : { primary: string; secondary: string; } >primary : string ->"mowing" : string +>"mowing" : "mowing" >secondary : string ->"none" : string +>"none" : "none" { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }]; >{ name: "trimmer", skills: { primary: "trimming", secondary: "edging" } } : { name: string; skills: { primary: string; secondary: string; }; } >name : string ->"trimmer" : string +>"trimmer" : "trimmer" >skills : { primary: string; secondary: string; } >{ primary: "trimming", secondary: "edging" } : { primary: string; secondary: string; } >primary : string ->"trimming" : string +>"trimming" : "trimming" >secondary : string ->"edging" : string +>"edging" : "edging" function getRobots() { >getRobots : () => Robot[] @@ -119,14 +119,14 @@ for (let {name: nameA } of [{ name: "mower", skill: "mowing" }, { name: "trimmer >[{ name: "mower", skill: "mowing" }, { name: "trimmer", skill: "trimming" }] : { name: string; skill: string; }[] >{ name: "mower", skill: "mowing" } : { name: string; skill: string; } >name : string ->"mower" : string +>"mower" : "mower" >skill : string ->"mowing" : string +>"mowing" : "mowing" >{ name: "trimmer", skill: "trimming" } : { name: string; skill: string; } >name : string ->"trimmer" : string +>"trimmer" : "trimmer" >skill : string ->"trimming" : string +>"trimming" : "trimming" console.log(nameA); >console.log(nameA) : void @@ -175,24 +175,24 @@ for (let { skills: { primary: primaryA, secondary: secondaryA } } of [{ name: "m >[{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }] : { name: string; skills: { primary: string; secondary: string; }; }[] >{ name: "mower", skills: { primary: "mowing", secondary: "none" } } : { name: string; skills: { primary: string; secondary: string; }; } >name : string ->"mower" : string +>"mower" : "mower" >skills : { primary: string; secondary: string; } >{ primary: "mowing", secondary: "none" } : { primary: string; secondary: string; } >primary : string ->"mowing" : string +>"mowing" : "mowing" >secondary : string ->"none" : string +>"none" : "none" { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }]) { >{ name: "trimmer", skills: { primary: "trimming", secondary: "edging" } } : { name: string; skills: { primary: string; secondary: string; }; } >name : string ->"trimmer" : string +>"trimmer" : "trimmer" >skills : { primary: string; secondary: string; } >{ primary: "trimming", secondary: "edging" } : { primary: string; secondary: string; } >primary : string ->"trimming" : string +>"trimming" : "trimming" >secondary : string ->"edging" : string +>"edging" : "edging" console.log(primaryA); >console.log(primaryA) : void @@ -239,14 +239,14 @@ for (let {name: nameA, skill: skillA } of [{ name: "mower", skill: "mowing" }, { >[{ name: "mower", skill: "mowing" }, { name: "trimmer", skill: "trimming" }] : { name: string; skill: string; }[] >{ name: "mower", skill: "mowing" } : { name: string; skill: string; } >name : string ->"mower" : string +>"mower" : "mower" >skill : string ->"mowing" : string +>"mowing" : "mowing" >{ name: "trimmer", skill: "trimming" } : { name: string; skill: string; } >name : string ->"trimmer" : string +>"trimmer" : "trimmer" >skill : string ->"trimming" : string +>"trimming" : "trimming" console.log(nameA); >console.log(nameA) : void @@ -301,24 +301,24 @@ for (let {name: nameA, skills: { primary: primaryA, secondary: secondaryA } } of >[{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }] : { name: string; skills: { primary: string; secondary: string; }; }[] >{ name: "mower", skills: { primary: "mowing", secondary: "none" } } : { name: string; skills: { primary: string; secondary: string; }; } >name : string ->"mower" : string +>"mower" : "mower" >skills : { primary: string; secondary: string; } >{ primary: "mowing", secondary: "none" } : { primary: string; secondary: string; } >primary : string ->"mowing" : string +>"mowing" : "mowing" >secondary : string ->"none" : string +>"none" : "none" { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }]) { >{ name: "trimmer", skills: { primary: "trimming", secondary: "edging" } } : { name: string; skills: { primary: string; secondary: string; }; } >name : string ->"trimmer" : string +>"trimmer" : "trimmer" >skills : { primary: string; secondary: string; } >{ primary: "trimming", secondary: "edging" } : { primary: string; secondary: string; } >primary : string ->"trimming" : string +>"trimming" : "trimming" >secondary : string ->"edging" : string +>"edging" : "edging" console.log(nameA); >console.log(nameA) : void diff --git a/tests/baselines/reference/sourceMapValidationDestructuringForOfObjectBindingPattern2.types b/tests/baselines/reference/sourceMapValidationDestructuringForOfObjectBindingPattern2.types index 1f292542545..64680d66001 100644 --- a/tests/baselines/reference/sourceMapValidationDestructuringForOfObjectBindingPattern2.types +++ b/tests/baselines/reference/sourceMapValidationDestructuringForOfObjectBindingPattern2.types @@ -40,14 +40,14 @@ let robots: Robot[] = [{ name: "mower", skill: "mowing" }, { name: "trimmer", sk >[{ name: "mower", skill: "mowing" }, { name: "trimmer", skill: "trimming" }] : { name: string; skill: string; }[] >{ name: "mower", skill: "mowing" } : { name: string; skill: string; } >name : string ->"mower" : string +>"mower" : "mower" >skill : string ->"mowing" : string +>"mowing" : "mowing" >{ name: "trimmer", skill: "trimming" } : { name: string; skill: string; } >name : string ->"trimmer" : string +>"trimmer" : "trimmer" >skill : string ->"trimming" : string +>"trimming" : "trimming" let multiRobots: MultiRobot[] = [{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, >multiRobots : MultiRobot[] @@ -55,24 +55,24 @@ let multiRobots: MultiRobot[] = [{ name: "mower", skills: { primary: "mowing", s >[{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }] : { name: string; skills: { primary: string; secondary: string; }; }[] >{ name: "mower", skills: { primary: "mowing", secondary: "none" } } : { name: string; skills: { primary: string; secondary: string; }; } >name : string ->"mower" : string +>"mower" : "mower" >skills : { primary: string; secondary: string; } >{ primary: "mowing", secondary: "none" } : { primary: string; secondary: string; } >primary : string ->"mowing" : string +>"mowing" : "mowing" >secondary : string ->"none" : string +>"none" : "none" { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }]; >{ name: "trimmer", skills: { primary: "trimming", secondary: "edging" } } : { name: string; skills: { primary: string; secondary: string; }; } >name : string ->"trimmer" : string +>"trimmer" : "trimmer" >skills : { primary: string; secondary: string; } >{ primary: "trimming", secondary: "edging" } : { primary: string; secondary: string; } >primary : string ->"trimming" : string +>"trimming" : "trimming" >secondary : string ->"edging" : string +>"edging" : "edging" function getRobots() { >getRobots : () => Robot[] @@ -135,14 +135,14 @@ for ({name: nameA } of [{ name: "mower", skill: "mowing" }, { name: "trimmer", s >[{ name: "mower", skill: "mowing" }, { name: "trimmer", skill: "trimming" }] : { name: string; skill: string; }[] >{ name: "mower", skill: "mowing" } : { name: string; skill: string; } >name : string ->"mower" : string +>"mower" : "mower" >skill : string ->"mowing" : string +>"mowing" : "mowing" >{ name: "trimmer", skill: "trimming" } : { name: string; skill: string; } >name : string ->"trimmer" : string +>"trimmer" : "trimmer" >skill : string ->"trimming" : string +>"trimming" : "trimming" console.log(nameA); >console.log(nameA) : void @@ -197,24 +197,24 @@ for ({ skills: { primary: primaryA, secondary: secondaryA } } of [{ name: "mower >[{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }] : { name: string; skills: { primary: string; secondary: string; }; }[] >{ name: "mower", skills: { primary: "mowing", secondary: "none" } } : { name: string; skills: { primary: string; secondary: string; }; } >name : string ->"mower" : string +>"mower" : "mower" >skills : { primary: string; secondary: string; } >{ primary: "mowing", secondary: "none" } : { primary: string; secondary: string; } >primary : string ->"mowing" : string +>"mowing" : "mowing" >secondary : string ->"none" : string +>"none" : "none" { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }]) { >{ name: "trimmer", skills: { primary: "trimming", secondary: "edging" } } : { name: string; skills: { primary: string; secondary: string; }; } >name : string ->"trimmer" : string +>"trimmer" : "trimmer" >skills : { primary: string; secondary: string; } >{ primary: "trimming", secondary: "edging" } : { primary: string; secondary: string; } >primary : string ->"trimming" : string +>"trimming" : "trimming" >secondary : string ->"edging" : string +>"edging" : "edging" console.log(primaryA); >console.log(primaryA) : void @@ -254,14 +254,14 @@ for ({name } of [{ name: "mower", skill: "mowing" }, { name: "trimmer", skill: " >[{ name: "mower", skill: "mowing" }, { name: "trimmer", skill: "trimming" }] : { name: string; skill: string; }[] >{ name: "mower", skill: "mowing" } : { name: string; skill: string; } >name : string ->"mower" : string +>"mower" : "mower" >skill : string ->"mowing" : string +>"mowing" : "mowing" >{ name: "trimmer", skill: "trimming" } : { name: string; skill: string; } >name : string ->"trimmer" : string +>"trimmer" : "trimmer" >skill : string ->"trimming" : string +>"trimming" : "trimming" console.log(nameA); >console.log(nameA) : void @@ -310,24 +310,24 @@ for ({ skills: { primary, secondary } } of [{ name: "mower", skills: { primary: >[{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }] : { name: string; skills: { primary: string; secondary: string; }; }[] >{ name: "mower", skills: { primary: "mowing", secondary: "none" } } : { name: string; skills: { primary: string; secondary: string; }; } >name : string ->"mower" : string +>"mower" : "mower" >skills : { primary: string; secondary: string; } >{ primary: "mowing", secondary: "none" } : { primary: string; secondary: string; } >primary : string ->"mowing" : string +>"mowing" : "mowing" >secondary : string ->"none" : string +>"none" : "none" { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }]) { >{ name: "trimmer", skills: { primary: "trimming", secondary: "edging" } } : { name: string; skills: { primary: string; secondary: string; }; } >name : string ->"trimmer" : string +>"trimmer" : "trimmer" >skills : { primary: string; secondary: string; } >{ primary: "trimming", secondary: "edging" } : { primary: string; secondary: string; } >primary : string ->"trimming" : string +>"trimming" : "trimming" >secondary : string ->"edging" : string +>"edging" : "edging" console.log(primaryA); >console.log(primaryA) : void @@ -378,14 +378,14 @@ for ({name: nameA, skill: skillA } of [{ name: "mower", skill: "mowing" }, { nam >[{ name: "mower", skill: "mowing" }, { name: "trimmer", skill: "trimming" }] : { name: string; skill: string; }[] >{ name: "mower", skill: "mowing" } : { name: string; skill: string; } >name : string ->"mower" : string +>"mower" : "mower" >skill : string ->"mowing" : string +>"mowing" : "mowing" >{ name: "trimmer", skill: "trimming" } : { name: string; skill: string; } >name : string ->"trimmer" : string +>"trimmer" : "trimmer" >skill : string ->"trimming" : string +>"trimming" : "trimming" console.log(nameA); >console.log(nameA) : void @@ -446,24 +446,24 @@ for ({name: nameA, skills: { primary: primaryA, secondary: secondaryA } } of [{ >[{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }] : { name: string; skills: { primary: string; secondary: string; }; }[] >{ name: "mower", skills: { primary: "mowing", secondary: "none" } } : { name: string; skills: { primary: string; secondary: string; }; } >name : string ->"mower" : string +>"mower" : "mower" >skills : { primary: string; secondary: string; } >{ primary: "mowing", secondary: "none" } : { primary: string; secondary: string; } >primary : string ->"mowing" : string +>"mowing" : "mowing" >secondary : string ->"none" : string +>"none" : "none" { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }]) { >{ name: "trimmer", skills: { primary: "trimming", secondary: "edging" } } : { name: string; skills: { primary: string; secondary: string; }; } >name : string ->"trimmer" : string +>"trimmer" : "trimmer" >skills : { primary: string; secondary: string; } >{ primary: "trimming", secondary: "edging" } : { primary: string; secondary: string; } >primary : string ->"trimming" : string +>"trimming" : "trimming" >secondary : string ->"edging" : string +>"edging" : "edging" console.log(nameA); >console.log(nameA) : void @@ -506,14 +506,14 @@ for ({name, skill } of [{ name: "mower", skill: "mowing" }, { name: "trimmer", s >[{ name: "mower", skill: "mowing" }, { name: "trimmer", skill: "trimming" }] : { name: string; skill: string; }[] >{ name: "mower", skill: "mowing" } : { name: string; skill: string; } >name : string ->"mower" : string +>"mower" : "mower" >skill : string ->"mowing" : string +>"mowing" : "mowing" >{ name: "trimmer", skill: "trimming" } : { name: string; skill: string; } >name : string ->"trimmer" : string +>"trimmer" : "trimmer" >skill : string ->"trimming" : string +>"trimming" : "trimming" console.log(nameA); >console.log(nameA) : void @@ -565,24 +565,24 @@ for ({name, skills: { primary, secondary } } of [{ name: "mower", skills: { prim >[{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }] : { name: string; skills: { primary: string; secondary: string; }; }[] >{ name: "mower", skills: { primary: "mowing", secondary: "none" } } : { name: string; skills: { primary: string; secondary: string; }; } >name : string ->"mower" : string +>"mower" : "mower" >skills : { primary: string; secondary: string; } >{ primary: "mowing", secondary: "none" } : { primary: string; secondary: string; } >primary : string ->"mowing" : string +>"mowing" : "mowing" >secondary : string ->"none" : string +>"none" : "none" { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }]) { >{ name: "trimmer", skills: { primary: "trimming", secondary: "edging" } } : { name: string; skills: { primary: string; secondary: string; }; } >name : string ->"trimmer" : string +>"trimmer" : "trimmer" >skills : { primary: string; secondary: string; } >{ primary: "trimming", secondary: "edging" } : { primary: string; secondary: string; } >primary : string ->"trimming" : string +>"trimming" : "trimming" >secondary : string ->"edging" : string +>"edging" : "edging" console.log(nameA); >console.log(nameA) : void diff --git a/tests/baselines/reference/sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues.types b/tests/baselines/reference/sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues.types index 36f67f946f0..d55ab46cbd2 100644 --- a/tests/baselines/reference/sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues.types +++ b/tests/baselines/reference/sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues.types @@ -40,14 +40,14 @@ let robots: Robot[] = [{ name: "mower", skill: "mowing" }, { name: "trimmer", sk >[{ name: "mower", skill: "mowing" }, { name: "trimmer", skill: "trimming" }] : { name: string; skill: string; }[] >{ name: "mower", skill: "mowing" } : { name: string; skill: string; } >name : string ->"mower" : string +>"mower" : "mower" >skill : string ->"mowing" : string +>"mowing" : "mowing" >{ name: "trimmer", skill: "trimming" } : { name: string; skill: string; } >name : string ->"trimmer" : string +>"trimmer" : "trimmer" >skill : string ->"trimming" : string +>"trimming" : "trimming" let multiRobots: MultiRobot[] = [{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, >multiRobots : MultiRobot[] @@ -55,24 +55,24 @@ let multiRobots: MultiRobot[] = [{ name: "mower", skills: { primary: "mowing", s >[{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }] : { name: string; skills: { primary: string; secondary: string; }; }[] >{ name: "mower", skills: { primary: "mowing", secondary: "none" } } : { name: string; skills: { primary: string; secondary: string; }; } >name : string ->"mower" : string +>"mower" : "mower" >skills : { primary: string; secondary: string; } >{ primary: "mowing", secondary: "none" } : { primary: string; secondary: string; } >primary : string ->"mowing" : string +>"mowing" : "mowing" >secondary : string ->"none" : string +>"none" : "none" { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }]; >{ name: "trimmer", skills: { primary: "trimming", secondary: "edging" } } : { name: string; skills: { primary: string; secondary: string; }; } >name : string ->"trimmer" : string +>"trimmer" : "trimmer" >skills : { primary: string; secondary: string; } >{ primary: "trimming", secondary: "edging" } : { primary: string; secondary: string; } >primary : string ->"trimming" : string +>"trimming" : "trimming" >secondary : string ->"edging" : string +>"edging" : "edging" function getRobots() { >getRobots : () => Robot[] @@ -91,7 +91,7 @@ function getMultiRobots() { for (let {name: nameA = "noName" } of robots) { >name : any >nameA : string ->"noName" : string +>"noName" : "noName" >robots : Robot[] console.log(nameA); @@ -104,7 +104,7 @@ for (let {name: nameA = "noName" } of robots) { for (let {name: nameA = "noName" } of getRobots()) { >name : any >nameA : string ->"noName" : string +>"noName" : "noName" >getRobots() : Robot[] >getRobots : () => Robot[] @@ -118,18 +118,18 @@ for (let {name: nameA = "noName" } of getRobots()) { for (let {name: nameA = "noName" } of [{ name: "mower", skill: "mowing" }, { name: "trimmer", skill: "trimming" }]) { >name : any >nameA : string ->"noName" : string +>"noName" : "noName" >[{ name: "mower", skill: "mowing" }, { name: "trimmer", skill: "trimming" }] : { name: string; skill: string; }[] >{ name: "mower", skill: "mowing" } : { name: string; skill: string; } >name : string ->"mower" : string +>"mower" : "mower" >skill : string ->"mowing" : string +>"mowing" : "mowing" >{ name: "trimmer", skill: "trimming" } : { name: string; skill: string; } >name : string ->"trimmer" : string +>"trimmer" : "trimmer" >skill : string ->"trimming" : string +>"trimming" : "trimming" console.log(nameA); >console.log(nameA) : void @@ -142,17 +142,17 @@ for (let { skills: { primary: primaryA = "primary", secondary: secondaryA = "sec >skills : any >primary : any >primaryA : string ->"primary" : string +>"primary" : "primary" >secondary : any >secondaryA : string ->"secondary" : string +>"secondary" : "secondary" { primary: "nosKill", secondary: "noSkill" } } of multiRobots) { >{ primary: "nosKill", secondary: "noSkill" } : { primary?: string; secondary?: string; } >primary : string ->"nosKill" : string +>"nosKill" : "nosKill" >secondary : string ->"noSkill" : string +>"noSkill" : "noSkill" >multiRobots : MultiRobot[] console.log(primaryA); @@ -166,17 +166,17 @@ for (let { skills: { primary: primaryA = "primary", secondary: secondaryA = "sec >skills : any >primary : any >primaryA : string ->"primary" : string +>"primary" : "primary" >secondary : any >secondaryA : string ->"secondary" : string +>"secondary" : "secondary" { primary: "nosKill", secondary: "noSkill" } } of getMultiRobots()) { >{ primary: "nosKill", secondary: "noSkill" } : { primary?: string; secondary?: string; } >primary : string ->"nosKill" : string +>"nosKill" : "nosKill" >secondary : string ->"noSkill" : string +>"noSkill" : "noSkill" >getMultiRobots() : MultiRobot[] >getMultiRobots : () => MultiRobot[] @@ -191,17 +191,17 @@ for (let { skills: { primary: primaryA = "primary", secondary: secondaryA = "sec >skills : any >primary : any >primaryA : string ->"primary" : string +>"primary" : "primary" >secondary : any >secondaryA : string ->"secondary" : string +>"secondary" : "secondary" { primary: "nosKill", secondary: "noSkill" } } of >{ primary: "nosKill", secondary: "noSkill" } : { primary?: string; secondary?: string; } >primary : string ->"nosKill" : string +>"nosKill" : "nosKill" >secondary : string ->"noSkill" : string +>"noSkill" : "noSkill" [{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, >[{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }] : MultiRobot[] @@ -209,24 +209,24 @@ for (let { skills: { primary: primaryA = "primary", secondary: secondaryA = "sec >[{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }] : { name: string; skills: { primary: string; secondary: string; }; }[] >{ name: "mower", skills: { primary: "mowing", secondary: "none" } } : { name: string; skills: { primary: string; secondary: string; }; } >name : string ->"mower" : string +>"mower" : "mower" >skills : { primary: string; secondary: string; } >{ primary: "mowing", secondary: "none" } : { primary: string; secondary: string; } >primary : string ->"mowing" : string +>"mowing" : "mowing" >secondary : string ->"none" : string +>"none" : "none" { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }]) { >{ name: "trimmer", skills: { primary: "trimming", secondary: "edging" } } : { name: string; skills: { primary: string; secondary: string; }; } >name : string ->"trimmer" : string +>"trimmer" : "trimmer" >skills : { primary: string; secondary: string; } >{ primary: "trimming", secondary: "edging" } : { primary: string; secondary: string; } >primary : string ->"trimming" : string +>"trimming" : "trimming" >secondary : string ->"edging" : string +>"edging" : "edging" console.log(primaryA); >console.log(primaryA) : void @@ -239,10 +239,10 @@ for (let { skills: { primary: primaryA = "primary", secondary: secondaryA = "sec for (let {name: nameA = "noName", skill: skillA = "noSkill" } of robots) { >name : any >nameA : string ->"noName" : string +>"noName" : "noName" >skill : any >skillA : string ->"noSkill" : string +>"noSkill" : "noSkill" >robots : Robot[] console.log(nameA); @@ -255,10 +255,10 @@ for (let {name: nameA = "noName", skill: skillA = "noSkill" } of robots) { for (let {name: nameA = "noName", skill: skillA = "noSkill" } of getRobots()) { >name : any >nameA : string ->"noName" : string +>"noName" : "noName" >skill : any >skillA : string ->"noSkill" : string +>"noSkill" : "noSkill" >getRobots() : Robot[] >getRobots : () => Robot[] @@ -272,21 +272,21 @@ for (let {name: nameA = "noName", skill: skillA = "noSkill" } of getRobots()) { for (let {name: nameA = "noName", skill: skillA = "noSkill" } of [{ name: "mower", skill: "mowing" }, { name: "trimmer", skill: "trimming" }]) { >name : any >nameA : string ->"noName" : string +>"noName" : "noName" >skill : any >skillA : string ->"noSkill" : string +>"noSkill" : "noSkill" >[{ name: "mower", skill: "mowing" }, { name: "trimmer", skill: "trimming" }] : { name: string; skill: string; }[] >{ name: "mower", skill: "mowing" } : { name: string; skill: string; } >name : string ->"mower" : string +>"mower" : "mower" >skill : string ->"mowing" : string +>"mowing" : "mowing" >{ name: "trimmer", skill: "trimming" } : { name: string; skill: string; } >name : string ->"trimmer" : string +>"trimmer" : "trimmer" >skill : string ->"trimming" : string +>"trimming" : "trimming" console.log(nameA); >console.log(nameA) : void @@ -299,7 +299,7 @@ for (let { name: nameA = "noName", >name : any >nameA : string ->"noName" : string +>"noName" : "noName" skills: { >skills : any @@ -307,19 +307,19 @@ for (let { primary: primaryA = "primary", >primary : any >primaryA : string ->"primary" : string +>"primary" : "primary" secondary: secondaryA = "secondary" >secondary : any >secondaryA : string ->"secondary" : string +>"secondary" : "secondary" } = { primary: "noSkill", secondary: "noSkill" } >{ primary: "noSkill", secondary: "noSkill" } : { primary?: string; secondary?: string; } >primary : string ->"noSkill" : string +>"noSkill" : "noSkill" >secondary : string ->"noSkill" : string +>"noSkill" : "noSkill" } of multiRobots) { >multiRobots : MultiRobot[] @@ -335,7 +335,7 @@ for (let { name: nameA = "noName", >name : any >nameA : string ->"noName" : string +>"noName" : "noName" skills: { >skills : any @@ -343,19 +343,19 @@ for (let { primary: primaryA = "primary", >primary : any >primaryA : string ->"primary" : string +>"primary" : "primary" secondary: secondaryA = "secondary" >secondary : any >secondaryA : string ->"secondary" : string +>"secondary" : "secondary" } = { primary: "noSkill", secondary: "noSkill" } >{ primary: "noSkill", secondary: "noSkill" } : { primary?: string; secondary?: string; } >primary : string ->"noSkill" : string +>"noSkill" : "noSkill" >secondary : string ->"noSkill" : string +>"noSkill" : "noSkill" } of getMultiRobots()) { >getMultiRobots() : MultiRobot[] @@ -372,7 +372,7 @@ for (let { name: nameA = "noName", >name : any >nameA : string ->"noName" : string +>"noName" : "noName" skills: { >skills : any @@ -380,19 +380,19 @@ for (let { primary: primaryA = "primary", >primary : any >primaryA : string ->"primary" : string +>"primary" : "primary" secondary: secondaryA = "secondary" >secondary : any >secondaryA : string ->"secondary" : string +>"secondary" : "secondary" } = { primary: "noSkill", secondary: "noSkill" } >{ primary: "noSkill", secondary: "noSkill" } : { primary?: string; secondary?: string; } >primary : string ->"noSkill" : string +>"noSkill" : "noSkill" >secondary : string ->"noSkill" : string +>"noSkill" : "noSkill" } of [{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, >[{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }] : MultiRobot[] @@ -400,24 +400,24 @@ for (let { >[{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }] : { name: string; skills: { primary: string; secondary: string; }; }[] >{ name: "mower", skills: { primary: "mowing", secondary: "none" } } : { name: string; skills: { primary: string; secondary: string; }; } >name : string ->"mower" : string +>"mower" : "mower" >skills : { primary: string; secondary: string; } >{ primary: "mowing", secondary: "none" } : { primary: string; secondary: string; } >primary : string ->"mowing" : string +>"mowing" : "mowing" >secondary : string ->"none" : string +>"none" : "none" { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }]) { >{ name: "trimmer", skills: { primary: "trimming", secondary: "edging" } } : { name: string; skills: { primary: string; secondary: string; }; } >name : string ->"trimmer" : string +>"trimmer" : "trimmer" >skills : { primary: string; secondary: string; } >{ primary: "trimming", secondary: "edging" } : { primary: string; secondary: string; } >primary : string ->"trimming" : string +>"trimming" : "trimming" >secondary : string ->"edging" : string +>"edging" : "edging" console.log(nameA); >console.log(nameA) : void diff --git a/tests/baselines/reference/sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.types b/tests/baselines/reference/sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.types index adb5d515fe4..6119665124d 100644 --- a/tests/baselines/reference/sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.types +++ b/tests/baselines/reference/sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.types @@ -40,14 +40,14 @@ let robots: Robot[] = [{ name: "mower", skill: "mowing" }, { name: "trimmer", sk >[{ name: "mower", skill: "mowing" }, { name: "trimmer", skill: "trimming" }] : { name: string; skill: string; }[] >{ name: "mower", skill: "mowing" } : { name: string; skill: string; } >name : string ->"mower" : string +>"mower" : "mower" >skill : string ->"mowing" : string +>"mowing" : "mowing" >{ name: "trimmer", skill: "trimming" } : { name: string; skill: string; } >name : string ->"trimmer" : string +>"trimmer" : "trimmer" >skill : string ->"trimming" : string +>"trimming" : "trimming" let multiRobots: MultiRobot[] = [{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, >multiRobots : MultiRobot[] @@ -55,24 +55,24 @@ let multiRobots: MultiRobot[] = [{ name: "mower", skills: { primary: "mowing", s >[{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }] : { name: string; skills: { primary: string; secondary: string; }; }[] >{ name: "mower", skills: { primary: "mowing", secondary: "none" } } : { name: string; skills: { primary: string; secondary: string; }; } >name : string ->"mower" : string +>"mower" : "mower" >skills : { primary: string; secondary: string; } >{ primary: "mowing", secondary: "none" } : { primary: string; secondary: string; } >primary : string ->"mowing" : string +>"mowing" : "mowing" >secondary : string ->"none" : string +>"none" : "none" { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }]; >{ name: "trimmer", skills: { primary: "trimming", secondary: "edging" } } : { name: string; skills: { primary: string; secondary: string; }; } >name : string ->"trimmer" : string +>"trimmer" : "trimmer" >skills : { primary: string; secondary: string; } >{ primary: "trimming", secondary: "edging" } : { primary: string; secondary: string; } >primary : string ->"trimming" : string +>"trimming" : "trimming" >secondary : string ->"edging" : string +>"edging" : "edging" function getRobots() { >getRobots : () => Robot[] @@ -104,9 +104,9 @@ let name: string, primary: string, secondary: string, skill: string; for ({name: nameA = "noName" } of robots) { >{name: nameA = "noName" } : { name?: string; } >name : Robot ->nameA = "noName" : string +>nameA = "noName" : "noName" >nameA : string ->"noName" : string +>"noName" : "noName" >robots : Robot[] console.log(nameA); @@ -119,9 +119,9 @@ for ({name: nameA = "noName" } of robots) { for ({name: nameA = "noName" } of getRobots()) { >{name: nameA = "noName" } : { name?: string; } >name : Robot ->nameA = "noName" : string +>nameA = "noName" : "noName" >nameA : string ->"noName" : string +>"noName" : "noName" >getRobots() : Robot[] >getRobots : () => Robot[] @@ -135,20 +135,20 @@ for ({name: nameA = "noName" } of getRobots()) { for ({name: nameA = "noName" } of [{ name: "mower", skill: "mowing" }, { name: "trimmer", skill: "trimming" }]) { >{name: nameA = "noName" } : { name?: string; } >name : { name: string; skill: string; } ->nameA = "noName" : string +>nameA = "noName" : "noName" >nameA : string ->"noName" : string +>"noName" : "noName" >[{ name: "mower", skill: "mowing" }, { name: "trimmer", skill: "trimming" }] : { name: string; skill: string; }[] >{ name: "mower", skill: "mowing" } : { name: string; skill: string; } >name : string ->"mower" : string +>"mower" : "mower" >skill : string ->"mowing" : string +>"mowing" : "mowing" >{ name: "trimmer", skill: "trimming" } : { name: string; skill: string; } >name : string ->"trimmer" : string +>"trimmer" : "trimmer" >skill : string ->"trimming" : string +>"trimming" : "trimming" console.log(nameA); >console.log(nameA) : void @@ -163,20 +163,20 @@ for ({ skills: { primary: primaryA = "primary", secondary: secondaryA = "seconda >{ primary: primaryA = "primary", secondary: secondaryA = "secondary" } = { primary: "nosKill", secondary: "noSkill" } : { primary?: string; secondary?: string; } >{ primary: primaryA = "primary", secondary: secondaryA = "secondary" } : { primary?: string; secondary?: string; } >primary : string ->primaryA = "primary" : string +>primaryA = "primary" : "primary" >primaryA : string ->"primary" : string +>"primary" : "primary" >secondary : string ->secondaryA = "secondary" : string +>secondaryA = "secondary" : "secondary" >secondaryA : string ->"secondary" : string +>"secondary" : "secondary" { primary: "nosKill", secondary: "noSkill" } } of multiRobots) { >{ primary: "nosKill", secondary: "noSkill" } : { primary?: string; secondary?: string; } >primary : string ->"nosKill" : string +>"nosKill" : "nosKill" >secondary : string ->"noSkill" : string +>"noSkill" : "noSkill" >multiRobots : MultiRobot[] console.log(primaryA); @@ -192,20 +192,20 @@ for ({ skills: { primary: primaryA = "primary", secondary: secondaryA = "seconda >{ primary: primaryA = "primary", secondary: secondaryA = "secondary" } = { primary: "nosKill", secondary: "noSkill" } : { primary?: string; secondary?: string; } >{ primary: primaryA = "primary", secondary: secondaryA = "secondary" } : { primary?: string; secondary?: string; } >primary : string ->primaryA = "primary" : string +>primaryA = "primary" : "primary" >primaryA : string ->"primary" : string +>"primary" : "primary" >secondary : string ->secondaryA = "secondary" : string +>secondaryA = "secondary" : "secondary" >secondaryA : string ->"secondary" : string +>"secondary" : "secondary" { primary: "nosKill", secondary: "noSkill" } } of getMultiRobots()) { >{ primary: "nosKill", secondary: "noSkill" } : { primary?: string; secondary?: string; } >primary : string ->"nosKill" : string +>"nosKill" : "nosKill" >secondary : string ->"noSkill" : string +>"noSkill" : "noSkill" >getMultiRobots() : MultiRobot[] >getMultiRobots : () => MultiRobot[] @@ -222,20 +222,20 @@ for ({ skills: { primary: primaryA = "primary", secondary: secondaryA = "seconda >{ primary: primaryA = "primary", secondary: secondaryA = "secondary" } = { primary: "nosKill", secondary: "noSkill" } : { primary?: string; secondary?: string; } >{ primary: primaryA = "primary", secondary: secondaryA = "secondary" } : { primary?: string; secondary?: string; } >primary : string ->primaryA = "primary" : string +>primaryA = "primary" : "primary" >primaryA : string ->"primary" : string +>"primary" : "primary" >secondary : string ->secondaryA = "secondary" : string +>secondaryA = "secondary" : "secondary" >secondaryA : string ->"secondary" : string +>"secondary" : "secondary" { primary: "nosKill", secondary: "noSkill" } } of >{ primary: "nosKill", secondary: "noSkill" } : { primary?: string; secondary?: string; } >primary : string ->"nosKill" : string +>"nosKill" : "nosKill" >secondary : string ->"noSkill" : string +>"noSkill" : "noSkill" [{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, >[{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }] : MultiRobot[] @@ -243,24 +243,24 @@ for ({ skills: { primary: primaryA = "primary", secondary: secondaryA = "seconda >[{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }] : { name: string; skills: { primary: string; secondary: string; }; }[] >{ name: "mower", skills: { primary: "mowing", secondary: "none" } } : { name: string; skills: { primary: string; secondary: string; }; } >name : string ->"mower" : string +>"mower" : "mower" >skills : { primary: string; secondary: string; } >{ primary: "mowing", secondary: "none" } : { primary: string; secondary: string; } >primary : string ->"mowing" : string +>"mowing" : "mowing" >secondary : string ->"none" : string +>"none" : "none" { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }]) { >{ name: "trimmer", skills: { primary: "trimming", secondary: "edging" } } : { name: string; skills: { primary: string; secondary: string; }; } >name : string ->"trimmer" : string +>"trimmer" : "trimmer" >skills : { primary: string; secondary: string; } >{ primary: "trimming", secondary: "edging" } : { primary: string; secondary: string; } >primary : string ->"trimming" : string +>"trimming" : "trimming" >secondary : string ->"edging" : string +>"edging" : "edging" console.log(primaryA); >console.log(primaryA) : void @@ -301,14 +301,14 @@ for ({ name = "noName" } of [{ name: "mower", skill: "mowing" }, { name: "trimme >[{ name: "mower", skill: "mowing" }, { name: "trimmer", skill: "trimming" }] : { name: string; skill: string; }[] >{ name: "mower", skill: "mowing" } : { name: string; skill: string; } >name : string ->"mower" : string +>"mower" : "mower" >skill : string ->"mowing" : string +>"mowing" : "mowing" >{ name: "trimmer", skill: "trimming" } : { name: string; skill: string; } >name : string ->"trimmer" : string +>"trimmer" : "trimmer" >skill : string ->"trimming" : string +>"trimming" : "trimming" console.log(nameA); >console.log(nameA) : void @@ -334,9 +334,9 @@ for ({ } = { primary: "noSkill", secondary: "noSkill" } >{ primary: "noSkill", secondary: "noSkill" } : { primary?: string; secondary?: string; } >primary : string ->"noSkill" : string +>"noSkill" : "noSkill" >secondary : string ->"noSkill" : string +>"noSkill" : "noSkill" } of multiRobots) { >multiRobots : MultiRobot[] @@ -365,9 +365,9 @@ for ({ } = { primary: "noSkill", secondary: "noSkill" } >{ primary: "noSkill", secondary: "noSkill" } : { primary?: string; secondary?: string; } >primary : string ->"noSkill" : string +>"noSkill" : "noSkill" >secondary : string ->"noSkill" : string +>"noSkill" : "noSkill" } of getMultiRobots()) { >getMultiRobots() : MultiRobot[] @@ -397,32 +397,32 @@ for ({ } = { primary: "noSkill", secondary: "noSkill" } >{ primary: "noSkill", secondary: "noSkill" } : { primary?: string; secondary?: string; } >primary : string ->"noSkill" : string +>"noSkill" : "noSkill" >secondary : string ->"noSkill" : string +>"noSkill" : "noSkill" } of [{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, >[{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }] : { name: string; skills: { primary: string; secondary: string; }; }[] >{ name: "mower", skills: { primary: "mowing", secondary: "none" } } : { name: string; skills: { primary: string; secondary: string; }; } >name : string ->"mower" : string +>"mower" : "mower" >skills : { primary: string; secondary: string; } >{ primary: "mowing", secondary: "none" } : { primary: string; secondary: string; } >primary : string ->"mowing" : string +>"mowing" : "mowing" >secondary : string ->"none" : string +>"none" : "none" { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }]) { >{ name: "trimmer", skills: { primary: "trimming", secondary: "edging" } } : { name: string; skills: { primary: string; secondary: string; }; } >name : string ->"trimmer" : string +>"trimmer" : "trimmer" >skills : { primary: string; secondary: string; } >{ primary: "trimming", secondary: "edging" } : { primary: string; secondary: string; } >primary : string ->"trimming" : string +>"trimming" : "trimming" >secondary : string ->"edging" : string +>"edging" : "edging" console.log(primaryA); >console.log(primaryA) : void @@ -436,13 +436,13 @@ for ({ for ({name: nameA = "noName", skill: skillA = "noSkill" } of robots) { >{name: nameA = "noName", skill: skillA = "noSkill" } : { name?: string; skill?: string; } >name : Robot ->nameA = "noName" : string +>nameA = "noName" : "noName" >nameA : string ->"noName" : string +>"noName" : "noName" >skill : Robot ->skillA = "noSkill" : string +>skillA = "noSkill" : "noSkill" >skillA : string ->"noSkill" : string +>"noSkill" : "noSkill" >robots : Robot[] console.log(nameA); @@ -455,13 +455,13 @@ for ({name: nameA = "noName", skill: skillA = "noSkill" } of robots) { for ({name: nameA = "noName", skill: skillA = "noSkill" } of getRobots()) { >{name: nameA = "noName", skill: skillA = "noSkill" } : { name?: string; skill?: string; } >name : Robot ->nameA = "noName" : string +>nameA = "noName" : "noName" >nameA : string ->"noName" : string +>"noName" : "noName" >skill : Robot ->skillA = "noSkill" : string +>skillA = "noSkill" : "noSkill" >skillA : string ->"noSkill" : string +>"noSkill" : "noSkill" >getRobots() : Robot[] >getRobots : () => Robot[] @@ -475,24 +475,24 @@ for ({name: nameA = "noName", skill: skillA = "noSkill" } of getRobots()) { for ({name: nameA = "noName", skill: skillA = "noSkill" } of [{ name: "mower", skill: "mowing" }, { name: "trimmer", skill: "trimming" }]) { >{name: nameA = "noName", skill: skillA = "noSkill" } : { name?: string; skill?: string; } >name : { name: string; skill: string; } ->nameA = "noName" : string +>nameA = "noName" : "noName" >nameA : string ->"noName" : string +>"noName" : "noName" >skill : { name: string; skill: string; } ->skillA = "noSkill" : string +>skillA = "noSkill" : "noSkill" >skillA : string ->"noSkill" : string +>"noSkill" : "noSkill" >[{ name: "mower", skill: "mowing" }, { name: "trimmer", skill: "trimming" }] : { name: string; skill: string; }[] >{ name: "mower", skill: "mowing" } : { name: string; skill: string; } >name : string ->"mower" : string +>"mower" : "mower" >skill : string ->"mowing" : string +>"mowing" : "mowing" >{ name: "trimmer", skill: "trimming" } : { name: string; skill: string; } >name : string ->"trimmer" : string +>"trimmer" : "trimmer" >skill : string ->"trimming" : string +>"trimming" : "trimming" console.log(nameA); >console.log(nameA) : void @@ -506,9 +506,9 @@ for ({ name: nameA = "noName", >name : MultiRobot ->nameA = "noName" : string +>nameA = "noName" : "noName" >nameA : string ->"noName" : string +>"noName" : "noName" skills: { >skills : MultiRobot @@ -517,22 +517,22 @@ for ({ primary: primaryA = "primary", >primary : string ->primaryA = "primary" : string +>primaryA = "primary" : "primary" >primaryA : string ->"primary" : string +>"primary" : "primary" secondary: secondaryA = "secondary" >secondary : string ->secondaryA = "secondary" : string +>secondaryA = "secondary" : "secondary" >secondaryA : string ->"secondary" : string +>"secondary" : "secondary" } = { primary: "noSkill", secondary: "noSkill" } >{ primary: "noSkill", secondary: "noSkill" } : { primary?: string; secondary?: string; } >primary : string ->"noSkill" : string +>"noSkill" : "noSkill" >secondary : string ->"noSkill" : string +>"noSkill" : "noSkill" } of multiRobots) { >multiRobots : MultiRobot[] @@ -549,9 +549,9 @@ for ({ name: nameA = "noName", >name : MultiRobot ->nameA = "noName" : string +>nameA = "noName" : "noName" >nameA : string ->"noName" : string +>"noName" : "noName" skills: { >skills : MultiRobot @@ -560,22 +560,22 @@ for ({ primary: primaryA = "primary", >primary : string ->primaryA = "primary" : string +>primaryA = "primary" : "primary" >primaryA : string ->"primary" : string +>"primary" : "primary" secondary: secondaryA = "secondary" >secondary : string ->secondaryA = "secondary" : string +>secondaryA = "secondary" : "secondary" >secondaryA : string ->"secondary" : string +>"secondary" : "secondary" } = { primary: "noSkill", secondary: "noSkill" } >{ primary: "noSkill", secondary: "noSkill" } : { primary?: string; secondary?: string; } >primary : string ->"noSkill" : string +>"noSkill" : "noSkill" >secondary : string ->"noSkill" : string +>"noSkill" : "noSkill" } of getMultiRobots()) { >getMultiRobots() : MultiRobot[] @@ -593,9 +593,9 @@ for ({ name: nameA = "noName", >name : MultiRobot ->nameA = "noName" : string +>nameA = "noName" : "noName" >nameA : string ->"noName" : string +>"noName" : "noName" skills: { >skills : MultiRobot @@ -604,22 +604,22 @@ for ({ primary: primaryA = "primary", >primary : string ->primaryA = "primary" : string +>primaryA = "primary" : "primary" >primaryA : string ->"primary" : string +>"primary" : "primary" secondary: secondaryA = "secondary" >secondary : string ->secondaryA = "secondary" : string +>secondaryA = "secondary" : "secondary" >secondaryA : string ->"secondary" : string +>"secondary" : "secondary" } = { primary: "noSkill", secondary: "noSkill" } >{ primary: "noSkill", secondary: "noSkill" } : { primary?: string; secondary?: string; } >primary : string ->"noSkill" : string +>"noSkill" : "noSkill" >secondary : string ->"noSkill" : string +>"noSkill" : "noSkill" } of [{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, >[{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }] : MultiRobot[] @@ -627,24 +627,24 @@ for ({ >[{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }] : { name: string; skills: { primary: string; secondary: string; }; }[] >{ name: "mower", skills: { primary: "mowing", secondary: "none" } } : { name: string; skills: { primary: string; secondary: string; }; } >name : string ->"mower" : string +>"mower" : "mower" >skills : { primary: string; secondary: string; } >{ primary: "mowing", secondary: "none" } : { primary: string; secondary: string; } >primary : string ->"mowing" : string +>"mowing" : "mowing" >secondary : string ->"none" : string +>"none" : "none" { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }]) { >{ name: "trimmer", skills: { primary: "trimming", secondary: "edging" } } : { name: string; skills: { primary: string; secondary: string; }; } >name : string ->"trimmer" : string +>"trimmer" : "trimmer" >skills : { primary: string; secondary: string; } >{ primary: "trimming", secondary: "edging" } : { primary: string; secondary: string; } >primary : string ->"trimming" : string +>"trimming" : "trimming" >secondary : string ->"edging" : string +>"edging" : "edging" console.log(nameA); >console.log(nameA) : void @@ -688,14 +688,14 @@ for ({ name = "noName", skill = "noSkill" } of [{ name: "mower", skill: "mowing >[{ name: "mower", skill: "mowing" }, { name: "trimmer", skill: "trimming" }] : { name: string; skill: string; }[] >{ name: "mower", skill: "mowing" } : { name: string; skill: string; } >name : string ->"mower" : string +>"mower" : "mower" >skill : string ->"mowing" : string +>"mowing" : "mowing" >{ name: "trimmer", skill: "trimming" } : { name: string; skill: string; } >name : string ->"trimmer" : string +>"trimmer" : "trimmer" >skill : string ->"trimming" : string +>"trimming" : "trimming" console.log(nameA); >console.log(nameA) : void @@ -724,9 +724,9 @@ for ({ } = { primary: "noSkill", secondary: "noSkill" } >{ primary: "noSkill", secondary: "noSkill" } : { primary?: string; secondary?: string; } >primary : string ->"noSkill" : string +>"noSkill" : "noSkill" >secondary : string ->"noSkill" : string +>"noSkill" : "noSkill" } of multiRobots) { >multiRobots : MultiRobot[] @@ -758,9 +758,9 @@ for ({ } = { primary: "noSkill", secondary: "noSkill" } >{ primary: "noSkill", secondary: "noSkill" } : { primary?: string; secondary?: string; } >primary : string ->"noSkill" : string +>"noSkill" : "noSkill" >secondary : string ->"noSkill" : string +>"noSkill" : "noSkill" } of getMultiRobots()) { >getMultiRobots() : MultiRobot[] @@ -793,32 +793,32 @@ for ({ } = { primary: "noSkill", secondary: "noSkill" } >{ primary: "noSkill", secondary: "noSkill" } : { primary?: string; secondary?: string; } >primary : string ->"noSkill" : string +>"noSkill" : "noSkill" >secondary : string ->"noSkill" : string +>"noSkill" : "noSkill" } of [{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, >[{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }] : { name: string; skills: { primary: string; secondary: string; }; }[] >{ name: "mower", skills: { primary: "mowing", secondary: "none" } } : { name: string; skills: { primary: string; secondary: string; }; } >name : string ->"mower" : string +>"mower" : "mower" >skills : { primary: string; secondary: string; } >{ primary: "mowing", secondary: "none" } : { primary: string; secondary: string; } >primary : string ->"mowing" : string +>"mowing" : "mowing" >secondary : string ->"none" : string +>"none" : "none" { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }]) { >{ name: "trimmer", skills: { primary: "trimming", secondary: "edging" } } : { name: string; skills: { primary: string; secondary: string; }; } >name : string ->"trimmer" : string +>"trimmer" : "trimmer" >skills : { primary: string; secondary: string; } >{ primary: "trimming", secondary: "edging" } : { primary: string; secondary: string; } >primary : string ->"trimming" : string +>"trimming" : "trimming" >secondary : string ->"edging" : string +>"edging" : "edging" console.log(nameA); >console.log(nameA) : void diff --git a/tests/baselines/reference/sourceMapValidationDestructuringParameterNestedObjectBindingPattern.types b/tests/baselines/reference/sourceMapValidationDestructuringParameterNestedObjectBindingPattern.types index af27c32d15b..eef87d57c45 100644 --- a/tests/baselines/reference/sourceMapValidationDestructuringParameterNestedObjectBindingPattern.types +++ b/tests/baselines/reference/sourceMapValidationDestructuringParameterNestedObjectBindingPattern.types @@ -28,13 +28,13 @@ var robotA: Robot = { name: "mower", skills: { primary: "mowing", secondary: "no >Robot : Robot >{ name: "mower", skills: { primary: "mowing", secondary: "none" } } : { name: string; skills: { primary: string; secondary: string; }; } >name : string ->"mower" : string +>"mower" : "mower" >skills : { primary: string; secondary: string; } >{ primary: "mowing", secondary: "none" } : { primary: string; secondary: string; } >primary : string ->"mowing" : string +>"mowing" : "mowing" >secondary : string ->"none" : string +>"none" : "none" function foo1({ skills: { primary: primaryA, secondary: secondaryA } }: Robot) { >foo1 : ({skills: {primary: primaryA, secondary: secondaryA}}: Robot) => void @@ -95,13 +95,13 @@ foo1({ name: "Edger", skills: { primary: "edging", secondary: "branch trimming" >foo1 : ({skills: {primary: primaryA, secondary: secondaryA}}: Robot) => void >{ name: "Edger", skills: { primary: "edging", secondary: "branch trimming" } } : { name: string; skills: { primary: string; secondary: string; }; } >name : string ->"Edger" : string +>"Edger" : "Edger" >skills : { primary: string; secondary: string; } >{ primary: "edging", secondary: "branch trimming" } : { primary: string; secondary: string; } >primary : string ->"edging" : string +>"edging" : "edging" >secondary : string ->"branch trimming" : string +>"branch trimming" : "branch trimming" foo2(robotA); >foo2(robotA) : void @@ -113,13 +113,13 @@ foo2({ name: "Edger", skills: { primary: "edging", secondary: "branch trimming" >foo2 : ({name: nameC, skills: {primary: primaryB, secondary: secondaryB}}: Robot) => void >{ name: "Edger", skills: { primary: "edging", secondary: "branch trimming" } } : { name: string; skills: { primary: string; secondary: string; }; } >name : string ->"Edger" : string +>"Edger" : "Edger" >skills : { primary: string; secondary: string; } >{ primary: "edging", secondary: "branch trimming" } : { primary: string; secondary: string; } >primary : string ->"edging" : string +>"edging" : "edging" >secondary : string ->"branch trimming" : string +>"branch trimming" : "branch trimming" foo3(robotA); >foo3(robotA) : void @@ -131,11 +131,11 @@ foo3({ name: "Edger", skills: { primary: "edging", secondary: "branch trimming" >foo3 : ({skills}: Robot) => void >{ name: "Edger", skills: { primary: "edging", secondary: "branch trimming" } } : { name: string; skills: { primary: string; secondary: string; }; } >name : string ->"Edger" : string +>"Edger" : "Edger" >skills : { primary: string; secondary: string; } >{ primary: "edging", secondary: "branch trimming" } : { primary: string; secondary: string; } >primary : string ->"edging" : string +>"edging" : "edging" >secondary : string ->"branch trimming" : string +>"branch trimming" : "branch trimming" diff --git a/tests/baselines/reference/sourceMapValidationDestructuringParameterNestedObjectBindingPatternDefaultValues.types b/tests/baselines/reference/sourceMapValidationDestructuringParameterNestedObjectBindingPatternDefaultValues.types index 1115931feef..9f5b16407ca 100644 --- a/tests/baselines/reference/sourceMapValidationDestructuringParameterNestedObjectBindingPatternDefaultValues.types +++ b/tests/baselines/reference/sourceMapValidationDestructuringParameterNestedObjectBindingPatternDefaultValues.types @@ -28,13 +28,13 @@ var robotA: Robot = { name: "mower", skills: { primary: "mowing", secondary: "no >Robot : Robot >{ name: "mower", skills: { primary: "mowing", secondary: "none" } } : { name: string; skills: { primary: string; secondary: string; }; } >name : string ->"mower" : string +>"mower" : "mower" >skills : { primary: string; secondary: string; } >{ primary: "mowing", secondary: "none" } : { primary: string; secondary: string; } >primary : string ->"mowing" : string +>"mowing" : "mowing" >secondary : string ->"none" : string +>"none" : "none" function foo1( >foo1 : ({skills: {primary: primaryA, secondary: secondaryA}}?: Robot) => void @@ -45,19 +45,19 @@ function foo1( primary: primaryA = "primary", >primary : any >primaryA : string ->"primary" : string +>"primary" : "primary" secondary: secondaryA = "secondary" >secondary : any >secondaryA : string ->"secondary" : string +>"secondary" : "secondary" } = { primary: "SomeSkill", secondary: "someSkill" } >{ primary: "SomeSkill", secondary: "someSkill" } : { primary?: string; secondary?: string; } >primary : string ->"SomeSkill" : string +>"SomeSkill" : "SomeSkill" >secondary : string ->"someSkill" : string +>"someSkill" : "someSkill" }: Robot = robotA) { >Robot : Robot @@ -76,7 +76,7 @@ function foo2( name: nameC = "name", >name : any >nameC : string ->"name" : string +>"name" : "name" skills: { >skills : any @@ -84,19 +84,19 @@ function foo2( primary: primaryB = "primary", >primary : any >primaryB : string ->"primary" : string +>"primary" : "primary" secondary: secondaryB = "secondary" >secondary : any >secondaryB : string ->"secondary" : string +>"secondary" : "secondary" } = { primary: "SomeSkill", secondary: "someSkill" } >{ primary: "SomeSkill", secondary: "someSkill" } : { primary?: string; secondary?: string; } >primary : string ->"SomeSkill" : string +>"SomeSkill" : "SomeSkill" >secondary : string ->"someSkill" : string +>"someSkill" : "someSkill" }: Robot = robotA) { >Robot : Robot @@ -114,9 +114,9 @@ function foo3({ skills = { primary: "SomeSkill", secondary: "someSkill" } }: Ro >skills : { primary?: string; secondary?: string; } >{ primary: "SomeSkill", secondary: "someSkill" } : { primary: string; secondary: string; } >primary : string ->"SomeSkill" : string +>"SomeSkill" : "SomeSkill" >secondary : string ->"someSkill" : string +>"someSkill" : "someSkill" >Robot : Robot >robotA : Robot @@ -140,13 +140,13 @@ foo1({ name: "Edger", skills: { primary: "edging", secondary: "branch trimming" >foo1 : ({skills: {primary: primaryA, secondary: secondaryA}}?: Robot) => void >{ name: "Edger", skills: { primary: "edging", secondary: "branch trimming" } } : { name: string; skills: { primary: string; secondary: string; }; } >name : string ->"Edger" : string +>"Edger" : "Edger" >skills : { primary: string; secondary: string; } >{ primary: "edging", secondary: "branch trimming" } : { primary: string; secondary: string; } >primary : string ->"edging" : string +>"edging" : "edging" >secondary : string ->"branch trimming" : string +>"branch trimming" : "branch trimming" foo2(robotA); >foo2(robotA) : void @@ -158,13 +158,13 @@ foo2({ name: "Edger", skills: { primary: "edging", secondary: "branch trimming" >foo2 : ({name: nameC, skills: {primary: primaryB, secondary: secondaryB}}?: Robot) => void >{ name: "Edger", skills: { primary: "edging", secondary: "branch trimming" } } : { name: string; skills: { primary: string; secondary: string; }; } >name : string ->"Edger" : string +>"Edger" : "Edger" >skills : { primary: string; secondary: string; } >{ primary: "edging", secondary: "branch trimming" } : { primary: string; secondary: string; } >primary : string ->"edging" : string +>"edging" : "edging" >secondary : string ->"branch trimming" : string +>"branch trimming" : "branch trimming" foo3(robotA); >foo3(robotA) : void @@ -176,11 +176,11 @@ foo3({ name: "Edger", skills: { primary: "edging", secondary: "branch trimming" >foo3 : ({skills}?: Robot) => void >{ name: "Edger", skills: { primary: "edging", secondary: "branch trimming" } } : { name: string; skills: { primary: string; secondary: string; }; } >name : string ->"Edger" : string +>"Edger" : "Edger" >skills : { primary: string; secondary: string; } >{ primary: "edging", secondary: "branch trimming" } : { primary: string; secondary: string; } >primary : string ->"edging" : string +>"edging" : "edging" >secondary : string ->"branch trimming" : string +>"branch trimming" : "branch trimming" diff --git a/tests/baselines/reference/sourceMapValidationDestructuringParameterObjectBindingPattern.types b/tests/baselines/reference/sourceMapValidationDestructuringParameterObjectBindingPattern.types index 6b8f26acf43..225071a3d2e 100644 --- a/tests/baselines/reference/sourceMapValidationDestructuringParameterObjectBindingPattern.types +++ b/tests/baselines/reference/sourceMapValidationDestructuringParameterObjectBindingPattern.types @@ -17,16 +17,16 @@ declare var console: { } var hello = "hello"; >hello : string ->"hello" : string +>"hello" : "hello" var robotA: Robot = { name: "mower", skill: "mowing" }; >robotA : Robot >Robot : Robot >{ name: "mower", skill: "mowing" } : { name: string; skill: string; } >name : string ->"mower" : string +>"mower" : "mower" >skill : string ->"mowing" : string +>"mowing" : "mowing" function foo1({ name: nameA }: Robot) { >foo1 : ({name: nameA}: Robot) => void @@ -79,9 +79,9 @@ foo1({ name: "Edger", skill: "cutting edges" }); >foo1 : ({name: nameA}: Robot) => void >{ name: "Edger", skill: "cutting edges" } : { name: string; skill: string; } >name : string ->"Edger" : string +>"Edger" : "Edger" >skill : string ->"cutting edges" : string +>"cutting edges" : "cutting edges" foo2(robotA); >foo2(robotA) : void @@ -93,9 +93,9 @@ foo2({ name: "Edger", skill: "cutting edges" }); >foo2 : ({name: nameB, skill: skillB}: Robot) => void >{ name: "Edger", skill: "cutting edges" } : { name: string; skill: string; } >name : string ->"Edger" : string +>"Edger" : "Edger" >skill : string ->"cutting edges" : string +>"cutting edges" : "cutting edges" foo3(robotA); >foo3(robotA) : void @@ -107,7 +107,7 @@ foo3({ name: "Edger", skill: "cutting edges" }); >foo3 : ({name}: Robot) => void >{ name: "Edger", skill: "cutting edges" } : { name: string; skill: string; } >name : string ->"Edger" : string +>"Edger" : "Edger" >skill : string ->"cutting edges" : string +>"cutting edges" : "cutting edges" diff --git a/tests/baselines/reference/sourceMapValidationDestructuringParameterObjectBindingPatternDefaultValues.types b/tests/baselines/reference/sourceMapValidationDestructuringParameterObjectBindingPatternDefaultValues.types index 253c5feae8f..db6a8bcab29 100644 --- a/tests/baselines/reference/sourceMapValidationDestructuringParameterObjectBindingPatternDefaultValues.types +++ b/tests/baselines/reference/sourceMapValidationDestructuringParameterObjectBindingPatternDefaultValues.types @@ -17,22 +17,22 @@ declare var console: { } var hello = "hello"; >hello : string ->"hello" : string +>"hello" : "hello" var robotA: Robot = { name: "mower", skill: "mowing" }; >robotA : Robot >Robot : Robot >{ name: "mower", skill: "mowing" } : { name: string; skill: string; } >name : string ->"mower" : string +>"mower" : "mower" >skill : string ->"mowing" : string +>"mowing" : "mowing" function foo1({ name: nameA = "" }: Robot = { }) { >foo1 : ({name: nameA}?: Robot) => void >name : any >nameA : string ->"" : string +>"" : "" >Robot : Robot >{ } : {} @@ -47,10 +47,10 @@ function foo2({ name: nameB = "", skill: skillB = "noSkill" }: Robot = { >foo2 : ({name: nameB, skill: skillB}?: Robot) => void >name : any >nameB : string ->"" : string +>"" : "" >skill : any >skillB : string ->"noSkill" : string +>"noSkill" : "noSkill" >Robot : Robot >{} : {} @@ -64,7 +64,7 @@ function foo2({ name: nameB = "", skill: skillB = "noSkill" }: Robot = { function foo3({ name = "" }: Robot = {}) { >foo3 : ({name}?: Robot) => void >name : string ->"" : string +>"" : "" >Robot : Robot >{} : {} @@ -86,9 +86,9 @@ foo1({ name: "Edger", skill: "cutting edges" }); >foo1 : ({name: nameA}?: Robot) => void >{ name: "Edger", skill: "cutting edges" } : { name: string; skill: string; } >name : string ->"Edger" : string +>"Edger" : "Edger" >skill : string ->"cutting edges" : string +>"cutting edges" : "cutting edges" foo2(robotA); >foo2(robotA) : void @@ -100,9 +100,9 @@ foo2({ name: "Edger", skill: "cutting edges" }); >foo2 : ({name: nameB, skill: skillB}?: Robot) => void >{ name: "Edger", skill: "cutting edges" } : { name: string; skill: string; } >name : string ->"Edger" : string +>"Edger" : "Edger" >skill : string ->"cutting edges" : string +>"cutting edges" : "cutting edges" foo3(robotA); >foo3(robotA) : void @@ -114,7 +114,7 @@ foo3({ name: "Edger", skill: "cutting edges" }); >foo3 : ({name}?: Robot) => void >{ name: "Edger", skill: "cutting edges" } : { name: string; skill: string; } >name : string ->"Edger" : string +>"Edger" : "Edger" >skill : string ->"cutting edges" : string +>"cutting edges" : "cutting edges" diff --git a/tests/baselines/reference/sourceMapValidationDestructuringParametertArrayBindingPattern.types b/tests/baselines/reference/sourceMapValidationDestructuringParametertArrayBindingPattern.types index aab0b3cf5c7..d7aed64a232 100644 --- a/tests/baselines/reference/sourceMapValidationDestructuringParametertArrayBindingPattern.types +++ b/tests/baselines/reference/sourceMapValidationDestructuringParametertArrayBindingPattern.types @@ -13,9 +13,9 @@ var robotA: Robot = [1, "mower", "mowing"]; >robotA : [number, string, string] >Robot : [number, string, string] >[1, "mower", "mowing"] : [number, string, string] ->1 : number ->"mower" : string ->"mowing" : string +>1 : 1 +>"mower" : "mower" +>"mowing" : "mowing" function foo1([, nameA]: Robot) { >foo1 : ([, nameA]: [number, string, string]) => void @@ -82,9 +82,9 @@ foo1([2, "trimmer", "trimming"]); >foo1([2, "trimmer", "trimming"]) : void >foo1 : ([, nameA]: [number, string, string]) => void >[2, "trimmer", "trimming"] : [number, string, string] ->2 : number ->"trimmer" : string ->"trimming" : string +>2 : 2 +>"trimmer" : "trimmer" +>"trimming" : "trimming" foo2(robotA); >foo2(robotA) : void @@ -95,9 +95,9 @@ foo2([2, "trimmer", "trimming"]); >foo2([2, "trimmer", "trimming"]) : void >foo2 : ([numberB]: [number, string, string]) => void >[2, "trimmer", "trimming"] : [number, string, string] ->2 : number ->"trimmer" : string ->"trimming" : string +>2 : 2 +>"trimmer" : "trimmer" +>"trimming" : "trimming" foo3(robotA); >foo3(robotA) : void @@ -108,9 +108,9 @@ foo3([2, "trimmer", "trimming"]); >foo3([2, "trimmer", "trimming"]) : void >foo3 : ([numberA2, nameA2, skillA2]: [number, string, string]) => void >[2, "trimmer", "trimming"] : [number, string, string] ->2 : number ->"trimmer" : string ->"trimming" : string +>2 : 2 +>"trimmer" : "trimmer" +>"trimming" : "trimming" foo4(robotA); >foo4(robotA) : void @@ -121,7 +121,7 @@ foo4([2, "trimmer", "trimming"]); >foo4([2, "trimmer", "trimming"]) : void >foo4 : ([numberA3, ...robotAInfo]: [number, string, string]) => void >[2, "trimmer", "trimming"] : [number, string, string] ->2 : number ->"trimmer" : string ->"trimming" : string +>2 : 2 +>"trimmer" : "trimmer" +>"trimming" : "trimming" diff --git a/tests/baselines/reference/sourceMapValidationDestructuringParametertArrayBindingPattern2.types b/tests/baselines/reference/sourceMapValidationDestructuringParametertArrayBindingPattern2.types index b3e09d962c3..00809184d3b 100644 --- a/tests/baselines/reference/sourceMapValidationDestructuringParametertArrayBindingPattern2.types +++ b/tests/baselines/reference/sourceMapValidationDestructuringParametertArrayBindingPattern2.types @@ -13,10 +13,10 @@ var robotA: Robot = ["trimmer", ["trimming", "edging"]]; >robotA : [string, [string, string]] >Robot : [string, [string, string]] >["trimmer", ["trimming", "edging"]] : [string, [string, string]] ->"trimmer" : string +>"trimmer" : "trimmer" >["trimming", "edging"] : [string, string] ->"trimming" : string ->"edging" : string +>"trimming" : "trimming" +>"edging" : "edging" function foo1([, skillA]: Robot) { >foo1 : ([, skillA]: [string, [string, string]]) => void @@ -82,10 +82,10 @@ foo1(["roomba", ["vaccum", "mopping"]]); >foo1(["roomba", ["vaccum", "mopping"]]) : void >foo1 : ([, skillA]: [string, [string, string]]) => void >["roomba", ["vaccum", "mopping"]] : [string, [string, string]] ->"roomba" : string +>"roomba" : "roomba" >["vaccum", "mopping"] : [string, string] ->"vaccum" : string ->"mopping" : string +>"vaccum" : "vaccum" +>"mopping" : "mopping" foo2(robotA); >foo2(robotA) : void @@ -96,10 +96,10 @@ foo2(["roomba", ["vaccum", "mopping"]]); >foo2(["roomba", ["vaccum", "mopping"]]) : void >foo2 : ([nameMB]: [string, [string, string]]) => void >["roomba", ["vaccum", "mopping"]] : [string, [string, string]] ->"roomba" : string +>"roomba" : "roomba" >["vaccum", "mopping"] : [string, string] ->"vaccum" : string ->"mopping" : string +>"vaccum" : "vaccum" +>"mopping" : "mopping" foo3(robotA); >foo3(robotA) : void @@ -110,10 +110,10 @@ foo3(["roomba", ["vaccum", "mopping"]]); >foo3(["roomba", ["vaccum", "mopping"]]) : void >foo3 : ([nameMA, [primarySkillA, secondarySkillA]]: [string, [string, string]]) => void >["roomba", ["vaccum", "mopping"]] : [string, [string, string]] ->"roomba" : string +>"roomba" : "roomba" >["vaccum", "mopping"] : [string, string] ->"vaccum" : string ->"mopping" : string +>"vaccum" : "vaccum" +>"mopping" : "mopping" foo4(robotA); >foo4(robotA) : void @@ -124,8 +124,8 @@ foo4(["roomba", ["vaccum", "mopping"]]); >foo4(["roomba", ["vaccum", "mopping"]]) : void >foo4 : ([...multiRobotAInfo]: [string, [string, string]]) => void >["roomba", ["vaccum", "mopping"]] : [string, [string, string]] ->"roomba" : string +>"roomba" : "roomba" >["vaccum", "mopping"] : [string, string] ->"vaccum" : string ->"mopping" : string +>"vaccum" : "vaccum" +>"mopping" : "mopping" diff --git a/tests/baselines/reference/sourceMapValidationDestructuringParametertArrayBindingPatternDefaultValues.types b/tests/baselines/reference/sourceMapValidationDestructuringParametertArrayBindingPatternDefaultValues.types index 43420fdd587..a9d1013c136 100644 --- a/tests/baselines/reference/sourceMapValidationDestructuringParametertArrayBindingPatternDefaultValues.types +++ b/tests/baselines/reference/sourceMapValidationDestructuringParametertArrayBindingPatternDefaultValues.types @@ -13,21 +13,21 @@ var robotA: Robot = [1, "mower", "mowing"]; >robotA : [number, string, string] >Robot : [number, string, string] >[1, "mower", "mowing"] : [number, string, string] ->1 : number ->"mower" : string ->"mowing" : string +>1 : 1 +>"mower" : "mower" +>"mowing" : "mowing" function foo1([, nameA = "noName"]: Robot = [-1, "name", "skill"]) { >foo1 : ([, nameA]?: [number, string, string]) => void > : undefined >nameA : string ->"noName" : string +>"noName" : "noName" >Robot : [number, string, string] >[-1, "name", "skill"] : [number, string, string] ->-1 : number ->1 : number ->"name" : string ->"skill" : string +>-1 : -1 +>1 : 1 +>"name" : "name" +>"skill" : "skill" console.log(nameA); >console.log(nameA) : void @@ -40,14 +40,14 @@ function foo1([, nameA = "noName"]: Robot = [-1, "name", "skill"]) { function foo2([numberB = -1]: Robot = [-1, "name", "skill"]) { >foo2 : ([numberB]?: [number, string, string]) => void >numberB : number ->-1 : number ->1 : number +>-1 : -1 +>1 : 1 >Robot : [number, string, string] >[-1, "name", "skill"] : [number, string, string] ->-1 : number ->1 : number ->"name" : string ->"skill" : string +>-1 : -1 +>1 : 1 +>"name" : "name" +>"skill" : "skill" console.log(numberB); >console.log(numberB) : void @@ -60,18 +60,18 @@ function foo2([numberB = -1]: Robot = [-1, "name", "skill"]) { function foo3([numberA2 = -1, nameA2 = "name", skillA2 = "skill"]: Robot = [-1, "name", "skill"]) { >foo3 : ([numberA2, nameA2, skillA2]?: [number, string, string]) => void >numberA2 : number ->-1 : number ->1 : number +>-1 : -1 +>1 : 1 >nameA2 : string ->"name" : string +>"name" : "name" >skillA2 : string ->"skill" : string +>"skill" : "skill" >Robot : [number, string, string] >[-1, "name", "skill"] : [number, string, string] ->-1 : number ->1 : number ->"name" : string ->"skill" : string +>-1 : -1 +>1 : 1 +>"name" : "name" +>"skill" : "skill" console.log(nameA2); >console.log(nameA2) : void @@ -84,15 +84,15 @@ function foo3([numberA2 = -1, nameA2 = "name", skillA2 = "skill"]: Robot = [-1, function foo4([numberA3 = -1, ...robotAInfo]: Robot = [-1, "name", "skill"]) { >foo4 : ([numberA3, ...robotAInfo]?: [number, string, string]) => void >numberA3 : number ->-1 : number ->1 : number +>-1 : -1 +>1 : 1 >robotAInfo : (string | number)[] >Robot : [number, string, string] >[-1, "name", "skill"] : [number, string, string] ->-1 : number ->1 : number ->"name" : string ->"skill" : string +>-1 : -1 +>1 : 1 +>"name" : "name" +>"skill" : "skill" console.log(robotAInfo); >console.log(robotAInfo) : void @@ -111,9 +111,9 @@ foo1([2, "trimmer", "trimming"]); >foo1([2, "trimmer", "trimming"]) : void >foo1 : ([, nameA]?: [number, string, string]) => void >[2, "trimmer", "trimming"] : [number, string, string] ->2 : number ->"trimmer" : string ->"trimming" : string +>2 : 2 +>"trimmer" : "trimmer" +>"trimming" : "trimming" foo2(robotA); >foo2(robotA) : void @@ -124,9 +124,9 @@ foo2([2, "trimmer", "trimming"]); >foo2([2, "trimmer", "trimming"]) : void >foo2 : ([numberB]?: [number, string, string]) => void >[2, "trimmer", "trimming"] : [number, string, string] ->2 : number ->"trimmer" : string ->"trimming" : string +>2 : 2 +>"trimmer" : "trimmer" +>"trimming" : "trimming" foo3(robotA); >foo3(robotA) : void @@ -137,9 +137,9 @@ foo3([2, "trimmer", "trimming"]); >foo3([2, "trimmer", "trimming"]) : void >foo3 : ([numberA2, nameA2, skillA2]?: [number, string, string]) => void >[2, "trimmer", "trimming"] : [number, string, string] ->2 : number ->"trimmer" : string ->"trimming" : string +>2 : 2 +>"trimmer" : "trimmer" +>"trimming" : "trimming" foo4(robotA); >foo4(robotA) : void @@ -150,7 +150,7 @@ foo4([2, "trimmer", "trimming"]); >foo4([2, "trimmer", "trimming"]) : void >foo4 : ([numberA3, ...robotAInfo]?: [number, string, string]) => void >[2, "trimmer", "trimming"] : [number, string, string] ->2 : number ->"trimmer" : string ->"trimming" : string +>2 : 2 +>"trimmer" : "trimmer" +>"trimming" : "trimming" diff --git a/tests/baselines/reference/sourceMapValidationDestructuringParametertArrayBindingPatternDefaultValues2.types b/tests/baselines/reference/sourceMapValidationDestructuringParametertArrayBindingPatternDefaultValues2.types index bd140d6a232..b3569bb58b7 100644 --- a/tests/baselines/reference/sourceMapValidationDestructuringParametertArrayBindingPatternDefaultValues2.types +++ b/tests/baselines/reference/sourceMapValidationDestructuringParametertArrayBindingPatternDefaultValues2.types @@ -13,24 +13,24 @@ var robotA: Robot = ["trimmer", ["trimming", "edging"]]; >robotA : [string, string[]] >Robot : [string, string[]] >["trimmer", ["trimming", "edging"]] : [string, string[]] ->"trimmer" : string +>"trimmer" : "trimmer" >["trimming", "edging"] : string[] ->"trimming" : string ->"edging" : string +>"trimming" : "trimming" +>"edging" : "edging" function foo1([, skillA = ["noSkill", "noSkill"]]: Robot= ["name", ["skill1", "skill2"]]) { >foo1 : ([, skillA]?: [string, string[]]) => void > : undefined >skillA : string[] >["noSkill", "noSkill"] : string[] ->"noSkill" : string ->"noSkill" : string +>"noSkill" : "noSkill" +>"noSkill" : "noSkill" >Robot : [string, string[]] >["name", ["skill1", "skill2"]] : [string, string[]] ->"name" : string +>"name" : "name" >["skill1", "skill2"] : string[] ->"skill1" : string ->"skill2" : string +>"skill1" : "skill1" +>"skill2" : "skill2" console.log(skillA); >console.log(skillA) : void @@ -43,13 +43,13 @@ function foo1([, skillA = ["noSkill", "noSkill"]]: Robot= ["name", ["skill1", "s function foo2([nameMB = "noName"]: Robot = ["name", ["skill1", "skill2"]]) { >foo2 : ([nameMB]?: [string, string[]]) => void >nameMB : string ->"noName" : string +>"noName" : "noName" >Robot : [string, string[]] >["name", ["skill1", "skill2"]] : [string, string[]] ->"name" : string +>"name" : "name" >["skill1", "skill2"] : string[] ->"skill1" : string ->"skill2" : string +>"skill1" : "skill1" +>"skill2" : "skill2" console.log(nameMB); >console.log(nameMB) : void @@ -62,20 +62,20 @@ function foo2([nameMB = "noName"]: Robot = ["name", ["skill1", "skill2"]]) { function foo3([nameMA = "noName", [ >foo3 : ([nameMA, [primarySkillA, secondarySkillA]]: [string, string[]]) => void >nameMA : string ->"noName" : string +>"noName" : "noName" primarySkillA = "primary", >primarySkillA : string ->"primary" : string +>"primary" : "primary" secondarySkillA = "secondary" >secondarySkillA : string ->"secondary" : string +>"secondary" : "secondary" ] = ["noSkill", "noSkill"]]: Robot) { >["noSkill", "noSkill"] : [string, string] ->"noSkill" : string ->"noSkill" : string +>"noSkill" : "noSkill" +>"noSkill" : "noSkill" >Robot : [string, string[]] console.log(nameMA); @@ -95,10 +95,10 @@ foo1(["roomba", ["vaccum", "mopping"]]); >foo1(["roomba", ["vaccum", "mopping"]]) : void >foo1 : ([, skillA]?: [string, string[]]) => void >["roomba", ["vaccum", "mopping"]] : [string, string[]] ->"roomba" : string +>"roomba" : "roomba" >["vaccum", "mopping"] : string[] ->"vaccum" : string ->"mopping" : string +>"vaccum" : "vaccum" +>"mopping" : "mopping" foo2(robotA); >foo2(robotA) : void @@ -109,10 +109,10 @@ foo2(["roomba", ["vaccum", "mopping"]]); >foo2(["roomba", ["vaccum", "mopping"]]) : void >foo2 : ([nameMB]?: [string, string[]]) => void >["roomba", ["vaccum", "mopping"]] : [string, string[]] ->"roomba" : string +>"roomba" : "roomba" >["vaccum", "mopping"] : string[] ->"vaccum" : string ->"mopping" : string +>"vaccum" : "vaccum" +>"mopping" : "mopping" foo3(robotA); >foo3(robotA) : void @@ -123,8 +123,8 @@ foo3(["roomba", ["vaccum", "mopping"]]); >foo3(["roomba", ["vaccum", "mopping"]]) : void >foo3 : ([nameMA, [primarySkillA, secondarySkillA]]: [string, string[]]) => void >["roomba", ["vaccum", "mopping"]] : [string, string[]] ->"roomba" : string +>"roomba" : "roomba" >["vaccum", "mopping"] : string[] ->"vaccum" : string ->"mopping" : string +>"vaccum" : "vaccum" +>"mopping" : "mopping" diff --git a/tests/baselines/reference/sourceMapValidationDestructuringVariableStatement.types b/tests/baselines/reference/sourceMapValidationDestructuringVariableStatement.types index 82a2ffe88f6..5d61294b568 100644 --- a/tests/baselines/reference/sourceMapValidationDestructuringVariableStatement.types +++ b/tests/baselines/reference/sourceMapValidationDestructuringVariableStatement.types @@ -17,25 +17,25 @@ declare var console: { } var hello = "hello"; >hello : string ->"hello" : string +>"hello" : "hello" var robotA: Robot = { name: "mower", skill: "mowing" }; >robotA : Robot >Robot : Robot >{ name: "mower", skill: "mowing" } : { name: string; skill: string; } >name : string ->"mower" : string +>"mower" : "mower" >skill : string ->"mowing" : string +>"mowing" : "mowing" var robotB: Robot = { name: "trimmer", skill: "trimming" }; >robotB : Robot >Robot : Robot >{ name: "trimmer", skill: "trimming" } : { name: string; skill: string; } >name : string ->"trimmer" : string +>"trimmer" : "trimmer" >skill : string ->"trimming" : string +>"trimming" : "trimming" var { name: nameA } = robotA; >name : any @@ -56,9 +56,9 @@ var { name: nameC, skill: skillC } = { name: "Edger", skill: "cutting edges" }; >skillC : string >{ name: "Edger", skill: "cutting edges" } : { name: string; skill: string; } >name : string ->"Edger" : string +>"Edger" : "Edger" >skill : string ->"cutting edges" : string +>"cutting edges" : "cutting edges" if (nameA == nameB) { >nameA == nameB : boolean diff --git a/tests/baselines/reference/sourceMapValidationDestructuringVariableStatement1.types b/tests/baselines/reference/sourceMapValidationDestructuringVariableStatement1.types index 9d8023f5f74..9ed1df0f533 100644 --- a/tests/baselines/reference/sourceMapValidationDestructuringVariableStatement1.types +++ b/tests/baselines/reference/sourceMapValidationDestructuringVariableStatement1.types @@ -17,25 +17,25 @@ declare var console: { } var hello = "hello"; >hello : string ->"hello" : string +>"hello" : "hello" var robotA: Robot = { name: "mower", skill: "mowing" }; >robotA : Robot >Robot : Robot >{ name: "mower", skill: "mowing" } : { name: string; skill: string; } >name : string ->"mower" : string +>"mower" : "mower" >skill : string ->"mowing" : string +>"mowing" : "mowing" var robotB: Robot = { name: "trimmer", skill: "trimming" }; >robotB : Robot >Robot : Robot >{ name: "trimmer", skill: "trimming" } : { name: string; skill: string; } >name : string ->"trimmer" : string +>"trimmer" : "trimmer" >skill : string ->"trimming" : string +>"trimming" : "trimming" var a: string, { name: nameA } = robotA; >a : string @@ -59,9 +59,9 @@ var c: string, { name: nameC, skill: skillC } = { name: "Edger", skill: "cutting >skillC : string >{ name: "Edger", skill: "cutting edges" } : { name: string; skill: string; } >name : string ->"Edger" : string +>"Edger" : "Edger" >skill : string ->"cutting edges" : string +>"cutting edges" : "cutting edges" var { name: nameA } = robotA, a = hello; >name : any @@ -77,7 +77,7 @@ var { name: nameB, skill: skillB } = robotB, b = " hello"; >skillB : string >robotB : Robot >b : string ->" hello" : string +>" hello" : " hello" var { name: nameC, skill: skillC } = { name: "Edger", skill: "cutting edges" }, c = hello; >name : any @@ -86,9 +86,9 @@ var { name: nameC, skill: skillC } = { name: "Edger", skill: "cutting edges" }, >skillC : string >{ name: "Edger", skill: "cutting edges" } : { name: string; skill: string; } >name : string ->"Edger" : string +>"Edger" : "Edger" >skill : string ->"cutting edges" : string +>"cutting edges" : "cutting edges" >c : string >hello : string @@ -99,7 +99,7 @@ var a = hello, { name: nameA } = robotA, a1= "hello"; >nameA : string >robotA : Robot >a1 : string ->"hello" : string +>"hello" : "hello" var b = hello, { name: nameB, skill: skillB } = robotB, b1 = "hello"; >b : string @@ -110,7 +110,7 @@ var b = hello, { name: nameB, skill: skillB } = robotB, b1 = "hello"; >skillB : string >robotB : Robot >b1 : string ->"hello" : string +>"hello" : "hello" var c = hello, { name: nameC, skill: skillC } = { name: "Edger", skill: "cutting edges" }, c1 = hello; >c : string @@ -121,9 +121,9 @@ var c = hello, { name: nameC, skill: skillC } = { name: "Edger", skill: "cutting >skillC : string >{ name: "Edger", skill: "cutting edges" } : { name: string; skill: string; } >name : string ->"Edger" : string +>"Edger" : "Edger" >skill : string ->"cutting edges" : string +>"cutting edges" : "cutting edges" >c1 : string >hello : string diff --git a/tests/baselines/reference/sourceMapValidationDestructuringVariableStatementArrayBindingPattern.types b/tests/baselines/reference/sourceMapValidationDestructuringVariableStatementArrayBindingPattern.types index db6e57258d7..46bdfec4b06 100644 --- a/tests/baselines/reference/sourceMapValidationDestructuringVariableStatementArrayBindingPattern.types +++ b/tests/baselines/reference/sourceMapValidationDestructuringVariableStatementArrayBindingPattern.types @@ -13,17 +13,17 @@ var robotA: Robot = [1, "mower", "mowing"]; >robotA : [number, string, string] >Robot : [number, string, string] >[1, "mower", "mowing"] : [number, string, string] ->1 : number ->"mower" : string ->"mowing" : string +>1 : 1 +>"mower" : "mower" +>"mowing" : "mowing" var robotB: Robot = [2, "trimmer", "trimming"]; >robotB : [number, string, string] >Robot : [number, string, string] >[2, "trimmer", "trimming"] : [number, string, string] ->2 : number ->"trimmer" : string ->"trimming" : string +>2 : 2 +>"trimmer" : "trimmer" +>"trimming" : "trimming" let [, nameA] = robotA; @@ -44,18 +44,18 @@ let [numberA2, nameA2, skillA2] = robotA; let [numberC2] = [3, "edging", "Trimming edges"]; >numberC2 : number >[3, "edging", "Trimming edges"] : [number, string, string] ->3 : number ->"edging" : string ->"Trimming edges" : string +>3 : 3 +>"edging" : "edging" +>"Trimming edges" : "Trimming edges" let [numberC, nameC, skillC] = [3, "edging", "Trimming edges"]; >numberC : number >nameC : string >skillC : string >[3, "edging", "Trimming edges"] : [number, string, string] ->3 : number ->"edging" : string ->"Trimming edges" : string +>3 : 3 +>"edging" : "edging" +>"Trimming edges" : "Trimming edges" let [numberA3, ...robotAInfo] = robotA; >numberA3 : number diff --git a/tests/baselines/reference/sourceMapValidationDestructuringVariableStatementArrayBindingPattern2.types b/tests/baselines/reference/sourceMapValidationDestructuringVariableStatementArrayBindingPattern2.types index 57d4b271c2f..99f280985b5 100644 --- a/tests/baselines/reference/sourceMapValidationDestructuringVariableStatementArrayBindingPattern2.types +++ b/tests/baselines/reference/sourceMapValidationDestructuringVariableStatementArrayBindingPattern2.types @@ -13,19 +13,19 @@ var multiRobotA: MultiSkilledRobot = ["mower", ["mowing", ""]]; >multiRobotA : [string, [string, string]] >MultiSkilledRobot : [string, [string, string]] >["mower", ["mowing", ""]] : [string, [string, string]] ->"mower" : string +>"mower" : "mower" >["mowing", ""] : [string, string] ->"mowing" : string ->"" : string +>"mowing" : "mowing" +>"" : "" var multiRobotB: MultiSkilledRobot = ["trimmer", ["trimming", "edging"]]; >multiRobotB : [string, [string, string]] >MultiSkilledRobot : [string, [string, string]] >["trimmer", ["trimming", "edging"]] : [string, [string, string]] ->"trimmer" : string +>"trimmer" : "trimmer" >["trimming", "edging"] : [string, string] ->"trimming" : string ->"edging" : string +>"trimming" : "trimming" +>"edging" : "edging" let [, skillA] = multiRobotA; > : undefined @@ -45,20 +45,20 @@ let [nameMA, [primarySkillA, secondarySkillA]] = multiRobotA; let [nameMC] = ["roomba", ["vaccum", "mopping"]]; >nameMC : string >["roomba", ["vaccum", "mopping"]] : [string, string[]] ->"roomba" : string +>"roomba" : "roomba" >["vaccum", "mopping"] : string[] ->"vaccum" : string ->"mopping" : string +>"vaccum" : "vaccum" +>"mopping" : "mopping" let [nameMC2, [primarySkillC, secondarySkillC]] = ["roomba", ["vaccum", "mopping"]]; >nameMC2 : string >primarySkillC : string >secondarySkillC : string >["roomba", ["vaccum", "mopping"]] : [string, [string, string]] ->"roomba" : string +>"roomba" : "roomba" >["vaccum", "mopping"] : [string, string] ->"vaccum" : string ->"mopping" : string +>"vaccum" : "vaccum" +>"mopping" : "mopping" let [...multiRobotAInfo] = multiRobotA; >multiRobotAInfo : (string | [string, string])[] @@ -77,8 +77,8 @@ if (nameMB == nameMA) { >skillA[0] + skillA[1] : string >skillA[0] : string >skillA : [string, string] ->0 : number +>0 : 0 >skillA[1] : string >skillA : [string, string] ->1 : number +>1 : 1 } diff --git a/tests/baselines/reference/sourceMapValidationDestructuringVariableStatementArrayBindingPattern3.types b/tests/baselines/reference/sourceMapValidationDestructuringVariableStatementArrayBindingPattern3.types index 14a8c18c051..bdd2059b863 100644 --- a/tests/baselines/reference/sourceMapValidationDestructuringVariableStatementArrayBindingPattern3.types +++ b/tests/baselines/reference/sourceMapValidationDestructuringVariableStatementArrayBindingPattern3.types @@ -16,35 +16,35 @@ var robotA: Robot = [1, "mower", "mowing"]; >robotA : [number, string, string] >Robot : [number, string, string] >[1, "mower", "mowing"] : [number, string, string] ->1 : number ->"mower" : string ->"mowing" : string +>1 : 1 +>"mower" : "mower" +>"mowing" : "mowing" var robotB: Robot = [2, "trimmer", "trimming"]; >robotB : [number, string, string] >Robot : [number, string, string] >[2, "trimmer", "trimming"] : [number, string, string] ->2 : number ->"trimmer" : string ->"trimming" : string +>2 : 2 +>"trimmer" : "trimmer" +>"trimming" : "trimming" var multiRobotA: MultiSkilledRobot = ["mower", ["mowing", ""]]; >multiRobotA : [string, [string, string]] >MultiSkilledRobot : [string, [string, string]] >["mower", ["mowing", ""]] : [string, [string, string]] ->"mower" : string +>"mower" : "mower" >["mowing", ""] : [string, string] ->"mowing" : string ->"" : string +>"mowing" : "mowing" +>"" : "" var multiRobotB: MultiSkilledRobot = ["trimmer", ["trimming", "edging"]]; >multiRobotB : [string, [string, string]] >MultiSkilledRobot : [string, [string, string]] >["trimmer", ["trimming", "edging"]] : [string, [string, string]] ->"trimmer" : string +>"trimmer" : "trimmer" >["trimming", "edging"] : [string, string] ->"trimming" : string ->"edging" : string +>"trimming" : "trimming" +>"edging" : "edging" let nameA: string, numberB: number, nameB: string, skillB: string; >nameA : string @@ -85,9 +85,9 @@ let multiRobotAInfo: (string | [string, string])[]; > : undefined >nameB : string >[2, "trimmer", "trimming"] : [number, string, string] ->2 : number ->"trimmer" : string ->"trimming" : string +>2 : 2 +>"trimmer" : "trimmer" +>"trimming" : "trimming" [, multiSkillB] = multiRobotB; >[, multiSkillB] = multiRobotB : [string, [string, string]] @@ -110,10 +110,10 @@ let multiRobotAInfo: (string | [string, string])[]; > : undefined >multiSkillB : [string, string] >["roomba", ["vaccum", "mopping"]] : [string, [string, string]] ->"roomba" : string +>"roomba" : "roomba" >["vaccum", "mopping"] : [string, string] ->"vaccum" : string ->"mopping" : string +>"vaccum" : "vaccum" +>"mopping" : "mopping" [numberB] = robotB; >[numberB] = robotB : [number, string, string] @@ -133,9 +133,9 @@ let multiRobotAInfo: (string | [string, string])[]; >[numberB] : [number] >numberB : number >[2, "trimmer", "trimming"] : [number, string, string] ->2 : number ->"trimmer" : string ->"trimming" : string +>2 : 2 +>"trimmer" : "trimmer" +>"trimming" : "trimming" [nameMB] = multiRobotB; >[nameMB] = multiRobotB : [string, [string, string]] @@ -155,10 +155,10 @@ let multiRobotAInfo: (string | [string, string])[]; >[nameMB] : [string] >nameMB : string >["trimmer", ["trimming", "edging"]] : [string, string[]] ->"trimmer" : string +>"trimmer" : "trimmer" >["trimming", "edging"] : string[] ->"trimming" : string ->"edging" : string +>"trimming" : "trimming" +>"edging" : "edging" [numberB, nameB, skillB] = robotB; >[numberB, nameB, skillB] = robotB : [number, string, string] @@ -184,9 +184,9 @@ let multiRobotAInfo: (string | [string, string])[]; >nameB : string >skillB : string >[2, "trimmer", "trimming"] : [number, string, string] ->2 : number ->"trimmer" : string ->"trimming" : string +>2 : 2 +>"trimmer" : "trimmer" +>"trimming" : "trimming" [nameMB, [primarySkillB, secondarySkillB]] = multiRobotB; >[nameMB, [primarySkillB, secondarySkillB]] = multiRobotB : [string, [string, string]] @@ -215,10 +215,10 @@ let multiRobotAInfo: (string | [string, string])[]; >primarySkillB : string >secondarySkillB : string >["trimmer", ["trimming", "edging"]] : [string, [string, string]] ->"trimmer" : string +>"trimmer" : "trimmer" >["trimming", "edging"] : [string, string] ->"trimming" : string ->"edging" : string +>"trimming" : "trimming" +>"edging" : "edging" [numberB, ...robotAInfo] = robotB; >[numberB, ...robotAInfo] = robotB : [number, string, string] @@ -246,9 +246,9 @@ let multiRobotAInfo: (string | [string, string])[]; >[2, "trimmer", "trimming"] : [number, string, string] >Robot : [number, string, string] >[2, "trimmer", "trimming"] : [number, string, string] ->2 : number ->"trimmer" : string ->"trimming" : string +>2 : 2 +>"trimmer" : "trimmer" +>"trimming" : "trimming" [...multiRobotAInfo] = multiRobotA; >[...multiRobotAInfo] = multiRobotA : [string, [string, string]] @@ -271,10 +271,10 @@ let multiRobotAInfo: (string | [string, string])[]; >...multiRobotAInfo : string | [string, string] >multiRobotAInfo : (string | [string, string])[] >["trimmer", ["trimming", "edging"]] : (string | [string, string])[] ->"trimmer" : string +>"trimmer" : "trimmer" >["trimming", "edging"] : [string, string] ->"trimming" : string ->"edging" : string +>"trimming" : "trimming" +>"edging" : "edging" if (nameA == nameB) { >nameA == nameB : boolean diff --git a/tests/baselines/reference/sourceMapValidationDestructuringVariableStatementArrayBindingPattern4.types b/tests/baselines/reference/sourceMapValidationDestructuringVariableStatementArrayBindingPattern4.types index 461939a11aa..4f61c672b81 100644 --- a/tests/baselines/reference/sourceMapValidationDestructuringVariableStatementArrayBindingPattern4.types +++ b/tests/baselines/reference/sourceMapValidationDestructuringVariableStatementArrayBindingPattern4.types @@ -3,6 +3,6 @@ var [x] = [1, 2]; >x : number >[1, 2] : [number, number] ->1 : number ->2 : number +>1 : 1 +>2 : 2 diff --git a/tests/baselines/reference/sourceMapValidationDestructuringVariableStatementArrayBindingPattern5.types b/tests/baselines/reference/sourceMapValidationDestructuringVariableStatementArrayBindingPattern5.types index 1ef747517e4..908e566ca71 100644 --- a/tests/baselines/reference/sourceMapValidationDestructuringVariableStatementArrayBindingPattern5.types +++ b/tests/baselines/reference/sourceMapValidationDestructuringVariableStatementArrayBindingPattern5.types @@ -3,13 +3,13 @@ var [x] = [1, 2]; >x : number >[1, 2] : [number, number] ->1 : number ->2 : number +>1 : 1 +>2 : 2 var [y, z] = [1, 2]; >y : number >z : number >[1, 2] : [number, number] ->1 : number ->2 : number +>1 : 1 +>2 : 2 diff --git a/tests/baselines/reference/sourceMapValidationDestructuringVariableStatementArrayBindingPattern6.types b/tests/baselines/reference/sourceMapValidationDestructuringVariableStatementArrayBindingPattern6.types index 1b94874ae7c..166a6192bb7 100644 --- a/tests/baselines/reference/sourceMapValidationDestructuringVariableStatementArrayBindingPattern6.types +++ b/tests/baselines/reference/sourceMapValidationDestructuringVariableStatementArrayBindingPattern6.types @@ -2,8 +2,8 @@ var [x = 20] = [1, 2]; >x : number ->20 : number +>20 : 20 >[1, 2] : [number, number] ->1 : number ->2 : number +>1 : 1 +>2 : 2 diff --git a/tests/baselines/reference/sourceMapValidationDestructuringVariableStatementArrayBindingPattern7.types b/tests/baselines/reference/sourceMapValidationDestructuringVariableStatementArrayBindingPattern7.types index 9b369e410a4..da537c6e109 100644 --- a/tests/baselines/reference/sourceMapValidationDestructuringVariableStatementArrayBindingPattern7.types +++ b/tests/baselines/reference/sourceMapValidationDestructuringVariableStatementArrayBindingPattern7.types @@ -2,9 +2,9 @@ var [x = 20, j] = [1, 2]; >x : number ->20 : number +>20 : 20 >j : number >[1, 2] : [number, number] ->1 : number ->2 : number +>1 : 1 +>2 : 2 diff --git a/tests/baselines/reference/sourceMapValidationDestructuringVariableStatementArrayBindingPatternDefaultValues.types b/tests/baselines/reference/sourceMapValidationDestructuringVariableStatementArrayBindingPatternDefaultValues.types index be5b47f2eaa..fae55a6cabf 100644 --- a/tests/baselines/reference/sourceMapValidationDestructuringVariableStatementArrayBindingPatternDefaultValues.types +++ b/tests/baselines/reference/sourceMapValidationDestructuringVariableStatementArrayBindingPatternDefaultValues.types @@ -13,66 +13,66 @@ var robotA: Robot = [1, "mower", "mowing"]; >robotA : [number, string, string] >Robot : [number, string, string] >[1, "mower", "mowing"] : [number, string, string] ->1 : number ->"mower" : string ->"mowing" : string +>1 : 1 +>"mower" : "mower" +>"mowing" : "mowing" var robotB: Robot = [2, "trimmer", "trimming"]; >robotB : [number, string, string] >Robot : [number, string, string] >[2, "trimmer", "trimming"] : [number, string, string] ->2 : number ->"trimmer" : string ->"trimming" : string +>2 : 2 +>"trimmer" : "trimmer" +>"trimming" : "trimming" let [, nameA = "noName"] = robotA; > : undefined >nameA : string ->"noName" : string +>"noName" : "noName" >robotA : [number, string, string] let [numberB = -1] = robotB; >numberB : number ->-1 : number ->1 : number +>-1 : -1 +>1 : 1 >robotB : [number, string, string] let [numberA2 = -1, nameA2 = "noName", skillA2 = "noSkill"] = robotA; >numberA2 : number ->-1 : number ->1 : number +>-1 : -1 +>1 : 1 >nameA2 : string ->"noName" : string +>"noName" : "noName" >skillA2 : string ->"noSkill" : string +>"noSkill" : "noSkill" >robotA : [number, string, string] let [numberC2 = -1] = [3, "edging", "Trimming edges"]; >numberC2 : number ->-1 : number ->1 : number +>-1 : -1 +>1 : 1 >[3, "edging", "Trimming edges"] : [number, string, string] ->3 : number ->"edging" : string ->"Trimming edges" : string +>3 : 3 +>"edging" : "edging" +>"Trimming edges" : "Trimming edges" let [numberC = -1, nameC = "noName", skillC = "noSkill"] = [3, "edging", "Trimming edges"]; >numberC : number ->-1 : number ->1 : number +>-1 : -1 +>1 : 1 >nameC : string ->"noName" : string +>"noName" : "noName" >skillC : string ->"noSkill" : string +>"noSkill" : "noSkill" >[3, "edging", "Trimming edges"] : [number, string, string] ->3 : number ->"edging" : string ->"Trimming edges" : string +>3 : 3 +>"edging" : "edging" +>"Trimming edges" : "Trimming edges" let [numberA3 = -1, ...robotAInfo] = robotA; >numberA3 : number ->-1 : number ->1 : number +>-1 : -1 +>1 : 1 >robotAInfo : (string | number)[] >robotA : [number, string, string] diff --git a/tests/baselines/reference/sourceMapValidationDestructuringVariableStatementArrayBindingPatternDefaultValues2.types b/tests/baselines/reference/sourceMapValidationDestructuringVariableStatementArrayBindingPatternDefaultValues2.types index 12215507d4a..21d75479c6d 100644 --- a/tests/baselines/reference/sourceMapValidationDestructuringVariableStatementArrayBindingPatternDefaultValues2.types +++ b/tests/baselines/reference/sourceMapValidationDestructuringVariableStatementArrayBindingPatternDefaultValues2.types @@ -13,69 +13,69 @@ var multiRobotA: MultiSkilledRobot = ["mower", ["mowing", ""]]; >multiRobotA : [string, string[]] >MultiSkilledRobot : [string, string[]] >["mower", ["mowing", ""]] : [string, string[]] ->"mower" : string +>"mower" : "mower" >["mowing", ""] : string[] ->"mowing" : string ->"" : string +>"mowing" : "mowing" +>"" : "" var multiRobotB: MultiSkilledRobot = ["trimmer", ["trimming", "edging"]]; >multiRobotB : [string, string[]] >MultiSkilledRobot : [string, string[]] >["trimmer", ["trimming", "edging"]] : [string, string[]] ->"trimmer" : string +>"trimmer" : "trimmer" >["trimming", "edging"] : string[] ->"trimming" : string ->"edging" : string +>"trimming" : "trimming" +>"edging" : "edging" let [, skillA = ["noSkill", "noSkill"]] = multiRobotA; > : undefined >skillA : string[] >["noSkill", "noSkill"] : string[] ->"noSkill" : string ->"noSkill" : string +>"noSkill" : "noSkill" +>"noSkill" : "noSkill" >multiRobotA : [string, string[]] let [nameMB = "noName" ] = multiRobotB; >nameMB : string ->"noName" : string +>"noName" : "noName" >multiRobotB : [string, string[]] let [nameMA = "noName", [primarySkillA = "noSkill", secondarySkillA = "noSkill"] = ["noSkill", "noSkill"]] = multiRobotA; >nameMA : string ->"noName" : string +>"noName" : "noName" >primarySkillA : string ->"noSkill" : string +>"noSkill" : "noSkill" >secondarySkillA : string ->"noSkill" : string +>"noSkill" : "noSkill" >["noSkill", "noSkill"] : [string, string] ->"noSkill" : string ->"noSkill" : string +>"noSkill" : "noSkill" +>"noSkill" : "noSkill" >multiRobotA : [string, string[]] let [nameMC = "noName" ] = ["roomba", ["vaccum", "mopping"]]; >nameMC : string ->"noName" : string +>"noName" : "noName" >["roomba", ["vaccum", "mopping"]] : [string, string[]] ->"roomba" : string +>"roomba" : "roomba" >["vaccum", "mopping"] : string[] ->"vaccum" : string ->"mopping" : string +>"vaccum" : "vaccum" +>"mopping" : "mopping" let [nameMC2 = "noName", [primarySkillC = "noSkill", secondarySkillC = "noSkill"] = ["noSkill", "noSkill"]] = ["roomba", ["vaccum", "mopping"]]; >nameMC2 : string ->"noName" : string +>"noName" : "noName" >primarySkillC : string ->"noSkill" : string +>"noSkill" : "noSkill" >secondarySkillC : string ->"noSkill" : string +>"noSkill" : "noSkill" >["noSkill", "noSkill"] : [string, string] ->"noSkill" : string ->"noSkill" : string +>"noSkill" : "noSkill" +>"noSkill" : "noSkill" >["roomba", ["vaccum", "mopping"]] : [string, [string, string]] ->"roomba" : string +>"roomba" : "roomba" >["vaccum", "mopping"] : [string, string] ->"vaccum" : string ->"mopping" : string +>"vaccum" : "vaccum" +>"mopping" : "mopping" if (nameMB == nameMA) { >nameMB == nameMA : boolean @@ -90,8 +90,8 @@ if (nameMB == nameMA) { >skillA[0] + skillA[1] : string >skillA[0] : string >skillA : string[] ->0 : number +>0 : 0 >skillA[1] : string >skillA : string[] ->1 : number +>1 : 1 } diff --git a/tests/baselines/reference/sourceMapValidationDestructuringVariableStatementArrayBindingPatternDefaultValues3.types b/tests/baselines/reference/sourceMapValidationDestructuringVariableStatementArrayBindingPatternDefaultValues3.types index 0b1454bdf3b..35c458f4310 100644 --- a/tests/baselines/reference/sourceMapValidationDestructuringVariableStatementArrayBindingPatternDefaultValues3.types +++ b/tests/baselines/reference/sourceMapValidationDestructuringVariableStatementArrayBindingPatternDefaultValues3.types @@ -16,35 +16,35 @@ var robotA: Robot = [1, "mower", "mowing"]; >robotA : [number, string, string] >Robot : [number, string, string] >[1, "mower", "mowing"] : [number, string, string] ->1 : number ->"mower" : string ->"mowing" : string +>1 : 1 +>"mower" : "mower" +>"mowing" : "mowing" var robotB: Robot = [2, "trimmer", "trimming"]; >robotB : [number, string, string] >Robot : [number, string, string] >[2, "trimmer", "trimming"] : [number, string, string] ->2 : number ->"trimmer" : string ->"trimming" : string +>2 : 2 +>"trimmer" : "trimmer" +>"trimming" : "trimming" var multiRobotA: MultiSkilledRobot = ["mower", ["mowing", ""]]; >multiRobotA : [string, string[]] >MultiSkilledRobot : [string, string[]] >["mower", ["mowing", ""]] : [string, string[]] ->"mower" : string +>"mower" : "mower" >["mowing", ""] : string[] ->"mowing" : string ->"" : string +>"mowing" : "mowing" +>"" : "" var multiRobotB: MultiSkilledRobot = ["trimmer", ["trimming", "edging"]]; >multiRobotB : [string, string[]] >MultiSkilledRobot : [string, string[]] >["trimmer", ["trimming", "edging"]] : [string, string[]] ->"trimmer" : string +>"trimmer" : "trimmer" >["trimming", "edging"] : string[] ->"trimming" : string ->"edging" : string +>"trimming" : "trimming" +>"edging" : "edging" let nameA: string, numberB: number, nameB: string, skillB: string; >nameA : string @@ -68,18 +68,18 @@ let multiRobotAInfo: (string | string[])[]; >[, nameA = "helloNoName"] = robotA : [number, string, string] >[, nameA = "helloNoName"] : [undefined, string] > : undefined ->nameA = "helloNoName" : string +>nameA = "helloNoName" : "helloNoName" >nameA : string ->"helloNoName" : string +>"helloNoName" : "helloNoName" >robotA : [number, string, string] [, nameB = "helloNoName"] = getRobotB(); >[, nameB = "helloNoName"] = getRobotB() : [number, string, string] >[, nameB = "helloNoName"] : [undefined, string] > : undefined ->nameB = "helloNoName" : string +>nameB = "helloNoName" : "helloNoName" >nameB : string ->"helloNoName" : string +>"helloNoName" : "helloNoName" >getRobotB() : [number, string, string] >getRobotB : () => [number, string, string] @@ -87,13 +87,13 @@ let multiRobotAInfo: (string | string[])[]; >[, nameB = "helloNoName"] = [2, "trimmer", "trimming"] : [number, string, string] >[, nameB = "helloNoName"] : [undefined, string] > : undefined ->nameB = "helloNoName" : string +>nameB = "helloNoName" : "helloNoName" >nameB : string ->"helloNoName" : string +>"helloNoName" : "helloNoName" >[2, "trimmer", "trimming"] : [number, string, string] ->2 : number ->"trimmer" : string ->"trimming" : string +>2 : 2 +>"trimmer" : "trimmer" +>"trimming" : "trimming" [, multiSkillB = []] = multiRobotB; >[, multiSkillB = []] = multiRobotB : [string, string[]] @@ -122,151 +122,151 @@ let multiRobotAInfo: (string | string[])[]; >multiSkillB : string[] >[] : undefined[] >["roomba", ["vaccum", "mopping"]] : [string, string[]] ->"roomba" : string +>"roomba" : "roomba" >["vaccum", "mopping"] : string[] ->"vaccum" : string ->"mopping" : string +>"vaccum" : "vaccum" +>"mopping" : "mopping" [numberB = -1] = robotB; >[numberB = -1] = robotB : [number, string, string] >[numberB = -1] : [number] ->numberB = -1 : number +>numberB = -1 : -1 >numberB : number ->-1 : number ->1 : number +>-1 : -1 +>1 : 1 >robotB : [number, string, string] [numberB = -1] = getRobotB(); >[numberB = -1] = getRobotB() : [number, string, string] >[numberB = -1] : [number] ->numberB = -1 : number +>numberB = -1 : -1 >numberB : number ->-1 : number ->1 : number +>-1 : -1 +>1 : 1 >getRobotB() : [number, string, string] >getRobotB : () => [number, string, string] [numberB = -1] = [2, "trimmer", "trimming"]; >[numberB = -1] = [2, "trimmer", "trimming"] : [number, string, string] >[numberB = -1] : [number] ->numberB = -1 : number +>numberB = -1 : -1 >numberB : number ->-1 : number ->1 : number +>-1 : -1 +>1 : 1 >[2, "trimmer", "trimming"] : [number, string, string] ->2 : number ->"trimmer" : string ->"trimming" : string +>2 : 2 +>"trimmer" : "trimmer" +>"trimming" : "trimming" [nameMB = "helloNoName"] = multiRobotB; >[nameMB = "helloNoName"] = multiRobotB : [string, string[]] >[nameMB = "helloNoName"] : [string] ->nameMB = "helloNoName" : string +>nameMB = "helloNoName" : "helloNoName" >nameMB : string ->"helloNoName" : string +>"helloNoName" : "helloNoName" >multiRobotB : [string, string[]] [nameMB = "helloNoName"] = getMultiRobotB(); >[nameMB = "helloNoName"] = getMultiRobotB() : [string, string[]] >[nameMB = "helloNoName"] : [string] ->nameMB = "helloNoName" : string +>nameMB = "helloNoName" : "helloNoName" >nameMB : string ->"helloNoName" : string +>"helloNoName" : "helloNoName" >getMultiRobotB() : [string, string[]] >getMultiRobotB : () => [string, string[]] [nameMB = "helloNoName"] = ["trimmer", ["trimming", "edging"]]; >[nameMB = "helloNoName"] = ["trimmer", ["trimming", "edging"]] : [string, string[]] >[nameMB = "helloNoName"] : [string] ->nameMB = "helloNoName" : string +>nameMB = "helloNoName" : "helloNoName" >nameMB : string ->"helloNoName" : string +>"helloNoName" : "helloNoName" >["trimmer", ["trimming", "edging"]] : [string, string[]] ->"trimmer" : string +>"trimmer" : "trimmer" >["trimming", "edging"] : string[] ->"trimming" : string ->"edging" : string +>"trimming" : "trimming" +>"edging" : "edging" [numberB = -1, nameB = "helloNoName", skillB = "noSkill"] = robotB; >[numberB = -1, nameB = "helloNoName", skillB = "noSkill"] = robotB : [number, string, string] >[numberB = -1, nameB = "helloNoName", skillB = "noSkill"] : [number, string, string] ->numberB = -1 : number +>numberB = -1 : -1 >numberB : number ->-1 : number ->1 : number ->nameB = "helloNoName" : string +>-1 : -1 +>1 : 1 +>nameB = "helloNoName" : "helloNoName" >nameB : string ->"helloNoName" : string ->skillB = "noSkill" : string +>"helloNoName" : "helloNoName" +>skillB = "noSkill" : "noSkill" >skillB : string ->"noSkill" : string +>"noSkill" : "noSkill" >robotB : [number, string, string] [numberB = -1, nameB = "helloNoName", skillB = "noSkill"] = getRobotB(); >[numberB = -1, nameB = "helloNoName", skillB = "noSkill"] = getRobotB() : [number, string, string] >[numberB = -1, nameB = "helloNoName", skillB = "noSkill"] : [number, string, string] ->numberB = -1 : number +>numberB = -1 : -1 >numberB : number ->-1 : number ->1 : number ->nameB = "helloNoName" : string +>-1 : -1 +>1 : 1 +>nameB = "helloNoName" : "helloNoName" >nameB : string ->"helloNoName" : string ->skillB = "noSkill" : string +>"helloNoName" : "helloNoName" +>skillB = "noSkill" : "noSkill" >skillB : string ->"noSkill" : string +>"noSkill" : "noSkill" >getRobotB() : [number, string, string] >getRobotB : () => [number, string, string] [numberB = -1, nameB = "helloNoName", skillB = "noSkill"] = [2, "trimmer", "trimming"]; >[numberB = -1, nameB = "helloNoName", skillB = "noSkill"] = [2, "trimmer", "trimming"] : [number, string, string] >[numberB = -1, nameB = "helloNoName", skillB = "noSkill"] : [number, string, string] ->numberB = -1 : number +>numberB = -1 : -1 >numberB : number ->-1 : number ->1 : number ->nameB = "helloNoName" : string +>-1 : -1 +>1 : 1 +>nameB = "helloNoName" : "helloNoName" >nameB : string ->"helloNoName" : string ->skillB = "noSkill" : string +>"helloNoName" : "helloNoName" +>skillB = "noSkill" : "noSkill" >skillB : string ->"noSkill" : string +>"noSkill" : "noSkill" >[2, "trimmer", "trimming"] : [number, string, string] ->2 : number ->"trimmer" : string ->"trimming" : string +>2 : 2 +>"trimmer" : "trimmer" +>"trimming" : "trimming" [nameMB = "helloNoName", [primarySkillB = "noSkill", secondarySkillB = "noSkill"] = []] = multiRobotB; >[nameMB = "helloNoName", [primarySkillB = "noSkill", secondarySkillB = "noSkill"] = []] = multiRobotB : [string, string[]] >[nameMB = "helloNoName", [primarySkillB = "noSkill", secondarySkillB = "noSkill"] = []] : [string, [string, string]] ->nameMB = "helloNoName" : string +>nameMB = "helloNoName" : "helloNoName" >nameMB : string ->"helloNoName" : string +>"helloNoName" : "helloNoName" >[primarySkillB = "noSkill", secondarySkillB = "noSkill"] = [] : [string, string] >[primarySkillB = "noSkill", secondarySkillB = "noSkill"] : [string, string] ->primarySkillB = "noSkill" : string +>primarySkillB = "noSkill" : "noSkill" >primarySkillB : string ->"noSkill" : string ->secondarySkillB = "noSkill" : string +>"noSkill" : "noSkill" +>secondarySkillB = "noSkill" : "noSkill" >secondarySkillB : string ->"noSkill" : string +>"noSkill" : "noSkill" >[] : [string, string] >multiRobotB : [string, string[]] [nameMB = "helloNoName", [primarySkillB = "noSkill", secondarySkillB = "noSkill"] = []] = getMultiRobotB(); >[nameMB = "helloNoName", [primarySkillB = "noSkill", secondarySkillB = "noSkill"] = []] = getMultiRobotB() : [string, string[]] >[nameMB = "helloNoName", [primarySkillB = "noSkill", secondarySkillB = "noSkill"] = []] : [string, [string, string]] ->nameMB = "helloNoName" : string +>nameMB = "helloNoName" : "helloNoName" >nameMB : string ->"helloNoName" : string +>"helloNoName" : "helloNoName" >[primarySkillB = "noSkill", secondarySkillB = "noSkill"] = [] : [string, string] >[primarySkillB = "noSkill", secondarySkillB = "noSkill"] : [string, string] ->primarySkillB = "noSkill" : string +>primarySkillB = "noSkill" : "noSkill" >primarySkillB : string ->"noSkill" : string ->secondarySkillB = "noSkill" : string +>"noSkill" : "noSkill" +>secondarySkillB = "noSkill" : "noSkill" >secondarySkillB : string ->"noSkill" : string +>"noSkill" : "noSkill" >[] : [string, string] >getMultiRobotB() : [string, string[]] >getMultiRobotB : () => [string, string[]] @@ -274,33 +274,33 @@ let multiRobotAInfo: (string | string[])[]; [nameMB = "helloNoName", [primarySkillB = "noSkill", secondarySkillB = "noSkill"] = []] = >[nameMB = "helloNoName", [primarySkillB = "noSkill", secondarySkillB = "noSkill"] = []] = ["trimmer", ["trimming", "edging"]] : [string, [string, string]] >[nameMB = "helloNoName", [primarySkillB = "noSkill", secondarySkillB = "noSkill"] = []] : [string, [string, string]] ->nameMB = "helloNoName" : string +>nameMB = "helloNoName" : "helloNoName" >nameMB : string ->"helloNoName" : string +>"helloNoName" : "helloNoName" >[primarySkillB = "noSkill", secondarySkillB = "noSkill"] = [] : [string, string] >[primarySkillB = "noSkill", secondarySkillB = "noSkill"] : [string, string] ->primarySkillB = "noSkill" : string +>primarySkillB = "noSkill" : "noSkill" >primarySkillB : string ->"noSkill" : string ->secondarySkillB = "noSkill" : string +>"noSkill" : "noSkill" +>secondarySkillB = "noSkill" : "noSkill" >secondarySkillB : string ->"noSkill" : string +>"noSkill" : "noSkill" >[] : [string, string] ["trimmer", ["trimming", "edging"]]; >["trimmer", ["trimming", "edging"]] : [string, [string, string]] ->"trimmer" : string +>"trimmer" : "trimmer" >["trimming", "edging"] : [string, string] ->"trimming" : string ->"edging" : string +>"trimming" : "trimming" +>"edging" : "edging" [numberB = -1, ...robotAInfo] = robotB; >[numberB = -1, ...robotAInfo] = robotB : [number, string, string] >[numberB = -1, ...robotAInfo] : (string | number)[] ->numberB = -1 : number +>numberB = -1 : -1 >numberB : number ->-1 : number ->1 : number +>-1 : -1 +>1 : 1 >...robotAInfo : string | number >robotAInfo : (string | number)[] >robotB : [number, string, string] @@ -308,10 +308,10 @@ let multiRobotAInfo: (string | string[])[]; [numberB = -1, ...robotAInfo] = getRobotB(); >[numberB = -1, ...robotAInfo] = getRobotB() : [number, string, string] >[numberB = -1, ...robotAInfo] : (string | number)[] ->numberB = -1 : number +>numberB = -1 : -1 >numberB : number ->-1 : number ->1 : number +>-1 : -1 +>1 : 1 >...robotAInfo : string | number >robotAInfo : (string | number)[] >getRobotB() : [number, string, string] @@ -320,18 +320,18 @@ let multiRobotAInfo: (string | string[])[]; [numberB = -1, ...robotAInfo] = [2, "trimmer", "trimming"]; >[numberB = -1, ...robotAInfo] = [2, "trimmer", "trimming"] : [number, string, string] >[numberB = -1, ...robotAInfo] : (string | number)[] ->numberB = -1 : number +>numberB = -1 : -1 >numberB : number ->-1 : number ->1 : number +>-1 : -1 +>1 : 1 >...robotAInfo : string | number >robotAInfo : (string | number)[] >[2, "trimmer", "trimming"] : [number, string, string] >Robot : [number, string, string] >[2, "trimmer", "trimming"] : [number, string, string] ->2 : number ->"trimmer" : string ->"trimming" : string +>2 : 2 +>"trimmer" : "trimmer" +>"trimming" : "trimming" if (nameA == nameB) { >nameA == nameB : boolean diff --git a/tests/baselines/reference/sourceMapValidationDestructuringVariableStatementDefaultValues.types b/tests/baselines/reference/sourceMapValidationDestructuringVariableStatementDefaultValues.types index 0ad3330e867..fbce7dedef1 100644 --- a/tests/baselines/reference/sourceMapValidationDestructuringVariableStatementDefaultValues.types +++ b/tests/baselines/reference/sourceMapValidationDestructuringVariableStatementDefaultValues.types @@ -17,53 +17,53 @@ declare var console: { } var hello = "hello"; >hello : string ->"hello" : string +>"hello" : "hello" var robotA: Robot = { name: "mower", skill: "mowing" }; >robotA : Robot >Robot : Robot >{ name: "mower", skill: "mowing" } : { name: string; skill: string; } >name : string ->"mower" : string +>"mower" : "mower" >skill : string ->"mowing" : string +>"mowing" : "mowing" var robotB: Robot = { name: "trimmer", skill: "trimming" }; >robotB : Robot >Robot : Robot >{ name: "trimmer", skill: "trimming" } : { name: string; skill: string; } >name : string ->"trimmer" : string +>"trimmer" : "trimmer" >skill : string ->"trimming" : string +>"trimming" : "trimming" var { name: nameA = "" } = robotA; >name : any >nameA : string ->"" : string +>"" : "" >robotA : Robot var { name: nameB = "", skill: skillB = "" } = robotB; >name : any >nameB : string ->"" : string +>"" : "" >skill : any >skillB : string ->"" : string +>"" : "" >robotB : Robot var { name: nameC = "", skill: skillC = "" } = { name: "Edger", skill: "cutting edges" }; >name : any >nameC : string ->"" : string +>"" : "" >skill : any >skillC : string ->"" : string +>"" : "" >{ name: "Edger", skill: "cutting edges" } : { name?: string; skill?: string; } >name : string ->"Edger" : string +>"Edger" : "Edger" >skill : string ->"cutting edges" : string +>"cutting edges" : "cutting edges" if (nameA == nameB) { >nameA == nameB : boolean diff --git a/tests/baselines/reference/sourceMapValidationDestructuringVariableStatementNestedObjectBindingPattern.types b/tests/baselines/reference/sourceMapValidationDestructuringVariableStatementNestedObjectBindingPattern.types index 1101b01b1a7..cf60c4a515f 100644 --- a/tests/baselines/reference/sourceMapValidationDestructuringVariableStatementNestedObjectBindingPattern.types +++ b/tests/baselines/reference/sourceMapValidationDestructuringVariableStatementNestedObjectBindingPattern.types @@ -28,26 +28,26 @@ var robotA: Robot = { name: "mower", skills: { primary: "mowing", secondary: "no >Robot : Robot >{ name: "mower", skills: { primary: "mowing", secondary: "none" } } : { name: string; skills: { primary: string; secondary: string; }; } >name : string ->"mower" : string +>"mower" : "mower" >skills : { primary: string; secondary: string; } >{ primary: "mowing", secondary: "none" } : { primary: string; secondary: string; } >primary : string ->"mowing" : string +>"mowing" : "mowing" >secondary : string ->"none" : string +>"none" : "none" var robotB: Robot = { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }; >robotB : Robot >Robot : Robot >{ name: "trimmer", skills: { primary: "trimming", secondary: "edging" } } : { name: string; skills: { primary: string; secondary: string; }; } >name : string ->"trimmer" : string +>"trimmer" : "trimmer" >skills : { primary: string; secondary: string; } >{ primary: "trimming", secondary: "edging" } : { primary: string; secondary: string; } >primary : string ->"trimming" : string +>"trimming" : "trimming" >secondary : string ->"edging" : string +>"edging" : "edging" var { skills: { primary: primaryA, secondary: secondaryA } } = robotA; >skills : any @@ -77,13 +77,13 @@ var { name: nameC, skills: { primary: primaryB, secondary: secondaryB } } = { na >secondaryB : string >{ name: "Edger", skills: { primary: "edging", secondary: "branch trimming" } } : { name: string; skills: { primary: string; secondary: string; }; } >name : string ->"Edger" : string +>"Edger" : "Edger" >skills : { primary: string; secondary: string; } >{ primary: "edging", secondary: "branch trimming" } : { primary: string; secondary: string; } >primary : string ->"edging" : string +>"edging" : "edging" >secondary : string ->"branch trimming" : string +>"branch trimming" : "branch trimming" if (nameB == nameB) { >nameB == nameB : boolean diff --git a/tests/baselines/reference/sourceMapValidationDestructuringVariableStatementNestedObjectBindingPatternWithDefaultValues.types b/tests/baselines/reference/sourceMapValidationDestructuringVariableStatementNestedObjectBindingPatternWithDefaultValues.types index e3fdec19339..fa007d9a2fc 100644 --- a/tests/baselines/reference/sourceMapValidationDestructuringVariableStatementNestedObjectBindingPatternWithDefaultValues.types +++ b/tests/baselines/reference/sourceMapValidationDestructuringVariableStatementNestedObjectBindingPatternWithDefaultValues.types @@ -28,26 +28,26 @@ var robotA: Robot = { name: "mower", skills: { primary: "mowing", secondary: "no >Robot : Robot >{ name: "mower", skills: { primary: "mowing", secondary: "none" } } : { name: string; skills: { primary: string; secondary: string; }; } >name : string ->"mower" : string +>"mower" : "mower" >skills : { primary: string; secondary: string; } >{ primary: "mowing", secondary: "none" } : { primary: string; secondary: string; } >primary : string ->"mowing" : string +>"mowing" : "mowing" >secondary : string ->"none" : string +>"none" : "none" var robotB: Robot = { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }; >robotB : Robot >Robot : Robot >{ name: "trimmer", skills: { primary: "trimming", secondary: "edging" } } : { name: string; skills: { primary: string; secondary: string; }; } >name : string ->"trimmer" : string +>"trimmer" : "trimmer" >skills : { primary: string; secondary: string; } >{ primary: "trimming", secondary: "edging" } : { primary: string; secondary: string; } >primary : string ->"trimming" : string +>"trimming" : "trimming" >secondary : string ->"edging" : string +>"edging" : "edging" var { skills: { @@ -56,19 +56,19 @@ var { primary: primaryA = "noSkill", >primary : any >primaryA : string ->"noSkill" : string +>"noSkill" : "noSkill" secondary: secondaryA = "noSkill" >secondary : any >secondaryA : string ->"noSkill" : string +>"noSkill" : "noSkill" } = { primary: "noSkill", secondary: "noSkill" } >{ primary: "noSkill", secondary: "noSkill" } : { primary?: string; secondary?: string; } >primary : string ->"noSkill" : string +>"noSkill" : "noSkill" >secondary : string ->"noSkill" : string +>"noSkill" : "noSkill" } = robotA; >robotA : Robot @@ -77,7 +77,7 @@ var { name: nameB = "noNameSpecified", >name : any >nameB : string ->"noNameSpecified" : string +>"noNameSpecified" : "noNameSpecified" skills: { >skills : any @@ -85,19 +85,19 @@ var { primary: primaryB = "noSkill", >primary : any >primaryB : string ->"noSkill" : string +>"noSkill" : "noSkill" secondary: secondaryB = "noSkill" >secondary : any >secondaryB : string ->"noSkill" : string +>"noSkill" : "noSkill" } = { primary: "noSkill", secondary: "noSkill" } >{ primary: "noSkill", secondary: "noSkill" } : { primary?: string; secondary?: string; } >primary : string ->"noSkill" : string +>"noSkill" : "noSkill" >secondary : string ->"noSkill" : string +>"noSkill" : "noSkill" } = robotB; >robotB : Robot @@ -106,7 +106,7 @@ var { name: nameC = "noNameSpecified", >name : any >nameC : string ->"noNameSpecified" : string +>"noNameSpecified" : "noNameSpecified" skills: { >skills : any @@ -114,32 +114,32 @@ var { primary: primaryB = "noSkill", >primary : any >primaryB : string ->"noSkill" : string +>"noSkill" : "noSkill" secondary: secondaryB = "noSkill" >secondary : any >secondaryB : string ->"noSkill" : string +>"noSkill" : "noSkill" } = { primary: "noSkill", secondary: "noSkill" } >{ primary: "noSkill", secondary: "noSkill" } : { primary?: string; secondary?: string; } >primary : string ->"noSkill" : string +>"noSkill" : "noSkill" >secondary : string ->"noSkill" : string +>"noSkill" : "noSkill" } = { name: "Edger", skills: { primary: "edging", secondary: "branch trimming" } }; >{ name: "Edger", skills: { primary: "edging", secondary: "branch trimming" } } : Robot >Robot : Robot >{ name: "Edger", skills: { primary: "edging", secondary: "branch trimming" } } : { name: string; skills: { primary: string; secondary: string; }; } >name : string ->"Edger" : string +>"Edger" : "Edger" >skills : { primary: string; secondary: string; } >{ primary: "edging", secondary: "branch trimming" } : { primary: string; secondary: string; } >primary : string ->"edging" : string +>"edging" : "edging" >secondary : string ->"branch trimming" : string +>"branch trimming" : "branch trimming" if (nameB == nameB) { >nameB == nameB : boolean diff --git a/tests/baselines/reference/sourceMapValidationDestructuringVariableStatementObjectBindingPattern1.types b/tests/baselines/reference/sourceMapValidationDestructuringVariableStatementObjectBindingPattern1.types index c975a9eaae5..14995bbe1c9 100644 --- a/tests/baselines/reference/sourceMapValidationDestructuringVariableStatementObjectBindingPattern1.types +++ b/tests/baselines/reference/sourceMapValidationDestructuringVariableStatementObjectBindingPattern1.types @@ -4,5 +4,5 @@ var {x} = { x: 20 }; >x : number >{ x: 20 } : { x: number; } >x : number ->20 : number +>20 : 20 diff --git a/tests/baselines/reference/sourceMapValidationDestructuringVariableStatementObjectBindingPattern2.types b/tests/baselines/reference/sourceMapValidationDestructuringVariableStatementObjectBindingPattern2.types index a694d4ecd29..52a5484052c 100644 --- a/tests/baselines/reference/sourceMapValidationDestructuringVariableStatementObjectBindingPattern2.types +++ b/tests/baselines/reference/sourceMapValidationDestructuringVariableStatementObjectBindingPattern2.types @@ -4,14 +4,14 @@ var {x} = { x: 20 }; >x : number >{ x: 20 } : { x: number; } >x : number ->20 : number +>20 : 20 var { a, b } = { a: 30, b: 40 }; >a : number >b : number >{ a: 30, b: 40 } : { a: number; b: number; } >a : number ->30 : number +>30 : 30 >b : number ->40 : number +>40 : 40 diff --git a/tests/baselines/reference/sourceMapValidationDestructuringVariableStatementObjectBindingPattern3.types b/tests/baselines/reference/sourceMapValidationDestructuringVariableStatementObjectBindingPattern3.types index bec1b195c98..4b70fa8aa8d 100644 --- a/tests/baselines/reference/sourceMapValidationDestructuringVariableStatementObjectBindingPattern3.types +++ b/tests/baselines/reference/sourceMapValidationDestructuringVariableStatementObjectBindingPattern3.types @@ -2,8 +2,8 @@ var {x = 500} = { x: 20 }; >x : number ->500 : number +>500 : 500 >{ x: 20 } : { x?: number; } >x : number ->20 : number +>20 : 20 diff --git a/tests/baselines/reference/sourceMapValidationDestructuringVariableStatementObjectBindingPattern4.types b/tests/baselines/reference/sourceMapValidationDestructuringVariableStatementObjectBindingPattern4.types index 1d00ac2d56b..1bd508ef2e5 100644 --- a/tests/baselines/reference/sourceMapValidationDestructuringVariableStatementObjectBindingPattern4.types +++ b/tests/baselines/reference/sourceMapValidationDestructuringVariableStatementObjectBindingPattern4.types @@ -2,13 +2,13 @@ var {x = 500, >x : number ->500 : number +>500 : 500 y} = { x: 20, y: "hi" }; >y : string >{ x: 20, y: "hi" } : { x?: number; y: string; } >x : number ->20 : number +>20 : 20 >y : string ->"hi" : string +>"hi" : "hi" diff --git a/tests/baselines/reference/sourceMapValidationDo.types b/tests/baselines/reference/sourceMapValidationDo.types index 7623a483fd1..85716b8f8b8 100644 --- a/tests/baselines/reference/sourceMapValidationDo.types +++ b/tests/baselines/reference/sourceMapValidationDo.types @@ -1,7 +1,7 @@ === tests/cases/compiler/sourceMapValidationDo.ts === var i = 0; >i : number ->0 : number +>0 : 0 do { @@ -12,7 +12,7 @@ do } while (i < 10); >i < 10 : boolean >i : number ->10 : number +>10 : 10 do { i++; @@ -22,5 +22,5 @@ do { } while (i < 20); >i < 20 : boolean >i : number ->20 : number +>20 : 20 diff --git a/tests/baselines/reference/sourceMapValidationFor.errors.txt b/tests/baselines/reference/sourceMapValidationFor.errors.txt index 6949d7545ed..c64544c4b6c 100644 --- a/tests/baselines/reference/sourceMapValidationFor.errors.txt +++ b/tests/baselines/reference/sourceMapValidationFor.errors.txt @@ -1,9 +1,10 @@ tests/cases/compiler/sourceMapValidationFor.ts(2,5): error TS2304: Cannot find name 'WScript'. tests/cases/compiler/sourceMapValidationFor.ts(6,5): error TS2304: Cannot find name 'WScript'. tests/cases/compiler/sourceMapValidationFor.ts(20,1): error TS7027: Unreachable code detected. +tests/cases/compiler/sourceMapValidationFor.ts(32,21): error TS2695: Left side of comma operator is unused and has no side effects. -==== tests/cases/compiler/sourceMapValidationFor.ts (3 errors) ==== +==== tests/cases/compiler/sourceMapValidationFor.ts (4 errors) ==== for (var i = 0; i < 10; i++) { WScript.Echo("i: " + i); ~~~~~~~ @@ -42,4 +43,6 @@ tests/cases/compiler/sourceMapValidationFor.ts(20,1): error TS7027: Unreachable i++; } for (i = 0, j = 20; j < 20, i < 20; j++) { + ~~~~~~ +!!! error TS2695: Left side of comma operator is unused and has no side effects. } \ No newline at end of file diff --git a/tests/baselines/reference/sourceMapValidationFunctionExpressions.types b/tests/baselines/reference/sourceMapValidationFunctionExpressions.types index 9ddfd93b89d..d51798c084f 100644 --- a/tests/baselines/reference/sourceMapValidationFunctionExpressions.types +++ b/tests/baselines/reference/sourceMapValidationFunctionExpressions.types @@ -1,7 +1,7 @@ === tests/cases/compiler/sourceMapValidationFunctionExpressions.ts === var greetings = 0; >greetings : number ->0 : number +>0 : 0 var greet = (greeting: string): number => { >greet : (greeting: string) => number @@ -18,7 +18,7 @@ var greet = (greeting: string): number => { greet("Hello"); >greet("Hello") : number >greet : (greeting: string) => number ->"Hello" : string +>"Hello" : "Hello" var incrGreetings = () => greetings++; >incrGreetings : () => number diff --git a/tests/baselines/reference/sourceMapValidationFunctions.types b/tests/baselines/reference/sourceMapValidationFunctions.types index 82cb550a8aa..6a085996c5c 100644 --- a/tests/baselines/reference/sourceMapValidationFunctions.types +++ b/tests/baselines/reference/sourceMapValidationFunctions.types @@ -1,7 +1,7 @@ === tests/cases/compiler/sourceMapValidationFunctions.ts === var greetings = 0; >greetings : number ->0 : number +>0 : 0 function greet(greeting: string): number { >greet : (greeting: string) => number @@ -18,7 +18,7 @@ function greet2(greeting: string, n = 10, x?: string, ...restParams: string[]): >greet2 : (greeting: string, n?: number, x?: string, ...restParams: string[]) => number >greeting : string >n : number ->10 : number +>10 : 10 >x : string >restParams : string[] @@ -33,7 +33,7 @@ function foo(greeting: string, n = 10, x?: string, ...restParams: string[]) >foo : (greeting: string, n?: number, x?: string, ...restParams: string[]) => void >greeting : string >n : number ->10 : number +>10 : 10 >x : string >restParams : string[] { diff --git a/tests/baselines/reference/sourceMapValidationIfElse.types b/tests/baselines/reference/sourceMapValidationIfElse.types index 2b195983f21..b4a76d55647 100644 --- a/tests/baselines/reference/sourceMapValidationIfElse.types +++ b/tests/baselines/reference/sourceMapValidationIfElse.types @@ -1,7 +1,7 @@ === tests/cases/compiler/sourceMapValidationIfElse.ts === var i = 10; >i : number ->10 : number +>10 : 10 if (i == 10) { >i == 10 : boolean @@ -41,7 +41,7 @@ else if (i == 20) { i += 70; >i += 70 : number >i : number ->70 : number +>70 : 70 } else { i--; diff --git a/tests/baselines/reference/sourceMapValidationLabeled.types b/tests/baselines/reference/sourceMapValidationLabeled.types index 7af624ac93b..6756494a5c7 100644 --- a/tests/baselines/reference/sourceMapValidationLabeled.types +++ b/tests/baselines/reference/sourceMapValidationLabeled.types @@ -5,5 +5,5 @@ x: var b = 10; >b : number ->10 : number +>10 : 10 diff --git a/tests/baselines/reference/sourceMapValidationModule.types b/tests/baselines/reference/sourceMapValidationModule.types index 2c653270650..45651200300 100644 --- a/tests/baselines/reference/sourceMapValidationModule.types +++ b/tests/baselines/reference/sourceMapValidationModule.types @@ -4,7 +4,7 @@ module m2 { var a = 10; >a : number ->10 : number +>10 : 10 a++; >a++ : number @@ -18,7 +18,7 @@ module m3 { export var x = 30; >x : number ->30 : number +>30 : 30 } export function foo() { diff --git a/tests/baselines/reference/sourceMapValidationSwitch.types b/tests/baselines/reference/sourceMapValidationSwitch.types index 1c0a73c1bbe..9df86ee2132 100644 --- a/tests/baselines/reference/sourceMapValidationSwitch.types +++ b/tests/baselines/reference/sourceMapValidationSwitch.types @@ -1,7 +1,7 @@ === tests/cases/compiler/sourceMapValidationSwitch.ts === var x = 10; >x : number ->10 : number +>10 : 10 switch (x) { >x : number @@ -29,7 +29,7 @@ switch (x) { >x : number >x *10 : number >x : number ->10 : number +>10 : 10 } switch (x) >x : number @@ -58,6 +58,6 @@ switch (x) >x : number >x * 10 : number >x : number ->10 : number +>10 : 10 } } diff --git a/tests/baselines/reference/sourceMapValidationTryCatchFinally.types b/tests/baselines/reference/sourceMapValidationTryCatchFinally.types index 9159ee5aa45..7d7fb1d3aa9 100644 --- a/tests/baselines/reference/sourceMapValidationTryCatchFinally.types +++ b/tests/baselines/reference/sourceMapValidationTryCatchFinally.types @@ -1,7 +1,7 @@ === tests/cases/compiler/sourceMapValidationTryCatchFinally.ts === var x = 10; >x : number ->10 : number +>10 : 10 try { x = x + 1; @@ -9,7 +9,7 @@ try { >x : number >x + 1 : number >x : number ->1 : number +>1 : 1 } catch (e) { >e : any @@ -19,7 +19,7 @@ try { >x : number >x - 1 : number >x : number ->1 : number +>1 : 1 } finally { x = x * 10; @@ -27,7 +27,7 @@ try { >x : number >x * 10 : number >x : number ->10 : number +>10 : 10 } try { @@ -36,7 +36,7 @@ try >x : number >x + 1 : number >x : number ->1 : number +>1 : 1 throw new Error(); >new Error() : Error @@ -50,7 +50,7 @@ catch (e) >x : number >x - 1 : number >x : number ->1 : number +>1 : 1 } finally { @@ -59,5 +59,5 @@ finally >x : number >x * 10 : number >x : number ->10 : number +>10 : 10 } diff --git a/tests/baselines/reference/sourceMapValidationVariables.types b/tests/baselines/reference/sourceMapValidationVariables.types index 2bacc7b526f..5dc46f5e792 100644 --- a/tests/baselines/reference/sourceMapValidationVariables.types +++ b/tests/baselines/reference/sourceMapValidationVariables.types @@ -1,19 +1,19 @@ === tests/cases/compiler/sourceMapValidationVariables.ts === var a = 10; >a : number ->10 : number +>10 : 10 var b; >b : any var c = 10, d, e; >c : number ->10 : number +>10 : 10 >d : any >e : any var c2, d2 = 10; >c2 : any >d2 : number ->10 : number +>10 : 10 diff --git a/tests/baselines/reference/sourceMapValidationWhile.types b/tests/baselines/reference/sourceMapValidationWhile.types index 86cf0216276..71b50d86736 100644 --- a/tests/baselines/reference/sourceMapValidationWhile.types +++ b/tests/baselines/reference/sourceMapValidationWhile.types @@ -1,7 +1,7 @@ === tests/cases/compiler/sourceMapValidationWhile.ts === var a = 10; >a : number ->10 : number +>10 : 10 while (a == 10) { >a == 10 : boolean diff --git a/tests/baselines/reference/sourceMapValidationWithComments.types b/tests/baselines/reference/sourceMapValidationWithComments.types index 26971f0aaab..3e4b4639754 100644 --- a/tests/baselines/reference/sourceMapValidationWithComments.types +++ b/tests/baselines/reference/sourceMapValidationWithComments.types @@ -8,7 +8,7 @@ class DebugClass { // Start Debugger Test Code var i = 0; >i : number ->0 : number +>0 : 0 i++; >i++ : number @@ -50,6 +50,6 @@ class DebugClass { return true; ->true : boolean +>true : true } } diff --git a/tests/baselines/reference/sourceMapWithMultipleFilesWithCopyright.types b/tests/baselines/reference/sourceMapWithMultipleFilesWithCopyright.types index 8e9cda7377a..7c7cbc4e599 100644 --- a/tests/baselines/reference/sourceMapWithMultipleFilesWithCopyright.types +++ b/tests/baselines/reference/sourceMapWithMultipleFilesWithCopyright.types @@ -19,11 +19,11 @@ var x = { a: 10, >a : number ->10 : number +>10 : 10 b: 20 >b : number ->20 : number +>20 : 20 }; diff --git a/tests/baselines/reference/sourceMapWithMultipleFilesWithFileEndingWithInterface.types b/tests/baselines/reference/sourceMapWithMultipleFilesWithFileEndingWithInterface.types index 561be8ce783..d3a26c4114e 100644 --- a/tests/baselines/reference/sourceMapWithMultipleFilesWithFileEndingWithInterface.types +++ b/tests/baselines/reference/sourceMapWithMultipleFilesWithFileEndingWithInterface.types @@ -4,7 +4,7 @@ module M { export var X = 1; >X : number ->1 : number +>1 : 1 } interface Navigator { >Navigator : Navigator diff --git a/tests/baselines/reference/sourcemapValidationDuplicateNames.types b/tests/baselines/reference/sourcemapValidationDuplicateNames.types index ccc6caa23b4..3798144f3af 100644 --- a/tests/baselines/reference/sourcemapValidationDuplicateNames.types +++ b/tests/baselines/reference/sourcemapValidationDuplicateNames.types @@ -4,7 +4,7 @@ module m1 { var x = 10; >x : number ->10 : number +>10 : 10 export class c { >c : c diff --git a/tests/baselines/reference/specializeVarArgs1.types b/tests/baselines/reference/specializeVarArgs1.types index 97b46876e66..68e1be49d5e 100644 --- a/tests/baselines/reference/specializeVarArgs1.types +++ b/tests/baselines/reference/specializeVarArgs1.types @@ -41,5 +41,5 @@ a.push('Some Value'); >a.push : (...values: string[]) => any >a : ObservableArray >push : (...values: string[]) => any ->'Some Value' : string +>'Some Value' : "Some Value" diff --git a/tests/baselines/reference/specializedSignatureAsCallbackParameter1.errors.txt b/tests/baselines/reference/specializedSignatureAsCallbackParameter1.errors.txt index 61b499e0aee..cf294de7780 100644 --- a/tests/baselines/reference/specializedSignatureAsCallbackParameter1.errors.txt +++ b/tests/baselines/reference/specializedSignatureAsCallbackParameter1.errors.txt @@ -1,5 +1,5 @@ -tests/cases/compiler/specializedSignatureAsCallbackParameter1.ts(7,4): error TS2345: Argument of type 'number' is not assignable to parameter of type 'string'. -tests/cases/compiler/specializedSignatureAsCallbackParameter1.ts(8,4): error TS2345: Argument of type 'number' is not assignable to parameter of type 'string'. +tests/cases/compiler/specializedSignatureAsCallbackParameter1.ts(7,4): error TS2345: Argument of type '1' is not assignable to parameter of type 'string'. +tests/cases/compiler/specializedSignatureAsCallbackParameter1.ts(8,4): error TS2345: Argument of type '1' is not assignable to parameter of type 'string'. ==== tests/cases/compiler/specializedSignatureAsCallbackParameter1.ts (2 errors) ==== @@ -11,7 +11,7 @@ tests/cases/compiler/specializedSignatureAsCallbackParameter1.ts(8,4): error TS2 // both are errors x3(1, (x: string) => 1); ~ -!!! error TS2345: Argument of type 'number' is not assignable to parameter of type 'string'. +!!! error TS2345: Argument of type '1' is not assignable to parameter of type 'string'. x3(1, (x: 'hm') => 1); ~ -!!! error TS2345: Argument of type 'number' is not assignable to parameter of type 'string'. \ No newline at end of file +!!! error TS2345: Argument of type '1' is not assignable to parameter of type 'string'. \ No newline at end of file diff --git a/tests/baselines/reference/staticAnonymousTypeNotReferencingTypeParameter.types b/tests/baselines/reference/staticAnonymousTypeNotReferencingTypeParameter.types index 69de032ca2e..f2bd83674cd 100644 --- a/tests/baselines/reference/staticAnonymousTypeNotReferencingTypeParameter.types +++ b/tests/baselines/reference/staticAnonymousTypeNotReferencingTypeParameter.types @@ -24,7 +24,7 @@ let y: number = outer(5).y; >outer(5).y : number >outer(5) : typeof Inner >outer : (x: T) => typeof Inner ->5 : number +>5 : 5 >y : number class ListWrapper2 { @@ -42,7 +42,7 @@ class ListWrapper2 { >array.slice : (start?: number, end?: number) => T[] >array : T[] >slice : (start?: number, end?: number) => T[] ->0 : number +>0 : 0 static reversed(dit: typeof ListWrapper2, array: T[]): T[] { >reversed : (dit: typeof ListWrapper2, array: T[]) => T[] @@ -92,7 +92,7 @@ namespace tessst { for (let i = 0, len = array.length; i < len; i++) { >i : number ->0 : number +>0 : 0 >len : number >array.length : number >array : T[] @@ -171,7 +171,7 @@ class ListWrapper { >array.slice : (start?: number, end?: number) => T[] >array : T[] >slice : (start?: number, end?: number) => T[] ->0 : number +>0 : 0 static forEachWithIndex(dit: typeof ListWrapper, array: T[], fn: (t: T, n: number) => void) { >forEachWithIndex : (dit: typeof ListWrapper, array: T[], fn: (t: T, n: number) => void) => void @@ -187,7 +187,7 @@ class ListWrapper { for (var i = 0; i < array.length; i++) { >i : number ->0 : number +>0 : 0 >i < array.length : boolean >i : number >array.length : number @@ -222,7 +222,7 @@ class ListWrapper { return array[0]; >array[0] : T >array : T[] ->0 : number +>0 : 0 } static last(dit: typeof ListWrapper, array: T[]): T { >last : (dit: typeof ListWrapper, array: T[]) => T @@ -251,7 +251,7 @@ class ListWrapper { >array.length : number >array : T[] >length : number ->1 : number +>1 : 1 } static indexOf(dit: typeof ListWrapper, array: T[], value: T, startIndex: number = 0): number { >indexOf : (dit: typeof ListWrapper, array: T[], value: T, startIndex?: number) => number @@ -263,7 +263,7 @@ class ListWrapper { >value : T >T : T >startIndex : number ->0 : number +>0 : 0 return array.indexOf(value, startIndex); >array.indexOf(value, startIndex) : number @@ -289,7 +289,7 @@ class ListWrapper { >indexOf : (searchElement: T, fromIndex?: number) => number >el : T >-1 : -1 ->1 : number +>1 : 1 static reversed(dit: typeof ListWrapper, array: T[]): T[] { >reversed : (dit: typeof ListWrapper, array: T[]) => T[] @@ -318,8 +318,8 @@ class ListWrapper { >scanner.scanRange : (start: number, length: number, callback: () => T) => T >scanner : Scanner >scanRange : (start: number, length: number, callback: () => T) => T ->3 : number ->5 : number +>3 : 3 +>5 : 5 >() => { } : () => void return tessst.funkyFor(array, t => t.toString()) ? a.reverse() : a; @@ -368,7 +368,7 @@ class ListWrapper { >list : T[] >splice : { (start: number): T[]; (start: number, deleteCount: number, ...items: T[]): T[]; } >index : number ->0 : number +>0 : 0 >value : T static removeAt(dit: typeof ListWrapper, list: T[], index: number): T { @@ -393,7 +393,7 @@ class ListWrapper { >list : T[] >splice : { (start: number): T[]; (start: number, deleteCount: number, ...items: T[]): T[]; } >index : number ->1 : number +>1 : 1 return res; >res : T @@ -410,7 +410,7 @@ class ListWrapper { for (var i = 0; i < items.length; ++i) { >i : number ->0 : number +>0 : 0 >i < items.length : boolean >i : number >items.length : number @@ -435,7 +435,7 @@ class ListWrapper { >list : T[] >splice : { (start: number): T[]; (start: number, deleteCount: number, ...items: T[]): T[]; } >index : number ->1 : number +>1 : 1 } } static remove(dit: typeof ListWrapper, list: T[], el: T): boolean { @@ -459,8 +459,8 @@ class ListWrapper { if (index > -1) { >index > -1 : boolean >index : number ->-1 : number ->1 : number +>-1 : -1 +>1 : 1 list.splice(index, 1); >list.splice(index, 1) : T[] @@ -468,24 +468,24 @@ class ListWrapper { >list : T[] >splice : { (start: number): T[]; (start: number, deleteCount: number, ...items: T[]): T[]; } >index : number ->1 : number +>1 : 1 return true; ->true : boolean +>true : true } return false; ->false : boolean +>false : false } static clear(dit: typeof ListWrapper, list: any[]) { list.length = 0; } >clear : (dit: typeof ListWrapper, list: any[]) => void >dit : typeof ListWrapper >ListWrapper : typeof ListWrapper >list : any[] ->list.length = 0 : number +>list.length = 0 : 0 >list.length : number >list : any[] >length : number ->0 : number +>0 : 0 static isEmpty(dit: typeof ListWrapper, list: any[]): boolean { return list.length == 0; } >isEmpty : (dit: typeof ListWrapper, list: any[]) => boolean @@ -505,7 +505,7 @@ class ListWrapper { >list : any[] >value : any >start : number ->0 : number +>0 : 0 >end : number >null : null @@ -540,11 +540,11 @@ class ListWrapper { >b.length : number >b : any[] >length : number ->false : boolean +>false : false for (var i = 0; i < a.length; ++i) { >i : number ->0 : number +>0 : 0 >i < a.length : boolean >i : number >a.length : number @@ -561,10 +561,10 @@ class ListWrapper { >b[i] : any >b : any[] >i : number ->false : boolean +>false : false } return true; ->true : boolean +>true : true } static slice(dit: typeof ListWrapper, l: T[], from: number = 0, to: number = null): T[] { >slice : (dit: typeof ListWrapper, l: T[], from?: number, to?: number) => T[] @@ -574,7 +574,7 @@ class ListWrapper { >l : T[] >T : T >from : number ->0 : number +>0 : 0 >to : number >null : null >T : T @@ -701,7 +701,7 @@ class ListWrapper { for (var index = 0; index < list.length; index++) { >index : number ->0 : number +>0 : 0 >index < list.length : boolean >index : number >list.length : number @@ -757,10 +757,10 @@ let cloned = ListWrapper.clone(ListWrapper, [1,2,3,4]); >clone : (dit: typeof ListWrapper, array: T[]) => T[] >ListWrapper : typeof ListWrapper >[1,2,3,4] : number[] ->1 : number ->2 : number ->3 : number ->4 : number +>1 : 1 +>2 : 2 +>3 : 3 +>4 : 4 declare function isBlank(x: any): boolean; >isBlank : (x: any) => boolean diff --git a/tests/baselines/reference/staticFactory1.types b/tests/baselines/reference/staticFactory1.types index 538728de2df..941dc614559 100644 --- a/tests/baselines/reference/staticFactory1.types +++ b/tests/baselines/reference/staticFactory1.types @@ -4,7 +4,7 @@ class Base { foo() { return 1; } >foo : () => number ->1 : number +>1 : 1 static create() { >create : () => Base @@ -21,7 +21,7 @@ class Derived extends Base { foo() { return 2; } >foo : () => number ->2 : number +>2 : 2 } var d = Derived.create(); >d : Base diff --git a/tests/baselines/reference/staticInstanceResolution.types b/tests/baselines/reference/staticInstanceResolution.types index 255242252e3..1eb555487da 100644 --- a/tests/baselines/reference/staticInstanceResolution.types +++ b/tests/baselines/reference/staticInstanceResolution.types @@ -18,7 +18,7 @@ class Comment { >comments[0].getDocCommentText : () => void >comments[0] : Comment >comments : Comment[] ->0 : number +>0 : 0 >getDocCommentText : () => void var c: Comment; diff --git a/tests/baselines/reference/staticInstanceResolution2.types b/tests/baselines/reference/staticInstanceResolution2.types index 200e3336a28..68abb3a08ce 100644 --- a/tests/baselines/reference/staticInstanceResolution2.types +++ b/tests/baselines/reference/staticInstanceResolution2.types @@ -7,7 +7,7 @@ A.hasOwnProperty('foo'); >A.hasOwnProperty : (v: string) => boolean >A : typeof A >hasOwnProperty : (v: string) => boolean ->'foo' : string +>'foo' : "foo" class B { >B : B @@ -19,7 +19,7 @@ B.hasOwnProperty('foo'); >B.hasOwnProperty : (v: string) => boolean >B : typeof B >hasOwnProperty : (v: string) => boolean ->'foo' : string +>'foo' : "foo" diff --git a/tests/baselines/reference/staticInstanceResolution3.types b/tests/baselines/reference/staticInstanceResolution3.types index fe50c659f6d..2bc480b0ac8 100644 --- a/tests/baselines/reference/staticInstanceResolution3.types +++ b/tests/baselines/reference/staticInstanceResolution3.types @@ -10,7 +10,7 @@ WinJS.Promise.timeout(10); >WinJS : typeof WinJS >Promise : typeof WinJS.Promise >timeout : (delay: number) => WinJS.Promise ->10 : number +>10 : 10 === tests/cases/compiler/staticInstanceResolution3_0.ts === export class Promise { diff --git a/tests/baselines/reference/staticMemberAccessOffDerivedType1.types b/tests/baselines/reference/staticMemberAccessOffDerivedType1.types index 55b9c83969b..8eaba4abb98 100644 --- a/tests/baselines/reference/staticMemberAccessOffDerivedType1.types +++ b/tests/baselines/reference/staticMemberAccessOffDerivedType1.types @@ -6,7 +6,7 @@ class SomeBase { >GetNumber : () => number return 2; ->2 : number +>2 : 2 } } class P extends SomeBase { diff --git a/tests/baselines/reference/staticMemberInitialization.types b/tests/baselines/reference/staticMemberInitialization.types index 518b2fce25f..cb2c37f3fe0 100644 --- a/tests/baselines/reference/staticMemberInitialization.types +++ b/tests/baselines/reference/staticMemberInitialization.types @@ -4,7 +4,7 @@ class C { static x = 1; >x : number ->1 : number +>1 : 1 } var c = new C(); diff --git a/tests/baselines/reference/staticMemberWithStringAndNumberNames.types b/tests/baselines/reference/staticMemberWithStringAndNumberNames.types index e23ac90d59a..b0826343d20 100644 --- a/tests/baselines/reference/staticMemberWithStringAndNumberNames.types +++ b/tests/baselines/reference/staticMemberWithStringAndNumberNames.types @@ -3,44 +3,44 @@ class C { >C : C static "foo" = 0; ->0 : number +>0 : 0 static 0 = 1; ->1 : number +>1 : 1 x = C['foo']; >x : number >C['foo'] : number >C : typeof C ->'foo' : string +>'foo' : "foo" x2 = C['0']; >x2 : number >C['0'] : number >C : typeof C ->'0' : string +>'0' : "0" x3 = C[0]; >x3 : number >C[0] : number >C : typeof C ->0 : number +>0 : 0 static s = C['foo']; >s : number >C['foo'] : number >C : typeof C ->'foo' : string +>'foo' : "foo" static s2 = C['0']; >s2 : number >C['0'] : number >C : typeof C ->'0' : string +>'0' : "0" static s3 = C[0]; >s3 : number >C[0] : number >C : typeof C ->0 : number +>0 : 0 } diff --git a/tests/baselines/reference/stradac.types b/tests/baselines/reference/stradac.types index acdb54f45bd..b0b0cb895a2 100644 --- a/tests/baselines/reference/stradac.types +++ b/tests/baselines/reference/stradac.types @@ -1,7 +1,7 @@ === tests/cases/compiler/stradac.ts === var x = 10; >x : number ->10 : number +>10 : 10 // C++-style comment diff --git a/tests/baselines/reference/strictModeReservedWord.errors.txt b/tests/baselines/reference/strictModeReservedWord.errors.txt index 02ece81a1d9..7a1bacbb525 100644 --- a/tests/baselines/reference/strictModeReservedWord.errors.txt +++ b/tests/baselines/reference/strictModeReservedWord.errors.txt @@ -40,7 +40,7 @@ tests/cases/compiler/strictModeReservedWord.ts(22,22): error TS1212: Identifier tests/cases/compiler/strictModeReservedWord.ts(22,30): error TS1212: Identifier expected. 'implements' is a reserved word in strict mode tests/cases/compiler/strictModeReservedWord.ts(23,5): error TS2304: Cannot find name 'ublic'. tests/cases/compiler/strictModeReservedWord.ts(24,5): error TS1212: Identifier expected. 'static' is a reserved word in strict mode -tests/cases/compiler/strictModeReservedWord.ts(24,5): error TS2349: Cannot invoke an expression whose type lacks a call signature. +tests/cases/compiler/strictModeReservedWord.ts(24,5): error TS2349: Cannot invoke an expression whose type lacks a call signature. Type 'String' has no compatible call signatures. ==== tests/cases/compiler/strictModeReservedWord.ts (43 errors) ==== @@ -153,7 +153,7 @@ tests/cases/compiler/strictModeReservedWord.ts(24,5): error TS2349: Cannot invok ~~~~~~ !!! error TS1212: Identifier expected. 'static' is a reserved word in strict mode ~~~~~~~~ -!!! error TS2349: Cannot invoke an expression whose type lacks a call signature. +!!! error TS2349: Cannot invoke an expression whose type lacks a call signature. Type 'String' has no compatible call signatures. } \ No newline at end of file diff --git a/tests/baselines/reference/strictModeReservedWordInClassDeclaration.errors.txt b/tests/baselines/reference/strictModeReservedWordInClassDeclaration.errors.txt index 0b868960bed..0dff64c9a31 100644 --- a/tests/baselines/reference/strictModeReservedWordInClassDeclaration.errors.txt +++ b/tests/baselines/reference/strictModeReservedWordInClassDeclaration.errors.txt @@ -16,9 +16,9 @@ tests/cases/compiler/strictModeReservedWordInClassDeclaration.ts(21,9): error TS tests/cases/compiler/strictModeReservedWordInClassDeclaration.ts(21,17): error TS1213: Identifier expected. 'private' is a reserved word in strict mode. Class definitions are automatically in strict mode. tests/cases/compiler/strictModeReservedWordInClassDeclaration.ts(23,20): error TS1213: Identifier expected. 'public' is a reserved word in strict mode. Class definitions are automatically in strict mode. tests/cases/compiler/strictModeReservedWordInClassDeclaration.ts(25,20): error TS1213: Identifier expected. 'public' is a reserved word in strict mode. Class definitions are automatically in strict mode. -tests/cases/compiler/strictModeReservedWordInClassDeclaration.ts(25,20): error TS2503: Cannot find namespace 'public'. +tests/cases/compiler/strictModeReservedWordInClassDeclaration.ts(25,20): error TS2693: 'public' only refers to a type, but is being used as a value here. tests/cases/compiler/strictModeReservedWordInClassDeclaration.ts(26,21): error TS1213: Identifier expected. 'public' is a reserved word in strict mode. Class definitions are automatically in strict mode. -tests/cases/compiler/strictModeReservedWordInClassDeclaration.ts(26,21): error TS2503: Cannot find namespace 'public'. +tests/cases/compiler/strictModeReservedWordInClassDeclaration.ts(26,21): error TS2693: 'public' only refers to a type, but is being used as a value here. tests/cases/compiler/strictModeReservedWordInClassDeclaration.ts(27,17): error TS1213: Identifier expected. 'package' is a reserved word in strict mode. Class definitions are automatically in strict mode. tests/cases/compiler/strictModeReservedWordInClassDeclaration.ts(27,17): error TS2304: Cannot find name 'package'. tests/cases/compiler/strictModeReservedWordInClassDeclaration.ts(28,17): error TS1213: Identifier expected. 'package' is a reserved word in strict mode. Class definitions are automatically in strict mode. @@ -88,12 +88,12 @@ tests/cases/compiler/strictModeReservedWordInClassDeclaration.ts(28,17): error T ~~~~~~ !!! error TS1213: Identifier expected. 'public' is a reserved word in strict mode. Class definitions are automatically in strict mode. ~~~~~~ -!!! error TS2503: Cannot find namespace 'public'. +!!! error TS2693: 'public' only refers to a type, but is being used as a value here. class F1 implements public.private.implements { } ~~~~~~ !!! error TS1213: Identifier expected. 'public' is a reserved word in strict mode. Class definitions are automatically in strict mode. ~~~~~~ -!!! error TS2503: Cannot find namespace 'public'. +!!! error TS2693: 'public' only refers to a type, but is being used as a value here. class G extends package { } ~~~~~~~ !!! error TS1213: Identifier expected. 'package' is a reserved word in strict mode. Class definitions are automatically in strict mode. diff --git a/tests/baselines/reference/strictModeUseContextualKeyword.types b/tests/baselines/reference/strictModeUseContextualKeyword.types index a13e3d16ef8..9c6a89a7321 100644 --- a/tests/baselines/reference/strictModeUseContextualKeyword.types +++ b/tests/baselines/reference/strictModeUseContextualKeyword.types @@ -1,10 +1,10 @@ === tests/cases/compiler/strictModeUseContextualKeyword.ts === "use strict" ->"use strict" : string +>"use strict" : "use strict" var as = 0; >as : number ->0 : number +>0 : 0 function foo(as: string) { } >foo : (as: string) => void @@ -29,6 +29,6 @@ function H() { >as : number >{ as: 1 } : { as: number; } >as : number ->1 : number +>1 : 1 } diff --git a/tests/baselines/reference/strictModeWordInExportDeclaration.types b/tests/baselines/reference/strictModeWordInExportDeclaration.types index aa5f8e84f82..5064280bd31 100644 --- a/tests/baselines/reference/strictModeWordInExportDeclaration.types +++ b/tests/baselines/reference/strictModeWordInExportDeclaration.types @@ -1,10 +1,10 @@ === tests/cases/compiler/strictModeWordInExportDeclaration.ts === "use strict" ->"use strict" : string +>"use strict" : "use strict" var x = 1; >x : number ->1 : number +>1 : 1 export { x as foo } >x : number diff --git a/tests/baselines/reference/strictNullChecksNoWidening.types b/tests/baselines/reference/strictNullChecksNoWidening.types index 6dd2ee3fb4c..a544f9cef94 100644 --- a/tests/baselines/reference/strictNullChecksNoWidening.types +++ b/tests/baselines/reference/strictNullChecksNoWidening.types @@ -11,7 +11,7 @@ var a2 = undefined; var a3 = void 0; >a3 : undefined >void 0 : undefined ->0 : number +>0 : 0 var b1 = []; >b1 : never[] diff --git a/tests/baselines/reference/strictNullLogicalAndOr.types b/tests/baselines/reference/strictNullLogicalAndOr.types index ba25c57fe1d..50eb6586a0f 100644 --- a/tests/baselines/reference/strictNullLogicalAndOr.types +++ b/tests/baselines/reference/strictNullLogicalAndOr.types @@ -9,7 +9,7 @@ let sinOrCos = Math.random() < .5; >Math.random : () => number >Math : Math >random : () => number ->.5 : number +>.5 : 0.5 let choice = sinOrCos && Math.sin || Math.cos; >choice : (x: number) => number @@ -44,7 +44,7 @@ function sq(n?: number): number { >n*n : number >n : number >n : number ->0 : number +>0 : 0 return r; >r : number @@ -53,5 +53,5 @@ function sq(n?: number): number { sq(3); >sq(3) : number >sq : (n?: number | undefined) => number ->3 : number +>3 : 3 diff --git a/tests/baselines/reference/stringHasStringValuedNumericIndexer.types b/tests/baselines/reference/stringHasStringValuedNumericIndexer.types index ce9504358eb..01f086ebbf4 100644 --- a/tests/baselines/reference/stringHasStringValuedNumericIndexer.types +++ b/tests/baselines/reference/stringHasStringValuedNumericIndexer.types @@ -2,6 +2,6 @@ var str: string = ""[0]; >str : string >""[0] : string ->"" : string ->0 : number +>"" : "" +>0 : 0 diff --git a/tests/baselines/reference/stringIncludes.types b/tests/baselines/reference/stringIncludes.types index 0d1e5ffea4d..1dce85fcec7 100644 --- a/tests/baselines/reference/stringIncludes.types +++ b/tests/baselines/reference/stringIncludes.types @@ -8,17 +8,17 @@ includes = "abcde".includes("cd"); >includes : boolean >"abcde".includes("cd") : boolean >"abcde".includes : (searchString: string, position?: number) => boolean ->"abcde" : string +>"abcde" : "abcde" >includes : (searchString: string, position?: number) => boolean ->"cd" : string +>"cd" : "cd" includes = "abcde".includes("cd", 2); >includes = "abcde".includes("cd", 2) : boolean >includes : boolean >"abcde".includes("cd", 2) : boolean >"abcde".includes : (searchString: string, position?: number) => boolean ->"abcde" : string +>"abcde" : "abcde" >includes : (searchString: string, position?: number) => boolean ->"cd" : string ->2 : number +>"cd" : "cd" +>2 : 2 diff --git a/tests/baselines/reference/stringIndexingResults.types b/tests/baselines/reference/stringIndexingResults.types index 1fdc580b1a2..9d7c19f49cc 100644 --- a/tests/baselines/reference/stringIndexingResults.types +++ b/tests/baselines/reference/stringIndexingResults.types @@ -7,7 +7,7 @@ class C { y = ''; >y : string ->'' : string +>'' : "" } var c: C; @@ -18,19 +18,19 @@ var r1 = c['y']; >r1 : string >c['y'] : string >c : C ->'y' : string +>'y' : "y" var r2 = c['a']; >r2 : string >c['a'] : string >c : C ->'a' : string +>'a' : "a" var r3 = c[1]; >r3 : string >c[1] : string >c : C ->1 : number +>1 : 1 interface I { >I : I @@ -50,19 +50,19 @@ var r4 = i['y']; >r4 : string >i['y'] : string >i : I ->'y' : string +>'y' : "y" var r5 = i['a']; >r5 : string >i['a'] : string >i : I ->'a' : string +>'a' : "a" var r6 = i[1]; >r6 : string >i[1] : string >i : I ->1 : number +>1 : 1 var a: { >a : { [x: string]: string; y: string; } @@ -78,42 +78,42 @@ var r7 = a['y']; >r7 : string >a['y'] : string >a : { [x: string]: string; y: string; } ->'y' : string +>'y' : "y" var r8 = a['a']; >r8 : string >a['a'] : string >a : { [x: string]: string; y: string; } ->'a' : string +>'a' : "a" var r9 = a[1]; >r9 : string >a[1] : string >a : { [x: string]: string; y: string; } ->1 : number +>1 : 1 var b: { [x: string]: string } = { y: '' } >b : { [x: string]: string; } >x : string >{ y: '' } : { y: string; } >y : string ->'' : string +>'' : "" var r10 = b['y']; >r10 : string >b['y'] : string >b : { [x: string]: string; } ->'y' : string +>'y' : "y" var r11 = b['a']; >r11 : string >b['a'] : string >b : { [x: string]: string; } ->'a' : string +>'a' : "a" var r12 = b[1]; >r12 : string >b[1] : string >b : { [x: string]: string; } ->1 : number +>1 : 1 diff --git a/tests/baselines/reference/stringLiteralCheckedInIf01.types b/tests/baselines/reference/stringLiteralCheckedInIf01.types index bbf83ebdaa6..2505870f9a9 100644 --- a/tests/baselines/reference/stringLiteralCheckedInIf01.types +++ b/tests/baselines/reference/stringLiteralCheckedInIf01.types @@ -36,6 +36,6 @@ function f(foo: T) { >foo as S[] : S[] >foo : S[] >S : S ->0 : number +>0 : 0 } } diff --git a/tests/baselines/reference/stringLiteralCheckedInIf02.types b/tests/baselines/reference/stringLiteralCheckedInIf02.types index d8e0be2f0d9..6589c85222a 100644 --- a/tests/baselines/reference/stringLiteralCheckedInIf02.types +++ b/tests/baselines/reference/stringLiteralCheckedInIf02.types @@ -42,6 +42,6 @@ function f(foo: T) { return foo[0]; >foo[0] : S >foo : S[] ->0 : number +>0 : 0 } } diff --git a/tests/baselines/reference/stringLiteralMatchedInSwitch01.types b/tests/baselines/reference/stringLiteralMatchedInSwitch01.types index a0147779fd0..5f2d68d47cd 100644 --- a/tests/baselines/reference/stringLiteralMatchedInSwitch01.types +++ b/tests/baselines/reference/stringLiteralMatchedInSwitch01.types @@ -31,7 +31,7 @@ switch (foo) { >foo as S[] : S[] >foo : S[] >S : S ->0 : number +>0 : 0 break; } diff --git a/tests/baselines/reference/stringLiteralObjectLiteralDeclaration1.types b/tests/baselines/reference/stringLiteralObjectLiteralDeclaration1.types index 3f06c5eaa75..7c4ea1c86bb 100644 --- a/tests/baselines/reference/stringLiteralObjectLiteralDeclaration1.types +++ b/tests/baselines/reference/stringLiteralObjectLiteralDeclaration1.types @@ -5,6 +5,6 @@ module m1 { export var n = { 'foo bar': 4 }; >n : { 'foo bar': number; } >{ 'foo bar': 4 } : { 'foo bar': number; } ->4 : number +>4 : 4 } diff --git a/tests/baselines/reference/stringLiteralPropertyNameWithLineContinuation1.types b/tests/baselines/reference/stringLiteralPropertyNameWithLineContinuation1.types index ee5b5b27b54..c5022b5463b 100644 --- a/tests/baselines/reference/stringLiteralPropertyNameWithLineContinuation1.types +++ b/tests/baselines/reference/stringLiteralPropertyNameWithLineContinuation1.types @@ -6,13 +6,13 @@ var x = {'text\ ': string; } ':'hello'} ->'hello' : string +>'hello' : "hello" x.text = "bar" ->x.text = "bar" : string +>x.text = "bar" : "bar" >x.text : string >x : { 'text\ ': string; } >text : string ->"bar" : string +>"bar" : "bar" diff --git a/tests/baselines/reference/stringLiteralTypesAndLogicalOrExpressions01.errors.txt b/tests/baselines/reference/stringLiteralTypesAndLogicalOrExpressions01.errors.txt new file mode 100644 index 00000000000..3a884d2d1c4 --- /dev/null +++ b/tests/baselines/reference/stringLiteralTypesAndLogicalOrExpressions01.errors.txt @@ -0,0 +1,18 @@ +tests/cases/conformance/types/stringLiteral/stringLiteralTypesAndLogicalOrExpressions01.ts(6,5): error TS2322: Type 'string' is not assignable to type '"foo"'. +tests/cases/conformance/types/stringLiteral/stringLiteralTypesAndLogicalOrExpressions01.ts(8,5): error TS2322: Type 'string' is not assignable to type '"foo" | "bar"'. + + +==== tests/cases/conformance/types/stringLiteral/stringLiteralTypesAndLogicalOrExpressions01.ts (2 errors) ==== + + declare function myRandBool(): boolean; + + let a: "foo" = "foo"; + let b = a || "foo"; + let c: "foo" = b; + ~ +!!! error TS2322: Type 'string' is not assignable to type '"foo"'. + let d = b || "bar"; + let e: "foo" | "bar" = d; + ~ +!!! error TS2322: Type 'string' is not assignable to type '"foo" | "bar"'. + \ No newline at end of file diff --git a/tests/baselines/reference/stringLiteralTypesAndLogicalOrExpressions01.js b/tests/baselines/reference/stringLiteralTypesAndLogicalOrExpressions01.js index 479256b18b7..b6bcaf7c887 100644 --- a/tests/baselines/reference/stringLiteralTypesAndLogicalOrExpressions01.js +++ b/tests/baselines/reference/stringLiteralTypesAndLogicalOrExpressions01.js @@ -20,7 +20,7 @@ var e = d; //// [stringLiteralTypesAndLogicalOrExpressions01.d.ts] declare function myRandBool(): boolean; declare let a: "foo"; -declare let b: "foo"; +declare let b: string; declare let c: "foo"; -declare let d: "foo" | "bar"; +declare let d: string; declare let e: "foo" | "bar"; diff --git a/tests/baselines/reference/stringLiteralTypesAndTuples01.js b/tests/baselines/reference/stringLiteralTypesAndTuples01.js index b887213c8f6..4700cc65730 100644 --- a/tests/baselines/reference/stringLiteralTypesAndTuples01.js +++ b/tests/baselines/reference/stringLiteralTypesAndTuples01.js @@ -39,4 +39,4 @@ function rawr(dino) { declare let hello: string, brave: string, newish: string, world: string; declare type RexOrRaptor = "t-rex" | "raptor"; declare let im: "I'm", a: "a", dinosaur: RexOrRaptor; -declare function rawr(dino: RexOrRaptor): string; +declare function rawr(dino: RexOrRaptor): "ROAAAAR!" | "yip yip!"; diff --git a/tests/baselines/reference/stringLiteralTypesAndTuples01.types b/tests/baselines/reference/stringLiteralTypesAndTuples01.types index 10a30a6d75c..f69e36cf541 100644 --- a/tests/baselines/reference/stringLiteralTypesAndTuples01.types +++ b/tests/baselines/reference/stringLiteralTypesAndTuples01.types @@ -7,10 +7,10 @@ let [hello, brave, newish, world] = ["Hello", "Brave", "New", "World"]; >newish : string >world : string >["Hello", "Brave", "New", "World"] : [string, string, string, string] ->"Hello" : string ->"Brave" : string ->"New" : string ->"World" : string +>"Hello" : "Hello" +>"Brave" : "Brave" +>"New" : "New" +>"World" : "World" type RexOrRaptor = "t-rex" | "raptor" >RexOrRaptor : RexOrRaptor @@ -26,12 +26,12 @@ let [im, a, dinosaur]: ["I'm", "a", RexOrRaptor] = ['I\'m', 'a', 't-rex']; >'t-rex' : "t-rex" rawr(dinosaur); ->rawr(dinosaur) : string ->rawr : (dino: RexOrRaptor) => string +>rawr(dinosaur) : "ROAAAAR!" | "yip yip!" +>rawr : (dino: RexOrRaptor) => "ROAAAAR!" | "yip yip!" >dinosaur : "t-rex" function rawr(dino: RexOrRaptor) { ->rawr : (dino: RexOrRaptor) => string +>rawr : (dino: RexOrRaptor) => "ROAAAAR!" | "yip yip!" >dino : RexOrRaptor >RexOrRaptor : RexOrRaptor @@ -41,7 +41,7 @@ function rawr(dino: RexOrRaptor) { >"t-rex" : "t-rex" return "ROAAAAR!"; ->"ROAAAAR!" : string +>"ROAAAAR!" : "ROAAAAR!" } if (dino === "raptor") { >dino === "raptor" : boolean @@ -49,11 +49,11 @@ function rawr(dino: RexOrRaptor) { >"raptor" : "raptor" return "yip yip!"; ->"yip yip!" : string +>"yip yip!" : "yip yip!" } throw "Unexpected " + dino; >"Unexpected " + dino : string ->"Unexpected " : string +>"Unexpected " : "Unexpected " >dino : never } diff --git a/tests/baselines/reference/stringLiteralTypesAsTags01.types b/tests/baselines/reference/stringLiteralTypesAsTags01.types index e95a7364f93..ad53fb01c79 100644 --- a/tests/baselines/reference/stringLiteralTypesAsTags01.types +++ b/tests/baselines/reference/stringLiteralTypesAsTags01.types @@ -79,12 +79,12 @@ let x: A = { >{ kind: "A", a: 100,} : { kind: "A"; a: number; } kind: "A", ->kind : "A" +>kind : string >"A" : "A" a: 100, >a : number ->100 : number +>100 : 100 } if (hasKind(x, "A")) { diff --git a/tests/baselines/reference/stringLiteralTypesAsTags02.types b/tests/baselines/reference/stringLiteralTypesAsTags02.types index c984b8a78f9..2e2cb2831b6 100644 --- a/tests/baselines/reference/stringLiteralTypesAsTags02.types +++ b/tests/baselines/reference/stringLiteralTypesAsTags02.types @@ -73,12 +73,12 @@ let x: A = { >{ kind: "A", a: 100,} : { kind: "A"; a: number; } kind: "A", ->kind : "A" +>kind : string >"A" : "A" a: 100, >a : number ->100 : number +>100 : 100 } if (hasKind(x, "A")) { diff --git a/tests/baselines/reference/stringLiteralTypesAsTags03.types b/tests/baselines/reference/stringLiteralTypesAsTags03.types index fbe71ff07c1..17507c1036f 100644 --- a/tests/baselines/reference/stringLiteralTypesAsTags03.types +++ b/tests/baselines/reference/stringLiteralTypesAsTags03.types @@ -76,12 +76,12 @@ let x: A = { >{ kind: "A", a: 100,} : { kind: "A"; a: number; } kind: "A", ->kind : "A" +>kind : string >"A" : "A" a: 100, >a : number ->100 : number +>100 : 100 } if (hasKind(x, "A")) { diff --git a/tests/baselines/reference/stringLiteralTypesAsTypeParameterConstraint01.js b/tests/baselines/reference/stringLiteralTypesAsTypeParameterConstraint01.js index 4f49d326ec0..805f16228ba 100644 --- a/tests/baselines/reference/stringLiteralTypesAsTypeParameterConstraint01.js +++ b/tests/baselines/reference/stringLiteralTypesAsTypeParameterConstraint01.js @@ -38,8 +38,8 @@ hResult = h("bar"); declare function foo(f: (x: T) => T): (x: T) => T; declare function bar(f: (x: T) => T): (x: T) => T; declare let f: (x: "foo") => "foo"; -declare let fResult: "foo"; +declare let fResult: string; declare let g: (x: "foo") => "foo"; -declare let gResult: "foo"; +declare let gResult: string; declare let h: (x: "foo" | "bar") => "foo" | "bar"; -declare let hResult: "foo" | "bar"; +declare let hResult: string; diff --git a/tests/baselines/reference/stringLiteralTypesAsTypeParameterConstraint01.types b/tests/baselines/reference/stringLiteralTypesAsTypeParameterConstraint01.types index fe9163fc819..e213faf3b69 100644 --- a/tests/baselines/reference/stringLiteralTypesAsTypeParameterConstraint01.types +++ b/tests/baselines/reference/stringLiteralTypesAsTypeParameterConstraint01.types @@ -33,7 +33,7 @@ let f = foo(x => x); >x : "foo" let fResult = f("foo"); ->fResult : "foo" +>fResult : string >f("foo") : "foo" >f : (x: "foo") => "foo" >"foo" : "foo" @@ -48,7 +48,7 @@ let g = foo((x => x)); >x : "foo" let gResult = g("foo"); ->gResult : "foo" +>gResult : string >g("foo") : "foo" >g : (x: "foo") => "foo" >"foo" : "foo" @@ -62,14 +62,14 @@ let h = bar(x => x); >x : "foo" | "bar" let hResult = h("foo"); ->hResult : "foo" | "bar" +>hResult : string >h("foo") : "foo" | "bar" >h : (x: "foo" | "bar") => "foo" | "bar" >"foo" : "foo" hResult = h("bar"); >hResult = h("bar") : "foo" | "bar" ->hResult : "foo" | "bar" +>hResult : string >h("bar") : "foo" | "bar" >h : (x: "foo" | "bar") => "foo" | "bar" >"bar" : "bar" diff --git a/tests/baselines/reference/stringLiteralTypesAsTypeParameterConstraint02.js b/tests/baselines/reference/stringLiteralTypesAsTypeParameterConstraint02.js index 173e74a6eef..06ee42b68ad 100644 --- a/tests/baselines/reference/stringLiteralTypesAsTypeParameterConstraint02.js +++ b/tests/baselines/reference/stringLiteralTypesAsTypeParameterConstraint02.js @@ -18,4 +18,4 @@ var fResult = f("foo"); //// [stringLiteralTypesAsTypeParameterConstraint02.d.ts] declare function foo(f: (x: T) => T): (x: T) => T; declare let f: (x: "foo") => "foo"; -declare let fResult: "foo"; +declare let fResult: string; diff --git a/tests/baselines/reference/stringLiteralTypesAsTypeParameterConstraint02.types b/tests/baselines/reference/stringLiteralTypesAsTypeParameterConstraint02.types index 3a1b8fdc05c..75ba54cf6c2 100644 --- a/tests/baselines/reference/stringLiteralTypesAsTypeParameterConstraint02.types +++ b/tests/baselines/reference/stringLiteralTypesAsTypeParameterConstraint02.types @@ -26,7 +26,7 @@ let f = foo((y: "foo" | "bar") => y === "foo" ? y : "foo"); >"foo" : "foo" let fResult = f("foo"); ->fResult : "foo" +>fResult : string >f("foo") : "foo" >f : (x: "foo") => "foo" >"foo" : "foo" diff --git a/tests/baselines/reference/stringLiteralTypesInUnionTypes01.errors.txt b/tests/baselines/reference/stringLiteralTypesInUnionTypes01.errors.txt new file mode 100644 index 00000000000..39b2b154cc8 --- /dev/null +++ b/tests/baselines/reference/stringLiteralTypesInUnionTypes01.errors.txt @@ -0,0 +1,26 @@ +tests/cases/conformance/types/stringLiteral/stringLiteralTypesInUnionTypes01.ts(16,9): error TS2322: Type 'string' is not assignable to type '"foo" | "bar" | "baz"'. + + +==== tests/cases/conformance/types/stringLiteral/stringLiteralTypesInUnionTypes01.ts (1 errors) ==== + + type T = "foo" | "bar" | "baz"; + + var x: "foo" | "bar" | "baz" = undefined; + var y: T = undefined; + + if (x === "foo") { + let a = x; + } + else if (x !== "bar") { + let b = x || y; + } + else { + let c = x; + let d = y; + let e: (typeof x) | (typeof y) = c || d; + ~ +!!! error TS2322: Type 'string' is not assignable to type '"foo" | "bar" | "baz"'. + } + + x = y; + y = x; \ No newline at end of file diff --git a/tests/baselines/reference/stringLiteralTypesInUnionTypes02.types b/tests/baselines/reference/stringLiteralTypesInUnionTypes02.types index ab63a9e2fab..40b34796e72 100644 --- a/tests/baselines/reference/stringLiteralTypesInUnionTypes02.types +++ b/tests/baselines/reference/stringLiteralTypesInUnionTypes02.types @@ -18,7 +18,7 @@ if (x === "foo") { >"foo" : "foo" let a = x; ->a : string | "foo" +>a : string >x : string | "foo" } else if (x !== "bar") { @@ -34,11 +34,11 @@ else if (x !== "bar") { } else { let c = x; ->c : string | "bar" +>c : string >x : string | "bar" let d = y; ->d : string | "foo" | "bar" | "baz" +>d : string >y : string | "foo" | "bar" | "baz" let e: (typeof x) | (typeof y) = c || d; @@ -46,8 +46,8 @@ else { >x : string | "bar" >y : string | "foo" | "bar" | "baz" >c || d : string ->c : string | "bar" ->d : string | "foo" | "bar" | "baz" +>c : string +>d : string } x = y; diff --git a/tests/baselines/reference/stringLiteralTypesInUnionTypes03.errors.txt b/tests/baselines/reference/stringLiteralTypesInUnionTypes03.errors.txt new file mode 100644 index 00000000000..784f368c164 --- /dev/null +++ b/tests/baselines/reference/stringLiteralTypesInUnionTypes03.errors.txt @@ -0,0 +1,28 @@ +tests/cases/conformance/types/stringLiteral/stringLiteralTypesInUnionTypes03.ts(16,9): error TS2322: Type 'string | number' is not assignable to type 'number | "foo" | "bar"'. + Type 'string' is not assignable to type 'number | "foo" | "bar"'. + + +==== tests/cases/conformance/types/stringLiteral/stringLiteralTypesInUnionTypes03.ts (1 errors) ==== + + type T = number | "foo" | "bar"; + + var x: "foo" | "bar" | number; + var y: T = undefined; + + if (x === "foo") { + let a = x; + } + else if (x !== "bar") { + let b = x || y; + } + else { + let c = x; + let d = y; + let e: (typeof x) | (typeof y) = c || d; + ~ +!!! error TS2322: Type 'string | number' is not assignable to type 'number | "foo" | "bar"'. +!!! error TS2322: Type 'string' is not assignable to type 'number | "foo" | "bar"'. + } + + x = y; + y = x; \ No newline at end of file diff --git a/tests/baselines/reference/stringLiteralTypesInUnionTypes04.types b/tests/baselines/reference/stringLiteralTypesInUnionTypes04.types index 05b6b9b9b7a..3d2a41ec5c9 100644 --- a/tests/baselines/reference/stringLiteralTypesInUnionTypes04.types +++ b/tests/baselines/reference/stringLiteralTypesInUnionTypes04.types @@ -19,7 +19,7 @@ if (x === "") { >"" : "" let a = x; ->a : "" +>a : string >x : "" } @@ -29,7 +29,7 @@ if (x !== "") { >"" : "" let b = x; ->b : "foo" +>b : string >x : "foo" } @@ -39,7 +39,7 @@ if (x == "") { >"" : "" let c = x; ->c : "" +>c : string >x : "" } @@ -49,7 +49,7 @@ if (x != "") { >"" : "" let d = x; ->d : "foo" +>d : string >x : "foo" } @@ -57,7 +57,7 @@ if (x) { >x : T let e = x; ->e : "foo" +>e : string >x : "foo" } @@ -66,7 +66,7 @@ if (!x) { >x : T let f = x; ->f : T +>f : string >x : T } @@ -76,7 +76,7 @@ if (!!x) { >x : T let g = x; ->g : "foo" +>g : string >x : "foo" } @@ -87,6 +87,6 @@ if (!!!x) { >x : T let h = x; ->h : T +>h : string >x : T } diff --git a/tests/baselines/reference/stringLiteralTypesOverloadAssignability03.types b/tests/baselines/reference/stringLiteralTypesOverloadAssignability03.types index 8150eedd7b8..00af8e68373 100644 --- a/tests/baselines/reference/stringLiteralTypesOverloadAssignability03.types +++ b/tests/baselines/reference/stringLiteralTypesOverloadAssignability03.types @@ -9,7 +9,7 @@ function f(x: string): number { >x : string return 0; ->0 : number +>0 : 0 } function g(x: "foo"): number; @@ -21,7 +21,7 @@ function g(x: string): number { >x : string return 0; ->0 : number +>0 : 0 } let a = f; diff --git a/tests/baselines/reference/stringLiteralTypesOverloadAssignability04.types b/tests/baselines/reference/stringLiteralTypesOverloadAssignability04.types index 7187e276fe4..694a300d3d3 100644 --- a/tests/baselines/reference/stringLiteralTypesOverloadAssignability04.types +++ b/tests/baselines/reference/stringLiteralTypesOverloadAssignability04.types @@ -9,7 +9,7 @@ function f(x: "foo"): number { >x : "foo" return 0; ->0 : number +>0 : 0 } function g(x: "foo"): number; @@ -21,7 +21,7 @@ function g(x: "foo"): number { >x : "foo" return 0; ->0 : number +>0 : 0 } let a = f; diff --git a/tests/baselines/reference/stringLiteralTypesOverloadAssignability05.types b/tests/baselines/reference/stringLiteralTypesOverloadAssignability05.types index b7dd9262a67..925d2547411 100644 --- a/tests/baselines/reference/stringLiteralTypesOverloadAssignability05.types +++ b/tests/baselines/reference/stringLiteralTypesOverloadAssignability05.types @@ -13,7 +13,7 @@ function f(x: string): number { >x : string return 0; ->0 : number +>0 : 0 } function g(x: "foo"): number; @@ -25,7 +25,7 @@ function g(x: string): number { >x : string return 0; ->0 : number +>0 : 0 } let a = f; diff --git a/tests/baselines/reference/stringLiteralTypesOverloads01.types b/tests/baselines/reference/stringLiteralTypesOverloads01.types index 3b9df5c0066..2a0bc61f3e8 100644 --- a/tests/baselines/reference/stringLiteralTypesOverloads01.types +++ b/tests/baselines/reference/stringLiteralTypesOverloads01.types @@ -42,7 +42,7 @@ function getFalsyPrimitive(x: PrimitiveName): number | string | boolean { >"string" : "string" return ""; ->"" : string +>"" : "" } if (x === "number") { >x === "number" : boolean @@ -50,7 +50,7 @@ function getFalsyPrimitive(x: PrimitiveName): number | string | boolean { >"number" : "number" return 0; ->0 : number +>0 : 0 } if (x === "boolean") { >x === "boolean" : boolean @@ -58,12 +58,12 @@ function getFalsyPrimitive(x: PrimitiveName): number | string | boolean { >"boolean" : "boolean" return false; ->false : boolean +>false : false } // Should be unreachable. throw "Invalid value"; ->"Invalid value" : string +>"Invalid value" : "Invalid value" } namespace Consts1 { diff --git a/tests/baselines/reference/stringLiteralTypesOverloads02.errors.txt b/tests/baselines/reference/stringLiteralTypesOverloads02.errors.txt deleted file mode 100644 index 995cf687b70..00000000000 --- a/tests/baselines/reference/stringLiteralTypesOverloads02.errors.txt +++ /dev/null @@ -1,57 +0,0 @@ -tests/cases/conformance/types/stringLiteral/stringLiteralTypesOverloads02.ts(9,10): error TS2354: No best common type exists among return expressions. - - -==== tests/cases/conformance/types/stringLiteral/stringLiteralTypesOverloads02.ts (1 errors) ==== - - function getFalsyPrimitive(x: "string"): string; - function getFalsyPrimitive(x: "number"): number; - function getFalsyPrimitive(x: "boolean"): boolean; - function getFalsyPrimitive(x: "boolean" | "string"): boolean | string; - function getFalsyPrimitive(x: "boolean" | "number"): boolean | number; - function getFalsyPrimitive(x: "number" | "string"): number | string; - function getFalsyPrimitive(x: "number" | "string" | "boolean"): number | string | boolean; - function getFalsyPrimitive(x: string) { - ~~~~~~~~~~~~~~~~~ -!!! error TS2354: No best common type exists among return expressions. - if (x === "string") { - return ""; - } - if (x === "number") { - return 0; - } - if (x === "boolean") { - return false; - } - - // Should be unreachable. - throw "Invalid value"; - } - - namespace Consts1 { - const EMPTY_STRING = getFalsyPrimitive("string"); - const ZERO = getFalsyPrimitive('number'); - const FALSE = getFalsyPrimitive("boolean"); - } - - const string: "string" = "string" - const number: "number" = "number" - const boolean: "boolean" = "boolean" - - const stringOrNumber = string || number; - const stringOrBoolean = string || boolean; - const booleanOrNumber = number || boolean; - const stringOrBooleanOrNumber = stringOrBoolean || number; - - namespace Consts2 { - const EMPTY_STRING = getFalsyPrimitive(string); - const ZERO = getFalsyPrimitive(number); - const FALSE = getFalsyPrimitive(boolean); - - const a = getFalsyPrimitive(stringOrNumber); - const b = getFalsyPrimitive(stringOrBoolean); - const c = getFalsyPrimitive(booleanOrNumber); - const d = getFalsyPrimitive(stringOrBooleanOrNumber); - } - - - \ No newline at end of file diff --git a/tests/baselines/reference/stringLiteralTypesOverloads02.js b/tests/baselines/reference/stringLiteralTypesOverloads02.js index 45443ea6a8f..0e7bd8c82c8 100644 --- a/tests/baselines/reference/stringLiteralTypesOverloads02.js +++ b/tests/baselines/reference/stringLiteralTypesOverloads02.js @@ -7,7 +7,7 @@ function getFalsyPrimitive(x: "boolean" | "string"): boolean | string; function getFalsyPrimitive(x: "boolean" | "number"): boolean | number; function getFalsyPrimitive(x: "number" | "string"): number | string; function getFalsyPrimitive(x: "number" | "string" | "boolean"): number | string | boolean; -function getFalsyPrimitive(x: string) { +function getFalsyPrimitive(x: string): string | number | boolean { if (x === "string") { return ""; } @@ -28,9 +28,9 @@ namespace Consts1 { const FALSE = getFalsyPrimitive("boolean"); } -const string: "string" = "string" -const number: "number" = "number" -const boolean: "boolean" = "boolean" +const string = "string" +const number = "number" +const boolean = "boolean" const stringOrNumber = string || number; const stringOrBoolean = string || boolean; diff --git a/tests/baselines/reference/stringLiteralTypesOverloads02.symbols b/tests/baselines/reference/stringLiteralTypesOverloads02.symbols new file mode 100644 index 00000000000..1bbedacf8a5 --- /dev/null +++ b/tests/baselines/reference/stringLiteralTypesOverloads02.symbols @@ -0,0 +1,140 @@ +=== tests/cases/conformance/types/stringLiteral/stringLiteralTypesOverloads02.ts === + +function getFalsyPrimitive(x: "string"): string; +>getFalsyPrimitive : Symbol(getFalsyPrimitive, Decl(stringLiteralTypesOverloads02.ts, 0, 0), Decl(stringLiteralTypesOverloads02.ts, 1, 48), Decl(stringLiteralTypesOverloads02.ts, 2, 48), Decl(stringLiteralTypesOverloads02.ts, 3, 50), Decl(stringLiteralTypesOverloads02.ts, 4, 70), Decl(stringLiteralTypesOverloads02.ts, 5, 70), Decl(stringLiteralTypesOverloads02.ts, 6, 68), Decl(stringLiteralTypesOverloads02.ts, 7, 90)) +>x : Symbol(x, Decl(stringLiteralTypesOverloads02.ts, 1, 27)) + +function getFalsyPrimitive(x: "number"): number; +>getFalsyPrimitive : Symbol(getFalsyPrimitive, Decl(stringLiteralTypesOverloads02.ts, 0, 0), Decl(stringLiteralTypesOverloads02.ts, 1, 48), Decl(stringLiteralTypesOverloads02.ts, 2, 48), Decl(stringLiteralTypesOverloads02.ts, 3, 50), Decl(stringLiteralTypesOverloads02.ts, 4, 70), Decl(stringLiteralTypesOverloads02.ts, 5, 70), Decl(stringLiteralTypesOverloads02.ts, 6, 68), Decl(stringLiteralTypesOverloads02.ts, 7, 90)) +>x : Symbol(x, Decl(stringLiteralTypesOverloads02.ts, 2, 27)) + +function getFalsyPrimitive(x: "boolean"): boolean; +>getFalsyPrimitive : Symbol(getFalsyPrimitive, Decl(stringLiteralTypesOverloads02.ts, 0, 0), Decl(stringLiteralTypesOverloads02.ts, 1, 48), Decl(stringLiteralTypesOverloads02.ts, 2, 48), Decl(stringLiteralTypesOverloads02.ts, 3, 50), Decl(stringLiteralTypesOverloads02.ts, 4, 70), Decl(stringLiteralTypesOverloads02.ts, 5, 70), Decl(stringLiteralTypesOverloads02.ts, 6, 68), Decl(stringLiteralTypesOverloads02.ts, 7, 90)) +>x : Symbol(x, Decl(stringLiteralTypesOverloads02.ts, 3, 27)) + +function getFalsyPrimitive(x: "boolean" | "string"): boolean | string; +>getFalsyPrimitive : Symbol(getFalsyPrimitive, Decl(stringLiteralTypesOverloads02.ts, 0, 0), Decl(stringLiteralTypesOverloads02.ts, 1, 48), Decl(stringLiteralTypesOverloads02.ts, 2, 48), Decl(stringLiteralTypesOverloads02.ts, 3, 50), Decl(stringLiteralTypesOverloads02.ts, 4, 70), Decl(stringLiteralTypesOverloads02.ts, 5, 70), Decl(stringLiteralTypesOverloads02.ts, 6, 68), Decl(stringLiteralTypesOverloads02.ts, 7, 90)) +>x : Symbol(x, Decl(stringLiteralTypesOverloads02.ts, 4, 27)) + +function getFalsyPrimitive(x: "boolean" | "number"): boolean | number; +>getFalsyPrimitive : Symbol(getFalsyPrimitive, Decl(stringLiteralTypesOverloads02.ts, 0, 0), Decl(stringLiteralTypesOverloads02.ts, 1, 48), Decl(stringLiteralTypesOverloads02.ts, 2, 48), Decl(stringLiteralTypesOverloads02.ts, 3, 50), Decl(stringLiteralTypesOverloads02.ts, 4, 70), Decl(stringLiteralTypesOverloads02.ts, 5, 70), Decl(stringLiteralTypesOverloads02.ts, 6, 68), Decl(stringLiteralTypesOverloads02.ts, 7, 90)) +>x : Symbol(x, Decl(stringLiteralTypesOverloads02.ts, 5, 27)) + +function getFalsyPrimitive(x: "number" | "string"): number | string; +>getFalsyPrimitive : Symbol(getFalsyPrimitive, Decl(stringLiteralTypesOverloads02.ts, 0, 0), Decl(stringLiteralTypesOverloads02.ts, 1, 48), Decl(stringLiteralTypesOverloads02.ts, 2, 48), Decl(stringLiteralTypesOverloads02.ts, 3, 50), Decl(stringLiteralTypesOverloads02.ts, 4, 70), Decl(stringLiteralTypesOverloads02.ts, 5, 70), Decl(stringLiteralTypesOverloads02.ts, 6, 68), Decl(stringLiteralTypesOverloads02.ts, 7, 90)) +>x : Symbol(x, Decl(stringLiteralTypesOverloads02.ts, 6, 27)) + +function getFalsyPrimitive(x: "number" | "string" | "boolean"): number | string | boolean; +>getFalsyPrimitive : Symbol(getFalsyPrimitive, Decl(stringLiteralTypesOverloads02.ts, 0, 0), Decl(stringLiteralTypesOverloads02.ts, 1, 48), Decl(stringLiteralTypesOverloads02.ts, 2, 48), Decl(stringLiteralTypesOverloads02.ts, 3, 50), Decl(stringLiteralTypesOverloads02.ts, 4, 70), Decl(stringLiteralTypesOverloads02.ts, 5, 70), Decl(stringLiteralTypesOverloads02.ts, 6, 68), Decl(stringLiteralTypesOverloads02.ts, 7, 90)) +>x : Symbol(x, Decl(stringLiteralTypesOverloads02.ts, 7, 27)) + +function getFalsyPrimitive(x: string): string | number | boolean { +>getFalsyPrimitive : Symbol(getFalsyPrimitive, Decl(stringLiteralTypesOverloads02.ts, 0, 0), Decl(stringLiteralTypesOverloads02.ts, 1, 48), Decl(stringLiteralTypesOverloads02.ts, 2, 48), Decl(stringLiteralTypesOverloads02.ts, 3, 50), Decl(stringLiteralTypesOverloads02.ts, 4, 70), Decl(stringLiteralTypesOverloads02.ts, 5, 70), Decl(stringLiteralTypesOverloads02.ts, 6, 68), Decl(stringLiteralTypesOverloads02.ts, 7, 90)) +>x : Symbol(x, Decl(stringLiteralTypesOverloads02.ts, 8, 27)) + + if (x === "string") { +>x : Symbol(x, Decl(stringLiteralTypesOverloads02.ts, 8, 27)) + + return ""; + } + if (x === "number") { +>x : Symbol(x, Decl(stringLiteralTypesOverloads02.ts, 8, 27)) + + return 0; + } + if (x === "boolean") { +>x : Symbol(x, Decl(stringLiteralTypesOverloads02.ts, 8, 27)) + + return false; + } + + // Should be unreachable. + throw "Invalid value"; +} + +namespace Consts1 { +>Consts1 : Symbol(Consts1, Decl(stringLiteralTypesOverloads02.ts, 21, 1)) + + const EMPTY_STRING = getFalsyPrimitive("string"); +>EMPTY_STRING : Symbol(EMPTY_STRING, Decl(stringLiteralTypesOverloads02.ts, 24, 9)) +>getFalsyPrimitive : Symbol(getFalsyPrimitive, Decl(stringLiteralTypesOverloads02.ts, 0, 0), Decl(stringLiteralTypesOverloads02.ts, 1, 48), Decl(stringLiteralTypesOverloads02.ts, 2, 48), Decl(stringLiteralTypesOverloads02.ts, 3, 50), Decl(stringLiteralTypesOverloads02.ts, 4, 70), Decl(stringLiteralTypesOverloads02.ts, 5, 70), Decl(stringLiteralTypesOverloads02.ts, 6, 68), Decl(stringLiteralTypesOverloads02.ts, 7, 90)) + + const ZERO = getFalsyPrimitive('number'); +>ZERO : Symbol(ZERO, Decl(stringLiteralTypesOverloads02.ts, 25, 9)) +>getFalsyPrimitive : Symbol(getFalsyPrimitive, Decl(stringLiteralTypesOverloads02.ts, 0, 0), Decl(stringLiteralTypesOverloads02.ts, 1, 48), Decl(stringLiteralTypesOverloads02.ts, 2, 48), Decl(stringLiteralTypesOverloads02.ts, 3, 50), Decl(stringLiteralTypesOverloads02.ts, 4, 70), Decl(stringLiteralTypesOverloads02.ts, 5, 70), Decl(stringLiteralTypesOverloads02.ts, 6, 68), Decl(stringLiteralTypesOverloads02.ts, 7, 90)) + + const FALSE = getFalsyPrimitive("boolean"); +>FALSE : Symbol(FALSE, Decl(stringLiteralTypesOverloads02.ts, 26, 9)) +>getFalsyPrimitive : Symbol(getFalsyPrimitive, Decl(stringLiteralTypesOverloads02.ts, 0, 0), Decl(stringLiteralTypesOverloads02.ts, 1, 48), Decl(stringLiteralTypesOverloads02.ts, 2, 48), Decl(stringLiteralTypesOverloads02.ts, 3, 50), Decl(stringLiteralTypesOverloads02.ts, 4, 70), Decl(stringLiteralTypesOverloads02.ts, 5, 70), Decl(stringLiteralTypesOverloads02.ts, 6, 68), Decl(stringLiteralTypesOverloads02.ts, 7, 90)) +} + +const string = "string" +>string : Symbol(string, Decl(stringLiteralTypesOverloads02.ts, 29, 5)) + +const number = "number" +>number : Symbol(number, Decl(stringLiteralTypesOverloads02.ts, 30, 5)) + +const boolean = "boolean" +>boolean : Symbol(boolean, Decl(stringLiteralTypesOverloads02.ts, 31, 5)) + +const stringOrNumber = string || number; +>stringOrNumber : Symbol(stringOrNumber, Decl(stringLiteralTypesOverloads02.ts, 33, 5)) +>string : Symbol(string, Decl(stringLiteralTypesOverloads02.ts, 29, 5)) +>number : Symbol(number, Decl(stringLiteralTypesOverloads02.ts, 30, 5)) + +const stringOrBoolean = string || boolean; +>stringOrBoolean : Symbol(stringOrBoolean, Decl(stringLiteralTypesOverloads02.ts, 34, 5)) +>string : Symbol(string, Decl(stringLiteralTypesOverloads02.ts, 29, 5)) +>boolean : Symbol(boolean, Decl(stringLiteralTypesOverloads02.ts, 31, 5)) + +const booleanOrNumber = number || boolean; +>booleanOrNumber : Symbol(booleanOrNumber, Decl(stringLiteralTypesOverloads02.ts, 35, 5)) +>number : Symbol(number, Decl(stringLiteralTypesOverloads02.ts, 30, 5)) +>boolean : Symbol(boolean, Decl(stringLiteralTypesOverloads02.ts, 31, 5)) + +const stringOrBooleanOrNumber = stringOrBoolean || number; +>stringOrBooleanOrNumber : Symbol(stringOrBooleanOrNumber, Decl(stringLiteralTypesOverloads02.ts, 36, 5)) +>stringOrBoolean : Symbol(stringOrBoolean, Decl(stringLiteralTypesOverloads02.ts, 34, 5)) +>number : Symbol(number, Decl(stringLiteralTypesOverloads02.ts, 30, 5)) + +namespace Consts2 { +>Consts2 : Symbol(Consts2, Decl(stringLiteralTypesOverloads02.ts, 36, 58)) + + const EMPTY_STRING = getFalsyPrimitive(string); +>EMPTY_STRING : Symbol(EMPTY_STRING, Decl(stringLiteralTypesOverloads02.ts, 39, 9)) +>getFalsyPrimitive : Symbol(getFalsyPrimitive, Decl(stringLiteralTypesOverloads02.ts, 0, 0), Decl(stringLiteralTypesOverloads02.ts, 1, 48), Decl(stringLiteralTypesOverloads02.ts, 2, 48), Decl(stringLiteralTypesOverloads02.ts, 3, 50), Decl(stringLiteralTypesOverloads02.ts, 4, 70), Decl(stringLiteralTypesOverloads02.ts, 5, 70), Decl(stringLiteralTypesOverloads02.ts, 6, 68), Decl(stringLiteralTypesOverloads02.ts, 7, 90)) +>string : Symbol(string, Decl(stringLiteralTypesOverloads02.ts, 29, 5)) + + const ZERO = getFalsyPrimitive(number); +>ZERO : Symbol(ZERO, Decl(stringLiteralTypesOverloads02.ts, 40, 9)) +>getFalsyPrimitive : Symbol(getFalsyPrimitive, Decl(stringLiteralTypesOverloads02.ts, 0, 0), Decl(stringLiteralTypesOverloads02.ts, 1, 48), Decl(stringLiteralTypesOverloads02.ts, 2, 48), Decl(stringLiteralTypesOverloads02.ts, 3, 50), Decl(stringLiteralTypesOverloads02.ts, 4, 70), Decl(stringLiteralTypesOverloads02.ts, 5, 70), Decl(stringLiteralTypesOverloads02.ts, 6, 68), Decl(stringLiteralTypesOverloads02.ts, 7, 90)) +>number : Symbol(number, Decl(stringLiteralTypesOverloads02.ts, 30, 5)) + + const FALSE = getFalsyPrimitive(boolean); +>FALSE : Symbol(FALSE, Decl(stringLiteralTypesOverloads02.ts, 41, 9)) +>getFalsyPrimitive : Symbol(getFalsyPrimitive, Decl(stringLiteralTypesOverloads02.ts, 0, 0), Decl(stringLiteralTypesOverloads02.ts, 1, 48), Decl(stringLiteralTypesOverloads02.ts, 2, 48), Decl(stringLiteralTypesOverloads02.ts, 3, 50), Decl(stringLiteralTypesOverloads02.ts, 4, 70), Decl(stringLiteralTypesOverloads02.ts, 5, 70), Decl(stringLiteralTypesOverloads02.ts, 6, 68), Decl(stringLiteralTypesOverloads02.ts, 7, 90)) +>boolean : Symbol(boolean, Decl(stringLiteralTypesOverloads02.ts, 31, 5)) + + const a = getFalsyPrimitive(stringOrNumber); +>a : Symbol(a, Decl(stringLiteralTypesOverloads02.ts, 43, 9)) +>getFalsyPrimitive : Symbol(getFalsyPrimitive, Decl(stringLiteralTypesOverloads02.ts, 0, 0), Decl(stringLiteralTypesOverloads02.ts, 1, 48), Decl(stringLiteralTypesOverloads02.ts, 2, 48), Decl(stringLiteralTypesOverloads02.ts, 3, 50), Decl(stringLiteralTypesOverloads02.ts, 4, 70), Decl(stringLiteralTypesOverloads02.ts, 5, 70), Decl(stringLiteralTypesOverloads02.ts, 6, 68), Decl(stringLiteralTypesOverloads02.ts, 7, 90)) +>stringOrNumber : Symbol(stringOrNumber, Decl(stringLiteralTypesOverloads02.ts, 33, 5)) + + const b = getFalsyPrimitive(stringOrBoolean); +>b : Symbol(b, Decl(stringLiteralTypesOverloads02.ts, 44, 9)) +>getFalsyPrimitive : Symbol(getFalsyPrimitive, Decl(stringLiteralTypesOverloads02.ts, 0, 0), Decl(stringLiteralTypesOverloads02.ts, 1, 48), Decl(stringLiteralTypesOverloads02.ts, 2, 48), Decl(stringLiteralTypesOverloads02.ts, 3, 50), Decl(stringLiteralTypesOverloads02.ts, 4, 70), Decl(stringLiteralTypesOverloads02.ts, 5, 70), Decl(stringLiteralTypesOverloads02.ts, 6, 68), Decl(stringLiteralTypesOverloads02.ts, 7, 90)) +>stringOrBoolean : Symbol(stringOrBoolean, Decl(stringLiteralTypesOverloads02.ts, 34, 5)) + + const c = getFalsyPrimitive(booleanOrNumber); +>c : Symbol(c, Decl(stringLiteralTypesOverloads02.ts, 45, 9)) +>getFalsyPrimitive : Symbol(getFalsyPrimitive, Decl(stringLiteralTypesOverloads02.ts, 0, 0), Decl(stringLiteralTypesOverloads02.ts, 1, 48), Decl(stringLiteralTypesOverloads02.ts, 2, 48), Decl(stringLiteralTypesOverloads02.ts, 3, 50), Decl(stringLiteralTypesOverloads02.ts, 4, 70), Decl(stringLiteralTypesOverloads02.ts, 5, 70), Decl(stringLiteralTypesOverloads02.ts, 6, 68), Decl(stringLiteralTypesOverloads02.ts, 7, 90)) +>booleanOrNumber : Symbol(booleanOrNumber, Decl(stringLiteralTypesOverloads02.ts, 35, 5)) + + const d = getFalsyPrimitive(stringOrBooleanOrNumber); +>d : Symbol(d, Decl(stringLiteralTypesOverloads02.ts, 46, 9)) +>getFalsyPrimitive : Symbol(getFalsyPrimitive, Decl(stringLiteralTypesOverloads02.ts, 0, 0), Decl(stringLiteralTypesOverloads02.ts, 1, 48), Decl(stringLiteralTypesOverloads02.ts, 2, 48), Decl(stringLiteralTypesOverloads02.ts, 3, 50), Decl(stringLiteralTypesOverloads02.ts, 4, 70), Decl(stringLiteralTypesOverloads02.ts, 5, 70), Decl(stringLiteralTypesOverloads02.ts, 6, 68), Decl(stringLiteralTypesOverloads02.ts, 7, 90)) +>stringOrBooleanOrNumber : Symbol(stringOrBooleanOrNumber, Decl(stringLiteralTypesOverloads02.ts, 36, 5)) +} + + + diff --git a/tests/baselines/reference/stringLiteralTypesOverloads02.types b/tests/baselines/reference/stringLiteralTypesOverloads02.types new file mode 100644 index 00000000000..7122929e85d --- /dev/null +++ b/tests/baselines/reference/stringLiteralTypesOverloads02.types @@ -0,0 +1,170 @@ +=== tests/cases/conformance/types/stringLiteral/stringLiteralTypesOverloads02.ts === + +function getFalsyPrimitive(x: "string"): string; +>getFalsyPrimitive : { (x: "string"): string; (x: "number"): number; (x: "boolean"): boolean; (x: "string" | "boolean"): string | boolean; (x: "number" | "boolean"): number | boolean; (x: "string" | "number"): string | number; (x: "string" | "number" | "boolean"): string | number | boolean; } +>x : "string" + +function getFalsyPrimitive(x: "number"): number; +>getFalsyPrimitive : { (x: "string"): string; (x: "number"): number; (x: "boolean"): boolean; (x: "string" | "boolean"): string | boolean; (x: "number" | "boolean"): number | boolean; (x: "string" | "number"): string | number; (x: "string" | "number" | "boolean"): string | number | boolean; } +>x : "number" + +function getFalsyPrimitive(x: "boolean"): boolean; +>getFalsyPrimitive : { (x: "string"): string; (x: "number"): number; (x: "boolean"): boolean; (x: "string" | "boolean"): string | boolean; (x: "number" | "boolean"): number | boolean; (x: "string" | "number"): string | number; (x: "string" | "number" | "boolean"): string | number | boolean; } +>x : "boolean" + +function getFalsyPrimitive(x: "boolean" | "string"): boolean | string; +>getFalsyPrimitive : { (x: "string"): string; (x: "number"): number; (x: "boolean"): boolean; (x: "string" | "boolean"): string | boolean; (x: "number" | "boolean"): number | boolean; (x: "string" | "number"): string | number; (x: "string" | "number" | "boolean"): string | number | boolean; } +>x : "string" | "boolean" + +function getFalsyPrimitive(x: "boolean" | "number"): boolean | number; +>getFalsyPrimitive : { (x: "string"): string; (x: "number"): number; (x: "boolean"): boolean; (x: "string" | "boolean"): string | boolean; (x: "number" | "boolean"): number | boolean; (x: "string" | "number"): string | number; (x: "string" | "number" | "boolean"): string | number | boolean; } +>x : "number" | "boolean" + +function getFalsyPrimitive(x: "number" | "string"): number | string; +>getFalsyPrimitive : { (x: "string"): string; (x: "number"): number; (x: "boolean"): boolean; (x: "string" | "boolean"): string | boolean; (x: "number" | "boolean"): number | boolean; (x: "string" | "number"): string | number; (x: "string" | "number" | "boolean"): string | number | boolean; } +>x : "string" | "number" + +function getFalsyPrimitive(x: "number" | "string" | "boolean"): number | string | boolean; +>getFalsyPrimitive : { (x: "string"): string; (x: "number"): number; (x: "boolean"): boolean; (x: "string" | "boolean"): string | boolean; (x: "number" | "boolean"): number | boolean; (x: "string" | "number"): string | number; (x: "string" | "number" | "boolean"): string | number | boolean; } +>x : "string" | "number" | "boolean" + +function getFalsyPrimitive(x: string): string | number | boolean { +>getFalsyPrimitive : { (x: "string"): string; (x: "number"): number; (x: "boolean"): boolean; (x: "string" | "boolean"): string | boolean; (x: "number" | "boolean"): number | boolean; (x: "string" | "number"): string | number; (x: "string" | "number" | "boolean"): string | number | boolean; } +>x : string + + if (x === "string") { +>x === "string" : boolean +>x : string +>"string" : "string" + + return ""; +>"" : "" + } + if (x === "number") { +>x === "number" : boolean +>x : string +>"number" : "number" + + return 0; +>0 : 0 + } + if (x === "boolean") { +>x === "boolean" : boolean +>x : string +>"boolean" : "boolean" + + return false; +>false : false + } + + // Should be unreachable. + throw "Invalid value"; +>"Invalid value" : "Invalid value" +} + +namespace Consts1 { +>Consts1 : typeof Consts1 + + const EMPTY_STRING = getFalsyPrimitive("string"); +>EMPTY_STRING : string +>getFalsyPrimitive("string") : string +>getFalsyPrimitive : { (x: "string"): string; (x: "number"): number; (x: "boolean"): boolean; (x: "string" | "boolean"): string | boolean; (x: "number" | "boolean"): number | boolean; (x: "string" | "number"): string | number; (x: "string" | "number" | "boolean"): string | number | boolean; } +>"string" : "string" + + const ZERO = getFalsyPrimitive('number'); +>ZERO : number +>getFalsyPrimitive('number') : number +>getFalsyPrimitive : { (x: "string"): string; (x: "number"): number; (x: "boolean"): boolean; (x: "string" | "boolean"): string | boolean; (x: "number" | "boolean"): number | boolean; (x: "string" | "number"): string | number; (x: "string" | "number" | "boolean"): string | number | boolean; } +>'number' : "number" + + const FALSE = getFalsyPrimitive("boolean"); +>FALSE : boolean +>getFalsyPrimitive("boolean") : boolean +>getFalsyPrimitive : { (x: "string"): string; (x: "number"): number; (x: "boolean"): boolean; (x: "string" | "boolean"): string | boolean; (x: "number" | "boolean"): number | boolean; (x: "string" | "number"): string | number; (x: "string" | "number" | "boolean"): string | number | boolean; } +>"boolean" : "boolean" +} + +const string = "string" +>string : "string" +>"string" : "string" + +const number = "number" +>number : "number" +>"number" : "number" + +const boolean = "boolean" +>boolean : "boolean" +>"boolean" : "boolean" + +const stringOrNumber = string || number; +>stringOrNumber : "string" | "number" +>string || number : "string" | "number" +>string : "string" +>number : "number" + +const stringOrBoolean = string || boolean; +>stringOrBoolean : "string" | "boolean" +>string || boolean : "string" | "boolean" +>string : "string" +>boolean : "boolean" + +const booleanOrNumber = number || boolean; +>booleanOrNumber : "number" | "boolean" +>number || boolean : "number" | "boolean" +>number : "number" +>boolean : "boolean" + +const stringOrBooleanOrNumber = stringOrBoolean || number; +>stringOrBooleanOrNumber : "string" | "number" | "boolean" +>stringOrBoolean || number : "string" | "number" | "boolean" +>stringOrBoolean : "string" | "boolean" +>number : "number" + +namespace Consts2 { +>Consts2 : typeof Consts2 + + const EMPTY_STRING = getFalsyPrimitive(string); +>EMPTY_STRING : string +>getFalsyPrimitive(string) : string +>getFalsyPrimitive : { (x: "string"): string; (x: "number"): number; (x: "boolean"): boolean; (x: "string" | "boolean"): string | boolean; (x: "number" | "boolean"): number | boolean; (x: "string" | "number"): string | number; (x: "string" | "number" | "boolean"): string | number | boolean; } +>string : "string" + + const ZERO = getFalsyPrimitive(number); +>ZERO : number +>getFalsyPrimitive(number) : number +>getFalsyPrimitive : { (x: "string"): string; (x: "number"): number; (x: "boolean"): boolean; (x: "string" | "boolean"): string | boolean; (x: "number" | "boolean"): number | boolean; (x: "string" | "number"): string | number; (x: "string" | "number" | "boolean"): string | number | boolean; } +>number : "number" + + const FALSE = getFalsyPrimitive(boolean); +>FALSE : boolean +>getFalsyPrimitive(boolean) : boolean +>getFalsyPrimitive : { (x: "string"): string; (x: "number"): number; (x: "boolean"): boolean; (x: "string" | "boolean"): string | boolean; (x: "number" | "boolean"): number | boolean; (x: "string" | "number"): string | number; (x: "string" | "number" | "boolean"): string | number | boolean; } +>boolean : "boolean" + + const a = getFalsyPrimitive(stringOrNumber); +>a : string | number +>getFalsyPrimitive(stringOrNumber) : string | number +>getFalsyPrimitive : { (x: "string"): string; (x: "number"): number; (x: "boolean"): boolean; (x: "string" | "boolean"): string | boolean; (x: "number" | "boolean"): number | boolean; (x: "string" | "number"): string | number; (x: "string" | "number" | "boolean"): string | number | boolean; } +>stringOrNumber : "string" | "number" + + const b = getFalsyPrimitive(stringOrBoolean); +>b : string | boolean +>getFalsyPrimitive(stringOrBoolean) : string | boolean +>getFalsyPrimitive : { (x: "string"): string; (x: "number"): number; (x: "boolean"): boolean; (x: "string" | "boolean"): string | boolean; (x: "number" | "boolean"): number | boolean; (x: "string" | "number"): string | number; (x: "string" | "number" | "boolean"): string | number | boolean; } +>stringOrBoolean : "string" | "boolean" + + const c = getFalsyPrimitive(booleanOrNumber); +>c : number | boolean +>getFalsyPrimitive(booleanOrNumber) : number | boolean +>getFalsyPrimitive : { (x: "string"): string; (x: "number"): number; (x: "boolean"): boolean; (x: "string" | "boolean"): string | boolean; (x: "number" | "boolean"): number | boolean; (x: "string" | "number"): string | number; (x: "string" | "number" | "boolean"): string | number | boolean; } +>booleanOrNumber : "number" | "boolean" + + const d = getFalsyPrimitive(stringOrBooleanOrNumber); +>d : string | number | boolean +>getFalsyPrimitive(stringOrBooleanOrNumber) : string | number | boolean +>getFalsyPrimitive : { (x: "string"): string; (x: "number"): number; (x: "boolean"): boolean; (x: "string" | "boolean"): string | boolean; (x: "number" | "boolean"): number | boolean; (x: "string" | "number"): string | number; (x: "string" | "number" | "boolean"): string | number | boolean; } +>stringOrBooleanOrNumber : "string" | "number" | "boolean" +} + + + diff --git a/tests/baselines/reference/stringLiteralTypesOverloads04.js b/tests/baselines/reference/stringLiteralTypesOverloads04.js index fd10ac986a9..81e123c3e57 100644 --- a/tests/baselines/reference/stringLiteralTypesOverloads04.js +++ b/tests/baselines/reference/stringLiteralTypesOverloads04.js @@ -3,7 +3,7 @@ declare function f(x: (p: "foo" | "bar") => "foo"); f(y => { - let z = y = "foo"; + const z = y = "foo"; return z; }) diff --git a/tests/baselines/reference/stringLiteralTypesOverloads04.symbols b/tests/baselines/reference/stringLiteralTypesOverloads04.symbols index 9f468b8bd95..de1951d325a 100644 --- a/tests/baselines/reference/stringLiteralTypesOverloads04.symbols +++ b/tests/baselines/reference/stringLiteralTypesOverloads04.symbols @@ -9,11 +9,11 @@ f(y => { >f : Symbol(f, Decl(stringLiteralTypesOverloads04.ts, 0, 0)) >y : Symbol(y, Decl(stringLiteralTypesOverloads04.ts, 3, 2)) - let z = y = "foo"; ->z : Symbol(z, Decl(stringLiteralTypesOverloads04.ts, 4, 7)) + const z = y = "foo"; +>z : Symbol(z, Decl(stringLiteralTypesOverloads04.ts, 4, 9)) >y : Symbol(y, Decl(stringLiteralTypesOverloads04.ts, 3, 2)) return z; ->z : Symbol(z, Decl(stringLiteralTypesOverloads04.ts, 4, 7)) +>z : Symbol(z, Decl(stringLiteralTypesOverloads04.ts, 4, 9)) }) diff --git a/tests/baselines/reference/stringLiteralTypesOverloads04.types b/tests/baselines/reference/stringLiteralTypesOverloads04.types index 32d316494ca..8cb8b2a7cea 100644 --- a/tests/baselines/reference/stringLiteralTypesOverloads04.types +++ b/tests/baselines/reference/stringLiteralTypesOverloads04.types @@ -6,12 +6,12 @@ declare function f(x: (p: "foo" | "bar") => "foo"); >p : "foo" | "bar" f(y => { ->f(y => { let z = y = "foo"; return z;}) : any +>f(y => { const z = y = "foo"; return z;}) : any >f : (x: (p: "foo" | "bar") => "foo") => any ->y => { let z = y = "foo"; return z;} : (y: "foo" | "bar") => "foo" +>y => { const z = y = "foo"; return z;} : (y: "foo" | "bar") => "foo" >y : "foo" | "bar" - let z = y = "foo"; + const z = y = "foo"; >z : "foo" >y = "foo" : "foo" >y : "foo" | "bar" diff --git a/tests/baselines/reference/stringLiteralTypesTypePredicates01.types b/tests/baselines/reference/stringLiteralTypesTypePredicates01.types index 822103b86f5..0a87ffad865 100644 --- a/tests/baselines/reference/stringLiteralTypesTypePredicates01.types +++ b/tests/baselines/reference/stringLiteralTypesTypePredicates01.types @@ -42,12 +42,12 @@ if (kindIs(x, "A")) { >"A" : "A" let a = x; ->a : "A" +>a : string >x : "A" } else { let b = x; ->b : "B" +>b : string >x : "B" } @@ -59,11 +59,11 @@ if (!kindIs(x, "B")) { >"B" : "B" let c = x; ->c : "A" +>c : string >x : "A" } else { let d = x; ->d : "B" +>d : string >x : "B" } diff --git a/tests/baselines/reference/stringLiteralTypesWithVariousOperators01.types b/tests/baselines/reference/stringLiteralTypesWithVariousOperators01.types index d55d5ab9294..46dfef010a0 100644 --- a/tests/baselines/reference/stringLiteralTypesWithVariousOperators01.types +++ b/tests/baselines/reference/stringLiteralTypesWithVariousOperators01.types @@ -16,33 +16,33 @@ let abcOrXyz: "ABC" | "XYZ" = abc || xyz; let abcOrXyzOrNumber: "ABC" | "XYZ" | number = abcOrXyz || 100; >abcOrXyzOrNumber : number | "ABC" | "XYZ" ->abcOrXyz || 100 : number | "ABC" | "XYZ" +>abcOrXyz || 100 : "ABC" | "XYZ" | 100 >abcOrXyz : "ABC" | "XYZ" ->100 : number +>100 : 100 let a = "" + abc; >a : string >"" + abc : string ->"" : string +>"" : "" >abc : "ABC" let b = abc + ""; >b : string >abc + "" : string >abc : "ABC" ->"" : string +>"" : "" let c = 10 + abc; >c : string >10 + abc : string ->10 : number +>10 : 10 >abc : "ABC" let d = abc + 10; >d : string >abc + 10 : string >abc : "ABC" ->10 : number +>10 : 10 let e = xyz + abc; >e : string @@ -59,14 +59,14 @@ let f = abc + xyz; let g = true + abc; >g : string >true + abc : string ->true : boolean +>true : true >abc : "ABC" let h = abc + true; >h : string >abc + true : string >abc : "ABC" ->true : boolean +>true : true let i = abc + abcOrXyz + xyz; >i : string @@ -96,12 +96,12 @@ let m = abcOrXyzOrNumber + ""; >m : string >abcOrXyzOrNumber + "" : string >abcOrXyzOrNumber : number | "ABC" | "XYZ" ->"" : string +>"" : "" let n = "" + abcOrXyzOrNumber; >n : string >"" + abcOrXyzOrNumber : string ->"" : string +>"" : "" >abcOrXyzOrNumber : number | "ABC" | "XYZ" let o = abcOrXyzOrNumber + abcOrXyz; diff --git a/tests/baselines/reference/stringLiteralTypesWithVariousOperators02.errors.txt b/tests/baselines/reference/stringLiteralTypesWithVariousOperators02.errors.txt index ad02604cc4c..a51469baa93 100644 --- a/tests/baselines/reference/stringLiteralTypesWithVariousOperators02.errors.txt +++ b/tests/baselines/reference/stringLiteralTypesWithVariousOperators02.errors.txt @@ -1,8 +1,8 @@ -tests/cases/conformance/types/stringLiteral/stringLiteralTypesWithVariousOperators02.ts(7,9): error TS2365: Operator '+' cannot be applied to types 'number | "ABC" | "XYZ"' and 'number'. -tests/cases/conformance/types/stringLiteral/stringLiteralTypesWithVariousOperators02.ts(8,9): error TS2365: Operator '+' cannot be applied to types 'number' and 'number | "ABC" | "XYZ"'. +tests/cases/conformance/types/stringLiteral/stringLiteralTypesWithVariousOperators02.ts(7,9): error TS2365: Operator '+' cannot be applied to types 'number | "ABC" | "XYZ"' and '100'. +tests/cases/conformance/types/stringLiteral/stringLiteralTypesWithVariousOperators02.ts(8,9): error TS2365: Operator '+' cannot be applied to types '100' and 'number | "ABC" | "XYZ"'. tests/cases/conformance/types/stringLiteral/stringLiteralTypesWithVariousOperators02.ts(9,9): error TS2365: Operator '+' cannot be applied to types 'number | "ABC" | "XYZ"' and 'number | "ABC" | "XYZ"'. -tests/cases/conformance/types/stringLiteral/stringLiteralTypesWithVariousOperators02.ts(10,9): error TS2365: Operator '+' cannot be applied to types 'number | "ABC" | "XYZ"' and 'boolean'. -tests/cases/conformance/types/stringLiteral/stringLiteralTypesWithVariousOperators02.ts(11,9): error TS2365: Operator '+' cannot be applied to types 'boolean' and 'number | "ABC" | "XYZ"'. +tests/cases/conformance/types/stringLiteral/stringLiteralTypesWithVariousOperators02.ts(10,9): error TS2365: Operator '+' cannot be applied to types 'number | "ABC" | "XYZ"' and 'true'. +tests/cases/conformance/types/stringLiteral/stringLiteralTypesWithVariousOperators02.ts(11,9): error TS2365: Operator '+' cannot be applied to types 'false' and 'number | "ABC" | "XYZ"'. tests/cases/conformance/types/stringLiteral/stringLiteralTypesWithVariousOperators02.ts(12,9): error TS2356: An arithmetic operand must be of type 'any', 'number' or an enum type. tests/cases/conformance/types/stringLiteral/stringLiteralTypesWithVariousOperators02.ts(13,11): error TS2356: An arithmetic operand must be of type 'any', 'number' or an enum type. tests/cases/conformance/types/stringLiteral/stringLiteralTypesWithVariousOperators02.ts(14,9): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. @@ -21,19 +21,19 @@ tests/cases/conformance/types/stringLiteral/stringLiteralTypesWithVariousOperato let a = abcOrXyzOrNumber + 100; ~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2365: Operator '+' cannot be applied to types 'number | "ABC" | "XYZ"' and 'number'. +!!! error TS2365: Operator '+' cannot be applied to types 'number | "ABC" | "XYZ"' and '100'. let b = 100 + abcOrXyzOrNumber; ~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2365: Operator '+' cannot be applied to types 'number' and 'number | "ABC" | "XYZ"'. +!!! error TS2365: Operator '+' cannot be applied to types '100' and 'number | "ABC" | "XYZ"'. let c = abcOrXyzOrNumber + abcOrXyzOrNumber; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ !!! error TS2365: Operator '+' cannot be applied to types 'number | "ABC" | "XYZ"' and 'number | "ABC" | "XYZ"'. let d = abcOrXyzOrNumber + true; ~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2365: Operator '+' cannot be applied to types 'number | "ABC" | "XYZ"' and 'boolean'. +!!! error TS2365: Operator '+' cannot be applied to types 'number | "ABC" | "XYZ"' and 'true'. let e = false + abcOrXyzOrNumber; ~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2365: Operator '+' cannot be applied to types 'boolean' and 'number | "ABC" | "XYZ"'. +!!! error TS2365: Operator '+' cannot be applied to types 'false' and 'number | "ABC" | "XYZ"'. let f = abcOrXyzOrNumber++; ~~~~~~~~~~~~~~~~ !!! error TS2356: An arithmetic operand must be of type 'any', 'number' or an enum type. diff --git a/tests/baselines/reference/stringLiteralsAssertionsInEqualityComparisons01.types b/tests/baselines/reference/stringLiteralsAssertionsInEqualityComparisons01.types index 17a835a2461..71cfd959f5e 100644 --- a/tests/baselines/reference/stringLiteralsAssertionsInEqualityComparisons01.types +++ b/tests/baselines/reference/stringLiteralsAssertionsInEqualityComparisons01.types @@ -4,7 +4,7 @@ var a = "foo" === "bar" as string; >"foo" === "bar" as string : boolean >"foo" : "foo" >"bar" as string : string ->"bar" : string +>"bar" : "bar" var b = "foo" !== ("bar" as string); >b : boolean @@ -12,7 +12,7 @@ var b = "foo" !== ("bar" as string); >"foo" : "foo" >("bar" as string) : string >"bar" as string : string ->"bar" : string +>"bar" : "bar" var c = "foo" == ("bar"); >c : boolean @@ -20,5 +20,5 @@ var c = "foo" == ("bar"); >"foo" : "foo" >("bar") : any >"bar" : any ->"bar" : string +>"bar" : "bar" diff --git a/tests/baselines/reference/stringLiteralsAssertionsInEqualityComparisons02.errors.txt b/tests/baselines/reference/stringLiteralsAssertionsInEqualityComparisons02.errors.txt index 5daeab5dbed..fd92af4e84f 100644 --- a/tests/baselines/reference/stringLiteralsAssertionsInEqualityComparisons02.errors.txt +++ b/tests/baselines/reference/stringLiteralsAssertionsInEqualityComparisons02.errors.txt @@ -1,21 +1,15 @@ tests/cases/conformance/types/literal/stringLiteralsAssertionsInEqualityComparisons02.ts(3,9): error TS2365: Operator '===' cannot be applied to types '"foo"' and '"baz"'. -tests/cases/conformance/types/literal/stringLiteralsAssertionsInEqualityComparisons02.ts(3,19): error TS2352: Type '"bar"' cannot be converted to type '"baz"'. -tests/cases/conformance/types/literal/stringLiteralsAssertionsInEqualityComparisons02.ts(4,20): error TS2352: Type '"bar"' cannot be converted to type '"foo"'. tests/cases/conformance/types/literal/stringLiteralsAssertionsInEqualityComparisons02.ts(5,9): error TS2365: Operator '==' cannot be applied to types 'string' and 'number'. tests/cases/conformance/types/literal/stringLiteralsAssertionsInEqualityComparisons02.ts(5,19): error TS2352: Type 'string' cannot be converted to type 'number'. -==== tests/cases/conformance/types/literal/stringLiteralsAssertionsInEqualityComparisons02.ts (5 errors) ==== +==== tests/cases/conformance/types/literal/stringLiteralsAssertionsInEqualityComparisons02.ts (3 errors) ==== type EnhancedString = string & { enhancements: any }; var a = "foo" === "bar" as "baz"; ~~~~~~~~~~~~~~~~~~~~~~~~ !!! error TS2365: Operator '===' cannot be applied to types '"foo"' and '"baz"'. - ~~~~~~~~~~~~~~ -!!! error TS2352: Type '"bar"' cannot be converted to type '"baz"'. var b = "foo" !== ("bar" as "foo"); - ~~~~~~~~~~~~~~ -!!! error TS2352: Type '"bar"' cannot be converted to type '"foo"'. var c = "foo" == ("bar"); ~~~~~~~~~~~~~~~~~~~~~~~~ !!! error TS2365: Operator '==' cannot be applied to types 'string' and 'number'. diff --git a/tests/baselines/reference/stringLiteralsWithSwitchStatements03.errors.txt b/tests/baselines/reference/stringLiteralsWithSwitchStatements03.errors.txt index b2cbc96501f..a16be702955 100644 --- a/tests/baselines/reference/stringLiteralsWithSwitchStatements03.errors.txt +++ b/tests/baselines/reference/stringLiteralsWithSwitchStatements03.errors.txt @@ -1,11 +1,18 @@ tests/cases/conformance/types/literal/stringLiteralsWithSwitchStatements03.ts(10,10): error TS2678: Type '"bar" | "baz"' is not comparable to type '"foo"'. Type '"baz"' is not comparable to type '"foo"'. tests/cases/conformance/types/literal/stringLiteralsWithSwitchStatements03.ts(12,10): error TS2678: Type '"bar"' is not comparable to type '"foo"'. +tests/cases/conformance/types/literal/stringLiteralsWithSwitchStatements03.ts(14,10): error TS2678: Type '"baz"' is not comparable to type '"foo"'. +tests/cases/conformance/types/literal/stringLiteralsWithSwitchStatements03.ts(14,11): error TS2695: Left side of comma operator is unused and has no side effects. +tests/cases/conformance/types/literal/stringLiteralsWithSwitchStatements03.ts(14,11): error TS2695: Left side of comma operator is unused and has no side effects. +tests/cases/conformance/types/literal/stringLiteralsWithSwitchStatements03.ts(20,10): error TS2678: Type '"bar" | "baz"' is not comparable to type '"foo"'. + Type '"baz"' is not comparable to type '"foo"'. tests/cases/conformance/types/literal/stringLiteralsWithSwitchStatements03.ts(22,10): error TS2678: Type '"bar" | "baz"' is not comparable to type '"foo"'. Type '"baz"' is not comparable to type '"foo"'. +tests/cases/conformance/types/literal/stringLiteralsWithSwitchStatements03.ts(23,10): error TS2678: Type '"bar" | "baz"' is not comparable to type '"foo"'. + Type '"baz"' is not comparable to type '"foo"'. -==== tests/cases/conformance/types/literal/stringLiteralsWithSwitchStatements03.ts (3 errors) ==== +==== tests/cases/conformance/types/literal/stringLiteralsWithSwitchStatements03.ts (8 errors) ==== let x: "foo"; let y: "foo" | "bar"; let z: "bar"; @@ -25,18 +32,30 @@ tests/cases/conformance/types/literal/stringLiteralsWithSwitchStatements03.ts(22 !!! error TS2678: Type '"bar"' is not comparable to type '"foo"'. break; case (x, y, ("baz")): + ~~~~~~~~~~~~~~~ +!!! error TS2678: Type '"baz"' is not comparable to type '"foo"'. + ~ +!!! error TS2695: Left side of comma operator is unused and has no side effects. + ~~~~ +!!! error TS2695: Left side of comma operator is unused and has no side effects. x; y; break; case (("foo" || ("bar"))): break; case (("bar" || ("baz"))): + ~~~~~~~~~~~~~~~~~~~~ +!!! error TS2678: Type '"bar" | "baz"' is not comparable to type '"foo"'. +!!! error TS2678: Type '"baz"' is not comparable to type '"foo"'. break; case z || "baz": ~~~~~~~~~~ !!! error TS2678: Type '"bar" | "baz"' is not comparable to type '"foo"'. !!! error TS2678: Type '"baz"' is not comparable to type '"foo"'. case "baz" || z: + ~~~~~~~~~~ +!!! error TS2678: Type '"bar" | "baz"' is not comparable to type '"foo"'. +!!! error TS2678: Type '"baz"' is not comparable to type '"foo"'. z; break; } diff --git a/tests/baselines/reference/stringLiteralsWithSwitchStatements04.errors.txt b/tests/baselines/reference/stringLiteralsWithSwitchStatements04.errors.txt new file mode 100644 index 00000000000..441978c2fe8 --- /dev/null +++ b/tests/baselines/reference/stringLiteralsWithSwitchStatements04.errors.txt @@ -0,0 +1,40 @@ +tests/cases/conformance/types/literal/stringLiteralsWithSwitchStatements04.ts(7,10): error TS2695: Left side of comma operator is unused and has no side effects. +tests/cases/conformance/types/literal/stringLiteralsWithSwitchStatements04.ts(9,10): error TS2695: Left side of comma operator is unused and has no side effects. +tests/cases/conformance/types/literal/stringLiteralsWithSwitchStatements04.ts(11,10): error TS2695: Left side of comma operator is unused and has no side effects. +tests/cases/conformance/types/literal/stringLiteralsWithSwitchStatements04.ts(11,10): error TS2678: Type '"baz"' is not comparable to type '"foo" | "bar"'. +tests/cases/conformance/types/literal/stringLiteralsWithSwitchStatements04.ts(13,10): error TS2695: Left side of comma operator is unused and has no side effects. + + +==== tests/cases/conformance/types/literal/stringLiteralsWithSwitchStatements04.ts (5 errors) ==== + let x: "foo"; + let y: "foo" | "bar"; + + declare function randBool(): boolean; + + switch (y) { + case "foo", x: + ~~~~~ +!!! error TS2695: Left side of comma operator is unused and has no side effects. + break; + case x, "foo": + ~ +!!! error TS2695: Left side of comma operator is unused and has no side effects. + break; + case x, "baz": + ~ +!!! error TS2695: Left side of comma operator is unused and has no side effects. + ~~~~~~~~ +!!! error TS2678: Type '"baz"' is not comparable to type '"foo" | "bar"'. + break; + case "baz", x: + ~~~~~ +!!! error TS2695: Left side of comma operator is unused and has no side effects. + break; + case "baz" && "bar": + break; + case "baz" && ("foo" || "bar"): + break; + case "bar" && ("baz" || "bar"): + break; + } + \ No newline at end of file diff --git a/tests/baselines/reference/stringLiteralsWithTypeAssertions01.errors.txt b/tests/baselines/reference/stringLiteralsWithTypeAssertions01.errors.txt deleted file mode 100644 index d9d465c7afc..00000000000 --- a/tests/baselines/reference/stringLiteralsWithTypeAssertions01.errors.txt +++ /dev/null @@ -1,25 +0,0 @@ -tests/cases/conformance/types/literal/stringLiteralsWithTypeAssertions01.ts(3,9): error TS2352: Type '"foo"' cannot be converted to type '"bar"'. -tests/cases/conformance/types/literal/stringLiteralsWithTypeAssertions01.ts(4,9): error TS2352: Type '"bar"' cannot be converted to type '"foo"'. -tests/cases/conformance/types/literal/stringLiteralsWithTypeAssertions01.ts(7,9): error TS2352: Type '"foo" | "bar"' cannot be converted to type '"baz"'. - Type '"bar"' is not comparable to type '"baz"'. -tests/cases/conformance/types/literal/stringLiteralsWithTypeAssertions01.ts(8,9): error TS2352: Type '"baz"' cannot be converted to type '"foo" | "bar"'. - - -==== tests/cases/conformance/types/literal/stringLiteralsWithTypeAssertions01.ts (4 errors) ==== - let fooOrBar: "foo" | "bar"; - - let a = "foo" as "bar"; - ~~~~~~~~~~~~~~ -!!! error TS2352: Type '"foo"' cannot be converted to type '"bar"'. - let b = "bar" as "foo"; - ~~~~~~~~~~~~~~ -!!! error TS2352: Type '"bar"' cannot be converted to type '"foo"'. - let c = fooOrBar as "foo"; - let d = fooOrBar as "bar"; - let e = fooOrBar as "baz"; - ~~~~~~~~~~~~~~~~~ -!!! error TS2352: Type '"foo" | "bar"' cannot be converted to type '"baz"'. -!!! error TS2352: Type '"bar"' is not comparable to type '"baz"'. - let f = "baz" as typeof fooOrBar; - ~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2352: Type '"baz"' cannot be converted to type '"foo" | "bar"'. \ No newline at end of file diff --git a/tests/baselines/reference/stringLiteralsWithTypeAssertions01.symbols b/tests/baselines/reference/stringLiteralsWithTypeAssertions01.symbols new file mode 100644 index 00000000000..915432deca3 --- /dev/null +++ b/tests/baselines/reference/stringLiteralsWithTypeAssertions01.symbols @@ -0,0 +1,26 @@ +=== tests/cases/conformance/types/literal/stringLiteralsWithTypeAssertions01.ts === +let fooOrBar: "foo" | "bar"; +>fooOrBar : Symbol(fooOrBar, Decl(stringLiteralsWithTypeAssertions01.ts, 0, 3)) + +let a = "foo" as "bar"; +>a : Symbol(a, Decl(stringLiteralsWithTypeAssertions01.ts, 2, 3)) + +let b = "bar" as "foo"; +>b : Symbol(b, Decl(stringLiteralsWithTypeAssertions01.ts, 3, 3)) + +let c = fooOrBar as "foo"; +>c : Symbol(c, Decl(stringLiteralsWithTypeAssertions01.ts, 4, 3)) +>fooOrBar : Symbol(fooOrBar, Decl(stringLiteralsWithTypeAssertions01.ts, 0, 3)) + +let d = fooOrBar as "bar"; +>d : Symbol(d, Decl(stringLiteralsWithTypeAssertions01.ts, 5, 3)) +>fooOrBar : Symbol(fooOrBar, Decl(stringLiteralsWithTypeAssertions01.ts, 0, 3)) + +let e = fooOrBar as "baz"; +>e : Symbol(e, Decl(stringLiteralsWithTypeAssertions01.ts, 6, 3)) +>fooOrBar : Symbol(fooOrBar, Decl(stringLiteralsWithTypeAssertions01.ts, 0, 3)) + +let f = "baz" as typeof fooOrBar; +>f : Symbol(f, Decl(stringLiteralsWithTypeAssertions01.ts, 7, 3)) +>fooOrBar : Symbol(fooOrBar, Decl(stringLiteralsWithTypeAssertions01.ts, 0, 3)) + diff --git a/tests/baselines/reference/stringLiteralsWithTypeAssertions01.types b/tests/baselines/reference/stringLiteralsWithTypeAssertions01.types new file mode 100644 index 00000000000..923af8961c7 --- /dev/null +++ b/tests/baselines/reference/stringLiteralsWithTypeAssertions01.types @@ -0,0 +1,35 @@ +=== tests/cases/conformance/types/literal/stringLiteralsWithTypeAssertions01.ts === +let fooOrBar: "foo" | "bar"; +>fooOrBar : "foo" | "bar" + +let a = "foo" as "bar"; +>a : "bar" +>"foo" as "bar" : "bar" +>"foo" : "foo" + +let b = "bar" as "foo"; +>b : "foo" +>"bar" as "foo" : "foo" +>"bar" : "bar" + +let c = fooOrBar as "foo"; +>c : "foo" +>fooOrBar as "foo" : "foo" +>fooOrBar : "foo" | "bar" + +let d = fooOrBar as "bar"; +>d : "bar" +>fooOrBar as "bar" : "bar" +>fooOrBar : "foo" | "bar" + +let e = fooOrBar as "baz"; +>e : "baz" +>fooOrBar as "baz" : "baz" +>fooOrBar : "foo" | "bar" + +let f = "baz" as typeof fooOrBar; +>f : "foo" | "bar" +>"baz" as typeof fooOrBar : "foo" | "bar" +>"baz" : "baz" +>fooOrBar : "foo" | "bar" + diff --git a/tests/baselines/reference/stringNamedPropertyAccess.types b/tests/baselines/reference/stringNamedPropertyAccess.types index 2d0b585f828..1b3d56abc10 100644 --- a/tests/baselines/reference/stringNamedPropertyAccess.types +++ b/tests/baselines/reference/stringNamedPropertyAccess.types @@ -13,13 +13,13 @@ var r1 = c["a b"]; >r1 : number >c["a b"] : number >c : C ->"a b" : string +>"a b" : "a b" var r1b = C['c d']; >r1b : number >C['c d'] : number >C : typeof C ->'c d' : string +>'c d' : "c d" interface I { >I : I @@ -34,7 +34,7 @@ var r2 = i["a b"]; >r2 : number >i["a b"] : number >i : I ->"a b" : string +>"a b" : "a b" var a: { >a : { "a b": number; } @@ -45,18 +45,18 @@ var r3 = a["a b"]; >r3 : number >a["a b"] : number >a : { "a b": number; } ->"a b" : string +>"a b" : "a b" var b = { >b : { "a b": number; } >{ "a b": 1} : { "a b": number; } "a b": 1 ->1 : number +>1 : 1 } var r4 = b["a b"]; >r4 : number >b["a b"] : number >b : { "a b": number; } ->"a b" : string +>"a b" : "a b" diff --git a/tests/baselines/reference/stringPropCodeGen.types b/tests/baselines/reference/stringPropCodeGen.types index 9b061a510e1..184718982fa 100644 --- a/tests/baselines/reference/stringPropCodeGen.types +++ b/tests/baselines/reference/stringPropCodeGen.types @@ -7,7 +7,7 @@ var a = { >function() { } : () => void "bar" : 5 ->5 : number +>5 : 5 }; diff --git a/tests/baselines/reference/stringPropertyAccess.types b/tests/baselines/reference/stringPropertyAccess.types index 05409140353..fd2ec13da74 100644 --- a/tests/baselines/reference/stringPropertyAccess.types +++ b/tests/baselines/reference/stringPropertyAccess.types @@ -1,7 +1,7 @@ === tests/cases/conformance/types/primitives/string/stringPropertyAccess.ts === var x = ''; >x : string ->'' : string +>'' : "" var a = x.charAt(0); >a : string @@ -9,7 +9,7 @@ var a = x.charAt(0); >x.charAt : (pos: number) => string >x : string >charAt : (pos: number) => string ->0 : number +>0 : 0 var b = x.hasOwnProperty('charAt'); >b : boolean @@ -17,21 +17,21 @@ var b = x.hasOwnProperty('charAt'); >x.hasOwnProperty : (v: string) => boolean >x : string >hasOwnProperty : (v: string) => boolean ->'charAt' : string +>'charAt' : "charAt" var c = x['charAt'](0); >c : string >x['charAt'](0) : string >x['charAt'] : (pos: number) => string >x : string ->'charAt' : string ->0 : number +>'charAt' : "charAt" +>0 : 0 var e = x['hasOwnProperty']('toFixed'); >e : boolean >x['hasOwnProperty']('toFixed') : boolean >x['hasOwnProperty'] : (v: string) => boolean >x : string ->'hasOwnProperty' : string ->'toFixed' : string +>'hasOwnProperty' : "hasOwnProperty" +>'toFixed' : "toFixed" diff --git a/tests/baselines/reference/stringPropertyAccessWithError.errors.txt b/tests/baselines/reference/stringPropertyAccessWithError.errors.txt index fef1613bc5f..7cff28ee85d 100644 --- a/tests/baselines/reference/stringPropertyAccessWithError.errors.txt +++ b/tests/baselines/reference/stringPropertyAccessWithError.errors.txt @@ -1,8 +1,8 @@ -tests/cases/conformance/types/primitives/string/stringPropertyAccessWithError.ts(2,21): error TS2345: Argument of type 'string' is not assignable to parameter of type 'number'. +tests/cases/conformance/types/primitives/string/stringPropertyAccessWithError.ts(2,21): error TS2345: Argument of type '"invalid"' is not assignable to parameter of type 'number'. ==== tests/cases/conformance/types/primitives/string/stringPropertyAccessWithError.ts (1 errors) ==== var x = ''; var d = x['charAt']('invalid'); // error ~~~~~~~~~ -!!! error TS2345: Argument of type 'string' is not assignable to parameter of type 'number'. \ No newline at end of file +!!! error TS2345: Argument of type '"invalid"' is not assignable to parameter of type 'number'. \ No newline at end of file diff --git a/tests/baselines/reference/structural1.types b/tests/baselines/reference/structural1.types index 8ad3c679286..12dfb25d91d 100644 --- a/tests/baselines/reference/structural1.types +++ b/tests/baselines/reference/structural1.types @@ -23,8 +23,8 @@ module M { >f : (i: I) => void >{salt:2,pepper:0} : { salt: number; pepper: number; } >salt : number ->2 : number +>2 : 2 >pepper : number ->0 : number +>0 : 0 } diff --git a/tests/baselines/reference/styleOptions.types b/tests/baselines/reference/styleOptions.types index f0c0e93161c..fca394ed9af 100644 --- a/tests/baselines/reference/styleOptions.types +++ b/tests/baselines/reference/styleOptions.types @@ -3,11 +3,11 @@ var x = 1; >x : number ->1 : number +>1 : 1 var y = 1; >y : number ->1 : number +>1 : 1 var t = x == y; >t : boolean diff --git a/tests/baselines/reference/subtypeRelationForNever.types b/tests/baselines/reference/subtypeRelationForNever.types index c577ee07862..67c92b9b079 100644 --- a/tests/baselines/reference/subtypeRelationForNever.types +++ b/tests/baselines/reference/subtypeRelationForNever.types @@ -27,13 +27,13 @@ function withFew(values: a[], haveFew: (values: a[]) => r, haveNone: (reas >values.length : number >values : a[] >length : number ->0 : number +>0 : 0 >haveFew(values) : r >haveFew : (values: a[]) => r >values : a[] >haveNone('No values.') : r >haveNone : (reason: string) => r ->'No values.' : string +>'No values.' : "No values." } function id
(value: a) : a { return value; } >id : (value: a) => a @@ -48,9 +48,9 @@ const result = withFew([1, 2, 3], id, fail); // expected result is number[] >withFew([1, 2, 3], id, fail) : number[] >withFew : (values: a[], haveFew: (values: a[]) => r, haveNone: (reason: string) => r) => r >[1, 2, 3] : number[] ->1 : number ->2 : number ->3 : number +>1 : 1 +>2 : 2 +>3 : 3 >id : (value: a) => a >fail : (message: string) => never diff --git a/tests/baselines/reference/subtypesOfAny.types b/tests/baselines/reference/subtypesOfAny.types index efa9fd1cd82..aebe77df12e 100644 --- a/tests/baselines/reference/subtypesOfAny.types +++ b/tests/baselines/reference/subtypesOfAny.types @@ -187,7 +187,7 @@ module f { export var bar = 1; >bar : number ->1 : number +>1 : 1 } interface I15 { >I15 : I15 @@ -210,7 +210,7 @@ module c { export var bar = 1; >bar : number ->1 : number +>1 : 1 } interface I16 { >I16 : I16 diff --git a/tests/baselines/reference/subtypesOfTypeParameterWithConstraints2.types b/tests/baselines/reference/subtypesOfTypeParameterWithConstraints2.types index 4059a1b0b51..99aef9e95f6 100644 --- a/tests/baselines/reference/subtypesOfTypeParameterWithConstraints2.types +++ b/tests/baselines/reference/subtypesOfTypeParameterWithConstraints2.types @@ -14,14 +14,14 @@ function f1(x: T, y: U) { var r = true ? x : y; >r : U >true ? x : y : U ->true : boolean +>true : true >x : T >y : U var r = true ? y : x; >r : U >true ? y : x : U ->true : boolean +>true : true >y : U >x : T } @@ -44,14 +44,14 @@ function f2(x: T, y: U, z: V) { var r = true ? x : y; >r : U >true ? x : y : U ->true : boolean +>true : true >x : T >y : U var r = true ? y : x; >r : U >true ? y : x : U ->true : boolean +>true : true >y : U >x : T @@ -59,14 +59,14 @@ function f2(x: T, y: U, z: V) { var r2 = true ? z : y; >r2 : V >true ? z : y : V ->true : boolean +>true : true >z : V >y : U var r2 = true ? y : z; >r2 : V >true ? y : z : V ->true : boolean +>true : true >y : U >z : V @@ -74,14 +74,14 @@ function f2(x: T, y: U, z: V) { var r2a = true ? z : x; >r2a : V >true ? z : x : V ->true : boolean +>true : true >z : V >x : T var r2b = true ? x : z; >r2b : V >true ? x : z : V ->true : boolean +>true : true >x : T >z : V } @@ -101,14 +101,14 @@ function f3(x: T, y: U) { var r = true ? x : y; >r : U >true ? x : y : U ->true : boolean +>true : true >x : T >y : U var r = true ? y : x; >r : U >true ? y : x : U ->true : boolean +>true : true >y : U >x : T @@ -116,7 +116,7 @@ function f3(x: T, y: U) { var r2 = true ? x : new Date(); >r2 : Date >true ? x : new Date() : Date ->true : boolean +>true : true >x : T >new Date() : Date >Date : DateConstructor @@ -124,7 +124,7 @@ function f3(x: T, y: U) { var r2 = true ? new Date() : x; >r2 : Date >true ? new Date() : x : Date ->true : boolean +>true : true >new Date() : Date >Date : DateConstructor >x : T @@ -133,7 +133,7 @@ function f3(x: T, y: U) { var r3 = true ? y : new Date(); >r3 : Date >true ? y : new Date() : Date ->true : boolean +>true : true >y : U >new Date() : Date >Date : DateConstructor @@ -141,7 +141,7 @@ function f3(x: T, y: U) { var r3 = true ? new Date() : y; >r3 : Date >true ? new Date() : y : Date ->true : boolean +>true : true >new Date() : Date >Date : DateConstructor >y : U @@ -174,7 +174,7 @@ module f { export var bar = 1; >bar : number ->1 : number +>1 : 1 } class c { baz: string } >c : c @@ -185,7 +185,7 @@ module c { export var bar = 1; >bar : number ->1 : number +>1 : 1 } function f4(x: T) { @@ -198,14 +198,14 @@ function f4(x: T) { var r0 = true ? x : null; // ok >r0 : T >true ? x : null : T ->true : boolean +>true : true >x : T >null : null var r0 = true ? null : x; // ok >r0 : T >true ? null : x : T ->true : boolean +>true : true >null : null >x : T @@ -216,14 +216,14 @@ function f4(x: T) { var r0b = true ? u : x; // ok >r0b : any >true ? u : x : any ->true : boolean +>true : true >u : any >x : T var r0b = true ? x : u; // ok >r0b : any >true ? x : u : any ->true : boolean +>true : true >x : T >u : any } @@ -237,17 +237,17 @@ function f5(x: T) { var r1 = true ? 1 : x; // ok >r1 : number | T ->true ? 1 : x : number | T ->true : boolean ->1 : number +>true ? 1 : x : 1 | T +>true : true +>1 : 1 >x : T var r1 = true ? x : 1; // ok >r1 : number | T ->true ? x : 1 : number | T ->true : boolean +>true ? x : 1 : 1 | T +>true : true >x : T ->1 : number +>1 : 1 } function f6(x: T) { @@ -259,17 +259,17 @@ function f6(x: T) { var r2 = true ? '' : x; // ok >r2 : string | T ->true ? '' : x : string | T ->true : boolean ->'' : string +>true ? '' : x : "" | T +>true : true +>'' : "" >x : T var r2 = true ? x : ''; // ok >r2 : string | T ->true ? x : '' : string | T ->true : boolean +>true ? x : '' : "" | T +>true : true >x : T ->'' : string +>'' : "" } function f7(x: T) { @@ -281,17 +281,17 @@ function f7(x: T) { var r3 = true ? true : x; // ok >r3 : boolean | T ->true ? true : x : boolean | T ->true : boolean ->true : boolean +>true ? true : x : true | T +>true : true +>true : true >x : T var r3 = true ? x : true; // ok >r3 : boolean | T ->true ? x : true : boolean | T ->true : boolean +>true ? x : true : true | T +>true : true >x : T ->true : boolean +>true : true } function f8(x: T) { @@ -304,7 +304,7 @@ function f8(x: T) { var r4 = true ? new Date() : x; // ok >r4 : Date >true ? new Date() : x : Date ->true : boolean +>true : true >new Date() : Date >Date : DateConstructor >x : T @@ -312,7 +312,7 @@ function f8(x: T) { var r4 = true ? x : new Date(); // ok >r4 : Date >true ? x : new Date() : Date ->true : boolean +>true : true >x : T >new Date() : Date >Date : DateConstructor @@ -328,14 +328,14 @@ function f9(x: T) { var r5 = true ? /1/ : x; // ok >r5 : RegExp >true ? /1/ : x : RegExp ->true : boolean +>true : true >/1/ : RegExp >x : T var r5 = true ? x : /1/; // ok >r5 : RegExp >true ? x : /1/ : RegExp ->true : boolean +>true : true >x : T >/1/ : RegExp } @@ -350,20 +350,20 @@ function f10(x: T) { var r6 = true ? { foo: 1 } : x; // ok >r6 : { foo: number; } >true ? { foo: 1 } : x : { foo: number; } ->true : boolean +>true : true >{ foo: 1 } : { foo: number; } >foo : number ->1 : number +>1 : 1 >x : T var r6 = true ? x : { foo: 1 }; // ok >r6 : { foo: number; } >true ? x : { foo: 1 } : { foo: number; } ->true : boolean +>true : true >x : T >{ foo: 1 } : { foo: number; } >foo : number ->1 : number +>1 : 1 } function f11 void>(x: T) { @@ -375,14 +375,14 @@ function f11 void>(x: T) { var r7 = true ? () => { } : x; // ok >r7 : () => void >true ? () => { } : x : () => void ->true : boolean +>true : true >() => { } : () => void >x : T var r7 = true ? x : () => { }; // ok >r7 : () => void >true ? x : () => { } : () => void ->true : boolean +>true : true >x : T >() => { } : () => void } @@ -400,7 +400,7 @@ function f12(x: U) => U>(x: T) { var r8 = true ? (x: T) => { return x } : x; // ok >r8 : (x: T) => T >true ? (x: T) => { return x } : x : (x: T) => T ->true : boolean +>true : true >(x: T) => { return x } : (x: T) => T >T : T >x : T @@ -411,7 +411,7 @@ function f12(x: U) => U>(x: T) { var r8b = true ? x : (x: T) => { return x }; // ok, type parameters not identical across declarations >r8b : (x: T) => T >true ? x : (x: T) => { return x } : (x: T) => T ->true : boolean +>true : true >x : T >(x: T) => { return x } : (x: T) => T >T : T @@ -434,14 +434,14 @@ function f13(x: T) { var r9 = true ? i1 : x; // ok >r9 : I1 >true ? i1 : x : I1 ->true : boolean +>true : true >i1 : I1 >x : T var r9 = true ? x : i1; // ok >r9 : I1 >true ? x : i1 : I1 ->true : boolean +>true : true >x : T >i1 : I1 } @@ -460,14 +460,14 @@ function f14(x: T) { var r10 = true ? c1 : x; // ok >r10 : C1 >true ? c1 : x : C1 ->true : boolean +>true : true >c1 : C1 >x : T var r10 = true ? x : c1; // ok >r10 : C1 >true ? x : c1 : C1 ->true : boolean +>true : true >x : T >c1 : C1 } @@ -486,14 +486,14 @@ function f15>(x: T) { var r12 = true ? c2 : x; // ok >r12 : C2 >true ? c2 : x : C2 ->true : boolean +>true : true >c2 : C2 >x : T var r12 = true ? x : c2; // ok >r12 : C2 >true ? x : c2 : C2 ->true : boolean +>true : true >x : T >c2 : C2 } @@ -508,21 +508,21 @@ function f16(x: T) { var r13 = true ? E : x; // ok >r13 : T | typeof E >true ? E : x : T | typeof E ->true : boolean +>true : true >E : typeof E >x : T var r13 = true ? x : E; // ok >r13 : T | typeof E >true ? x : E : T | typeof E ->true : boolean +>true : true >x : T >E : typeof E var r14 = true ? E.A : x; // ok >r14 : E >true ? E.A : x : E ->true : boolean +>true : true >E.A : E >E : typeof E >A : E @@ -531,7 +531,7 @@ function f16(x: T) { var r14 = true ? x : E.A; // ok >r14 : E >true ? x : E.A : E ->true : boolean +>true : true >x : T >E.A : E >E : typeof E @@ -552,14 +552,14 @@ function f17(x: T) { var r15 = true ? af : x; // ok >r15 : typeof f >true ? af : x : typeof f ->true : boolean +>true : true >af : typeof f >x : T var r15 = true ? x : af; // ok >r15 : typeof f >true ? x : af : typeof f ->true : boolean +>true : true >x : T >af : typeof f } @@ -578,14 +578,14 @@ function f18(x: T) { var r16 = true ? ac : x; // ok >r16 : typeof c >true ? ac : x : typeof c ->true : boolean +>true : true >ac : typeof c >x : T var r16 = true ? x : ac; // ok >r16 : typeof c >true ? x : ac : typeof c ->true : boolean +>true : true >x : T >ac : typeof c } @@ -606,14 +606,14 @@ function f19(x: T) { var r17 = true ? x : a; // ok >r17 : T >true ? x : a : T ->true : boolean +>true : true >x : T >a : U var r17 = true ? a : x; // ok >r17 : T >true ? a : x : T ->true : boolean +>true : true >a : U >x : T } @@ -630,14 +630,14 @@ function f19(x: T) { var r18 = true ? x : a; // ok >r18 : T >true ? x : a : T ->true : boolean +>true : true >x : T >a : V var r18 = true ? a : x; // ok >r18 : T >true ? a : x : T ->true : boolean +>true : true >a : V >x : T } @@ -653,7 +653,7 @@ function f20(x: T) { var r19 = true ? new Object() : x; // ok >r19 : Object >true ? new Object() : x : Object ->true : boolean +>true : true >new Object() : Object >Object : ObjectConstructor >x : T @@ -661,7 +661,7 @@ function f20(x: T) { var r19 = true ? x : new Object(); // ok >r19 : Object >true ? x : new Object() : Object ->true : boolean +>true : true >x : T >new Object() : Object >Object : ObjectConstructor @@ -677,14 +677,14 @@ function f21(x: T) { var r20 = true ? {} : x; // ok >r20 : {} >true ? {} : x : {} ->true : boolean +>true : true >{} : {} >x : T var r20 = true ? x : {}; // ok >r20 : {} >true ? x : {} : {} ->true : boolean +>true : true >x : T >{} : {} } diff --git a/tests/baselines/reference/subtypesOfTypeParameterWithConstraints3.types b/tests/baselines/reference/subtypesOfTypeParameterWithConstraints3.types index f0f075a37ce..598fec51bc0 100644 --- a/tests/baselines/reference/subtypesOfTypeParameterWithConstraints3.types +++ b/tests/baselines/reference/subtypesOfTypeParameterWithConstraints3.types @@ -18,14 +18,14 @@ function f(t: T, u: U, v: V) { var r = true ? t : u; >r : U >true ? t : u : U ->true : boolean +>true : true >t : T >u : U var r = true ? u : t; >r : U >true ? u : t : U ->true : boolean +>true : true >u : U >t : T @@ -33,14 +33,14 @@ function f(t: T, u: U, v: V) { var r2 = true ? t : v; >r2 : T | V >true ? t : v : T | V ->true : boolean +>true : true >t : T >v : V var r2 = true ? v : t; >r2 : T | V >true ? v : t : T | V ->true : boolean +>true : true >v : V >t : T @@ -48,14 +48,14 @@ function f(t: T, u: U, v: V) { var r3 = true ? v : u; >r3 : U | V >true ? v : u : U | V ->true : boolean +>true : true >v : V >u : U var r3 = true ? u : v; >r3 : U | V >true ? u : v : U | V ->true : boolean +>true : true >u : U >v : V } diff --git a/tests/baselines/reference/subtypingTransitivity.types b/tests/baselines/reference/subtypingTransitivity.types index 0a41e045d98..8aabf635313 100644 --- a/tests/baselines/reference/subtypingTransitivity.types +++ b/tests/baselines/reference/subtypingTransitivity.types @@ -35,11 +35,11 @@ var d2: D2; >D2 : D2 d.x = ''; ->d.x = '' : string +>d.x = '' : "" >d.x : string >d : D >x : string ->'' : string +>'' : "" b = d; >b = d : D @@ -47,9 +47,9 @@ b = d; >d : D b.x = 1; // assigned number to string ->b.x = 1 : number +>b.x = 1 : 1 >b.x : Object >b : B >x : Object ->1 : number +>1 : 1 diff --git a/tests/baselines/reference/subtypingWithCallSignatures.types b/tests/baselines/reference/subtypingWithCallSignatures.types index 50e773882d0..3f6994c8a04 100644 --- a/tests/baselines/reference/subtypingWithCallSignatures.types +++ b/tests/baselines/reference/subtypingWithCallSignatures.types @@ -18,7 +18,7 @@ module CallSignature { >foo1 : { (cb: (x: number) => void): (x: number) => void; (cb: any): any; } >(x: number) => 1 : (x: number) => number >x : number ->1 : number +>1 : 1 var r2 = foo1((x: T) => ''); // ok because base returns void >r2 : (x: number) => void @@ -28,7 +28,7 @@ module CallSignature { >T : T >x : T >T : T ->'' : string +>'' : "" declare function foo2(cb: (x: number, y: number) => void): typeof cb; >foo2 : { (cb: (x: number, y: number) => void): (x: number, y: number) => void; (cb: any): any; } @@ -48,7 +48,7 @@ module CallSignature { >(x: number, y: number) => 1 : (x: number, y: number) => number >x : number >y : number ->1 : number +>1 : 1 var r4 = foo2((x: T) => ''); // ok because base returns void >r4 : (x: number, y: number) => void @@ -58,5 +58,5 @@ module CallSignature { >T : T >x : T >T : T ->'' : string +>'' : "" } diff --git a/tests/baselines/reference/subtypingWithCallSignatures2.types b/tests/baselines/reference/subtypingWithCallSignatures2.types index 8a56e05a9c2..8ce4b566b86 100644 --- a/tests/baselines/reference/subtypingWithCallSignatures2.types +++ b/tests/baselines/reference/subtypingWithCallSignatures2.types @@ -322,7 +322,7 @@ var r1arg2 = (x: number) => [1]; >(x: number) => [1] : (x: number) => number[] >x : number >[1] : number[] ->1 : number +>1 : 1 var r1 = foo1(r1arg1); // any, return types are not subtype of first overload >r1 : any @@ -349,14 +349,14 @@ var r2arg1 = (x: T) => ['']; >x : T >T : T >[''] : string[] ->'' : string +>'' : "" var r2arg2 = (x: number) => ['']; >r2arg2 : (x: number) => string[] >(x: number) => [''] : (x: number) => string[] >x : number >[''] : string[] ->'' : string +>'' : "" var r2 = foo2(r2arg1); >r2 : (x: number) => string[] @@ -423,7 +423,7 @@ var r4arg2 = (x: string, y: number) => ''; >(x: string, y: number) => '' : (x: string, y: number) => string >x : string >y : number ->'' : string +>'' : "" var r4 = foo4(r4arg1); // any >r4 : any @@ -461,7 +461,7 @@ var r5arg2 = (x: (arg: string) => number) => ''; >(x: (arg: string) => number) => '' : (x: (arg: string) => number) => string >x : (arg: string) => number >arg : string ->'' : string +>'' : "" var r5 = foo5(r5arg1); // any >r5 : any @@ -701,7 +701,7 @@ var r10arg1 = (...x: T[]) => x[0]; >T : T >x[0] : T >x : T[] ->0 : number +>0 : 0 var r10arg2 = (...x: Derived[]) => null; >r10arg2 : (...x: Derived[]) => Derived @@ -929,7 +929,7 @@ var r16arg1 = (x: T) => [1]; >x : T >T : T >[1] : number[] ->1 : number +>1 : 1 var r16 = foo16(r16arg1); >r16 : { (x: T): number[]; (x: U): number[]; } diff --git a/tests/baselines/reference/subtypingWithCallSignatures3.types b/tests/baselines/reference/subtypingWithCallSignatures3.types index 379810b2541..6abc7567efb 100644 --- a/tests/baselines/reference/subtypingWithCallSignatures3.types +++ b/tests/baselines/reference/subtypingWithCallSignatures3.types @@ -224,7 +224,7 @@ module Errors { >(x: number) => [''] : (x: number) => string[] >x : number >[''] : string[] ->'' : string +>'' : "" >(x: T) => null : (x: T) => U[] >T : T >U : U @@ -248,7 +248,7 @@ module Errors { >(x: number) => [''] : (x: number) => string[] >x : number >[''] : string[] ->'' : string +>'' : "" var r2arg = (x: (arg: T) => U) => (r: T) => null; >r2arg : (x: (arg: T) => U) => (r: T) => V @@ -508,7 +508,7 @@ module Errors { >x : { a: string; b: number; } >a : string >b : number ->1 : number +>1 : 1 var r7 = foo15(r7arg); // any >r7 : any @@ -538,7 +538,7 @@ module Errors { >T : T >b : T >T : T ->1 : number +>1 : 1 var r7c = foo15(r7arg3); // (x: { a: string; b: number }) => number): number; >r7c : (x: { a: string; b: number; }) => number @@ -617,7 +617,7 @@ module WithGenericSignaturesInBaseType { >x : T >T : T >[''] : string[] ->'' : string +>'' : "" var r2 = foo2(r2arg2); // (x:T) => T[] since we can infer from generic signatures now >r2 : (x: T) => T[] diff --git a/tests/baselines/reference/subtypingWithCallSignatures4.types b/tests/baselines/reference/subtypingWithCallSignatures4.types index e76d36114e9..5926636289a 100644 --- a/tests/baselines/reference/subtypingWithCallSignatures4.types +++ b/tests/baselines/reference/subtypingWithCallSignatures4.types @@ -264,7 +264,7 @@ var r2arg = (x: T) => ['']; >x : T >T : T >[''] : string[] ->'' : string +>'' : "" var r2arg2 = (x: T) => ['']; >r2arg2 : (x: T) => string[] @@ -273,7 +273,7 @@ var r2arg2 = (x: T) => ['']; >x : T >T : T >[''] : string[] ->'' : string +>'' : "" var r2 = foo2(r2arg); >r2 : any @@ -337,7 +337,7 @@ var r4arg = (x: T, y: U) => ''; >T : T >y : U >U : U ->'' : string +>'' : "" var r4arg2 = (x: T, y: U) => ''; >r4arg2 : (x: T, y: U) => string @@ -348,7 +348,7 @@ var r4arg2 = (x: T, y: U) => ''; >T : T >y : U >U : U ->'' : string +>'' : "" var r4 = foo4(r4arg); >r4 : any diff --git a/tests/baselines/reference/subtypingWithObjectMembersOptionality.types b/tests/baselines/reference/subtypingWithObjectMembersOptionality.types index 815f2d60740..e0198e31d28 100644 --- a/tests/baselines/reference/subtypingWithObjectMembersOptionality.types +++ b/tests/baselines/reference/subtypingWithObjectMembersOptionality.types @@ -87,7 +87,7 @@ var b = { Foo: null }; var r = true ? a : b; >r : { Foo?: Base; } >true ? a : b : { Foo?: Base; } ->true : boolean +>true : true >a : { Foo?: Base; } >b : { Foo: Derived; } @@ -158,7 +158,7 @@ module TwoLevels { var r = true ? a : b; >r : { Foo?: Base; } >true ? a : b : { Foo?: Base; } ->true : boolean +>true : true >a : { Foo?: Base; } >b : { Foo: Derived2; } } diff --git a/tests/baselines/reference/subtypingWithObjectMembersOptionality3.types b/tests/baselines/reference/subtypingWithObjectMembersOptionality3.types index 6490b0abd9b..7f93418506f 100644 --- a/tests/baselines/reference/subtypingWithObjectMembersOptionality3.types +++ b/tests/baselines/reference/subtypingWithObjectMembersOptionality3.types @@ -71,7 +71,7 @@ var b: { Foo2: Derived; } var r = true ? a : b; // ok >r : { Foo?: Base; } >true ? a : b : { Foo?: Base; } ->true : boolean +>true : true >a : { Foo?: Base; } >b : { Foo2: Derived; } diff --git a/tests/baselines/reference/subtypingWithObjectMembersOptionality4.types b/tests/baselines/reference/subtypingWithObjectMembersOptionality4.types index ee636be020b..d1d00e8e1bc 100644 --- a/tests/baselines/reference/subtypingWithObjectMembersOptionality4.types +++ b/tests/baselines/reference/subtypingWithObjectMembersOptionality4.types @@ -71,7 +71,7 @@ var b: { Foo2?: Derived; } var r = true ? a : b; // ok >r : { Foo2?: Derived; } >true ? a : b : { Foo2?: Derived; } ->true : boolean +>true : true >a : { Foo: Base; } >b : { Foo2?: Derived; } diff --git a/tests/baselines/reference/super2.types b/tests/baselines/reference/super2.types index a3807f03099..2ff73710080 100644 --- a/tests/baselines/reference/super2.types +++ b/tests/baselines/reference/super2.types @@ -7,14 +7,14 @@ class Base5 { >x : () => string return "BaseX"; ->"BaseX" : string +>"BaseX" : "BaseX" } public y() { >y : () => string return "BaseY"; ->"BaseY" : string +>"BaseY" : "BaseY" } } @@ -26,7 +26,7 @@ class Sub5 extends Base5 { >x : () => string return "SubX"; ->"SubX" : string +>"SubX" : "SubX" } } @@ -62,7 +62,7 @@ class Base6 { >x : () => string return "BaseX"; ->"BaseX" : string +>"BaseX" : "BaseX" } } @@ -74,7 +74,7 @@ class Sub6 extends Base6 { >y : () => string return "SubY"; ->"SubY" : string +>"SubY" : "SubY" } } diff --git a/tests/baselines/reference/superCallArgsMustMatch.errors.txt b/tests/baselines/reference/superCallArgsMustMatch.errors.txt index 06758b44fe6..f5724a710d1 100644 --- a/tests/baselines/reference/superCallArgsMustMatch.errors.txt +++ b/tests/baselines/reference/superCallArgsMustMatch.errors.txt @@ -1,4 +1,4 @@ -tests/cases/compiler/superCallArgsMustMatch.ts(17,15): error TS2345: Argument of type 'string' is not assignable to parameter of type 'number'. +tests/cases/compiler/superCallArgsMustMatch.ts(17,15): error TS2345: Argument of type '"hi"' is not assignable to parameter of type 'number'. ==== tests/cases/compiler/superCallArgsMustMatch.ts (1 errors) ==== @@ -20,7 +20,7 @@ tests/cases/compiler/superCallArgsMustMatch.ts(17,15): error TS2345: Argument of // which is instantiated with 'number' in the extends clause super("hi"); ~~~~ -!!! error TS2345: Argument of type 'string' is not assignable to parameter of type 'number'. +!!! error TS2345: Argument of type '"hi"' is not assignable to parameter of type 'number'. var x: number = this.foo; diff --git a/tests/baselines/reference/superCallAssignResult.errors.txt b/tests/baselines/reference/superCallAssignResult.errors.txt index bc9e2a0dc55..524866f28f1 100644 --- a/tests/baselines/reference/superCallAssignResult.errors.txt +++ b/tests/baselines/reference/superCallAssignResult.errors.txt @@ -1,4 +1,4 @@ -tests/cases/compiler/superCallAssignResult.ts(8,9): error TS2322: Type 'number' is not assignable to type 'void'. +tests/cases/compiler/superCallAssignResult.ts(8,9): error TS2322: Type '5' is not assignable to type 'void'. ==== tests/cases/compiler/superCallAssignResult.ts (1 errors) ==== @@ -11,6 +11,6 @@ tests/cases/compiler/superCallAssignResult.ts(8,9): error TS2322: Type 'number' var x = super(5); // Should be of type void, not E. x = 5; ~ -!!! error TS2322: Type 'number' is not assignable to type 'void'. +!!! error TS2322: Type '5' is not assignable to type 'void'. } } \ No newline at end of file diff --git a/tests/baselines/reference/superCallParameterContextualTyping2.errors.txt b/tests/baselines/reference/superCallParameterContextualTyping2.errors.txt index a1e89d41efc..92451ffd056 100644 --- a/tests/baselines/reference/superCallParameterContextualTyping2.errors.txt +++ b/tests/baselines/reference/superCallParameterContextualTyping2.errors.txt @@ -1,4 +1,4 @@ -tests/cases/conformance/expressions/contextualTyping/superCallParameterContextualTyping2.ts(10,43): error TS2349: Cannot invoke an expression whose type lacks a call signature. +tests/cases/conformance/expressions/contextualTyping/superCallParameterContextualTyping2.ts(10,43): error TS2349: Cannot invoke an expression whose type lacks a call signature. Type 'Number' has no compatible call signatures. ==== tests/cases/conformance/expressions/contextualTyping/superCallParameterContextualTyping2.ts (1 errors) ==== @@ -13,5 +13,5 @@ tests/cases/conformance/expressions/contextualTyping/superCallParameterContextua // Ensure 'value' is not of type 'any' by invoking it with type arguments. constructor() { super(value => String(value())); } ~~~~~~~~~~~~~~~ -!!! error TS2349: Cannot invoke an expression whose type lacks a call signature. +!!! error TS2349: Cannot invoke an expression whose type lacks a call signature. Type 'Number' has no compatible call signatures. } \ No newline at end of file diff --git a/tests/baselines/reference/superCalls.types b/tests/baselines/reference/superCalls.types index ce5353df329..ad5f0806c44 100644 --- a/tests/baselines/reference/superCalls.types +++ b/tests/baselines/reference/superCalls.types @@ -4,7 +4,7 @@ class Base { x = 43; >x : number ->43 : number +>43 : 43 constructor(n: string) { >n : string @@ -26,14 +26,14 @@ class Derived extends Base { super(''); >super('') : void >super : typeof Base ->'' : string +>'' : "" //type of super call expression is void var p = super(''); >p : void >super('') : void >super : typeof Base ->'' : string +>'' : "" var p = v(); >p : void @@ -54,7 +54,7 @@ class OtherDerived extends OtherBase { constructor() { var p = ''; >p : string ->'' : string +>'' : "" super(); >super() : void diff --git a/tests/baselines/reference/superPropertyAccessInComputedPropertiesOfNestedType_ES5.types b/tests/baselines/reference/superPropertyAccessInComputedPropertiesOfNestedType_ES5.types index d435bff69b5..78af8fdf0b9 100644 --- a/tests/baselines/reference/superPropertyAccessInComputedPropertiesOfNestedType_ES5.types +++ b/tests/baselines/reference/superPropertyAccessInComputedPropertiesOfNestedType_ES5.types @@ -4,7 +4,7 @@ class A { foo() { return 1; } >foo : () => number ->1 : number +>1 : 1 } class B extends A { @@ -13,7 +13,7 @@ class B extends A { foo() { return 2; } >foo : () => number ->2 : number +>2 : 2 bar() { >bar : () => typeof (Anonymous class) @@ -28,7 +28,7 @@ class B extends A { >foo : () => number return 100; ->100 : number +>100 : 100 } } } diff --git a/tests/baselines/reference/superPropertyAccessInComputedPropertiesOfNestedType_ES6.types b/tests/baselines/reference/superPropertyAccessInComputedPropertiesOfNestedType_ES6.types index 817e3b73ba4..0e3d295fc88 100644 --- a/tests/baselines/reference/superPropertyAccessInComputedPropertiesOfNestedType_ES6.types +++ b/tests/baselines/reference/superPropertyAccessInComputedPropertiesOfNestedType_ES6.types @@ -4,7 +4,7 @@ class A { foo() { return 1; } >foo : () => number ->1 : number +>1 : 1 } class B extends A { @@ -13,7 +13,7 @@ class B extends A { foo() { return 2; } >foo : () => number ->2 : number +>2 : 2 bar() { >bar : () => typeof (Anonymous class) @@ -28,7 +28,7 @@ class B extends A { >foo : () => number return 100; ->100 : number +>100 : 100 } } } diff --git a/tests/baselines/reference/superPropertyAccessNoError.types b/tests/baselines/reference/superPropertyAccessNoError.types index b982b2ab694..f1e6101c421 100644 --- a/tests/baselines/reference/superPropertyAccessNoError.types +++ b/tests/baselines/reference/superPropertyAccessNoError.types @@ -14,14 +14,14 @@ class SomeBaseClass { >func : () => string return ''; ->'' : string +>'' : "" } static func() { >func : () => number return 3; ->3 : number +>3 : 3 } returnThis() { diff --git a/tests/baselines/reference/superPropertyAccess_ES6.types b/tests/baselines/reference/superPropertyAccess_ES6.types index b10b1944a44..bb4082a73cf 100644 --- a/tests/baselines/reference/superPropertyAccess_ES6.types +++ b/tests/baselines/reference/superPropertyAccess_ES6.types @@ -5,11 +5,11 @@ class MyBase { getValue(): number { return 1; } >getValue : () => number ->1 : number +>1 : 1 get value(): number { return 1; } >value : number ->1 : number +>1 : 1 } class MyDerived extends MyBase { @@ -84,6 +84,6 @@ class B extends A { >property : string >value + " addition" : string >value : string ->" addition" : string +>" addition" : " addition" } } diff --git a/tests/baselines/reference/superSymbolIndexedAccess1.types b/tests/baselines/reference/superSymbolIndexedAccess1.types index af2c6cab156..ab09528b04b 100644 --- a/tests/baselines/reference/superSymbolIndexedAccess1.types +++ b/tests/baselines/reference/superSymbolIndexedAccess1.types @@ -5,7 +5,7 @@ var symbol = Symbol.for('myThing'); >Symbol.for : (key: string) => symbol >Symbol : SymbolConstructor >for : (key: string) => symbol ->'myThing' : string +>'myThing' : "myThing" class Foo { >Foo : Foo @@ -14,7 +14,7 @@ class Foo { >symbol : symbol return 0; ->0 : number +>0 : 0 } } diff --git a/tests/baselines/reference/superSymbolIndexedAccess2.types b/tests/baselines/reference/superSymbolIndexedAccess2.types index 72bb6914d3e..61c760dfac7 100644 --- a/tests/baselines/reference/superSymbolIndexedAccess2.types +++ b/tests/baselines/reference/superSymbolIndexedAccess2.types @@ -9,7 +9,7 @@ class Foo { >isConcatSpreadable : symbol return 0; ->0 : number +>0 : 0 } } diff --git a/tests/baselines/reference/superSymbolIndexedAccess5.types b/tests/baselines/reference/superSymbolIndexedAccess5.types index abc3ba364b0..745fd81b8f8 100644 --- a/tests/baselines/reference/superSymbolIndexedAccess5.types +++ b/tests/baselines/reference/superSymbolIndexedAccess5.types @@ -9,7 +9,7 @@ class Foo { >symbol : any return 0; ->0 : number +>0 : 0 } } diff --git a/tests/baselines/reference/superSymbolIndexedAccess6.types b/tests/baselines/reference/superSymbolIndexedAccess6.types index 830ade0c685..11c4a0e553b 100644 --- a/tests/baselines/reference/superSymbolIndexedAccess6.types +++ b/tests/baselines/reference/superSymbolIndexedAccess6.types @@ -9,7 +9,7 @@ class Foo { >symbol : any return 0; ->0 : number +>0 : 0 } } diff --git a/tests/baselines/reference/switchAssignmentCompat.errors.txt b/tests/baselines/reference/switchAssignmentCompat.errors.txt index 747a1035b68..46c89fa5b52 100644 --- a/tests/baselines/reference/switchAssignmentCompat.errors.txt +++ b/tests/baselines/reference/switchAssignmentCompat.errors.txt @@ -1,4 +1,4 @@ -tests/cases/compiler/switchAssignmentCompat.ts(4,10): error TS2678: Type 'typeof Foo' is not comparable to type 'number'. +tests/cases/compiler/switchAssignmentCompat.ts(4,10): error TS2678: Type 'typeof Foo' is not comparable to type '0'. ==== tests/cases/compiler/switchAssignmentCompat.ts (1 errors) ==== @@ -7,6 +7,6 @@ tests/cases/compiler/switchAssignmentCompat.ts(4,10): error TS2678: Type 'typeof switch (0) { case Foo: break; // Error expected ~~~ -!!! error TS2678: Type 'typeof Foo' is not comparable to type 'number'. +!!! error TS2678: Type 'typeof Foo' is not comparable to type '0'. } \ No newline at end of file diff --git a/tests/baselines/reference/switchBreakStatements.errors.txt b/tests/baselines/reference/switchBreakStatements.errors.txt new file mode 100644 index 00000000000..229c42068c3 --- /dev/null +++ b/tests/baselines/reference/switchBreakStatements.errors.txt @@ -0,0 +1,92 @@ +tests/cases/conformance/statements/breakStatements/switchBreakStatements.ts(3,10): error TS2678: Type '"a"' is not comparable to type '""'. +tests/cases/conformance/statements/breakStatements/switchBreakStatements.ts(9,10): error TS2678: Type '"a"' is not comparable to type '""'. +tests/cases/conformance/statements/breakStatements/switchBreakStatements.ts(16,10): error TS2678: Type '"a"' is not comparable to type '""'. +tests/cases/conformance/statements/breakStatements/switchBreakStatements.ts(22,10): error TS2678: Type '"a"' is not comparable to type '""'. +tests/cases/conformance/statements/breakStatements/switchBreakStatements.ts(25,18): error TS2678: Type '"a"' is not comparable to type '""'. +tests/cases/conformance/statements/breakStatements/switchBreakStatements.ts(31,10): error TS2678: Type '"a"' is not comparable to type '""'. +tests/cases/conformance/statements/breakStatements/switchBreakStatements.ts(34,18): error TS2678: Type '"a"' is not comparable to type '""'. +tests/cases/conformance/statements/breakStatements/switchBreakStatements.ts(41,10): error TS2678: Type '"a"' is not comparable to type '""'. +tests/cases/conformance/statements/breakStatements/switchBreakStatements.ts(43,18): error TS2678: Type '"a"' is not comparable to type '""'. +tests/cases/conformance/statements/breakStatements/switchBreakStatements.ts(45,26): error TS2678: Type '"a"' is not comparable to type '""'. +tests/cases/conformance/statements/breakStatements/switchBreakStatements.ts(49,34): error TS2678: Type '"a"' is not comparable to type '""'. + + +==== tests/cases/conformance/statements/breakStatements/switchBreakStatements.ts (11 errors) ==== + + switch ('') { + case 'a': + ~~~ +!!! error TS2678: Type '"a"' is not comparable to type '""'. + break; + } + + ONE: + switch ('') { + case 'a': + ~~~ +!!! error TS2678: Type '"a"' is not comparable to type '""'. + break ONE; + } + + TWO: + THREE: + switch ('') { + case 'a': + ~~~ +!!! error TS2678: Type '"a"' is not comparable to type '""'. + break THREE; + } + + FOUR: + switch ('') { + case 'a': + ~~~ +!!! error TS2678: Type '"a"' is not comparable to type '""'. + FIVE: + switch ('') { + case 'a': + ~~~ +!!! error TS2678: Type '"a"' is not comparable to type '""'. + break FOUR; + } + } + + switch ('') { + case 'a': + ~~~ +!!! error TS2678: Type '"a"' is not comparable to type '""'. + SIX: + switch ('') { + case 'a': + ~~~ +!!! error TS2678: Type '"a"' is not comparable to type '""'. + break SIX; + } + } + + SEVEN: + switch ('') { + case 'a': + ~~~ +!!! error TS2678: Type '"a"' is not comparable to type '""'. + switch ('') { + case 'a': + ~~~ +!!! error TS2678: Type '"a"' is not comparable to type '""'. + switch ('') { + case 'a': + ~~~ +!!! error TS2678: Type '"a"' is not comparable to type '""'. + break SEVEN; + EIGHT: + switch ('') { + case 'a': + ~~~ +!!! error TS2678: Type '"a"' is not comparable to type '""'. + var fn = function () { } + break EIGHT; + } + } + } + } + \ No newline at end of file diff --git a/tests/baselines/reference/switchCases.errors.txt b/tests/baselines/reference/switchCases.errors.txt new file mode 100644 index 00000000000..205f8aae8c7 --- /dev/null +++ b/tests/baselines/reference/switchCases.errors.txt @@ -0,0 +1,11 @@ +tests/cases/compiler/switchCases.ts(2,7): error TS2678: Type '1' is not comparable to type '0'. + + +==== tests/cases/compiler/switchCases.ts (1 errors) ==== + switch(0) { + case 1: + ~ +!!! error TS2678: Type '1' is not comparable to type '0'. + break; + } + \ No newline at end of file diff --git a/tests/baselines/reference/switchCasesExpressionTypeMismatch.errors.txt b/tests/baselines/reference/switchCasesExpressionTypeMismatch.errors.txt index e430b33097c..3ea12e2460f 100644 --- a/tests/baselines/reference/switchCasesExpressionTypeMismatch.errors.txt +++ b/tests/baselines/reference/switchCasesExpressionTypeMismatch.errors.txt @@ -1,22 +1,25 @@ -tests/cases/compiler/switchCasesExpressionTypeMismatch.ts(4,10): error TS2678: Type 'typeof Foo' is not comparable to type 'number'. -tests/cases/compiler/switchCasesExpressionTypeMismatch.ts(5,10): error TS2678: Type '"sss"' is not comparable to type 'number'. -tests/cases/compiler/switchCasesExpressionTypeMismatch.ts(7,10): error TS2678: Type 'true' is not comparable to type 'number'. +tests/cases/compiler/switchCasesExpressionTypeMismatch.ts(4,10): error TS2678: Type 'typeof Foo' is not comparable to type '0'. +tests/cases/compiler/switchCasesExpressionTypeMismatch.ts(5,10): error TS2678: Type '"sss"' is not comparable to type '0'. +tests/cases/compiler/switchCasesExpressionTypeMismatch.ts(6,10): error TS2678: Type '123' is not comparable to type '0'. +tests/cases/compiler/switchCasesExpressionTypeMismatch.ts(7,10): error TS2678: Type 'true' is not comparable to type '0'. -==== tests/cases/compiler/switchCasesExpressionTypeMismatch.ts (3 errors) ==== +==== tests/cases/compiler/switchCasesExpressionTypeMismatch.ts (4 errors) ==== class Foo { } switch (0) { case Foo: break; // Error ~~~ -!!! error TS2678: Type 'typeof Foo' is not comparable to type 'number'. +!!! error TS2678: Type 'typeof Foo' is not comparable to type '0'. case "sss": break; // Error ~~~~~ -!!! error TS2678: Type '"sss"' is not comparable to type 'number'. +!!! error TS2678: Type '"sss"' is not comparable to type '0'. case 123: break; // No Error + ~~~ +!!! error TS2678: Type '123' is not comparable to type '0'. case true: break; // Error ~~~~ -!!! error TS2678: Type 'true' is not comparable to type 'number'. +!!! error TS2678: Type 'true' is not comparable to type '0'. } var s: any = 0; diff --git a/tests/baselines/reference/switchFallThroughs.types b/tests/baselines/reference/switchFallThroughs.types index cd0af6693eb..3e0f0276846 100644 --- a/tests/baselines/reference/switchFallThroughs.types +++ b/tests/baselines/reference/switchFallThroughs.types @@ -17,7 +17,7 @@ function R1(index: number) { var a = 'a'; >a : string ->'a' : string +>'a' : "a" return a; >a : string @@ -29,14 +29,14 @@ function R1(index: number) { >4 : 4 return 'b'; ->'b' : string +>'b' : "b" } case 5: >5 : 5 default: return 'c'; ->'c' : string +>'c' : "c" } } diff --git a/tests/baselines/reference/symbolDeclarationEmit10.types b/tests/baselines/reference/symbolDeclarationEmit10.types index 0d8d54c28de..d7f5c861e89 100644 --- a/tests/baselines/reference/symbolDeclarationEmit10.types +++ b/tests/baselines/reference/symbolDeclarationEmit10.types @@ -7,7 +7,7 @@ var obj = { >Symbol.isConcatSpreadable : symbol >Symbol : SymbolConstructor >isConcatSpreadable : symbol ->'' : string +>'' : "" set [Symbol.isConcatSpreadable](x) { } >Symbol.isConcatSpreadable : symbol diff --git a/tests/baselines/reference/symbolDeclarationEmit11.types b/tests/baselines/reference/symbolDeclarationEmit11.types index 30f92266eb2..d75c3683e97 100644 --- a/tests/baselines/reference/symbolDeclarationEmit11.types +++ b/tests/baselines/reference/symbolDeclarationEmit11.types @@ -6,7 +6,7 @@ class C { >Symbol.iterator : symbol >Symbol : SymbolConstructor >iterator : symbol ->0 : number +>0 : 0 static [Symbol.isConcatSpreadable]() { } >Symbol.isConcatSpreadable : symbol @@ -17,7 +17,7 @@ class C { >Symbol.toPrimitive : symbol >Symbol : SymbolConstructor >toPrimitive : symbol ->"" : string +>"" : "" static set [Symbol.toPrimitive](x) { } >Symbol.toPrimitive : symbol diff --git a/tests/baselines/reference/symbolDeclarationEmit13.types b/tests/baselines/reference/symbolDeclarationEmit13.types index ce77ec9b38b..9fa17acdc10 100644 --- a/tests/baselines/reference/symbolDeclarationEmit13.types +++ b/tests/baselines/reference/symbolDeclarationEmit13.types @@ -6,7 +6,7 @@ class C { >Symbol.toPrimitive : symbol >Symbol : SymbolConstructor >toPrimitive : symbol ->"" : string +>"" : "" set [Symbol.toStringTag](x) { } >Symbol.toStringTag : symbol diff --git a/tests/baselines/reference/symbolDeclarationEmit14.types b/tests/baselines/reference/symbolDeclarationEmit14.types index 5e975a6eae4..daf7b6d5731 100644 --- a/tests/baselines/reference/symbolDeclarationEmit14.types +++ b/tests/baselines/reference/symbolDeclarationEmit14.types @@ -6,11 +6,11 @@ class C { >Symbol.toPrimitive : symbol >Symbol : SymbolConstructor >toPrimitive : symbol ->"" : string +>"" : "" get [Symbol.toStringTag]() { return ""; } >Symbol.toStringTag : symbol >Symbol : SymbolConstructor >toStringTag : symbol ->"" : string +>"" : "" } diff --git a/tests/baselines/reference/symbolDeclarationEmit2.types b/tests/baselines/reference/symbolDeclarationEmit2.types index 10727836712..23d2fac2de8 100644 --- a/tests/baselines/reference/symbolDeclarationEmit2.types +++ b/tests/baselines/reference/symbolDeclarationEmit2.types @@ -6,5 +6,5 @@ class C { >Symbol.toPrimitive : symbol >Symbol : SymbolConstructor >toPrimitive : symbol ->"" : string +>"" : "" } diff --git a/tests/baselines/reference/symbolDeclarationEmit4.types b/tests/baselines/reference/symbolDeclarationEmit4.types index 51e4135b498..f9fa6dc581c 100644 --- a/tests/baselines/reference/symbolDeclarationEmit4.types +++ b/tests/baselines/reference/symbolDeclarationEmit4.types @@ -6,7 +6,7 @@ class C { >Symbol.toPrimitive : symbol >Symbol : SymbolConstructor >toPrimitive : symbol ->"" : string +>"" : "" set [Symbol.toPrimitive](x) { } >Symbol.toPrimitive : symbol diff --git a/tests/baselines/reference/symbolDeclarationEmit8.types b/tests/baselines/reference/symbolDeclarationEmit8.types index e14bc5c395b..4e8bfc9a9af 100644 --- a/tests/baselines/reference/symbolDeclarationEmit8.types +++ b/tests/baselines/reference/symbolDeclarationEmit8.types @@ -7,5 +7,5 @@ var obj = { >Symbol.isConcatSpreadable : symbol >Symbol : SymbolConstructor >isConcatSpreadable : symbol ->0 : number +>0 : 0 } diff --git a/tests/baselines/reference/symbolProperty1.types b/tests/baselines/reference/symbolProperty1.types index 667e51fda8a..4af154f7b27 100644 --- a/tests/baselines/reference/symbolProperty1.types +++ b/tests/baselines/reference/symbolProperty1.types @@ -8,7 +8,7 @@ var x = { [s]: 0, >s : symbol ->0 : number +>0 : 0 [s]() { }, >s : symbol @@ -17,6 +17,6 @@ var x = { >s : symbol return 0; ->0 : number +>0 : 0 } } diff --git a/tests/baselines/reference/symbolProperty18.types b/tests/baselines/reference/symbolProperty18.types index 772e6aff2f7..97b4de9897c 100644 --- a/tests/baselines/reference/symbolProperty18.types +++ b/tests/baselines/reference/symbolProperty18.types @@ -7,13 +7,13 @@ var i = { >Symbol.iterator : symbol >Symbol : SymbolConstructor >iterator : symbol ->0 : number +>0 : 0 [Symbol.toStringTag]() { return "" }, >Symbol.toStringTag : symbol >Symbol : SymbolConstructor >toStringTag : symbol ->"" : string +>"" : "" set [Symbol.toPrimitive](p: boolean) { } >Symbol.toPrimitive : symbol @@ -40,11 +40,11 @@ var str = i[Symbol.toStringTag](); >toStringTag : symbol i[Symbol.toPrimitive] = false; ->i[Symbol.toPrimitive] = false : boolean +>i[Symbol.toPrimitive] = false : false >i[Symbol.toPrimitive] : boolean >i : { [Symbol.iterator]: number; [Symbol.toStringTag](): string; [Symbol.toPrimitive]: boolean; } >Symbol.toPrimitive : symbol >Symbol : SymbolConstructor >toPrimitive : symbol ->false : boolean +>false : false diff --git a/tests/baselines/reference/symbolProperty2.types b/tests/baselines/reference/symbolProperty2.types index 7584c6461e8..18aafb5afb5 100644 --- a/tests/baselines/reference/symbolProperty2.types +++ b/tests/baselines/reference/symbolProperty2.types @@ -10,7 +10,7 @@ var x = { [s]: 0, >s : symbol ->0 : number +>0 : 0 [s]() { }, >s : symbol @@ -19,6 +19,6 @@ var x = { >s : symbol return 0; ->0 : number +>0 : 0 } } diff --git a/tests/baselines/reference/symbolProperty21.errors.txt b/tests/baselines/reference/symbolProperty21.errors.txt index fa9cabc9b61..766af0659e8 100644 --- a/tests/baselines/reference/symbolProperty21.errors.txt +++ b/tests/baselines/reference/symbolProperty21.errors.txt @@ -1,4 +1,4 @@ -tests/cases/conformance/es6/Symbols/symbolProperty21.ts(10,5): error TS2345: Argument of type '{ [Symbol.isConcatSpreadable]: string; [Symbol.toPrimitive]: number; [Symbol.unscopables]: boolean; }' is not assignable to parameter of type 'I'. +tests/cases/conformance/es6/Symbols/symbolProperty21.ts(10,5): error TS2345: Argument of type '{ [Symbol.isConcatSpreadable]: string; [Symbol.toPrimitive]: number; [Symbol.unscopables]: true; }' is not assignable to parameter of type 'I'. Object literal may only specify known properties, and '[Symbol.toPrimitive]' does not exist in type 'I'. @@ -14,7 +14,7 @@ tests/cases/conformance/es6/Symbols/symbolProperty21.ts(10,5): error TS2345: Arg [Symbol.isConcatSpreadable]: "", [Symbol.toPrimitive]: 0, ~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2345: Argument of type '{ [Symbol.isConcatSpreadable]: string; [Symbol.toPrimitive]: number; [Symbol.unscopables]: boolean; }' is not assignable to parameter of type 'I'. +!!! error TS2345: Argument of type '{ [Symbol.isConcatSpreadable]: string; [Symbol.toPrimitive]: number; [Symbol.unscopables]: true; }' is not assignable to parameter of type 'I'. !!! error TS2345: Object literal may only specify known properties, and '[Symbol.toPrimitive]' does not exist in type 'I'. [Symbol.unscopables]: true }); \ No newline at end of file diff --git a/tests/baselines/reference/symbolProperty22.types b/tests/baselines/reference/symbolProperty22.types index 29d16b1553e..628164f3929 100644 --- a/tests/baselines/reference/symbolProperty22.types +++ b/tests/baselines/reference/symbolProperty22.types @@ -28,7 +28,7 @@ declare function foo(p1: T, p2: I): U; foo("", { [Symbol.unscopables]: s => s.length }); >foo("", { [Symbol.unscopables]: s => s.length }) : number >foo : (p1: T, p2: I) => U ->"" : string +>"" : "" >{ [Symbol.unscopables]: s => s.length } : { [Symbol.unscopables]: (s: string) => number; } >Symbol.unscopables : symbol >Symbol : SymbolConstructor diff --git a/tests/baselines/reference/symbolProperty23.types b/tests/baselines/reference/symbolProperty23.types index b34a208a907..c4a9d6765dd 100644 --- a/tests/baselines/reference/symbolProperty23.types +++ b/tests/baselines/reference/symbolProperty23.types @@ -18,6 +18,6 @@ class C implements I { >toPrimitive : symbol return true; ->true : boolean +>true : true } } diff --git a/tests/baselines/reference/symbolProperty26.types b/tests/baselines/reference/symbolProperty26.types index 386761c98f9..cde412000db 100644 --- a/tests/baselines/reference/symbolProperty26.types +++ b/tests/baselines/reference/symbolProperty26.types @@ -8,7 +8,7 @@ class C1 { >toStringTag : symbol return ""; ->"" : string +>"" : "" } } @@ -22,6 +22,6 @@ class C2 extends C1 { >toStringTag : symbol return ""; ->"" : string +>"" : "" } } diff --git a/tests/baselines/reference/symbolProperty27.types b/tests/baselines/reference/symbolProperty27.types index d8ff2f2f116..2c138b5a9d0 100644 --- a/tests/baselines/reference/symbolProperty27.types +++ b/tests/baselines/reference/symbolProperty27.types @@ -22,6 +22,6 @@ class C2 extends C1 { >toStringTag : symbol return ""; ->"" : string +>"" : "" } } diff --git a/tests/baselines/reference/symbolProperty28.types b/tests/baselines/reference/symbolProperty28.types index 6eddebf44d8..2a7b5fabf79 100644 --- a/tests/baselines/reference/symbolProperty28.types +++ b/tests/baselines/reference/symbolProperty28.types @@ -10,7 +10,7 @@ class C1 { return { x: "" }; >{ x: "" } : { x: string; } >x : string ->"" : string +>"" : "" } } diff --git a/tests/baselines/reference/symbolProperty4.types b/tests/baselines/reference/symbolProperty4.types index 7bcf3f23397..abcf4451b03 100644 --- a/tests/baselines/reference/symbolProperty4.types +++ b/tests/baselines/reference/symbolProperty4.types @@ -6,7 +6,7 @@ var x = { [Symbol()]: 0, >Symbol() : symbol >Symbol : SymbolConstructor ->0 : number +>0 : 0 [Symbol()]() { }, >Symbol() : symbol @@ -17,6 +17,6 @@ var x = { >Symbol : SymbolConstructor return 0; ->0 : number +>0 : 0 } } diff --git a/tests/baselines/reference/symbolProperty40.types b/tests/baselines/reference/symbolProperty40.types index c349a705a29..efe6600d535 100644 --- a/tests/baselines/reference/symbolProperty40.types +++ b/tests/baselines/reference/symbolProperty40.types @@ -37,7 +37,7 @@ c[Symbol.iterator](""); >Symbol.iterator : symbol >Symbol : SymbolConstructor >iterator : symbol ->"" : string +>"" : "" c[Symbol.iterator](0); >c[Symbol.iterator](0) : number @@ -46,5 +46,5 @@ c[Symbol.iterator](0); >Symbol.iterator : symbol >Symbol : SymbolConstructor >iterator : symbol ->0 : number +>0 : 0 diff --git a/tests/baselines/reference/symbolProperty41.types b/tests/baselines/reference/symbolProperty41.types index f312481ac04..5eebd107659 100644 --- a/tests/baselines/reference/symbolProperty41.types +++ b/tests/baselines/reference/symbolProperty41.types @@ -40,7 +40,7 @@ c[Symbol.iterator](""); >Symbol.iterator : symbol >Symbol : SymbolConstructor >iterator : symbol ->"" : string +>"" : "" c[Symbol.iterator]("hello"); >c[Symbol.iterator]("hello") : { x: string; hello: string; } diff --git a/tests/baselines/reference/symbolProperty45.types b/tests/baselines/reference/symbolProperty45.types index 946ceeb9ea1..cb0fbdffc53 100644 --- a/tests/baselines/reference/symbolProperty45.types +++ b/tests/baselines/reference/symbolProperty45.types @@ -8,7 +8,7 @@ class C { >hasInstance : symbol return ""; ->"" : string +>"" : "" } get [Symbol.toPrimitive]() { >Symbol.toPrimitive : symbol @@ -16,6 +16,6 @@ class C { >toPrimitive : symbol return ""; ->"" : string +>"" : "" } } diff --git a/tests/baselines/reference/symbolProperty46.errors.txt b/tests/baselines/reference/symbolProperty46.errors.txt index 68f86afc315..3756f2c5271 100644 --- a/tests/baselines/reference/symbolProperty46.errors.txt +++ b/tests/baselines/reference/symbolProperty46.errors.txt @@ -1,4 +1,4 @@ -tests/cases/conformance/es6/Symbols/symbolProperty46.ts(10,1): error TS2322: Type 'number' is not assignable to type 'string'. +tests/cases/conformance/es6/Symbols/symbolProperty46.ts(10,1): error TS2322: Type '0' is not assignable to type 'string'. ==== tests/cases/conformance/es6/Symbols/symbolProperty46.ts (1 errors) ==== @@ -13,5 +13,5 @@ tests/cases/conformance/es6/Symbols/symbolProperty46.ts(10,1): error TS2322: Typ (new C)[Symbol.hasInstance] = 0; ~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2322: Type 'number' is not assignable to type 'string'. +!!! error TS2322: Type '0' is not assignable to type 'string'. (new C)[Symbol.hasInstance] = ""; \ No newline at end of file diff --git a/tests/baselines/reference/symbolProperty47.errors.txt b/tests/baselines/reference/symbolProperty47.errors.txt index b35650f94bb..2e15085eb24 100644 --- a/tests/baselines/reference/symbolProperty47.errors.txt +++ b/tests/baselines/reference/symbolProperty47.errors.txt @@ -1,5 +1,5 @@ -tests/cases/conformance/es6/Symbols/symbolProperty47.ts(3,16): error TS2322: Type 'string' is not assignable to type 'number'. -tests/cases/conformance/es6/Symbols/symbolProperty47.ts(11,1): error TS2322: Type 'string' is not assignable to type 'number'. +tests/cases/conformance/es6/Symbols/symbolProperty47.ts(3,16): error TS2322: Type '""' is not assignable to type 'number'. +tests/cases/conformance/es6/Symbols/symbolProperty47.ts(11,1): error TS2322: Type '""' is not assignable to type 'number'. ==== tests/cases/conformance/es6/Symbols/symbolProperty47.ts (2 errors) ==== @@ -7,7 +7,7 @@ tests/cases/conformance/es6/Symbols/symbolProperty47.ts(11,1): error TS2322: Typ get [Symbol.hasInstance]() { return ""; ~~ -!!! error TS2322: Type 'string' is not assignable to type 'number'. +!!! error TS2322: Type '""' is not assignable to type 'number'. } // Should take a string set [Symbol.hasInstance](x: number) { @@ -17,4 +17,4 @@ tests/cases/conformance/es6/Symbols/symbolProperty47.ts(11,1): error TS2322: Typ (new C)[Symbol.hasInstance] = 0; (new C)[Symbol.hasInstance] = ""; ~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2322: Type 'string' is not assignable to type 'number'. \ No newline at end of file +!!! error TS2322: Type '""' is not assignable to type 'number'. \ No newline at end of file diff --git a/tests/baselines/reference/symbolProperty5.types b/tests/baselines/reference/symbolProperty5.types index b338f94f6d3..833b6aa525d 100644 --- a/tests/baselines/reference/symbolProperty5.types +++ b/tests/baselines/reference/symbolProperty5.types @@ -7,7 +7,7 @@ var x = { >Symbol.iterator : symbol >Symbol : SymbolConstructor >iterator : symbol ->0 : number +>0 : 0 [Symbol.toPrimitive]() { }, >Symbol.toPrimitive : symbol @@ -20,6 +20,6 @@ var x = { >toStringTag : symbol return 0; ->0 : number +>0 : 0 } } diff --git a/tests/baselines/reference/symbolProperty55.types b/tests/baselines/reference/symbolProperty55.types index 8c438bbf445..3d56c268267 100644 --- a/tests/baselines/reference/symbolProperty55.types +++ b/tests/baselines/reference/symbolProperty55.types @@ -7,7 +7,7 @@ var obj = { >Symbol.iterator : symbol >Symbol : SymbolConstructor >iterator : symbol ->0 : number +>0 : 0 }; diff --git a/tests/baselines/reference/symbolProperty56.types b/tests/baselines/reference/symbolProperty56.types index 87998908745..63f6317e219 100644 --- a/tests/baselines/reference/symbolProperty56.types +++ b/tests/baselines/reference/symbolProperty56.types @@ -7,7 +7,7 @@ var obj = { >Symbol.iterator : symbol >Symbol : SymbolConstructor >iterator : symbol ->0 : number +>0 : 0 }; @@ -24,5 +24,5 @@ module M { >obj : { [Symbol.iterator]: number; } >Symbol["iterator"] : any >Symbol : {} ->"iterator" : string +>"iterator" : "iterator" } diff --git a/tests/baselines/reference/symbolProperty57.types b/tests/baselines/reference/symbolProperty57.types index b0c02052e58..6a4920b8e2f 100644 --- a/tests/baselines/reference/symbolProperty57.types +++ b/tests/baselines/reference/symbolProperty57.types @@ -7,7 +7,7 @@ var obj = { >Symbol.iterator : symbol >Symbol : SymbolConstructor >iterator : symbol ->0 : number +>0 : 0 }; @@ -17,5 +17,5 @@ obj[Symbol["nonsense"]]; >obj : { [Symbol.iterator]: number; } >Symbol["nonsense"] : any >Symbol : SymbolConstructor ->"nonsense" : string +>"nonsense" : "nonsense" diff --git a/tests/baselines/reference/symbolProperty6.types b/tests/baselines/reference/symbolProperty6.types index a378acf1bbe..a9fe1178e07 100644 --- a/tests/baselines/reference/symbolProperty6.types +++ b/tests/baselines/reference/symbolProperty6.types @@ -6,7 +6,7 @@ class C { >Symbol.iterator : symbol >Symbol : SymbolConstructor >iterator : symbol ->0 : number +>0 : 0 [Symbol.unscopables]: number; >Symbol.unscopables : symbol @@ -24,6 +24,6 @@ class C { >toStringTag : symbol return 0; ->0 : number +>0 : 0 } } diff --git a/tests/baselines/reference/symbolType11.types b/tests/baselines/reference/symbolType11.types index 903c4ec0ecc..ec474dcdb54 100644 --- a/tests/baselines/reference/symbolType11.types +++ b/tests/baselines/reference/symbolType11.types @@ -5,7 +5,7 @@ var s = Symbol.for("logical"); >Symbol.for : (key: string) => symbol >Symbol : SymbolConstructor >for : (key: string) => symbol ->"logical" : string +>"logical" : "logical" s && s; >s && s : symbol @@ -18,8 +18,8 @@ s && []; >[] : undefined[] 0 && s; ->0 && s : symbol ->0 : number +>0 && s : 0 +>0 : 0 >s : symbol s || s; @@ -28,9 +28,9 @@ s || s; >s : symbol s || 1; ->s || 1 : number | symbol +>s || 1 : symbol | 1 >s : symbol ->1 : number +>1 : 1 ({}) || s; >({}) || s : {} diff --git a/tests/baselines/reference/symbolType12.errors.txt b/tests/baselines/reference/symbolType12.errors.txt index adceb58ae56..b6034c62eec 100644 --- a/tests/baselines/reference/symbolType12.errors.txt +++ b/tests/baselines/reference/symbolType12.errors.txt @@ -8,7 +8,7 @@ tests/cases/conformance/es6/Symbols/symbolType12.ts(7,1): error TS2362: The left tests/cases/conformance/es6/Symbols/symbolType12.ts(7,6): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. tests/cases/conformance/es6/Symbols/symbolType12.ts(8,1): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. tests/cases/conformance/es6/Symbols/symbolType12.ts(9,1): error TS2365: Operator '+=' cannot be applied to types 'symbol' and 'symbol'. -tests/cases/conformance/es6/Symbols/symbolType12.ts(10,1): error TS2365: Operator '+=' cannot be applied to types 'symbol' and 'number'. +tests/cases/conformance/es6/Symbols/symbolType12.ts(10,1): error TS2365: Operator '+=' cannot be applied to types 'symbol' and '0'. tests/cases/conformance/es6/Symbols/symbolType12.ts(11,1): error TS2469: The '+=' operator cannot be applied to type 'symbol'. tests/cases/conformance/es6/Symbols/symbolType12.ts(12,8): error TS2469: The '+=' operator cannot be applied to type 'symbol'. tests/cases/conformance/es6/Symbols/symbolType12.ts(13,1): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. @@ -67,7 +67,7 @@ tests/cases/conformance/es6/Symbols/symbolType12.ts(28,8): error TS2469: The '+= !!! error TS2365: Operator '+=' cannot be applied to types 'symbol' and 'symbol'. s += 0; ~~~~~~ -!!! error TS2365: Operator '+=' cannot be applied to types 'symbol' and 'number'. +!!! error TS2365: Operator '+=' cannot be applied to types 'symbol' and '0'. s += ""; ~ !!! error TS2469: The '+=' operator cannot be applied to type 'symbol'. diff --git a/tests/baselines/reference/symbolType6.errors.txt b/tests/baselines/reference/symbolType6.errors.txt index 29d894c2afb..42940ac1961 100644 --- a/tests/baselines/reference/symbolType6.errors.txt +++ b/tests/baselines/reference/symbolType6.errors.txt @@ -3,10 +3,10 @@ tests/cases/conformance/es6/Symbols/symbolType6.ts(4,1): error TS2362: The left- tests/cases/conformance/es6/Symbols/symbolType6.ts(4,5): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. tests/cases/conformance/es6/Symbols/symbolType6.ts(5,1): error TS2469: The '+' operator cannot be applied to type 'symbol'. tests/cases/conformance/es6/Symbols/symbolType6.ts(6,1): error TS2469: The '+' operator cannot be applied to type 'symbol'. -tests/cases/conformance/es6/Symbols/symbolType6.ts(7,1): error TS2365: Operator '+' cannot be applied to types 'symbol' and 'number'. +tests/cases/conformance/es6/Symbols/symbolType6.ts(7,1): error TS2365: Operator '+' cannot be applied to types 'symbol' and '0'. tests/cases/conformance/es6/Symbols/symbolType6.ts(8,6): error TS2469: The '+' operator cannot be applied to type 'symbol'. tests/cases/conformance/es6/Symbols/symbolType6.ts(9,5): error TS2469: The '+' operator cannot be applied to type 'symbol'. -tests/cases/conformance/es6/Symbols/symbolType6.ts(10,1): error TS2365: Operator '+' cannot be applied to types 'number' and 'symbol'. +tests/cases/conformance/es6/Symbols/symbolType6.ts(10,1): error TS2365: Operator '+' cannot be applied to types '0' and 'symbol'. tests/cases/conformance/es6/Symbols/symbolType6.ts(11,1): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. tests/cases/conformance/es6/Symbols/symbolType6.ts(12,5): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. tests/cases/conformance/es6/Symbols/symbolType6.ts(14,1): error TS2469: The '+' operator cannot be applied to type 'symbol'. @@ -32,7 +32,7 @@ tests/cases/conformance/es6/Symbols/symbolType6.ts(15,6): error TS2469: The '+' !!! error TS2469: The '+' operator cannot be applied to type 'symbol'. s + 0; ~~~~~ -!!! error TS2365: Operator '+' cannot be applied to types 'symbol' and 'number'. +!!! error TS2365: Operator '+' cannot be applied to types 'symbol' and '0'. "" + s; ~ !!! error TS2469: The '+' operator cannot be applied to type 'symbol'. @@ -41,7 +41,7 @@ tests/cases/conformance/es6/Symbols/symbolType6.ts(15,6): error TS2469: The '+' !!! error TS2469: The '+' operator cannot be applied to type 'symbol'. 0 + s; ~~~~~ -!!! error TS2365: Operator '+' cannot be applied to types 'number' and 'symbol'. +!!! error TS2365: Operator '+' cannot be applied to types '0' and 'symbol'. s - 0; ~ !!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. diff --git a/tests/baselines/reference/systemModule1.types b/tests/baselines/reference/systemModule1.types index 2adf73d116f..927b88f4b54 100644 --- a/tests/baselines/reference/systemModule1.types +++ b/tests/baselines/reference/systemModule1.types @@ -2,5 +2,5 @@ export var x = 1; >x : number ->1 : number +>1 : 1 diff --git a/tests/baselines/reference/systemModule13.types b/tests/baselines/reference/systemModule13.types index f31b0825416..ec85746d2bb 100644 --- a/tests/baselines/reference/systemModule13.types +++ b/tests/baselines/reference/systemModule13.types @@ -5,9 +5,9 @@ export let [x,y,z] = [1, 2, 3]; >y : number >z : number >[1, 2, 3] : [number, number, number] ->1 : number ->2 : number ->3 : number +>1 : 1 +>2 : 2 +>3 : 3 export const {a: z0, b: {c: z1}} = {a: true, b: {c: "123"}}; >a : any @@ -17,16 +17,16 @@ export const {a: z0, b: {c: z1}} = {a: true, b: {c: "123"}}; >z1 : string >{a: true, b: {c: "123"}} : { a: boolean; b: { c: string; }; } >a : boolean ->true : boolean +>true : true >b : { c: string; } >{c: "123"} : { c: string; } >c : string ->"123" : string +>"123" : "123" for ([x] of [[1]]) {} >[x] : [number] >x : number >[[1]] : number[][] >[1] : number[] ->1 : number +>1 : 1 diff --git a/tests/baselines/reference/systemModule15.types b/tests/baselines/reference/systemModule15.types index 502638dab93..7ebd1f7378e 100644 --- a/tests/baselines/reference/systemModule15.types +++ b/tests/baselines/reference/systemModule15.types @@ -25,9 +25,9 @@ use(moduleB.moduleC); use(moduleB.moduleCStar); >use(moduleB.moduleCStar) : void >use : (v: any) => void ->moduleB.moduleCStar : typeof +>moduleB.moduleCStar : typeof "tests/cases/compiler/file3" >moduleB : typeof moduleB ->moduleCStar : typeof +>moduleCStar : typeof "tests/cases/compiler/file3" === tests/cases/compiler/file2.ts === @@ -58,7 +58,7 @@ export { export var value = "youpi"; >value : string ->"youpi" : string +>"youpi" : "youpi" export default value; >value : string @@ -67,5 +67,5 @@ export default value; export var value2 = "v"; >value2 : string ->"v" : string +>"v" : "v" diff --git a/tests/baselines/reference/systemModule16.errors.txt b/tests/baselines/reference/systemModule16.errors.txt index 8c79c9218e4..33d7ba58bc2 100644 --- a/tests/baselines/reference/systemModule16.errors.txt +++ b/tests/baselines/reference/systemModule16.errors.txt @@ -4,9 +4,13 @@ tests/cases/compiler/systemModule16.ts(4,15): error TS2307: Cannot find module ' tests/cases/compiler/systemModule16.ts(5,15): error TS2307: Cannot find module 'bar'. tests/cases/compiler/systemModule16.ts(8,32): error TS2307: Cannot find module 'foo'. tests/cases/compiler/systemModule16.ts(9,32): error TS2307: Cannot find module 'bar'. +tests/cases/compiler/systemModule16.ts(11,1): error TS2695: Left side of comma operator is unused and has no side effects. +tests/cases/compiler/systemModule16.ts(11,1): error TS2695: Left side of comma operator is unused and has no side effects. +tests/cases/compiler/systemModule16.ts(11,1): error TS2695: Left side of comma operator is unused and has no side effects. +tests/cases/compiler/systemModule16.ts(11,1): error TS2695: Left side of comma operator is unused and has no side effects. -==== tests/cases/compiler/systemModule16.ts (6 errors) ==== +==== tests/cases/compiler/systemModule16.ts (10 errors) ==== import * as x from "foo"; ~~~~~ @@ -30,4 +34,12 @@ tests/cases/compiler/systemModule16.ts(9,32): error TS2307: Cannot find module ' !!! error TS2307: Cannot find module 'bar'. x,y,a1,b1,d1; + ~ +!!! error TS2695: Left side of comma operator is unused and has no side effects. + ~~~ +!!! error TS2695: Left side of comma operator is unused and has no side effects. + ~~~~~~ +!!! error TS2695: Left side of comma operator is unused and has no side effects. + ~~~~~~~~~ +!!! error TS2695: Left side of comma operator is unused and has no side effects. \ No newline at end of file diff --git a/tests/baselines/reference/systemModule17.types b/tests/baselines/reference/systemModule17.types index 1f0b1b51842..c0a0a7dc584 100644 --- a/tests/baselines/reference/systemModule17.types +++ b/tests/baselines/reference/systemModule17.types @@ -11,7 +11,7 @@ export interface I {} var x = 1; >x : number ->1 : number +>1 : 1 interface I { } >I : I @@ -21,7 +21,7 @@ namespace N { export var x = 1; >x : number ->1 : number +>1 : 1 export interface I { } >I : I diff --git a/tests/baselines/reference/systemModule4.types b/tests/baselines/reference/systemModule4.types index 2029cdb88d7..8a871a987a7 100644 --- a/tests/baselines/reference/systemModule4.types +++ b/tests/baselines/reference/systemModule4.types @@ -2,7 +2,7 @@ export var x = 1; >x : number ->1 : number +>1 : 1 export var y; >y : any diff --git a/tests/baselines/reference/systemModule7.types b/tests/baselines/reference/systemModule7.types index 650e2d6cdb1..33003f5fa37 100644 --- a/tests/baselines/reference/systemModule7.types +++ b/tests/baselines/reference/systemModule7.types @@ -6,7 +6,7 @@ export module M { var x = 1; >x : number ->1 : number +>1 : 1 } // filename: nonInstantiatedModule.ts diff --git a/tests/baselines/reference/systemModule8.types b/tests/baselines/reference/systemModule8.types index 940067c5653..f31e77c346d 100644 --- a/tests/baselines/reference/systemModule8.types +++ b/tests/baselines/reference/systemModule8.types @@ -4,9 +4,9 @@ export var x; >x : any x = 1; ->x = 1 : number +>x = 1 : 1 >x : any ->1 : number +>1 : 1 x++; >x++ : number @@ -27,98 +27,98 @@ x--; x += 1; >x += 1 : any >x : any ->1 : number +>1 : 1 x -= 1; >x -= 1 : number >x : any ->1 : number +>1 : 1 x *= 1; >x *= 1 : number >x : any ->1 : number +>1 : 1 x /= 1; >x /= 1 : number >x : any ->1 : number +>1 : 1 x |= 1; >x |= 1 : number >x : any ->1 : number +>1 : 1 x &= 1; >x &= 1 : number >x : any ->1 : number +>1 : 1 x + 1; >x + 1 : any >x : any ->1 : number +>1 : 1 x - 1; >x - 1 : number >x : any ->1 : number +>1 : 1 x & 1; >x & 1 : number >x : any ->1 : number +>1 : 1 x | 1; >x | 1 : number >x : any ->1 : number +>1 : 1 for (x = 5;;x++) {} ->x = 5 : number +>x = 5 : 5 >x : any ->5 : number +>5 : 5 >x++ : number >x : any for (x = 8;;x--) {} ->x = 8 : number +>x = 8 : 8 >x : any ->8 : number +>8 : 8 >x-- : number >x : any for (x = 15;;++x) {} ->x = 15 : number +>x = 15 : 15 >x : any ->15 : number +>15 : 15 >++x : number >x : any for (x = 18;;--x) {} ->x = 18 : number +>x = 18 : 18 >x : any ->18 : number +>18 : 18 >--x : number >x : any for (let x = 50;;) {} >x : number ->50 : number +>50 : 50 function foo() { >foo : () => void x = 100; ->x = 100 : number +>x = 100 : 100 >x : any ->100 : number +>100 : 100 } export let [y] = [1]; >y : number >[1] : [number] ->1 : number +>1 : 1 export const {a: z0, b: {c: z1}} = {a: true, b: {c: "123"}}; >a : any @@ -128,16 +128,16 @@ export const {a: z0, b: {c: z1}} = {a: true, b: {c: "123"}}; >z1 : string >{a: true, b: {c: "123"}} : { a: boolean; b: { c: string; }; } >a : boolean ->true : boolean +>true : true >b : { c: string; } >{c: "123"} : { c: string; } >c : string ->"123" : string +>"123" : "123" for ([x] of [[1]]) {} >[x] : [any] >x : any >[[1]] : number[][] >[1] : number[] ->1 : number +>1 : 1 diff --git a/tests/baselines/reference/systemModuleAmbientDeclarations.types b/tests/baselines/reference/systemModuleAmbientDeclarations.types index 3633f922881..04c4f2d49df 100644 --- a/tests/baselines/reference/systemModuleAmbientDeclarations.types +++ b/tests/baselines/reference/systemModuleAmbientDeclarations.types @@ -12,7 +12,7 @@ declare class C {} declare enum E {X = 1}; >E : E >X : E ->1 : number +>1 : 1 export var promise = Promise; >promise : typeof Promise @@ -46,7 +46,7 @@ export declare var v: number; export declare enum E {X = 1} >E : E >X : E ->1 : number +>1 : 1 === tests/cases/compiler/file6.ts === export declare module M { var v: number; } diff --git a/tests/baselines/reference/systemModuleTargetES6.types b/tests/baselines/reference/systemModuleTargetES6.types index 5a9801a5d89..193507fca89 100644 --- a/tests/baselines/reference/systemModuleTargetES6.types +++ b/tests/baselines/reference/systemModuleTargetES6.types @@ -7,7 +7,7 @@ export class MyClass2 { static value = 42; >value : number ->42 : number +>42 : 42 static getInstance() { return MyClass2.value; } >getInstance : () => number diff --git a/tests/baselines/reference/taggedTemplateContextualTyping1.types b/tests/baselines/reference/taggedTemplateContextualTyping1.types index 2ccf8798dfd..4e207a0d6bb 100644 --- a/tests/baselines/reference/taggedTemplateContextualTyping1.types +++ b/tests/baselines/reference/taggedTemplateContextualTyping1.types @@ -48,7 +48,7 @@ function tempTag1(...rest: any[]): T { // and it is an error to invoke an any-typed value with type arguments, // so this test will error. tempTag1 `${ x => { x(undefined); return x; } }${ 10 }`; ->tempTag1 `${ x => { x(undefined); return x; } }${ 10 }` : number +>tempTag1 `${ x => { x(undefined); return x; } }${ 10 }` : 10 >tempTag1 : { (templateStrs: TemplateStringsArray, f: FuncType, x: T): T; (templateStrs: TemplateStringsArray, f: FuncType, h: FuncType, x: T): T; } >`${ x => { x(undefined); return x; } }${ 10 }` : string >x => { x(undefined); return x; } : (x: (p: T) => T) => (p: T) => T @@ -57,10 +57,10 @@ tempTag1 `${ x => { x(undefined); return x; } }${ 10 } >x : (p: T) => T >undefined : undefined >x : (p: T) => T ->10 : number +>10 : 10 tempTag1 `${ x => { x(undefined); return x; } }${ y => { y(undefined); return y; } }${ 10 }`; ->tempTag1 `${ x => { x(undefined); return x; } }${ y => { y(undefined); return y; } }${ 10 }` : number +>tempTag1 `${ x => { x(undefined); return x; } }${ y => { y(undefined); return y; } }${ 10 }` : 10 >tempTag1 : { (templateStrs: TemplateStringsArray, f: FuncType, x: T): T; (templateStrs: TemplateStringsArray, f: FuncType, h: FuncType, x: T): T; } >`${ x => { x(undefined); return x; } }${ y => { y(undefined); return y; } }${ 10 }` : string >x => { x(undefined); return x; } : (x: (p: T) => T) => (p: T) => T @@ -75,7 +75,7 @@ tempTag1 `${ x => { x(undefined); return x; } }${ y => >y : (p: T) => T >undefined : undefined >y : (p: T) => T ->10 : number +>10 : 10 tempTag1 `${ x => { x(undefined); return x; } }${ (y: (p: T) => T) => { y(undefined); return y } }${ undefined }`; >tempTag1 `${ x => { x(undefined); return x; } }${ (y: (p: T) => T) => { y(undefined); return y } }${ undefined }` : any diff --git a/tests/baselines/reference/taggedTemplateContextualTyping2.types b/tests/baselines/reference/taggedTemplateContextualTyping2.types index 02dcbd22753..2dbf2c53c8b 100644 --- a/tests/baselines/reference/taggedTemplateContextualTyping2.types +++ b/tests/baselines/reference/taggedTemplateContextualTyping2.types @@ -59,7 +59,7 @@ tempTag2 `${ x => { x(undefined); return x; } }${ 0 }`; >x : (p: T) => T >undefined : undefined >x : (p: T) => T ->0 : number +>0 : 0 tempTag2 `${ x => { x(undefined); return x; } }${ y => { y(null); return y; } }${ "hello" }`; >tempTag2 `${ x => { x(undefined); return x; } }${ y => { y(null); return y; } }${ "hello" }` : string @@ -77,7 +77,7 @@ tempTag2 `${ x => { x(undefined); return x; } }${ y => { yy : (p: T) => T >null : null >y : (p: T) => T ->"hello" : string +>"hello" : "hello" tempTag2 `${ x => { x(undefined); return x; } }${ undefined }${ "hello" }`; >tempTag2 `${ x => { x(undefined); return x; } }${ undefined }${ "hello" }` : string @@ -90,5 +90,5 @@ tempTag2 `${ x => { x(undefined); return x; } }${ undefined }${ >undefined : undefined >x : (p: T) => T >undefined : undefined ->"hello" : string +>"hello" : "hello" diff --git a/tests/baselines/reference/taggedTemplateStringsHexadecimalEscapes.types b/tests/baselines/reference/taggedTemplateStringsHexadecimalEscapes.types index 329ce9c3b21..e42bf52c005 100644 --- a/tests/baselines/reference/taggedTemplateStringsHexadecimalEscapes.types +++ b/tests/baselines/reference/taggedTemplateStringsHexadecimalEscapes.types @@ -8,5 +8,5 @@ f `\x0D${ "Interrupted CRLF" }\x0A`; >f `\x0D${ "Interrupted CRLF" }\x0A` : void >f : (...args: any[]) => void >`\x0D${ "Interrupted CRLF" }\x0A` : string ->"Interrupted CRLF" : string +>"Interrupted CRLF" : "Interrupted CRLF" diff --git a/tests/baselines/reference/taggedTemplateStringsHexadecimalEscapesES6.types b/tests/baselines/reference/taggedTemplateStringsHexadecimalEscapesES6.types index f350b6137a7..1b5fefe9c9e 100644 --- a/tests/baselines/reference/taggedTemplateStringsHexadecimalEscapesES6.types +++ b/tests/baselines/reference/taggedTemplateStringsHexadecimalEscapesES6.types @@ -8,5 +8,5 @@ f `\x0D${ "Interrupted CRLF" }\x0A`; >f `\x0D${ "Interrupted CRLF" }\x0A` : void >f : (...args: any[]) => void >`\x0D${ "Interrupted CRLF" }\x0A` : string ->"Interrupted CRLF" : string +>"Interrupted CRLF" : "Interrupted CRLF" diff --git a/tests/baselines/reference/taggedTemplateStringsPlainCharactersThatArePartsOfEscapes02.types b/tests/baselines/reference/taggedTemplateStringsPlainCharactersThatArePartsOfEscapes02.types index 9b02e0d3fb3..6619696bb39 100644 --- a/tests/baselines/reference/taggedTemplateStringsPlainCharactersThatArePartsOfEscapes02.types +++ b/tests/baselines/reference/taggedTemplateStringsPlainCharactersThatArePartsOfEscapes02.types @@ -3,33 +3,33 @@ `0${ " " }1${ " " }2${ " " }3${ " " }4${ " " }5${ " " }6${ " " }7${ " " }8${ " " }9${ " " }10${ " " }11${ " " }12${ " " }13${ " " }14${ " " }15${ " " }16${ " " }17${ " " }18${ " " }19${ " " }20${ " " }2028${ " " }2029${ " " }0085${ " " }t${ " " }v${ " " }f${ " " }b${ " " }r${ " " }n` >`0${ " " }1${ " " }2${ " " }3${ " " }4${ " " }5${ " " }6${ " " }7${ " " }8${ " " }9${ " " }10${ " " }11${ " " }12${ " " }13${ " " }14${ " " }15${ " " }16${ " " }17${ " " }18${ " " }19${ " " }20${ " " }2028${ " " }2029${ " " }0085${ " " }t${ " " }v${ " " }f${ " " }b${ " " }r${ " " }n` : string ->" " : string ->" " : string ->" " : string ->" " : string ->" " : string ->" " : string ->" " : string ->" " : string ->" " : string ->" " : string ->" " : string ->" " : string ->" " : string ->" " : string ->" " : string ->" " : string ->" " : string ->" " : string ->" " : string ->" " : string ->" " : string ->" " : string ->" " : string ->" " : string ->" " : string ->" " : string ->" " : string ->" " : string ->" " : string +>" " : " " +>" " : " " +>" " : " " +>" " : " " +>" " : " " +>" " : " " +>" " : " " +>" " : " " +>" " : " " +>" " : " " +>" " : " " +>" " : " " +>" " : " " +>" " : " " +>" " : " " +>" " : " " +>" " : " " +>" " : " " +>" " : " " +>" " : " " +>" " : " " +>" " : " " +>" " : " " +>" " : " " +>" " : " " +>" " : " " +>" " : " " +>" " : " " +>" " : " " diff --git a/tests/baselines/reference/taggedTemplateStringsPlainCharactersThatArePartsOfEscapes02_ES6.types b/tests/baselines/reference/taggedTemplateStringsPlainCharactersThatArePartsOfEscapes02_ES6.types index ed229126283..2fae6446989 100644 --- a/tests/baselines/reference/taggedTemplateStringsPlainCharactersThatArePartsOfEscapes02_ES6.types +++ b/tests/baselines/reference/taggedTemplateStringsPlainCharactersThatArePartsOfEscapes02_ES6.types @@ -10,33 +10,33 @@ f `0${ " " }1${ " " }2${ " " }3${ " " }4${ " " }5${ " " }6${ " " }7${ " " }8${ " >f `0${ " " }1${ " " }2${ " " }3${ " " }4${ " " }5${ " " }6${ " " }7${ " " }8${ " " }9${ " " }10${ " " }11${ " " }12${ " " }13${ " " }14${ " " }15${ " " }16${ " " }17${ " " }18${ " " }19${ " " }20${ " " }2028${ " " }2029${ " " }0085${ " " }t${ " " }v${ " " }f${ " " }b${ " " }r${ " " }n` : void >f : (...x: any[]) => void >`0${ " " }1${ " " }2${ " " }3${ " " }4${ " " }5${ " " }6${ " " }7${ " " }8${ " " }9${ " " }10${ " " }11${ " " }12${ " " }13${ " " }14${ " " }15${ " " }16${ " " }17${ " " }18${ " " }19${ " " }20${ " " }2028${ " " }2029${ " " }0085${ " " }t${ " " }v${ " " }f${ " " }b${ " " }r${ " " }n` : string ->" " : string ->" " : string ->" " : string ->" " : string ->" " : string ->" " : string ->" " : string ->" " : string ->" " : string ->" " : string ->" " : string ->" " : string ->" " : string ->" " : string ->" " : string ->" " : string ->" " : string ->" " : string ->" " : string ->" " : string ->" " : string ->" " : string ->" " : string ->" " : string ->" " : string ->" " : string ->" " : string ->" " : string ->" " : string +>" " : " " +>" " : " " +>" " : " " +>" " : " " +>" " : " " +>" " : " " +>" " : " " +>" " : " " +>" " : " " +>" " : " " +>" " : " " +>" " : " " +>" " : " " +>" " : " " +>" " : " " +>" " : " " +>" " : " " +>" " : " " +>" " : " " +>" " : " " +>" " : " " +>" " : " " +>" " : " " +>" " : " " +>" " : " " +>" " : " " +>" " : " " +>" " : " " +>" " : " " diff --git a/tests/baselines/reference/taggedTemplateStringsTypeArgumentInference.errors.txt b/tests/baselines/reference/taggedTemplateStringsTypeArgumentInference.errors.txt index b345e971ab2..2ead58862b6 100644 --- a/tests/baselines/reference/taggedTemplateStringsTypeArgumentInference.errors.txt +++ b/tests/baselines/reference/taggedTemplateStringsTypeArgumentInference.errors.txt @@ -1,5 +1,5 @@ tests/cases/conformance/es6/templates/taggedTemplateStringsTypeArgumentInference.ts(64,11): error TS2453: The type argument for type parameter 'T' cannot be inferred from the usage. Consider specifying the type arguments explicitly. - Type argument candidate 'string' is not a valid type argument because it is not a supertype of candidate 'number'. + Type argument candidate '""' is not a valid type argument because it is not a supertype of candidate '0'. tests/cases/conformance/es6/templates/taggedTemplateStringsTypeArgumentInference.ts(77,79): error TS2453: The type argument for type parameter 'T' cannot be inferred from the usage. Consider specifying the type arguments explicitly. Type argument candidate '{ x: number; z: Date; }' is not a valid type argument because it is not a supertype of candidate '{ x: number; y: string; }'. Object literal may only specify known properties, and 'y' does not exist in type '{ x: number; z: Date; }'. @@ -72,7 +72,7 @@ tests/cases/conformance/es6/templates/taggedTemplateStringsTypeArgumentInference var a9a = someGenerics9 `${ '' }${ 0 }${ [] }`; ~~~~~~~~~~~~~ !!! error TS2453: The type argument for type parameter 'T' cannot be inferred from the usage. Consider specifying the type arguments explicitly. -!!! error TS2453: Type argument candidate 'string' is not a valid type argument because it is not a supertype of candidate 'number'. +!!! error TS2453: Type argument candidate '""' is not a valid type argument because it is not a supertype of candidate '0'. var a9a: {}; // Generic tag with multiple parameters of generic type passed arguments with multiple best common types diff --git a/tests/baselines/reference/taggedTemplateStringsTypeArgumentInferenceES6.errors.txt b/tests/baselines/reference/taggedTemplateStringsTypeArgumentInferenceES6.errors.txt index 619e5081a3b..781456b8bbb 100644 --- a/tests/baselines/reference/taggedTemplateStringsTypeArgumentInferenceES6.errors.txt +++ b/tests/baselines/reference/taggedTemplateStringsTypeArgumentInferenceES6.errors.txt @@ -1,5 +1,5 @@ tests/cases/conformance/es6/templates/taggedTemplateStringsTypeArgumentInferenceES6.ts(63,11): error TS2453: The type argument for type parameter 'T' cannot be inferred from the usage. Consider specifying the type arguments explicitly. - Type argument candidate 'string' is not a valid type argument because it is not a supertype of candidate 'number'. + Type argument candidate '""' is not a valid type argument because it is not a supertype of candidate '0'. tests/cases/conformance/es6/templates/taggedTemplateStringsTypeArgumentInferenceES6.ts(76,79): error TS2453: The type argument for type parameter 'T' cannot be inferred from the usage. Consider specifying the type arguments explicitly. Type argument candidate '{ x: number; z: Date; }' is not a valid type argument because it is not a supertype of candidate '{ x: number; y: string; }'. Object literal may only specify known properties, and 'y' does not exist in type '{ x: number; z: Date; }'. @@ -71,7 +71,7 @@ tests/cases/conformance/es6/templates/taggedTemplateStringsTypeArgumentInference var a9a = someGenerics9 `${ '' }${ 0 }${ [] }`; ~~~~~~~~~~~~~ !!! error TS2453: The type argument for type parameter 'T' cannot be inferred from the usage. Consider specifying the type arguments explicitly. -!!! error TS2453: Type argument candidate 'string' is not a valid type argument because it is not a supertype of candidate 'number'. +!!! error TS2453: Type argument candidate '""' is not a valid type argument because it is not a supertype of candidate '0'. var a9a: {}; // Generic tag with multiple parameters of generic type passed arguments with multiple best common types diff --git a/tests/baselines/reference/taggedTemplateStringsWithIncompatibleTypedTags.errors.txt b/tests/baselines/reference/taggedTemplateStringsWithIncompatibleTypedTags.errors.txt index 44b30fb535f..06343389868 100644 --- a/tests/baselines/reference/taggedTemplateStringsWithIncompatibleTypedTags.errors.txt +++ b/tests/baselines/reference/taggedTemplateStringsWithIncompatibleTypedTags.errors.txt @@ -1,9 +1,9 @@ -tests/cases/conformance/es6/templates/taggedTemplateStringsWithIncompatibleTypedTags.ts(14,9): error TS2345: Argument of type 'number' is not assignable to parameter of type 'boolean'. -tests/cases/conformance/es6/templates/taggedTemplateStringsWithIncompatibleTypedTags.ts(18,9): error TS2345: Argument of type 'number' is not assignable to parameter of type 'boolean'. -tests/cases/conformance/es6/templates/taggedTemplateStringsWithIncompatibleTypedTags.ts(22,9): error TS2345: Argument of type 'number' is not assignable to parameter of type 'boolean'. -tests/cases/conformance/es6/templates/taggedTemplateStringsWithIncompatibleTypedTags.ts(24,25): error TS2345: Argument of type 'number' is not assignable to parameter of type 'boolean'. -tests/cases/conformance/es6/templates/taggedTemplateStringsWithIncompatibleTypedTags.ts(26,9): error TS2345: Argument of type 'number' is not assignable to parameter of type 'boolean'. -tests/cases/conformance/es6/templates/taggedTemplateStringsWithIncompatibleTypedTags.ts(28,57): error TS2345: Argument of type 'number' is not assignable to parameter of type 'boolean'. +tests/cases/conformance/es6/templates/taggedTemplateStringsWithIncompatibleTypedTags.ts(14,9): error TS2345: Argument of type '1' is not assignable to parameter of type 'boolean'. +tests/cases/conformance/es6/templates/taggedTemplateStringsWithIncompatibleTypedTags.ts(18,9): error TS2345: Argument of type '1' is not assignable to parameter of type 'boolean'. +tests/cases/conformance/es6/templates/taggedTemplateStringsWithIncompatibleTypedTags.ts(22,9): error TS2345: Argument of type '1' is not assignable to parameter of type 'boolean'. +tests/cases/conformance/es6/templates/taggedTemplateStringsWithIncompatibleTypedTags.ts(24,25): error TS2345: Argument of type '1' is not assignable to parameter of type 'boolean'. +tests/cases/conformance/es6/templates/taggedTemplateStringsWithIncompatibleTypedTags.ts(26,9): error TS2345: Argument of type '1' is not assignable to parameter of type 'boolean'. +tests/cases/conformance/es6/templates/taggedTemplateStringsWithIncompatibleTypedTags.ts(28,57): error TS2345: Argument of type '1' is not assignable to parameter of type 'boolean'. ==== tests/cases/conformance/es6/templates/taggedTemplateStringsWithIncompatibleTypedTags.ts (6 errors) ==== @@ -22,31 +22,31 @@ tests/cases/conformance/es6/templates/taggedTemplateStringsWithIncompatibleTyped f `abc${1}def${2}ghi`; ~ -!!! error TS2345: Argument of type 'number' is not assignable to parameter of type 'boolean'. +!!! error TS2345: Argument of type '1' is not assignable to parameter of type 'boolean'. f `abc`.member f `abc${1}def${2}ghi`.member; ~ -!!! error TS2345: Argument of type 'number' is not assignable to parameter of type 'boolean'. +!!! error TS2345: Argument of type '1' is not assignable to parameter of type 'boolean'. f `abc`["member"]; f `abc${1}def${2}ghi`["member"]; ~ -!!! error TS2345: Argument of type 'number' is not assignable to parameter of type 'boolean'. +!!! error TS2345: Argument of type '1' is not assignable to parameter of type 'boolean'. f `abc`[0].member `abc${1}def${2}ghi`; ~ -!!! error TS2345: Argument of type 'number' is not assignable to parameter of type 'boolean'. +!!! error TS2345: Argument of type '1' is not assignable to parameter of type 'boolean'. f `abc${1}def${2}ghi`["member"].member `abc${1}def${2}ghi`; ~ -!!! error TS2345: Argument of type 'number' is not assignable to parameter of type 'boolean'. +!!! error TS2345: Argument of type '1' is not assignable to parameter of type 'boolean'. f `abc${ true }def${ true }ghi`["member"].member `abc${ 1 }def${ 2 }ghi`; ~ -!!! error TS2345: Argument of type 'number' is not assignable to parameter of type 'boolean'. +!!! error TS2345: Argument of type '1' is not assignable to parameter of type 'boolean'. f.thisIsNotATag(`abc`); diff --git a/tests/baselines/reference/taggedTemplateStringsWithIncompatibleTypedTagsES6.errors.txt b/tests/baselines/reference/taggedTemplateStringsWithIncompatibleTypedTagsES6.errors.txt index c2825c19e63..9d1ee541e4f 100644 --- a/tests/baselines/reference/taggedTemplateStringsWithIncompatibleTypedTagsES6.errors.txt +++ b/tests/baselines/reference/taggedTemplateStringsWithIncompatibleTypedTagsES6.errors.txt @@ -1,9 +1,9 @@ -tests/cases/conformance/es6/templates/taggedTemplateStringsWithIncompatibleTypedTagsES6.ts(14,9): error TS2345: Argument of type 'number' is not assignable to parameter of type 'boolean'. -tests/cases/conformance/es6/templates/taggedTemplateStringsWithIncompatibleTypedTagsES6.ts(18,9): error TS2345: Argument of type 'number' is not assignable to parameter of type 'boolean'. -tests/cases/conformance/es6/templates/taggedTemplateStringsWithIncompatibleTypedTagsES6.ts(22,9): error TS2345: Argument of type 'number' is not assignable to parameter of type 'boolean'. -tests/cases/conformance/es6/templates/taggedTemplateStringsWithIncompatibleTypedTagsES6.ts(24,25): error TS2345: Argument of type 'number' is not assignable to parameter of type 'boolean'. -tests/cases/conformance/es6/templates/taggedTemplateStringsWithIncompatibleTypedTagsES6.ts(26,9): error TS2345: Argument of type 'number' is not assignable to parameter of type 'boolean'. -tests/cases/conformance/es6/templates/taggedTemplateStringsWithIncompatibleTypedTagsES6.ts(28,57): error TS2345: Argument of type 'number' is not assignable to parameter of type 'boolean'. +tests/cases/conformance/es6/templates/taggedTemplateStringsWithIncompatibleTypedTagsES6.ts(14,9): error TS2345: Argument of type '1' is not assignable to parameter of type 'boolean'. +tests/cases/conformance/es6/templates/taggedTemplateStringsWithIncompatibleTypedTagsES6.ts(18,9): error TS2345: Argument of type '1' is not assignable to parameter of type 'boolean'. +tests/cases/conformance/es6/templates/taggedTemplateStringsWithIncompatibleTypedTagsES6.ts(22,9): error TS2345: Argument of type '1' is not assignable to parameter of type 'boolean'. +tests/cases/conformance/es6/templates/taggedTemplateStringsWithIncompatibleTypedTagsES6.ts(24,25): error TS2345: Argument of type '1' is not assignable to parameter of type 'boolean'. +tests/cases/conformance/es6/templates/taggedTemplateStringsWithIncompatibleTypedTagsES6.ts(26,9): error TS2345: Argument of type '1' is not assignable to parameter of type 'boolean'. +tests/cases/conformance/es6/templates/taggedTemplateStringsWithIncompatibleTypedTagsES6.ts(28,57): error TS2345: Argument of type '1' is not assignable to parameter of type 'boolean'. ==== tests/cases/conformance/es6/templates/taggedTemplateStringsWithIncompatibleTypedTagsES6.ts (6 errors) ==== @@ -22,31 +22,31 @@ tests/cases/conformance/es6/templates/taggedTemplateStringsWithIncompatibleTyped f `abc${1}def${2}ghi`; ~ -!!! error TS2345: Argument of type 'number' is not assignable to parameter of type 'boolean'. +!!! error TS2345: Argument of type '1' is not assignable to parameter of type 'boolean'. f `abc`.member f `abc${1}def${2}ghi`.member; ~ -!!! error TS2345: Argument of type 'number' is not assignable to parameter of type 'boolean'. +!!! error TS2345: Argument of type '1' is not assignable to parameter of type 'boolean'. f `abc`["member"]; f `abc${1}def${2}ghi`["member"]; ~ -!!! error TS2345: Argument of type 'number' is not assignable to parameter of type 'boolean'. +!!! error TS2345: Argument of type '1' is not assignable to parameter of type 'boolean'. f `abc`[0].member `abc${1}def${2}ghi`; ~ -!!! error TS2345: Argument of type 'number' is not assignable to parameter of type 'boolean'. +!!! error TS2345: Argument of type '1' is not assignable to parameter of type 'boolean'. f `abc${1}def${2}ghi`["member"].member `abc${1}def${2}ghi`; ~ -!!! error TS2345: Argument of type 'number' is not assignable to parameter of type 'boolean'. +!!! error TS2345: Argument of type '1' is not assignable to parameter of type 'boolean'. f `abc${ true }def${ true }ghi`["member"].member `abc${ 1 }def${ 2 }ghi`; ~ -!!! error TS2345: Argument of type 'number' is not assignable to parameter of type 'boolean'. +!!! error TS2345: Argument of type '1' is not assignable to parameter of type 'boolean'. f.thisIsNotATag(`abc`); diff --git a/tests/baselines/reference/taggedTemplateStringsWithManyCallAndMemberExpressions.types b/tests/baselines/reference/taggedTemplateStringsWithManyCallAndMemberExpressions.types index 34d9e71dcab..f10c493dbd9 100644 --- a/tests/baselines/reference/taggedTemplateStringsWithManyCallAndMemberExpressions.types +++ b/tests/baselines/reference/taggedTemplateStringsWithManyCallAndMemberExpressions.types @@ -36,10 +36,10 @@ var x = new new new f `abc${ 0 }def`.member("hello")(42) === true; >f `abc${ 0 }def` : I >f : I >`abc${ 0 }def` : string ->0 : number +>0 : 0 >member : new (s: string) => new (n: number) => new () => boolean ->"hello" : string ->42 : number +>"hello" : "hello" +>42 : 42 >true : true diff --git a/tests/baselines/reference/taggedTemplateStringsWithManyCallAndMemberExpressionsES6.types b/tests/baselines/reference/taggedTemplateStringsWithManyCallAndMemberExpressionsES6.types index b57b1ba40aa..23923ab7180 100644 --- a/tests/baselines/reference/taggedTemplateStringsWithManyCallAndMemberExpressionsES6.types +++ b/tests/baselines/reference/taggedTemplateStringsWithManyCallAndMemberExpressionsES6.types @@ -36,10 +36,10 @@ var x = new new new f `abc${ 0 }def`.member("hello")(42) === true; >f `abc${ 0 }def` : I >f : I >`abc${ 0 }def` : string ->0 : number +>0 : 0 >member : new (s: string) => new (n: number) => new () => boolean ->"hello" : string ->42 : number +>"hello" : "hello" +>42 : 42 >true : true diff --git a/tests/baselines/reference/taggedTemplateStringsWithOverloadResolution1.errors.txt b/tests/baselines/reference/taggedTemplateStringsWithOverloadResolution1.errors.txt index 426eef8ce7f..e9c9e0ed6e0 100644 --- a/tests/baselines/reference/taggedTemplateStringsWithOverloadResolution1.errors.txt +++ b/tests/baselines/reference/taggedTemplateStringsWithOverloadResolution1.errors.txt @@ -5,7 +5,7 @@ tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolutio tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution1.ts(12,13): error TS2345: Argument of type 'undefined[]' is not assignable to parameter of type 'TemplateStringsArray'. tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution1.ts(13,13): error TS2345: Argument of type 'undefined[]' is not assignable to parameter of type 'TemplateStringsArray'. tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution1.ts(14,9): error TS2346: Supplied parameters do not match any signature of call target. -tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution1.ts(19,20): error TS2345: Argument of type 'boolean' is not assignable to parameter of type 'string'. +tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution1.ts(19,20): error TS2345: Argument of type 'true' is not assignable to parameter of type 'string'. tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution1.ts(21,9): error TS2346: Supplied parameters do not match any signature of call target. @@ -43,7 +43,7 @@ tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolutio var w = foo `${1}${2}`; // boolean var x = foo `${1}${true}`; // boolean (with error) ~~~~ -!!! error TS2345: Argument of type 'boolean' is not assignable to parameter of type 'string'. +!!! error TS2345: Argument of type 'true' is not assignable to parameter of type 'string'. var y = foo `${1}${"2"}`; // {} var z = foo `${1}${2}${3}`; // any (with error) ~~~~~~~~~~~~~~~~~~ diff --git a/tests/baselines/reference/taggedTemplateStringsWithOverloadResolution1_ES6.errors.txt b/tests/baselines/reference/taggedTemplateStringsWithOverloadResolution1_ES6.errors.txt index 73adc0c0302..d7817e32ee0 100644 --- a/tests/baselines/reference/taggedTemplateStringsWithOverloadResolution1_ES6.errors.txt +++ b/tests/baselines/reference/taggedTemplateStringsWithOverloadResolution1_ES6.errors.txt @@ -5,7 +5,7 @@ tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolutio tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution1_ES6.ts(12,13): error TS2345: Argument of type 'undefined[]' is not assignable to parameter of type 'TemplateStringsArray'. tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution1_ES6.ts(13,13): error TS2345: Argument of type 'undefined[]' is not assignable to parameter of type 'TemplateStringsArray'. tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution1_ES6.ts(14,9): error TS2346: Supplied parameters do not match any signature of call target. -tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution1_ES6.ts(19,20): error TS2345: Argument of type 'boolean' is not assignable to parameter of type 'string'. +tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution1_ES6.ts(19,20): error TS2345: Argument of type 'true' is not assignable to parameter of type 'string'. tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution1_ES6.ts(21,9): error TS2346: Supplied parameters do not match any signature of call target. @@ -43,7 +43,7 @@ tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolutio var w = foo `${1}${2}`; // boolean var x = foo `${1}${true}`; // boolean (with error) ~~~~ -!!! error TS2345: Argument of type 'boolean' is not assignable to parameter of type 'string'. +!!! error TS2345: Argument of type 'true' is not assignable to parameter of type 'string'. var y = foo `${1}${"2"}`; // {} var z = foo `${1}${2}${3}`; // any (with error) ~~~~~~~~~~~~~~~~~~ diff --git a/tests/baselines/reference/taggedTemplateStringsWithOverloadResolution2.types b/tests/baselines/reference/taggedTemplateStringsWithOverloadResolution2.types index 3c35974ddec..38b2087ccbf 100644 --- a/tests/baselines/reference/taggedTemplateStringsWithOverloadResolution2.types +++ b/tests/baselines/reference/taggedTemplateStringsWithOverloadResolution2.types @@ -24,14 +24,14 @@ var a = foo1 `${1}`; >foo1 `${1}` : string >foo1 : { (strs: TemplateStringsArray, x: number): string; (strs: string[], x: number): number; } >`${1}` : string ->1 : number +>1 : 1 var b = foo1([], 1); >b : number >foo1([], 1) : number >foo1 : { (strs: TemplateStringsArray, x: number): string; (strs: string[], x: number): number; } >[] : undefined[] ->1 : number +>1 : 1 function foo2(strs: string[], x: number): number; >foo2 : { (strs: string[], x: number): number; (strs: TemplateStringsArray, x: number): string; } @@ -57,12 +57,12 @@ var c = foo2 `${1}`; >foo2 `${1}` : string >foo2 : { (strs: string[], x: number): number; (strs: TemplateStringsArray, x: number): string; } >`${1}` : string ->1 : number +>1 : 1 var d = foo2([], 1); >d : number >foo2([], 1) : number >foo2 : { (strs: string[], x: number): number; (strs: TemplateStringsArray, x: number): string; } >[] : undefined[] ->1 : number +>1 : 1 diff --git a/tests/baselines/reference/taggedTemplateStringsWithOverloadResolution2_ES6.types b/tests/baselines/reference/taggedTemplateStringsWithOverloadResolution2_ES6.types index 7faeec19c4a..41caabef752 100644 --- a/tests/baselines/reference/taggedTemplateStringsWithOverloadResolution2_ES6.types +++ b/tests/baselines/reference/taggedTemplateStringsWithOverloadResolution2_ES6.types @@ -23,14 +23,14 @@ var a = foo1 `${1}`; >foo1 `${1}` : string >foo1 : { (strs: TemplateStringsArray, x: number): string; (strs: string[], x: number): number; } >`${1}` : string ->1 : number +>1 : 1 var b = foo1([], 1); >b : number >foo1([], 1) : number >foo1 : { (strs: TemplateStringsArray, x: number): string; (strs: string[], x: number): number; } >[] : undefined[] ->1 : number +>1 : 1 function foo2(strs: string[], x: number): number; >foo2 : { (strs: string[], x: number): number; (strs: TemplateStringsArray, x: number): string; } @@ -56,12 +56,12 @@ var c = foo2 `${1}`; >foo2 `${1}` : string >foo2 : { (strs: string[], x: number): number; (strs: TemplateStringsArray, x: number): string; } >`${1}` : string ->1 : number +>1 : 1 var d = foo2([], 1); >d : number >foo2([], 1) : number >foo2 : { (strs: string[], x: number): number; (strs: TemplateStringsArray, x: number): string; } >[] : undefined[] ->1 : number +>1 : 1 diff --git a/tests/baselines/reference/taggedTemplateStringsWithOverloadResolution3.errors.txt b/tests/baselines/reference/taggedTemplateStringsWithOverloadResolution3.errors.txt index 0d65c3fd13b..2248fee5ceb 100644 --- a/tests/baselines/reference/taggedTemplateStringsWithOverloadResolution3.errors.txt +++ b/tests/baselines/reference/taggedTemplateStringsWithOverloadResolution3.errors.txt @@ -1,8 +1,8 @@ tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution3.ts(10,9): error TS2345: Argument of type '{}' is not assignable to parameter of type 'number'. tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution3.ts(19,4): error TS2339: Property 'foo' does not exist on type 'Date'. tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution3.ts(45,1): error TS2346: Supplied parameters do not match any signature of call target. -tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution3.ts(63,9): error TS2345: Argument of type 'boolean' is not assignable to parameter of type 'number'. -tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution3.ts(64,18): error TS2345: Argument of type 'boolean' is not assignable to parameter of type 'string'. +tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution3.ts(63,9): error TS2345: Argument of type 'true' is not assignable to parameter of type 'number'. +tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution3.ts(64,18): error TS2345: Argument of type 'true' is not assignable to parameter of type 'string'. tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution3.ts(70,18): error TS2339: Property 'toFixed' does not exist on type 'string'. @@ -77,10 +77,10 @@ tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolutio // Generic overloads with constraints called without type arguments but with types that do not satisfy the constraints fn4 `${ true }${ null }`; ~~~~ -!!! error TS2345: Argument of type 'boolean' is not assignable to parameter of type 'number'. +!!! error TS2345: Argument of type 'true' is not assignable to parameter of type 'number'. fn4 `${ null }${ true }`; ~~~~ -!!! error TS2345: Argument of type 'boolean' is not assignable to parameter of type 'string'. +!!! error TS2345: Argument of type 'true' is not assignable to parameter of type 'string'. // Non - generic overloads where contextual typing of function arguments has errors function fn5(strs: TemplateStringsArray, f: (n: string) => void): string; diff --git a/tests/baselines/reference/taggedTemplateStringsWithOverloadResolution3_ES6.errors.txt b/tests/baselines/reference/taggedTemplateStringsWithOverloadResolution3_ES6.errors.txt index e65acdee835..7329ade1b64 100644 --- a/tests/baselines/reference/taggedTemplateStringsWithOverloadResolution3_ES6.errors.txt +++ b/tests/baselines/reference/taggedTemplateStringsWithOverloadResolution3_ES6.errors.txt @@ -1,8 +1,8 @@ tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution3_ES6.ts(9,9): error TS2345: Argument of type '{}' is not assignable to parameter of type 'number'. tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution3_ES6.ts(18,4): error TS2339: Property 'foo' does not exist on type 'Date'. tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution3_ES6.ts(44,1): error TS2346: Supplied parameters do not match any signature of call target. -tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution3_ES6.ts(62,9): error TS2345: Argument of type 'boolean' is not assignable to parameter of type 'number'. -tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution3_ES6.ts(63,18): error TS2345: Argument of type 'boolean' is not assignable to parameter of type 'string'. +tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution3_ES6.ts(62,9): error TS2345: Argument of type 'true' is not assignable to parameter of type 'number'. +tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution3_ES6.ts(63,18): error TS2345: Argument of type 'true' is not assignable to parameter of type 'string'. tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution3_ES6.ts(69,18): error TS2339: Property 'toFixed' does not exist on type 'string'. @@ -76,10 +76,10 @@ tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolutio // Generic overloads with constraints called without type arguments but with types that do not satisfy the constraints fn4 `${ true }${ null }`; ~~~~ -!!! error TS2345: Argument of type 'boolean' is not assignable to parameter of type 'number'. +!!! error TS2345: Argument of type 'true' is not assignable to parameter of type 'number'. fn4 `${ null }${ true }`; ~~~~ -!!! error TS2345: Argument of type 'boolean' is not assignable to parameter of type 'string'. +!!! error TS2345: Argument of type 'true' is not assignable to parameter of type 'string'. // Non - generic overloads where contextual typing of function arguments has errors function fn5(strs: TemplateStringsArray, f: (n: string) => void): string; diff --git a/tests/baselines/reference/taggedTemplateStringsWithTagNamedDeclare.types b/tests/baselines/reference/taggedTemplateStringsWithTagNamedDeclare.types index d1f56f387d6..b0accf616af 100644 --- a/tests/baselines/reference/taggedTemplateStringsWithTagNamedDeclare.types +++ b/tests/baselines/reference/taggedTemplateStringsWithTagNamedDeclare.types @@ -11,5 +11,5 @@ declare `Hello ${0} world!`; >declare `Hello ${0} world!` : void >declare : (x: any, ...ys: any[]) => void >`Hello ${0} world!` : string ->0 : number +>0 : 0 diff --git a/tests/baselines/reference/taggedTemplateStringsWithTagNamedDeclareES6.types b/tests/baselines/reference/taggedTemplateStringsWithTagNamedDeclareES6.types index e2274f82ff7..6e474bf3474 100644 --- a/tests/baselines/reference/taggedTemplateStringsWithTagNamedDeclareES6.types +++ b/tests/baselines/reference/taggedTemplateStringsWithTagNamedDeclareES6.types @@ -10,5 +10,5 @@ declare `Hello ${0} world!`; >declare `Hello ${0} world!` : void >declare : (x: any, ...ys: any[]) => void >`Hello ${0} world!` : string ->0 : number +>0 : 0 diff --git a/tests/baselines/reference/taggedTemplateStringsWithTagsTypedAsAny.types b/tests/baselines/reference/taggedTemplateStringsWithTagsTypedAsAny.types index 0db2a3bb963..9e894240c93 100644 --- a/tests/baselines/reference/taggedTemplateStringsWithTagsTypedAsAny.types +++ b/tests/baselines/reference/taggedTemplateStringsWithTagsTypedAsAny.types @@ -11,8 +11,8 @@ f `abc${1}def${2}ghi`; >f `abc${1}def${2}ghi` : any >f : any >`abc${1}def${2}ghi` : string ->1 : number ->2 : number +>1 : 1 +>2 : 2 f.g.h `abc` >f.g.h `abc` : any @@ -31,8 +31,8 @@ f.g.h `abc${1}def${2}ghi`; >g : any >h : any >`abc${1}def${2}ghi` : string ->1 : number ->2 : number +>1 : 1 +>2 : 2 f `abc`.member >f `abc`.member : any @@ -46,8 +46,8 @@ f `abc${1}def${2}ghi`.member; >f `abc${1}def${2}ghi` : any >f : any >`abc${1}def${2}ghi` : string ->1 : number ->2 : number +>1 : 1 +>2 : 2 >member : any f `abc`["member"]; @@ -55,16 +55,16 @@ f `abc`["member"]; >f `abc` : any >f : any >`abc` : string ->"member" : string +>"member" : "member" f `abc${1}def${2}ghi`["member"]; >f `abc${1}def${2}ghi`["member"] : any >f `abc${1}def${2}ghi` : any >f : any >`abc${1}def${2}ghi` : string ->1 : number ->2 : number ->"member" : string +>1 : 1 +>2 : 2 +>"member" : "member" f `abc`["member"].someOtherTag `abc${1}def${2}ghi`; >f `abc`["member"].someOtherTag `abc${1}def${2}ghi` : any @@ -73,11 +73,11 @@ f `abc`["member"].someOtherTag `abc${1}def${2}ghi`; >f `abc` : any >f : any >`abc` : string ->"member" : string +>"member" : "member" >someOtherTag : any >`abc${1}def${2}ghi` : string ->1 : number ->2 : number +>1 : 1 +>2 : 2 f `abc${1}def${2}ghi`["member"].someOtherTag `abc${1}def${2}ghi`; >f `abc${1}def${2}ghi`["member"].someOtherTag `abc${1}def${2}ghi` : any @@ -86,13 +86,13 @@ f `abc${1}def${2}ghi`["member"].someOtherTag `abc${1}def${2}ghi`; >f `abc${1}def${2}ghi` : any >f : any >`abc${1}def${2}ghi` : string ->1 : number ->2 : number ->"member" : string +>1 : 1 +>2 : 2 +>"member" : "member" >someOtherTag : any >`abc${1}def${2}ghi` : string ->1 : number ->2 : number +>1 : 1 +>2 : 2 f.thisIsNotATag(`abc`); >f.thisIsNotATag(`abc`) : any @@ -107,6 +107,6 @@ f.thisIsNotATag(`abc${1}def${2}ghi`); >f : any >thisIsNotATag : any >`abc${1}def${2}ghi` : string ->1 : number ->2 : number +>1 : 1 +>2 : 2 diff --git a/tests/baselines/reference/taggedTemplateStringsWithTagsTypedAsAnyES6.types b/tests/baselines/reference/taggedTemplateStringsWithTagsTypedAsAnyES6.types index 1a6ffb5eba0..99bb10f3546 100644 --- a/tests/baselines/reference/taggedTemplateStringsWithTagsTypedAsAnyES6.types +++ b/tests/baselines/reference/taggedTemplateStringsWithTagsTypedAsAnyES6.types @@ -11,8 +11,8 @@ f `abc${1}def${2}ghi`; >f `abc${1}def${2}ghi` : any >f : any >`abc${1}def${2}ghi` : string ->1 : number ->2 : number +>1 : 1 +>2 : 2 f.g.h `abc` >f.g.h `abc` : any @@ -31,8 +31,8 @@ f.g.h `abc${1}def${2}ghi`; >g : any >h : any >`abc${1}def${2}ghi` : string ->1 : number ->2 : number +>1 : 1 +>2 : 2 f `abc`.member >f `abc`.member : any @@ -46,8 +46,8 @@ f `abc${1}def${2}ghi`.member; >f `abc${1}def${2}ghi` : any >f : any >`abc${1}def${2}ghi` : string ->1 : number ->2 : number +>1 : 1 +>2 : 2 >member : any f `abc`["member"]; @@ -55,16 +55,16 @@ f `abc`["member"]; >f `abc` : any >f : any >`abc` : string ->"member" : string +>"member" : "member" f `abc${1}def${2}ghi`["member"]; >f `abc${1}def${2}ghi`["member"] : any >f `abc${1}def${2}ghi` : any >f : any >`abc${1}def${2}ghi` : string ->1 : number ->2 : number ->"member" : string +>1 : 1 +>2 : 2 +>"member" : "member" f `abc`["member"].someOtherTag `abc${1}def${2}ghi`; >f `abc`["member"].someOtherTag `abc${1}def${2}ghi` : any @@ -73,11 +73,11 @@ f `abc`["member"].someOtherTag `abc${1}def${2}ghi`; >f `abc` : any >f : any >`abc` : string ->"member" : string +>"member" : "member" >someOtherTag : any >`abc${1}def${2}ghi` : string ->1 : number ->2 : number +>1 : 1 +>2 : 2 f `abc${1}def${2}ghi`["member"].someOtherTag `abc${1}def${2}ghi`; >f `abc${1}def${2}ghi`["member"].someOtherTag `abc${1}def${2}ghi` : any @@ -86,13 +86,13 @@ f `abc${1}def${2}ghi`["member"].someOtherTag `abc${1}def${2}ghi`; >f `abc${1}def${2}ghi` : any >f : any >`abc${1}def${2}ghi` : string ->1 : number ->2 : number ->"member" : string +>1 : 1 +>2 : 2 +>"member" : "member" >someOtherTag : any >`abc${1}def${2}ghi` : string ->1 : number ->2 : number +>1 : 1 +>2 : 2 f.thisIsNotATag(`abc`); >f.thisIsNotATag(`abc`) : any @@ -107,6 +107,6 @@ f.thisIsNotATag(`abc${1}def${2}ghi`); >f : any >thisIsNotATag : any >`abc${1}def${2}ghi` : string ->1 : number ->2 : number +>1 : 1 +>2 : 2 diff --git a/tests/baselines/reference/taggedTemplateStringsWithTypeErrorInFunctionExpressionsInSubstitutionExpression.errors.txt b/tests/baselines/reference/taggedTemplateStringsWithTypeErrorInFunctionExpressionsInSubstitutionExpression.errors.txt index 88bfac23211..6da8d2ffce3 100644 --- a/tests/baselines/reference/taggedTemplateStringsWithTypeErrorInFunctionExpressionsInSubstitutionExpression.errors.txt +++ b/tests/baselines/reference/taggedTemplateStringsWithTypeErrorInFunctionExpressionsInSubstitutionExpression.errors.txt @@ -1,4 +1,4 @@ -tests/cases/conformance/es6/templates/taggedTemplateStringsWithTypeErrorInFunctionExpressionsInSubstitutionExpression.ts(6,31): error TS2322: Type 'string' is not assignable to type 'number'. +tests/cases/conformance/es6/templates/taggedTemplateStringsWithTypeErrorInFunctionExpressionsInSubstitutionExpression.ts(6,31): error TS2322: Type '"bad"' is not assignable to type 'number'. ==== tests/cases/conformance/es6/templates/taggedTemplateStringsWithTypeErrorInFunctionExpressionsInSubstitutionExpression.ts (1 errors) ==== @@ -9,4 +9,4 @@ tests/cases/conformance/es6/templates/taggedTemplateStringsWithTypeErrorInFuncti foo `${function (x: number) { x = "bad"; } }`; ~ -!!! error TS2322: Type 'string' is not assignable to type 'number'. \ No newline at end of file +!!! error TS2322: Type '"bad"' is not assignable to type 'number'. \ No newline at end of file diff --git a/tests/baselines/reference/taggedTemplateStringsWithTypeErrorInFunctionExpressionsInSubstitutionExpressionES6.errors.txt b/tests/baselines/reference/taggedTemplateStringsWithTypeErrorInFunctionExpressionsInSubstitutionExpressionES6.errors.txt index 6b0f4b642ff..c1d18cd6f91 100644 --- a/tests/baselines/reference/taggedTemplateStringsWithTypeErrorInFunctionExpressionsInSubstitutionExpressionES6.errors.txt +++ b/tests/baselines/reference/taggedTemplateStringsWithTypeErrorInFunctionExpressionsInSubstitutionExpressionES6.errors.txt @@ -1,4 +1,4 @@ -tests/cases/conformance/es6/templates/taggedTemplateStringsWithTypeErrorInFunctionExpressionsInSubstitutionExpressionES6.ts(5,31): error TS2322: Type 'string' is not assignable to type 'number'. +tests/cases/conformance/es6/templates/taggedTemplateStringsWithTypeErrorInFunctionExpressionsInSubstitutionExpressionES6.ts(5,31): error TS2322: Type '"bad"' is not assignable to type 'number'. ==== tests/cases/conformance/es6/templates/taggedTemplateStringsWithTypeErrorInFunctionExpressionsInSubstitutionExpressionES6.ts (1 errors) ==== @@ -8,4 +8,4 @@ tests/cases/conformance/es6/templates/taggedTemplateStringsWithTypeErrorInFuncti foo `${function (x: number) { x = "bad"; } }`; ~ -!!! error TS2322: Type 'string' is not assignable to type 'number'. \ No newline at end of file +!!! error TS2322: Type '"bad"' is not assignable to type 'number'. \ No newline at end of file diff --git a/tests/baselines/reference/taggedTemplateStringsWithTypedTags.types b/tests/baselines/reference/taggedTemplateStringsWithTypedTags.types index c7c521154c7..69b9368f765 100644 --- a/tests/baselines/reference/taggedTemplateStringsWithTypedTags.types +++ b/tests/baselines/reference/taggedTemplateStringsWithTypedTags.types @@ -42,8 +42,8 @@ f `abc${1}def${2}ghi`; >f `abc${1}def${2}ghi` : I >f : I >`abc${1}def${2}ghi` : string ->1 : number ->2 : number +>1 : 1 +>2 : 2 f `abc`.member >f `abc`.member : I @@ -57,8 +57,8 @@ f `abc${1}def${2}ghi`.member; >f `abc${1}def${2}ghi` : I >f : I >`abc${1}def${2}ghi` : string ->1 : number ->2 : number +>1 : 1 +>2 : 2 >member : I f `abc`["member"]; @@ -66,16 +66,16 @@ f `abc`["member"]; >f `abc` : I >f : I >`abc` : string ->"member" : string +>"member" : "member" f `abc${1}def${2}ghi`["member"]; >f `abc${1}def${2}ghi`["member"] : I >f `abc${1}def${2}ghi` : I >f : I >`abc${1}def${2}ghi` : string ->1 : number ->2 : number ->"member" : string +>1 : 1 +>2 : 2 +>"member" : "member" f `abc`[0].member `abc${1}def${2}ghi`; >f `abc`[0].member `abc${1}def${2}ghi` : I @@ -84,11 +84,11 @@ f `abc`[0].member `abc${1}def${2}ghi`; >f `abc` : I >f : I >`abc` : string ->0 : number +>0 : 0 >member : I >`abc${1}def${2}ghi` : string ->1 : number ->2 : number +>1 : 1 +>2 : 2 f `abc${1}def${2}ghi`["member"].member `abc${1}def${2}ghi`; >f `abc${1}def${2}ghi`["member"].member `abc${1}def${2}ghi` : I @@ -97,13 +97,13 @@ f `abc${1}def${2}ghi`["member"].member `abc${1}def${2}ghi`; >f `abc${1}def${2}ghi` : I >f : I >`abc${1}def${2}ghi` : string ->1 : number ->2 : number ->"member" : string +>1 : 1 +>2 : 2 +>"member" : "member" >member : I >`abc${1}def${2}ghi` : string ->1 : number ->2 : number +>1 : 1 +>2 : 2 f.thisIsNotATag(`abc`); >f.thisIsNotATag(`abc`) : void @@ -118,6 +118,6 @@ f.thisIsNotATag(`abc${1}def${2}ghi`); >f : I >thisIsNotATag : (x: string) => void >`abc${1}def${2}ghi` : string ->1 : number ->2 : number +>1 : 1 +>2 : 2 diff --git a/tests/baselines/reference/taggedTemplateStringsWithTypedTagsES6.types b/tests/baselines/reference/taggedTemplateStringsWithTypedTagsES6.types index bf45144c329..97e2f011ca6 100644 --- a/tests/baselines/reference/taggedTemplateStringsWithTypedTagsES6.types +++ b/tests/baselines/reference/taggedTemplateStringsWithTypedTagsES6.types @@ -42,8 +42,8 @@ f `abc${1}def${2}ghi`; >f `abc${1}def${2}ghi` : I >f : I >`abc${1}def${2}ghi` : string ->1 : number ->2 : number +>1 : 1 +>2 : 2 f `abc`.member >f `abc`.member : I @@ -57,8 +57,8 @@ f `abc${1}def${2}ghi`.member; >f `abc${1}def${2}ghi` : I >f : I >`abc${1}def${2}ghi` : string ->1 : number ->2 : number +>1 : 1 +>2 : 2 >member : I f `abc`["member"]; @@ -66,16 +66,16 @@ f `abc`["member"]; >f `abc` : I >f : I >`abc` : string ->"member" : string +>"member" : "member" f `abc${1}def${2}ghi`["member"]; >f `abc${1}def${2}ghi`["member"] : I >f `abc${1}def${2}ghi` : I >f : I >`abc${1}def${2}ghi` : string ->1 : number ->2 : number ->"member" : string +>1 : 1 +>2 : 2 +>"member" : "member" f `abc`[0].member `abc${1}def${2}ghi`; >f `abc`[0].member `abc${1}def${2}ghi` : I @@ -84,11 +84,11 @@ f `abc`[0].member `abc${1}def${2}ghi`; >f `abc` : I >f : I >`abc` : string ->0 : number +>0 : 0 >member : I >`abc${1}def${2}ghi` : string ->1 : number ->2 : number +>1 : 1 +>2 : 2 f `abc${1}def${2}ghi`["member"].member `abc${1}def${2}ghi`; >f `abc${1}def${2}ghi`["member"].member `abc${1}def${2}ghi` : I @@ -97,13 +97,13 @@ f `abc${1}def${2}ghi`["member"].member `abc${1}def${2}ghi`; >f `abc${1}def${2}ghi` : I >f : I >`abc${1}def${2}ghi` : string ->1 : number ->2 : number ->"member" : string +>1 : 1 +>2 : 2 +>"member" : "member" >member : I >`abc${1}def${2}ghi` : string ->1 : number ->2 : number +>1 : 1 +>2 : 2 f.thisIsNotATag(`abc`); >f.thisIsNotATag(`abc`) : void @@ -118,6 +118,6 @@ f.thisIsNotATag(`abc${1}def${2}ghi`); >f : I >thisIsNotATag : (x: string) => void >`abc${1}def${2}ghi` : string ->1 : number ->2 : number +>1 : 1 +>2 : 2 diff --git a/tests/baselines/reference/taggedTemplateStringsWithUnicodeEscapes.types b/tests/baselines/reference/taggedTemplateStringsWithUnicodeEscapes.types index 7b09b5c5746..4b9b447d32a 100644 --- a/tests/baselines/reference/taggedTemplateStringsWithUnicodeEscapes.types +++ b/tests/baselines/reference/taggedTemplateStringsWithUnicodeEscapes.types @@ -8,5 +8,5 @@ f `'\u{1f4a9}'${ " should be converted to " }'\uD83D\uDCA9'`; >f `'\u{1f4a9}'${ " should be converted to " }'\uD83D\uDCA9'` : void >f : (...args: any[]) => void >`'\u{1f4a9}'${ " should be converted to " }'\uD83D\uDCA9'` : string ->" should be converted to " : string +>" should be converted to " : " should be converted to " diff --git a/tests/baselines/reference/taggedTemplateStringsWithUnicodeEscapesES6.types b/tests/baselines/reference/taggedTemplateStringsWithUnicodeEscapesES6.types index ad4c5cc67a9..36a298c5a38 100644 --- a/tests/baselines/reference/taggedTemplateStringsWithUnicodeEscapesES6.types +++ b/tests/baselines/reference/taggedTemplateStringsWithUnicodeEscapesES6.types @@ -8,5 +8,5 @@ f `'\u{1f4a9}'${ " should be converted to " }'\uD83D\uDCA9'`; >f `'\u{1f4a9}'${ " should be converted to " }'\uD83D\uDCA9'` : void >f : (...args: any[]) => void >`'\u{1f4a9}'${ " should be converted to " }'\uD83D\uDCA9'` : string ->" should be converted to " : string +>" should be converted to " : " should be converted to " diff --git a/tests/baselines/reference/taggedTemplateWithConstructableTag01.errors.txt b/tests/baselines/reference/taggedTemplateWithConstructableTag01.errors.txt index b114acc5277..9815338f2ef 100644 --- a/tests/baselines/reference/taggedTemplateWithConstructableTag01.errors.txt +++ b/tests/baselines/reference/taggedTemplateWithConstructableTag01.errors.txt @@ -1,4 +1,4 @@ -tests/cases/conformance/es6/templates/taggedTemplateWithConstructableTag01.ts(3,1): error TS2349: Cannot invoke an expression whose type lacks a call signature. +tests/cases/conformance/es6/templates/taggedTemplateWithConstructableTag01.ts(3,1): error TS2349: Cannot invoke an expression whose type lacks a call signature. Type 'typeof CtorTag' has no compatible call signatures. ==== tests/cases/conformance/es6/templates/taggedTemplateWithConstructableTag01.ts (1 errors) ==== @@ -6,4 +6,4 @@ tests/cases/conformance/es6/templates/taggedTemplateWithConstructableTag01.ts(3, CtorTag `Hello world!`; ~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2349: Cannot invoke an expression whose type lacks a call signature. \ No newline at end of file +!!! error TS2349: Cannot invoke an expression whose type lacks a call signature. Type 'typeof CtorTag' has no compatible call signatures. \ No newline at end of file diff --git a/tests/baselines/reference/taggedTemplateWithConstructableTag02.errors.txt b/tests/baselines/reference/taggedTemplateWithConstructableTag02.errors.txt index 9bc4414b24f..f3946d5a4f2 100644 --- a/tests/baselines/reference/taggedTemplateWithConstructableTag02.errors.txt +++ b/tests/baselines/reference/taggedTemplateWithConstructableTag02.errors.txt @@ -1,4 +1,4 @@ -tests/cases/conformance/es6/templates/taggedTemplateWithConstructableTag02.ts(6,1): error TS2349: Cannot invoke an expression whose type lacks a call signature. +tests/cases/conformance/es6/templates/taggedTemplateWithConstructableTag02.ts(6,1): error TS2349: Cannot invoke an expression whose type lacks a call signature. Type 'I' has no compatible call signatures. ==== tests/cases/conformance/es6/templates/taggedTemplateWithConstructableTag02.ts (1 errors) ==== @@ -9,4 +9,4 @@ tests/cases/conformance/es6/templates/taggedTemplateWithConstructableTag02.ts(6, var tag: I; tag `Hello world!`; ~~~~~~~~~~~~~~~~~~ -!!! error TS2349: Cannot invoke an expression whose type lacks a call signature. \ No newline at end of file +!!! error TS2349: Cannot invoke an expression whose type lacks a call signature. Type 'I' has no compatible call signatures. \ No newline at end of file diff --git a/tests/baselines/reference/taggedTemplatesWithIncompleteTemplateExpressions3.errors.txt b/tests/baselines/reference/taggedTemplatesWithIncompleteTemplateExpressions3.errors.txt index 33d93b43f13..ca306a8ad8b 100644 --- a/tests/baselines/reference/taggedTemplatesWithIncompleteTemplateExpressions3.errors.txt +++ b/tests/baselines/reference/taggedTemplatesWithIncompleteTemplateExpressions3.errors.txt @@ -1,4 +1,4 @@ -tests/cases/compiler/taggedTemplatesWithIncompleteTemplateExpressions3.ts(6,18): error TS2345: Argument of type 'number' is not assignable to parameter of type 'string'. +tests/cases/compiler/taggedTemplatesWithIncompleteTemplateExpressions3.ts(6,18): error TS2345: Argument of type '1' is not assignable to parameter of type 'string'. tests/cases/compiler/taggedTemplatesWithIncompleteTemplateExpressions3.ts(6,23): error TS1109: Expression expected. @@ -10,6 +10,6 @@ tests/cases/compiler/taggedTemplatesWithIncompleteTemplateExpressions3.ts(6,23): // Incomplete call, not enough parameters. f `123qdawdrqw${ 1 }${ ~ -!!! error TS2345: Argument of type 'number' is not assignable to parameter of type 'string'. +!!! error TS2345: Argument of type '1' is not assignable to parameter of type 'string'. !!! error TS1109: Expression expected. \ No newline at end of file diff --git a/tests/baselines/reference/taggedTemplatesWithIncompleteTemplateExpressions6.errors.txt b/tests/baselines/reference/taggedTemplatesWithIncompleteTemplateExpressions6.errors.txt index c577896aec7..a5d3f132b69 100644 --- a/tests/baselines/reference/taggedTemplatesWithIncompleteTemplateExpressions6.errors.txt +++ b/tests/baselines/reference/taggedTemplatesWithIncompleteTemplateExpressions6.errors.txt @@ -1,4 +1,4 @@ -tests/cases/compiler/taggedTemplatesWithIncompleteTemplateExpressions6.ts(6,18): error TS2345: Argument of type 'number' is not assignable to parameter of type 'string'. +tests/cases/compiler/taggedTemplatesWithIncompleteTemplateExpressions6.ts(6,18): error TS2345: Argument of type '1' is not assignable to parameter of type 'string'. tests/cases/compiler/taggedTemplatesWithIncompleteTemplateExpressions6.ts(6,23): error TS1109: Expression expected. @@ -10,6 +10,6 @@ tests/cases/compiler/taggedTemplatesWithIncompleteTemplateExpressions6.ts(6,23): // Incomplete call, not enough parameters, at EOF. f `123qdawdrqw${ 1 }${ ~ -!!! error TS2345: Argument of type 'number' is not assignable to parameter of type 'string'. +!!! error TS2345: Argument of type '1' is not assignable to parameter of type 'string'. !!! error TS1109: Expression expected. \ No newline at end of file diff --git a/tests/baselines/reference/targetTypeArgs.types b/tests/baselines/reference/targetTypeArgs.types index cda814d52c5..84985316aa2 100644 --- a/tests/baselines/reference/targetTypeArgs.types +++ b/tests/baselines/reference/targetTypeArgs.types @@ -7,7 +7,7 @@ function foo(callback: (x: string) => void) { callback("hello"); >callback("hello") : void >callback : (x: string) => void ->"hello" : string +>"hello" : "hello" } foo(function(x) { x }); @@ -21,7 +21,7 @@ foo(function(x) { x }); >[1].forEach(function(v,i,a) { v }) : void >[1].forEach : (callbackfn: (value: number, index: number, array: number[]) => void, thisArg?: any) => void >[1] : number[] ->1 : number +>1 : 1 >forEach : (callbackfn: (value: number, index: number, array: number[]) => void, thisArg?: any) => void >function(v,i,a) { v } : (v: number, i: number, a: number[]) => void >v : number @@ -33,55 +33,55 @@ foo(function(x) { x }); >["hello"].every(function(v,i,a) {return true;}) : boolean >["hello"].every : (callbackfn: (value: string, index: number, array: string[]) => boolean, thisArg?: any) => boolean >["hello"] : string[] ->"hello" : string +>"hello" : "hello" >every : (callbackfn: (value: string, index: number, array: string[]) => boolean, thisArg?: any) => boolean ->function(v,i,a) {return true;} : (v: string, i: number, a: string[]) => boolean +>function(v,i,a) {return true;} : (v: string, i: number, a: string[]) => true >v : string >i : number >a : string[] ->true : boolean +>true : true [1].every(function(v,i,a) {return true;}); >[1].every(function(v,i,a) {return true;}) : boolean >[1].every : (callbackfn: (value: number, index: number, array: number[]) => boolean, thisArg?: any) => boolean >[1] : number[] ->1 : number +>1 : 1 >every : (callbackfn: (value: number, index: number, array: number[]) => boolean, thisArg?: any) => boolean ->function(v,i,a) {return true;} : (v: number, i: number, a: number[]) => boolean +>function(v,i,a) {return true;} : (v: number, i: number, a: number[]) => true >v : number >i : number >a : number[] ->true : boolean +>true : true [1].every(function(v,i,a) {return true;}); >[1].every(function(v,i,a) {return true;}) : boolean >[1].every : (callbackfn: (value: number, index: number, array: number[]) => boolean, thisArg?: any) => boolean >[1] : number[] ->1 : number +>1 : 1 >every : (callbackfn: (value: number, index: number, array: number[]) => boolean, thisArg?: any) => boolean ->function(v,i,a) {return true;} : (v: number, i: number, a: number[]) => boolean +>function(v,i,a) {return true;} : (v: number, i: number, a: number[]) => true >v : number >i : number >a : number[] ->true : boolean +>true : true ["s"].every(function(v,i,a) {return true;}); >["s"].every(function(v,i,a) {return true;}) : boolean >["s"].every : (callbackfn: (value: string, index: number, array: string[]) => boolean, thisArg?: any) => boolean >["s"] : string[] ->"s" : string +>"s" : "s" >every : (callbackfn: (value: string, index: number, array: string[]) => boolean, thisArg?: any) => boolean ->function(v,i,a) {return true;} : (v: string, i: number, a: string[]) => boolean +>function(v,i,a) {return true;} : (v: string, i: number, a: string[]) => true >v : string >i : number >a : string[] ->true : boolean +>true : true ["s"].forEach(function(v,i,a) { v }); >["s"].forEach(function(v,i,a) { v }) : void >["s"].forEach : (callbackfn: (value: string, index: number, array: string[]) => void, thisArg?: any) => void >["s"] : string[] ->"s" : string +>"s" : "s" >forEach : (callbackfn: (value: string, index: number, array: string[]) => void, thisArg?: any) => void >function(v,i,a) { v } : (v: string, i: number, a: string[]) => void >v : string diff --git a/tests/baselines/reference/targetTypeBaseCalls.errors.txt b/tests/baselines/reference/targetTypeBaseCalls.errors.txt index 37a00c9798d..0ff253d1389 100644 --- a/tests/baselines/reference/targetTypeBaseCalls.errors.txt +++ b/tests/baselines/reference/targetTypeBaseCalls.errors.txt @@ -1,6 +1,6 @@ -tests/cases/compiler/targetTypeBaseCalls.ts(9,19): error TS2322: Type 'number' is not assignable to type 'string'. -tests/cases/compiler/targetTypeBaseCalls.ts(13,23): error TS2322: Type 'number' is not assignable to type 'string'. -tests/cases/compiler/targetTypeBaseCalls.ts(17,61): error TS2322: Type 'number' is not assignable to type 'string'. +tests/cases/compiler/targetTypeBaseCalls.ts(9,19): error TS2322: Type '5' is not assignable to type 'string'. +tests/cases/compiler/targetTypeBaseCalls.ts(13,23): error TS2322: Type '5' is not assignable to type 'string'. +tests/cases/compiler/targetTypeBaseCalls.ts(17,61): error TS2322: Type '5' is not assignable to type 'string'. ==== tests/cases/compiler/targetTypeBaseCalls.ts (3 errors) ==== @@ -14,17 +14,17 @@ tests/cases/compiler/targetTypeBaseCalls.ts(17,61): error TS2322: Type 'number' foo(function(s) { s = 5 }); // Error, can’t assign number to string ~ -!!! error TS2322: Type 'number' is not assignable to type 'string'. +!!! error TS2322: Type '5' is not assignable to type 'string'. new Foo(function(s) { s = 5 }); // error, if types are applied correctly ~ -!!! error TS2322: Type 'number' is not assignable to type 'string'. +!!! error TS2322: Type '5' is not assignable to type 'string'. class Bar extends Foo { constructor() { super(function(s) { s = 5 }) } } // error, if types are applied correctly ~ -!!! error TS2322: Type 'number' is not assignable to type 'string'. +!!! error TS2322: Type '5' is not assignable to type 'string'. \ No newline at end of file diff --git a/tests/baselines/reference/targetTypeCalls.types b/tests/baselines/reference/targetTypeCalls.types index 6e9c1ca190d..1ceb86a3a09 100644 --- a/tests/baselines/reference/targetTypeCalls.types +++ b/tests/baselines/reference/targetTypeCalls.types @@ -14,7 +14,7 @@ var fra2: (v:any)=>number = function() { return function () { return 0; } }() // >function() { return function () { return 0; } }() : () => number >function() { return function () { return 0; } } : () => () => number >function () { return 0; } : () => number ->0 : number +>0 : 0 var fra3: (v:any)=>string = function() { return function() { return function(v) {return v;};}(); }() // should work >fra3 : (v: any) => string diff --git a/tests/baselines/reference/targetTypeObjectLiteral.types b/tests/baselines/reference/targetTypeObjectLiteral.types index 8f77c11f7b6..5f80a01bf0c 100644 --- a/tests/baselines/reference/targetTypeObjectLiteral.types +++ b/tests/baselines/reference/targetTypeObjectLiteral.types @@ -8,7 +8,7 @@ var z: { x: number; y: (w:string)=>number;} = { x: 12, >x : number ->12 : number +>12 : 12 y: function(w) { >y : (w: string) => number @@ -16,7 +16,7 @@ var z: { x: number; y: (w:string)=>number;} = { >w : string return 0; ->0 : number +>0 : 0 } diff --git a/tests/baselines/reference/targetTypeObjectLiteralToAny.types b/tests/baselines/reference/targetTypeObjectLiteralToAny.types index b6bd1e91051..1dd81b33603 100644 --- a/tests/baselines/reference/targetTypeObjectLiteralToAny.types +++ b/tests/baselines/reference/targetTypeObjectLiteralToAny.types @@ -25,7 +25,7 @@ function suggest(){ >text : string >keyword : string >type : string ->"keyword" : string +>"keyword" : "keyword" }); } diff --git a/tests/baselines/reference/targetTypeTest2.types b/tests/baselines/reference/targetTypeTest2.types index 25b36f948c6..d3a4bc66dbb 100644 --- a/tests/baselines/reference/targetTypeTest2.types +++ b/tests/baselines/reference/targetTypeTest2.types @@ -5,9 +5,9 @@ var a : any[] = [1,2,"3"]; >a : any[] >[1,2,"3"] : (string | number)[] ->1 : number ->2 : number ->"3" : string +>1 : 1 +>2 : 2 +>"3" : "3" function func1(stuff:any[]) { return stuff; } diff --git a/tests/baselines/reference/templateStringBinaryOperations.types b/tests/baselines/reference/templateStringBinaryOperations.types index d4b8c531ef4..01d306487ee 100644 --- a/tests/baselines/reference/templateStringBinaryOperations.types +++ b/tests/baselines/reference/templateStringBinaryOperations.types @@ -2,440 +2,440 @@ var a = 1 + `${ 3 }`; >a : string >1 + `${ 3 }` : string ->1 : number +>1 : 1 >`${ 3 }` : string ->3 : number +>3 : 3 var b = 1 + `2${ 3 }`; >b : string >1 + `2${ 3 }` : string ->1 : number +>1 : 1 >`2${ 3 }` : string ->3 : number +>3 : 3 var c = 1 + `${ 3 }4`; >c : string >1 + `${ 3 }4` : string ->1 : number +>1 : 1 >`${ 3 }4` : string ->3 : number +>3 : 3 var d = 1 + `2${ 3 }4`; >d : string >1 + `2${ 3 }4` : string ->1 : number +>1 : 1 >`2${ 3 }4` : string ->3 : number +>3 : 3 var e = `${ 3 }` + 5; >e : string >`${ 3 }` + 5 : string >`${ 3 }` : string ->3 : number ->5 : number +>3 : 3 +>5 : 5 var f = `2${ 3 }` + 5; >f : string >`2${ 3 }` + 5 : string >`2${ 3 }` : string ->3 : number ->5 : number +>3 : 3 +>5 : 5 var g = `${ 3 }4` + 5; >g : string >`${ 3 }4` + 5 : string >`${ 3 }4` : string ->3 : number ->5 : number +>3 : 3 +>5 : 5 var h = `2${ 3 }4` + 5; >h : string >`2${ 3 }4` + 5 : string >`2${ 3 }4` : string ->3 : number ->5 : number +>3 : 3 +>5 : 5 var i = 1 + `${ 3 }` + 5; >i : string >1 + `${ 3 }` + 5 : string >1 + `${ 3 }` : string ->1 : number +>1 : 1 >`${ 3 }` : string ->3 : number ->5 : number +>3 : 3 +>5 : 5 var j = 1 + `2${ 3 }` + 5; >j : string >1 + `2${ 3 }` + 5 : string >1 + `2${ 3 }` : string ->1 : number +>1 : 1 >`2${ 3 }` : string ->3 : number ->5 : number +>3 : 3 +>5 : 5 var k = 1 + `${ 3 }4` + 5; >k : string >1 + `${ 3 }4` + 5 : string >1 + `${ 3 }4` : string ->1 : number +>1 : 1 >`${ 3 }4` : string ->3 : number ->5 : number +>3 : 3 +>5 : 5 var l = 1 + `2${ 3 }4` + 5; >l : string >1 + `2${ 3 }4` + 5 : string >1 + `2${ 3 }4` : string ->1 : number +>1 : 1 >`2${ 3 }4` : string ->3 : number ->5 : number +>3 : 3 +>5 : 5 var a2 = 1 + `${ 3 - 4 }`; >a2 : string >1 + `${ 3 - 4 }` : string ->1 : number +>1 : 1 >`${ 3 - 4 }` : string >3 - 4 : number ->3 : number ->4 : number +>3 : 3 +>4 : 4 var b2 = 1 + `2${ 3 - 4 }`; >b2 : string >1 + `2${ 3 - 4 }` : string ->1 : number +>1 : 1 >`2${ 3 - 4 }` : string >3 - 4 : number ->3 : number ->4 : number +>3 : 3 +>4 : 4 var c2 = 1 + `${ 3 - 4 }5`; >c2 : string >1 + `${ 3 - 4 }5` : string ->1 : number +>1 : 1 >`${ 3 - 4 }5` : string >3 - 4 : number ->3 : number ->4 : number +>3 : 3 +>4 : 4 var d2 = 1 + `2${ 3 - 4 }5`; >d2 : string >1 + `2${ 3 - 4 }5` : string ->1 : number +>1 : 1 >`2${ 3 - 4 }5` : string >3 - 4 : number ->3 : number ->4 : number +>3 : 3 +>4 : 4 var e2 = `${ 3 - 4 }` + 6; >e2 : string >`${ 3 - 4 }` + 6 : string >`${ 3 - 4 }` : string >3 - 4 : number ->3 : number ->4 : number ->6 : number +>3 : 3 +>4 : 4 +>6 : 6 var f2 = `2${ 3 - 4 }` + 6; >f2 : string >`2${ 3 - 4 }` + 6 : string >`2${ 3 - 4 }` : string >3 - 4 : number ->3 : number ->4 : number ->6 : number +>3 : 3 +>4 : 4 +>6 : 6 var g2 = `${ 3 - 4 }5` + 6; >g2 : string >`${ 3 - 4 }5` + 6 : string >`${ 3 - 4 }5` : string >3 - 4 : number ->3 : number ->4 : number ->6 : number +>3 : 3 +>4 : 4 +>6 : 6 var h2 = `2${ 3 - 4 }5` + 6; >h2 : string >`2${ 3 - 4 }5` + 6 : string >`2${ 3 - 4 }5` : string >3 - 4 : number ->3 : number ->4 : number ->6 : number +>3 : 3 +>4 : 4 +>6 : 6 var i2 = 1 + `${ 3 - 4 }` + 6; >i2 : string >1 + `${ 3 - 4 }` + 6 : string >1 + `${ 3 - 4 }` : string ->1 : number +>1 : 1 >`${ 3 - 4 }` : string >3 - 4 : number ->3 : number ->4 : number ->6 : number +>3 : 3 +>4 : 4 +>6 : 6 var j2 = 1 + `2${ 3 - 4 }` + 6; >j2 : string >1 + `2${ 3 - 4 }` + 6 : string >1 + `2${ 3 - 4 }` : string ->1 : number +>1 : 1 >`2${ 3 - 4 }` : string >3 - 4 : number ->3 : number ->4 : number ->6 : number +>3 : 3 +>4 : 4 +>6 : 6 var k2 = 1 + `${ 3 - 4 }5` + 6; >k2 : string >1 + `${ 3 - 4 }5` + 6 : string >1 + `${ 3 - 4 }5` : string ->1 : number +>1 : 1 >`${ 3 - 4 }5` : string >3 - 4 : number ->3 : number ->4 : number ->6 : number +>3 : 3 +>4 : 4 +>6 : 6 var l2 = 1 + `2${ 3 - 4 }5` + 6; >l2 : string >1 + `2${ 3 - 4 }5` + 6 : string >1 + `2${ 3 - 4 }5` : string ->1 : number +>1 : 1 >`2${ 3 - 4 }5` : string >3 - 4 : number ->3 : number ->4 : number ->6 : number +>3 : 3 +>4 : 4 +>6 : 6 var a3 = 1 + `${ 3 * 4 }`; >a3 : string >1 + `${ 3 * 4 }` : string ->1 : number +>1 : 1 >`${ 3 * 4 }` : string >3 * 4 : number ->3 : number ->4 : number +>3 : 3 +>4 : 4 var b3 = 1 + `2${ 3 * 4 }`; >b3 : string >1 + `2${ 3 * 4 }` : string ->1 : number +>1 : 1 >`2${ 3 * 4 }` : string >3 * 4 : number ->3 : number ->4 : number +>3 : 3 +>4 : 4 var c3 = 1 + `${ 3 * 4 }5`; >c3 : string >1 + `${ 3 * 4 }5` : string ->1 : number +>1 : 1 >`${ 3 * 4 }5` : string >3 * 4 : number ->3 : number ->4 : number +>3 : 3 +>4 : 4 var d3 = 1 + `2${ 3 * 4 }5`; >d3 : string >1 + `2${ 3 * 4 }5` : string ->1 : number +>1 : 1 >`2${ 3 * 4 }5` : string >3 * 4 : number ->3 : number ->4 : number +>3 : 3 +>4 : 4 var e3 = `${ 3 * 4 }` + 6; >e3 : string >`${ 3 * 4 }` + 6 : string >`${ 3 * 4 }` : string >3 * 4 : number ->3 : number ->4 : number ->6 : number +>3 : 3 +>4 : 4 +>6 : 6 var f3 = `2${ 3 * 4 }` + 6; >f3 : string >`2${ 3 * 4 }` + 6 : string >`2${ 3 * 4 }` : string >3 * 4 : number ->3 : number ->4 : number ->6 : number +>3 : 3 +>4 : 4 +>6 : 6 var g3 = `${ 3 * 4 }5` + 6; >g3 : string >`${ 3 * 4 }5` + 6 : string >`${ 3 * 4 }5` : string >3 * 4 : number ->3 : number ->4 : number ->6 : number +>3 : 3 +>4 : 4 +>6 : 6 var h3 = `2${ 3 * 4 }5` + 6; >h3 : string >`2${ 3 * 4 }5` + 6 : string >`2${ 3 * 4 }5` : string >3 * 4 : number ->3 : number ->4 : number ->6 : number +>3 : 3 +>4 : 4 +>6 : 6 var i3 = 1 + `${ 3 * 4 }` + 6; >i3 : string >1 + `${ 3 * 4 }` + 6 : string >1 + `${ 3 * 4 }` : string ->1 : number +>1 : 1 >`${ 3 * 4 }` : string >3 * 4 : number ->3 : number ->4 : number ->6 : number +>3 : 3 +>4 : 4 +>6 : 6 var j3 = 1 + `2${ 3 * 4 }` + 6; >j3 : string >1 + `2${ 3 * 4 }` + 6 : string >1 + `2${ 3 * 4 }` : string ->1 : number +>1 : 1 >`2${ 3 * 4 }` : string >3 * 4 : number ->3 : number ->4 : number ->6 : number +>3 : 3 +>4 : 4 +>6 : 6 var k3 = 1 + `${ 3 * 4 }5` + 6; >k3 : string >1 + `${ 3 * 4 }5` + 6 : string >1 + `${ 3 * 4 }5` : string ->1 : number +>1 : 1 >`${ 3 * 4 }5` : string >3 * 4 : number ->3 : number ->4 : number ->6 : number +>3 : 3 +>4 : 4 +>6 : 6 var l3 = 1 + `2${ 3 * 4 }5` + 6; >l3 : string >1 + `2${ 3 * 4 }5` + 6 : string >1 + `2${ 3 * 4 }5` : string ->1 : number +>1 : 1 >`2${ 3 * 4 }5` : string >3 * 4 : number ->3 : number ->4 : number ->6 : number +>3 : 3 +>4 : 4 +>6 : 6 var a4 = 1 + `${ 3 & 4 }`; >a4 : string >1 + `${ 3 & 4 }` : string ->1 : number +>1 : 1 >`${ 3 & 4 }` : string >3 & 4 : number ->3 : number ->4 : number +>3 : 3 +>4 : 4 var b4 = 1 + `2${ 3 & 4 }`; >b4 : string >1 + `2${ 3 & 4 }` : string ->1 : number +>1 : 1 >`2${ 3 & 4 }` : string >3 & 4 : number ->3 : number ->4 : number +>3 : 3 +>4 : 4 var c4 = 1 + `${ 3 & 4 }5`; >c4 : string >1 + `${ 3 & 4 }5` : string ->1 : number +>1 : 1 >`${ 3 & 4 }5` : string >3 & 4 : number ->3 : number ->4 : number +>3 : 3 +>4 : 4 var d4 = 1 + `2${ 3 & 4 }5`; >d4 : string >1 + `2${ 3 & 4 }5` : string ->1 : number +>1 : 1 >`2${ 3 & 4 }5` : string >3 & 4 : number ->3 : number ->4 : number +>3 : 3 +>4 : 4 var e4 = `${ 3 & 4 }` + 6; >e4 : string >`${ 3 & 4 }` + 6 : string >`${ 3 & 4 }` : string >3 & 4 : number ->3 : number ->4 : number ->6 : number +>3 : 3 +>4 : 4 +>6 : 6 var f4 = `2${ 3 & 4 }` + 6; >f4 : string >`2${ 3 & 4 }` + 6 : string >`2${ 3 & 4 }` : string >3 & 4 : number ->3 : number ->4 : number ->6 : number +>3 : 3 +>4 : 4 +>6 : 6 var g4 = `${ 3 & 4 }5` + 6; >g4 : string >`${ 3 & 4 }5` + 6 : string >`${ 3 & 4 }5` : string >3 & 4 : number ->3 : number ->4 : number ->6 : number +>3 : 3 +>4 : 4 +>6 : 6 var h4 = `2${ 3 & 4 }5` + 6; >h4 : string >`2${ 3 & 4 }5` + 6 : string >`2${ 3 & 4 }5` : string >3 & 4 : number ->3 : number ->4 : number ->6 : number +>3 : 3 +>4 : 4 +>6 : 6 var i4 = 1 + `${ 3 & 4 }` + 6; >i4 : string >1 + `${ 3 & 4 }` + 6 : string >1 + `${ 3 & 4 }` : string ->1 : number +>1 : 1 >`${ 3 & 4 }` : string >3 & 4 : number ->3 : number ->4 : number ->6 : number +>3 : 3 +>4 : 4 +>6 : 6 var j4 = 1 + `2${ 3 & 4 }` + 6; >j4 : string >1 + `2${ 3 & 4 }` + 6 : string >1 + `2${ 3 & 4 }` : string ->1 : number +>1 : 1 >`2${ 3 & 4 }` : string >3 & 4 : number ->3 : number ->4 : number ->6 : number +>3 : 3 +>4 : 4 +>6 : 6 var k4 = 1 + `${ 3 & 4 }5` + 6; >k4 : string >1 + `${ 3 & 4 }5` + 6 : string >1 + `${ 3 & 4 }5` : string ->1 : number +>1 : 1 >`${ 3 & 4 }5` : string >3 & 4 : number ->3 : number ->4 : number ->6 : number +>3 : 3 +>4 : 4 +>6 : 6 var l4 = 1 + `2${ 3 & 4 }5` + 6; >l4 : string >1 + `2${ 3 & 4 }5` + 6 : string >1 + `2${ 3 & 4 }5` : string ->1 : number +>1 : 1 >`2${ 3 & 4 }5` : string >3 & 4 : number ->3 : number ->4 : number ->6 : number +>3 : 3 +>4 : 4 +>6 : 6 diff --git a/tests/baselines/reference/templateStringBinaryOperationsES6.types b/tests/baselines/reference/templateStringBinaryOperationsES6.types index a20da835a81..0ac9775a655 100644 --- a/tests/baselines/reference/templateStringBinaryOperationsES6.types +++ b/tests/baselines/reference/templateStringBinaryOperationsES6.types @@ -2,440 +2,440 @@ var a = 1 + `${ 3 }`; >a : string >1 + `${ 3 }` : string ->1 : number +>1 : 1 >`${ 3 }` : string ->3 : number +>3 : 3 var b = 1 + `2${ 3 }`; >b : string >1 + `2${ 3 }` : string ->1 : number +>1 : 1 >`2${ 3 }` : string ->3 : number +>3 : 3 var c = 1 + `${ 3 }4`; >c : string >1 + `${ 3 }4` : string ->1 : number +>1 : 1 >`${ 3 }4` : string ->3 : number +>3 : 3 var d = 1 + `2${ 3 }4`; >d : string >1 + `2${ 3 }4` : string ->1 : number +>1 : 1 >`2${ 3 }4` : string ->3 : number +>3 : 3 var e = `${ 3 }` + 5; >e : string >`${ 3 }` + 5 : string >`${ 3 }` : string ->3 : number ->5 : number +>3 : 3 +>5 : 5 var f = `2${ 3 }` + 5; >f : string >`2${ 3 }` + 5 : string >`2${ 3 }` : string ->3 : number ->5 : number +>3 : 3 +>5 : 5 var g = `${ 3 }4` + 5; >g : string >`${ 3 }4` + 5 : string >`${ 3 }4` : string ->3 : number ->5 : number +>3 : 3 +>5 : 5 var h = `2${ 3 }4` + 5; >h : string >`2${ 3 }4` + 5 : string >`2${ 3 }4` : string ->3 : number ->5 : number +>3 : 3 +>5 : 5 var i = 1 + `${ 3 }` + 5; >i : string >1 + `${ 3 }` + 5 : string >1 + `${ 3 }` : string ->1 : number +>1 : 1 >`${ 3 }` : string ->3 : number ->5 : number +>3 : 3 +>5 : 5 var j = 1 + `2${ 3 }` + 5; >j : string >1 + `2${ 3 }` + 5 : string >1 + `2${ 3 }` : string ->1 : number +>1 : 1 >`2${ 3 }` : string ->3 : number ->5 : number +>3 : 3 +>5 : 5 var k = 1 + `${ 3 }4` + 5; >k : string >1 + `${ 3 }4` + 5 : string >1 + `${ 3 }4` : string ->1 : number +>1 : 1 >`${ 3 }4` : string ->3 : number ->5 : number +>3 : 3 +>5 : 5 var l = 1 + `2${ 3 }4` + 5; >l : string >1 + `2${ 3 }4` + 5 : string >1 + `2${ 3 }4` : string ->1 : number +>1 : 1 >`2${ 3 }4` : string ->3 : number ->5 : number +>3 : 3 +>5 : 5 var a2 = 1 + `${ 3 - 4 }`; >a2 : string >1 + `${ 3 - 4 }` : string ->1 : number +>1 : 1 >`${ 3 - 4 }` : string >3 - 4 : number ->3 : number ->4 : number +>3 : 3 +>4 : 4 var b2 = 1 + `2${ 3 - 4 }`; >b2 : string >1 + `2${ 3 - 4 }` : string ->1 : number +>1 : 1 >`2${ 3 - 4 }` : string >3 - 4 : number ->3 : number ->4 : number +>3 : 3 +>4 : 4 var c2 = 1 + `${ 3 - 4 }5`; >c2 : string >1 + `${ 3 - 4 }5` : string ->1 : number +>1 : 1 >`${ 3 - 4 }5` : string >3 - 4 : number ->3 : number ->4 : number +>3 : 3 +>4 : 4 var d2 = 1 + `2${ 3 - 4 }5`; >d2 : string >1 + `2${ 3 - 4 }5` : string ->1 : number +>1 : 1 >`2${ 3 - 4 }5` : string >3 - 4 : number ->3 : number ->4 : number +>3 : 3 +>4 : 4 var e2 = `${ 3 - 4 }` + 6; >e2 : string >`${ 3 - 4 }` + 6 : string >`${ 3 - 4 }` : string >3 - 4 : number ->3 : number ->4 : number ->6 : number +>3 : 3 +>4 : 4 +>6 : 6 var f2 = `2${ 3 - 4 }` + 6; >f2 : string >`2${ 3 - 4 }` + 6 : string >`2${ 3 - 4 }` : string >3 - 4 : number ->3 : number ->4 : number ->6 : number +>3 : 3 +>4 : 4 +>6 : 6 var g2 = `${ 3 - 4 }5` + 6; >g2 : string >`${ 3 - 4 }5` + 6 : string >`${ 3 - 4 }5` : string >3 - 4 : number ->3 : number ->4 : number ->6 : number +>3 : 3 +>4 : 4 +>6 : 6 var h2 = `2${ 3 - 4 }5` + 6; >h2 : string >`2${ 3 - 4 }5` + 6 : string >`2${ 3 - 4 }5` : string >3 - 4 : number ->3 : number ->4 : number ->6 : number +>3 : 3 +>4 : 4 +>6 : 6 var i2 = 1 + `${ 3 - 4 }` + 6; >i2 : string >1 + `${ 3 - 4 }` + 6 : string >1 + `${ 3 - 4 }` : string ->1 : number +>1 : 1 >`${ 3 - 4 }` : string >3 - 4 : number ->3 : number ->4 : number ->6 : number +>3 : 3 +>4 : 4 +>6 : 6 var j2 = 1 + `2${ 3 - 4 }` + 6; >j2 : string >1 + `2${ 3 - 4 }` + 6 : string >1 + `2${ 3 - 4 }` : string ->1 : number +>1 : 1 >`2${ 3 - 4 }` : string >3 - 4 : number ->3 : number ->4 : number ->6 : number +>3 : 3 +>4 : 4 +>6 : 6 var k2 = 1 + `${ 3 - 4 }5` + 6; >k2 : string >1 + `${ 3 - 4 }5` + 6 : string >1 + `${ 3 - 4 }5` : string ->1 : number +>1 : 1 >`${ 3 - 4 }5` : string >3 - 4 : number ->3 : number ->4 : number ->6 : number +>3 : 3 +>4 : 4 +>6 : 6 var l2 = 1 + `2${ 3 - 4 }5` + 6; >l2 : string >1 + `2${ 3 - 4 }5` + 6 : string >1 + `2${ 3 - 4 }5` : string ->1 : number +>1 : 1 >`2${ 3 - 4 }5` : string >3 - 4 : number ->3 : number ->4 : number ->6 : number +>3 : 3 +>4 : 4 +>6 : 6 var a3 = 1 + `${ 3 * 4 }`; >a3 : string >1 + `${ 3 * 4 }` : string ->1 : number +>1 : 1 >`${ 3 * 4 }` : string >3 * 4 : number ->3 : number ->4 : number +>3 : 3 +>4 : 4 var b3 = 1 + `2${ 3 * 4 }`; >b3 : string >1 + `2${ 3 * 4 }` : string ->1 : number +>1 : 1 >`2${ 3 * 4 }` : string >3 * 4 : number ->3 : number ->4 : number +>3 : 3 +>4 : 4 var c3 = 1 + `${ 3 * 4 }5`; >c3 : string >1 + `${ 3 * 4 }5` : string ->1 : number +>1 : 1 >`${ 3 * 4 }5` : string >3 * 4 : number ->3 : number ->4 : number +>3 : 3 +>4 : 4 var d3 = 1 + `2${ 3 * 4 }5`; >d3 : string >1 + `2${ 3 * 4 }5` : string ->1 : number +>1 : 1 >`2${ 3 * 4 }5` : string >3 * 4 : number ->3 : number ->4 : number +>3 : 3 +>4 : 4 var e3 = `${ 3 * 4 }` + 6; >e3 : string >`${ 3 * 4 }` + 6 : string >`${ 3 * 4 }` : string >3 * 4 : number ->3 : number ->4 : number ->6 : number +>3 : 3 +>4 : 4 +>6 : 6 var f3 = `2${ 3 * 4 }` + 6; >f3 : string >`2${ 3 * 4 }` + 6 : string >`2${ 3 * 4 }` : string >3 * 4 : number ->3 : number ->4 : number ->6 : number +>3 : 3 +>4 : 4 +>6 : 6 var g3 = `${ 3 * 4 }5` + 6; >g3 : string >`${ 3 * 4 }5` + 6 : string >`${ 3 * 4 }5` : string >3 * 4 : number ->3 : number ->4 : number ->6 : number +>3 : 3 +>4 : 4 +>6 : 6 var h3 = `2${ 3 * 4 }5` + 6; >h3 : string >`2${ 3 * 4 }5` + 6 : string >`2${ 3 * 4 }5` : string >3 * 4 : number ->3 : number ->4 : number ->6 : number +>3 : 3 +>4 : 4 +>6 : 6 var i3 = 1 + `${ 3 * 4 }` + 6; >i3 : string >1 + `${ 3 * 4 }` + 6 : string >1 + `${ 3 * 4 }` : string ->1 : number +>1 : 1 >`${ 3 * 4 }` : string >3 * 4 : number ->3 : number ->4 : number ->6 : number +>3 : 3 +>4 : 4 +>6 : 6 var j3 = 1 + `2${ 3 * 4 }` + 6; >j3 : string >1 + `2${ 3 * 4 }` + 6 : string >1 + `2${ 3 * 4 }` : string ->1 : number +>1 : 1 >`2${ 3 * 4 }` : string >3 * 4 : number ->3 : number ->4 : number ->6 : number +>3 : 3 +>4 : 4 +>6 : 6 var k3 = 1 + `${ 3 * 4 }5` + 6; >k3 : string >1 + `${ 3 * 4 }5` + 6 : string >1 + `${ 3 * 4 }5` : string ->1 : number +>1 : 1 >`${ 3 * 4 }5` : string >3 * 4 : number ->3 : number ->4 : number ->6 : number +>3 : 3 +>4 : 4 +>6 : 6 var l3 = 1 + `2${ 3 * 4 }5` + 6; >l3 : string >1 + `2${ 3 * 4 }5` + 6 : string >1 + `2${ 3 * 4 }5` : string ->1 : number +>1 : 1 >`2${ 3 * 4 }5` : string >3 * 4 : number ->3 : number ->4 : number ->6 : number +>3 : 3 +>4 : 4 +>6 : 6 var a4 = 1 + `${ 3 & 4 }`; >a4 : string >1 + `${ 3 & 4 }` : string ->1 : number +>1 : 1 >`${ 3 & 4 }` : string >3 & 4 : number ->3 : number ->4 : number +>3 : 3 +>4 : 4 var b4 = 1 + `2${ 3 & 4 }`; >b4 : string >1 + `2${ 3 & 4 }` : string ->1 : number +>1 : 1 >`2${ 3 & 4 }` : string >3 & 4 : number ->3 : number ->4 : number +>3 : 3 +>4 : 4 var c4 = 1 + `${ 3 & 4 }5`; >c4 : string >1 + `${ 3 & 4 }5` : string ->1 : number +>1 : 1 >`${ 3 & 4 }5` : string >3 & 4 : number ->3 : number ->4 : number +>3 : 3 +>4 : 4 var d4 = 1 + `2${ 3 & 4 }5`; >d4 : string >1 + `2${ 3 & 4 }5` : string ->1 : number +>1 : 1 >`2${ 3 & 4 }5` : string >3 & 4 : number ->3 : number ->4 : number +>3 : 3 +>4 : 4 var e4 = `${ 3 & 4 }` + 6; >e4 : string >`${ 3 & 4 }` + 6 : string >`${ 3 & 4 }` : string >3 & 4 : number ->3 : number ->4 : number ->6 : number +>3 : 3 +>4 : 4 +>6 : 6 var f4 = `2${ 3 & 4 }` + 6; >f4 : string >`2${ 3 & 4 }` + 6 : string >`2${ 3 & 4 }` : string >3 & 4 : number ->3 : number ->4 : number ->6 : number +>3 : 3 +>4 : 4 +>6 : 6 var g4 = `${ 3 & 4 }5` + 6; >g4 : string >`${ 3 & 4 }5` + 6 : string >`${ 3 & 4 }5` : string >3 & 4 : number ->3 : number ->4 : number ->6 : number +>3 : 3 +>4 : 4 +>6 : 6 var h4 = `2${ 3 & 4 }5` + 6; >h4 : string >`2${ 3 & 4 }5` + 6 : string >`2${ 3 & 4 }5` : string >3 & 4 : number ->3 : number ->4 : number ->6 : number +>3 : 3 +>4 : 4 +>6 : 6 var i4 = 1 + `${ 3 & 4 }` + 6; >i4 : string >1 + `${ 3 & 4 }` + 6 : string >1 + `${ 3 & 4 }` : string ->1 : number +>1 : 1 >`${ 3 & 4 }` : string >3 & 4 : number ->3 : number ->4 : number ->6 : number +>3 : 3 +>4 : 4 +>6 : 6 var j4 = 1 + `2${ 3 & 4 }` + 6; >j4 : string >1 + `2${ 3 & 4 }` + 6 : string >1 + `2${ 3 & 4 }` : string ->1 : number +>1 : 1 >`2${ 3 & 4 }` : string >3 & 4 : number ->3 : number ->4 : number ->6 : number +>3 : 3 +>4 : 4 +>6 : 6 var k4 = 1 + `${ 3 & 4 }5` + 6; >k4 : string >1 + `${ 3 & 4 }5` + 6 : string >1 + `${ 3 & 4 }5` : string ->1 : number +>1 : 1 >`${ 3 & 4 }5` : string >3 & 4 : number ->3 : number ->4 : number ->6 : number +>3 : 3 +>4 : 4 +>6 : 6 var l4 = 1 + `2${ 3 & 4 }5` + 6; >l4 : string >1 + `2${ 3 & 4 }5` + 6 : string >1 + `2${ 3 & 4 }5` : string ->1 : number +>1 : 1 >`2${ 3 & 4 }5` : string >3 & 4 : number ->3 : number ->4 : number ->6 : number +>3 : 3 +>4 : 4 +>6 : 6 diff --git a/tests/baselines/reference/templateStringInArray.types b/tests/baselines/reference/templateStringInArray.types index 04cc09a1005..03271a5dcd7 100644 --- a/tests/baselines/reference/templateStringInArray.types +++ b/tests/baselines/reference/templateStringInArray.types @@ -2,8 +2,8 @@ var x = [1, 2, `abc${ 123 }def`]; >x : (string | number)[] >[1, 2, `abc${ 123 }def`] : (string | number)[] ->1 : number ->2 : number +>1 : 1 +>2 : 2 >`abc${ 123 }def` : string ->123 : number +>123 : 123 diff --git a/tests/baselines/reference/templateStringInCallExpression.errors.txt b/tests/baselines/reference/templateStringInCallExpression.errors.txt index c483fd9d4c0..cd5e2ff7c63 100644 --- a/tests/baselines/reference/templateStringInCallExpression.errors.txt +++ b/tests/baselines/reference/templateStringInCallExpression.errors.txt @@ -1,7 +1,7 @@ -tests/cases/conformance/es6/templates/templateStringInCallExpression.ts(1,1): error TS2349: Cannot invoke an expression whose type lacks a call signature. +tests/cases/conformance/es6/templates/templateStringInCallExpression.ts(1,1): error TS2349: Cannot invoke an expression whose type lacks a call signature. Type 'String' has no compatible call signatures. ==== tests/cases/conformance/es6/templates/templateStringInCallExpression.ts (1 errors) ==== `abc${0}abc`(`hello ${0} world`, ` `, `1${2}3`); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2349: Cannot invoke an expression whose type lacks a call signature. \ No newline at end of file +!!! error TS2349: Cannot invoke an expression whose type lacks a call signature. Type 'String' has no compatible call signatures. \ No newline at end of file diff --git a/tests/baselines/reference/templateStringInCallExpressionES6.errors.txt b/tests/baselines/reference/templateStringInCallExpressionES6.errors.txt index 7a391b6afe7..fd47a8001ad 100644 --- a/tests/baselines/reference/templateStringInCallExpressionES6.errors.txt +++ b/tests/baselines/reference/templateStringInCallExpressionES6.errors.txt @@ -1,7 +1,7 @@ -tests/cases/conformance/es6/templates/templateStringInCallExpressionES6.ts(1,1): error TS2349: Cannot invoke an expression whose type lacks a call signature. +tests/cases/conformance/es6/templates/templateStringInCallExpressionES6.ts(1,1): error TS2349: Cannot invoke an expression whose type lacks a call signature. Type 'String' has no compatible call signatures. ==== tests/cases/conformance/es6/templates/templateStringInCallExpressionES6.ts (1 errors) ==== `abc${0}abc`(`hello ${0} world`, ` `, `1${2}3`); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2349: Cannot invoke an expression whose type lacks a call signature. \ No newline at end of file +!!! error TS2349: Cannot invoke an expression whose type lacks a call signature. Type 'String' has no compatible call signatures. \ No newline at end of file diff --git a/tests/baselines/reference/templateStringInConditional.types b/tests/baselines/reference/templateStringInConditional.types index bb5de339533..a375d572a5d 100644 --- a/tests/baselines/reference/templateStringInConditional.types +++ b/tests/baselines/reference/templateStringInConditional.types @@ -3,9 +3,9 @@ var x = `abc${ " " }def` ? `abc${ " " }def` : `abc${ " " }def`; >x : string >`abc${ " " }def` ? `abc${ " " }def` : `abc${ " " }def` : string >`abc${ " " }def` : string ->" " : string +>" " : " " >`abc${ " " }def` : string ->" " : string +>" " : " " >`abc${ " " }def` : string ->" " : string +>" " : " " diff --git a/tests/baselines/reference/templateStringInConditionalES6.types b/tests/baselines/reference/templateStringInConditionalES6.types index 060b81b2ab7..0f65ab22977 100644 --- a/tests/baselines/reference/templateStringInConditionalES6.types +++ b/tests/baselines/reference/templateStringInConditionalES6.types @@ -3,9 +3,9 @@ var x = `abc${ " " }def` ? `abc${ " " }def` : `abc${ " " }def`; >x : string >`abc${ " " }def` ? `abc${ " " }def` : `abc${ " " }def` : string >`abc${ " " }def` : string ->" " : string +>" " : " " >`abc${ " " }def` : string ->" " : string +>" " : " " >`abc${ " " }def` : string ->" " : string +>" " : " " diff --git a/tests/baselines/reference/templateStringInDeleteExpression.types b/tests/baselines/reference/templateStringInDeleteExpression.types index ff950555fb9..1ae84e4e2ff 100644 --- a/tests/baselines/reference/templateStringInDeleteExpression.types +++ b/tests/baselines/reference/templateStringInDeleteExpression.types @@ -2,5 +2,5 @@ delete `abc${0}abc`; >delete `abc${0}abc` : boolean >`abc${0}abc` : string ->0 : number +>0 : 0 diff --git a/tests/baselines/reference/templateStringInDeleteExpressionES6.types b/tests/baselines/reference/templateStringInDeleteExpressionES6.types index a182754dc68..80569e533e4 100644 --- a/tests/baselines/reference/templateStringInDeleteExpressionES6.types +++ b/tests/baselines/reference/templateStringInDeleteExpressionES6.types @@ -2,5 +2,5 @@ delete `abc${0}abc`; >delete `abc${0}abc` : boolean >`abc${0}abc` : string ->0 : number +>0 : 0 diff --git a/tests/baselines/reference/templateStringInEqualityChecks.types b/tests/baselines/reference/templateStringInEqualityChecks.types index 2f1b2cf987b..dd78aa131d4 100644 --- a/tests/baselines/reference/templateStringInEqualityChecks.types +++ b/tests/baselines/reference/templateStringInEqualityChecks.types @@ -4,7 +4,7 @@ var x = `abc${0}abc` === `abc` || >`abc${0}abc` === `abc` || `abc` !== `abc${0}abc` && `abc${0}abc` == "abc0abc" && "abc0abc" !== `abc${0}abc` : boolean >`abc${0}abc` === `abc` : boolean >`abc${0}abc` : string ->0 : number +>0 : 0 >`abc` : string `abc` !== `abc${0}abc` && @@ -13,17 +13,17 @@ var x = `abc${0}abc` === `abc` || >`abc` !== `abc${0}abc` : boolean >`abc` : string >`abc${0}abc` : string ->0 : number +>0 : 0 `abc${0}abc` == "abc0abc" && >`abc${0}abc` == "abc0abc" : boolean >`abc${0}abc` : string ->0 : number +>0 : 0 >"abc0abc" : "abc0abc" "abc0abc" !== `abc${0}abc`; >"abc0abc" !== `abc${0}abc` : boolean >"abc0abc" : "abc0abc" >`abc${0}abc` : string ->0 : number +>0 : 0 diff --git a/tests/baselines/reference/templateStringInEqualityChecksES6.types b/tests/baselines/reference/templateStringInEqualityChecksES6.types index ce552da09ea..b3ef2b89720 100644 --- a/tests/baselines/reference/templateStringInEqualityChecksES6.types +++ b/tests/baselines/reference/templateStringInEqualityChecksES6.types @@ -4,7 +4,7 @@ var x = `abc${0}abc` === `abc` || >`abc${0}abc` === `abc` || `abc` !== `abc${0}abc` && `abc${0}abc` == "abc0abc" && "abc0abc" !== `abc${0}abc` : boolean >`abc${0}abc` === `abc` : boolean >`abc${0}abc` : string ->0 : number +>0 : 0 >`abc` : string `abc` !== `abc${0}abc` && @@ -13,17 +13,17 @@ var x = `abc${0}abc` === `abc` || >`abc` !== `abc${0}abc` : boolean >`abc` : string >`abc${0}abc` : string ->0 : number +>0 : 0 `abc${0}abc` == "abc0abc" && >`abc${0}abc` == "abc0abc" : boolean >`abc${0}abc` : string ->0 : number +>0 : 0 >"abc0abc" : "abc0abc" "abc0abc" !== `abc${0}abc`; >"abc0abc" !== `abc${0}abc` : boolean >"abc0abc" : "abc0abc" >`abc${0}abc` : string ->0 : number +>0 : 0 diff --git a/tests/baselines/reference/templateStringInFunctionExpression.types b/tests/baselines/reference/templateStringInFunctionExpression.types index 62e34b5fc2d..af92d867acd 100644 --- a/tests/baselines/reference/templateStringInFunctionExpression.types +++ b/tests/baselines/reference/templateStringInFunctionExpression.types @@ -6,10 +6,10 @@ var x = function y() { `abc${ 0 }def` >`abc${ 0 }def` : string ->0 : number +>0 : 0 return `abc${ 0 }def`; >`abc${ 0 }def` : string ->0 : number +>0 : 0 }; diff --git a/tests/baselines/reference/templateStringInFunctionExpressionES6.types b/tests/baselines/reference/templateStringInFunctionExpressionES6.types index 268928125c5..2ab90b9e374 100644 --- a/tests/baselines/reference/templateStringInFunctionExpressionES6.types +++ b/tests/baselines/reference/templateStringInFunctionExpressionES6.types @@ -6,10 +6,10 @@ var x = function y() { `abc${ 0 }def` >`abc${ 0 }def` : string ->0 : number +>0 : 0 return `abc${ 0 }def`; >`abc${ 0 }def` : string ->0 : number +>0 : 0 }; diff --git a/tests/baselines/reference/templateStringInInOperator.types b/tests/baselines/reference/templateStringInInOperator.types index 881f37221fe..5ed944af496 100644 --- a/tests/baselines/reference/templateStringInInOperator.types +++ b/tests/baselines/reference/templateStringInInOperator.types @@ -3,10 +3,10 @@ var x = `${ "hi" }` in { hi: 10, hello: 20}; >x : boolean >`${ "hi" }` in { hi: 10, hello: 20} : boolean >`${ "hi" }` : string ->"hi" : string +>"hi" : "hi" >{ hi: 10, hello: 20} : { hi: number; hello: number; } >hi : number ->10 : number +>10 : 10 >hello : number ->20 : number +>20 : 20 diff --git a/tests/baselines/reference/templateStringInInOperatorES6.types b/tests/baselines/reference/templateStringInInOperatorES6.types index 4297338ba56..335b77380c2 100644 --- a/tests/baselines/reference/templateStringInInOperatorES6.types +++ b/tests/baselines/reference/templateStringInInOperatorES6.types @@ -3,10 +3,10 @@ var x = `${ "hi" }` in { hi: 10, hello: 20}; >x : boolean >`${ "hi" }` in { hi: 10, hello: 20} : boolean >`${ "hi" }` : string ->"hi" : string +>"hi" : "hi" >{ hi: 10, hello: 20} : { hi: number; hello: number; } >hi : number ->10 : number +>10 : 10 >hello : number ->20 : number +>20 : 20 diff --git a/tests/baselines/reference/templateStringInIndexExpression.types b/tests/baselines/reference/templateStringInIndexExpression.types index ff5461158ab..b453c37f4c5 100644 --- a/tests/baselines/reference/templateStringInIndexExpression.types +++ b/tests/baselines/reference/templateStringInIndexExpression.types @@ -2,6 +2,6 @@ `abc${0}abc`[`0`]; >`abc${0}abc`[`0`] : any >`abc${0}abc` : string ->0 : number +>0 : 0 >`0` : string diff --git a/tests/baselines/reference/templateStringInIndexExpressionES6.types b/tests/baselines/reference/templateStringInIndexExpressionES6.types index 153bed9f97a..b7be602e893 100644 --- a/tests/baselines/reference/templateStringInIndexExpressionES6.types +++ b/tests/baselines/reference/templateStringInIndexExpressionES6.types @@ -2,6 +2,6 @@ `abc${0}abc`[`0`]; >`abc${0}abc`[`0`] : any >`abc${0}abc` : string ->0 : number +>0 : 0 >`0` : string diff --git a/tests/baselines/reference/templateStringInObjectLiteral.errors.txt b/tests/baselines/reference/templateStringInObjectLiteral.errors.txt index dcc8d565b75..234ccfdcae5 100644 --- a/tests/baselines/reference/templateStringInObjectLiteral.errors.txt +++ b/tests/baselines/reference/templateStringInObjectLiteral.errors.txt @@ -1,4 +1,4 @@ -tests/cases/conformance/es6/templates/templateStringInObjectLiteral.ts(1,9): error TS2349: Cannot invoke an expression whose type lacks a call signature. +tests/cases/conformance/es6/templates/templateStringInObjectLiteral.ts(1,9): error TS2349: Cannot invoke an expression whose type lacks a call signature. Type '{ a: string; }' has no compatible call signatures. tests/cases/conformance/es6/templates/templateStringInObjectLiteral.ts(3,5): error TS1136: Property assignment expected. tests/cases/conformance/es6/templates/templateStringInObjectLiteral.ts(3,8): error TS1005: ',' expected. tests/cases/conformance/es6/templates/templateStringInObjectLiteral.ts(3,10): error TS1134: Variable declaration expected. @@ -12,7 +12,7 @@ tests/cases/conformance/es6/templates/templateStringInObjectLiteral.ts(4,1): err ~~~~~~~~~~~~~~~~~~~~~~~~ `b`: 321 ~~~~~~~ -!!! error TS2349: Cannot invoke an expression whose type lacks a call signature. +!!! error TS2349: Cannot invoke an expression whose type lacks a call signature. Type '{ a: string; }' has no compatible call signatures. ~~~ !!! error TS1136: Property assignment expected. ~ diff --git a/tests/baselines/reference/templateStringInObjectLiteralES6.errors.txt b/tests/baselines/reference/templateStringInObjectLiteralES6.errors.txt index ab914fabb8b..4c78dbea2cb 100644 --- a/tests/baselines/reference/templateStringInObjectLiteralES6.errors.txt +++ b/tests/baselines/reference/templateStringInObjectLiteralES6.errors.txt @@ -1,4 +1,4 @@ -tests/cases/conformance/es6/templates/templateStringInObjectLiteralES6.ts(1,9): error TS2349: Cannot invoke an expression whose type lacks a call signature. +tests/cases/conformance/es6/templates/templateStringInObjectLiteralES6.ts(1,9): error TS2349: Cannot invoke an expression whose type lacks a call signature. Type '{ a: string; }' has no compatible call signatures. tests/cases/conformance/es6/templates/templateStringInObjectLiteralES6.ts(3,5): error TS1136: Property assignment expected. tests/cases/conformance/es6/templates/templateStringInObjectLiteralES6.ts(3,8): error TS1005: ',' expected. tests/cases/conformance/es6/templates/templateStringInObjectLiteralES6.ts(3,10): error TS1134: Variable declaration expected. @@ -12,7 +12,7 @@ tests/cases/conformance/es6/templates/templateStringInObjectLiteralES6.ts(4,1): ~~~~~~~~~~~~~~~~~~~~~~~~ `b`: 321 ~~~~~~~ -!!! error TS2349: Cannot invoke an expression whose type lacks a call signature. +!!! error TS2349: Cannot invoke an expression whose type lacks a call signature. Type '{ a: string; }' has no compatible call signatures. ~~~ !!! error TS1136: Property assignment expected. ~ diff --git a/tests/baselines/reference/templateStringInParentheses.types b/tests/baselines/reference/templateStringInParentheses.types index 29436a32d2a..ca9b328d5b5 100644 --- a/tests/baselines/reference/templateStringInParentheses.types +++ b/tests/baselines/reference/templateStringInParentheses.types @@ -3,5 +3,5 @@ var x = (`abc${0}abc`); >x : string >(`abc${0}abc`) : string >`abc${0}abc` : string ->0 : number +>0 : 0 diff --git a/tests/baselines/reference/templateStringInParenthesesES6.types b/tests/baselines/reference/templateStringInParenthesesES6.types index 0d4d89ef3a9..518ad880918 100644 --- a/tests/baselines/reference/templateStringInParenthesesES6.types +++ b/tests/baselines/reference/templateStringInParenthesesES6.types @@ -3,5 +3,5 @@ var x = (`abc${0}abc`); >x : string >(`abc${0}abc`) : string >`abc${0}abc` : string ->0 : number +>0 : 0 diff --git a/tests/baselines/reference/templateStringInPropertyAssignment.types b/tests/baselines/reference/templateStringInPropertyAssignment.types index a8ba0351311..c47a921e941 100644 --- a/tests/baselines/reference/templateStringInPropertyAssignment.types +++ b/tests/baselines/reference/templateStringInPropertyAssignment.types @@ -6,6 +6,6 @@ var x = { a: `abc${ 123 }def${ 456 }ghi` >a : string >`abc${ 123 }def${ 456 }ghi` : string ->123 : number ->456 : number +>123 : 123 +>456 : 456 } diff --git a/tests/baselines/reference/templateStringInPropertyAssignmentES6.types b/tests/baselines/reference/templateStringInPropertyAssignmentES6.types index 5da8d9ac6f9..43a9e0f5507 100644 --- a/tests/baselines/reference/templateStringInPropertyAssignmentES6.types +++ b/tests/baselines/reference/templateStringInPropertyAssignmentES6.types @@ -6,6 +6,6 @@ var x = { a: `abc${ 123 }def${ 456 }ghi` >a : string >`abc${ 123 }def${ 456 }ghi` : string ->123 : number ->456 : number +>123 : 123 +>456 : 456 } diff --git a/tests/baselines/reference/templateStringInPropertyName1.errors.txt b/tests/baselines/reference/templateStringInPropertyName1.errors.txt index 306c6a651e4..15f4415611b 100644 --- a/tests/baselines/reference/templateStringInPropertyName1.errors.txt +++ b/tests/baselines/reference/templateStringInPropertyName1.errors.txt @@ -1,4 +1,4 @@ -tests/cases/conformance/es6/templates/templateStringInPropertyName1.ts(1,9): error TS2349: Cannot invoke an expression whose type lacks a call signature. +tests/cases/conformance/es6/templates/templateStringInPropertyName1.ts(1,9): error TS2349: Cannot invoke an expression whose type lacks a call signature. Type '{}' has no compatible call signatures. tests/cases/conformance/es6/templates/templateStringInPropertyName1.ts(2,5): error TS1136: Property assignment expected. tests/cases/conformance/es6/templates/templateStringInPropertyName1.ts(2,8): error TS1005: ',' expected. tests/cases/conformance/es6/templates/templateStringInPropertyName1.ts(2,10): error TS1134: Variable declaration expected. @@ -10,7 +10,7 @@ tests/cases/conformance/es6/templates/templateStringInPropertyName1.ts(3,1): err ~ `a`: 321 ~~~~~~~ -!!! error TS2349: Cannot invoke an expression whose type lacks a call signature. +!!! error TS2349: Cannot invoke an expression whose type lacks a call signature. Type '{}' has no compatible call signatures. ~~~ !!! error TS1136: Property assignment expected. ~ diff --git a/tests/baselines/reference/templateStringInPropertyName2.errors.txt b/tests/baselines/reference/templateStringInPropertyName2.errors.txt index e004eec9bba..d9e5d73dd06 100644 --- a/tests/baselines/reference/templateStringInPropertyName2.errors.txt +++ b/tests/baselines/reference/templateStringInPropertyName2.errors.txt @@ -1,4 +1,4 @@ -tests/cases/conformance/es6/templates/templateStringInPropertyName2.ts(1,9): error TS2349: Cannot invoke an expression whose type lacks a call signature. +tests/cases/conformance/es6/templates/templateStringInPropertyName2.ts(1,9): error TS2349: Cannot invoke an expression whose type lacks a call signature. Type '{}' has no compatible call signatures. tests/cases/conformance/es6/templates/templateStringInPropertyName2.ts(2,5): error TS1136: Property assignment expected. tests/cases/conformance/es6/templates/templateStringInPropertyName2.ts(2,32): error TS1005: ',' expected. tests/cases/conformance/es6/templates/templateStringInPropertyName2.ts(2,34): error TS1134: Variable declaration expected. @@ -10,7 +10,7 @@ tests/cases/conformance/es6/templates/templateStringInPropertyName2.ts(3,1): err ~ `abc${ 123 }def${ 456 }ghi`: 321 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2349: Cannot invoke an expression whose type lacks a call signature. +!!! error TS2349: Cannot invoke an expression whose type lacks a call signature. Type '{}' has no compatible call signatures. ~~~~~~ !!! error TS1136: Property assignment expected. ~ diff --git a/tests/baselines/reference/templateStringInPropertyNameES6_1.errors.txt b/tests/baselines/reference/templateStringInPropertyNameES6_1.errors.txt index 3576effe560..620b3248558 100644 --- a/tests/baselines/reference/templateStringInPropertyNameES6_1.errors.txt +++ b/tests/baselines/reference/templateStringInPropertyNameES6_1.errors.txt @@ -1,4 +1,4 @@ -tests/cases/conformance/es6/templates/templateStringInPropertyNameES6_1.ts(1,9): error TS2349: Cannot invoke an expression whose type lacks a call signature. +tests/cases/conformance/es6/templates/templateStringInPropertyNameES6_1.ts(1,9): error TS2349: Cannot invoke an expression whose type lacks a call signature. Type '{}' has no compatible call signatures. tests/cases/conformance/es6/templates/templateStringInPropertyNameES6_1.ts(2,5): error TS1136: Property assignment expected. tests/cases/conformance/es6/templates/templateStringInPropertyNameES6_1.ts(2,8): error TS1005: ',' expected. tests/cases/conformance/es6/templates/templateStringInPropertyNameES6_1.ts(2,10): error TS1134: Variable declaration expected. @@ -10,7 +10,7 @@ tests/cases/conformance/es6/templates/templateStringInPropertyNameES6_1.ts(3,1): ~ `a`: 321 ~~~~~~~ -!!! error TS2349: Cannot invoke an expression whose type lacks a call signature. +!!! error TS2349: Cannot invoke an expression whose type lacks a call signature. Type '{}' has no compatible call signatures. ~~~ !!! error TS1136: Property assignment expected. ~ diff --git a/tests/baselines/reference/templateStringInPropertyNameES6_2.errors.txt b/tests/baselines/reference/templateStringInPropertyNameES6_2.errors.txt index 37e7dc8c0f8..00ef4e511bc 100644 --- a/tests/baselines/reference/templateStringInPropertyNameES6_2.errors.txt +++ b/tests/baselines/reference/templateStringInPropertyNameES6_2.errors.txt @@ -1,4 +1,4 @@ -tests/cases/conformance/es6/templates/templateStringInPropertyNameES6_2.ts(1,9): error TS2349: Cannot invoke an expression whose type lacks a call signature. +tests/cases/conformance/es6/templates/templateStringInPropertyNameES6_2.ts(1,9): error TS2349: Cannot invoke an expression whose type lacks a call signature. Type '{}' has no compatible call signatures. tests/cases/conformance/es6/templates/templateStringInPropertyNameES6_2.ts(2,5): error TS1136: Property assignment expected. tests/cases/conformance/es6/templates/templateStringInPropertyNameES6_2.ts(2,32): error TS1005: ',' expected. tests/cases/conformance/es6/templates/templateStringInPropertyNameES6_2.ts(2,34): error TS1134: Variable declaration expected. @@ -10,7 +10,7 @@ tests/cases/conformance/es6/templates/templateStringInPropertyNameES6_2.ts(3,1): ~ `abc${ 123 }def${ 456 }ghi`: 321 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2349: Cannot invoke an expression whose type lacks a call signature. +!!! error TS2349: Cannot invoke an expression whose type lacks a call signature. Type '{}' has no compatible call signatures. ~~~~~~ !!! error TS1136: Property assignment expected. ~ diff --git a/tests/baselines/reference/templateStringInSwitchAndCase.types b/tests/baselines/reference/templateStringInSwitchAndCase.types index 0949aa21fde..a0f8602167a 100644 --- a/tests/baselines/reference/templateStringInSwitchAndCase.types +++ b/tests/baselines/reference/templateStringInSwitchAndCase.types @@ -1,7 +1,7 @@ === tests/cases/conformance/es6/templates/templateStringInSwitchAndCase.ts === switch (`abc${0}abc`) { >`abc${0}abc` : string ->0 : number +>0 : 0 case `abc`: >`abc` : string @@ -11,9 +11,9 @@ switch (`abc${0}abc`) { case `abc${0}abc`: >`abc${0}abc` : string ->0 : number +>0 : 0 `def${1}def`; >`def${1}def` : string ->1 : number +>1 : 1 } diff --git a/tests/baselines/reference/templateStringInSwitchAndCaseES6.types b/tests/baselines/reference/templateStringInSwitchAndCaseES6.types index a9ba35c8599..0cde7e58756 100644 --- a/tests/baselines/reference/templateStringInSwitchAndCaseES6.types +++ b/tests/baselines/reference/templateStringInSwitchAndCaseES6.types @@ -1,7 +1,7 @@ === tests/cases/conformance/es6/templates/templateStringInSwitchAndCaseES6.ts === switch (`abc${0}abc`) { >`abc${0}abc` : string ->0 : number +>0 : 0 case `abc`: >`abc` : string @@ -11,9 +11,9 @@ switch (`abc${0}abc`) { case `abc${0}abc`: >`abc${0}abc` : string ->0 : number +>0 : 0 `def${1}def`; >`def${1}def` : string ->1 : number +>1 : 1 } diff --git a/tests/baselines/reference/templateStringInTaggedTemplate.errors.txt b/tests/baselines/reference/templateStringInTaggedTemplate.errors.txt index 18ce24a0b3b..9494f03a8bf 100644 --- a/tests/baselines/reference/templateStringInTaggedTemplate.errors.txt +++ b/tests/baselines/reference/templateStringInTaggedTemplate.errors.txt @@ -1,7 +1,7 @@ -tests/cases/conformance/es6/templates/templateStringInTaggedTemplate.ts(1,1): error TS2349: Cannot invoke an expression whose type lacks a call signature. +tests/cases/conformance/es6/templates/templateStringInTaggedTemplate.ts(1,1): error TS2349: Cannot invoke an expression whose type lacks a call signature. Type 'String' has no compatible call signatures. ==== tests/cases/conformance/es6/templates/templateStringInTaggedTemplate.ts (1 errors) ==== `I AM THE ${ `${ `TAG` } ` } PORTION` `I ${ "AM" } THE TEMPLATE PORTION` ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2349: Cannot invoke an expression whose type lacks a call signature. \ No newline at end of file +!!! error TS2349: Cannot invoke an expression whose type lacks a call signature. Type 'String' has no compatible call signatures. \ No newline at end of file diff --git a/tests/baselines/reference/templateStringInTaggedTemplateES6.errors.txt b/tests/baselines/reference/templateStringInTaggedTemplateES6.errors.txt index fd30d7f4074..581e084e738 100644 --- a/tests/baselines/reference/templateStringInTaggedTemplateES6.errors.txt +++ b/tests/baselines/reference/templateStringInTaggedTemplateES6.errors.txt @@ -1,7 +1,7 @@ -tests/cases/conformance/es6/templates/templateStringInTaggedTemplateES6.ts(1,1): error TS2349: Cannot invoke an expression whose type lacks a call signature. +tests/cases/conformance/es6/templates/templateStringInTaggedTemplateES6.ts(1,1): error TS2349: Cannot invoke an expression whose type lacks a call signature. Type 'String' has no compatible call signatures. ==== tests/cases/conformance/es6/templates/templateStringInTaggedTemplateES6.ts (1 errors) ==== `I AM THE ${ `${ `TAG` } ` } PORTION` `I ${ "AM" } THE TEMPLATE PORTION` ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2349: Cannot invoke an expression whose type lacks a call signature. \ No newline at end of file +!!! error TS2349: Cannot invoke an expression whose type lacks a call signature. Type 'String' has no compatible call signatures. \ No newline at end of file diff --git a/tests/baselines/reference/templateStringInTypeAssertion.types b/tests/baselines/reference/templateStringInTypeAssertion.types index 73ed437adb3..c8950634a36 100644 --- a/tests/baselines/reference/templateStringInTypeAssertion.types +++ b/tests/baselines/reference/templateStringInTypeAssertion.types @@ -3,5 +3,5 @@ var x = `abc${ 123 }def`; >x : any >`abc${ 123 }def` : any >`abc${ 123 }def` : string ->123 : number +>123 : 123 diff --git a/tests/baselines/reference/templateStringInTypeAssertionES6.types b/tests/baselines/reference/templateStringInTypeAssertionES6.types index 26d4689f939..becccd73738 100644 --- a/tests/baselines/reference/templateStringInTypeAssertionES6.types +++ b/tests/baselines/reference/templateStringInTypeAssertionES6.types @@ -3,5 +3,5 @@ var x = `abc${ 123 }def`; >x : any >`abc${ 123 }def` : any >`abc${ 123 }def` : string ->123 : number +>123 : 123 diff --git a/tests/baselines/reference/templateStringInTypeOf.types b/tests/baselines/reference/templateStringInTypeOf.types index 550828b3a47..0d7d26a82b2 100644 --- a/tests/baselines/reference/templateStringInTypeOf.types +++ b/tests/baselines/reference/templateStringInTypeOf.types @@ -3,5 +3,5 @@ var x = typeof `abc${ 123 }def`; >x : string >typeof `abc${ 123 }def` : string >`abc${ 123 }def` : string ->123 : number +>123 : 123 diff --git a/tests/baselines/reference/templateStringInTypeOfES6.types b/tests/baselines/reference/templateStringInTypeOfES6.types index b04e37426a4..ad142d13fe5 100644 --- a/tests/baselines/reference/templateStringInTypeOfES6.types +++ b/tests/baselines/reference/templateStringInTypeOfES6.types @@ -3,5 +3,5 @@ var x = typeof `abc${ 123 }def`; >x : string >typeof `abc${ 123 }def` : string >`abc${ 123 }def` : string ->123 : number +>123 : 123 diff --git a/tests/baselines/reference/templateStringInUnaryPlus.types b/tests/baselines/reference/templateStringInUnaryPlus.types index bab86198433..aa2b4fe4f2d 100644 --- a/tests/baselines/reference/templateStringInUnaryPlus.types +++ b/tests/baselines/reference/templateStringInUnaryPlus.types @@ -3,5 +3,5 @@ var x = +`abc${ 123 }def`; >x : number >+`abc${ 123 }def` : number >`abc${ 123 }def` : string ->123 : number +>123 : 123 diff --git a/tests/baselines/reference/templateStringInUnaryPlusES6.types b/tests/baselines/reference/templateStringInUnaryPlusES6.types index d632e8e2965..8286fa8b6c1 100644 --- a/tests/baselines/reference/templateStringInUnaryPlusES6.types +++ b/tests/baselines/reference/templateStringInUnaryPlusES6.types @@ -3,5 +3,5 @@ var x = +`abc${ 123 }def`; >x : number >+`abc${ 123 }def` : number >`abc${ 123 }def` : string ->123 : number +>123 : 123 diff --git a/tests/baselines/reference/templateStringInWhile.types b/tests/baselines/reference/templateStringInWhile.types index fe4931455e2..c0914ee771c 100644 --- a/tests/baselines/reference/templateStringInWhile.types +++ b/tests/baselines/reference/templateStringInWhile.types @@ -1,9 +1,9 @@ === tests/cases/conformance/es6/templates/templateStringInWhile.ts === while (`abc${0}abc`) { >`abc${0}abc` : string ->0 : number +>0 : 0 `def${1}def`; >`def${1}def` : string ->1 : number +>1 : 1 } diff --git a/tests/baselines/reference/templateStringInWhileES6.types b/tests/baselines/reference/templateStringInWhileES6.types index ef2c3d02cae..29119d7f77e 100644 --- a/tests/baselines/reference/templateStringInWhileES6.types +++ b/tests/baselines/reference/templateStringInWhileES6.types @@ -1,9 +1,9 @@ === tests/cases/conformance/es6/templates/templateStringInWhileES6.ts === while (`abc${0}abc`) { >`abc${0}abc` : string ->0 : number +>0 : 0 `def${1}def`; >`def${1}def` : string ->1 : number +>1 : 1 } diff --git a/tests/baselines/reference/templateStringPlainCharactersThatArePartsOfEscapes02.types b/tests/baselines/reference/templateStringPlainCharactersThatArePartsOfEscapes02.types index e7cc81af06c..62d0190586a 100644 --- a/tests/baselines/reference/templateStringPlainCharactersThatArePartsOfEscapes02.types +++ b/tests/baselines/reference/templateStringPlainCharactersThatArePartsOfEscapes02.types @@ -3,33 +3,33 @@ `0${ " " }1${ " " }2${ " " }3${ " " }4${ " " }5${ " " }6${ " " }7${ " " }8${ " " }9${ " " }10${ " " }11${ " " }12${ " " }13${ " " }14${ " " }15${ " " }16${ " " }17${ " " }18${ " " }19${ " " }20${ " " }2028${ " " }2029${ " " }0085${ " " }t${ " " }v${ " " }f${ " " }b${ " " }r${ " " }n` >`0${ " " }1${ " " }2${ " " }3${ " " }4${ " " }5${ " " }6${ " " }7${ " " }8${ " " }9${ " " }10${ " " }11${ " " }12${ " " }13${ " " }14${ " " }15${ " " }16${ " " }17${ " " }18${ " " }19${ " " }20${ " " }2028${ " " }2029${ " " }0085${ " " }t${ " " }v${ " " }f${ " " }b${ " " }r${ " " }n` : string ->" " : string ->" " : string ->" " : string ->" " : string ->" " : string ->" " : string ->" " : string ->" " : string ->" " : string ->" " : string ->" " : string ->" " : string ->" " : string ->" " : string ->" " : string ->" " : string ->" " : string ->" " : string ->" " : string ->" " : string ->" " : string ->" " : string ->" " : string ->" " : string ->" " : string ->" " : string ->" " : string ->" " : string ->" " : string +>" " : " " +>" " : " " +>" " : " " +>" " : " " +>" " : " " +>" " : " " +>" " : " " +>" " : " " +>" " : " " +>" " : " " +>" " : " " +>" " : " " +>" " : " " +>" " : " " +>" " : " " +>" " : " " +>" " : " " +>" " : " " +>" " : " " +>" " : " " +>" " : " " +>" " : " " +>" " : " " +>" " : " " +>" " : " " +>" " : " " +>" " : " " +>" " : " " +>" " : " " diff --git a/tests/baselines/reference/templateStringPlainCharactersThatArePartsOfEscapes02_ES6.types b/tests/baselines/reference/templateStringPlainCharactersThatArePartsOfEscapes02_ES6.types index 9b91b5db72c..cf07cae5b93 100644 --- a/tests/baselines/reference/templateStringPlainCharactersThatArePartsOfEscapes02_ES6.types +++ b/tests/baselines/reference/templateStringPlainCharactersThatArePartsOfEscapes02_ES6.types @@ -2,33 +2,33 @@ `0${ " " }1${ " " }2${ " " }3${ " " }4${ " " }5${ " " }6${ " " }7${ " " }8${ " " }9${ " " }10${ " " }11${ " " }12${ " " }13${ " " }14${ " " }15${ " " }16${ " " }17${ " " }18${ " " }19${ " " }20${ " " }2028${ " " }2029${ " " }0085${ " " }t${ " " }v${ " " }f${ " " }b${ " " }r${ " " }n` >`0${ " " }1${ " " }2${ " " }3${ " " }4${ " " }5${ " " }6${ " " }7${ " " }8${ " " }9${ " " }10${ " " }11${ " " }12${ " " }13${ " " }14${ " " }15${ " " }16${ " " }17${ " " }18${ " " }19${ " " }20${ " " }2028${ " " }2029${ " " }0085${ " " }t${ " " }v${ " " }f${ " " }b${ " " }r${ " " }n` : string ->" " : string ->" " : string ->" " : string ->" " : string ->" " : string ->" " : string ->" " : string ->" " : string ->" " : string ->" " : string ->" " : string ->" " : string ->" " : string ->" " : string ->" " : string ->" " : string ->" " : string ->" " : string ->" " : string ->" " : string ->" " : string ->" " : string ->" " : string ->" " : string ->" " : string ->" " : string ->" " : string ->" " : string ->" " : string +>" " : " " +>" " : " " +>" " : " " +>" " : " " +>" " : " " +>" " : " " +>" " : " " +>" " : " " +>" " : " " +>" " : " " +>" " : " " +>" " : " " +>" " : " " +>" " : " " +>" " : " " +>" " : " " +>" " : " " +>" " : " " +>" " : " " +>" " : " " +>" " : " " +>" " : " " +>" " : " " +>" " : " " +>" " : " " +>" " : " " +>" " : " " +>" " : " " +>" " : " " diff --git a/tests/baselines/reference/templateStringWithEmbeddedAddition.types b/tests/baselines/reference/templateStringWithEmbeddedAddition.types index 02173dc026f..56bc197c377 100644 --- a/tests/baselines/reference/templateStringWithEmbeddedAddition.types +++ b/tests/baselines/reference/templateStringWithEmbeddedAddition.types @@ -3,6 +3,6 @@ var x = `abc${ 10 + 10 }def`; >x : string >`abc${ 10 + 10 }def` : string >10 + 10 : number ->10 : number ->10 : number +>10 : 10 +>10 : 10 diff --git a/tests/baselines/reference/templateStringWithEmbeddedAdditionES6.types b/tests/baselines/reference/templateStringWithEmbeddedAdditionES6.types index ec33cee95f1..6ee46c39f57 100644 --- a/tests/baselines/reference/templateStringWithEmbeddedAdditionES6.types +++ b/tests/baselines/reference/templateStringWithEmbeddedAdditionES6.types @@ -3,6 +3,6 @@ var x = `abc${ 10 + 10 }def`; >x : string >`abc${ 10 + 10 }def` : string >10 + 10 : number ->10 : number ->10 : number +>10 : 10 +>10 : 10 diff --git a/tests/baselines/reference/templateStringWithEmbeddedArray.types b/tests/baselines/reference/templateStringWithEmbeddedArray.types index 2842936c502..b82fa26d400 100644 --- a/tests/baselines/reference/templateStringWithEmbeddedArray.types +++ b/tests/baselines/reference/templateStringWithEmbeddedArray.types @@ -3,7 +3,7 @@ var x = `abc${ [1,2,3] }def`; >x : string >`abc${ [1,2,3] }def` : string >[1,2,3] : number[] ->1 : number ->2 : number ->3 : number +>1 : 1 +>2 : 2 +>3 : 3 diff --git a/tests/baselines/reference/templateStringWithEmbeddedArrayES6.types b/tests/baselines/reference/templateStringWithEmbeddedArrayES6.types index 2f8e67f0539..e8701a7f4c3 100644 --- a/tests/baselines/reference/templateStringWithEmbeddedArrayES6.types +++ b/tests/baselines/reference/templateStringWithEmbeddedArrayES6.types @@ -3,7 +3,7 @@ var x = `abc${ [1,2,3] }def`; >x : string >`abc${ [1,2,3] }def` : string >[1,2,3] : number[] ->1 : number ->2 : number ->3 : number +>1 : 1 +>2 : 2 +>3 : 3 diff --git a/tests/baselines/reference/templateStringWithEmbeddedComments.types b/tests/baselines/reference/templateStringWithEmbeddedComments.types index 46a5fd3b091..f948a8bdaaf 100644 --- a/tests/baselines/reference/templateStringWithEmbeddedComments.types +++ b/tests/baselines/reference/templateStringWithEmbeddedComments.types @@ -3,7 +3,7 @@ >`head${ // single line comment10}middle${/* Multi- * line * comment */ 20 // closing comment}tail` : string 10 ->10 : number +>10 : 10 } middle${ /* Multi- @@ -11,7 +11,7 @@ middle${ * comment */ 20 ->20 : number +>20 : 20 // closing comment } diff --git a/tests/baselines/reference/templateStringWithEmbeddedCommentsES6.types b/tests/baselines/reference/templateStringWithEmbeddedCommentsES6.types index 0eaf40cafac..cd2e0b23441 100644 --- a/tests/baselines/reference/templateStringWithEmbeddedCommentsES6.types +++ b/tests/baselines/reference/templateStringWithEmbeddedCommentsES6.types @@ -3,7 +3,7 @@ >`head${ // single line comment10}middle${/* Multi- * line * comment */ 20 // closing comment}tail` : string 10 ->10 : number +>10 : 10 } middle${ /* Multi- @@ -11,7 +11,7 @@ middle${ * comment */ 20 ->20 : number +>20 : 20 // closing comment } diff --git a/tests/baselines/reference/templateStringWithEmbeddedConditional.types b/tests/baselines/reference/templateStringWithEmbeddedConditional.types index 7ec1ef97a30..d79433e7b8a 100644 --- a/tests/baselines/reference/templateStringWithEmbeddedConditional.types +++ b/tests/baselines/reference/templateStringWithEmbeddedConditional.types @@ -2,8 +2,8 @@ var x = `abc${ true ? false : " " }def`; >x : string >`abc${ true ? false : " " }def` : string ->true ? false : " " : string | boolean ->true : boolean ->false : boolean ->" " : string +>true ? false : " " : false | " " +>true : true +>false : false +>" " : " " diff --git a/tests/baselines/reference/templateStringWithEmbeddedConditionalES6.types b/tests/baselines/reference/templateStringWithEmbeddedConditionalES6.types index 5453880ce16..1ddc81a19e7 100644 --- a/tests/baselines/reference/templateStringWithEmbeddedConditionalES6.types +++ b/tests/baselines/reference/templateStringWithEmbeddedConditionalES6.types @@ -2,8 +2,8 @@ var x = `abc${ true ? false : " " }def`; >x : string >`abc${ true ? false : " " }def` : string ->true ? false : " " : string | boolean ->true : boolean ->false : boolean ->" " : string +>true ? false : " " : false | " " +>true : true +>false : false +>" " : " " diff --git a/tests/baselines/reference/templateStringWithEmbeddedDivision.types b/tests/baselines/reference/templateStringWithEmbeddedDivision.types index 440d162933b..6f891375624 100644 --- a/tests/baselines/reference/templateStringWithEmbeddedDivision.types +++ b/tests/baselines/reference/templateStringWithEmbeddedDivision.types @@ -3,6 +3,6 @@ var x = `abc${ 1 / 1 }def`; >x : string >`abc${ 1 / 1 }def` : string >1 / 1 : number ->1 : number ->1 : number +>1 : 1 +>1 : 1 diff --git a/tests/baselines/reference/templateStringWithEmbeddedDivisionES6.types b/tests/baselines/reference/templateStringWithEmbeddedDivisionES6.types index 7a5980bae9e..f91b3a27639 100644 --- a/tests/baselines/reference/templateStringWithEmbeddedDivisionES6.types +++ b/tests/baselines/reference/templateStringWithEmbeddedDivisionES6.types @@ -3,6 +3,6 @@ var x = `abc${ 1 / 1 }def`; >x : string >`abc${ 1 / 1 }def` : string >1 / 1 : number ->1 : number ->1 : number +>1 : 1 +>1 : 1 diff --git a/tests/baselines/reference/templateStringWithEmbeddedInOperator.types b/tests/baselines/reference/templateStringWithEmbeddedInOperator.types index d693dd276d1..f97ca55b633 100644 --- a/tests/baselines/reference/templateStringWithEmbeddedInOperator.types +++ b/tests/baselines/reference/templateStringWithEmbeddedInOperator.types @@ -3,10 +3,10 @@ var x = `abc${ "hi" in { hi: 10, hello: 20} }def`; >x : string >`abc${ "hi" in { hi: 10, hello: 20} }def` : string >"hi" in { hi: 10, hello: 20} : boolean ->"hi" : string +>"hi" : "hi" >{ hi: 10, hello: 20} : { hi: number; hello: number; } >hi : number ->10 : number +>10 : 10 >hello : number ->20 : number +>20 : 20 diff --git a/tests/baselines/reference/templateStringWithEmbeddedInOperatorES6.types b/tests/baselines/reference/templateStringWithEmbeddedInOperatorES6.types index ff5be5f4d82..a1346c2ce6d 100644 --- a/tests/baselines/reference/templateStringWithEmbeddedInOperatorES6.types +++ b/tests/baselines/reference/templateStringWithEmbeddedInOperatorES6.types @@ -3,10 +3,10 @@ var x = `abc${ "hi" in { hi: 10, hello: 20} }def`; >x : string >`abc${ "hi" in { hi: 10, hello: 20} }def` : string >"hi" in { hi: 10, hello: 20} : boolean ->"hi" : string +>"hi" : "hi" >{ hi: 10, hello: 20} : { hi: number; hello: number; } >hi : number ->10 : number +>10 : 10 >hello : number ->20 : number +>20 : 20 diff --git a/tests/baselines/reference/templateStringWithEmbeddedModulo.types b/tests/baselines/reference/templateStringWithEmbeddedModulo.types index fc5d3d2560d..c4711809563 100644 --- a/tests/baselines/reference/templateStringWithEmbeddedModulo.types +++ b/tests/baselines/reference/templateStringWithEmbeddedModulo.types @@ -3,6 +3,6 @@ var x = `abc${ 1 % 1 }def`; >x : string >`abc${ 1 % 1 }def` : string >1 % 1 : number ->1 : number ->1 : number +>1 : 1 +>1 : 1 diff --git a/tests/baselines/reference/templateStringWithEmbeddedModuloES6.types b/tests/baselines/reference/templateStringWithEmbeddedModuloES6.types index 35ae5473bef..2a1e6b602e2 100644 --- a/tests/baselines/reference/templateStringWithEmbeddedModuloES6.types +++ b/tests/baselines/reference/templateStringWithEmbeddedModuloES6.types @@ -3,6 +3,6 @@ var x = `abc${ 1 % 1 }def`; >x : string >`abc${ 1 % 1 }def` : string >1 % 1 : number ->1 : number ->1 : number +>1 : 1 +>1 : 1 diff --git a/tests/baselines/reference/templateStringWithEmbeddedMultiplication.types b/tests/baselines/reference/templateStringWithEmbeddedMultiplication.types index 6d81cabc169..f442ab3165b 100644 --- a/tests/baselines/reference/templateStringWithEmbeddedMultiplication.types +++ b/tests/baselines/reference/templateStringWithEmbeddedMultiplication.types @@ -3,6 +3,6 @@ var x = `abc${ 7 * 6 }def`; >x : string >`abc${ 7 * 6 }def` : string >7 * 6 : number ->7 : number ->6 : number +>7 : 7 +>6 : 6 diff --git a/tests/baselines/reference/templateStringWithEmbeddedMultiplicationES6.types b/tests/baselines/reference/templateStringWithEmbeddedMultiplicationES6.types index c4235f8535e..3e9f15773ef 100644 --- a/tests/baselines/reference/templateStringWithEmbeddedMultiplicationES6.types +++ b/tests/baselines/reference/templateStringWithEmbeddedMultiplicationES6.types @@ -3,6 +3,6 @@ var x = `abc${ 7 * 6 }def`; >x : string >`abc${ 7 * 6 }def` : string >7 * 6 : number ->7 : number ->6 : number +>7 : 7 +>6 : 6 diff --git a/tests/baselines/reference/templateStringWithEmbeddedNewOperator.types b/tests/baselines/reference/templateStringWithEmbeddedNewOperator.types index bcc90c42c74..1e358a571b3 100644 --- a/tests/baselines/reference/templateStringWithEmbeddedNewOperator.types +++ b/tests/baselines/reference/templateStringWithEmbeddedNewOperator.types @@ -4,5 +4,5 @@ var x = `abc${ new String("Hi") }def`; >`abc${ new String("Hi") }def` : string >new String("Hi") : String >String : StringConstructor ->"Hi" : string +>"Hi" : "Hi" diff --git a/tests/baselines/reference/templateStringWithEmbeddedNewOperatorES6.types b/tests/baselines/reference/templateStringWithEmbeddedNewOperatorES6.types index be58edbe4d8..4939c6f867f 100644 --- a/tests/baselines/reference/templateStringWithEmbeddedNewOperatorES6.types +++ b/tests/baselines/reference/templateStringWithEmbeddedNewOperatorES6.types @@ -4,5 +4,5 @@ var x = `abc${ new String("Hi") }def`; >`abc${ new String("Hi") }def` : string >new String("Hi") : String >String : StringConstructor ->"Hi" : string +>"Hi" : "Hi" diff --git a/tests/baselines/reference/templateStringWithEmbeddedObjectLiteral.types b/tests/baselines/reference/templateStringWithEmbeddedObjectLiteral.types index 0ff7fc140bb..9854e4e9056 100644 --- a/tests/baselines/reference/templateStringWithEmbeddedObjectLiteral.types +++ b/tests/baselines/reference/templateStringWithEmbeddedObjectLiteral.types @@ -4,7 +4,7 @@ var x = `abc${ { x: 10, y: 20 } }def`; >`abc${ { x: 10, y: 20 } }def` : string >{ x: 10, y: 20 } : { x: number; y: number; } >x : number ->10 : number +>10 : 10 >y : number ->20 : number +>20 : 20 diff --git a/tests/baselines/reference/templateStringWithEmbeddedObjectLiteralES6.types b/tests/baselines/reference/templateStringWithEmbeddedObjectLiteralES6.types index 4a5df4707b7..db086517791 100644 --- a/tests/baselines/reference/templateStringWithEmbeddedObjectLiteralES6.types +++ b/tests/baselines/reference/templateStringWithEmbeddedObjectLiteralES6.types @@ -4,7 +4,7 @@ var x = `abc${ { x: 10, y: 20 } }def`; >`abc${ { x: 10, y: 20 } }def` : string >{ x: 10, y: 20 } : { x: number; y: number; } >x : number ->10 : number +>10 : 10 >y : number ->20 : number +>20 : 20 diff --git a/tests/baselines/reference/templateStringWithEmbeddedTemplateString.types b/tests/baselines/reference/templateStringWithEmbeddedTemplateString.types index acda0c7a7ec..cef4f69c0a9 100644 --- a/tests/baselines/reference/templateStringWithEmbeddedTemplateString.types +++ b/tests/baselines/reference/templateStringWithEmbeddedTemplateString.types @@ -3,7 +3,7 @@ var x = `123${ `456 ${ " | " } 654` }321 123${ `456 ${ " | " } 654` }321`; >x : string >`123${ `456 ${ " | " } 654` }321 123${ `456 ${ " | " } 654` }321` : string >`456 ${ " | " } 654` : string ->" | " : string +>" | " : " | " >`456 ${ " | " } 654` : string ->" | " : string +>" | " : " | " diff --git a/tests/baselines/reference/templateStringWithEmbeddedTemplateStringES6.types b/tests/baselines/reference/templateStringWithEmbeddedTemplateStringES6.types index 252765cb7c0..12532c8402e 100644 --- a/tests/baselines/reference/templateStringWithEmbeddedTemplateStringES6.types +++ b/tests/baselines/reference/templateStringWithEmbeddedTemplateStringES6.types @@ -3,7 +3,7 @@ var x = `123${ `456 ${ " | " } 654` }321 123${ `456 ${ " | " } 654` }321`; >x : string >`123${ `456 ${ " | " } 654` }321 123${ `456 ${ " | " } 654` }321` : string >`456 ${ " | " } 654` : string ->" | " : string +>" | " : " | " >`456 ${ " | " } 654` : string ->" | " : string +>" | " : " | " diff --git a/tests/baselines/reference/templateStringWithEmbeddedTypeAssertionOnAddition.types b/tests/baselines/reference/templateStringWithEmbeddedTypeAssertionOnAddition.types index 98254cad8b7..898263825af 100644 --- a/tests/baselines/reference/templateStringWithEmbeddedTypeAssertionOnAddition.types +++ b/tests/baselines/reference/templateStringWithEmbeddedTypeAssertionOnAddition.types @@ -5,6 +5,6 @@ var x = `abc${ (10 + 10) }def`; >(10 + 10) : any >(10 + 10) : number >10 + 10 : number ->10 : number ->10 : number +>10 : 10 +>10 : 10 diff --git a/tests/baselines/reference/templateStringWithEmbeddedTypeAssertionOnAdditionES6.types b/tests/baselines/reference/templateStringWithEmbeddedTypeAssertionOnAdditionES6.types index ac74625f57a..e9e81a2d097 100644 --- a/tests/baselines/reference/templateStringWithEmbeddedTypeAssertionOnAdditionES6.types +++ b/tests/baselines/reference/templateStringWithEmbeddedTypeAssertionOnAdditionES6.types @@ -5,6 +5,6 @@ var x = `abc${ (10 + 10) }def`; >(10 + 10) : any >(10 + 10) : number >10 + 10 : number ->10 : number ->10 : number +>10 : 10 +>10 : 10 diff --git a/tests/baselines/reference/templateStringWithEmbeddedTypeOfOperator.types b/tests/baselines/reference/templateStringWithEmbeddedTypeOfOperator.types index e63ea3aac69..48330140ad3 100644 --- a/tests/baselines/reference/templateStringWithEmbeddedTypeOfOperator.types +++ b/tests/baselines/reference/templateStringWithEmbeddedTypeOfOperator.types @@ -3,5 +3,5 @@ var x = `abc${ typeof "hi" }def`; >x : string >`abc${ typeof "hi" }def` : string >typeof "hi" : string ->"hi" : string +>"hi" : "hi" diff --git a/tests/baselines/reference/templateStringWithEmbeddedTypeOfOperatorES6.types b/tests/baselines/reference/templateStringWithEmbeddedTypeOfOperatorES6.types index 0692eaccb5e..3d7eba45c19 100644 --- a/tests/baselines/reference/templateStringWithEmbeddedTypeOfOperatorES6.types +++ b/tests/baselines/reference/templateStringWithEmbeddedTypeOfOperatorES6.types @@ -3,5 +3,5 @@ var x = `abc${ typeof "hi" }def`; >x : string >`abc${ typeof "hi" }def` : string >typeof "hi" : string ->"hi" : string +>"hi" : "hi" diff --git a/tests/baselines/reference/templateStringWithEmbeddedYieldKeywordES6.types b/tests/baselines/reference/templateStringWithEmbeddedYieldKeywordES6.types index 3a6f5d16726..e4496aa4e8b 100644 --- a/tests/baselines/reference/templateStringWithEmbeddedYieldKeywordES6.types +++ b/tests/baselines/reference/templateStringWithEmbeddedYieldKeywordES6.types @@ -1,12 +1,12 @@ === tests/cases/conformance/es6/templates/templateStringWithEmbeddedYieldKeywordES6.ts === function* gen() { ->gen : () => IterableIterator +>gen : () => IterableIterator<10> // Once this is supported, yield *must* be parenthesized. var x = `abc${ yield 10 }def`; >x : string >`abc${ yield 10 }def` : string >yield 10 : any ->10 : number +>10 : 10 } diff --git a/tests/baselines/reference/templateStringWithEmptyLiteralPortions.types b/tests/baselines/reference/templateStringWithEmptyLiteralPortions.types index f88ca5e7493..f20ab1552e3 100644 --- a/tests/baselines/reference/templateStringWithEmptyLiteralPortions.types +++ b/tests/baselines/reference/templateStringWithEmptyLiteralPortions.types @@ -6,68 +6,68 @@ var a = ``; var b = `${ 0 }`; >b : string >`${ 0 }` : string ->0 : number +>0 : 0 var c = `1${ 0 }`; >c : string >`1${ 0 }` : string ->0 : number +>0 : 0 var d = `${ 0 }2`; >d : string >`${ 0 }2` : string ->0 : number +>0 : 0 var e = `1${ 0 }2`; >e : string >`1${ 0 }2` : string ->0 : number +>0 : 0 var f = `${ 0 }${ 0 }`; >f : string >`${ 0 }${ 0 }` : string ->0 : number ->0 : number +>0 : 0 +>0 : 0 var g = `1${ 0 }${ 0 }`; >g : string >`1${ 0 }${ 0 }` : string ->0 : number ->0 : number +>0 : 0 +>0 : 0 var h = `${ 0 }2${ 0 }`; >h : string >`${ 0 }2${ 0 }` : string ->0 : number ->0 : number +>0 : 0 +>0 : 0 var i = `1${ 0 }2${ 0 }`; >i : string >`1${ 0 }2${ 0 }` : string ->0 : number ->0 : number +>0 : 0 +>0 : 0 var j = `${ 0 }${ 0 }3`; >j : string >`${ 0 }${ 0 }3` : string ->0 : number ->0 : number +>0 : 0 +>0 : 0 var k = `1${ 0 }${ 0 }3`; >k : string >`1${ 0 }${ 0 }3` : string ->0 : number ->0 : number +>0 : 0 +>0 : 0 var l = `${ 0 }2${ 0 }3`; >l : string >`${ 0 }2${ 0 }3` : string ->0 : number ->0 : number +>0 : 0 +>0 : 0 var m = `1${ 0 }2${ 0 }3`; >m : string >`1${ 0 }2${ 0 }3` : string ->0 : number ->0 : number +>0 : 0 +>0 : 0 diff --git a/tests/baselines/reference/templateStringWithEmptyLiteralPortionsES6.types b/tests/baselines/reference/templateStringWithEmptyLiteralPortionsES6.types index 068da7f9484..73eeeaae045 100644 --- a/tests/baselines/reference/templateStringWithEmptyLiteralPortionsES6.types +++ b/tests/baselines/reference/templateStringWithEmptyLiteralPortionsES6.types @@ -6,68 +6,68 @@ var a = ``; var b = `${ 0 }`; >b : string >`${ 0 }` : string ->0 : number +>0 : 0 var c = `1${ 0 }`; >c : string >`1${ 0 }` : string ->0 : number +>0 : 0 var d = `${ 0 }2`; >d : string >`${ 0 }2` : string ->0 : number +>0 : 0 var e = `1${ 0 }2`; >e : string >`1${ 0 }2` : string ->0 : number +>0 : 0 var f = `${ 0 }${ 0 }`; >f : string >`${ 0 }${ 0 }` : string ->0 : number ->0 : number +>0 : 0 +>0 : 0 var g = `1${ 0 }${ 0 }`; >g : string >`1${ 0 }${ 0 }` : string ->0 : number ->0 : number +>0 : 0 +>0 : 0 var h = `${ 0 }2${ 0 }`; >h : string >`${ 0 }2${ 0 }` : string ->0 : number ->0 : number +>0 : 0 +>0 : 0 var i = `1${ 0 }2${ 0 }`; >i : string >`1${ 0 }2${ 0 }` : string ->0 : number ->0 : number +>0 : 0 +>0 : 0 var j = `${ 0 }${ 0 }3`; >j : string >`${ 0 }${ 0 }3` : string ->0 : number ->0 : number +>0 : 0 +>0 : 0 var k = `1${ 0 }${ 0 }3`; >k : string >`1${ 0 }${ 0 }3` : string ->0 : number ->0 : number +>0 : 0 +>0 : 0 var l = `${ 0 }2${ 0 }3`; >l : string >`${ 0 }2${ 0 }3` : string ->0 : number ->0 : number +>0 : 0 +>0 : 0 var m = `1${ 0 }2${ 0 }3`; >m : string >`1${ 0 }2${ 0 }3` : string ->0 : number ->0 : number +>0 : 0 +>0 : 0 diff --git a/tests/baselines/reference/templateStringWithOpenCommentInStringPortion.types b/tests/baselines/reference/templateStringWithOpenCommentInStringPortion.types index 9adee375396..8c6d4dc2e79 100644 --- a/tests/baselines/reference/templateStringWithOpenCommentInStringPortion.types +++ b/tests/baselines/reference/templateStringWithOpenCommentInStringPortion.types @@ -1,6 +1,6 @@ === tests/cases/conformance/es6/templates/templateStringWithOpenCommentInStringPortion.ts === ` /**head ${ 10 } // still middle ${ 20 } /* still tail ` >` /**head ${ 10 } // still middle ${ 20 } /* still tail ` : string ->10 : number ->20 : number +>10 : 10 +>20 : 20 diff --git a/tests/baselines/reference/templateStringWithOpenCommentInStringPortionES6.types b/tests/baselines/reference/templateStringWithOpenCommentInStringPortionES6.types index ea1513756de..fa9ede6976b 100644 --- a/tests/baselines/reference/templateStringWithOpenCommentInStringPortionES6.types +++ b/tests/baselines/reference/templateStringWithOpenCommentInStringPortionES6.types @@ -1,6 +1,6 @@ === tests/cases/conformance/es6/templates/templateStringWithOpenCommentInStringPortionES6.ts === ` /**head ${ 10 } // still middle ${ 20 } /* still tail ` >` /**head ${ 10 } // still middle ${ 20 } /* still tail ` : string ->10 : number ->20 : number +>10 : 10 +>20 : 20 diff --git a/tests/baselines/reference/templateStringWithPropertyAccess.types b/tests/baselines/reference/templateStringWithPropertyAccess.types index 6afb7402970..21749c848da 100644 --- a/tests/baselines/reference/templateStringWithPropertyAccess.types +++ b/tests/baselines/reference/templateStringWithPropertyAccess.types @@ -3,7 +3,7 @@ >`abc${0}abc`.indexOf(`abc`) : number >`abc${0}abc`.indexOf : (searchString: string, position?: number) => number >`abc${0}abc` : string ->0 : number +>0 : 0 >indexOf : (searchString: string, position?: number) => number >`abc` : string diff --git a/tests/baselines/reference/templateStringWithPropertyAccessES6.types b/tests/baselines/reference/templateStringWithPropertyAccessES6.types index bdbded8be4a..3e297e6bf07 100644 --- a/tests/baselines/reference/templateStringWithPropertyAccessES6.types +++ b/tests/baselines/reference/templateStringWithPropertyAccessES6.types @@ -3,7 +3,7 @@ >`abc${0}abc`.indexOf(`abc`) : number >`abc${0}abc`.indexOf : (searchString: string, position?: number) => number >`abc${0}abc` : string ->0 : number +>0 : 0 >indexOf : (searchString: string, position?: number) => number >`abc` : string diff --git a/tests/baselines/reference/templateStringsWithTypeErrorInFunctionExpressionsInSubstitutionExpression.errors.txt b/tests/baselines/reference/templateStringsWithTypeErrorInFunctionExpressionsInSubstitutionExpression.errors.txt index 7204f32dba2..6b11fdb661a 100644 --- a/tests/baselines/reference/templateStringsWithTypeErrorInFunctionExpressionsInSubstitutionExpression.errors.txt +++ b/tests/baselines/reference/templateStringsWithTypeErrorInFunctionExpressionsInSubstitutionExpression.errors.txt @@ -1,4 +1,4 @@ -tests/cases/conformance/es6/templates/templateStringsWithTypeErrorInFunctionExpressionsInSubstitutionExpression.ts(3,27): error TS2322: Type 'string' is not assignable to type 'number'. +tests/cases/conformance/es6/templates/templateStringsWithTypeErrorInFunctionExpressionsInSubstitutionExpression.ts(3,27): error TS2322: Type '"bad"' is not assignable to type 'number'. ==== tests/cases/conformance/es6/templates/templateStringsWithTypeErrorInFunctionExpressionsInSubstitutionExpression.ts (1 errors) ==== @@ -6,4 +6,4 @@ tests/cases/conformance/es6/templates/templateStringsWithTypeErrorInFunctionExpr `${function (x: number) { x = "bad"; } }`; ~ -!!! error TS2322: Type 'string' is not assignable to type 'number'. \ No newline at end of file +!!! error TS2322: Type '"bad"' is not assignable to type 'number'. \ No newline at end of file diff --git a/tests/baselines/reference/templateStringsWithTypeErrorInFunctionExpressionsInSubstitutionExpressionES6.errors.txt b/tests/baselines/reference/templateStringsWithTypeErrorInFunctionExpressionsInSubstitutionExpressionES6.errors.txt index 9fece57ef5e..8d5a8bb4885 100644 --- a/tests/baselines/reference/templateStringsWithTypeErrorInFunctionExpressionsInSubstitutionExpressionES6.errors.txt +++ b/tests/baselines/reference/templateStringsWithTypeErrorInFunctionExpressionsInSubstitutionExpressionES6.errors.txt @@ -1,8 +1,8 @@ -tests/cases/conformance/es6/templates/templateStringsWithTypeErrorInFunctionExpressionsInSubstitutionExpressionES6.ts(2,27): error TS2322: Type 'string' is not assignable to type 'number'. +tests/cases/conformance/es6/templates/templateStringsWithTypeErrorInFunctionExpressionsInSubstitutionExpressionES6.ts(2,27): error TS2322: Type '"bad"' is not assignable to type 'number'. ==== tests/cases/conformance/es6/templates/templateStringsWithTypeErrorInFunctionExpressionsInSubstitutionExpressionES6.ts (1 errors) ==== `${function (x: number) { x = "bad"; } }`; ~ -!!! error TS2322: Type 'string' is not assignable to type 'number'. \ No newline at end of file +!!! error TS2322: Type '"bad"' is not assignable to type 'number'. \ No newline at end of file diff --git a/tests/baselines/reference/ternaryExpressionSourceMap.types b/tests/baselines/reference/ternaryExpressionSourceMap.types index d74a175635a..d6d17091b43 100644 --- a/tests/baselines/reference/ternaryExpressionSourceMap.types +++ b/tests/baselines/reference/ternaryExpressionSourceMap.types @@ -2,14 +2,14 @@ var x = 1; >x : number ->1 : number +>1 : 1 var foo = x ? () => 0 : () => 0; >foo : () => number >x ? () => 0 : () => 0 : () => number >x : number >() => 0 : () => number ->0 : number +>0 : 0 >() => 0 : () => number ->0 : number +>0 : 0 diff --git a/tests/baselines/reference/thisBinding2.types b/tests/baselines/reference/thisBinding2.types index 99668ca4901..dbd9f83c741 100644 --- a/tests/baselines/reference/thisBinding2.types +++ b/tests/baselines/reference/thisBinding2.types @@ -17,7 +17,7 @@ class C { var x = 1; >x : number ->1 : number +>1 : 1 return this.x; >this.x : number @@ -35,7 +35,7 @@ class C { var x = 1; >x : number ->1 : number +>1 : 1 return this.x; >this.x : any @@ -57,7 +57,7 @@ var messenger = { message: "Hello World", >message : string ->"Hello World" : string +>"Hello World" : "Hello World" start: function () { >start : () => number @@ -71,7 +71,7 @@ var messenger = { >this.message : any >this : any >message : any ->3000 : number +>3000 : 3000 } }; diff --git a/tests/baselines/reference/thisCapture1.types b/tests/baselines/reference/thisCapture1.types index eb4501203ca..ff9e9e3b9fe 100644 --- a/tests/baselines/reference/thisCapture1.types +++ b/tests/baselines/reference/thisCapture1.types @@ -4,7 +4,7 @@ class X { private y = 0; >y : number ->0 : number +>0 : 0 public getSettings(keys: string[]): any { >getSettings : (keys: string[]) => any @@ -23,11 +23,11 @@ class X { >() => { this.y = 0; } : () => void this.y = 0; ->this.y = 0 : number +>this.y = 0 : 0 >this.y : number >this : this >y : number ->0 : number +>0 : 0 }).promise(); >promise : any diff --git a/tests/baselines/reference/thisInGenericStaticMembers.types b/tests/baselines/reference/thisInGenericStaticMembers.types index 8d4aabe2812..082ffb588a5 100644 --- a/tests/baselines/reference/thisInGenericStaticMembers.types +++ b/tests/baselines/reference/thisInGenericStaticMembers.types @@ -30,7 +30,7 @@ class A { >one : (source: T, value: number) => T >T : T >source : T ->42 : number +>42 : 42 } } @@ -60,7 +60,7 @@ class B { >this : typeof B >one : (source: B, value: number) => B >source : B ->42 : number +>42 : 42 } } diff --git a/tests/baselines/reference/thisInInnerFunctions.types b/tests/baselines/reference/thisInInnerFunctions.types index 2d0c3363b18..e6c6d2b834c 100644 --- a/tests/baselines/reference/thisInInnerFunctions.types +++ b/tests/baselines/reference/thisInInnerFunctions.types @@ -4,7 +4,7 @@ class Foo { x = "hello"; >x : string ->"hello" : string +>"hello" : "hello" bar() { >bar : () => void @@ -13,11 +13,11 @@ class Foo { >inner : () => void this.y = "hi"; // 'this' should be not type to 'Foo' either ->this.y = "hi" : string +>this.y = "hi" : "hi" >this.y : any >this : any >y : any ->"hi" : string +>"hi" : "hi" var f = () => this.y; // 'this' should be not type to 'Foo' either >f : () => any diff --git a/tests/baselines/reference/thisInLambda.types b/tests/baselines/reference/thisInLambda.types index aea7fb08bd6..a9d5b695750 100644 --- a/tests/baselines/reference/thisInLambda.types +++ b/tests/baselines/reference/thisInLambda.types @@ -4,7 +4,7 @@ class Foo { x = "hello"; >x : string ->"hello" : string +>"hello" : "hello" bar() { >bar : () => void diff --git a/tests/baselines/reference/thisInPropertyBoundDeclarations.types b/tests/baselines/reference/thisInPropertyBoundDeclarations.types index f871e78d219..b783c5c1b5f 100644 --- a/tests/baselines/reference/thisInPropertyBoundDeclarations.types +++ b/tests/baselines/reference/thisInPropertyBoundDeclarations.types @@ -131,14 +131,14 @@ class B { >' ' + function() { } + ' ' + (() => () => () => this) : string >' ' + function() { } + ' ' : string >' ' + function() { } : string ->' ' : string +>' ' : " " function() { >function() { } : () => void } + ' ' + ->' ' : string +>' ' : " " (() => () => () => this); >(() => () => () => this) : () => () => () => this diff --git a/tests/baselines/reference/thisInStaticMethod1.types b/tests/baselines/reference/thisInStaticMethod1.types index fdee20c21bf..6e922737ca9 100644 --- a/tests/baselines/reference/thisInStaticMethod1.types +++ b/tests/baselines/reference/thisInStaticMethod1.types @@ -4,7 +4,7 @@ class foo { static x = 3; >x : number ->3 : number +>3 : 3 static bar() { >bar : () => number diff --git a/tests/baselines/reference/thisTypeInAccessors.types b/tests/baselines/reference/thisTypeInAccessors.types index 998658c5d58..4bf21861051 100644 --- a/tests/baselines/reference/thisTypeInAccessors.types +++ b/tests/baselines/reference/thisTypeInAccessors.types @@ -15,7 +15,7 @@ const explicit = { n: 12, >n : number ->12 : number +>12 : 12 get x(this: Foo): number { return this.n; }, >x : number @@ -42,7 +42,7 @@ const copiedFromGetter = { n: 14, >n : number ->14 : number +>14 : 14 get x(this: Foo): number { return this.n; }, >x : number @@ -67,7 +67,7 @@ const copiedFromSetter = { n: 15, >n : number ->15 : number +>15 : 15 get x() { return this.n }, >x : number @@ -92,7 +92,7 @@ const copiedFromGetterUnannotated = { n: 16, >n : number ->16 : number +>16 : 16 get x(this: Foo) { return this.n }, >x : number @@ -118,7 +118,7 @@ class Explicit { n = 17; >n : number ->17 : number +>17 : 17 get x(this: Foo): number { return this.n; } >x : number @@ -144,7 +144,7 @@ class Contextual { n = 21; >n : number ->21 : number +>21 : 21 get x() { return this.n } // inside a class, so already correct >x : number diff --git a/tests/baselines/reference/thisTypeInFunctions.types b/tests/baselines/reference/thisTypeInFunctions.types index 863ecbce628..44bf23ad509 100644 --- a/tests/baselines/reference/thisTypeInFunctions.types +++ b/tests/baselines/reference/thisTypeInFunctions.types @@ -58,7 +58,7 @@ class C { return m + 1; >m + 1 : number >m : number ->1 : number +>1 : 1 } } class D extends C { } @@ -127,7 +127,7 @@ function implicitThis(n: number): number { >this : any >m : any >n : number ->12 : number +>12 : 12 } let impl: I = { >impl : I @@ -136,7 +136,7 @@ let impl: I = { a: 12, >a : number ->12 : number +>12 : 12 explicitVoid2: () => this.a, // ok, this: any because it refers to some outer object (window?) >explicitVoid2 : () => any @@ -147,7 +147,7 @@ let impl: I = { explicitVoid1() { return 12; }, >explicitVoid1 : (this: void) => number ->12 : number +>12 : 12 explicitStructural() { >explicitStructural : (this: { a: number; }) => number @@ -183,7 +183,7 @@ impl.explicitVoid1 = function () { return 12; }; >impl : I >explicitVoid1 : (this: void) => number >function () { return 12; } : (this: void) => number ->12 : number +>12 : 12 impl.explicitVoid2 = () => 12; >impl.explicitVoid2 = () => 12 : () => number @@ -191,7 +191,7 @@ impl.explicitVoid2 = () => 12; >impl : I >explicitVoid2 : (this: void) => number >() => 12 : () => number ->12 : number +>12 : 12 impl.explicitStructural = function() { return this.a; }; >impl.explicitStructural = function() { return this.a; } : (this: { a: number; }) => number @@ -219,7 +219,7 @@ impl.explicitStructural = () => 12; >impl : I >explicitStructural : (this: { a: number; }) => number >() => 12 : () => number ->12 : number +>12 : 12 impl.explicitInterface = () => 12; >impl.explicitInterface = () => 12 : () => number @@ -227,7 +227,7 @@ impl.explicitInterface = () => 12; >impl : I >explicitInterface : (this: I) => number >() => 12 : () => number ->12 : number +>12 : 12 impl.explicitThis = function () { return this.a; }; >impl.explicitThis = function () { return this.a; } : (this: I) => number @@ -249,7 +249,7 @@ let ok: {y: number, f: (this: { y: number }, x: number) => number} = { y: 12, f: >x : number >{ y: 12, f: explicitStructural } : { y: number; f: (this: { y: number; }, x: number) => number; } >y : number ->12 : number +>12 : 12 >f : (this: { y: number; }, x: number) => number >explicitStructural : (this: { y: number; }, x: number) => number @@ -260,7 +260,7 @@ let implicitAnyOk: {notSpecified: number, f: (x: number) => number} = { notSpeci >x : number >{ notSpecified: 12, f: implicitThis } : { notSpecified: number; f: (n: number) => number; } >notSpecified : number ->12 : number +>12 : 12 >f : (n: number) => number >implicitThis : (n: number) => number @@ -269,19 +269,19 @@ ok.f(13); >ok.f : (this: { y: number; }, x: number) => number >ok : { y: number; f: (this: { y: number; }, x: number) => number; } >f : (this: { y: number; }, x: number) => number ->13 : number +>13 : 13 implicitThis(12); >implicitThis(12) : number >implicitThis : (n: number) => number ->12 : number +>12 : 12 implicitAnyOk.f(12); >implicitAnyOk.f(12) : number >implicitAnyOk.f : (x: number) => number >implicitAnyOk : { notSpecified: number; f: (x: number) => number; } >f : (x: number) => number ->12 : number +>12 : 12 let c = new C(); >c : C @@ -304,42 +304,42 @@ c.explicitC(12); >c.explicitC : (this: C, m: number) => number >c : C >explicitC : (this: C, m: number) => number ->12 : number +>12 : 12 c.explicitProperty(12); >c.explicitProperty(12) : number >c.explicitProperty : (this: { n: number; }, m: number) => number >c : C >explicitProperty : (this: { n: number; }, m: number) => number ->12 : number +>12 : 12 c.explicitThis(12); >c.explicitThis(12) : number >c.explicitThis : (this: C, m: number) => number >c : C >explicitThis : (this: C, m: number) => number ->12 : number +>12 : 12 d.explicitC(12); >d.explicitC(12) : number >d.explicitC : (this: C, m: number) => number >d : D >explicitC : (this: C, m: number) => number ->12 : number +>12 : 12 d.explicitProperty(12); >d.explicitProperty(12) : number >d.explicitProperty : (this: { n: number; }, m: number) => number >d : D >explicitProperty : (this: { n: number; }, m: number) => number ->12 : number +>12 : 12 d.explicitThis(12); >d.explicitThis(12) : number >d.explicitThis : (this: D, m: number) => number >d : D >explicitThis : (this: D, m: number) => number ->12 : number +>12 : 12 let reconstructed: { >reconstructed : { n: number; explicitThis(this: C, m: number): number; explicitC(this: C, m: number): number; explicitProperty: (this: { n: number; }, m: number) => number; explicitVoid(this: void, m: number): number; } @@ -375,7 +375,7 @@ let reconstructed: { n: 12, >n : number ->12 : number +>12 : 12 explicitThis: c.explicitThis, >explicitThis : (this: C, m: number) => number @@ -407,14 +407,14 @@ reconstructed.explicitThis(10); >reconstructed.explicitThis : (this: C, m: number) => number >reconstructed : { n: number; explicitThis(this: C, m: number): number; explicitC(this: C, m: number): number; explicitProperty: (this: { n: number; }, m: number) => number; explicitVoid(this: void, m: number): number; } >explicitThis : (this: C, m: number) => number ->10 : number +>10 : 10 reconstructed.explicitProperty(11); >reconstructed.explicitProperty(11) : number >reconstructed.explicitProperty : (this: { n: number; }, m: number) => number >reconstructed : { n: number; explicitThis(this: C, m: number): number; explicitC(this: C, m: number): number; explicitProperty: (this: { n: number; }, m: number) => number; explicitVoid(this: void, m: number): number; } >explicitProperty : (this: { n: number; }, m: number) => number ->11 : number +>11 : 11 let explicitVoid = reconstructed.explicitVoid; >explicitVoid : (this: void, m: number) => number @@ -425,7 +425,7 @@ let explicitVoid = reconstructed.explicitVoid; explicitVoid(12); >explicitVoid(12) : number >explicitVoid : (this: void, m: number) => number ->12 : number +>12 : 12 // assignment checking let unboundToSpecified: (this: { y: number }, x: number) => number = x => x + this.y; // ok, this:any @@ -457,7 +457,7 @@ let anyToSpecified: (this: { y: number }, x: number) => number = function(x: num >x : number >x + 12 : number >x : number ->12 : number +>12 : 12 let unspecifiedLambda: (x: number) => number = x => x + 12; >unspecifiedLambda : (x: number) => number @@ -466,7 +466,7 @@ let unspecifiedLambda: (x: number) => number = x => x + 12; >x : number >x + 12 : number >x : number ->12 : number +>12 : 12 let specifiedLambda: (this: void, x: number) => number = x => x + 12; >specifiedLambda : (this: void, x: number) => number @@ -476,7 +476,7 @@ let specifiedLambda: (this: void, x: number) => number = x => x + 12; >x : number >x + 12 : number >x : number ->12 : number +>12 : 12 let unspecifiedLambdaToSpecified: (this: {y: number}, x: number) => number = unspecifiedLambda; >unspecifiedLambdaToSpecified : (this: { y: number; }, x: number) => number @@ -881,11 +881,11 @@ function InterfaceThis(this: I) { >I : I this.a = 12; ->this.a = 12 : number +>this.a = 12 : 12 >this.a : number >this : I >a : number ->12 : number +>12 : 12 } function LiteralTypeThis(this: {x: string}) { >LiteralTypeThis : (this: { x: string; }) => void @@ -893,22 +893,22 @@ function LiteralTypeThis(this: {x: string}) { >x : string this.x = "ok"; ->this.x = "ok" : string +>this.x = "ok" : "ok" >this.x : string >this : { x: string; } >x : string ->"ok" : string +>"ok" : "ok" } function AnyThis(this: any) { >AnyThis : (this: any) => void >this : any this.x = "ok"; ->this.x = "ok" : string +>this.x = "ok" : "ok" >this.x : any >this : any >x : any ->"ok" : string +>"ok" : "ok" } let interfaceThis = new InterfaceThis(); >interfaceThis : any @@ -949,7 +949,7 @@ let n: number = f.call(12); >f.call : (this: (...argArray: any[]) => U, ...argArray: any[]) => U >f : { (this: void, x: number): number; call(this: (...argArray: any[]) => U, ...argArray: any[]): U; } >call : (this: (...argArray: any[]) => U, ...argArray: any[]) => U ->12 : number +>12 : 12 function missingTypeIsImplicitAny(this, a: number) { return this.anything + a; } >missingTypeIsImplicitAny : (this: any, a: number) => any diff --git a/tests/baselines/reference/thisTypeInFunctions2.types b/tests/baselines/reference/thisTypeInFunctions2.types index 25fb2f28a60..3cf6c1d2fae 100644 --- a/tests/baselines/reference/thisTypeInFunctions2.types +++ b/tests/baselines/reference/thisTypeInFunctions2.types @@ -58,7 +58,7 @@ declare function simple(arg: SimpleInterface): void; extend1({ >extend1({ init() { this // this: IndexedWithThis because of contextual typing. // this.mine this.willDestroy }, mine: 12, foo() { this.url; // this: any because 'foo' matches the string indexer this.willDestroy; }}) : void >extend1 : (args: IndexedWithThis) => void ->{ init() { this // this: IndexedWithThis because of contextual typing. // this.mine this.willDestroy }, mine: 12, foo() { this.url; // this: any because 'foo' matches the string indexer this.willDestroy; }} : { init(this: IndexedWithThis): void; mine: number; foo(this: any): void; } +>{ init() { this // this: IndexedWithThis because of contextual typing. // this.mine this.willDestroy }, mine: 12, foo() { this.url; // this: any because 'foo' matches the string indexer this.willDestroy; }} : { init(this: IndexedWithThis): void; mine: 12; foo(this: any): void; } init() { >init : (this: IndexedWithThis) => void @@ -75,7 +75,7 @@ extend1({ }, mine: 12, >mine : number ->12 : number +>12 : 12 foo() { >foo : (this: any) => void @@ -115,7 +115,7 @@ extend2({ }, mine: 13, >mine : number ->13 : number +>13 : 13 foo() { >foo : () => void @@ -159,7 +159,7 @@ simple({ >bar : () => number return 14; ->14 : number +>14 : 14 } }) diff --git a/tests/baselines/reference/thisTypeInFunctionsNegative.errors.txt b/tests/baselines/reference/thisTypeInFunctionsNegative.errors.txt index 564aa2ed926..e88f4c1ca96 100644 --- a/tests/baselines/reference/thisTypeInFunctionsNegative.errors.txt +++ b/tests/baselines/reference/thisTypeInFunctionsNegative.errors.txt @@ -11,7 +11,7 @@ tests/cases/conformance/types/thisType/thisTypeInFunctionsNegative.ts(62,97): er tests/cases/conformance/types/thisType/thisTypeInFunctionsNegative.ts(63,110): error TS2322: Type '{ wrongName: number; explicitStructural: (this: { y: number; }, x: number) => number; }' is not assignable to type '{ wrongName: number; f: (this: { y: number; }, x: number) => number; }'. Object literal may only specify known properties, and 'explicitStructural' does not exist in type '{ wrongName: number; f: (this: { y: number; }, x: number) => number; }'. tests/cases/conformance/types/thisType/thisTypeInFunctionsNegative.ts(65,1): error TS2346: Supplied parameters do not match any signature of call target. -tests/cases/conformance/types/thisType/thisTypeInFunctionsNegative.ts(66,6): error TS2345: Argument of type 'string' is not assignable to parameter of type 'number'. +tests/cases/conformance/types/thisType/thisTypeInFunctionsNegative.ts(66,6): error TS2345: Argument of type '"wrong type"' is not assignable to parameter of type 'number'. tests/cases/conformance/types/thisType/thisTypeInFunctionsNegative.ts(67,1): error TS2346: Supplied parameters do not match any signature of call target. tests/cases/conformance/types/thisType/thisTypeInFunctionsNegative.ts(68,1): error TS2684: The 'this' context of type '{ y: string; f: (this: { y: number; }, x: number) => number; }' is not assignable to method's 'this' of type '{ y: number; }'. Types of property 'y' are incompatible. @@ -19,16 +19,16 @@ tests/cases/conformance/types/thisType/thisTypeInFunctionsNegative.ts(68,1): err tests/cases/conformance/types/thisType/thisTypeInFunctionsNegative.ts(69,1): error TS2684: The 'this' context of type '{ wrongName: number; f: (this: { y: number; }, x: number) => number; }' is not assignable to method's 'this' of type '{ y: number; }'. Property 'y' is missing in type '{ wrongName: number; f: (this: { y: number; }, x: number) => number; }'. tests/cases/conformance/types/thisType/thisTypeInFunctionsNegative.ts(72,1): error TS2346: Supplied parameters do not match any signature of call target. -tests/cases/conformance/types/thisType/thisTypeInFunctionsNegative.ts(73,13): error TS2345: Argument of type 'string' is not assignable to parameter of type 'number'. +tests/cases/conformance/types/thisType/thisTypeInFunctionsNegative.ts(73,13): error TS2345: Argument of type '"wrong type"' is not assignable to parameter of type 'number'. tests/cases/conformance/types/thisType/thisTypeInFunctionsNegative.ts(74,1): error TS2346: Supplied parameters do not match any signature of call target. tests/cases/conformance/types/thisType/thisTypeInFunctionsNegative.ts(75,1): error TS2346: Supplied parameters do not match any signature of call target. -tests/cases/conformance/types/thisType/thisTypeInFunctionsNegative.ts(76,16): error TS2345: Argument of type 'string' is not assignable to parameter of type 'number'. +tests/cases/conformance/types/thisType/thisTypeInFunctionsNegative.ts(76,16): error TS2345: Argument of type '"wrong type 2"' is not assignable to parameter of type 'number'. tests/cases/conformance/types/thisType/thisTypeInFunctionsNegative.ts(77,1): error TS2346: Supplied parameters do not match any signature of call target. tests/cases/conformance/types/thisType/thisTypeInFunctionsNegative.ts(78,1): error TS2346: Supplied parameters do not match any signature of call target. -tests/cases/conformance/types/thisType/thisTypeInFunctionsNegative.ts(79,16): error TS2345: Argument of type 'string' is not assignable to parameter of type 'number'. +tests/cases/conformance/types/thisType/thisTypeInFunctionsNegative.ts(79,16): error TS2345: Argument of type '"wrong type 2"' is not assignable to parameter of type 'number'. tests/cases/conformance/types/thisType/thisTypeInFunctionsNegative.ts(80,1): error TS2346: Supplied parameters do not match any signature of call target. tests/cases/conformance/types/thisType/thisTypeInFunctionsNegative.ts(81,1): error TS2346: Supplied parameters do not match any signature of call target. -tests/cases/conformance/types/thisType/thisTypeInFunctionsNegative.ts(82,20): error TS2345: Argument of type 'string' is not assignable to parameter of type 'number'. +tests/cases/conformance/types/thisType/thisTypeInFunctionsNegative.ts(82,20): error TS2345: Argument of type '"wrong type 3"' is not assignable to parameter of type 'number'. tests/cases/conformance/types/thisType/thisTypeInFunctionsNegative.ts(83,1): error TS2346: Supplied parameters do not match any signature of call target. tests/cases/conformance/types/thisType/thisTypeInFunctionsNegative.ts(86,5): error TS2322: Type '(this: { y: number; }, x: number) => number' is not assignable to type '(this: void, x: number) => number'. The 'this' types of each signature are incompatible. @@ -190,7 +190,7 @@ tests/cases/conformance/types/thisType/thisTypeInFunctionsNegative.ts(175,35): e !!! error TS2346: Supplied parameters do not match any signature of call target. ok.f('wrong type'); ~~~~~~~~~~~~ -!!! error TS2345: Argument of type 'string' is not assignable to parameter of type 'number'. +!!! error TS2345: Argument of type '"wrong type"' is not assignable to parameter of type 'number'. ok.f(13, 'too many arguments'); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ !!! error TS2346: Supplied parameters do not match any signature of call target. @@ -210,7 +210,7 @@ tests/cases/conformance/types/thisType/thisTypeInFunctionsNegative.ts(175,35): e !!! error TS2346: Supplied parameters do not match any signature of call target. c.explicitC('wrong type'); ~~~~~~~~~~~~ -!!! error TS2345: Argument of type 'string' is not assignable to parameter of type 'number'. +!!! error TS2345: Argument of type '"wrong type"' is not assignable to parameter of type 'number'. c.explicitC(13, 'too many arguments'); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ !!! error TS2346: Supplied parameters do not match any signature of call target. @@ -219,7 +219,7 @@ tests/cases/conformance/types/thisType/thisTypeInFunctionsNegative.ts(175,35): e !!! error TS2346: Supplied parameters do not match any signature of call target. c.explicitThis('wrong type 2'); ~~~~~~~~~~~~~~ -!!! error TS2345: Argument of type 'string' is not assignable to parameter of type 'number'. +!!! error TS2345: Argument of type '"wrong type 2"' is not assignable to parameter of type 'number'. c.explicitThis(14, 'too many arguments 2'); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ !!! error TS2346: Supplied parameters do not match any signature of call target. @@ -228,7 +228,7 @@ tests/cases/conformance/types/thisType/thisTypeInFunctionsNegative.ts(175,35): e !!! error TS2346: Supplied parameters do not match any signature of call target. c.implicitThis('wrong type 2'); ~~~~~~~~~~~~~~ -!!! error TS2345: Argument of type 'string' is not assignable to parameter of type 'number'. +!!! error TS2345: Argument of type '"wrong type 2"' is not assignable to parameter of type 'number'. c.implicitThis(14, 'too many arguments 2'); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ !!! error TS2346: Supplied parameters do not match any signature of call target. @@ -237,7 +237,7 @@ tests/cases/conformance/types/thisType/thisTypeInFunctionsNegative.ts(175,35): e !!! error TS2346: Supplied parameters do not match any signature of call target. c.explicitProperty('wrong type 3'); ~~~~~~~~~~~~~~ -!!! error TS2345: Argument of type 'string' is not assignable to parameter of type 'number'. +!!! error TS2345: Argument of type '"wrong type 3"' is not assignable to parameter of type 'number'. c.explicitProperty(15, 'too many arguments 3'); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ !!! error TS2346: Supplied parameters do not match any signature of call target. diff --git a/tests/baselines/reference/thisTypeInObjectLiterals.types b/tests/baselines/reference/thisTypeInObjectLiterals.types index 91d95d5f0a8..240cfaa54f9 100644 --- a/tests/baselines/reference/thisTypeInObjectLiterals.types +++ b/tests/baselines/reference/thisTypeInObjectLiterals.types @@ -5,7 +5,7 @@ let o = { d: "bar", >d : string ->"bar" : string +>"bar" : "bar" m() { >m : () => any @@ -37,7 +37,7 @@ let mutuallyRecursive = { a: 100, >a : number ->100 : number +>100 : 100 start() { >start : () => any @@ -71,7 +71,7 @@ let mutuallyRecursive = { if (n > 0) { >n > 0 : boolean >n : number ->0 : number +>0 : 0 return this.passthrough(n - 1); >this.passthrough(n - 1) : any @@ -80,7 +80,7 @@ let mutuallyRecursive = { >passthrough : any >n - 1 : number >n : number ->1 : number +>1 : 1 } return n; >n : number diff --git a/tests/baselines/reference/thisTypeInTuples.types b/tests/baselines/reference/thisTypeInTuples.types index d2d70ad8e09..3b6f995840e 100644 --- a/tests/baselines/reference/thisTypeInTuples.types +++ b/tests/baselines/reference/thisTypeInTuples.types @@ -10,8 +10,8 @@ interface Array { let t: [number, string] = [42, "hello"]; >t : [number, string] >[42, "hello"] : [number, string] ->42 : number ->"hello" : string +>42 : 42 +>"hello" : "hello" let a = t.slice(); >a : [number, string] @@ -26,7 +26,7 @@ let b = t.slice(1); >t.slice : { (start?: number, end?: number): (string | number)[]; (): [number, string]; } >t : [number, string] >slice : { (start?: number, end?: number): (string | number)[]; (): [number, string]; } ->1 : number +>1 : 1 let c = t.slice(0, 1); >c : (string | number)[] @@ -34,6 +34,6 @@ let c = t.slice(0, 1); >t.slice : { (start?: number, end?: number): (string | number)[]; (): [number, string]; } >t : [number, string] >slice : { (start?: number, end?: number): (string | number)[]; (): [number, string]; } ->0 : number ->1 : number +>0 : 0 +>1 : 1 diff --git a/tests/baselines/reference/throwInEnclosingStatements.types b/tests/baselines/reference/throwInEnclosingStatements.types index eb127cf28bd..4955b9243ae 100644 --- a/tests/baselines/reference/throwInEnclosingStatements.types +++ b/tests/baselines/reference/throwInEnclosingStatements.types @@ -34,12 +34,12 @@ switch (y) { var z = 0; >z : number ->0 : number +>0 : 0 while (z < 10) { >z < 10 : boolean >z : number ->10 : number +>10 : 10 throw z; >z : number @@ -47,7 +47,7 @@ while (z < 10) { for (var i = 0; ;) { throw i; } >i : number ->0 : number +>0 : 0 >i : number for (var idx in {}) { throw idx; } @@ -57,16 +57,16 @@ for (var idx in {}) { throw idx; } do { throw null; }while(true) >null : null ->true : boolean +>true : true var j = 0; >j : number ->0 : number +>0 : 0 while (j < 0) { throw j; } >j < 0 : boolean >j : number ->0 : number +>0 : 0 >j : number class C { @@ -98,7 +98,7 @@ var aa = { id:12, >id : number ->12 : number +>12 : 12 biz() { >biz : () => void diff --git a/tests/baselines/reference/throwStatements.types b/tests/baselines/reference/throwStatements.types index 5023513ee53..19b8988ed47 100644 --- a/tests/baselines/reference/throwStatements.types +++ b/tests/baselines/reference/throwStatements.types @@ -40,7 +40,7 @@ class D{ function F(x: string): number { return 42; } >F : (x: string) => number >x : string ->42 : number +>42 : 42 module M { >M : typeof M @@ -63,14 +63,14 @@ module M { var aNumber = 9.9; >aNumber : number ->9.9 : number +>9.9 : 9.9 throw aNumber; >aNumber : number var aString = 'this is a string'; >aString : string ->'this is a string' : string +>'this is a string' : "this is a string" throw aString; >aString : string @@ -79,7 +79,7 @@ var aDate = new Date(12); >aDate : Date >new Date(12) : Date >Date : DateConstructor ->12 : number +>12 : 12 throw aDate; >aDate : Date @@ -135,7 +135,7 @@ var anObjectLiteral = { id: 12 }; >anObjectLiteral : { id: number; } >{ id: 12 } : { id: number; } >id : number ->12 : number +>12 : 12 throw anObjectLiteral; >anObjectLiteral : { id: number; } @@ -150,13 +150,13 @@ throw aFunction; throw aFunction(''); >aFunction('') : number >aFunction : (x: string) => number ->'' : string +>'' : "" var aLambda = (x) => 2; >aLambda : (x: any) => number >(x) => 2 : (x: any) => number >x : any ->2 : number +>2 : 2 throw aLambda; >aLambda : (x: any) => number @@ -164,7 +164,7 @@ throw aLambda; throw aLambda(1); >aLambda(1) : number >aLambda : (x: any) => number ->1 : number +>1 : 1 var aModule = M; >aModule : typeof M @@ -205,10 +205,10 @@ throw x; // literals throw 0.0; ->0.0 : number +>0.0 : 0 throw false; ->false : boolean +>false : false throw null; >null : null @@ -217,34 +217,34 @@ throw undefined; >undefined : undefined throw 'a string'; ->'a string' : string +>'a string' : "a string" throw function () { return 'a string' }; >function () { return 'a string' } : () => string ->'a string' : string +>'a string' : "a string" throw (x:T) => 42; >(x:T) => 42 : (x: T) => number >T : T >x : T >T : T ->42 : number +>42 : 42 throw { x: 12, y: 13 }; >{ x: 12, y: 13 } : { x: number; y: number; } >x : number ->12 : number +>12 : 12 >y : number ->13 : number +>13 : 13 throw []; >[] : undefined[] throw ['a', ['b']]; >['a', ['b']] : (string | string[])[] ->'a' : string +>'a' : "a" >['b'] : string[] ->'b' : string +>'b' : "b" throw /[a-z]/; >/[a-z]/ : RegExp diff --git a/tests/baselines/reference/toStringOnPrimitives.types b/tests/baselines/reference/toStringOnPrimitives.types index 4d7227f248a..1b0e320ef6f 100644 --- a/tests/baselines/reference/toStringOnPrimitives.types +++ b/tests/baselines/reference/toStringOnPrimitives.types @@ -2,22 +2,22 @@ true.toString() >true.toString() : string >true.toString : () => string ->true : boolean +>true : true >toString : () => string var aBool = false; >aBool : boolean ->false : boolean +>false : false aBool.toString(); >aBool.toString() : string >aBool.toString : () => string ->aBool : boolean +>aBool : false >toString : () => string 1..toString(); >1..toString() : string >1..toString : (radix?: number) => string ->1. : number +>1. : 1 >toString : (radix?: number) => string diff --git a/tests/baselines/reference/topLevel.types b/tests/baselines/reference/topLevel.types index ac1dd1182b9..72794b6f4e3 100644 --- a/tests/baselines/reference/topLevel.types +++ b/tests/baselines/reference/topLevel.types @@ -48,21 +48,21 @@ class Point implements IPoint { >"("+this.x+","+this.y : string >"("+this.x+"," : string >"("+this.x : string ->"(" : string +>"(" : "(" >this.x : any >this : this >x : any ->"," : string +>"," : "," >this.y : any >this : this >y : any ->")" : string +>")" : ")" } } var result=""; >result : string ->"" : string +>"" : "" result+=(new Point(3,4).move(2,2)); >result+=(new Point(3,4).move(2,2)) : string @@ -72,11 +72,11 @@ result+=(new Point(3,4).move(2,2)); >new Point(3,4).move : (xo: number, yo: number) => Point >new Point(3,4) : Point >Point : typeof Point ->3 : number ->4 : number +>3 : 3 +>4 : 4 >move : (xo: number, yo: number) => Point ->2 : number ->2 : number +>2 : 2 +>2 : 2 module M { >M : typeof M @@ -85,8 +85,8 @@ module M { >origin : Point >new Point(0,0) : Point >Point : typeof Point ->0 : number ->0 : number +>0 : 0 +>0 : 0 } result+=(M.origin.move(1,1)); @@ -99,7 +99,7 @@ result+=(M.origin.move(1,1)); >M : typeof M >origin : Point >move : (xo: number, yo: number) => Point ->1 : number ->1 : number +>1 : 1 +>1 : 1 diff --git a/tests/baselines/reference/topLevelAmbientModule.types b/tests/baselines/reference/topLevelAmbientModule.types index c5bcfa3a5bf..aef1bb5486f 100644 --- a/tests/baselines/reference/topLevelAmbientModule.types +++ b/tests/baselines/reference/topLevelAmbientModule.types @@ -9,7 +9,7 @@ var z = foo.x + 10; >foo.x : number >foo : typeof foo >x : number ->10 : number +>10 : 10 === tests/cases/conformance/externalModules/foo_0.ts === declare module "foo" { diff --git a/tests/baselines/reference/topLevelExports.types b/tests/baselines/reference/topLevelExports.types index ab156991506..4a27478c08f 100644 --- a/tests/baselines/reference/topLevelExports.types +++ b/tests/baselines/reference/topLevelExports.types @@ -1,7 +1,7 @@ === tests/cases/compiler/topLevelExports.ts === export var foo = 3; >foo : number ->3 : number +>3 : 3 function log(n:number) { return n;} >log : (n: number) => number diff --git a/tests/baselines/reference/trailingCommasES3.types b/tests/baselines/reference/trailingCommasES3.types index 98777c6b37f..21e397a1c46 100644 --- a/tests/baselines/reference/trailingCommasES3.types +++ b/tests/baselines/reference/trailingCommasES3.types @@ -4,23 +4,23 @@ var o1 = { a: 1, b: 2 }; >o1 : { a: number; b: number; } >{ a: 1, b: 2 } : { a: number; b: number; } >a : number ->1 : number +>1 : 1 >b : number ->2 : number +>2 : 2 var o2 = { a: 1, b: 2, }; >o2 : { a: number; b: number; } >{ a: 1, b: 2, } : { a: number; b: number; } >a : number ->1 : number +>1 : 1 >b : number ->2 : number +>2 : 2 var o3 = { a: 1, }; >o3 : { a: number; } >{ a: 1, } : { a: number; } >a : number ->1 : number +>1 : 1 var o4 = {}; >o4 : {} @@ -29,19 +29,19 @@ var o4 = {}; var a1 = [1, 2]; >a1 : number[] >[1, 2] : number[] ->1 : number ->2 : number +>1 : 1 +>2 : 2 var a2 = [1, 2, ]; >a2 : number[] >[1, 2, ] : number[] ->1 : number ->2 : number +>1 : 1 +>2 : 2 var a3 = [1, ]; >a3 : number[] >[1, ] : number[] ->1 : number +>1 : 1 var a4 = []; >a4 : any[] @@ -50,7 +50,7 @@ var a4 = []; var a5 = [1, , ]; >a5 : number[] >[1, , ] : number[] ->1 : number +>1 : 1 > : undefined var a6 = [, , ]; diff --git a/tests/baselines/reference/trailingCommasES5.types b/tests/baselines/reference/trailingCommasES5.types index 498f70df94a..22d4fb37780 100644 --- a/tests/baselines/reference/trailingCommasES5.types +++ b/tests/baselines/reference/trailingCommasES5.types @@ -4,23 +4,23 @@ var o1 = { a: 1, b: 2 }; >o1 : { a: number; b: number; } >{ a: 1, b: 2 } : { a: number; b: number; } >a : number ->1 : number +>1 : 1 >b : number ->2 : number +>2 : 2 var o2 = { a: 1, b: 2, }; >o2 : { a: number; b: number; } >{ a: 1, b: 2, } : { a: number; b: number; } >a : number ->1 : number +>1 : 1 >b : number ->2 : number +>2 : 2 var o3 = { a: 1, }; >o3 : { a: number; } >{ a: 1, } : { a: number; } >a : number ->1 : number +>1 : 1 var o4 = {}; >o4 : {} @@ -29,19 +29,19 @@ var o4 = {}; var a1 = [1, 2]; >a1 : number[] >[1, 2] : number[] ->1 : number ->2 : number +>1 : 1 +>2 : 2 var a2 = [1, 2, ]; >a2 : number[] >[1, 2, ] : number[] ->1 : number ->2 : number +>1 : 1 +>2 : 2 var a3 = [1, ]; >a3 : number[] >[1, ] : number[] ->1 : number +>1 : 1 var a4 = []; >a4 : any[] @@ -50,7 +50,7 @@ var a4 = []; var a5 = [1, , ]; >a5 : number[] >[1, , ] : number[] ->1 : number +>1 : 1 > : undefined var a6 = [, , ]; diff --git a/tests/baselines/reference/trailingCommasInFunctionParametersAndArguments.types b/tests/baselines/reference/trailingCommasInFunctionParametersAndArguments.types index 9e2aa0abd8a..00cca0b5e87 100644 --- a/tests/baselines/reference/trailingCommasInFunctionParametersAndArguments.types +++ b/tests/baselines/reference/trailingCommasInFunctionParametersAndArguments.types @@ -7,7 +7,7 @@ function f1(x,) {} f1(1,); >f1(1,) : void >f1 : (x: any) => void ->1 : number +>1 : 1 function f2(...args,) {} >f2 : (...args: any[]) => void @@ -33,14 +33,14 @@ declare function f3(x, y,): string; >f3(1,) : number >f3(1,) : number >f3 : { (x: any): number; (x: any, y: any): string; } ->1 : number +>1 : 1 f3(1, 2,); >f3(1, 2,) : string >f3(1, 2,) : string >f3 : { (x: any): number; (x: any, y: any): string; } ->1 : number ->2 : number +>1 : 1 +>2 : 2 // Works for constructors too class X { @@ -67,5 +67,5 @@ interface Y { new X(1,); >new X(1,) : X >X : typeof X ->1 : number +>1 : 1 diff --git a/tests/baselines/reference/tsxAttributeErrors.errors.txt b/tests/baselines/reference/tsxAttributeErrors.errors.txt index 30a897c5163..4a898969363 100644 --- a/tests/baselines/reference/tsxAttributeErrors.errors.txt +++ b/tests/baselines/reference/tsxAttributeErrors.errors.txt @@ -1,5 +1,5 @@ -tests/cases/conformance/jsx/tsxAttributeErrors.tsx(15,6): error TS2322: Type 'number' is not assignable to type 'string'. -tests/cases/conformance/jsx/tsxAttributeErrors.tsx(18,6): error TS2322: Type 'string' is not assignable to type 'number'. +tests/cases/conformance/jsx/tsxAttributeErrors.tsx(15,6): error TS2322: Type '42' is not assignable to type 'string'. +tests/cases/conformance/jsx/tsxAttributeErrors.tsx(18,6): error TS2322: Type '"foo"' is not assignable to type 'number'. tests/cases/conformance/jsx/tsxAttributeErrors.tsx(22,6): error TS2606: Property 'text' of JSX spread attribute is not assignable to target property. Type 'number' is not assignable to type 'string'. @@ -21,12 +21,12 @@ tests/cases/conformance/jsx/tsxAttributeErrors.tsx(22,6): error TS2606: Property // Error, number is not assignable to string
; ~~~~~~~~~ -!!! error TS2322: Type 'number' is not assignable to type 'string'. +!!! error TS2322: Type '42' is not assignable to type 'string'. // Error, string is not assignable to number
; ~~~~~~~~~~~~~ -!!! error TS2322: Type 'string' is not assignable to type 'number'. +!!! error TS2322: Type '"foo"' is not assignable to type 'number'. // Error, number is not assignable to string var attribs = { text: 100 }; diff --git a/tests/baselines/reference/tsxAttributeResolution1.errors.txt b/tests/baselines/reference/tsxAttributeResolution1.errors.txt index 49bb504604e..f7fb114f3e0 100644 --- a/tests/baselines/reference/tsxAttributeResolution1.errors.txt +++ b/tests/baselines/reference/tsxAttributeResolution1.errors.txt @@ -1,10 +1,10 @@ -tests/cases/conformance/jsx/file.tsx(23,8): error TS2322: Type 'string' is not assignable to type 'number'. +tests/cases/conformance/jsx/file.tsx(23,8): error TS2322: Type '"0"' is not assignable to type 'number'. tests/cases/conformance/jsx/file.tsx(24,8): error TS2339: Property 'y' does not exist on type 'Attribs1'. tests/cases/conformance/jsx/file.tsx(25,8): error TS2339: Property 'y' does not exist on type 'Attribs1'. -tests/cases/conformance/jsx/file.tsx(26,8): error TS2322: Type 'string' is not assignable to type 'number'. +tests/cases/conformance/jsx/file.tsx(26,8): error TS2322: Type '"32"' is not assignable to type 'number'. tests/cases/conformance/jsx/file.tsx(27,8): error TS2339: Property 'var' does not exist on type 'Attribs1'. tests/cases/conformance/jsx/file.tsx(29,1): error TS2324: Property 'reqd' is missing in type '{ reqd: string; }'. -tests/cases/conformance/jsx/file.tsx(30,8): error TS2322: Type 'number' is not assignable to type 'string'. +tests/cases/conformance/jsx/file.tsx(30,8): error TS2322: Type '10' is not assignable to type 'string'. ==== tests/cases/conformance/jsx/file.tsx (7 errors) ==== @@ -32,7 +32,7 @@ tests/cases/conformance/jsx/file.tsx(30,8): error TS2322: Type 'number' is not a // Errors ; // Error, '0' is not number ~~~~~~~ -!!! error TS2322: Type 'string' is not assignable to type 'number'. +!!! error TS2322: Type '"0"' is not assignable to type 'number'. ; // Error, no property "y" ~ !!! error TS2339: Property 'y' does not exist on type 'Attribs1'. @@ -41,7 +41,7 @@ tests/cases/conformance/jsx/file.tsx(30,8): error TS2322: Type 'number' is not a !!! error TS2339: Property 'y' does not exist on type 'Attribs1'. ; // Error, "32" is not number ~~~~~~ -!!! error TS2322: Type 'string' is not assignable to type 'number'. +!!! error TS2322: Type '"32"' is not assignable to type 'number'. ; // Error, no 'var' property ~~~ !!! error TS2339: Property 'var' does not exist on type 'Attribs1'. @@ -51,7 +51,7 @@ tests/cases/conformance/jsx/file.tsx(30,8): error TS2322: Type 'number' is not a !!! error TS2324: Property 'reqd' is missing in type '{ reqd: string; }'. ; // Error, reqd is not string ~~~~~~~~~ -!!! error TS2322: Type 'number' is not assignable to type 'string'. +!!! error TS2322: Type '10' is not assignable to type 'string'. // Should be OK ; diff --git a/tests/baselines/reference/tsxAttributeResolution10.errors.txt b/tests/baselines/reference/tsxAttributeResolution10.errors.txt index c929756364c..787eb4b5f00 100644 --- a/tests/baselines/reference/tsxAttributeResolution10.errors.txt +++ b/tests/baselines/reference/tsxAttributeResolution10.errors.txt @@ -1,4 +1,4 @@ -tests/cases/conformance/jsx/file.tsx(11,14): error TS2322: Type 'string' is not assignable to type 'boolean'. +tests/cases/conformance/jsx/file.tsx(11,14): error TS2322: Type '"world"' is not assignable to type 'boolean'. ==== tests/cases/conformance/jsx/react.d.ts (0 errors) ==== @@ -25,7 +25,7 @@ tests/cases/conformance/jsx/file.tsx(11,14): error TS2322: Type 'string' is not // Should be an error ; ~~~~~~~~~~~ -!!! error TS2322: Type 'string' is not assignable to type 'boolean'. +!!! error TS2322: Type '"world"' is not assignable to type 'boolean'. // Should be OK ; diff --git a/tests/baselines/reference/tsxAttributeResolution14.errors.txt b/tests/baselines/reference/tsxAttributeResolution14.errors.txt index 81d42e49059..9f4e00747f1 100644 --- a/tests/baselines/reference/tsxAttributeResolution14.errors.txt +++ b/tests/baselines/reference/tsxAttributeResolution14.errors.txt @@ -1,5 +1,5 @@ -tests/cases/conformance/jsx/file.tsx(14,28): error TS2322: Type 'number' is not assignable to type 'string'. -tests/cases/conformance/jsx/file.tsx(16,28): error TS2322: Type 'boolean' is not assignable to type 'string | number'. +tests/cases/conformance/jsx/file.tsx(14,28): error TS2322: Type '2' is not assignable to type 'string'. +tests/cases/conformance/jsx/file.tsx(16,28): error TS2322: Type 'true' is not assignable to type 'string | number'. ==== tests/cases/conformance/jsx/react.d.ts (0 errors) ==== @@ -28,11 +28,11 @@ tests/cases/conformance/jsx/file.tsx(16,28): error TS2322: Type 'boolean' is not
// error ~~~~~~~~~~~~~~~ -!!! error TS2322: Type 'number' is not assignable to type 'string'. +!!! error TS2322: Type '2' is not assignable to type 'string'. // ok // error ~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2322: Type 'boolean' is not assignable to type 'string | number'. +!!! error TS2322: Type 'true' is not assignable to type 'string | number'.
) } \ No newline at end of file diff --git a/tests/baselines/reference/tsxAttributeResolution3.errors.txt b/tests/baselines/reference/tsxAttributeResolution3.errors.txt index 6513b9879dc..ae8ba7a9a54 100644 --- a/tests/baselines/reference/tsxAttributeResolution3.errors.txt +++ b/tests/baselines/reference/tsxAttributeResolution3.errors.txt @@ -3,7 +3,7 @@ tests/cases/conformance/jsx/file.tsx(19,8): error TS2606: Property 'x' of JSX sp tests/cases/conformance/jsx/file.tsx(23,1): error TS2324: Property 'x' is missing in type 'Attribs1'. tests/cases/conformance/jsx/file.tsx(31,15): error TS2606: Property 'x' of JSX spread attribute is not assignable to target property. Type 'number' is not assignable to type 'string'. -tests/cases/conformance/jsx/file.tsx(39,8): error TS2322: Type 'number' is not assignable to type 'string'. +tests/cases/conformance/jsx/file.tsx(39,8): error TS2322: Type '32' is not assignable to type 'string'. ==== tests/cases/conformance/jsx/file.tsx (4 errors) ==== @@ -55,5 +55,5 @@ tests/cases/conformance/jsx/file.tsx(39,8): error TS2322: Type 'number' is not a var obj7 = { x: 'foo' }; ~~~~~~ -!!! error TS2322: Type 'number' is not assignable to type 'string'. +!!! error TS2322: Type '32' is not assignable to type 'string'. \ No newline at end of file diff --git a/tests/baselines/reference/tsxAttributeResolution6.errors.txt b/tests/baselines/reference/tsxAttributeResolution6.errors.txt index 732ac9500a9..f3a4d512152 100644 --- a/tests/baselines/reference/tsxAttributeResolution6.errors.txt +++ b/tests/baselines/reference/tsxAttributeResolution6.errors.txt @@ -1,5 +1,5 @@ tests/cases/conformance/jsx/file.tsx(10,8): error TS2322: Type 'boolean' is not assignable to type 'string'. -tests/cases/conformance/jsx/file.tsx(11,8): error TS2322: Type 'string' is not assignable to type 'boolean'. +tests/cases/conformance/jsx/file.tsx(11,8): error TS2322: Type '"true"' is not assignable to type 'boolean'. tests/cases/conformance/jsx/file.tsx(12,1): error TS2324: Property 'n' is missing in type '{ n: boolean; }'. @@ -18,7 +18,7 @@ tests/cases/conformance/jsx/file.tsx(12,1): error TS2324: Property 'n' is missin !!! error TS2322: Type 'boolean' is not assignable to type 'string'. ; ~~~~~~~~ -!!! error TS2322: Type 'string' is not assignable to type 'boolean'. +!!! error TS2322: Type '"true"' is not assignable to type 'boolean'. ; ~~~~~~~~~ !!! error TS2324: Property 'n' is missing in type '{ n: boolean; }'. diff --git a/tests/baselines/reference/tsxAttributeResolution7.errors.txt b/tests/baselines/reference/tsxAttributeResolution7.errors.txt index acbd7f407de..f5af1b48eb2 100644 --- a/tests/baselines/reference/tsxAttributeResolution7.errors.txt +++ b/tests/baselines/reference/tsxAttributeResolution7.errors.txt @@ -1,4 +1,4 @@ -tests/cases/conformance/jsx/file.tsx(9,8): error TS2322: Type 'number' is not assignable to type 'string'. +tests/cases/conformance/jsx/file.tsx(9,8): error TS2322: Type '32' is not assignable to type 'string'. ==== tests/cases/conformance/jsx/file.tsx (1 errors) ==== @@ -12,7 +12,7 @@ tests/cases/conformance/jsx/file.tsx(9,8): error TS2322: Type 'number' is not as // Error ; ~~~~~~~~~~~~~ -!!! error TS2322: Type 'number' is not assignable to type 'string'. +!!! error TS2322: Type '32' is not assignable to type 'string'. // OK ; diff --git a/tests/baselines/reference/tsxAttributeResolution9.errors.txt b/tests/baselines/reference/tsxAttributeResolution9.errors.txt index c25532eaa0a..73571689b1f 100644 --- a/tests/baselines/reference/tsxAttributeResolution9.errors.txt +++ b/tests/baselines/reference/tsxAttributeResolution9.errors.txt @@ -1,4 +1,4 @@ -tests/cases/conformance/jsx/file.tsx(9,14): error TS2322: Type 'number' is not assignable to type 'string'. +tests/cases/conformance/jsx/file.tsx(9,14): error TS2322: Type '0' is not assignable to type 'string'. ==== tests/cases/conformance/jsx/react.d.ts (0 errors) ==== @@ -27,5 +27,5 @@ tests/cases/conformance/jsx/file.tsx(9,14): error TS2322: Type 'number' is not a ; // ok ; // should be an error ~~~~~~~ -!!! error TS2322: Type 'number' is not assignable to type 'string'. +!!! error TS2322: Type '0' is not assignable to type 'string'. \ No newline at end of file diff --git a/tests/baselines/reference/tsxDynamicTagName1.types b/tests/baselines/reference/tsxDynamicTagName1.types index 005afcf6adb..def9810e052 100644 --- a/tests/baselines/reference/tsxDynamicTagName1.types +++ b/tests/baselines/reference/tsxDynamicTagName1.types @@ -2,7 +2,7 @@ var CustomTag = "h1"; >CustomTag : string ->"h1" : string +>"h1" : "h1" Hello World // No error > Hello World : any diff --git a/tests/baselines/reference/tsxDynamicTagName5.types b/tests/baselines/reference/tsxDynamicTagName5.types index ac4ee31141a..dbc01e89483 100644 --- a/tests/baselines/reference/tsxDynamicTagName5.types +++ b/tests/baselines/reference/tsxDynamicTagName5.types @@ -19,7 +19,7 @@ export class Text extends React.Component<{}, {}> { _tagName: string = 'div'; >_tagName : string ->'div' : string +>'div' : "div" render() { >render : () => any diff --git a/tests/baselines/reference/tsxDynamicTagName6.types b/tests/baselines/reference/tsxDynamicTagName6.types index 5dadf6fe825..b4fbb1ed358 100644 --- a/tests/baselines/reference/tsxDynamicTagName6.types +++ b/tests/baselines/reference/tsxDynamicTagName6.types @@ -18,7 +18,7 @@ const t = {tag:'h1'} >t : { tag: string; } >{tag:'h1'} : { tag: string; } >tag : string ->'h1' : string +>'h1' : "h1" const foo = // No error >foo : JSX.Element diff --git a/tests/baselines/reference/tsxDynamicTagName8.types b/tests/baselines/reference/tsxDynamicTagName8.types index 154e7e33fe0..e2d7956a989 100644 --- a/tests/baselines/reference/tsxDynamicTagName8.types +++ b/tests/baselines/reference/tsxDynamicTagName8.types @@ -19,7 +19,7 @@ export class Text extends React.Component<{}, {}> { _tagName: string = 'div'; >_tagName : string ->'div' : string +>'div' : "div" render() { >render : () => any diff --git a/tests/baselines/reference/tsxElementResolution12.errors.txt b/tests/baselines/reference/tsxElementResolution12.errors.txt index 4a15005f6fb..5367e29e388 100644 --- a/tests/baselines/reference/tsxElementResolution12.errors.txt +++ b/tests/baselines/reference/tsxElementResolution12.errors.txt @@ -1,6 +1,6 @@ tests/cases/conformance/jsx/file.tsx(17,2): error TS2304: Cannot find name 'Obj2'. tests/cases/conformance/jsx/file.tsx(23,1): error TS2607: JSX element class does not support attributes because it does not have a 'pr' property -tests/cases/conformance/jsx/file.tsx(30,7): error TS2322: Type 'string' is not assignable to type 'number'. +tests/cases/conformance/jsx/file.tsx(30,7): error TS2322: Type '"10"' is not assignable to type 'number'. ==== tests/cases/conformance/jsx/file.tsx (3 errors) ==== @@ -39,5 +39,5 @@ tests/cases/conformance/jsx/file.tsx(30,7): error TS2322: Type 'string' is not a ; // OK ; // Error ~~~~~~~~ -!!! error TS2322: Type 'string' is not assignable to type 'number'. +!!! error TS2322: Type '"10"' is not assignable to type 'number'. \ No newline at end of file diff --git a/tests/baselines/reference/tsxElementResolution13.types b/tests/baselines/reference/tsxElementResolution13.types index 57884f86b56..d55d4705ff4 100644 --- a/tests/baselines/reference/tsxElementResolution13.types +++ b/tests/baselines/reference/tsxElementResolution13.types @@ -25,5 +25,5 @@ var obj1: Obj1; > : JSX.Element >obj1 : Obj1 >x : any ->10 : number +>10 : 10 diff --git a/tests/baselines/reference/tsxElementResolution14.types b/tests/baselines/reference/tsxElementResolution14.types index 2768a6c531d..752a0baafb9 100644 --- a/tests/baselines/reference/tsxElementResolution14.types +++ b/tests/baselines/reference/tsxElementResolution14.types @@ -20,5 +20,5 @@ var obj1: Obj1; > : JSX.Element >obj1 : Obj1 >x : any ->10 : number +>10 : 10 diff --git a/tests/baselines/reference/tsxElementResolution9.types b/tests/baselines/reference/tsxElementResolution9.types index b138aa0509e..c63e61efc07 100644 --- a/tests/baselines/reference/tsxElementResolution9.types +++ b/tests/baselines/reference/tsxElementResolution9.types @@ -68,5 +68,5 @@ var Obj3: Obj3; > : JSX.Element >Obj3 : Obj3 >x : any ->42 : number +>42 : 42 diff --git a/tests/baselines/reference/tsxEmit1.types b/tests/baselines/reference/tsxEmit1.types index e6f92bebd1e..84f00b4758a 100644 --- a/tests/baselines/reference/tsxEmit1.types +++ b/tests/baselines/reference/tsxEmit1.types @@ -45,7 +45,7 @@ var selfClosed5 =
; >
: JSX.Element >div : any >x : any ->0 : number +>0 : 0 >y : any var selfClosed6 =
; @@ -53,7 +53,7 @@ var selfClosed6 =
; >
: JSX.Element >div : any >x : any ->"1" : string +>"1" : "1" >y : any var selfClosed7 =
; diff --git a/tests/baselines/reference/tsxEmit3.errors.txt b/tests/baselines/reference/tsxEmit3.errors.txt new file mode 100644 index 00000000000..bef4d8d4efc --- /dev/null +++ b/tests/baselines/reference/tsxEmit3.errors.txt @@ -0,0 +1,56 @@ +tests/cases/conformance/jsx/file.tsx(19,2): error TS2695: Left side of comma operator is unused and has no side effects. +tests/cases/conformance/jsx/file.tsx(23,3): error TS2695: Left side of comma operator is unused and has no side effects. +tests/cases/conformance/jsx/file.tsx(26,3): error TS2695: Left side of comma operator is unused and has no side effects. +tests/cases/conformance/jsx/file.tsx(39,2): error TS2695: Left side of comma operator is unused and has no side effects. + + +==== tests/cases/conformance/jsx/file.tsx (4 errors) ==== + + declare module JSX { + interface Element { } + interface IntrinsicElements { } + } + + module M { + export class Foo { constructor() { } } + export module S { + export class Bar { } + + // Emit Foo + // Foo, ; + } + } + + module M { + // Emit M.Foo + Foo, ; + ~~~ +!!! error TS2695: Left side of comma operator is unused and has no side effects. + + export module S { + // Emit M.Foo + Foo, ; + ~~~ +!!! error TS2695: Left side of comma operator is unused and has no side effects. + + // Emit S.Bar + Bar, ; + ~~~ +!!! error TS2695: Left side of comma operator is unused and has no side effects. + } + + } + + module M { + // Emit M.S.Bar + S.Bar, ; + } + + module M { + var M = 100; + // Emit M_1.Foo + Foo, ; + ~~~ +!!! error TS2695: Left side of comma operator is unused and has no side effects. + } + \ No newline at end of file diff --git a/tests/baselines/reference/tsxEmit3.types b/tests/baselines/reference/tsxEmit3.types index e70c44d0041..42c31a37720 100644 --- a/tests/baselines/reference/tsxEmit3.types +++ b/tests/baselines/reference/tsxEmit3.types @@ -77,7 +77,7 @@ module M { var M = 100; >M : number ->100 : number +>100 : 100 // Emit M_1.Foo Foo, ; diff --git a/tests/baselines/reference/tsxErrorRecovery2.errors.txt b/tests/baselines/reference/tsxErrorRecovery2.errors.txt index 9a0b5790b2c..472b94654aa 100644 --- a/tests/baselines/reference/tsxErrorRecovery2.errors.txt +++ b/tests/baselines/reference/tsxErrorRecovery2.errors.txt @@ -1,18 +1,24 @@ +tests/cases/conformance/jsx/file1.tsx(4,1): error TS2695: Left side of comma operator is unused and has no side effects. tests/cases/conformance/jsx/file1.tsx(6,1): error TS2657: JSX expressions must have one parent element +tests/cases/conformance/jsx/file2.tsx(1,9): error TS2695: Left side of comma operator is unused and has no side effects. tests/cases/conformance/jsx/file2.tsx(2,1): error TS2657: JSX expressions must have one parent element -==== tests/cases/conformance/jsx/file1.tsx (1 errors) ==== +==== tests/cases/conformance/jsx/file1.tsx (2 errors) ==== declare namespace JSX { interface Element { } }
+ ~~~~~~~~~~~ +!!! error TS2695: Left side of comma operator is unused and has no side effects.
!!! error TS2657: JSX expressions must have one parent element -==== tests/cases/conformance/jsx/file2.tsx (1 errors) ==== +==== tests/cases/conformance/jsx/file2.tsx (2 errors) ==== var x =
+ ~~~~~~~~~~~ +!!! error TS2695: Left side of comma operator is unused and has no side effects. !!! error TS2657: JSX expressions must have one parent element \ No newline at end of file diff --git a/tests/baselines/reference/tsxErrorRecovery3.errors.txt b/tests/baselines/reference/tsxErrorRecovery3.errors.txt index f7e4bc170a9..5e7c5bffcb5 100644 --- a/tests/baselines/reference/tsxErrorRecovery3.errors.txt +++ b/tests/baselines/reference/tsxErrorRecovery3.errors.txt @@ -1,16 +1,20 @@ +tests/cases/conformance/jsx/file1.tsx(4,1): error TS2695: Left side of comma operator is unused and has no side effects. tests/cases/conformance/jsx/file1.tsx(4,2): error TS2304: Cannot find name 'React'. tests/cases/conformance/jsx/file1.tsx(5,2): error TS2304: Cannot find name 'React'. tests/cases/conformance/jsx/file1.tsx(6,1): error TS2657: JSX expressions must have one parent element +tests/cases/conformance/jsx/file2.tsx(1,9): error TS2695: Left side of comma operator is unused and has no side effects. tests/cases/conformance/jsx/file2.tsx(1,10): error TS2304: Cannot find name 'React'. tests/cases/conformance/jsx/file2.tsx(1,21): error TS2304: Cannot find name 'React'. tests/cases/conformance/jsx/file2.tsx(2,1): error TS2657: JSX expressions must have one parent element -==== tests/cases/conformance/jsx/file1.tsx (3 errors) ==== +==== tests/cases/conformance/jsx/file1.tsx (4 errors) ==== declare namespace JSX { interface Element { } }
+ ~~~~~~~~~~~ +!!! error TS2695: Left side of comma operator is unused and has no side effects. ~~~ !!! error TS2304: Cannot find name 'React'.
@@ -19,8 +23,10 @@ tests/cases/conformance/jsx/file2.tsx(2,1): error TS2657: JSX expressions must h !!! error TS2657: JSX expressions must have one parent element -==== tests/cases/conformance/jsx/file2.tsx (3 errors) ==== +==== tests/cases/conformance/jsx/file2.tsx (4 errors) ==== var x =
+ ~~~~~~~~~~~ +!!! error TS2695: Left side of comma operator is unused and has no side effects. ~~~ !!! error TS2304: Cannot find name 'React'. ~~~ diff --git a/tests/baselines/reference/tsxGenericArrowFunctionParsing.types b/tests/baselines/reference/tsxGenericArrowFunctionParsing.types index d5a9436872a..693f920195d 100644 --- a/tests/baselines/reference/tsxGenericArrowFunctionParsing.types +++ b/tests/baselines/reference/tsxGenericArrowFunctionParsing.types @@ -51,7 +51,7 @@ var x4 = () => {}; >() => {} : JSX.Element >T : any >extends : any ->true : boolean +>true : true >T : any x4.isElement; diff --git a/tests/baselines/reference/tsxReactEmit1.types b/tests/baselines/reference/tsxReactEmit1.types index d837eb007bf..8eb14e91963 100644 --- a/tests/baselines/reference/tsxReactEmit1.types +++ b/tests/baselines/reference/tsxReactEmit1.types @@ -47,7 +47,7 @@ var selfClosed5 =
; >
: JSX.Element >div : any >x : any ->0 : number +>0 : 0 >y : any var selfClosed6 =
; @@ -55,7 +55,7 @@ var selfClosed6 =
; >
: JSX.Element >div : any >x : any ->"1" : string +>"1" : "1" >y : any var selfClosed7 =
; diff --git a/tests/baselines/reference/tsxReactEmitEntities.js b/tests/baselines/reference/tsxReactEmitEntities.js index 2a5c1ec4963..41c294b8bab 100644 --- a/tests/baselines/reference/tsxReactEmitEntities.js +++ b/tests/baselines/reference/tsxReactEmitEntities.js @@ -9,8 +9,27 @@ declare var React: any;
Dot goes here: · ¬AnEntity;
;
Be careful of "-ed strings!
; +
{{braces}}
; +// Escapes do nothing +
\n
; + +// Also works in string literal attributes +
; +// Does not happen for a string literal that happens to be inside an attribute (and escapes then work) +
; +// Preserves single quotes +
//// [file.js] React.createElement("div", null, "Dot goes here: \u00B7 ¬AnEntity; "); React.createElement("div", null, "Be careful of \"-ed strings!"); +React.createElement("div", null, "{{braces}}"); +// Escapes do nothing +React.createElement("div", null, "\\n"); +// Also works in string literal attributes +React.createElement("div", { attr: "{\u2026}\\" }); +// Does not happen for a string literal that happens to be inside an attribute (and escapes then work) +React.createElement("div", { attr: "{…}\"" }); +// Preserves single quotes +React.createElement("div", { attr: '"' }); diff --git a/tests/baselines/reference/tsxReactEmitEntities.symbols b/tests/baselines/reference/tsxReactEmitEntities.symbols index 5a0274029e4..470c6177842 100644 --- a/tests/baselines/reference/tsxReactEmitEntities.symbols +++ b/tests/baselines/reference/tsxReactEmitEntities.symbols @@ -23,3 +23,30 @@ declare var React: any; >div : Symbol(JSX.IntrinsicElements, Decl(file.tsx, 1, 22)) >div : Symbol(JSX.IntrinsicElements, Decl(file.tsx, 1, 22)) +
{{braces}}
; +>div : Symbol(JSX.IntrinsicElements, Decl(file.tsx, 1, 22)) +>div : Symbol(JSX.IntrinsicElements, Decl(file.tsx, 1, 22)) + +// Escapes do nothing +
\n
; +>div : Symbol(JSX.IntrinsicElements, Decl(file.tsx, 1, 22)) +>div : Symbol(JSX.IntrinsicElements, Decl(file.tsx, 1, 22)) + +// Also works in string literal attributes +
; +>div : Symbol(JSX.IntrinsicElements, Decl(file.tsx, 1, 22)) +>attr : Symbol(unknown) +>div : Symbol(JSX.IntrinsicElements, Decl(file.tsx, 1, 22)) + +// Does not happen for a string literal that happens to be inside an attribute (and escapes then work) +
; +>div : Symbol(JSX.IntrinsicElements, Decl(file.tsx, 1, 22)) +>attr : Symbol(unknown) +>div : Symbol(JSX.IntrinsicElements, Decl(file.tsx, 1, 22)) + +// Preserves single quotes +
+>div : Symbol(JSX.IntrinsicElements, Decl(file.tsx, 1, 22)) +>attr : Symbol(unknown) +>div : Symbol(JSX.IntrinsicElements, Decl(file.tsx, 1, 22)) + diff --git a/tests/baselines/reference/tsxReactEmitEntities.types b/tests/baselines/reference/tsxReactEmitEntities.types index 111653ea140..34ef6dff0a8 100644 --- a/tests/baselines/reference/tsxReactEmitEntities.types +++ b/tests/baselines/reference/tsxReactEmitEntities.types @@ -25,3 +25,36 @@ declare var React: any; >div : any >div : any +
{{braces}}
; +>
{{braces}}
: JSX.Element +>div : any +>div : any + +// Escapes do nothing +
\n
; +>
\n
: JSX.Element +>div : any +>div : any + +// Also works in string literal attributes +
; +>
: JSX.Element +>div : any +>attr : any +>div : any + +// Does not happen for a string literal that happens to be inside an attribute (and escapes then work) +
; +>
: JSX.Element +>div : any +>attr : any +>"{…}\"" : "{…}\"" +>div : any + +// Preserves single quotes +
+>
: JSX.Element +>div : any +>attr : any +>div : any + diff --git a/tests/baselines/reference/tsxReactEmitNesting.types b/tests/baselines/reference/tsxReactEmitNesting.types index fff29c11525..7a1b3e82441 100644 --- a/tests/baselines/reference/tsxReactEmitNesting.types +++ b/tests/baselines/reference/tsxReactEmitNesting.types @@ -62,7 +62,7 @@ let render = (ctrl, model) => >style : any >{display:(model.todos && model.todos.length) ? "block" : "none"} : { display: string; } >display : string ->(model.todos && model.todos.length) ? "block" : "none" : string +>(model.todos && model.todos.length) ? "block" : "none" : "block" | "none" >(model.todos && model.todos.length) : any >model.todos && model.todos.length : any >model.todos : any @@ -73,8 +73,8 @@ let render = (ctrl, model) => >model : any >todos : any >length : any ->"block" : string ->"none" : string +>"block" : "block" +>"none" : "none" > : any @@ -111,7 +111,7 @@ let render = (ctrl, model) => >class : any >{todo: true, completed: todo.completed, editing: todo == model.editedTodo} : { todo: boolean; completed: any; editing: boolean; } >todo : boolean ->true : boolean +>true : true >completed : any >todo.completed : any >todo : any diff --git a/tests/baselines/reference/tsxReactEmitWhitespace.types b/tests/baselines/reference/tsxReactEmitWhitespace.types index 824aa5cfdae..f5ae431d342 100644 --- a/tests/baselines/reference/tsxReactEmitWhitespace.types +++ b/tests/baselines/reference/tsxReactEmitWhitespace.types @@ -20,7 +20,7 @@ declare var React: any; var p = 0; >p : number ->0 : number +>0 : 0 // Emit " "
; diff --git a/tests/baselines/reference/tsxStatelessFunctionComponents1.errors.txt b/tests/baselines/reference/tsxStatelessFunctionComponents1.errors.txt index a40aef38e22..e1f7570d9c0 100644 --- a/tests/baselines/reference/tsxStatelessFunctionComponents1.errors.txt +++ b/tests/baselines/reference/tsxStatelessFunctionComponents1.errors.txt @@ -1,6 +1,6 @@ tests/cases/conformance/jsx/file.tsx(12,9): error TS2324: Property 'name' is missing in type 'IntrinsicAttributes & { name: string; }'. tests/cases/conformance/jsx/file.tsx(12,16): error TS2339: Property 'naaame' does not exist on type 'IntrinsicAttributes & { name: string; }'. -tests/cases/conformance/jsx/file.tsx(19,15): error TS2322: Type 'number' is not assignable to type 'string'. +tests/cases/conformance/jsx/file.tsx(19,15): error TS2322: Type '42' is not assignable to type 'string'. tests/cases/conformance/jsx/file.tsx(21,15): error TS2339: Property 'naaaaaaame' does not exist on type 'IntrinsicAttributes & { name?: string; }'. @@ -29,7 +29,7 @@ tests/cases/conformance/jsx/file.tsx(21,15): error TS2339: Property 'naaaaaaame' // Error let e = ; ~~~~~~~~~ -!!! error TS2322: Type 'number' is not assignable to type 'string'. +!!! error TS2322: Type '42' is not assignable to type 'string'. // Error let f = ; ~~~~~~~~~~ diff --git a/tests/baselines/reference/tsxTypeErrors.types b/tests/baselines/reference/tsxTypeErrors.types index 303c7695dbf..d64781479fa 100644 --- a/tests/baselines/reference/tsxTypeErrors.types +++ b/tests/baselines/reference/tsxTypeErrors.types @@ -19,7 +19,7 @@ var thing = { oops: 100 }; >thing : { oops: number; } >{ oops: 100 } : { oops: number; } >oops : number ->100 : number +>100 : 100 var a3 =
>a3 : any @@ -62,7 +62,7 @@ var b1 = ; > : any >MyClass : typeof MyClass >reqd : any ->true : boolean +>true : true // Mistyped attribute member // sample.tsx(23,22): error TS2322: Type '{ x: number; y: string; }' is not assignable to type '{ x: number; y: number; }'. @@ -75,8 +75,8 @@ var b2 = ; >pt : any >{x: 4, y: 'oops'} : { x: number; y: string; } >x : number ->4 : number +>4 : 4 >y : string ->'oops' : string +>'oops' : "oops" diff --git a/tests/baselines/reference/tupleElementTypes3.types b/tests/baselines/reference/tupleElementTypes3.types index 6f29ba1371a..eee520d4425 100644 --- a/tests/baselines/reference/tupleElementTypes3.types +++ b/tests/baselines/reference/tupleElementTypes3.types @@ -3,6 +3,6 @@ var [a, b] = [0, undefined]; >a : number >b : any >[0, undefined] : [number, undefined] ->0 : number +>0 : 0 >undefined : undefined diff --git a/tests/baselines/reference/tupleElementTypes4.types b/tests/baselines/reference/tupleElementTypes4.types index 06e19ef72bb..72ff071e5e2 100644 --- a/tests/baselines/reference/tupleElementTypes4.types +++ b/tests/baselines/reference/tupleElementTypes4.types @@ -4,6 +4,6 @@ function f([a, b] = [0, undefined]) { } >a : number >b : any >[0, undefined] : [number, undefined] ->0 : number +>0 : 0 >undefined : undefined diff --git a/tests/baselines/reference/twoMergedInterfacesWithDifferingOverloads.types b/tests/baselines/reference/twoMergedInterfacesWithDifferingOverloads.types index e9ed0031928..897e54a2330 100644 --- a/tests/baselines/reference/twoMergedInterfacesWithDifferingOverloads.types +++ b/tests/baselines/reference/twoMergedInterfacesWithDifferingOverloads.types @@ -63,7 +63,7 @@ var r = b.foo(true); // returns Date >b.foo : { (x: boolean): number; (x: string): string; (x: boolean): Date; (x: Date): string; } >b : B >foo : { (x: boolean): number; (x: string): string; (x: boolean): Date; (x: Date): string; } ->true : boolean +>true : true // add generic overload interface C { @@ -106,12 +106,12 @@ var c: C; var r2 = c.foo(1, 2); // number >r2 : number ->c.foo(1, 2) : number +>c.foo(1, 2) : 1 | 2 >c.foo : { (x: boolean, y: Date): string; (x: string, y: string): number; (x: W, y: W): W; } >c : C >foo : { (x: boolean, y: Date): string; (x: string, y: string): number; (x: W, y: W): W; } ->1 : number ->2 : number +>1 : 1 +>2 : 2 // add generic overload that would be ambiguous interface D { @@ -163,6 +163,6 @@ var r3 = d.foo(1, 1); // boolean, last definition wins >d.foo : { (x: A, y: A): Date; (x: W, y: W): boolean; } >d : D >foo : { (x: A, y: A): Date; (x: W, y: W): boolean; } ->1 : number ->1 : number +>1 : 1 +>1 : 1 diff --git a/tests/baselines/reference/twoMergedInterfacesWithDifferingOverloads2.types b/tests/baselines/reference/twoMergedInterfacesWithDifferingOverloads2.types index afbafba4920..bbe716d4323 100644 --- a/tests/baselines/reference/twoMergedInterfacesWithDifferingOverloads2.types +++ b/tests/baselines/reference/twoMergedInterfacesWithDifferingOverloads2.types @@ -28,14 +28,14 @@ var r2 = a(1); >r2 : number >a(1) : number >a : A ->1 : number +>1 : 1 var r3 = a(1, 2); >r3 : boolean >a(1, 2) : boolean >a : A ->1 : number ->2 : number +>1 : 1 +>2 : 2 module G { >G : typeof G @@ -83,19 +83,19 @@ module G { >r2 : boolean >a(true) : boolean >a : A ->true : boolean +>true : true var r3 = a(true, 2); >r3 : boolean >a(true, 2) : boolean >a : A ->true : boolean ->2 : number +>true : true +>2 : 2 var r4 = a(1, true); >r4 : number ->a(1, true) : number +>a(1, true) : 1 >a : A ->1 : number ->true : boolean +>1 : 1 +>true : true } diff --git a/tests/baselines/reference/typeAliases.types b/tests/baselines/reference/typeAliases.types index d6bce143c9b..1d798bc14a6 100644 --- a/tests/baselines/reference/typeAliases.types +++ b/tests/baselines/reference/typeAliases.types @@ -191,7 +191,7 @@ type Meters = number enum E { x = 10 } >E : E >x : E ->10 : number +>10 : 10 declare function f15(a: string): boolean; >f15 : { (a: string): boolean; (a: number): string; } @@ -231,15 +231,15 @@ f16(x); var y: StringAndBoolean = ["1", false]; >y : [string, boolean] >StringAndBoolean : [string, boolean] ->["1", false] : [string, boolean] ->"1" : string ->false : boolean +>["1", false] : [string, false] +>"1" : "1" +>false : false y[0].toLowerCase(); >y[0].toLowerCase() : string >y[0].toLowerCase : () => string >y[0] : string >y : [string, boolean] ->0 : number +>0 : 0 >toLowerCase : () => string diff --git a/tests/baselines/reference/typeAnnotationBestCommonTypeInArrayLiteral.types b/tests/baselines/reference/typeAnnotationBestCommonTypeInArrayLiteral.types index d0c881c1c5d..66e35a5a535 100644 --- a/tests/baselines/reference/typeAnnotationBestCommonTypeInArrayLiteral.types +++ b/tests/baselines/reference/typeAnnotationBestCommonTypeInArrayLiteral.types @@ -28,31 +28,31 @@ var menuData: IMenuItem[] = [ >{ "id": "ourLogo", "type": "image", "link": "", "icon": "modules/menu/logo.svg" } : { "id": string; "type": string; "link": string; "icon": string; } "id": "ourLogo", ->"ourLogo" : string +>"ourLogo" : "ourLogo" "type": "image", ->"image" : string +>"image" : "image" "link": "", ->"" : string +>"" : "" "icon": "modules/menu/logo.svg" ->"modules/menu/logo.svg" : string +>"modules/menu/logo.svg" : "modules/menu/logo.svg" }, { >{ "id": "productName", "type": "default", "link": "", "text": "Product Name" } : { "id": string; "type": string; "link": string; "text": string; } "id": "productName", ->"productName" : string +>"productName" : "productName" "type": "default", ->"default" : string +>"default" : "default" "link": "", ->"" : string +>"" : "" "text": "Product Name" ->"Product Name" : string +>"Product Name" : "Product Name" } ]; diff --git a/tests/baselines/reference/typeArgInference.types b/tests/baselines/reference/typeArgInference.types index d553e0fe8d4..e8a2fff80a7 100644 --- a/tests/baselines/reference/typeArgInference.types +++ b/tests/baselines/reference/typeArgInference.types @@ -39,9 +39,9 @@ var o = { a: 3, b: "test" }; >o : { a: number; b: string; } >{ a: 3, b: "test" } : { a: number; b: string; } >a : number ->3 : number +>3 : 3 >b : string ->"test" : string +>"test" : "test" var x: I; >x : I diff --git a/tests/baselines/reference/typeArgInference2WithError.errors.txt b/tests/baselines/reference/typeArgInference2WithError.errors.txt index 8a191ed310e..e7abedfecb7 100644 --- a/tests/baselines/reference/typeArgInference2WithError.errors.txt +++ b/tests/baselines/reference/typeArgInference2WithError.errors.txt @@ -1,5 +1,5 @@ tests/cases/compiler/typeArgInference2WithError.ts(7,10): error TS2453: The type argument for type parameter 'T' cannot be inferred from the usage. Consider specifying the type arguments explicitly. - Type argument candidate 'string' is not a valid type argument because it is not a supertype of candidate 'number'. + Type argument candidate '"abc"' is not a valid type argument because it is not a supertype of candidate '5'. ==== tests/cases/compiler/typeArgInference2WithError.ts (1 errors) ==== @@ -12,4 +12,4 @@ tests/cases/compiler/typeArgInference2WithError.ts(7,10): error TS2453: The type var z7 = foo("abc", 5); // Error ~~~ !!! error TS2453: The type argument for type parameter 'T' cannot be inferred from the usage. Consider specifying the type arguments explicitly. -!!! error TS2453: Type argument candidate 'string' is not a valid type argument because it is not a supertype of candidate 'number'. \ No newline at end of file +!!! error TS2453: Type argument candidate '"abc"' is not a valid type argument because it is not a supertype of candidate '5'. \ No newline at end of file diff --git a/tests/baselines/reference/typeArgInferenceWithNull.types b/tests/baselines/reference/typeArgInferenceWithNull.types index 93ded4267eb..52f656f6890 100644 --- a/tests/baselines/reference/typeArgInferenceWithNull.types +++ b/tests/baselines/reference/typeArgInferenceWithNull.types @@ -48,5 +48,5 @@ fn6({ x: null }, y => { }, { x: "" }); // y has type { x: any }, but ideally wou >y : { x: string; } >{ x: "" } : { x: string; } >x : string ->"" : string +>"" : "" diff --git a/tests/baselines/reference/typeArgumentConstraintResolution1.errors.txt b/tests/baselines/reference/typeArgumentConstraintResolution1.errors.txt index 1131b6e1a68..6f27916eda0 100644 --- a/tests/baselines/reference/typeArgumentConstraintResolution1.errors.txt +++ b/tests/baselines/reference/typeArgumentConstraintResolution1.errors.txt @@ -1,5 +1,5 @@ -tests/cases/compiler/typeArgumentConstraintResolution1.ts(4,12): error TS2345: Argument of type 'string' is not assignable to parameter of type 'Date'. -tests/cases/compiler/typeArgumentConstraintResolution1.ts(11,12): error TS2345: Argument of type 'string' is not assignable to parameter of type 'Date'. +tests/cases/compiler/typeArgumentConstraintResolution1.ts(4,12): error TS2345: Argument of type '""' is not assignable to parameter of type 'Date'. +tests/cases/compiler/typeArgumentConstraintResolution1.ts(11,12): error TS2345: Argument of type '""' is not assignable to parameter of type 'Date'. ==== tests/cases/compiler/typeArgumentConstraintResolution1.ts (2 errors) ==== @@ -8,7 +8,7 @@ tests/cases/compiler/typeArgumentConstraintResolution1.ts(11,12): error TS2345: function foo1(test: any) { } foo1(""); // should error ~~ -!!! error TS2345: Argument of type 'string' is not assignable to parameter of type 'Date'. +!!! error TS2345: Argument of type '""' is not assignable to parameter of type 'Date'. @@ -17,5 +17,5 @@ tests/cases/compiler/typeArgumentConstraintResolution1.ts(11,12): error TS2345: function foo2(test: any): any { return null; } foo2(""); // Type Date does not satisfy the constraint 'Number' for type parameter 'T extends Number' ~~ -!!! error TS2345: Argument of type 'string' is not assignable to parameter of type 'Date'. +!!! error TS2345: Argument of type '""' is not assignable to parameter of type 'Date'. \ No newline at end of file diff --git a/tests/baselines/reference/typeArgumentInference.errors.txt b/tests/baselines/reference/typeArgumentInference.errors.txt index 51cf4ccf7d2..cc6c1d8ce96 100644 --- a/tests/baselines/reference/typeArgumentInference.errors.txt +++ b/tests/baselines/reference/typeArgumentInference.errors.txt @@ -1,5 +1,5 @@ tests/cases/conformance/expressions/functionCalls/typeArgumentInference.ts(68,11): error TS2453: The type argument for type parameter 'T' cannot be inferred from the usage. Consider specifying the type arguments explicitly. - Type argument candidate 'string' is not a valid type argument because it is not a supertype of candidate 'number'. + Type argument candidate '""' is not a valid type argument because it is not a supertype of candidate '0'. tests/cases/conformance/expressions/functionCalls/typeArgumentInference.ts(82,69): error TS2453: The type argument for type parameter 'T' cannot be inferred from the usage. Consider specifying the type arguments explicitly. Type argument candidate '{ x: number; z: Date; }' is not a valid type argument because it is not a supertype of candidate '{ x: number; y: string; }'. Object literal may only specify known properties, and 'y' does not exist in type '{ x: number; z: Date; }'. @@ -78,7 +78,7 @@ tests/cases/conformance/expressions/functionCalls/typeArgumentInference.ts(84,74 var a9a = someGenerics9('', 0, []); ~~~~~~~~~~~~~ !!! error TS2453: The type argument for type parameter 'T' cannot be inferred from the usage. Consider specifying the type arguments explicitly. -!!! error TS2453: Type argument candidate 'string' is not a valid type argument because it is not a supertype of candidate 'number'. +!!! error TS2453: Type argument candidate '""' is not a valid type argument because it is not a supertype of candidate '0'. var a9a: {}; var a9b = someGenerics9<{ a?: number; b?: string; }>({ a: 0 }, { b: '' }, null); var a9b: { a?: number; b?: string; }; diff --git a/tests/baselines/reference/typeArgumentInferenceApparentType1.types b/tests/baselines/reference/typeArgumentInferenceApparentType1.types index 29fd1aeca18..1b25f79d4fc 100644 --- a/tests/baselines/reference/typeArgumentInferenceApparentType1.types +++ b/tests/baselines/reference/typeArgumentInferenceApparentType1.types @@ -14,5 +14,5 @@ var res: string = method("test"); >res : string >method("test") : string >method : (iterable: Iterable) => T ->"test" : string +>"test" : "test" diff --git a/tests/baselines/reference/typeArgumentInferenceConstructSignatures.errors.txt b/tests/baselines/reference/typeArgumentInferenceConstructSignatures.errors.txt index da01aa778b6..ab056d461e9 100644 --- a/tests/baselines/reference/typeArgumentInferenceConstructSignatures.errors.txt +++ b/tests/baselines/reference/typeArgumentInferenceConstructSignatures.errors.txt @@ -1,4 +1,4 @@ -tests/cases/conformance/expressions/functionCalls/typeArgumentInferenceConstructSignatures.ts(25,35): error TS2345: Argument of type 'number' is not assignable to parameter of type 'string'. +tests/cases/conformance/expressions/functionCalls/typeArgumentInferenceConstructSignatures.ts(25,35): error TS2345: Argument of type '3' is not assignable to parameter of type 'string'. tests/cases/conformance/expressions/functionCalls/typeArgumentInferenceConstructSignatures.ts(51,19): error TS2304: Cannot find name 'Window'. tests/cases/conformance/expressions/functionCalls/typeArgumentInferenceConstructSignatures.ts(61,39): error TS2345: Argument of type '(x: string) => string' is not assignable to parameter of type '(x: number) => void'. Types of parameters 'x' and 'x' are incompatible. @@ -10,7 +10,7 @@ tests/cases/conformance/expressions/functionCalls/typeArgumentInferenceConstruct Types of parameters 'n' and 'b' are incompatible. Type 'number' is not assignable to type 'string'. tests/cases/conformance/expressions/functionCalls/typeArgumentInferenceConstructSignatures.ts(106,15): error TS2453: The type argument for type parameter 'T' cannot be inferred from the usage. Consider specifying the type arguments explicitly. - Type argument candidate 'string' is not a valid type argument because it is not a supertype of candidate 'number'. + Type argument candidate '""' is not a valid type argument because it is not a supertype of candidate '0'. tests/cases/conformance/expressions/functionCalls/typeArgumentInferenceConstructSignatures.ts(118,9): error TS2304: Cannot find name 'Window'. tests/cases/conformance/expressions/functionCalls/typeArgumentInferenceConstructSignatures.ts(120,51): error TS2304: Cannot find name 'window'. tests/cases/conformance/expressions/functionCalls/typeArgumentInferenceConstructSignatures.ts(120,69): error TS2453: The type argument for type parameter 'T' cannot be inferred from the usage. Consider specifying the type arguments explicitly. @@ -48,7 +48,7 @@ tests/cases/conformance/expressions/functionCalls/typeArgumentInferenceConstruct new someGenerics1(3, 4); new someGenerics1(3, 4); // Error ~ -!!! error TS2345: Argument of type 'number' is not assignable to parameter of type 'string'. +!!! error TS2345: Argument of type '3' is not assignable to parameter of type 'string'. new someGenerics1(3, 4); // Generic call with argument of function type whose parameter is of type parameter type @@ -146,7 +146,7 @@ tests/cases/conformance/expressions/functionCalls/typeArgumentInferenceConstruct var a9a = new someGenerics9('', 0, []); ~~~~~~~~~~~~~ !!! error TS2453: The type argument for type parameter 'T' cannot be inferred from the usage. Consider specifying the type arguments explicitly. -!!! error TS2453: Type argument candidate 'string' is not a valid type argument because it is not a supertype of candidate 'number'. +!!! error TS2453: Type argument candidate '""' is not a valid type argument because it is not a supertype of candidate '0'. var a9a: {}; var a9b = new someGenerics9<{ a?: number; b?: string; }>({ a: 0 }, { b: '' }, null); var a9b: { a?: number; b?: string; }; diff --git a/tests/baselines/reference/typeArgumentInferenceErrors.errors.txt b/tests/baselines/reference/typeArgumentInferenceErrors.errors.txt index 36a17e166a5..47d5e82994c 100644 --- a/tests/baselines/reference/typeArgumentInferenceErrors.errors.txt +++ b/tests/baselines/reference/typeArgumentInferenceErrors.errors.txt @@ -1,4 +1,4 @@ -tests/cases/conformance/expressions/functionCalls/typeArgumentInferenceErrors.ts(3,31): error TS2345: Argument of type 'number' is not assignable to parameter of type 'string'. +tests/cases/conformance/expressions/functionCalls/typeArgumentInferenceErrors.ts(3,31): error TS2345: Argument of type '3' is not assignable to parameter of type 'string'. tests/cases/conformance/expressions/functionCalls/typeArgumentInferenceErrors.ts(7,35): error TS2345: Argument of type '(x: string) => string' is not assignable to parameter of type '(x: number) => void'. Types of parameters 'x' and 'x' are incompatible. Type 'number' is not assignable to type 'string'. @@ -15,7 +15,7 @@ tests/cases/conformance/expressions/functionCalls/typeArgumentInferenceErrors.ts function someGenerics1(n: T, m: number) { } someGenerics1(3, 4); // Error ~ -!!! error TS2345: Argument of type 'number' is not assignable to parameter of type 'string'. +!!! error TS2345: Argument of type '3' is not assignable to parameter of type 'string'. // 2 parameter generic call with argument 1 of type parameter type and argument 2 of function type whose parameter is of type parameter type function someGenerics4(n: T, f: (x: U) => void) { } diff --git a/tests/baselines/reference/typeArgumentInferenceWithClassExpression1.types b/tests/baselines/reference/typeArgumentInferenceWithClassExpression1.types index 63ee1309383..dd434e8bb5d 100644 --- a/tests/baselines/reference/typeArgumentInferenceWithClassExpression1.types +++ b/tests/baselines/reference/typeArgumentInferenceWithClassExpression1.types @@ -18,6 +18,6 @@ foo(class { static prop = "hello" }).length; >foo : (x?: typeof (Anonymous class)) => T >class { static prop = "hello" } : typeof (Anonymous class) >prop : string ->"hello" : string +>"hello" : "hello" >length : number diff --git a/tests/baselines/reference/typeArgumentInferenceWithClassExpression3.types b/tests/baselines/reference/typeArgumentInferenceWithClassExpression3.types index 9a2bddd9296..82764584abd 100644 --- a/tests/baselines/reference/typeArgumentInferenceWithClassExpression3.types +++ b/tests/baselines/reference/typeArgumentInferenceWithClassExpression3.types @@ -18,6 +18,6 @@ foo(class { prop = "hello" }).length; >foo : (x?: typeof (Anonymous class)) => T >class { prop = "hello" } : typeof (Anonymous class) >prop : string ->"hello" : string +>"hello" : "hello" >length : number diff --git a/tests/baselines/reference/typeArgumentInferenceWithConstraints.errors.txt b/tests/baselines/reference/typeArgumentInferenceWithConstraints.errors.txt index 22d18e11eca..090f8c9b852 100644 --- a/tests/baselines/reference/typeArgumentInferenceWithConstraints.errors.txt +++ b/tests/baselines/reference/typeArgumentInferenceWithConstraints.errors.txt @@ -15,7 +15,7 @@ tests/cases/conformance/expressions/functionCalls/typeArgumentInferenceWithConst Type 'number' is not assignable to type 'string'. tests/cases/conformance/expressions/functionCalls/typeArgumentInferenceWithConstraints.ts(66,31): error TS2345: Argument of type '(a: (a: A) => A, b: (b: B) => B, c: (c: C) => C) => void' is not assignable to parameter of type 'string'. tests/cases/conformance/expressions/functionCalls/typeArgumentInferenceWithConstraints.ts(73,11): error TS2453: The type argument for type parameter 'T' cannot be inferred from the usage. Consider specifying the type arguments explicitly. - Type argument candidate 'string' is not a valid type argument because it is not a supertype of candidate 'number'. + Type argument candidate '""' is not a valid type argument because it is not a supertype of candidate '0'. tests/cases/conformance/expressions/functionCalls/typeArgumentInferenceWithConstraints.ts(85,9): error TS2304: Cannot find name 'Window'. tests/cases/conformance/expressions/functionCalls/typeArgumentInferenceWithConstraints.ts(87,47): error TS2304: Cannot find name 'window'. tests/cases/conformance/expressions/functionCalls/typeArgumentInferenceWithConstraints.ts(87,65): error TS2453: The type argument for type parameter 'T' cannot be inferred from the usage. Consider specifying the type arguments explicitly. @@ -128,7 +128,7 @@ tests/cases/conformance/expressions/functionCalls/typeArgumentInferenceWithConst var a9a = someGenerics9('', 0, []); ~~~~~~~~~~~~~ !!! error TS2453: The type argument for type parameter 'T' cannot be inferred from the usage. Consider specifying the type arguments explicitly. -!!! error TS2453: Type argument candidate 'string' is not a valid type argument because it is not a supertype of candidate 'number'. +!!! error TS2453: Type argument candidate '""' is not a valid type argument because it is not a supertype of candidate '0'. var a9a: {}; var a9b = someGenerics9<{ a?: number; b?: string; }>({ a: 0 }, { b: '' }, null); var a9b: { a?: number; b?: string; }; diff --git a/tests/baselines/reference/typeArgumentInferenceWithObjectLiteral.errors.txt b/tests/baselines/reference/typeArgumentInferenceWithObjectLiteral.errors.txt index c1352bedb9b..e82e7e020d0 100644 --- a/tests/baselines/reference/typeArgumentInferenceWithObjectLiteral.errors.txt +++ b/tests/baselines/reference/typeArgumentInferenceWithObjectLiteral.errors.txt @@ -1,8 +1,10 @@ +tests/cases/conformance/expressions/functionCalls/typeArgumentInferenceWithObjectLiteral.ts(30,10): error TS2453: The type argument for type parameter 'T' cannot be inferred from the usage. Consider specifying the type arguments explicitly. + Type argument candidate 'E1' is not a valid type argument because it is not a supertype of candidate '0'. tests/cases/conformance/expressions/functionCalls/typeArgumentInferenceWithObjectLiteral.ts(35,10): error TS2453: The type argument for type parameter 'T' cannot be inferred from the usage. Consider specifying the type arguments explicitly. Type argument candidate 'E1' is not a valid type argument because it is not a supertype of candidate 'E2'. -==== tests/cases/conformance/expressions/functionCalls/typeArgumentInferenceWithObjectLiteral.ts (1 errors) ==== +==== tests/cases/conformance/expressions/functionCalls/typeArgumentInferenceWithObjectLiteral.ts (2 errors) ==== interface Computed { read(): T; write(value: T); @@ -33,6 +35,9 @@ tests/cases/conformance/expressions/functionCalls/typeArgumentInferenceWithObjec var v1 = f1({ w: x => x, r: () => 0 }, 0); var v1 = f1({ w: x => x, r: () => 0 }, E1.X); var v1 = f1({ w: x => x, r: () => E1.X }, 0); + ~~ +!!! error TS2453: The type argument for type parameter 'T' cannot be inferred from the usage. Consider specifying the type arguments explicitly. +!!! error TS2453: Type argument candidate 'E1' is not a valid type argument because it is not a supertype of candidate '0'. var v2: E1; var v2 = f1({ w: x => x, r: () => E1.X }, E1.X); diff --git a/tests/baselines/reference/typeArgumentsOnFunctionsWithNoTypeParameters.errors.txt b/tests/baselines/reference/typeArgumentsOnFunctionsWithNoTypeParameters.errors.txt index b529afd4c6a..b2d9e3f8aaf 100644 --- a/tests/baselines/reference/typeArgumentsOnFunctionsWithNoTypeParameters.errors.txt +++ b/tests/baselines/reference/typeArgumentsOnFunctionsWithNoTypeParameters.errors.txt @@ -1,5 +1,5 @@ tests/cases/compiler/typeArgumentsOnFunctionsWithNoTypeParameters.ts(2,13): error TS2346: Supplied parameters do not match any signature of call target. -tests/cases/compiler/typeArgumentsOnFunctionsWithNoTypeParameters.ts(3,15): error TS2345: Argument of type 'number' is not assignable to parameter of type 'T'. +tests/cases/compiler/typeArgumentsOnFunctionsWithNoTypeParameters.ts(3,15): error TS2345: Argument of type '1' is not assignable to parameter of type 'T'. tests/cases/compiler/typeArgumentsOnFunctionsWithNoTypeParameters.ts(4,13): error TS2346: Supplied parameters do not match any signature of call target. @@ -10,7 +10,7 @@ tests/cases/compiler/typeArgumentsOnFunctionsWithNoTypeParameters.ts(4,13): erro !!! error TS2346: Supplied parameters do not match any signature of call target. var r2 = f(1); ~ -!!! error TS2345: Argument of type 'number' is not assignable to parameter of type 'T'. +!!! error TS2345: Argument of type '1' is not assignable to parameter of type 'T'. var r3 = f(null); ~~~~~~~~~~~~ !!! error TS2346: Supplied parameters do not match any signature of call target. diff --git a/tests/baselines/reference/typeArgumentsWithStringLiteralTypes01.errors.txt b/tests/baselines/reference/typeArgumentsWithStringLiteralTypes01.errors.txt index 48c7efb37e8..2876390758f 100644 --- a/tests/baselines/reference/typeArgumentsWithStringLiteralTypes01.errors.txt +++ b/tests/baselines/reference/typeArgumentsWithStringLiteralTypes01.errors.txt @@ -11,21 +11,17 @@ tests/cases/conformance/types/stringLiteral/typeArgumentsWithStringLiteralTypes0 tests/cases/conformance/types/stringLiteral/typeArgumentsWithStringLiteralTypes01.ts(55,43): error TS2345: Argument of type '"World"' is not assignable to parameter of type '"Hello"'. tests/cases/conformance/types/stringLiteral/typeArgumentsWithStringLiteralTypes01.ts(57,52): error TS2345: Argument of type '"World"' is not assignable to parameter of type '"Hello"'. tests/cases/conformance/types/stringLiteral/typeArgumentsWithStringLiteralTypes01.ts(58,43): error TS2345: Argument of type '"World"' is not assignable to parameter of type '"Hello"'. -tests/cases/conformance/types/stringLiteral/typeArgumentsWithStringLiteralTypes01.ts(61,5): error TS2322: Type 'string' is not assignable to type '"Hello"'. -tests/cases/conformance/types/stringLiteral/typeArgumentsWithStringLiteralTypes01.ts(63,5): error TS2322: Type 'string' is not assignable to type '"Hello"'. -tests/cases/conformance/types/stringLiteral/typeArgumentsWithStringLiteralTypes01.ts(75,5): error TS2322: Type '"Hello" | "World"' is not assignable to type '"Hello"'. - Type '"World"' is not assignable to type '"Hello"'. -tests/cases/conformance/types/stringLiteral/typeArgumentsWithStringLiteralTypes01.ts(77,5): error TS2322: Type '"Hello" | "World"' is not assignable to type '"Hello"'. - Type '"World"' is not assignable to type '"Hello"'. +tests/cases/conformance/types/stringLiteral/typeArgumentsWithStringLiteralTypes01.ts(68,25): error TS2345: Argument of type 'string' is not assignable to parameter of type '"Hello"'. +tests/cases/conformance/types/stringLiteral/typeArgumentsWithStringLiteralTypes01.ts(70,25): error TS2345: Argument of type 'string' is not assignable to parameter of type '"Hello"'. +tests/cases/conformance/types/stringLiteral/typeArgumentsWithStringLiteralTypes01.ts(75,30): error TS2345: Argument of type 'string' is not assignable to parameter of type '"Hello" | "World"'. +tests/cases/conformance/types/stringLiteral/typeArgumentsWithStringLiteralTypes01.ts(77,30): error TS2345: Argument of type 'string' is not assignable to parameter of type '"Hello" | "World"'. tests/cases/conformance/types/stringLiteral/typeArgumentsWithStringLiteralTypes01.ts(87,43): error TS2345: Argument of type '"World"' is not assignable to parameter of type '"Hello"'. tests/cases/conformance/types/stringLiteral/typeArgumentsWithStringLiteralTypes01.ts(88,43): error TS2345: Argument of type '"Hello"' is not assignable to parameter of type '"World"'. tests/cases/conformance/types/stringLiteral/typeArgumentsWithStringLiteralTypes01.ts(89,52): error TS2345: Argument of type '"World"' is not assignable to parameter of type '"Hello"'. -tests/cases/conformance/types/stringLiteral/typeArgumentsWithStringLiteralTypes01.ts(93,5): error TS2322: Type 'string' is not assignable to type '"Hello" | "World"'. -tests/cases/conformance/types/stringLiteral/typeArgumentsWithStringLiteralTypes01.ts(97,5): error TS2322: Type 'string' is not assignable to type '"Hello" | "World"'. -tests/cases/conformance/types/stringLiteral/typeArgumentsWithStringLiteralTypes01.ts(100,25): error TS2345: Argument of type '"Hello" | "World"' is not assignable to parameter of type '"Hello"'. - Type '"World"' is not assignable to type '"Hello"'. -tests/cases/conformance/types/stringLiteral/typeArgumentsWithStringLiteralTypes01.ts(104,25): error TS2345: Argument of type '"Hello" | "World"' is not assignable to parameter of type '"Hello"'. - Type '"World"' is not assignable to type '"Hello"'. +tests/cases/conformance/types/stringLiteral/typeArgumentsWithStringLiteralTypes01.ts(100,25): error TS2345: Argument of type 'string' is not assignable to parameter of type '"Hello"'. +tests/cases/conformance/types/stringLiteral/typeArgumentsWithStringLiteralTypes01.ts(104,25): error TS2345: Argument of type 'string' is not assignable to parameter of type '"Hello"'. +tests/cases/conformance/types/stringLiteral/typeArgumentsWithStringLiteralTypes01.ts(107,30): error TS2345: Argument of type 'string' is not assignable to parameter of type '"Hello" | "World"'. +tests/cases/conformance/types/stringLiteral/typeArgumentsWithStringLiteralTypes01.ts(111,30): error TS2345: Argument of type 'string' is not assignable to parameter of type '"Hello" | "World"'. ==== tests/cases/conformance/types/stringLiteral/typeArgumentsWithStringLiteralTypes01.ts (24 errors) ==== @@ -116,32 +112,30 @@ tests/cases/conformance/types/stringLiteral/typeArgumentsWithStringLiteralTypes0 // Assignment from the returned value should cause an error. a = takeReturnString(a); - ~ -!!! error TS2322: Type 'string' is not assignable to type '"Hello"'. b = takeReturnString(b); c = takeReturnString(c); - ~ -!!! error TS2322: Type 'string' is not assignable to type '"Hello"'. d = takeReturnString(d); e = takeReturnString(e); // Should be valid a = takeReturnHello(a); + ~ +!!! error TS2345: Argument of type 'string' is not assignable to parameter of type '"Hello"'. b = takeReturnHello(b); c = takeReturnHello(c); + ~ +!!! error TS2345: Argument of type 'string' is not assignable to parameter of type '"Hello"'. d = takeReturnHello(d); e = takeReturnHello(e); // Assignment from the returned value should cause an error. a = takeReturnHelloWorld(a); - ~ -!!! error TS2322: Type '"Hello" | "World"' is not assignable to type '"Hello"'. -!!! error TS2322: Type '"World"' is not assignable to type '"Hello"'. + ~ +!!! error TS2345: Argument of type 'string' is not assignable to parameter of type '"Hello" | "World"'. b = takeReturnHelloWorld(b); c = takeReturnHelloWorld(c); - ~ -!!! error TS2322: Type '"Hello" | "World"' is not assignable to type '"Hello"'. -!!! error TS2322: Type '"World"' is not assignable to type '"Hello"'. + ~ +!!! error TS2345: Argument of type 'string' is not assignable to parameter of type '"Hello" | "World"'. d = takeReturnHelloWorld(d); e = takeReturnHelloWorld(e); } @@ -164,32 +158,30 @@ tests/cases/conformance/types/stringLiteral/typeArgumentsWithStringLiteralTypes0 // Assignment from the returned value should cause an error. a = takeReturnString(a); - ~ -!!! error TS2322: Type 'string' is not assignable to type '"Hello" | "World"'. b = takeReturnString(b); c = takeReturnString(c); d = takeReturnString(d); e = takeReturnString(e); - ~ -!!! error TS2322: Type 'string' is not assignable to type '"Hello" | "World"'. // Passing these as arguments should cause an error. a = takeReturnHello(a); ~ -!!! error TS2345: Argument of type '"Hello" | "World"' is not assignable to parameter of type '"Hello"'. -!!! error TS2345: Type '"World"' is not assignable to type '"Hello"'. +!!! error TS2345: Argument of type 'string' is not assignable to parameter of type '"Hello"'. b = takeReturnHello(b); c = takeReturnHello(c); d = takeReturnHello(d); e = takeReturnHello(e); ~ -!!! error TS2345: Argument of type '"Hello" | "World"' is not assignable to parameter of type '"Hello"'. -!!! error TS2345: Type '"World"' is not assignable to type '"Hello"'. +!!! error TS2345: Argument of type 'string' is not assignable to parameter of type '"Hello"'. // Both should be valid. a = takeReturnHelloWorld(a); + ~ +!!! error TS2345: Argument of type 'string' is not assignable to parameter of type '"Hello" | "World"'. b = takeReturnHelloWorld(b); c = takeReturnHelloWorld(c); d = takeReturnHelloWorld(d); e = takeReturnHelloWorld(e); + ~ +!!! error TS2345: Argument of type 'string' is not assignable to parameter of type '"Hello" | "World"'. } \ No newline at end of file diff --git a/tests/baselines/reference/typeArgumentsWithStringLiteralTypes01.js b/tests/baselines/reference/typeArgumentsWithStringLiteralTypes01.js index c07dd225396..ca67e358705 100644 --- a/tests/baselines/reference/typeArgumentsWithStringLiteralTypes01.js +++ b/tests/baselines/reference/typeArgumentsWithStringLiteralTypes01.js @@ -229,16 +229,16 @@ declare namespace n1 { let e: string; } declare namespace n2 { - let a: "Hello"; + let a: string; let b: any; - let c: "Hello"; + let c: string; let d: any; let e: any; } declare namespace n3 { - let a: "Hello" | "World"; + let a: string; let b: any; let c: any; let d: any; - let e: "Hello" | "World"; + let e: string; } diff --git a/tests/baselines/reference/typeAssertionToGenericFunctionType.errors.txt b/tests/baselines/reference/typeAssertionToGenericFunctionType.errors.txt index a404b12701a..7d99934f5ea 100644 --- a/tests/baselines/reference/typeAssertionToGenericFunctionType.errors.txt +++ b/tests/baselines/reference/typeAssertionToGenericFunctionType.errors.txt @@ -1,4 +1,4 @@ -tests/cases/compiler/typeAssertionToGenericFunctionType.ts(5,13): error TS2345: Argument of type 'number' is not assignable to parameter of type 'string'. +tests/cases/compiler/typeAssertionToGenericFunctionType.ts(5,13): error TS2345: Argument of type '1' is not assignable to parameter of type 'string'. tests/cases/compiler/typeAssertionToGenericFunctionType.ts(6,1): error TS2346: Supplied parameters do not match any signature of call target. @@ -9,7 +9,7 @@ tests/cases/compiler/typeAssertionToGenericFunctionType.ts(6,1): error TS2346: S } x.a(1); // bug was that this caused 'Could not find symbol T' on return type T in the type assertion on x.a's definition ~ -!!! error TS2345: Argument of type 'number' is not assignable to parameter of type 'string'. +!!! error TS2345: Argument of type '1' is not assignable to parameter of type 'string'. x.b(); // error ~~~~~~~~~~~~~ !!! error TS2346: Supplied parameters do not match any signature of call target. \ No newline at end of file diff --git a/tests/baselines/reference/typeCheckingInsideFunctionExpressionInArray.errors.txt b/tests/baselines/reference/typeCheckingInsideFunctionExpressionInArray.errors.txt index e8c9bd6fc20..8df09b66513 100644 --- a/tests/baselines/reference/typeCheckingInsideFunctionExpressionInArray.errors.txt +++ b/tests/baselines/reference/typeCheckingInsideFunctionExpressionInArray.errors.txt @@ -1,4 +1,4 @@ -tests/cases/compiler/typeCheckingInsideFunctionExpressionInArray.ts(2,7): error TS2322: Type 'number' is not assignable to type 'string'. +tests/cases/compiler/typeCheckingInsideFunctionExpressionInArray.ts(2,7): error TS2322: Type '10' is not assignable to type 'string'. tests/cases/compiler/typeCheckingInsideFunctionExpressionInArray.ts(3,5): error TS2322: Type 'Object' is not assignable to type 'string'. tests/cases/compiler/typeCheckingInsideFunctionExpressionInArray.ts(4,15): error TS2339: Property 'NonexistantMethod' does not exist on type 'number[]'. tests/cases/compiler/typeCheckingInsideFunctionExpressionInArray.ts(5,5): error TS2304: Cannot find name 'derp'. @@ -8,7 +8,7 @@ tests/cases/compiler/typeCheckingInsideFunctionExpressionInArray.ts(5,5): error var functions = [function () { var k: string = 10; ~ -!!! error TS2322: Type 'number' is not assignable to type 'string'. +!!! error TS2322: Type '10' is not assignable to type 'string'. k = new Object(); ~ !!! error TS2322: Type 'Object' is not assignable to type 'string'. diff --git a/tests/baselines/reference/typeGuardFunction.types b/tests/baselines/reference/typeGuardFunction.types index 1e2be413a2b..a5635d2f31c 100644 --- a/tests/baselines/reference/typeGuardFunction.types +++ b/tests/baselines/reference/typeGuardFunction.types @@ -121,7 +121,7 @@ if (isC_multipleParams(a, 0)) { >isC_multipleParams(a, 0) : boolean >isC_multipleParams : (p1: any, p2: any) => p1 is C >a : A ->0 : number +>0 : 0 a.propC; >a.propC : number @@ -151,7 +151,7 @@ class D { >C : C return true; ->true : boolean +>true : true } } @@ -163,7 +163,7 @@ let f1 = (p1: A): p1 is C => false; >A : A >p1 : any >C : C ->false : boolean +>false : false // Function type declare function f2(p1: (p1: A) => p1 is C); @@ -185,7 +185,7 @@ f2(function(p1: A): p1 is C { >C : C return true; ->true : boolean +>true : true }); diff --git a/tests/baselines/reference/typeGuardFunctionErrors.errors.txt b/tests/baselines/reference/typeGuardFunctionErrors.errors.txt index eac2660df81..88f71cda196 100644 --- a/tests/baselines/reference/typeGuardFunctionErrors.errors.txt +++ b/tests/baselines/reference/typeGuardFunctionErrors.errors.txt @@ -1,5 +1,5 @@ tests/cases/conformance/expressions/typeGuards/typeGuardFunctionErrors.ts(2,7): error TS2300: Duplicate identifier 'A'. -tests/cases/conformance/expressions/typeGuards/typeGuardFunctionErrors.ts(15,12): error TS2322: Type 'string' is not assignable to type 'boolean'. +tests/cases/conformance/expressions/typeGuards/typeGuardFunctionErrors.ts(15,12): error TS2322: Type '""' is not assignable to type 'boolean'. tests/cases/conformance/expressions/typeGuards/typeGuardFunctionErrors.ts(18,55): error TS2304: Cannot find name 'x'. tests/cases/conformance/expressions/typeGuards/typeGuardFunctionErrors.ts(18,57): error TS1144: '{' or ';' expected. tests/cases/conformance/expressions/typeGuards/typeGuardFunctionErrors.ts(18,57): error TS2304: Cannot find name 'is'. @@ -47,7 +47,7 @@ tests/cases/conformance/expressions/typeGuards/typeGuardFunctionErrors.ts(98,22) tests/cases/conformance/expressions/typeGuards/typeGuardFunctionErrors.ts(98,25): error TS1005: ';' expected. tests/cases/conformance/expressions/typeGuards/typeGuardFunctionErrors.ts(98,27): error TS1005: ';' expected. tests/cases/conformance/expressions/typeGuards/typeGuardFunctionErrors.ts(104,25): error TS1228: A type predicate is only allowed in return type position for functions and methods. -tests/cases/conformance/expressions/typeGuards/typeGuardFunctionErrors.ts(105,16): error TS2322: Type 'boolean' is not assignable to type 'D'. +tests/cases/conformance/expressions/typeGuards/typeGuardFunctionErrors.ts(105,16): error TS2322: Type 'true' is not assignable to type 'D'. tests/cases/conformance/expressions/typeGuards/typeGuardFunctionErrors.ts(105,16): error TS2409: Return type of constructor signature must be assignable to the instance type of the class tests/cases/conformance/expressions/typeGuards/typeGuardFunctionErrors.ts(107,20): error TS1228: A type predicate is only allowed in return type position for functions and methods. tests/cases/conformance/expressions/typeGuards/typeGuardFunctionErrors.ts(110,20): error TS1228: A type predicate is only allowed in return type position for functions and methods. @@ -83,7 +83,7 @@ tests/cases/conformance/expressions/typeGuards/typeGuardFunctionErrors.ts(137,39 function hasANonBooleanReturnStatement(x): x is A { return ''; ~~ -!!! error TS2322: Type 'string' is not assignable to type 'boolean'. +!!! error TS2322: Type '""' is not assignable to type 'boolean'. } function hasTypeGuardTypeInsideTypeGuardType(x): x is x is A { @@ -259,7 +259,7 @@ tests/cases/conformance/expressions/typeGuards/typeGuardFunctionErrors.ts(137,39 !!! error TS1228: A type predicate is only allowed in return type position for functions and methods. return true; ~~~~ -!!! error TS2322: Type 'boolean' is not assignable to type 'D'. +!!! error TS2322: Type 'true' is not assignable to type 'D'. ~~~~ !!! error TS2409: Return type of constructor signature must be assignable to the instance type of the class } diff --git a/tests/baselines/reference/typeGuardFunctionGenerics.types b/tests/baselines/reference/typeGuardFunctionGenerics.types index c4655e71f0c..9d0fb25f2e8 100644 --- a/tests/baselines/reference/typeGuardFunctionGenerics.types +++ b/tests/baselines/reference/typeGuardFunctionGenerics.types @@ -134,5 +134,5 @@ let test3: B = funE(isB, 1); >funE(isB, 1) : B >funE : (p1: (p1: any) => p1 is T, p2: U) => T >isB : (p1: any) => p1 is B ->1 : number +>1 : 1 diff --git a/tests/baselines/reference/typeGuardFunctionOfFormThis.types b/tests/baselines/reference/typeGuardFunctionOfFormThis.types index 66d1a4b5b11..7b4b1fc76c8 100644 --- a/tests/baselines/reference/typeGuardFunctionOfFormThis.types +++ b/tests/baselines/reference/typeGuardFunctionOfFormThis.types @@ -259,13 +259,13 @@ if (crate.isSundries()) { >isSundries : () => this is Crate crate.contents.broken = true; ->crate.contents.broken = true : boolean +>crate.contents.broken = true : true >crate.contents.broken : boolean >crate.contents : Sundries >crate : Crate >contents : Sundries >broken : boolean ->true : boolean +>true : true } else if (crate.isSupplies()) { >crate.isSupplies() : boolean @@ -274,13 +274,13 @@ else if (crate.isSupplies()) { >isSupplies : () => this is Crate crate.contents.spoiled = true; ->crate.contents.spoiled = true : boolean +>crate.contents.spoiled = true : true >crate.contents.spoiled : boolean >crate.contents : Supplies >crate : Crate >contents : Supplies >spoiled : boolean ->true : boolean +>true : true } // Matching guards should be assignable diff --git a/tests/baselines/reference/typeGuardNesting.types b/tests/baselines/reference/typeGuardNesting.types index 6c2df126df1..29f6cba10db 100644 --- a/tests/baselines/reference/typeGuardNesting.types +++ b/tests/baselines/reference/typeGuardNesting.types @@ -26,7 +26,7 @@ if ((typeof strOrBool === 'boolean' && !strOrBool) || typeof strOrBool === 'stri >strOrBool : string | boolean >'string' : "string" >strOrBool : string ->"string" : string +>"string" : "string" let bool: boolean = (typeof strOrBool === 'boolean') ? strOrBool : false; >bool : boolean @@ -37,7 +37,7 @@ if ((typeof strOrBool === 'boolean' && !strOrBool) || typeof strOrBool === 'stri >strOrBool : string | boolean >'boolean' : "boolean" >strOrBool : boolean ->false : boolean +>false : false let label2: string = (typeof strOrBool !== 'boolean') ? strOrBool : "string"; >label2 : string @@ -48,7 +48,7 @@ if ((typeof strOrBool === 'boolean' && !strOrBool) || typeof strOrBool === 'stri >strOrBool : string | boolean >'boolean' : "boolean" >strOrBool : string ->"string" : string +>"string" : "string" let bool2: boolean = (typeof strOrBool !== 'string') ? strOrBool : false; >bool2 : boolean @@ -59,7 +59,7 @@ if ((typeof strOrBool === 'boolean' && !strOrBool) || typeof strOrBool === 'stri >strOrBool : string | boolean >'string' : "string" >strOrBool : boolean ->false : boolean +>false : false } if ((typeof strOrBool !== 'string' && !strOrBool) || typeof strOrBool !== 'boolean') { @@ -86,7 +86,7 @@ if ((typeof strOrBool !== 'string' && !strOrBool) || typeof strOrBool !== 'boole >strOrBool : string | boolean >'string' : "string" >strOrBool : string ->"string" : string +>"string" : "string" let bool: boolean = (typeof strOrBool === 'boolean') ? strOrBool : false; >bool : boolean @@ -97,7 +97,7 @@ if ((typeof strOrBool !== 'string' && !strOrBool) || typeof strOrBool !== 'boole >strOrBool : string | boolean >'boolean' : "boolean" >strOrBool : boolean ->false : boolean +>false : false let label2: string = (typeof strOrBool !== 'boolean') ? strOrBool : "string"; >label2 : string @@ -108,7 +108,7 @@ if ((typeof strOrBool !== 'string' && !strOrBool) || typeof strOrBool !== 'boole >strOrBool : string | boolean >'boolean' : "boolean" >strOrBool : string ->"string" : string +>"string" : "string" let bool2: boolean = (typeof strOrBool !== 'string') ? strOrBool : false; >bool2 : boolean @@ -119,6 +119,6 @@ if ((typeof strOrBool !== 'string' && !strOrBool) || typeof strOrBool !== 'boole >strOrBool : string | boolean >'string' : "string" >strOrBool : boolean ->false : boolean +>false : false } diff --git a/tests/baselines/reference/typeGuardOfFormFunctionEquality.types b/tests/baselines/reference/typeGuardOfFormFunctionEquality.types index 55f2e2aac0e..b47dfa94c8c 100644 --- a/tests/baselines/reference/typeGuardOfFormFunctionEquality.types +++ b/tests/baselines/reference/typeGuardOfFormFunctionEquality.types @@ -15,13 +15,13 @@ declare function isString2(a: Object): a is string; switch (isString1(0, "")) { >isString1(0, "") : boolean >isString1 : (a: number, b: Object) => b is string ->0 : number ->"" : string +>0 : 0 +>"" : "" case isString2(""): >isString2("") : boolean >isString2 : (a: Object) => a is string ->"" : string +>"" : "" default: } @@ -31,11 +31,11 @@ var x = isString1(0, "") === isString2(""); >isString1(0, "") === isString2("") : boolean >isString1(0, "") : boolean >isString1 : (a: number, b: Object) => b is string ->0 : number ->"" : string +>0 : 0 +>"" : "" >isString2("") : boolean >isString2 : (a: Object) => a is string ->"" : string +>"" : "" function isString3(a: number, b: number, c: Object): c is string { >isString3 : (a: number, b: number, c: Object) => c is string @@ -48,7 +48,7 @@ function isString3(a: number, b: number, c: Object): c is string { return isString1(0, c); >isString1(0, c) : boolean >isString1 : (a: number, b: Object) => b is string ->0 : number +>0 : 0 >c : Object } diff --git a/tests/baselines/reference/typeGuardOfFormIsType.types b/tests/baselines/reference/typeGuardOfFormIsType.types index e2059be7b63..53b2fab53f4 100644 --- a/tests/baselines/reference/typeGuardOfFormIsType.types +++ b/tests/baselines/reference/typeGuardOfFormIsType.types @@ -35,7 +35,7 @@ function isC1(x: any): x is C1 { >C1 : C1 return true; ->true : boolean +>true : true } function isC2(x: any): x is C2 { @@ -45,7 +45,7 @@ function isC2(x: any): x is C2 { >C2 : C2 return true; ->true : boolean +>true : true } function isD1(x: any): x is D1 { @@ -55,7 +55,7 @@ function isD1(x: any): x is D1 { >D1 : D1 return true; ->true : boolean +>true : true } var c1Orc2: C1 | C2; diff --git a/tests/baselines/reference/typeGuardOfFormIsTypeOnInterfaces.types b/tests/baselines/reference/typeGuardOfFormIsTypeOnInterfaces.types index ea169e95413..1295d0f6123 100644 --- a/tests/baselines/reference/typeGuardOfFormIsTypeOnInterfaces.types +++ b/tests/baselines/reference/typeGuardOfFormIsTypeOnInterfaces.types @@ -54,7 +54,7 @@ function isC1(x: any): x is C1 { >C1 : C1 return true; ->true : boolean +>true : true } function isC2(x: any): x is C2 { @@ -64,7 +64,7 @@ function isC2(x: any): x is C2 { >C2 : C2 return true; ->true : boolean +>true : true } function isD1(x: any): x is D1 { @@ -74,7 +74,7 @@ function isD1(x: any): x is D1 { >D1 : D1 return true; ->true : boolean +>true : true } var c1: C1; diff --git a/tests/baselines/reference/typeGuardsAsAssertions.types b/tests/baselines/reference/typeGuardsAsAssertions.types index 661ce9fbc55..bdda2eafefd 100644 --- a/tests/baselines/reference/typeGuardsAsAssertions.types +++ b/tests/baselines/reference/typeGuardsAsAssertions.types @@ -27,7 +27,7 @@ export const none : None = { none: '' }; >None : None >{ none: '' } : { none: string; } >none : string ->'' : string +>'' : "" export function isSome(value: Optional): value is Some { >isSome : (value: Optional) => value is Some @@ -41,7 +41,7 @@ export function isSome(value: Optional): value is Some { return 'some' in value; >'some' in value : boolean ->'some' : string +>'some' : "some" >value : Optional } @@ -102,7 +102,7 @@ function foo1() { let x: string | number | boolean = 0; >x : string | number | boolean ->0 : number +>0 : 0 x; // number >x : number @@ -125,7 +125,7 @@ function foo1() { >x.slice : (start?: number | undefined, end?: number | undefined) => string >x : string >slice : (start?: number | undefined, end?: number | undefined) => string ->"abc" : string +>"abc" : "abc" x; // string >x : string @@ -139,7 +139,7 @@ function foo2() { let x: string | number | boolean = 0; >x : string | number | boolean ->0 : number +>0 : 0 x; // number >x : number @@ -166,9 +166,9 @@ function foo2() { } else { x = "abc"; ->x = "abc" : string +>x = "abc" : "abc" >x : string | number | boolean ->"abc" : string +>"abc" : "abc" } x; // string >x : string @@ -306,9 +306,9 @@ function f6() { >slice : (start?: number | undefined, end?: number | undefined) => string x = ""; ->x = "" : string +>x = "" : "" >x : string | null | undefined ->"" : string +>"" : "" x!.slice(); >x!.slice() : string @@ -359,7 +359,7 @@ function f6() { >x = "" : string | undefined >x : string | null | undefined >"" : string | undefined ->"" : string +>"" : "" x!.slice(); >x!.slice() : string @@ -373,7 +373,7 @@ function f6() { >x : string | null | undefined >"" : string | null >null : null ->"" : string +>"" : "" x!.slice(); >x!.slice() : string diff --git a/tests/baselines/reference/typeGuardsInConditionalExpression.types b/tests/baselines/reference/typeGuardsInConditionalExpression.types index 8d5da1329e6..165eecd3514 100644 --- a/tests/baselines/reference/typeGuardsInConditionalExpression.types +++ b/tests/baselines/reference/typeGuardsInConditionalExpression.types @@ -40,10 +40,10 @@ function foo2(x: number | string) { ? ((x = "hello") && x) // string >((x = "hello") && x) : string >(x = "hello") && x : string ->(x = "hello") : string ->x = "hello" : string +>(x = "hello") : "hello" +>x = "hello" : "hello" >x : string | number ->"hello" : string +>"hello" : "hello" >x : string : x; // number @@ -63,10 +63,10 @@ function foo3(x: number | string) { ? ((x = 10) && x) // number >((x = 10) && x) : number >(x = 10) && x : number ->(x = 10) : number ->x = 10 : number +>(x = 10) : 10 +>x = 10 : 10 >x : string | number ->10 : number +>10 : 10 >x : number : x; // number @@ -89,10 +89,10 @@ function foo4(x: number | string) { : ((x = 10) && x); // number >((x = 10) && x) : number >(x = 10) && x : number ->(x = 10) : number ->x = 10 : number +>(x = 10) : 10 +>x = 10 : 10 >x : string | number ->10 : number +>10 : 10 >x : number } function foo5(x: number | string) { @@ -112,10 +112,10 @@ function foo5(x: number | string) { : ((x = "hello") && x); // string >((x = "hello") && x) : string >(x = "hello") && x : string ->(x = "hello") : string ->x = "hello" : string +>(x = "hello") : "hello" +>x = "hello" : "hello" >x : string | number ->"hello" : string +>"hello" : "hello" >x : string } function foo6(x: number | string) { @@ -133,19 +133,19 @@ function foo6(x: number | string) { ? ((x = 10) && x) // number >((x = 10) && x) : number >(x = 10) && x : number ->(x = 10) : number ->x = 10 : number +>(x = 10) : 10 +>x = 10 : 10 >x : string | number ->10 : number +>10 : 10 >x : number : ((x = "hello") && x); // string >((x = "hello") && x) : string >(x = "hello") && x : string ->(x = "hello") : string ->x = "hello" : string +>(x = "hello") : "hello" +>x = "hello" : "hello" >x : string | number ->"hello" : string +>"hello" : "hello" >x : string } function foo7(x: number | string | boolean) { @@ -228,7 +228,7 @@ function foo9(x: number | string) { var y = 10; >y : number ->10 : number +>10 : 10 // usage of x or assignment to separate variable shouldn't cause narrowing of type to stop return typeof x === "string" @@ -316,7 +316,7 @@ function foo11(x: number | string | boolean) { : ((b = x) // x is number | boolean >((b = x) // x is number | boolean && typeof x === "number" && (x = 10) // assignment to x && x) : number >(b = x) // x is number | boolean && typeof x === "number" && (x = 10) // assignment to x && x : number ->(b = x) // x is number | boolean && typeof x === "number" && (x = 10) : number +>(b = x) // x is number | boolean && typeof x === "number" && (x = 10) : 0 | 10 >(b = x) // x is number | boolean && typeof x === "number" : boolean >(b = x) : number | boolean >b = x : number | boolean @@ -330,10 +330,10 @@ function foo11(x: number | string | boolean) { >"number" : "number" && (x = 10) // assignment to x ->(x = 10) : number ->x = 10 : number +>(x = 10) : 10 +>x = 10 : 10 >x : string | number | boolean ->10 : number +>10 : 10 && x); // x is number >x : number @@ -356,10 +356,10 @@ function foo12(x: number | string | boolean) { ? ((x = 10) && x.toString().length) // number >((x = 10) && x.toString().length) : number >(x = 10) && x.toString().length : number ->(x = 10) : number ->x = 10 : number +>(x = 10) : 10 +>x = 10 : 10 >x : string | number | boolean ->10 : number +>10 : 10 >x.toString().length : number >x.toString() : string >x.toString : (radix?: number) => string diff --git a/tests/baselines/reference/typeGuardsInDoStatement.types b/tests/baselines/reference/typeGuardsInDoStatement.types index 58b6343a2f5..fe14cff375f 100644 --- a/tests/baselines/reference/typeGuardsInDoStatement.types +++ b/tests/baselines/reference/typeGuardsInDoStatement.types @@ -7,13 +7,13 @@ function a(x: string | number | boolean) { >x : string | number | boolean x = true; ->x = true : boolean +>x = true : true >x : string | number | boolean ->true : boolean +>true : true do { x; // boolean | string ->x : string | boolean +>x : string | true x = undefined; >x = undefined : undefined @@ -34,13 +34,13 @@ function b(x: string | number | boolean) { >x : string | number | boolean x = true; ->x = true : boolean +>x = true : true >x : string | number | boolean ->true : boolean +>true : true do { x; // boolean | string ->x : string | boolean +>x : string | true if (cond) continue; >cond : boolean @@ -64,9 +64,9 @@ function c(x: string | number) { >x : string | number x = ""; ->x = "" : string +>x = "" : "" >x : string | number ->"" : string +>"" : "" do { x; // string diff --git a/tests/baselines/reference/typeGuardsInIfStatement.errors.txt b/tests/baselines/reference/typeGuardsInIfStatement.errors.txt index cd9ae40932a..ac8dfb07887 100644 --- a/tests/baselines/reference/typeGuardsInIfStatement.errors.txt +++ b/tests/baselines/reference/typeGuardsInIfStatement.errors.txt @@ -1,10 +1,7 @@ -tests/cases/conformance/expressions/typeGuards/typeGuardsInIfStatement.ts(22,10): error TS2354: No best common type exists among return expressions. -tests/cases/conformance/expressions/typeGuards/typeGuardsInIfStatement.ts(31,10): error TS2354: No best common type exists among return expressions. -tests/cases/conformance/expressions/typeGuards/typeGuardsInIfStatement.ts(49,10): error TS2354: No best common type exists among return expressions. tests/cases/conformance/expressions/typeGuards/typeGuardsInIfStatement.ts(139,17): error TS2339: Property 'toString' does not exist on type 'never'. -==== tests/cases/conformance/expressions/typeGuards/typeGuardsInIfStatement.ts (4 errors) ==== +==== tests/cases/conformance/expressions/typeGuards/typeGuardsInIfStatement.ts (1 errors) ==== // In the true branch statement of an 'if' statement, // the type of a variable or parameter is narrowed by any type guard in the 'if' condition when true. // In the false branch statement of an 'if' statement, @@ -27,8 +24,6 @@ tests/cases/conformance/expressions/typeGuards/typeGuardsInIfStatement.ts(139,17 } } function foo3(x: number | string) { - ~~~~ -!!! error TS2354: No best common type exists among return expressions. if (typeof x === "string") { x = "Hello"; return x; // string @@ -38,8 +33,6 @@ tests/cases/conformance/expressions/typeGuards/typeGuardsInIfStatement.ts(139,17 } } function foo4(x: number | string) { - ~~~~ -!!! error TS2354: No best common type exists among return expressions. if (typeof x === "string") { return x; // string } @@ -58,8 +51,6 @@ tests/cases/conformance/expressions/typeGuards/typeGuardsInIfStatement.ts(139,17 } } function foo6(x: number | string) { - ~~~~ -!!! error TS2354: No best common type exists among return expressions. if (typeof x === "string") { x = 10; return x; // number diff --git a/tests/baselines/reference/typeGuardsInRightOperandOfAndAndOperator.types b/tests/baselines/reference/typeGuardsInRightOperandOfAndAndOperator.types index 9d22f63e764..54c1d0270b5 100644 --- a/tests/baselines/reference/typeGuardsInRightOperandOfAndAndOperator.types +++ b/tests/baselines/reference/typeGuardsInRightOperandOfAndAndOperator.types @@ -30,10 +30,10 @@ function foo2(x: number | string) { >"string" : "string" >((x = 10) && x) : number >(x = 10) && x : number ->(x = 10) : number ->x = 10 : number +>(x = 10) : 10 +>x = 10 : 10 >x : string | number ->10 : number +>10 : 10 >x : number } function foo3(x: number | string) { @@ -49,10 +49,10 @@ function foo3(x: number | string) { >"string" : "string" >((x = "hello") && x) : string >(x = "hello") && x : string ->(x = "hello") : string ->x = "hello" : string +>(x = "hello") : "hello" +>x = "hello" : "hello" >x : string | number ->"hello" : string +>"hello" : "hello" >x : string } function foo4(x: number | string | boolean) { @@ -174,10 +174,10 @@ function foo7(x: number | string | boolean) { ? ((x = 10) && x.toString()) // x is number >((x = 10) && x.toString()) : string >(x = 10) && x.toString() : string ->(x = 10) : number ->x = 10 : number +>(x = 10) : 10 +>x = 10 : 10 >x : string | number | boolean ->10 : number +>10 : 10 >x.toString() : string >x.toString : (radix?: number) => string >x : number diff --git a/tests/baselines/reference/typeGuardsInRightOperandOfOrOrOperator.types b/tests/baselines/reference/typeGuardsInRightOperandOfOrOrOperator.types index 0cb70c8c2d6..e8548ab1ef6 100644 --- a/tests/baselines/reference/typeGuardsInRightOperandOfOrOrOperator.types +++ b/tests/baselines/reference/typeGuardsInRightOperandOfOrOrOperator.types @@ -31,10 +31,10 @@ function foo2(x: number | string) { >"string" : "string" >((x = 10) || x) : number >(x = 10) || x : number ->(x = 10) : number ->x = 10 : number +>(x = 10) : 10 +>x = 10 : 10 >x : string | number ->10 : number +>10 : 10 >x : number } function foo3(x: number | string) { @@ -50,10 +50,10 @@ function foo3(x: number | string) { >"string" : "string" >((x = "hello") || x) : string >(x = "hello") || x : string ->(x = "hello") : string ->x = "hello" : string +>(x = "hello") : "hello" +>x = "hello" : "hello" >x : string | number ->"hello" : string +>"hello" : "hello" >x : string } function foo4(x: number | string | boolean) { @@ -175,10 +175,10 @@ function foo7(x: number | string | boolean) { ? ((x = 10) && x.toString()) // number | boolean | string >((x = 10) && x.toString()) : string >(x = 10) && x.toString() : string ->(x = 10) : number ->x = 10 : number +>(x = 10) : 10 +>x = 10 : 10 >x : string | number | boolean ->10 : number +>10 : 10 >x.toString() : string >x.toString : (radix?: number) => string >x : number diff --git a/tests/baselines/reference/typeGuardsNestedAssignments.types b/tests/baselines/reference/typeGuardsNestedAssignments.types index 3b125d4f32c..32ac85e270b 100644 --- a/tests/baselines/reference/typeGuardsNestedAssignments.types +++ b/tests/baselines/reference/typeGuardsNestedAssignments.types @@ -136,7 +136,7 @@ while ((match = re.exec("xxx")) != null) { >re.exec : (string: string) => RegExpExecArray | null >re : RegExp >exec : (string: string) => RegExpExecArray | null ->"xxx" : string +>"xxx" : "xxx" >null : null const length = match[1].length + match[2].length @@ -145,11 +145,11 @@ while ((match = re.exec("xxx")) != null) { >match[1].length : number >match[1] : string >match : RegExpExecArray ->1 : number +>1 : 1 >length : number >match[2].length : number >match[2] : string >match : RegExpExecArray ->2 : number +>2 : 2 >length : number } diff --git a/tests/baselines/reference/typeGuardsOnClassProperty.types b/tests/baselines/reference/typeGuardsOnClassProperty.types index 85af4540fb9..1b663ef209f 100644 --- a/tests/baselines/reference/typeGuardsOnClassProperty.types +++ b/tests/baselines/reference/typeGuardsOnClassProperty.types @@ -30,7 +30,7 @@ class D { >data.join : (separator?: string) => string >data : string[] >join : (separator?: string) => string ->" " : string +>" " : " " } getData1() { @@ -53,7 +53,7 @@ class D { >this : this >data : string[] >join : (separator?: string) => string ->" " : string +>" " : " " } } @@ -67,15 +67,15 @@ var o: { >prop2 : string | boolean } = { ->{ prop1: "string" , prop2: true } : { prop1: string; prop2: boolean; } +>{ prop1: "string" , prop2: true } : { prop1: string; prop2: true; } prop1: "string" , >prop1 : string ->"string" : string +>"string" : "string" prop2: true >prop2 : boolean ->true : boolean +>true : true } if (typeof o.prop1 === "string" && o.prop1.toLowerCase()) {} diff --git a/tests/baselines/reference/typeGuardsWithInstanceOfByConstructorSignature.errors.txt b/tests/baselines/reference/typeGuardsWithInstanceOfByConstructorSignature.errors.txt index b67f7328856..31db51bf57e 100644 --- a/tests/baselines/reference/typeGuardsWithInstanceOfByConstructorSignature.errors.txt +++ b/tests/baselines/reference/typeGuardsWithInstanceOfByConstructorSignature.errors.txt @@ -1,18 +1,24 @@ tests/cases/conformance/expressions/typeGuards/typeGuardsWithInstanceOfByConstructorSignature.ts(12,10): error TS2339: Property 'bar' does not exist on type 'A'. tests/cases/conformance/expressions/typeGuards/typeGuardsWithInstanceOfByConstructorSignature.ts(18,10): error TS2339: Property 'bar' does not exist on type 'A'. -tests/cases/conformance/expressions/typeGuards/typeGuardsWithInstanceOfByConstructorSignature.ts(33,5): error TS2322: Type 'string' is not assignable to type 'number'. +tests/cases/conformance/expressions/typeGuards/typeGuardsWithInstanceOfByConstructorSignature.ts(33,5): error TS2322: Type '"str"' is not assignable to type 'number'. tests/cases/conformance/expressions/typeGuards/typeGuardsWithInstanceOfByConstructorSignature.ts(34,10): error TS2339: Property 'bar' does not exist on type 'B'. tests/cases/conformance/expressions/typeGuards/typeGuardsWithInstanceOfByConstructorSignature.ts(41,10): error TS2339: Property 'bar' does not exist on type 'B'. tests/cases/conformance/expressions/typeGuards/typeGuardsWithInstanceOfByConstructorSignature.ts(66,10): error TS2339: Property 'bar2' does not exist on type 'C1'. tests/cases/conformance/expressions/typeGuards/typeGuardsWithInstanceOfByConstructorSignature.ts(72,10): error TS2339: Property 'bar1' does not exist on type 'C1 | C2'. + Property 'bar1' does not exist on type 'C2'. tests/cases/conformance/expressions/typeGuards/typeGuardsWithInstanceOfByConstructorSignature.ts(73,10): error TS2339: Property 'bar2' does not exist on type 'C1 | C2'. + Property 'bar2' does not exist on type 'C1'. tests/cases/conformance/expressions/typeGuards/typeGuardsWithInstanceOfByConstructorSignature.ts(85,10): error TS2339: Property 'bar' does not exist on type 'D'. tests/cases/conformance/expressions/typeGuards/typeGuardsWithInstanceOfByConstructorSignature.ts(91,10): error TS2339: Property 'bar' does not exist on type 'D'. tests/cases/conformance/expressions/typeGuards/typeGuardsWithInstanceOfByConstructorSignature.ts(112,10): error TS2339: Property 'bar2' does not exist on type 'E1'. tests/cases/conformance/expressions/typeGuards/typeGuardsWithInstanceOfByConstructorSignature.ts(118,11): error TS2339: Property 'bar1' does not exist on type 'E1 | E2'. + Property 'bar1' does not exist on type 'E2'. tests/cases/conformance/expressions/typeGuards/typeGuardsWithInstanceOfByConstructorSignature.ts(119,11): error TS2339: Property 'bar2' does not exist on type 'E1 | E2'. + Property 'bar2' does not exist on type 'E1'. tests/cases/conformance/expressions/typeGuards/typeGuardsWithInstanceOfByConstructorSignature.ts(134,11): error TS2339: Property 'foo' does not exist on type 'string | F'. + Property 'foo' does not exist on type 'string'. tests/cases/conformance/expressions/typeGuards/typeGuardsWithInstanceOfByConstructorSignature.ts(135,11): error TS2339: Property 'bar' does not exist on type 'string | F'. + Property 'bar' does not exist on type 'string'. tests/cases/conformance/expressions/typeGuards/typeGuardsWithInstanceOfByConstructorSignature.ts(160,11): error TS2339: Property 'foo2' does not exist on type 'G1'. tests/cases/conformance/expressions/typeGuards/typeGuardsWithInstanceOfByConstructorSignature.ts(166,11): error TS2339: Property 'foo2' does not exist on type 'G1'. tests/cases/conformance/expressions/typeGuards/typeGuardsWithInstanceOfByConstructorSignature.ts(182,11): error TS2339: Property 'bar' does not exist on type 'H'. @@ -59,7 +65,7 @@ tests/cases/conformance/expressions/typeGuards/typeGuardsWithInstanceOfByConstru obj3.foo = 1; obj3.foo = "str"; ~~~~~~~~ -!!! error TS2322: Type 'string' is not assignable to type 'number'. +!!! error TS2322: Type '"str"' is not assignable to type 'number'. obj3.bar = "str"; ~~~ !!! error TS2339: Property 'bar' does not exist on type 'B'. @@ -107,9 +113,11 @@ tests/cases/conformance/expressions/typeGuards/typeGuardsWithInstanceOfByConstru obj6.bar1; ~~~~ !!! error TS2339: Property 'bar1' does not exist on type 'C1 | C2'. +!!! error TS2339: Property 'bar1' does not exist on type 'C2'. obj6.bar2; ~~~~ !!! error TS2339: Property 'bar2' does not exist on type 'C1 | C2'. +!!! error TS2339: Property 'bar2' does not exist on type 'C1'. } // with object type literal @@ -163,9 +171,11 @@ tests/cases/conformance/expressions/typeGuards/typeGuardsWithInstanceOfByConstru obj10.bar1; ~~~~ !!! error TS2339: Property 'bar1' does not exist on type 'E1 | E2'. +!!! error TS2339: Property 'bar1' does not exist on type 'E2'. obj10.bar2; ~~~~ !!! error TS2339: Property 'bar2' does not exist on type 'E1 | E2'. +!!! error TS2339: Property 'bar2' does not exist on type 'E1'. } // a construct signature that returns any @@ -183,9 +193,11 @@ tests/cases/conformance/expressions/typeGuards/typeGuardsWithInstanceOfByConstru obj11.foo; ~~~ !!! error TS2339: Property 'foo' does not exist on type 'string | F'. +!!! error TS2339: Property 'foo' does not exist on type 'string'. obj11.bar; ~~~ !!! error TS2339: Property 'bar' does not exist on type 'string | F'. +!!! error TS2339: Property 'bar' does not exist on type 'string'. } var obj12: any; diff --git a/tests/baselines/reference/typeInferenceConflictingCandidates.errors.txt b/tests/baselines/reference/typeInferenceConflictingCandidates.errors.txt index f275e44503a..d20b7ae4ede 100644 --- a/tests/baselines/reference/typeInferenceConflictingCandidates.errors.txt +++ b/tests/baselines/reference/typeInferenceConflictingCandidates.errors.txt @@ -1,5 +1,5 @@ tests/cases/compiler/typeInferenceConflictingCandidates.ts(3,1): error TS2453: The type argument for type parameter 'T' cannot be inferred from the usage. Consider specifying the type arguments explicitly. - Type argument candidate 'string' is not a valid type argument because it is not a supertype of candidate 'number'. + Type argument candidate '""' is not a valid type argument because it is not a supertype of candidate '3'. ==== tests/cases/compiler/typeInferenceConflictingCandidates.ts (1 errors) ==== @@ -8,4 +8,4 @@ tests/cases/compiler/typeInferenceConflictingCandidates.ts(3,1): error TS2453: T g("", 3, a => a); ~ !!! error TS2453: The type argument for type parameter 'T' cannot be inferred from the usage. Consider specifying the type arguments explicitly. -!!! error TS2453: Type argument candidate 'string' is not a valid type argument because it is not a supertype of candidate 'number'. \ No newline at end of file +!!! error TS2453: Type argument candidate '""' is not a valid type argument because it is not a supertype of candidate '3'. \ No newline at end of file diff --git a/tests/baselines/reference/typeInferenceFBoundedTypeParams.types b/tests/baselines/reference/typeInferenceFBoundedTypeParams.types index 0ce04aabddf..a6d0a51dd45 100644 --- a/tests/baselines/reference/typeInferenceFBoundedTypeParams.types +++ b/tests/baselines/reference/typeInferenceFBoundedTypeParams.types @@ -61,9 +61,9 @@ fold( [1, 2, 3], >[1, 2, 3] : number[] ->1 : number ->2 : number ->3 : number +>1 : 1 +>2 : 2 +>3 : 3 [] as [string, string][], >[] as [string, string][] : [string, string][] @@ -81,8 +81,8 @@ fold( ["", ""] >["", ""] : [string, string] ->"" : string ->"" : string +>"" : "" +>"" : "" ) ); diff --git a/tests/baselines/reference/typeInferenceFixEarly.types b/tests/baselines/reference/typeInferenceFixEarly.types index 5c727ca3226..2eacc53be61 100644 --- a/tests/baselines/reference/typeInferenceFixEarly.types +++ b/tests/baselines/reference/typeInferenceFixEarly.types @@ -13,5 +13,5 @@ f(n => 3); >f : (p: (t: T) => T) => T >n => 3 : (n: {}) => number >n : {} ->3 : number +>3 : 3 diff --git a/tests/baselines/reference/typeInferenceWithTupleType.types b/tests/baselines/reference/typeInferenceWithTupleType.types index a45e72518e8..a7f8bff6798 100644 --- a/tests/baselines/reference/typeInferenceWithTupleType.types +++ b/tests/baselines/reference/typeInferenceWithTupleType.types @@ -20,20 +20,20 @@ var combineResult = combine("string", 10); >combineResult : [string, number] >combine("string", 10) : [string, number] >combine : (x: T, y: U) => [T, U] ->"string" : string ->10 : number +>"string" : "string" +>10 : 10 var combineEle1 = combineResult[0]; // string >combineEle1 : string >combineResult[0] : string >combineResult : [string, number] ->0 : number +>0 : 0 var combineEle2 = combineResult[1]; // number >combineEle2 : number >combineResult[1] : number >combineResult : [string, number] ->1 : number +>1 : 1 function zip(array1: T[], array2: U[]): [[T, U]] { >zip : (array1: T[], array2: U[]) => [[T, U]] @@ -74,7 +74,7 @@ function zip(array1: T[], array2: U[]): [[T, U]] { for (var i = 0; i < length; ++i) { >i : number ->0 : number +>0 : 0 >i < length : boolean >i : number >length : number @@ -103,24 +103,24 @@ var zipResult = zip(["foo", "bar"], [5, 6]); >zip(["foo", "bar"], [5, 6]) : [[string, number]] >zip : (array1: T[], array2: U[]) => [[T, U]] >["foo", "bar"] : string[] ->"foo" : string ->"bar" : string +>"foo" : "foo" +>"bar" : "bar" >[5, 6] : number[] ->5 : number ->6 : number +>5 : 5 +>6 : 6 var zipResultEle = zipResult[0]; // [string, number] >zipResultEle : [string, number] >zipResult[0] : [string, number] >zipResult : [[string, number]] ->0 : number +>0 : 0 var zipResultEleEle = zipResult[0][0]; // string >zipResultEleEle : string >zipResult[0][0] : string >zipResult[0] : [string, number] >zipResult : [[string, number]] ->0 : number ->0 : number +>0 : 0 +>0 : 0 diff --git a/tests/baselines/reference/typeName1.errors.txt b/tests/baselines/reference/typeName1.errors.txt index 152a5b951e7..3e99a18552f 100644 --- a/tests/baselines/reference/typeName1.errors.txt +++ b/tests/baselines/reference/typeName1.errors.txt @@ -1,19 +1,19 @@ -tests/cases/compiler/typeName1.ts(9,5): error TS2322: Type 'number' is not assignable to type '{ f(s: string): number; f(n: number): string; }'. -tests/cases/compiler/typeName1.ts(10,5): error TS2322: Type 'number' is not assignable to type '{ f(s: string): number; }'. -tests/cases/compiler/typeName1.ts(11,5): error TS2322: Type 'number' is not assignable to type '{ (s: string): number; (n: number): string; }'. -tests/cases/compiler/typeName1.ts(12,5): error TS2322: Type 'number' is not assignable to type '{ x: any; y: any; z: number; f(n: number): string; f(s: string): number; }'. -tests/cases/compiler/typeName1.ts(13,5): error TS2322: Type 'number' is not assignable to type '{ (s: string): number; (n: number): string; x: any; y: any; z: number; f(n: number): string; f(s: string): number; }'. -tests/cases/compiler/typeName1.ts(14,5): error TS2322: Type 'number' is not assignable to type '{ z: number; f: { (n: number): string; (s: string): number; }; }'. -tests/cases/compiler/typeName1.ts(15,5): error TS2322: Type 'number' is not assignable to type '(s: string) => boolean'. -tests/cases/compiler/typeName1.ts(16,5): error TS2322: Type 'number' is not assignable to type '{ (): boolean; [s: string]: { x: any; y: any; }; [n: number]: { x: any; y: any; }; z: I; }'. +tests/cases/compiler/typeName1.ts(9,5): error TS2322: Type '3' is not assignable to type '{ f(s: string): number; f(n: number): string; }'. +tests/cases/compiler/typeName1.ts(10,5): error TS2322: Type '3' is not assignable to type '{ f(s: string): number; }'. +tests/cases/compiler/typeName1.ts(11,5): error TS2322: Type '3' is not assignable to type '{ (s: string): number; (n: number): string; }'. +tests/cases/compiler/typeName1.ts(12,5): error TS2322: Type '3' is not assignable to type '{ x: any; y: any; z: number; f(n: number): string; f(s: string): number; }'. +tests/cases/compiler/typeName1.ts(13,5): error TS2322: Type '3' is not assignable to type '{ (s: string): number; (n: number): string; x: any; y: any; z: number; f(n: number): string; f(s: string): number; }'. +tests/cases/compiler/typeName1.ts(14,5): error TS2322: Type '3' is not assignable to type '{ z: number; f: { (n: number): string; (s: string): number; }; }'. +tests/cases/compiler/typeName1.ts(15,5): error TS2322: Type '3' is not assignable to type '(s: string) => boolean'. +tests/cases/compiler/typeName1.ts(16,5): error TS2322: Type '3' is not assignable to type '{ (): boolean; [s: string]: { x: any; y: any; }; [n: number]: { x: any; y: any; }; z: I; }'. tests/cases/compiler/typeName1.ts(16,10): error TS2411: Property 'z' of type 'I' is not assignable to string index type '{ x: any; y: any; }'. -tests/cases/compiler/typeName1.ts(17,5): error TS2322: Type 'number' is not assignable to type 'I'. -tests/cases/compiler/typeName1.ts(18,5): error TS2322: Type 'number' is not assignable to type 'I[][][][]'. -tests/cases/compiler/typeName1.ts(19,5): error TS2322: Type 'number' is not assignable to type '{ z: I; x: boolean; }[][]'. -tests/cases/compiler/typeName1.ts(20,5): error TS2322: Type 'number' is not assignable to type '{ z: I; x: boolean; y: (s: string) => boolean; w: { (): boolean; [s: string]: { x: any; y: any; }; [n: number]: { x: any; y: any; }; z: I; }; }[][]'. +tests/cases/compiler/typeName1.ts(17,5): error TS2322: Type '3' is not assignable to type 'I'. +tests/cases/compiler/typeName1.ts(18,5): error TS2322: Type '3' is not assignable to type 'I[][][][]'. +tests/cases/compiler/typeName1.ts(19,5): error TS2322: Type '3' is not assignable to type '{ z: I; x: boolean; }[][]'. +tests/cases/compiler/typeName1.ts(20,5): error TS2322: Type '3' is not assignable to type '{ z: I; x: boolean; y: (s: string) => boolean; w: { (): boolean; [s: string]: { x: any; y: any; }; [n: number]: { x: any; y: any; }; z: I; }; }[][]'. tests/cases/compiler/typeName1.ts(20,50): error TS2411: Property 'z' of type 'I' is not assignable to string index type '{ x: any; y: any; }'. -tests/cases/compiler/typeName1.ts(21,5): error TS2322: Type 'number' is not assignable to type '{ (): {}; new (): number; new (n: number): number; x: string; w: { y: number; }; }'. -tests/cases/compiler/typeName1.ts(22,5): error TS2322: Type 'number' is not assignable to type '{ (): string; f(x: number): boolean; p: any; q: any; }'. +tests/cases/compiler/typeName1.ts(21,5): error TS2322: Type '3' is not assignable to type '{ (): {}; new (): number; new (n: number): number; x: string; w: { y: number; }; }'. +tests/cases/compiler/typeName1.ts(22,5): error TS2322: Type '3' is not assignable to type '{ (): string; f(x: number): boolean; p: any; q: any; }'. tests/cases/compiler/typeName1.ts(23,5): error TS2322: Type 'typeof C' is not assignable to type 'number'. @@ -28,50 +28,50 @@ tests/cases/compiler/typeName1.ts(23,5): error TS2322: Type 'typeof C' is not as var x1:{ f(s:string):number;f(n:number):string; }=3; ~~ -!!! error TS2322: Type 'number' is not assignable to type '{ f(s: string): number; f(n: number): string; }'. +!!! error TS2322: Type '3' is not assignable to type '{ f(s: string): number; f(n: number): string; }'. var x2:{ f(s:string):number; } =3; ~~ -!!! error TS2322: Type 'number' is not assignable to type '{ f(s: string): number; }'. +!!! error TS2322: Type '3' is not assignable to type '{ f(s: string): number; }'. var x3:{ (s:string):number;(n:number):string; }=3; ~~ -!!! error TS2322: Type 'number' is not assignable to type '{ (s: string): number; (n: number): string; }'. +!!! error TS2322: Type '3' is not assignable to type '{ (s: string): number; (n: number): string; }'. var x4:{ x;y;z:number;f(n:number):string;f(s:string):number; }=3; ~~ -!!! error TS2322: Type 'number' is not assignable to type '{ x: any; y: any; z: number; f(n: number): string; f(s: string): number; }'. +!!! error TS2322: Type '3' is not assignable to type '{ x: any; y: any; z: number; f(n: number): string; f(s: string): number; }'. var x5:{ (s:string):number;(n:number):string;x;y;z:number;f(n:number):string;f(s:string):number; }=3; ~~ -!!! error TS2322: Type 'number' is not assignable to type '{ (s: string): number; (n: number): string; x: any; y: any; z: number; f(n: number): string; f(s: string): number; }'. +!!! error TS2322: Type '3' is not assignable to type '{ (s: string): number; (n: number): string; x: any; y: any; z: number; f(n: number): string; f(s: string): number; }'. var x6:{ z:number;f:{(n:number):string;(s:string):number;}; }=3; ~~ -!!! error TS2322: Type 'number' is not assignable to type '{ z: number; f: { (n: number): string; (s: string): number; }; }'. +!!! error TS2322: Type '3' is not assignable to type '{ z: number; f: { (n: number): string; (s: string): number; }; }'. var x7:(s:string)=>boolean=3; ~~ -!!! error TS2322: Type 'number' is not assignable to type '(s: string) => boolean'. +!!! error TS2322: Type '3' is not assignable to type '(s: string) => boolean'. var x8:{ z:I;[s:string]:{ x; y; };[n:number]:{x; y;};():boolean; }=3; ~~ -!!! error TS2322: Type 'number' is not assignable to type '{ (): boolean; [s: string]: { x: any; y: any; }; [n: number]: { x: any; y: any; }; z: I; }'. +!!! error TS2322: Type '3' is not assignable to type '{ (): boolean; [s: string]: { x: any; y: any; }; [n: number]: { x: any; y: any; }; z: I; }'. ~~~~ !!! error TS2411: Property 'z' of type 'I' is not assignable to string index type '{ x: any; y: any; }'. var x9:I=3; ~~ -!!! error TS2322: Type 'number' is not assignable to type 'I'. +!!! error TS2322: Type '3' is not assignable to type 'I'. var x10:I[][][][]=3; ~~~ -!!! error TS2322: Type 'number' is not assignable to type 'I[][][][]'. +!!! error TS2322: Type '3' is not assignable to type 'I[][][][]'. var x11:{z:I;x:boolean;}[][]=3; ~~~ -!!! error TS2322: Type 'number' is not assignable to type '{ z: I; x: boolean; }[][]'. +!!! error TS2322: Type '3' is not assignable to type '{ z: I; x: boolean; }[][]'. var x12:{z:I;x:boolean;y:(s:string)=>boolean;w:{ z:I;[s:string]:{ x; y; };[n:number]:{x; y;};():boolean; };}[][]=3; ~~~ -!!! error TS2322: Type 'number' is not assignable to type '{ z: I; x: boolean; y: (s: string) => boolean; w: { (): boolean; [s: string]: { x: any; y: any; }; [n: number]: { x: any; y: any; }; z: I; }; }[][]'. +!!! error TS2322: Type '3' is not assignable to type '{ z: I; x: boolean; y: (s: string) => boolean; w: { (): boolean; [s: string]: { x: any; y: any; }; [n: number]: { x: any; y: any; }; z: I; }; }[][]'. ~~~~ !!! error TS2411: Property 'z' of type 'I' is not assignable to string index type '{ x: any; y: any; }'. var x13:{ new(): number; new(n:number):number; x: string; w: {y: number;}; (): {}; } = 3; ~~~ -!!! error TS2322: Type 'number' is not assignable to type '{ (): {}; new (): number; new (n: number): number; x: string; w: { y: number; }; }'. +!!! error TS2322: Type '3' is not assignable to type '{ (): {}; new (): number; new (n: number): number; x: string; w: { y: number; }; }'. var x14:{ f(x:number):boolean; p; q; ():string; }=3; ~~~ -!!! error TS2322: Type 'number' is not assignable to type '{ (): string; f(x: number): boolean; p: any; q: any; }'. +!!! error TS2322: Type '3' is not assignable to type '{ (): string; f(x: number): boolean; p: any; q: any; }'. var x15:number=C; ~~~ !!! error TS2322: Type 'typeof C' is not assignable to type 'number'. diff --git a/tests/baselines/reference/typeOfEnumAndVarRedeclarations.errors.txt b/tests/baselines/reference/typeOfEnumAndVarRedeclarations.errors.txt index d7410ec04cb..89849d3a614 100644 --- a/tests/baselines/reference/typeOfEnumAndVarRedeclarations.errors.txt +++ b/tests/baselines/reference/typeOfEnumAndVarRedeclarations.errors.txt @@ -1,7 +1,9 @@ +tests/cases/compiler/typeOfEnumAndVarRedeclarations.ts(8,5): error TS2403: Subsequent variable declarations must have the same type. Variable 'x' must be of type 'typeof E', but here has type '{ readonly [x: number]: string; readonly a: E; readonly b: E; }'. +tests/cases/compiler/typeOfEnumAndVarRedeclarations.ts(10,5): error TS2403: Subsequent variable declarations must have the same type. Variable 'y' must be of type 'typeof E', but here has type '{ readonly [x: number]: string; readonly a: E; readonly b: E; }'. tests/cases/compiler/typeOfEnumAndVarRedeclarations.ts(10,70): error TS2375: Duplicate number index signature. -==== tests/cases/compiler/typeOfEnumAndVarRedeclarations.ts (1 errors) ==== +==== tests/cases/compiler/typeOfEnumAndVarRedeclarations.ts (3 errors) ==== enum E { a } @@ -10,7 +12,11 @@ tests/cases/compiler/typeOfEnumAndVarRedeclarations.ts(10,70): error TS2375: Dup } var x = E; var x: { readonly a: E; readonly b: E; readonly [x: number]: string; }; // Shouldnt error + ~ +!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'x' must be of type 'typeof E', but here has type '{ readonly [x: number]: string; readonly a: E; readonly b: E; }'. var y = E; var y: { readonly a: E; readonly b: E; readonly [x: number]: string; readonly [x: number]: string } // two errors: the types are not identical and duplicate signatures + ~ +!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'y' must be of type 'typeof E', but here has type '{ readonly [x: number]: string; readonly a: E; readonly b: E; }'. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ !!! error TS2375: Duplicate number index signature. \ No newline at end of file diff --git a/tests/baselines/reference/typeOfOnTypeArg.errors.txt b/tests/baselines/reference/typeOfOnTypeArg.errors.txt index 46b48983f21..58412a5417f 100644 --- a/tests/baselines/reference/typeOfOnTypeArg.errors.txt +++ b/tests/baselines/reference/typeOfOnTypeArg.errors.txt @@ -1,4 +1,4 @@ -tests/cases/compiler/typeOfOnTypeArg.ts(7,6): error TS2345: Argument of type 'number' is not assignable to parameter of type '{ '': number; }'. +tests/cases/compiler/typeOfOnTypeArg.ts(7,6): error TS2345: Argument of type '32' is not assignable to parameter of type '{ '': number; }'. ==== tests/cases/compiler/typeOfOnTypeArg.ts (1 errors) ==== @@ -10,5 +10,5 @@ tests/cases/compiler/typeOfOnTypeArg.ts(7,6): error TS2345: Argument of type 'nu fill(32); ~~ -!!! error TS2345: Argument of type 'number' is not assignable to parameter of type '{ '': number; }'. +!!! error TS2345: Argument of type '32' is not assignable to parameter of type '{ '': number; }'. \ No newline at end of file diff --git a/tests/baselines/reference/typeOfPrototype.types b/tests/baselines/reference/typeOfPrototype.types index 90466787080..0660b4cd00c 100644 --- a/tests/baselines/reference/typeOfPrototype.types +++ b/tests/baselines/reference/typeOfPrototype.types @@ -4,11 +4,11 @@ class Foo { bar = 3; >bar : number ->3 : number +>3 : 3 static bar = ''; >bar : string ->'' : string +>'' : "" } Foo.prototype.bar = undefined; // Should be OK >Foo.prototype.bar = undefined : undefined diff --git a/tests/baselines/reference/typeOfThisInStaticMembers.types b/tests/baselines/reference/typeOfThisInStaticMembers.types index 72caa4a95a9..55e92bd791c 100644 --- a/tests/baselines/reference/typeOfThisInStaticMembers.types +++ b/tests/baselines/reference/typeOfThisInStaticMembers.types @@ -35,7 +35,7 @@ var r2 = t.foo + 1; >t.foo : number >t : typeof C >foo : number ->1 : number +>1 : 1 var r3 = t.bar(); >r3 : typeof C @@ -48,7 +48,7 @@ var r4 = new t(1); >r4 : C >new t(1) : C >t : typeof C ->1 : number +>1 : 1 class C2 { >C2 : C2 @@ -90,7 +90,7 @@ var r5 = t2.foo + 1; >t2.foo : string >t2 : typeof C2 >foo : string ->1 : number +>1 : 1 var r6 = t2.bar(); >r6 : typeof C2 @@ -103,6 +103,6 @@ var r7 = new t2(''); >r7 : C2<{}> >new t2('') : C2<{}> >t2 : typeof C2 ->'' : string +>'' : "" diff --git a/tests/baselines/reference/typeParameterAndArgumentOfSameName1.types b/tests/baselines/reference/typeParameterAndArgumentOfSameName1.types index 8e476732ded..a8b96275283 100644 --- a/tests/baselines/reference/typeParameterAndArgumentOfSameName1.types +++ b/tests/baselines/reference/typeParameterAndArgumentOfSameName1.types @@ -13,7 +13,7 @@ function f(A: A): A { >A.toExponential : (fractionDigits?: number) => string >A : A >toExponential : (fractionDigits?: number) => string ->123 : number +>123 : 123 return null; >null : null diff --git a/tests/baselines/reference/typeParameterAsBaseClass.errors.txt b/tests/baselines/reference/typeParameterAsBaseClass.errors.txt index dec7f7f2a4a..e633a6dd396 100644 --- a/tests/baselines/reference/typeParameterAsBaseClass.errors.txt +++ b/tests/baselines/reference/typeParameterAsBaseClass.errors.txt @@ -1,11 +1,11 @@ -tests/cases/compiler/typeParameterAsBaseClass.ts(1,20): error TS2304: Cannot find name 'T'. +tests/cases/compiler/typeParameterAsBaseClass.ts(1,20): error TS2693: 'T' only refers to a type, but is being used as a value here. tests/cases/compiler/typeParameterAsBaseClass.ts(2,24): error TS2422: A class may only implement another class or interface. ==== tests/cases/compiler/typeParameterAsBaseClass.ts (2 errors) ==== class C extends T {} ~ -!!! error TS2304: Cannot find name 'T'. +!!! error TS2693: 'T' only refers to a type, but is being used as a value here. class C2 implements T {} ~ !!! error TS2422: A class may only implement another class or interface. \ No newline at end of file diff --git a/tests/baselines/reference/typeParameterAsBaseType.errors.txt b/tests/baselines/reference/typeParameterAsBaseType.errors.txt index 835b2369948..c16b16d0b1a 100644 --- a/tests/baselines/reference/typeParameterAsBaseType.errors.txt +++ b/tests/baselines/reference/typeParameterAsBaseType.errors.txt @@ -1,5 +1,5 @@ -tests/cases/conformance/types/typeParameters/typeParameterAsBaseType.ts(4,20): error TS2304: Cannot find name 'T'. -tests/cases/conformance/types/typeParameters/typeParameterAsBaseType.ts(5,24): error TS2304: Cannot find name 'U'. +tests/cases/conformance/types/typeParameters/typeParameterAsBaseType.ts(4,20): error TS2693: 'T' only refers to a type, but is being used as a value here. +tests/cases/conformance/types/typeParameters/typeParameterAsBaseType.ts(5,24): error TS2693: 'U' only refers to a type, but is being used as a value here. tests/cases/conformance/types/typeParameters/typeParameterAsBaseType.ts(7,24): error TS2312: An interface may only extend a class or another interface. tests/cases/conformance/types/typeParameters/typeParameterAsBaseType.ts(8,28): error TS2312: An interface may only extend a class or another interface. @@ -10,10 +10,10 @@ tests/cases/conformance/types/typeParameters/typeParameterAsBaseType.ts(8,28): e class C extends T { } ~ -!!! error TS2304: Cannot find name 'T'. +!!! error TS2693: 'T' only refers to a type, but is being used as a value here. class C2 extends U { } ~ -!!! error TS2304: Cannot find name 'U'. +!!! error TS2693: 'U' only refers to a type, but is being used as a value here. interface I extends T { } ~ diff --git a/tests/baselines/reference/typeParameterAsElementType.types b/tests/baselines/reference/typeParameterAsElementType.types index 10e6787ae31..b4c3b4f3ec0 100644 --- a/tests/baselines/reference/typeParameterAsElementType.types +++ b/tests/baselines/reference/typeParameterAsElementType.types @@ -11,5 +11,5 @@ function fee() { >arr : (string | T)[] >[t, ""] : (string | T)[] >t : T ->"" : string +>"" : "" } diff --git a/tests/baselines/reference/typeParameterAsTypeParameterConstraint.types b/tests/baselines/reference/typeParameterAsTypeParameterConstraint.types index c5f15f1ba55..885b655b749 100644 --- a/tests/baselines/reference/typeParameterAsTypeParameterConstraint.types +++ b/tests/baselines/reference/typeParameterAsTypeParameterConstraint.types @@ -16,17 +16,17 @@ function foo(x: T, y: U): U { return y; } var r = foo(1, 2); >r : number ->foo(1, 2) : number +>foo(1, 2) : 2 >foo : (x: T, y: U) => U ->1 : number ->2 : number +>1 : 1 +>2 : 2 var r = foo({}, 1); >r : number ->foo({}, 1) : number +>foo({}, 1) : 1 >foo : (x: T, y: U) => U >{} : {} ->1 : number +>1 : 1 interface A { >A : A @@ -62,12 +62,12 @@ var r3 = foo({ x: 1 }, { x: 2, y: 3 }); >foo : (x: T, y: U) => U >{ x: 1 } : { x: number; } >x : number ->1 : number +>1 : 1 >{ x: 2, y: 3 } : { x: number; y: number; } >x : number ->2 : number +>2 : 2 >y : number ->3 : number +>3 : 3 function foo2(x: T, y: U) { return y; } >foo2 : (x: T, y: U) => U @@ -82,10 +82,10 @@ function foo2(x: T, y: U) { return y; } >y : U foo2(1, ''); ->foo2(1, '') : string +>foo2(1, '') : "" >foo2 : (x: T, y: U) => U ->1 : number ->'' : string +>1 : 1 +>'' : "" foo2({}, { length: 2 }); >foo2({}, { length: 2 }) : { length: number; } @@ -93,28 +93,28 @@ foo2({}, { length: 2 }); >{} : {} >{ length: 2 } : { length: number; } >length : number ->2 : number +>2 : 2 foo2(1, { width: 3, length: 2 }); >foo2(1, { width: 3, length: 2 }) : { width: number; length: number; } >foo2 : (x: T, y: U) => U ->1 : number +>1 : 1 >{ width: 3, length: 2 } : { width: number; length: number; } >width : number ->3 : number +>3 : 3 >length : number ->2 : number +>2 : 2 foo2(1, []); >foo2(1, []) : any[] >foo2 : (x: T, y: U) => U ->1 : number +>1 : 1 >[] : undefined[] foo2(1, ['']); >foo2(1, ['']) : string[] >foo2 : (x: T, y: U) => U ->1 : number +>1 : 1 >[''] : string[] ->'' : string +>'' : "" diff --git a/tests/baselines/reference/typeParameterAsTypeParameterConstraint2.errors.txt b/tests/baselines/reference/typeParameterAsTypeParameterConstraint2.errors.txt index 0e148cb5689..08706d095b2 100644 --- a/tests/baselines/reference/typeParameterAsTypeParameterConstraint2.errors.txt +++ b/tests/baselines/reference/typeParameterAsTypeParameterConstraint2.errors.txt @@ -1,4 +1,4 @@ -tests/cases/conformance/types/typeParameters/typeArgumentLists/typeParameterAsTypeParameterConstraint2.ts(6,8): error TS2345: Argument of type 'string' is not assignable to parameter of type 'number'. +tests/cases/conformance/types/typeParameters/typeArgumentLists/typeParameterAsTypeParameterConstraint2.ts(6,8): error TS2345: Argument of type '""' is not assignable to parameter of type 'number'. tests/cases/conformance/types/typeParameters/typeArgumentLists/typeParameterAsTypeParameterConstraint2.ts(7,8): error TS2345: Argument of type '{}' is not assignable to parameter of type 'number'. tests/cases/conformance/types/typeParameters/typeArgumentLists/typeParameterAsTypeParameterConstraint2.ts(13,17): error TS2345: Argument of type 'NumberVariant' is not assignable to parameter of type 'number'. tests/cases/conformance/types/typeParameters/typeArgumentLists/typeParameterAsTypeParameterConstraint2.ts(16,9): error TS2345: Argument of type '{ length: string; }' is not assignable to parameter of type '{ length: number; }'. @@ -20,7 +20,7 @@ tests/cases/conformance/types/typeParameters/typeArgumentLists/typeParameterAsTy foo(1, ''); ~~ -!!! error TS2345: Argument of type 'string' is not assignable to parameter of type 'number'. +!!! error TS2345: Argument of type '""' is not assignable to parameter of type 'number'. foo(1, {}); ~~ !!! error TS2345: Argument of type '{}' is not assignable to parameter of type 'number'. diff --git a/tests/baselines/reference/typeParameterAsTypeParameterConstraintTransitively.types b/tests/baselines/reference/typeParameterAsTypeParameterConstraintTransitively.types index e2d41c5c136..8e5f04507bb 100644 --- a/tests/baselines/reference/typeParameterAsTypeParameterConstraintTransitively.types +++ b/tests/baselines/reference/typeParameterAsTypeParameterConstraintTransitively.types @@ -45,30 +45,30 @@ function foo(x: T, y: U, z: V): V { return z; } //function foo(x: T, y: U, z: V): V { return z; } foo(1, 2, 3); ->foo(1, 2, 3) : number +>foo(1, 2, 3) : 3 >foo : (x: T, y: U, z: V) => V ->1 : number ->2 : number ->3 : number +>1 : 1 +>2 : 2 +>3 : 3 foo({ x: 1 }, { x: 1, y: '' }, { x: 2, y: '', z: true }); >foo({ x: 1 }, { x: 1, y: '' }, { x: 2, y: '', z: true }) : { x: number; y: string; z: boolean; } >foo : (x: T, y: U, z: V) => V >{ x: 1 } : { x: number; } >x : number ->1 : number +>1 : 1 >{ x: 1, y: '' } : { x: number; y: string; } >x : number ->1 : number +>1 : 1 >y : string ->'' : string ->{ x: 2, y: '', z: true } : { x: number; y: string; z: boolean; } +>'' : "" +>{ x: 2, y: '', z: true } : { x: number; y: string; z: true; } >x : number ->2 : number +>2 : 2 >y : string ->'' : string +>'' : "" >z : boolean ->true : boolean +>true : true foo(a, b, c); >foo(a, b, c) : C @@ -82,13 +82,13 @@ foo(a, b, { foo: 1, bar: '', hm: true }); >foo : (x: T, y: U, z: V) => V >a : A >b : B ->{ foo: 1, bar: '', hm: true } : { foo: number; bar: string; hm: boolean; } +>{ foo: 1, bar: '', hm: true } : { foo: number; bar: string; hm: true; } >foo : number ->1 : number +>1 : 1 >bar : string ->'' : string +>'' : "" >hm : boolean ->true : boolean +>true : true foo((x: number, y) => { }, (x) => { }, () => { }); >foo((x: number, y) => { }, (x) => { }, () => { }) : () => void @@ -137,9 +137,9 @@ foo(b, b, { foo: 1, bar: '', hm: '' }); >b : B >{ foo: 1, bar: '', hm: '' } : { foo: number; bar: string; hm: string; } >foo : number ->1 : number +>1 : 1 >bar : string ->'' : string +>'' : "" >hm : string ->'' : string +>'' : "" diff --git a/tests/baselines/reference/typeParameterAsTypeParameterConstraintTransitively2.types b/tests/baselines/reference/typeParameterAsTypeParameterConstraintTransitively2.types index 3d51ad80832..80e800cb1e0 100644 --- a/tests/baselines/reference/typeParameterAsTypeParameterConstraintTransitively2.types +++ b/tests/baselines/reference/typeParameterAsTypeParameterConstraintTransitively2.types @@ -45,30 +45,30 @@ function foo(x: T, y: U, z: V): V { return z; } //function foo(x: T, y: U, z: V): V { return z; } foo(1, 2, ''); ->foo(1, 2, '') : string +>foo(1, 2, '') : "" >foo : (x: T, y: U, z: V) => V ->1 : number ->2 : number ->'' : string +>1 : 1 +>2 : 2 +>'' : "" foo({ x: 1 }, { x: 1, y: '' }, { x: 2, y: 2, z: true }); >foo({ x: 1 }, { x: 1, y: '' }, { x: 2, y: 2, z: true }) : { x: number; y: number; z: boolean; } >foo : (x: T, y: U, z: V) => V >{ x: 1 } : { x: number; } >x : number ->1 : number +>1 : 1 >{ x: 1, y: '' } : { x: number; y: string; } >x : number ->1 : number +>1 : 1 >y : string ->'' : string ->{ x: 2, y: 2, z: true } : { x: number; y: number; z: boolean; } +>'' : "" +>{ x: 2, y: 2, z: true } : { x: number; y: number; z: true; } >x : number ->2 : number +>2 : 2 >y : number ->2 : number +>2 : 2 >z : boolean ->true : boolean +>true : true foo(a, b, a); >foo(a, b, a) : A @@ -81,13 +81,13 @@ foo(a, { foo: 1, bar: '', hm: true }, b); >foo(a, { foo: 1, bar: '', hm: true }, b) : B >foo : (x: T, y: U, z: V) => V >a : A ->{ foo: 1, bar: '', hm: true } : { foo: number; bar: string; hm: boolean; } +>{ foo: 1, bar: '', hm: true } : { foo: number; bar: string; hm: true; } >foo : number ->1 : number +>1 : 1 >bar : string ->'' : string +>'' : "" >hm : boolean ->true : boolean +>true : true >b : B foo((x: number, y: string) => { }, (x, y: boolean) => { }, () => { }); diff --git a/tests/baselines/reference/typeReferenceDirectives7.types b/tests/baselines/reference/typeReferenceDirectives7.types index dab53a49899..8ef960dd4a9 100644 --- a/tests/baselines/reference/typeReferenceDirectives7.types +++ b/tests/baselines/reference/typeReferenceDirectives7.types @@ -3,7 +3,7 @@ export let $ = 1; >$ : number ->1 : number +>1 : 1 export let x: typeof $; >x : number diff --git a/tests/baselines/reference/typeReferenceDirectives8.types b/tests/baselines/reference/typeReferenceDirectives8.types index 93d80b7988a..54ed0efd6e0 100644 --- a/tests/baselines/reference/typeReferenceDirectives8.types +++ b/tests/baselines/reference/typeReferenceDirectives8.types @@ -22,5 +22,5 @@ export function foo(): Lib { return {x: 1} } >Lib : Lib >{x: 1} : { x: number; } >x : number ->1 : number +>1 : 1 diff --git a/tests/baselines/reference/typeUsedAsValueError.errors.txt b/tests/baselines/reference/typeUsedAsValueError.errors.txt new file mode 100644 index 00000000000..89459235c53 --- /dev/null +++ b/tests/baselines/reference/typeUsedAsValueError.errors.txt @@ -0,0 +1,50 @@ +tests/cases/compiler/typeUsedAsValueError.ts(16,11): error TS2693: 'Interface' only refers to a type, but is being used as a value here. +tests/cases/compiler/typeUsedAsValueError.ts(17,11): error TS2304: Cannot find name 'InterfaceNotFound'. +tests/cases/compiler/typeUsedAsValueError.ts(18,13): error TS2693: 'TypeAliasForSomeClass' only refers to a type, but is being used as a value here. +tests/cases/compiler/typeUsedAsValueError.ts(19,16): error TS2693: 'TypeAliasForSomeClass' only refers to a type, but is being used as a value here. +tests/cases/compiler/typeUsedAsValueError.ts(20,16): error TS2304: Cannot find name 'TypeAliasForSomeClassNotFound'. +tests/cases/compiler/typeUsedAsValueError.ts(21,11): error TS2693: 'someType' only refers to a type, but is being used as a value here. +tests/cases/compiler/typeUsedAsValueError.ts(22,17): error TS2693: 'someType' only refers to a type, but is being used as a value here. +tests/cases/compiler/typeUsedAsValueError.ts(23,17): error TS2304: Cannot find name 'someTypeNotFound'. + + +==== tests/cases/compiler/typeUsedAsValueError.ts (8 errors) ==== + interface Interface { + + } + + class SomeClass { + + } + + type TypeAliasForSomeClass = SomeClass; + type someType = { x: number }; + + function acceptsSomeType(a: someType) { + + } + + let one = Interface; + ~~~~~~~~~ +!!! error TS2693: 'Interface' only refers to a type, but is being used as a value here. + let two = InterfaceNotFound; + ~~~~~~~~~~~~~~~~~ +!!! error TS2304: Cannot find name 'InterfaceNotFound'. + let three = TypeAliasForSomeClass; + ~~~~~~~~~~~~~~~~~~~~~ +!!! error TS2693: 'TypeAliasForSomeClass' only refers to a type, but is being used as a value here. + let four = new TypeAliasForSomeClass(); + ~~~~~~~~~~~~~~~~~~~~~ +!!! error TS2693: 'TypeAliasForSomeClass' only refers to a type, but is being used as a value here. + let five = new TypeAliasForSomeClassNotFound(); + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS2304: Cannot find name 'TypeAliasForSomeClassNotFound'. + let six = someType; + ~~~~~~~~ +!!! error TS2693: 'someType' only refers to a type, but is being used as a value here. + acceptsSomeType(someType); + ~~~~~~~~ +!!! error TS2693: 'someType' only refers to a type, but is being used as a value here. + acceptsSomeType(someTypeNotFound); + ~~~~~~~~~~~~~~~~ +!!! error TS2304: Cannot find name 'someTypeNotFound'. \ No newline at end of file diff --git a/tests/baselines/reference/typeUsedAsValueError.js b/tests/baselines/reference/typeUsedAsValueError.js new file mode 100644 index 00000000000..d45299564c0 --- /dev/null +++ b/tests/baselines/reference/typeUsedAsValueError.js @@ -0,0 +1,41 @@ +//// [typeUsedAsValueError.ts] +interface Interface { + +} + +class SomeClass { + +} + +type TypeAliasForSomeClass = SomeClass; +type someType = { x: number }; + +function acceptsSomeType(a: someType) { + +} + +let one = Interface; +let two = InterfaceNotFound; +let three = TypeAliasForSomeClass; +let four = new TypeAliasForSomeClass(); +let five = new TypeAliasForSomeClassNotFound(); +let six = someType; +acceptsSomeType(someType); +acceptsSomeType(someTypeNotFound); + +//// [typeUsedAsValueError.js] +var SomeClass = (function () { + function SomeClass() { + } + return SomeClass; +}()); +function acceptsSomeType(a) { +} +var one = Interface; +var two = InterfaceNotFound; +var three = TypeAliasForSomeClass; +var four = new TypeAliasForSomeClass(); +var five = new TypeAliasForSomeClassNotFound(); +var six = someType; +acceptsSomeType(someType); +acceptsSomeType(someTypeNotFound); diff --git a/tests/baselines/reference/typeUsedAsValueError2.errors.txt b/tests/baselines/reference/typeUsedAsValueError2.errors.txt new file mode 100644 index 00000000000..3027abb0e6b --- /dev/null +++ b/tests/baselines/reference/typeUsedAsValueError2.errors.txt @@ -0,0 +1,28 @@ +tests/cases/compiler/world.ts(4,1): error TS2693: 'HelloInterface' only refers to a type, but is being used as a value here. +tests/cases/compiler/world.ts(5,1): error TS2304: Cannot find name 'HelloNamespace'. + + +==== tests/cases/compiler/world.ts (2 errors) ==== + import HelloInterface = require("helloInterface"); + import HelloNamespace = require("helloNamespace"); + + HelloInterface.world; + ~~~~~~~~~~~~~~ +!!! error TS2693: 'HelloInterface' only refers to a type, but is being used as a value here. + HelloNamespace.world; + ~~~~~~~~~~~~~~ +!!! error TS2304: Cannot find name 'HelloNamespace'. +==== tests/cases/compiler/helloInterface.ts (0 errors) ==== + interface HelloInterface { + world: any; + } + + export = HelloInterface; + +==== tests/cases/compiler/helloNamespace.ts (0 errors) ==== + namespace HelloNamespace { + export type world = any; + } + + export = HelloNamespace; + \ No newline at end of file diff --git a/tests/baselines/reference/typeUsedAsValueError2.js b/tests/baselines/reference/typeUsedAsValueError2.js new file mode 100644 index 00000000000..c3bd736cbb7 --- /dev/null +++ b/tests/baselines/reference/typeUsedAsValueError2.js @@ -0,0 +1,37 @@ +//// [tests/cases/compiler/typeUsedAsValueError2.ts] //// + +//// [helloInterface.ts] +interface HelloInterface { + world: any; +} + +export = HelloInterface; + +//// [helloNamespace.ts] +namespace HelloNamespace { + export type world = any; +} + +export = HelloNamespace; + +//// [world.ts] +import HelloInterface = require("helloInterface"); +import HelloNamespace = require("helloNamespace"); + +HelloInterface.world; +HelloNamespace.world; + +//// [helloInterface.js] +define(["require", "exports"], function (require, exports) { + "use strict"; +}); +//// [helloNamespace.js] +define(["require", "exports"], function (require, exports) { + "use strict"; +}); +//// [world.js] +define(["require", "exports"], function (require, exports) { + "use strict"; + HelloInterface.world; + HelloNamespace.world; +}); diff --git a/tests/baselines/reference/typeVal.types b/tests/baselines/reference/typeVal.types index d9768a9fbf7..26944f231b2 100644 --- a/tests/baselines/reference/typeVal.types +++ b/tests/baselines/reference/typeVal.types @@ -11,13 +11,13 @@ var I:I = { I: 3}; >I : I >{ I: 3} : { I: number; } >I : number ->3 : number +>3 : 3 I.I=4; ->I.I=4 : number +>I.I=4 : 4 >I.I : number >I : I >I : number ->4 : number +>4 : 4 diff --git a/tests/baselines/reference/typecheckCommaExpression.errors.txt b/tests/baselines/reference/typecheckCommaExpression.errors.txt index 96c9d4be45c..35628050c60 100644 --- a/tests/baselines/reference/typecheckCommaExpression.errors.txt +++ b/tests/baselines/reference/typecheckCommaExpression.errors.txt @@ -1,10 +1,13 @@ tests/cases/compiler/typecheckCommaExpression.ts(1,2): error TS2304: Cannot find name 'a'. +tests/cases/compiler/typecheckCommaExpression.ts(1,2): error TS2695: Left side of comma operator is unused and has no side effects. tests/cases/compiler/typecheckCommaExpression.ts(1,5): error TS2304: Cannot find name 'b'. -==== tests/cases/compiler/typecheckCommaExpression.ts (2 errors) ==== +==== tests/cases/compiler/typecheckCommaExpression.ts (3 errors) ==== (a, b) ~ !!! error TS2304: Cannot find name 'a'. + ~ +!!! error TS2695: Left side of comma operator is unused and has no side effects. ~ !!! error TS2304: Cannot find name 'b'. \ No newline at end of file diff --git a/tests/baselines/reference/typedArrays.types b/tests/baselines/reference/typedArrays.types index f7d3cbdd19f..444d6a74e43 100644 --- a/tests/baselines/reference/typedArrays.types +++ b/tests/baselines/reference/typedArrays.types @@ -11,63 +11,63 @@ function CreateTypedArrayTypes() { >typedArrays[0] = Int8Array : Int8ArrayConstructor >typedArrays[0] : any >typedArrays : any[] ->0 : number +>0 : 0 >Int8Array : Int8ArrayConstructor typedArrays[1] = Uint8Array; >typedArrays[1] = Uint8Array : Uint8ArrayConstructor >typedArrays[1] : any >typedArrays : any[] ->1 : number +>1 : 1 >Uint8Array : Uint8ArrayConstructor typedArrays[2] = Int16Array; >typedArrays[2] = Int16Array : Int16ArrayConstructor >typedArrays[2] : any >typedArrays : any[] ->2 : number +>2 : 2 >Int16Array : Int16ArrayConstructor typedArrays[3] = Uint16Array; >typedArrays[3] = Uint16Array : Uint16ArrayConstructor >typedArrays[3] : any >typedArrays : any[] ->3 : number +>3 : 3 >Uint16Array : Uint16ArrayConstructor typedArrays[4] = Int32Array; >typedArrays[4] = Int32Array : Int32ArrayConstructor >typedArrays[4] : any >typedArrays : any[] ->4 : number +>4 : 4 >Int32Array : Int32ArrayConstructor typedArrays[5] = Uint32Array; >typedArrays[5] = Uint32Array : Uint32ArrayConstructor >typedArrays[5] : any >typedArrays : any[] ->5 : number +>5 : 5 >Uint32Array : Uint32ArrayConstructor typedArrays[6] = Float32Array; >typedArrays[6] = Float32Array : Float32ArrayConstructor >typedArrays[6] : any >typedArrays : any[] ->6 : number +>6 : 6 >Float32Array : Float32ArrayConstructor typedArrays[7] = Float64Array; >typedArrays[7] = Float64Array : Float64ArrayConstructor >typedArrays[7] : any >typedArrays : any[] ->7 : number +>7 : 7 >Float64Array : Float64ArrayConstructor typedArrays[8] = Uint8ClampedArray; >typedArrays[8] = Uint8ClampedArray : Uint8ClampedArrayConstructor >typedArrays[8] : any >typedArrays : any[] ->8 : number +>8 : 8 >Uint8ClampedArray : Uint8ClampedArrayConstructor return typedArrays; @@ -86,7 +86,7 @@ function CreateTypedArrayInstancesFromLength(obj: number) { >typedArrays[0] = new Int8Array(obj) : Int8Array >typedArrays[0] : any >typedArrays : any[] ->0 : number +>0 : 0 >new Int8Array(obj) : Int8Array >Int8Array : Int8ArrayConstructor >obj : number @@ -95,7 +95,7 @@ function CreateTypedArrayInstancesFromLength(obj: number) { >typedArrays[1] = new Uint8Array(obj) : Uint8Array >typedArrays[1] : any >typedArrays : any[] ->1 : number +>1 : 1 >new Uint8Array(obj) : Uint8Array >Uint8Array : Uint8ArrayConstructor >obj : number @@ -104,7 +104,7 @@ function CreateTypedArrayInstancesFromLength(obj: number) { >typedArrays[2] = new Int16Array(obj) : Int16Array >typedArrays[2] : any >typedArrays : any[] ->2 : number +>2 : 2 >new Int16Array(obj) : Int16Array >Int16Array : Int16ArrayConstructor >obj : number @@ -113,7 +113,7 @@ function CreateTypedArrayInstancesFromLength(obj: number) { >typedArrays[3] = new Uint16Array(obj) : Uint16Array >typedArrays[3] : any >typedArrays : any[] ->3 : number +>3 : 3 >new Uint16Array(obj) : Uint16Array >Uint16Array : Uint16ArrayConstructor >obj : number @@ -122,7 +122,7 @@ function CreateTypedArrayInstancesFromLength(obj: number) { >typedArrays[4] = new Int32Array(obj) : Int32Array >typedArrays[4] : any >typedArrays : any[] ->4 : number +>4 : 4 >new Int32Array(obj) : Int32Array >Int32Array : Int32ArrayConstructor >obj : number @@ -131,7 +131,7 @@ function CreateTypedArrayInstancesFromLength(obj: number) { >typedArrays[5] = new Uint32Array(obj) : Uint32Array >typedArrays[5] : any >typedArrays : any[] ->5 : number +>5 : 5 >new Uint32Array(obj) : Uint32Array >Uint32Array : Uint32ArrayConstructor >obj : number @@ -140,7 +140,7 @@ function CreateTypedArrayInstancesFromLength(obj: number) { >typedArrays[6] = new Float32Array(obj) : Float32Array >typedArrays[6] : any >typedArrays : any[] ->6 : number +>6 : 6 >new Float32Array(obj) : Float32Array >Float32Array : Float32ArrayConstructor >obj : number @@ -149,7 +149,7 @@ function CreateTypedArrayInstancesFromLength(obj: number) { >typedArrays[7] = new Float64Array(obj) : Float64Array >typedArrays[7] : any >typedArrays : any[] ->7 : number +>7 : 7 >new Float64Array(obj) : Float64Array >Float64Array : Float64ArrayConstructor >obj : number @@ -158,7 +158,7 @@ function CreateTypedArrayInstancesFromLength(obj: number) { >typedArrays[8] = new Uint8ClampedArray(obj) : Uint8ClampedArray >typedArrays[8] : any >typedArrays : any[] ->8 : number +>8 : 8 >new Uint8ClampedArray(obj) : Uint8ClampedArray >Uint8ClampedArray : Uint8ClampedArrayConstructor >obj : number @@ -179,7 +179,7 @@ function CreateTypedArrayInstancesFromArray(obj: number[]) { >typedArrays[0] = new Int8Array(obj) : Int8Array >typedArrays[0] : any >typedArrays : any[] ->0 : number +>0 : 0 >new Int8Array(obj) : Int8Array >Int8Array : Int8ArrayConstructor >obj : number[] @@ -188,7 +188,7 @@ function CreateTypedArrayInstancesFromArray(obj: number[]) { >typedArrays[1] = new Uint8Array(obj) : Uint8Array >typedArrays[1] : any >typedArrays : any[] ->1 : number +>1 : 1 >new Uint8Array(obj) : Uint8Array >Uint8Array : Uint8ArrayConstructor >obj : number[] @@ -197,7 +197,7 @@ function CreateTypedArrayInstancesFromArray(obj: number[]) { >typedArrays[2] = new Int16Array(obj) : Int16Array >typedArrays[2] : any >typedArrays : any[] ->2 : number +>2 : 2 >new Int16Array(obj) : Int16Array >Int16Array : Int16ArrayConstructor >obj : number[] @@ -206,7 +206,7 @@ function CreateTypedArrayInstancesFromArray(obj: number[]) { >typedArrays[3] = new Uint16Array(obj) : Uint16Array >typedArrays[3] : any >typedArrays : any[] ->3 : number +>3 : 3 >new Uint16Array(obj) : Uint16Array >Uint16Array : Uint16ArrayConstructor >obj : number[] @@ -215,7 +215,7 @@ function CreateTypedArrayInstancesFromArray(obj: number[]) { >typedArrays[4] = new Int32Array(obj) : Int32Array >typedArrays[4] : any >typedArrays : any[] ->4 : number +>4 : 4 >new Int32Array(obj) : Int32Array >Int32Array : Int32ArrayConstructor >obj : number[] @@ -224,7 +224,7 @@ function CreateTypedArrayInstancesFromArray(obj: number[]) { >typedArrays[5] = new Uint32Array(obj) : Uint32Array >typedArrays[5] : any >typedArrays : any[] ->5 : number +>5 : 5 >new Uint32Array(obj) : Uint32Array >Uint32Array : Uint32ArrayConstructor >obj : number[] @@ -233,7 +233,7 @@ function CreateTypedArrayInstancesFromArray(obj: number[]) { >typedArrays[6] = new Float32Array(obj) : Float32Array >typedArrays[6] : any >typedArrays : any[] ->6 : number +>6 : 6 >new Float32Array(obj) : Float32Array >Float32Array : Float32ArrayConstructor >obj : number[] @@ -242,7 +242,7 @@ function CreateTypedArrayInstancesFromArray(obj: number[]) { >typedArrays[7] = new Float64Array(obj) : Float64Array >typedArrays[7] : any >typedArrays : any[] ->7 : number +>7 : 7 >new Float64Array(obj) : Float64Array >Float64Array : Float64ArrayConstructor >obj : number[] @@ -251,7 +251,7 @@ function CreateTypedArrayInstancesFromArray(obj: number[]) { >typedArrays[8] = new Uint8ClampedArray(obj) : Uint8ClampedArray >typedArrays[8] : any >typedArrays : any[] ->8 : number +>8 : 8 >new Uint8ClampedArray(obj) : Uint8ClampedArray >Uint8ClampedArray : Uint8ClampedArrayConstructor >obj : number[] @@ -272,7 +272,7 @@ function CreateIntegerTypedArraysFromArray2(obj:number[]) { >typedArrays[0] = Int8Array.from(obj) : Int8Array >typedArrays[0] : any >typedArrays : any[] ->0 : number +>0 : 0 >Int8Array.from(obj) : Int8Array >Int8Array.from : { (arrayLike: ArrayLike, mapfn?: (v: number, k: number) => number, thisArg?: any): Int8Array; (arrayLike: Iterable, mapfn?: (v: number, k: number) => number, thisArg?: any): Int8Array; } >Int8Array : Int8ArrayConstructor @@ -283,7 +283,7 @@ function CreateIntegerTypedArraysFromArray2(obj:number[]) { >typedArrays[1] = Uint8Array.from(obj) : Uint8Array >typedArrays[1] : any >typedArrays : any[] ->1 : number +>1 : 1 >Uint8Array.from(obj) : Uint8Array >Uint8Array.from : { (arrayLike: ArrayLike, mapfn?: (v: number, k: number) => number, thisArg?: any): Uint8Array; (arrayLike: Iterable, mapfn?: (v: number, k: number) => number, thisArg?: any): Uint8Array; } >Uint8Array : Uint8ArrayConstructor @@ -294,7 +294,7 @@ function CreateIntegerTypedArraysFromArray2(obj:number[]) { >typedArrays[2] = Int16Array.from(obj) : Int16Array >typedArrays[2] : any >typedArrays : any[] ->2 : number +>2 : 2 >Int16Array.from(obj) : Int16Array >Int16Array.from : { (arrayLike: ArrayLike, mapfn?: (v: number, k: number) => number, thisArg?: any): Int16Array; (arrayLike: Iterable, mapfn?: (v: number, k: number) => number, thisArg?: any): Int16Array; } >Int16Array : Int16ArrayConstructor @@ -305,7 +305,7 @@ function CreateIntegerTypedArraysFromArray2(obj:number[]) { >typedArrays[3] = Uint16Array.from(obj) : Uint16Array >typedArrays[3] : any >typedArrays : any[] ->3 : number +>3 : 3 >Uint16Array.from(obj) : Uint16Array >Uint16Array.from : { (arrayLike: ArrayLike, mapfn?: (v: number, k: number) => number, thisArg?: any): Uint16Array; (arrayLike: Iterable, mapfn?: (v: number, k: number) => number, thisArg?: any): Uint16Array; } >Uint16Array : Uint16ArrayConstructor @@ -316,7 +316,7 @@ function CreateIntegerTypedArraysFromArray2(obj:number[]) { >typedArrays[4] = Int32Array.from(obj) : Int32Array >typedArrays[4] : any >typedArrays : any[] ->4 : number +>4 : 4 >Int32Array.from(obj) : Int32Array >Int32Array.from : { (arrayLike: ArrayLike, mapfn?: (v: number, k: number) => number, thisArg?: any): Int32Array; (arrayLike: Iterable, mapfn?: (v: number, k: number) => number, thisArg?: any): Int32Array; } >Int32Array : Int32ArrayConstructor @@ -327,7 +327,7 @@ function CreateIntegerTypedArraysFromArray2(obj:number[]) { >typedArrays[5] = Uint32Array.from(obj) : Uint32Array >typedArrays[5] : any >typedArrays : any[] ->5 : number +>5 : 5 >Uint32Array.from(obj) : Uint32Array >Uint32Array.from : { (arrayLike: ArrayLike, mapfn?: (v: number, k: number) => number, thisArg?: any): Uint32Array; (arrayLike: Iterable, mapfn?: (v: number, k: number) => number, thisArg?: any): Uint32Array; } >Uint32Array : Uint32ArrayConstructor @@ -338,7 +338,7 @@ function CreateIntegerTypedArraysFromArray2(obj:number[]) { >typedArrays[6] = Float32Array.from(obj) : Float32Array >typedArrays[6] : any >typedArrays : any[] ->6 : number +>6 : 6 >Float32Array.from(obj) : Float32Array >Float32Array.from : { (arrayLike: ArrayLike, mapfn?: (v: number, k: number) => number, thisArg?: any): Float32Array; (arrayLike: Iterable, mapfn?: (v: number, k: number) => number, thisArg?: any): Float32Array; } >Float32Array : Float32ArrayConstructor @@ -349,7 +349,7 @@ function CreateIntegerTypedArraysFromArray2(obj:number[]) { >typedArrays[7] = Float64Array.from(obj) : Float64Array >typedArrays[7] : any >typedArrays : any[] ->7 : number +>7 : 7 >Float64Array.from(obj) : Float64Array >Float64Array.from : { (arrayLike: ArrayLike, mapfn?: (v: number, k: number) => number, thisArg?: any): Float64Array; (arrayLike: Iterable, mapfn?: (v: number, k: number) => number, thisArg?: any): Float64Array; } >Float64Array : Float64ArrayConstructor @@ -360,7 +360,7 @@ function CreateIntegerTypedArraysFromArray2(obj:number[]) { >typedArrays[8] = Uint8ClampedArray.from(obj) : Uint8ClampedArray >typedArrays[8] : any >typedArrays : any[] ->8 : number +>8 : 8 >Uint8ClampedArray.from(obj) : Uint8ClampedArray >Uint8ClampedArray.from : { (arrayLike: ArrayLike, mapfn?: (v: number, k: number) => number, thisArg?: any): Uint8ClampedArray; (arrayLike: Iterable, mapfn?: (v: number, k: number) => number, thisArg?: any): Uint8ClampedArray; } >Uint8ClampedArray : Uint8ClampedArrayConstructor @@ -384,7 +384,7 @@ function CreateIntegerTypedArraysFromArrayLike(obj:ArrayLike) { >typedArrays[0] = Int8Array.from(obj) : Int8Array >typedArrays[0] : any >typedArrays : any[] ->0 : number +>0 : 0 >Int8Array.from(obj) : Int8Array >Int8Array.from : { (arrayLike: ArrayLike, mapfn?: (v: number, k: number) => number, thisArg?: any): Int8Array; (arrayLike: Iterable, mapfn?: (v: number, k: number) => number, thisArg?: any): Int8Array; } >Int8Array : Int8ArrayConstructor @@ -395,7 +395,7 @@ function CreateIntegerTypedArraysFromArrayLike(obj:ArrayLike) { >typedArrays[1] = Uint8Array.from(obj) : Uint8Array >typedArrays[1] : any >typedArrays : any[] ->1 : number +>1 : 1 >Uint8Array.from(obj) : Uint8Array >Uint8Array.from : { (arrayLike: ArrayLike, mapfn?: (v: number, k: number) => number, thisArg?: any): Uint8Array; (arrayLike: Iterable, mapfn?: (v: number, k: number) => number, thisArg?: any): Uint8Array; } >Uint8Array : Uint8ArrayConstructor @@ -406,7 +406,7 @@ function CreateIntegerTypedArraysFromArrayLike(obj:ArrayLike) { >typedArrays[2] = Int16Array.from(obj) : Int16Array >typedArrays[2] : any >typedArrays : any[] ->2 : number +>2 : 2 >Int16Array.from(obj) : Int16Array >Int16Array.from : { (arrayLike: ArrayLike, mapfn?: (v: number, k: number) => number, thisArg?: any): Int16Array; (arrayLike: Iterable, mapfn?: (v: number, k: number) => number, thisArg?: any): Int16Array; } >Int16Array : Int16ArrayConstructor @@ -417,7 +417,7 @@ function CreateIntegerTypedArraysFromArrayLike(obj:ArrayLike) { >typedArrays[3] = Uint16Array.from(obj) : Uint16Array >typedArrays[3] : any >typedArrays : any[] ->3 : number +>3 : 3 >Uint16Array.from(obj) : Uint16Array >Uint16Array.from : { (arrayLike: ArrayLike, mapfn?: (v: number, k: number) => number, thisArg?: any): Uint16Array; (arrayLike: Iterable, mapfn?: (v: number, k: number) => number, thisArg?: any): Uint16Array; } >Uint16Array : Uint16ArrayConstructor @@ -428,7 +428,7 @@ function CreateIntegerTypedArraysFromArrayLike(obj:ArrayLike) { >typedArrays[4] = Int32Array.from(obj) : Int32Array >typedArrays[4] : any >typedArrays : any[] ->4 : number +>4 : 4 >Int32Array.from(obj) : Int32Array >Int32Array.from : { (arrayLike: ArrayLike, mapfn?: (v: number, k: number) => number, thisArg?: any): Int32Array; (arrayLike: Iterable, mapfn?: (v: number, k: number) => number, thisArg?: any): Int32Array; } >Int32Array : Int32ArrayConstructor @@ -439,7 +439,7 @@ function CreateIntegerTypedArraysFromArrayLike(obj:ArrayLike) { >typedArrays[5] = Uint32Array.from(obj) : Uint32Array >typedArrays[5] : any >typedArrays : any[] ->5 : number +>5 : 5 >Uint32Array.from(obj) : Uint32Array >Uint32Array.from : { (arrayLike: ArrayLike, mapfn?: (v: number, k: number) => number, thisArg?: any): Uint32Array; (arrayLike: Iterable, mapfn?: (v: number, k: number) => number, thisArg?: any): Uint32Array; } >Uint32Array : Uint32ArrayConstructor @@ -450,7 +450,7 @@ function CreateIntegerTypedArraysFromArrayLike(obj:ArrayLike) { >typedArrays[6] = Float32Array.from(obj) : Float32Array >typedArrays[6] : any >typedArrays : any[] ->6 : number +>6 : 6 >Float32Array.from(obj) : Float32Array >Float32Array.from : { (arrayLike: ArrayLike, mapfn?: (v: number, k: number) => number, thisArg?: any): Float32Array; (arrayLike: Iterable, mapfn?: (v: number, k: number) => number, thisArg?: any): Float32Array; } >Float32Array : Float32ArrayConstructor @@ -461,7 +461,7 @@ function CreateIntegerTypedArraysFromArrayLike(obj:ArrayLike) { >typedArrays[7] = Float64Array.from(obj) : Float64Array >typedArrays[7] : any >typedArrays : any[] ->7 : number +>7 : 7 >Float64Array.from(obj) : Float64Array >Float64Array.from : { (arrayLike: ArrayLike, mapfn?: (v: number, k: number) => number, thisArg?: any): Float64Array; (arrayLike: Iterable, mapfn?: (v: number, k: number) => number, thisArg?: any): Float64Array; } >Float64Array : Float64ArrayConstructor @@ -472,7 +472,7 @@ function CreateIntegerTypedArraysFromArrayLike(obj:ArrayLike) { >typedArrays[8] = Uint8ClampedArray.from(obj) : Uint8ClampedArray >typedArrays[8] : any >typedArrays : any[] ->8 : number +>8 : 8 >Uint8ClampedArray.from(obj) : Uint8ClampedArray >Uint8ClampedArray.from : { (arrayLike: ArrayLike, mapfn?: (v: number, k: number) => number, thisArg?: any): Uint8ClampedArray; (arrayLike: Iterable, mapfn?: (v: number, k: number) => number, thisArg?: any): Uint8ClampedArray; } >Uint8ClampedArray : Uint8ClampedArrayConstructor @@ -495,7 +495,7 @@ function CreateTypedArraysOf(obj) { >typedArrays[0] = Int8Array.of(...obj) : Int8Array >typedArrays[0] : any >typedArrays : any[] ->0 : number +>0 : 0 >Int8Array.of(...obj) : Int8Array >Int8Array.of : (...items: number[]) => Int8Array >Int8Array : Int8ArrayConstructor @@ -507,7 +507,7 @@ function CreateTypedArraysOf(obj) { >typedArrays[1] = Uint8Array.of(...obj) : Uint8Array >typedArrays[1] : any >typedArrays : any[] ->1 : number +>1 : 1 >Uint8Array.of(...obj) : Uint8Array >Uint8Array.of : (...items: number[]) => Uint8Array >Uint8Array : Uint8ArrayConstructor @@ -519,7 +519,7 @@ function CreateTypedArraysOf(obj) { >typedArrays[2] = Int16Array.of(...obj) : Int16Array >typedArrays[2] : any >typedArrays : any[] ->2 : number +>2 : 2 >Int16Array.of(...obj) : Int16Array >Int16Array.of : (...items: number[]) => Int16Array >Int16Array : Int16ArrayConstructor @@ -531,7 +531,7 @@ function CreateTypedArraysOf(obj) { >typedArrays[3] = Uint16Array.of(...obj) : Uint16Array >typedArrays[3] : any >typedArrays : any[] ->3 : number +>3 : 3 >Uint16Array.of(...obj) : Uint16Array >Uint16Array.of : (...items: number[]) => Uint16Array >Uint16Array : Uint16ArrayConstructor @@ -543,7 +543,7 @@ function CreateTypedArraysOf(obj) { >typedArrays[4] = Int32Array.of(...obj) : Int32Array >typedArrays[4] : any >typedArrays : any[] ->4 : number +>4 : 4 >Int32Array.of(...obj) : Int32Array >Int32Array.of : (...items: number[]) => Int32Array >Int32Array : Int32ArrayConstructor @@ -555,7 +555,7 @@ function CreateTypedArraysOf(obj) { >typedArrays[5] = Uint32Array.of(...obj) : Uint32Array >typedArrays[5] : any >typedArrays : any[] ->5 : number +>5 : 5 >Uint32Array.of(...obj) : Uint32Array >Uint32Array.of : (...items: number[]) => Uint32Array >Uint32Array : Uint32ArrayConstructor @@ -567,7 +567,7 @@ function CreateTypedArraysOf(obj) { >typedArrays[6] = Float32Array.of(...obj) : Float32Array >typedArrays[6] : any >typedArrays : any[] ->6 : number +>6 : 6 >Float32Array.of(...obj) : Float32Array >Float32Array.of : (...items: number[]) => Float32Array >Float32Array : Float32ArrayConstructor @@ -579,7 +579,7 @@ function CreateTypedArraysOf(obj) { >typedArrays[7] = Float64Array.of(...obj) : Float64Array >typedArrays[7] : any >typedArrays : any[] ->7 : number +>7 : 7 >Float64Array.of(...obj) : Float64Array >Float64Array.of : (...items: number[]) => Float64Array >Float64Array : Float64ArrayConstructor @@ -591,7 +591,7 @@ function CreateTypedArraysOf(obj) { >typedArrays[8] = Uint8ClampedArray.of(...obj) : Uint8ClampedArray >typedArrays[8] : any >typedArrays : any[] ->8 : number +>8 : 8 >Uint8ClampedArray.of(...obj) : Uint8ClampedArray >Uint8ClampedArray.of : (...items: number[]) => Uint8ClampedArray >Uint8ClampedArray : Uint8ClampedArrayConstructor @@ -614,127 +614,127 @@ function CreateTypedArraysOf2() { >typedArrays[0] = Int8Array.of(1,2,3,4) : Int8Array >typedArrays[0] : any >typedArrays : any[] ->0 : number +>0 : 0 >Int8Array.of(1,2,3,4) : Int8Array >Int8Array.of : (...items: number[]) => Int8Array >Int8Array : Int8ArrayConstructor >of : (...items: number[]) => Int8Array ->1 : number ->2 : number ->3 : number ->4 : number +>1 : 1 +>2 : 2 +>3 : 3 +>4 : 4 typedArrays[1] = Uint8Array.of(1,2,3,4); >typedArrays[1] = Uint8Array.of(1,2,3,4) : Uint8Array >typedArrays[1] : any >typedArrays : any[] ->1 : number +>1 : 1 >Uint8Array.of(1,2,3,4) : Uint8Array >Uint8Array.of : (...items: number[]) => Uint8Array >Uint8Array : Uint8ArrayConstructor >of : (...items: number[]) => Uint8Array ->1 : number ->2 : number ->3 : number ->4 : number +>1 : 1 +>2 : 2 +>3 : 3 +>4 : 4 typedArrays[2] = Int16Array.of(1,2,3,4); >typedArrays[2] = Int16Array.of(1,2,3,4) : Int16Array >typedArrays[2] : any >typedArrays : any[] ->2 : number +>2 : 2 >Int16Array.of(1,2,3,4) : Int16Array >Int16Array.of : (...items: number[]) => Int16Array >Int16Array : Int16ArrayConstructor >of : (...items: number[]) => Int16Array ->1 : number ->2 : number ->3 : number ->4 : number +>1 : 1 +>2 : 2 +>3 : 3 +>4 : 4 typedArrays[3] = Uint16Array.of(1,2,3,4); >typedArrays[3] = Uint16Array.of(1,2,3,4) : Uint16Array >typedArrays[3] : any >typedArrays : any[] ->3 : number +>3 : 3 >Uint16Array.of(1,2,3,4) : Uint16Array >Uint16Array.of : (...items: number[]) => Uint16Array >Uint16Array : Uint16ArrayConstructor >of : (...items: number[]) => Uint16Array ->1 : number ->2 : number ->3 : number ->4 : number +>1 : 1 +>2 : 2 +>3 : 3 +>4 : 4 typedArrays[4] = Int32Array.of(1,2,3,4); >typedArrays[4] = Int32Array.of(1,2,3,4) : Int32Array >typedArrays[4] : any >typedArrays : any[] ->4 : number +>4 : 4 >Int32Array.of(1,2,3,4) : Int32Array >Int32Array.of : (...items: number[]) => Int32Array >Int32Array : Int32ArrayConstructor >of : (...items: number[]) => Int32Array ->1 : number ->2 : number ->3 : number ->4 : number +>1 : 1 +>2 : 2 +>3 : 3 +>4 : 4 typedArrays[5] = Uint32Array.of(1,2,3,4); >typedArrays[5] = Uint32Array.of(1,2,3,4) : Uint32Array >typedArrays[5] : any >typedArrays : any[] ->5 : number +>5 : 5 >Uint32Array.of(1,2,3,4) : Uint32Array >Uint32Array.of : (...items: number[]) => Uint32Array >Uint32Array : Uint32ArrayConstructor >of : (...items: number[]) => Uint32Array ->1 : number ->2 : number ->3 : number ->4 : number +>1 : 1 +>2 : 2 +>3 : 3 +>4 : 4 typedArrays[6] = Float32Array.of(1,2,3,4); >typedArrays[6] = Float32Array.of(1,2,3,4) : Float32Array >typedArrays[6] : any >typedArrays : any[] ->6 : number +>6 : 6 >Float32Array.of(1,2,3,4) : Float32Array >Float32Array.of : (...items: number[]) => Float32Array >Float32Array : Float32ArrayConstructor >of : (...items: number[]) => Float32Array ->1 : number ->2 : number ->3 : number ->4 : number +>1 : 1 +>2 : 2 +>3 : 3 +>4 : 4 typedArrays[7] = Float64Array.of(1,2,3,4); >typedArrays[7] = Float64Array.of(1,2,3,4) : Float64Array >typedArrays[7] : any >typedArrays : any[] ->7 : number +>7 : 7 >Float64Array.of(1,2,3,4) : Float64Array >Float64Array.of : (...items: number[]) => Float64Array >Float64Array : Float64ArrayConstructor >of : (...items: number[]) => Float64Array ->1 : number ->2 : number ->3 : number ->4 : number +>1 : 1 +>2 : 2 +>3 : 3 +>4 : 4 typedArrays[8] = Uint8ClampedArray.of(1,2,3,4); >typedArrays[8] = Uint8ClampedArray.of(1,2,3,4) : Uint8ClampedArray >typedArrays[8] : any >typedArrays : any[] ->8 : number +>8 : 8 >Uint8ClampedArray.of(1,2,3,4) : Uint8ClampedArray >Uint8ClampedArray.of : (...items: number[]) => Uint8ClampedArray >Uint8ClampedArray : Uint8ClampedArrayConstructor >of : (...items: number[]) => Uint8ClampedArray ->1 : number ->2 : number ->3 : number ->4 : number +>1 : 1 +>2 : 2 +>3 : 3 +>4 : 4 return typedArrays; >typedArrays : any[] @@ -756,7 +756,7 @@ function CreateTypedArraysFromMapFn(obj:ArrayLike, mapFn: (n:number, v:n >typedArrays[0] = Int8Array.from(obj, mapFn) : Int8Array >typedArrays[0] : any >typedArrays : any[] ->0 : number +>0 : 0 >Int8Array.from(obj, mapFn) : Int8Array >Int8Array.from : { (arrayLike: ArrayLike, mapfn?: (v: number, k: number) => number, thisArg?: any): Int8Array; (arrayLike: Iterable, mapfn?: (v: number, k: number) => number, thisArg?: any): Int8Array; } >Int8Array : Int8ArrayConstructor @@ -768,7 +768,7 @@ function CreateTypedArraysFromMapFn(obj:ArrayLike, mapFn: (n:number, v:n >typedArrays[1] = Uint8Array.from(obj, mapFn) : Uint8Array >typedArrays[1] : any >typedArrays : any[] ->1 : number +>1 : 1 >Uint8Array.from(obj, mapFn) : Uint8Array >Uint8Array.from : { (arrayLike: ArrayLike, mapfn?: (v: number, k: number) => number, thisArg?: any): Uint8Array; (arrayLike: Iterable, mapfn?: (v: number, k: number) => number, thisArg?: any): Uint8Array; } >Uint8Array : Uint8ArrayConstructor @@ -780,7 +780,7 @@ function CreateTypedArraysFromMapFn(obj:ArrayLike, mapFn: (n:number, v:n >typedArrays[2] = Int16Array.from(obj, mapFn) : Int16Array >typedArrays[2] : any >typedArrays : any[] ->2 : number +>2 : 2 >Int16Array.from(obj, mapFn) : Int16Array >Int16Array.from : { (arrayLike: ArrayLike, mapfn?: (v: number, k: number) => number, thisArg?: any): Int16Array; (arrayLike: Iterable, mapfn?: (v: number, k: number) => number, thisArg?: any): Int16Array; } >Int16Array : Int16ArrayConstructor @@ -792,7 +792,7 @@ function CreateTypedArraysFromMapFn(obj:ArrayLike, mapFn: (n:number, v:n >typedArrays[3] = Uint16Array.from(obj, mapFn) : Uint16Array >typedArrays[3] : any >typedArrays : any[] ->3 : number +>3 : 3 >Uint16Array.from(obj, mapFn) : Uint16Array >Uint16Array.from : { (arrayLike: ArrayLike, mapfn?: (v: number, k: number) => number, thisArg?: any): Uint16Array; (arrayLike: Iterable, mapfn?: (v: number, k: number) => number, thisArg?: any): Uint16Array; } >Uint16Array : Uint16ArrayConstructor @@ -804,7 +804,7 @@ function CreateTypedArraysFromMapFn(obj:ArrayLike, mapFn: (n:number, v:n >typedArrays[4] = Int32Array.from(obj, mapFn) : Int32Array >typedArrays[4] : any >typedArrays : any[] ->4 : number +>4 : 4 >Int32Array.from(obj, mapFn) : Int32Array >Int32Array.from : { (arrayLike: ArrayLike, mapfn?: (v: number, k: number) => number, thisArg?: any): Int32Array; (arrayLike: Iterable, mapfn?: (v: number, k: number) => number, thisArg?: any): Int32Array; } >Int32Array : Int32ArrayConstructor @@ -816,7 +816,7 @@ function CreateTypedArraysFromMapFn(obj:ArrayLike, mapFn: (n:number, v:n >typedArrays[5] = Uint32Array.from(obj, mapFn) : Uint32Array >typedArrays[5] : any >typedArrays : any[] ->5 : number +>5 : 5 >Uint32Array.from(obj, mapFn) : Uint32Array >Uint32Array.from : { (arrayLike: ArrayLike, mapfn?: (v: number, k: number) => number, thisArg?: any): Uint32Array; (arrayLike: Iterable, mapfn?: (v: number, k: number) => number, thisArg?: any): Uint32Array; } >Uint32Array : Uint32ArrayConstructor @@ -828,7 +828,7 @@ function CreateTypedArraysFromMapFn(obj:ArrayLike, mapFn: (n:number, v:n >typedArrays[6] = Float32Array.from(obj, mapFn) : Float32Array >typedArrays[6] : any >typedArrays : any[] ->6 : number +>6 : 6 >Float32Array.from(obj, mapFn) : Float32Array >Float32Array.from : { (arrayLike: ArrayLike, mapfn?: (v: number, k: number) => number, thisArg?: any): Float32Array; (arrayLike: Iterable, mapfn?: (v: number, k: number) => number, thisArg?: any): Float32Array; } >Float32Array : Float32ArrayConstructor @@ -840,7 +840,7 @@ function CreateTypedArraysFromMapFn(obj:ArrayLike, mapFn: (n:number, v:n >typedArrays[7] = Float64Array.from(obj, mapFn) : Float64Array >typedArrays[7] : any >typedArrays : any[] ->7 : number +>7 : 7 >Float64Array.from(obj, mapFn) : Float64Array >Float64Array.from : { (arrayLike: ArrayLike, mapfn?: (v: number, k: number) => number, thisArg?: any): Float64Array; (arrayLike: Iterable, mapfn?: (v: number, k: number) => number, thisArg?: any): Float64Array; } >Float64Array : Float64ArrayConstructor @@ -852,7 +852,7 @@ function CreateTypedArraysFromMapFn(obj:ArrayLike, mapFn: (n:number, v:n >typedArrays[8] = Uint8ClampedArray.from(obj, mapFn) : Uint8ClampedArray >typedArrays[8] : any >typedArrays : any[] ->8 : number +>8 : 8 >Uint8ClampedArray.from(obj, mapFn) : Uint8ClampedArray >Uint8ClampedArray.from : { (arrayLike: ArrayLike, mapfn?: (v: number, k: number) => number, thisArg?: any): Uint8ClampedArray; (arrayLike: Iterable, mapfn?: (v: number, k: number) => number, thisArg?: any): Uint8ClampedArray; } >Uint8ClampedArray : Uint8ClampedArrayConstructor @@ -881,7 +881,7 @@ function CreateTypedArraysFromThisObj(obj:ArrayLike, mapFn: (n:number, v >typedArrays[0] = Int8Array.from(obj, mapFn, thisArg) : Int8Array >typedArrays[0] : any >typedArrays : any[] ->0 : number +>0 : 0 >Int8Array.from(obj, mapFn, thisArg) : Int8Array >Int8Array.from : { (arrayLike: ArrayLike, mapfn?: (v: number, k: number) => number, thisArg?: any): Int8Array; (arrayLike: Iterable, mapfn?: (v: number, k: number) => number, thisArg?: any): Int8Array; } >Int8Array : Int8ArrayConstructor @@ -894,7 +894,7 @@ function CreateTypedArraysFromThisObj(obj:ArrayLike, mapFn: (n:number, v >typedArrays[1] = Uint8Array.from(obj, mapFn, thisArg) : Uint8Array >typedArrays[1] : any >typedArrays : any[] ->1 : number +>1 : 1 >Uint8Array.from(obj, mapFn, thisArg) : Uint8Array >Uint8Array.from : { (arrayLike: ArrayLike, mapfn?: (v: number, k: number) => number, thisArg?: any): Uint8Array; (arrayLike: Iterable, mapfn?: (v: number, k: number) => number, thisArg?: any): Uint8Array; } >Uint8Array : Uint8ArrayConstructor @@ -907,7 +907,7 @@ function CreateTypedArraysFromThisObj(obj:ArrayLike, mapFn: (n:number, v >typedArrays[2] = Int16Array.from(obj, mapFn, thisArg) : Int16Array >typedArrays[2] : any >typedArrays : any[] ->2 : number +>2 : 2 >Int16Array.from(obj, mapFn, thisArg) : Int16Array >Int16Array.from : { (arrayLike: ArrayLike, mapfn?: (v: number, k: number) => number, thisArg?: any): Int16Array; (arrayLike: Iterable, mapfn?: (v: number, k: number) => number, thisArg?: any): Int16Array; } >Int16Array : Int16ArrayConstructor @@ -920,7 +920,7 @@ function CreateTypedArraysFromThisObj(obj:ArrayLike, mapFn: (n:number, v >typedArrays[3] = Uint16Array.from(obj, mapFn, thisArg) : Uint16Array >typedArrays[3] : any >typedArrays : any[] ->3 : number +>3 : 3 >Uint16Array.from(obj, mapFn, thisArg) : Uint16Array >Uint16Array.from : { (arrayLike: ArrayLike, mapfn?: (v: number, k: number) => number, thisArg?: any): Uint16Array; (arrayLike: Iterable, mapfn?: (v: number, k: number) => number, thisArg?: any): Uint16Array; } >Uint16Array : Uint16ArrayConstructor @@ -933,7 +933,7 @@ function CreateTypedArraysFromThisObj(obj:ArrayLike, mapFn: (n:number, v >typedArrays[4] = Int32Array.from(obj, mapFn, thisArg) : Int32Array >typedArrays[4] : any >typedArrays : any[] ->4 : number +>4 : 4 >Int32Array.from(obj, mapFn, thisArg) : Int32Array >Int32Array.from : { (arrayLike: ArrayLike, mapfn?: (v: number, k: number) => number, thisArg?: any): Int32Array; (arrayLike: Iterable, mapfn?: (v: number, k: number) => number, thisArg?: any): Int32Array; } >Int32Array : Int32ArrayConstructor @@ -946,7 +946,7 @@ function CreateTypedArraysFromThisObj(obj:ArrayLike, mapFn: (n:number, v >typedArrays[5] = Uint32Array.from(obj, mapFn, thisArg) : Uint32Array >typedArrays[5] : any >typedArrays : any[] ->5 : number +>5 : 5 >Uint32Array.from(obj, mapFn, thisArg) : Uint32Array >Uint32Array.from : { (arrayLike: ArrayLike, mapfn?: (v: number, k: number) => number, thisArg?: any): Uint32Array; (arrayLike: Iterable, mapfn?: (v: number, k: number) => number, thisArg?: any): Uint32Array; } >Uint32Array : Uint32ArrayConstructor @@ -959,7 +959,7 @@ function CreateTypedArraysFromThisObj(obj:ArrayLike, mapFn: (n:number, v >typedArrays[6] = Float32Array.from(obj, mapFn, thisArg) : Float32Array >typedArrays[6] : any >typedArrays : any[] ->6 : number +>6 : 6 >Float32Array.from(obj, mapFn, thisArg) : Float32Array >Float32Array.from : { (arrayLike: ArrayLike, mapfn?: (v: number, k: number) => number, thisArg?: any): Float32Array; (arrayLike: Iterable, mapfn?: (v: number, k: number) => number, thisArg?: any): Float32Array; } >Float32Array : Float32ArrayConstructor @@ -972,7 +972,7 @@ function CreateTypedArraysFromThisObj(obj:ArrayLike, mapFn: (n:number, v >typedArrays[7] = Float64Array.from(obj, mapFn, thisArg) : Float64Array >typedArrays[7] : any >typedArrays : any[] ->7 : number +>7 : 7 >Float64Array.from(obj, mapFn, thisArg) : Float64Array >Float64Array.from : { (arrayLike: ArrayLike, mapfn?: (v: number, k: number) => number, thisArg?: any): Float64Array; (arrayLike: Iterable, mapfn?: (v: number, k: number) => number, thisArg?: any): Float64Array; } >Float64Array : Float64ArrayConstructor @@ -985,7 +985,7 @@ function CreateTypedArraysFromThisObj(obj:ArrayLike, mapFn: (n:number, v >typedArrays[8] = Uint8ClampedArray.from(obj, mapFn, thisArg) : Uint8ClampedArray >typedArrays[8] : any >typedArrays : any[] ->8 : number +>8 : 8 >Uint8ClampedArray.from(obj, mapFn, thisArg) : Uint8ClampedArray >Uint8ClampedArray.from : { (arrayLike: ArrayLike, mapfn?: (v: number, k: number) => number, thisArg?: any): Uint8ClampedArray; (arrayLike: Iterable, mapfn?: (v: number, k: number) => number, thisArg?: any): Uint8ClampedArray; } >Uint8ClampedArray : Uint8ClampedArrayConstructor diff --git a/tests/baselines/reference/typedGenericPrototypeMember.types b/tests/baselines/reference/typedGenericPrototypeMember.types index 9e3f064de0d..b772c3be680 100644 --- a/tests/baselines/reference/typedGenericPrototypeMember.types +++ b/tests/baselines/reference/typedGenericPrototypeMember.types @@ -16,5 +16,5 @@ List.prototype.add("abc"); // Valid because T is instantiated to any >List : typeof List >prototype : List >add : (item: any) => void ->"abc" : string +>"abc" : "abc" diff --git a/tests/baselines/reference/typeofEnum.types b/tests/baselines/reference/typeofEnum.types index 2140bfa175b..9026e664c14 100644 --- a/tests/baselines/reference/typeofEnum.types +++ b/tests/baselines/reference/typeofEnum.types @@ -3,10 +3,10 @@ enum E { >E : E e1, ->e1 : E +>e1 : E.e1 e2 ->e2 : E +>e2 : E.e2 } var e1: typeof E; @@ -14,7 +14,7 @@ var e1: typeof E; >E : typeof E e1.e1; ->e1.e1 : E +>e1.e1 : E.e1 >e1 : typeof E ->e1 : E +>e1 : E.e1 diff --git a/tests/baselines/reference/typeofInterface.types b/tests/baselines/reference/typeofInterface.types index 70e3cfe6926..fad9b029004 100644 --- a/tests/baselines/reference/typeofInterface.types +++ b/tests/baselines/reference/typeofInterface.types @@ -25,5 +25,5 @@ var j: typeof k.foo = { a: "hello" }; >foo : { a: string; } >{ a: "hello" } : { a: string; } >a : string ->"hello" : string +>"hello" : "hello" diff --git a/tests/baselines/reference/typeofModuleWithoutExports.types b/tests/baselines/reference/typeofModuleWithoutExports.types index e0f29156c53..764a6c1df33 100644 --- a/tests/baselines/reference/typeofModuleWithoutExports.types +++ b/tests/baselines/reference/typeofModuleWithoutExports.types @@ -4,7 +4,7 @@ module M { var x = 1; >x : number ->1 : number +>1 : 1 class C { >C : C diff --git a/tests/baselines/reference/typeofOperatorWithAnyOtherType.errors.txt b/tests/baselines/reference/typeofOperatorWithAnyOtherType.errors.txt index f9394c622c0..94bca545609 100644 --- a/tests/baselines/reference/typeofOperatorWithAnyOtherType.errors.txt +++ b/tests/baselines/reference/typeofOperatorWithAnyOtherType.errors.txt @@ -1,6 +1,7 @@ tests/cases/conformance/expressions/unaryOperators/typeofOperator/typeofOperatorWithAnyOtherType.ts(46,32): error TS2365: Operator '+' cannot be applied to types 'undefined' and 'undefined'. tests/cases/conformance/expressions/unaryOperators/typeofOperator/typeofOperatorWithAnyOtherType.ts(47,32): error TS2365: Operator '+' cannot be applied to types 'null' and 'null'. tests/cases/conformance/expressions/unaryOperators/typeofOperator/typeofOperatorWithAnyOtherType.ts(48,32): error TS2365: Operator '+' cannot be applied to types 'undefined' and 'undefined'. +tests/cases/conformance/expressions/unaryOperators/typeofOperator/typeofOperatorWithAnyOtherType.ts(58,1): error TS2695: Left side of comma operator is unused and has no side effects. tests/cases/conformance/expressions/unaryOperators/typeofOperator/typeofOperatorWithAnyOtherType.ts(68,1): error TS7028: Unused label. tests/cases/conformance/expressions/unaryOperators/typeofOperator/typeofOperatorWithAnyOtherType.ts(69,1): error TS7028: Unused label. tests/cases/conformance/expressions/unaryOperators/typeofOperator/typeofOperatorWithAnyOtherType.ts(70,1): error TS7028: Unused label. @@ -10,7 +11,7 @@ tests/cases/conformance/expressions/unaryOperators/typeofOperator/typeofOperator tests/cases/conformance/expressions/unaryOperators/typeofOperator/typeofOperatorWithAnyOtherType.ts(74,1): error TS7028: Unused label. -==== tests/cases/conformance/expressions/unaryOperators/typeofOperator/typeofOperatorWithAnyOtherType.ts (10 errors) ==== +==== tests/cases/conformance/expressions/unaryOperators/typeofOperator/typeofOperatorWithAnyOtherType.ts (11 errors) ==== // typeof operator on any type var ANY: any; @@ -75,6 +76,8 @@ tests/cases/conformance/expressions/unaryOperators/typeofOperator/typeofOperator typeof ANY1; typeof ANY2[0]; typeof ANY, ANY1; + ~~~~~~~~~~ +!!! error TS2695: Left side of comma operator is unused and has no side effects. typeof obj1; typeof obj1.x; typeof objA.a; diff --git a/tests/baselines/reference/typeofOperatorWithBooleanType.errors.txt b/tests/baselines/reference/typeofOperatorWithBooleanType.errors.txt new file mode 100644 index 00000000000..48c75a32e9a --- /dev/null +++ b/tests/baselines/reference/typeofOperatorWithBooleanType.errors.txt @@ -0,0 +1,57 @@ +tests/cases/conformance/expressions/unaryOperators/typeofOperator/typeofOperatorWithBooleanType.ts(37,1): error TS2695: Left side of comma operator is unused and has no side effects. + + +==== tests/cases/conformance/expressions/unaryOperators/typeofOperator/typeofOperatorWithBooleanType.ts (1 errors) ==== + + // typeof operator on boolean type + var BOOLEAN: boolean; + + function foo(): boolean { return true; } + + class A { + public a: boolean; + static foo() { return false; } + } + module M { + export var n: boolean; + } + + var objA = new A(); + + // boolean type var + var ResultIsString1 = typeof BOOLEAN; + + // boolean type literal + var ResultIsString2 = typeof true; + var ResultIsString3 = typeof { x: true, y: false }; + + // boolean type expressions + var ResultIsString4 = typeof objA.a; + var ResultIsString5 = typeof M.n; + var ResultIsString6 = typeof foo(); + var ResultIsString7 = typeof A.foo(); + + // multiple typeof operator + var ResultIsString8 = typeof typeof BOOLEAN; + + // miss assignment operators + typeof true; + typeof BOOLEAN; + typeof foo(); + typeof true, false; + ~~~~~~~~~~~ +!!! error TS2695: Left side of comma operator is unused and has no side effects. + typeof objA.a; + typeof M.n; + + // use typeof in type query + var z: boolean; + var x: boolean[]; + var r: () => boolean; + z: typeof BOOLEAN; + r: typeof foo; + var y = { a: true, b: false}; + z: typeof y.a; + z: typeof objA.a; + z: typeof A.foo; + z: typeof M.n; \ No newline at end of file diff --git a/tests/baselines/reference/typeofOperatorWithBooleanType.types b/tests/baselines/reference/typeofOperatorWithBooleanType.types index 043307cfb00..a1a01c3f61f 100644 --- a/tests/baselines/reference/typeofOperatorWithBooleanType.types +++ b/tests/baselines/reference/typeofOperatorWithBooleanType.types @@ -6,7 +6,7 @@ var BOOLEAN: boolean; function foo(): boolean { return true; } >foo : () => boolean ->true : boolean +>true : true class A { >A : A @@ -16,7 +16,7 @@ class A { static foo() { return false; } >foo : () => boolean ->false : boolean +>false : false } module M { >M : typeof M @@ -40,16 +40,16 @@ var ResultIsString1 = typeof BOOLEAN; var ResultIsString2 = typeof true; >ResultIsString2 : string >typeof true : string ->true : boolean +>true : true var ResultIsString3 = typeof { x: true, y: false }; >ResultIsString3 : string >typeof { x: true, y: false } : string >{ x: true, y: false } : { x: boolean; y: boolean; } >x : boolean ->true : boolean +>true : true >y : boolean ->false : boolean +>false : false // boolean type expressions var ResultIsString4 = typeof objA.a; @@ -90,7 +90,7 @@ var ResultIsString8 = typeof typeof BOOLEAN; // miss assignment operators typeof true; >typeof true : string ->true : boolean +>true : true typeof BOOLEAN; >typeof BOOLEAN : string @@ -102,10 +102,10 @@ typeof foo(); >foo : () => boolean typeof true, false; ->typeof true, false : boolean +>typeof true, false : false >typeof true : string ->true : boolean ->false : boolean +>true : true +>false : false typeof objA.a; >typeof objA.a : string @@ -143,9 +143,9 @@ var y = { a: true, b: false}; >y : { a: boolean; b: boolean; } >{ a: true, b: false} : { a: boolean; b: boolean; } >a : boolean ->true : boolean +>true : true >b : boolean ->false : boolean +>false : false z: typeof y.a; >z : any diff --git a/tests/baselines/reference/typeofOperatorWithEnumType.errors.txt b/tests/baselines/reference/typeofOperatorWithEnumType.errors.txt new file mode 100644 index 00000000000..f078b9ed5b0 --- /dev/null +++ b/tests/baselines/reference/typeofOperatorWithEnumType.errors.txt @@ -0,0 +1,34 @@ +tests/cases/conformance/expressions/unaryOperators/typeofOperator/typeofOperatorWithEnumType.ts(23,1): error TS2695: Left side of comma operator is unused and has no side effects. + + +==== tests/cases/conformance/expressions/unaryOperators/typeofOperator/typeofOperatorWithEnumType.ts (1 errors) ==== + + // typeof operator on enum type + + enum ENUM { }; + enum ENUM1 { A, B, "" }; + + // enum type var + var ResultIsString1 = typeof ENUM; + var ResultIsString2 = typeof ENUM1; + + // enum type expressions + var ResultIsString3 = typeof ENUM1["A"]; + var ResultIsString4 = typeof (ENUM[0] + ENUM1["B"]); + + // multiple typeof operators + var ResultIsString5 = typeof typeof ENUM; + var ResultIsString6 = typeof typeof typeof (ENUM[0] + ENUM1.B); + + // miss assignment operators + typeof ENUM; + typeof ENUM1; + typeof ENUM1["B"]; + typeof ENUM, ENUM1; + ~~~~~~~~~~~ +!!! error TS2695: Left side of comma operator is unused and has no side effects. + + // use typeof in type query + enum z { }; + z: typeof ENUM; + z: typeof ENUM1; \ No newline at end of file diff --git a/tests/baselines/reference/typeofOperatorWithEnumType.types b/tests/baselines/reference/typeofOperatorWithEnumType.types index f9224811393..ec147bce889 100644 --- a/tests/baselines/reference/typeofOperatorWithEnumType.types +++ b/tests/baselines/reference/typeofOperatorWithEnumType.types @@ -7,8 +7,8 @@ enum ENUM { }; enum ENUM1 { A, B, "" }; >ENUM1 : ENUM1 ->A : ENUM1 ->B : ENUM1 +>A : ENUM1.A +>B : ENUM1.B // enum type var var ResultIsString1 = typeof ENUM; @@ -25,9 +25,9 @@ var ResultIsString2 = typeof ENUM1; var ResultIsString3 = typeof ENUM1["A"]; >ResultIsString3 : string >typeof ENUM1["A"] : string ->ENUM1["A"] : ENUM1 +>ENUM1["A"] : ENUM1.A >ENUM1 : typeof ENUM1 ->"A" : string +>"A" : "A" var ResultIsString4 = typeof (ENUM[0] + ENUM1["B"]); >ResultIsString4 : string @@ -36,10 +36,10 @@ var ResultIsString4 = typeof (ENUM[0] + ENUM1["B"]); >ENUM[0] + ENUM1["B"] : string >ENUM[0] : string >ENUM : typeof ENUM ->0 : number ->ENUM1["B"] : ENUM1 +>0 : 0 +>ENUM1["B"] : ENUM1.B >ENUM1 : typeof ENUM1 ->"B" : string +>"B" : "B" // multiple typeof operators var ResultIsString5 = typeof typeof ENUM; @@ -57,10 +57,10 @@ var ResultIsString6 = typeof typeof typeof (ENUM[0] + ENUM1.B); >ENUM[0] + ENUM1.B : string >ENUM[0] : string >ENUM : typeof ENUM ->0 : number ->ENUM1.B : ENUM1 +>0 : 0 +>ENUM1.B : ENUM1.B >ENUM1 : typeof ENUM1 ->B : ENUM1 +>B : ENUM1.B // miss assignment operators typeof ENUM; @@ -73,9 +73,9 @@ typeof ENUM1; typeof ENUM1["B"]; >typeof ENUM1["B"] : string ->ENUM1["B"] : ENUM1 +>ENUM1["B"] : ENUM1.B >ENUM1 : typeof ENUM1 ->"B" : string +>"B" : "B" typeof ENUM, ENUM1; >typeof ENUM, ENUM1 : typeof ENUM1 diff --git a/tests/baselines/reference/typeofOperatorWithNumberType.errors.txt b/tests/baselines/reference/typeofOperatorWithNumberType.errors.txt new file mode 100644 index 00000000000..e9cb922ed0b --- /dev/null +++ b/tests/baselines/reference/typeofOperatorWithNumberType.errors.txt @@ -0,0 +1,63 @@ +tests/cases/conformance/expressions/unaryOperators/typeofOperator/typeofOperatorWithNumberType.ts(45,1): error TS2695: Left side of comma operator is unused and has no side effects. + + +==== tests/cases/conformance/expressions/unaryOperators/typeofOperator/typeofOperatorWithNumberType.ts (1 errors) ==== + // typeof operator on number type + var NUMBER: number; + var NUMBER1: number[] = [1, 2]; + + function foo(): number { return 1; } + + class A { + public a: number; + static foo() { return 1; } + } + module M { + export var n: number; + } + + var objA = new A(); + + // number type var + var ResultIsString1 = typeof NUMBER; + var ResultIsString2 = typeof NUMBER1; + + // number type literal + var ResultIsString3 = typeof 1; + var ResultIsString4 = typeof { x: 1, y: 2}; + var ResultIsString5 = typeof { x: 1, y: (n: number) => { return n; } }; + + // number type expressions + var ResultIsString6 = typeof objA.a; + var ResultIsString7 = typeof M.n; + var ResultIsString8 = typeof NUMBER1[0]; + var ResultIsString9 = typeof foo(); + var ResultIsString10 = typeof A.foo(); + var ResultIsString11 = typeof (NUMBER + NUMBER); + + // multiple typeof operators + var ResultIsString12 = typeof typeof NUMBER; + var ResultIsString13 = typeof typeof typeof (NUMBER + NUMBER); + + // miss assignment operators + typeof 1; + typeof NUMBER; + typeof NUMBER1; + typeof foo(); + typeof objA.a; + typeof M.n; + typeof objA.a, M.n; + ~~~~~~~~~~~~~ +!!! error TS2695: Left side of comma operator is unused and has no side effects. + + // use typeof in type query + var z: number; + var x: number[]; + z: typeof NUMBER; + x: typeof NUMBER1; + r: typeof foo; + var y = { a: 1, b: 2 }; + z: typeof y.a; + z: typeof objA.a; + z: typeof A.foo; + z: typeof M.n; \ No newline at end of file diff --git a/tests/baselines/reference/typeofOperatorWithNumberType.types b/tests/baselines/reference/typeofOperatorWithNumberType.types index b80e6b1d4a8..d497257d636 100644 --- a/tests/baselines/reference/typeofOperatorWithNumberType.types +++ b/tests/baselines/reference/typeofOperatorWithNumberType.types @@ -6,12 +6,12 @@ var NUMBER: number; var NUMBER1: number[] = [1, 2]; >NUMBER1 : number[] >[1, 2] : number[] ->1 : number ->2 : number +>1 : 1 +>2 : 2 function foo(): number { return 1; } >foo : () => number ->1 : number +>1 : 1 class A { >A : A @@ -21,7 +21,7 @@ class A { static foo() { return 1; } >foo : () => number ->1 : number +>1 : 1 } module M { >M : typeof M @@ -50,23 +50,23 @@ var ResultIsString2 = typeof NUMBER1; var ResultIsString3 = typeof 1; >ResultIsString3 : string >typeof 1 : string ->1 : number +>1 : 1 var ResultIsString4 = typeof { x: 1, y: 2}; >ResultIsString4 : string >typeof { x: 1, y: 2} : string >{ x: 1, y: 2} : { x: number; y: number; } >x : number ->1 : number +>1 : 1 >y : number ->2 : number +>2 : 2 var ResultIsString5 = typeof { x: 1, y: (n: number) => { return n; } }; >ResultIsString5 : string >typeof { x: 1, y: (n: number) => { return n; } } : string >{ x: 1, y: (n: number) => { return n; } } : { x: number; y: (n: number) => number; } >x : number ->1 : number +>1 : 1 >y : (n: number) => number >(n: number) => { return n; } : (n: number) => number >n : number @@ -92,7 +92,7 @@ var ResultIsString8 = typeof NUMBER1[0]; >typeof NUMBER1[0] : string >NUMBER1[0] : number >NUMBER1 : number[] ->0 : number +>0 : 0 var ResultIsString9 = typeof foo(); >ResultIsString9 : string @@ -136,7 +136,7 @@ var ResultIsString13 = typeof typeof typeof (NUMBER + NUMBER); // miss assignment operators typeof 1; >typeof 1 : string ->1 : number +>1 : 1 typeof NUMBER; >typeof NUMBER : string @@ -199,9 +199,9 @@ var y = { a: 1, b: 2 }; >y : { a: number; b: number; } >{ a: 1, b: 2 } : { a: number; b: number; } >a : number ->1 : number +>1 : 1 >b : number ->2 : number +>2 : 2 z: typeof y.a; >z : any diff --git a/tests/baselines/reference/typeofOperatorWithStringType.errors.txt b/tests/baselines/reference/typeofOperatorWithStringType.errors.txt index bd891c949a3..6d01d397ab6 100644 --- a/tests/baselines/reference/typeofOperatorWithStringType.errors.txt +++ b/tests/baselines/reference/typeofOperatorWithStringType.errors.txt @@ -1,3 +1,4 @@ +tests/cases/conformance/expressions/unaryOperators/typeofOperator/typeofOperatorWithStringType.ts(44,1): error TS2695: Left side of comma operator is unused and has no side effects. tests/cases/conformance/expressions/unaryOperators/typeofOperator/typeofOperatorWithStringType.ts(50,1): error TS7028: Unused label. tests/cases/conformance/expressions/unaryOperators/typeofOperator/typeofOperatorWithStringType.ts(51,1): error TS7028: Unused label. tests/cases/conformance/expressions/unaryOperators/typeofOperator/typeofOperatorWithStringType.ts(52,1): error TS7028: Unused label. @@ -7,7 +8,7 @@ tests/cases/conformance/expressions/unaryOperators/typeofOperator/typeofOperator tests/cases/conformance/expressions/unaryOperators/typeofOperator/typeofOperatorWithStringType.ts(57,1): error TS7028: Unused label. -==== tests/cases/conformance/expressions/unaryOperators/typeofOperator/typeofOperatorWithStringType.ts (7 errors) ==== +==== tests/cases/conformance/expressions/unaryOperators/typeofOperator/typeofOperatorWithStringType.ts (8 errors) ==== // typeof operator on string type var STRING: string; var STRING1: string[] = ["", "abc"]; @@ -52,6 +53,8 @@ tests/cases/conformance/expressions/unaryOperators/typeofOperator/typeofOperator typeof STRING1; typeof foo(); typeof objA.a, M.n; + ~~~~~~~~~~~~~ +!!! error TS2695: Left side of comma operator is unused and has no side effects. // use typeof in type query var z: string; diff --git a/tests/baselines/reference/typeofSimple.errors.txt b/tests/baselines/reference/typeofSimple.errors.txt index 845a9fbbce3..ad498563c57 100644 --- a/tests/baselines/reference/typeofSimple.errors.txt +++ b/tests/baselines/reference/typeofSimple.errors.txt @@ -1,5 +1,5 @@ tests/cases/compiler/typeofSimple.ts(3,5): error TS2322: Type 'number' is not assignable to type 'string'. -tests/cases/compiler/typeofSimple.ts(8,21): error TS2304: Cannot find name 'J'. +tests/cases/compiler/typeofSimple.ts(8,21): error TS2693: 'J' only refers to a type, but is being used as a value here. ==== tests/cases/compiler/typeofSimple.ts (2 errors) ==== @@ -14,7 +14,7 @@ tests/cases/compiler/typeofSimple.ts(8,21): error TS2304: Cannot find name 'J'. var numberJ: typeof J; //Error, cannot reference type in typeof ~ -!!! error TS2304: Cannot find name 'J'. +!!! error TS2693: 'J' only refers to a type, but is being used as a value here. var numberI: I; var fun: () => I; diff --git a/tests/baselines/reference/typeofTypeParameter.errors.txt b/tests/baselines/reference/typeofTypeParameter.errors.txt index f610b4696ca..cdaeecaafb6 100644 --- a/tests/baselines/reference/typeofTypeParameter.errors.txt +++ b/tests/baselines/reference/typeofTypeParameter.errors.txt @@ -1,4 +1,4 @@ -tests/cases/conformance/types/specifyingTypes/typeQueries/typeofTypeParameter.ts(3,19): error TS2304: Cannot find name 'T'. +tests/cases/conformance/types/specifyingTypes/typeQueries/typeofTypeParameter.ts(3,19): error TS2693: 'T' only refers to a type, but is being used as a value here. ==== tests/cases/conformance/types/specifyingTypes/typeQueries/typeofTypeParameter.ts (1 errors) ==== @@ -6,6 +6,6 @@ tests/cases/conformance/types/specifyingTypes/typeQueries/typeofTypeParameter.ts var a: typeof x; var y: typeof T; ~ -!!! error TS2304: Cannot find name 'T'. +!!! error TS2693: 'T' only refers to a type, but is being used as a value here. return a; } \ No newline at end of file diff --git a/tests/baselines/reference/typesWithOptionalProperty.types b/tests/baselines/reference/typesWithOptionalProperty.types index 89879740732..e69b875a831 100644 --- a/tests/baselines/reference/typesWithOptionalProperty.types +++ b/tests/baselines/reference/typesWithOptionalProperty.types @@ -32,26 +32,26 @@ var b = { foo: '' }; >b : { foo: string; } >{ foo: '' } : { foo: string; } >foo : string ->'' : string +>'' : "" var c = { foo: '', bar: 3 }; >c : { foo: string; bar: number; } >{ foo: '', bar: 3 } : { foo: string; bar: number; } >foo : string ->'' : string +>'' : "" >bar : number ->3 : number +>3 : 3 var d = { foo: '', bar: 3, baz: () => '' }; >d : { foo: string; bar: number; baz: () => string; } >{ foo: '', bar: 3, baz: () => '' } : { foo: string; bar: number; baz: () => string; } >foo : string ->'' : string +>'' : "" >bar : number ->3 : number +>3 : 3 >baz : () => string >() => '' : () => string ->'' : string +>'' : "" var i: I; >i : I diff --git a/tests/baselines/reference/typesWithSpecializedCallSignatures.types b/tests/baselines/reference/typesWithSpecializedCallSignatures.types index b587ee7840e..b2ce825199f 100644 --- a/tests/baselines/reference/typesWithSpecializedCallSignatures.types +++ b/tests/baselines/reference/typesWithSpecializedCallSignatures.types @@ -143,5 +143,5 @@ var r3: Base = c.foo('hm'); >c.foo : { (x: "hi"): Derived1; (x: "bye"): Derived2; (x: string): Base; } >c : C >foo : { (x: "hi"): Derived1; (x: "bye"): Derived2; (x: string): Base; } ->'hm' : string +>'hm' : "hm" diff --git a/tests/baselines/reference/typesWithSpecializedConstructSignatures.types b/tests/baselines/reference/typesWithSpecializedConstructSignatures.types index 3036c0cea71..3829cd5ce21 100644 --- a/tests/baselines/reference/typesWithSpecializedConstructSignatures.types +++ b/tests/baselines/reference/typesWithSpecializedConstructSignatures.types @@ -38,7 +38,7 @@ var c = new C('a'); >c : C >new C('a') : C >C : typeof C ->'a' : string +>'a' : "a" interface I { >I : I @@ -114,5 +114,5 @@ var r3: Base = new a('hm'); >Base : Base >new a('hm') : Base >a : { new (x: "hi"): Derived1; new (x: "bye"): Derived2; new (x: string): Base; } ->'hm' : string +>'hm' : "hm" diff --git a/tests/baselines/reference/typingsLookup4.types b/tests/baselines/reference/typingsLookup4.types index d922c7b1dfa..e3f747ac55d 100644 --- a/tests/baselines/reference/typingsLookup4.types +++ b/tests/baselines/reference/typingsLookup4.types @@ -6,14 +6,14 @@ import { k } from "kquery"; >k : number import { l } from "lquery"; ->l : number +>l : 2 j + k + l; >j + k + l : number >j + k : number >j : number >k : number ->l : number +>l : 2 === /node_modules/@types/jquery/jquery.d.ts === export const j: number; @@ -25,6 +25,6 @@ export const k: number; === /node_modules/@types/lquery/lquery.ts === export const l = 2; ->l : number ->2 : number +>l : 2 +>2 : 2 diff --git a/tests/baselines/reference/umd-augmentation-1.types b/tests/baselines/reference/umd-augmentation-1.types index 59b577141e0..8f759912256 100644 --- a/tests/baselines/reference/umd-augmentation-1.types +++ b/tests/baselines/reference/umd-augmentation-1.types @@ -9,8 +9,8 @@ let v = new m.Vector(3, 2); >m.Vector : typeof m.Vector >m : typeof m >Vector : typeof m.Vector ->3 : number ->2 : number +>3 : 3 +>2 : 2 let magnitude = m.getLength(v); >magnitude : number @@ -28,8 +28,8 @@ let p: m.Point = v.translate(5, 5); >v.translate : (dx: number, dy: number) => m.Vector >v : m.Vector >translate : (dx: number, dy: number) => m.Vector ->5 : number ->5 : number +>5 : 5 +>5 : 5 p = v.reverse(); >p = v.reverse() : m.Point diff --git a/tests/baselines/reference/umd-augmentation-2.types b/tests/baselines/reference/umd-augmentation-2.types index 24fe6df3c3c..98d1d52ba4d 100644 --- a/tests/baselines/reference/umd-augmentation-2.types +++ b/tests/baselines/reference/umd-augmentation-2.types @@ -7,8 +7,8 @@ let v = new Math2d.Vector(3, 2); >Math2d.Vector : typeof Math2d.Vector >Math2d : typeof Math2d >Vector : typeof Math2d.Vector ->3 : number ->2 : number +>3 : 3 +>2 : 2 let magnitude = Math2d.getLength(v); >magnitude : number @@ -26,8 +26,8 @@ let p: Math2d.Point = v.translate(5, 5); >v.translate : (dx: number, dy: number) => Vector >v : Vector >translate : (dx: number, dy: number) => Vector ->5 : number ->5 : number +>5 : 5 +>5 : 5 p = v.reverse(); >p = v.reverse() : Math2d.Point diff --git a/tests/baselines/reference/umd-augmentation-3.types b/tests/baselines/reference/umd-augmentation-3.types index 39bc28cbd24..c62107cc40f 100644 --- a/tests/baselines/reference/umd-augmentation-3.types +++ b/tests/baselines/reference/umd-augmentation-3.types @@ -9,8 +9,8 @@ let v = new m.Vector(3, 2); >m.Vector : typeof m.Vector >m : typeof m >Vector : typeof m.Vector ->3 : number ->2 : number +>3 : 3 +>2 : 2 let magnitude = m.getLength(v); >magnitude : number @@ -28,8 +28,8 @@ let p: m.Point = v.translate(5, 5); >v.translate : (dx: number, dy: number) => m.Vector >v : m.Vector >translate : (dx: number, dy: number) => m.Vector ->5 : number ->5 : number +>5 : 5 +>5 : 5 p = v.reverse(); >p = v.reverse() : m.Point diff --git a/tests/baselines/reference/umd-augmentation-4.types b/tests/baselines/reference/umd-augmentation-4.types index 246270aa5a6..e1283c74a7c 100644 --- a/tests/baselines/reference/umd-augmentation-4.types +++ b/tests/baselines/reference/umd-augmentation-4.types @@ -7,8 +7,8 @@ let v = new Math2d.Vector(3, 2); >Math2d.Vector : typeof Math2d.Vector >Math2d : typeof Math2d >Vector : typeof Math2d.Vector ->3 : number ->2 : number +>3 : 3 +>2 : 2 let magnitude = Math2d.getLength(v); >magnitude : number @@ -26,8 +26,8 @@ let p: Math2d.Point = v.translate(5, 5); >v.translate : (dx: number, dy: number) => Math2d.Vector >v : Math2d.Vector >translate : (dx: number, dy: number) => Math2d.Vector ->5 : number ->5 : number +>5 : 5 +>5 : 5 p = v.reverse(); >p = v.reverse() : Math2d.Point diff --git a/tests/baselines/reference/umdGlobalConflict.types b/tests/baselines/reference/umdGlobalConflict.types index fa74e26874f..d23d42e702a 100644 --- a/tests/baselines/reference/umdGlobalConflict.types +++ b/tests/baselines/reference/umdGlobalConflict.types @@ -7,7 +7,7 @@ export var x: string; === tests/cases/compiler/v2/index.d.ts === export as namespace Alpha; ->Alpha : typeof +>Alpha : typeof "tests/cases/compiler/v2/index" export var y: number; >y : number diff --git a/tests/baselines/reference/unaryPlus.types b/tests/baselines/reference/unaryPlus.types index fc7a038ac72..8f92b51a159 100644 --- a/tests/baselines/reference/unaryPlus.types +++ b/tests/baselines/reference/unaryPlus.types @@ -3,40 +3,40 @@ var a = +1; >a : number >+1 : number ->1 : number +>1 : 1 var b = +(""); >b : number >+("") : number >("") : any >"" : any ->"" : string +>"" : "" enum E { some, thing }; >E : E ->some : E ->thing : E +>some : E.some +>thing : E.thing var c = +E.some; >c : number >+E.some : number ->E.some : E +>E.some : E.some >E : typeof E ->some : E +>some : E.some // also allowed, used to be errors var x = +"3"; //should be valid >x : number >+"3" : number ->"3" : string +>"3" : "3" var y = -"3"; // should be valid >y : number >-"3" : number ->"3" : string +>"3" : "3" var z = ~"3"; // should be valid >z : number >~"3" : number ->"3" : string +>"3" : "3" diff --git a/tests/baselines/reference/uncaughtCompilerError1.types b/tests/baselines/reference/uncaughtCompilerError1.types index 83503195f71..d69a52334b3 100644 --- a/tests/baselines/reference/uncaughtCompilerError1.types +++ b/tests/baselines/reference/uncaughtCompilerError1.types @@ -22,7 +22,7 @@ function f() { >'=' : "=" >index > 0 : boolean >index : any ->0 : number +>0 : 0 >token.type === '' : boolean >token.type : any >token : any @@ -34,7 +34,7 @@ function f() { >tokens : any >index - 1 : number >index : any ->1 : number +>1 : 1 >type : any >'attribute.name.html' : "attribute.name.html" @@ -46,14 +46,14 @@ function f() { >tokens.length : any >tokens : any >length : any ->1 : number +>1 : 1 return { appendText: '\"\"', advanceCount: 1 }; >{ appendText: '\"\"', advanceCount: 1 } : { appendText: string; advanceCount: number; } >appendText : string ->'\"\"' : string +>'\"\"' : "\"\"" >advanceCount : number ->1 : number +>1 : 1 } else if (tokens[index + 1].type !== 'attribute.value.html' && tokens[index + 1].type !== '') { >tokens[index + 1].type !== 'attribute.value.html' && tokens[index + 1].type !== '' : boolean @@ -63,7 +63,7 @@ function f() { >tokens : any >index + 1 : any >index : any ->1 : number +>1 : 1 >type : any >'attribute.value.html' : "attribute.value.html" >tokens[index + 1].type !== '' : boolean @@ -72,16 +72,16 @@ function f() { >tokens : any >index + 1 : any >index : any ->1 : number +>1 : 1 >type : any >'' : "" return { appendText: '\"\"', advanceCount: 1 }; >{ appendText: '\"\"', advanceCount: 1 } : { appendText: string; advanceCount: number; } >appendText : string ->'\"\"' : string +>'\"\"' : "\"\"" >advanceCount : number ->1 : number +>1 : 1 } return null; >null : null diff --git a/tests/baselines/reference/undefinedInferentialTyping.types b/tests/baselines/reference/undefinedInferentialTyping.types index 525181f0f4c..49ebbb53716 100644 --- a/tests/baselines/reference/undefinedInferentialTyping.types +++ b/tests/baselines/reference/undefinedInferentialTyping.types @@ -14,8 +14,8 @@ function f(arr: T[], elemnt: T): T { var a = f([], 3); // should be number >a : number ->f([], 3) : number +>f([], 3) : 3 >f : (arr: T[], elemnt: T) => T >[] : undefined[] ->3 : number +>3 : 3 diff --git a/tests/baselines/reference/undefinedIsSubtypeOfEverything.types b/tests/baselines/reference/undefinedIsSubtypeOfEverything.types index d89f032bf29..c52b7b62114 100644 --- a/tests/baselines/reference/undefinedIsSubtypeOfEverything.types +++ b/tests/baselines/reference/undefinedIsSubtypeOfEverything.types @@ -171,7 +171,7 @@ module f { export var bar = 1; >bar : number ->1 : number +>1 : 1 } class D12 extends Base { >D12 : D12 @@ -192,7 +192,7 @@ module c { export var bar = 1; >bar : number ->1 : number +>1 : 1 } class D13 extends Base { >D13 : D13 diff --git a/tests/baselines/reference/underscoreMapFirst.types b/tests/baselines/reference/underscoreMapFirst.types index 60cbcccda2b..4de13891137 100644 --- a/tests/baselines/reference/underscoreMapFirst.types +++ b/tests/baselines/reference/underscoreMapFirst.types @@ -127,7 +127,7 @@ class MyView extends View { >this : this >model : any >get : any ->"data" : string +>"data" : "data" var allSeries: ISeries[][] = _.pluck(data, "series"); >allSeries : ISeries[][] @@ -137,7 +137,7 @@ class MyView extends View { >_ : typeof _ >pluck : (list: _.Collection, propertyName: string) => any[] >data : IData[] ->"series" : string +>"series" : "series" return _.map(allSeries, _.first); >_.map(allSeries, _.first) : ISeries[] diff --git a/tests/baselines/reference/underscoreTest1.types b/tests/baselines/reference/underscoreTest1.types index 5950e50efa1..d4898d43bed 100644 --- a/tests/baselines/reference/underscoreTest1.types +++ b/tests/baselines/reference/underscoreTest1.types @@ -14,9 +14,9 @@ _.each([1, 2, 3], (num) => alert(num.toString())); >_ : Underscore.Static >each : { (list: T[], iterator: Iterator, context?: any): void; (list: Dictionary, iterator: Iterator, context?: any): void; } >[1, 2, 3] : number[] ->1 : number ->2 : number ->3 : number +>1 : 1 +>2 : 2 +>3 : 3 >(num) => alert(num.toString()) : (num: number) => void >num : number >alert(num.toString()) : void @@ -33,11 +33,11 @@ _.each({ one: 1, two: 2, three: 3 }, (value: number, key?: string) => alert(valu >each : { (list: T[], iterator: Iterator, context?: any): void; (list: Dictionary, iterator: Iterator, context?: any): void; } >{ one: 1, two: 2, three: 3 } : { one: number; two: number; three: number; } >one : number ->1 : number +>1 : 1 >two : number ->2 : number +>2 : 2 >three : number ->3 : number +>3 : 3 >(value: number, key?: string) => alert(value.toString()) : (value: number, key?: string) => void >value : number >key : string @@ -54,14 +54,14 @@ _.map([1, 2, 3], (num) => num * 3); >_ : Underscore.Static >map : { (list: T[], iterator: Iterator, context?: any): U[]; (list: Dictionary, iterator: Iterator, context?: any): U[]; } >[1, 2, 3] : number[] ->1 : number ->2 : number ->3 : number +>1 : 1 +>2 : 2 +>3 : 3 >(num) => num * 3 : (num: number) => number >num : number >num * 3 : number >num : number ->3 : number +>3 : 3 _.map({ one: 1, two: 2, three: 3 }, (value: number, key?: string) => value * 3); >_.map({ one: 1, two: 2, three: 3 }, (value: number, key?: string) => value * 3) : number[] @@ -70,17 +70,17 @@ _.map({ one: 1, two: 2, three: 3 }, (value: number, key?: string) => value * 3); >map : { (list: T[], iterator: Iterator, context?: any): U[]; (list: Dictionary, iterator: Iterator, context?: any): U[]; } >{ one: 1, two: 2, three: 3 } : { one: number; two: number; three: number; } >one : number ->1 : number +>1 : 1 >two : number ->2 : number +>2 : 2 >three : number ->3 : number +>3 : 3 >(value: number, key?: string) => value * 3 : (value: number, key?: string) => number >value : number >key : string >value * 3 : number >value : number ->3 : number +>3 : 3 var sum = _.reduce([1, 2, 3], (memo, num) => memo + num, 0); >sum : number @@ -89,29 +89,29 @@ var sum = _.reduce([1, 2, 3], (memo, num) => memo + num, 0); >_ : Underscore.Static >reduce : { (list: T[], iterator: Reducer, initialValue?: T, context?: any): T; (list: T[], iterator: Reducer, initialValue: U, context?: any): U; (list: Dictionary, iterator: Reducer, initialValue?: T, context?: any): T; (list: Dictionary, iterator: Reducer, initialValue: U, context?: any): U; } >[1, 2, 3] : number[] ->1 : number ->2 : number ->3 : number +>1 : 1 +>2 : 2 +>3 : 3 >(memo, num) => memo + num : (memo: number, num: number) => number >memo : number >num : number >memo + num : number >memo : number >num : number ->0 : number +>0 : 0 var list = [[0, 1], [2, 3], [4, 5]]; >list : number[][] >[[0, 1], [2, 3], [4, 5]] : number[][] >[0, 1] : number[] ->0 : number ->1 : number +>0 : 0 +>1 : 1 >[2, 3] : number[] ->2 : number ->3 : number +>2 : 2 +>3 : 3 >[4, 5] : number[] ->4 : number ->5 : number +>4 : 4 +>5 : 5 var flat = _.reduceRight(list, (a, b) => a.concat(b), []); >flat : number[] @@ -137,18 +137,18 @@ var even = _.find([1, 2, 3, 4, 5, 6], (num) => num % 2 == 0); >_ : Underscore.Static >find : { (list: T[], iterator: Iterator, context?: any): T; (list: Dictionary, iterator: Iterator, context?: any): T; } >[1, 2, 3, 4, 5, 6] : number[] ->1 : number ->2 : number ->3 : number ->4 : number ->5 : number ->6 : number +>1 : 1 +>2 : 2 +>3 : 3 +>4 : 4 +>5 : 5 +>6 : 6 >(num) => num % 2 == 0 : (num: number) => boolean >num : number >num % 2 == 0 : boolean >num % 2 : number >num : number ->2 : number +>2 : 2 >0 : 0 var evens = _.filter([1, 2, 3, 4, 5, 6], (num) => num % 2 == 0); @@ -158,18 +158,18 @@ var evens = _.filter([1, 2, 3, 4, 5, 6], (num) => num % 2 == 0); >_ : Underscore.Static >filter : { (list: T[], iterator: Iterator, context?: any): T[]; (list: Dictionary, iterator: Iterator, context?: any): T[]; } >[1, 2, 3, 4, 5, 6] : number[] ->1 : number ->2 : number ->3 : number ->4 : number ->5 : number ->6 : number +>1 : 1 +>2 : 2 +>3 : 3 +>4 : 4 +>5 : 5 +>6 : 6 >(num) => num % 2 == 0 : (num: number) => boolean >num : number >num % 2 == 0 : boolean >num % 2 : number >num : number ->2 : number +>2 : 2 >0 : 0 var listOfPlays = [{ title: "Cymbeline", author: "Shakespeare", year: 1611 }, { title: "The Tempest", author: "Shakespeare", year: 1611 }, { title: "Other", author: "Not Shakespeare", year: 2012 }]; @@ -177,25 +177,25 @@ var listOfPlays = [{ title: "Cymbeline", author: "Shakespeare", year: 1611 }, { >[{ title: "Cymbeline", author: "Shakespeare", year: 1611 }, { title: "The Tempest", author: "Shakespeare", year: 1611 }, { title: "Other", author: "Not Shakespeare", year: 2012 }] : { title: string; author: string; year: number; }[] >{ title: "Cymbeline", author: "Shakespeare", year: 1611 } : { title: string; author: string; year: number; } >title : string ->"Cymbeline" : string +>"Cymbeline" : "Cymbeline" >author : string ->"Shakespeare" : string +>"Shakespeare" : "Shakespeare" >year : number ->1611 : number +>1611 : 1611 >{ title: "The Tempest", author: "Shakespeare", year: 1611 } : { title: string; author: string; year: number; } >title : string ->"The Tempest" : string +>"The Tempest" : "The Tempest" >author : string ->"Shakespeare" : string +>"Shakespeare" : "Shakespeare" >year : number ->1611 : number +>1611 : 1611 >{ title: "Other", author: "Not Shakespeare", year: 2012 } : { title: string; author: string; year: number; } >title : string ->"Other" : string +>"Other" : "Other" >author : string ->"Not Shakespeare" : string +>"Not Shakespeare" : "Not Shakespeare" >year : number ->2012 : number +>2012 : 2012 _.where(listOfPlays, { author: "Shakespeare", year: 1611 }); >_.where(listOfPlays, { author: "Shakespeare", year: 1611 }) : { title: string; author: string; year: number; }[] @@ -205,9 +205,9 @@ _.where(listOfPlays, { author: "Shakespeare", year: 1611 }); >listOfPlays : { title: string; author: string; year: number; }[] >{ author: "Shakespeare", year: 1611 } : { author: string; year: number; } >author : string ->"Shakespeare" : string +>"Shakespeare" : "Shakespeare" >year : number ->1611 : number +>1611 : 1611 var odds = _.reject([1, 2, 3, 4, 5, 6], (num) => num % 2 == 0); >odds : number[] @@ -216,18 +216,18 @@ var odds = _.reject([1, 2, 3, 4, 5, 6], (num) => num % 2 == 0); >_ : Underscore.Static >reject : { (list: T[], iterator: Iterator, context?: any): T[]; (list: Dictionary, iterator: Iterator, context?: any): T[]; } >[1, 2, 3, 4, 5, 6] : number[] ->1 : number ->2 : number ->3 : number ->4 : number ->5 : number ->6 : number +>1 : 1 +>2 : 2 +>3 : 3 +>4 : 4 +>5 : 5 +>6 : 6 >(num) => num % 2 == 0 : (num: number) => boolean >num : number >num % 2 == 0 : boolean >num % 2 : number >num : number ->2 : number +>2 : 2 >0 : 0 _.all([true, 1, null, 'yes'], _.identity); @@ -235,11 +235,11 @@ _.all([true, 1, null, 'yes'], _.identity); >_.all : { (list: T[], iterator?: Iterator, context?: any): boolean; (list: Dictionary, iterator?: Iterator, context?: any): boolean; } >_ : Underscore.Static >all : { (list: T[], iterator?: Iterator, context?: any): boolean; (list: Dictionary, iterator?: Iterator, context?: any): boolean; } ->[true, 1, null, 'yes'] : (string | number | boolean)[] ->true : boolean ->1 : number +>[true, 1, null, 'yes'] : (true | 1 | "yes")[] +>true : true +>1 : 1 >null : null ->'yes' : string +>'yes' : "yes" >_.identity : (value: T) => T >_ : Underscore.Static >identity : (value: T) => T @@ -249,11 +249,11 @@ _.any([null, 0, 'yes', false]); >_.any : { (list: T[], iterator?: Iterator, context?: any): boolean; (list: Dictionary, iterator?: Iterator, context?: any): boolean; } >_ : Underscore.Static >any : { (list: T[], iterator?: Iterator, context?: any): boolean; (list: Dictionary, iterator?: Iterator, context?: any): boolean; } ->[null, 0, 'yes', false] : (string | number | boolean)[] +>[null, 0, 'yes', false] : (false | 0 | "yes")[] >null : null ->0 : number ->'yes' : string ->false : boolean +>0 : 0 +>'yes' : "yes" +>false : false _.contains([1, 2, 3], 3); >_.contains([1, 2, 3], 3) : boolean @@ -261,10 +261,10 @@ _.contains([1, 2, 3], 3); >_ : Underscore.Static >contains : { (list: T[], value: T): boolean; (list: Dictionary, value: T): boolean; } >[1, 2, 3] : number[] ->1 : number ->2 : number ->3 : number ->3 : number +>1 : 1 +>2 : 2 +>3 : 3 +>3 : 3 _.invoke([[5, 1, 7], [3, 2, 1]], 'sort'); >_.invoke([[5, 1, 7], [3, 2, 1]], 'sort') : any[] @@ -273,33 +273,33 @@ _.invoke([[5, 1, 7], [3, 2, 1]], 'sort'); >invoke : { (list: any[], methodName: string, ...args: any[]): any[]; (list: Dictionary, methodName: string, ...args: any[]): any[]; } >[[5, 1, 7], [3, 2, 1]] : number[][] >[5, 1, 7] : number[] ->5 : number ->1 : number ->7 : number +>5 : 5 +>1 : 1 +>7 : 7 >[3, 2, 1] : number[] ->3 : number ->2 : number ->1 : number ->'sort' : string +>3 : 3 +>2 : 2 +>1 : 1 +>'sort' : "sort" var stooges = [{ name: 'moe', age: 40 }, { name: 'larry', age: 50 }, { name: 'curly', age: 60 }]; >stooges : { name: string; age: number; }[] >[{ name: 'moe', age: 40 }, { name: 'larry', age: 50 }, { name: 'curly', age: 60 }] : { name: string; age: number; }[] >{ name: 'moe', age: 40 } : { name: string; age: number; } >name : string ->'moe' : string +>'moe' : "moe" >age : number ->40 : number +>40 : 40 >{ name: 'larry', age: 50 } : { name: string; age: number; } >name : string ->'larry' : string +>'larry' : "larry" >age : number ->50 : number +>50 : 50 >{ name: 'curly', age: 60 } : { name: string; age: number; } >name : string ->'curly' : string +>'curly' : "curly" >age : number ->60 : number +>60 : 60 _.pluck(stooges, 'name'); >_.pluck(stooges, 'name') : any[] @@ -307,7 +307,7 @@ _.pluck(stooges, 'name'); >_ : Underscore.Static >pluck : { (list: any[], propertyName: string): any[]; (list: Dictionary, propertyName: string): any[]; } >stooges : { name: string; age: number; }[] ->'name' : string +>'name' : "name" _.max(stooges, (stooge) => stooge.age); >_.max(stooges, (stooge) => stooge.age) : { name: string; age: number; } @@ -324,11 +324,11 @@ _.max(stooges, (stooge) => stooge.age); var numbers = [10, 5, 100, 2, 1000]; >numbers : number[] >[10, 5, 100, 2, 1000] : number[] ->10 : number ->5 : number ->100 : number ->2 : number ->1000 : number +>10 : 10 +>5 : 5 +>100 : 100 +>2 : 2 +>1000 : 1000 _.min(numbers); >_.min(numbers) : number @@ -343,12 +343,12 @@ _.sortBy([1, 2, 3, 4, 5, 6], (num) => Math.sin(num)); >_ : Underscore.Static >sortBy : { (list: T[], iterator: Iterator, context?: any): T[]; (list: Dictionary, iterator: Iterator, context?: any): T[]; (list: T[], propertyName: string): T[]; (list: Dictionary, propertyName: string): T[]; } >[1, 2, 3, 4, 5, 6] : number[] ->1 : number ->2 : number ->3 : number ->4 : number ->5 : number ->6 : number +>1 : 1 +>2 : 2 +>3 : 3 +>4 : 4 +>5 : 5 +>6 : 6 >(num) => Math.sin(num) : (num: number) => number >num : number >Math.sin(num) : number @@ -365,9 +365,9 @@ _([1.3, 2.1, 2.4]).groupBy((e: number, i?: number, list?: number[]) => Math.floo >_([1.3, 2.1, 2.4]) : Underscore.WrappedArray >_ : Underscore.Static >[1.3, 2.1, 2.4] : number[] ->1.3 : number ->2.1 : number ->2.4 : number +>1.3 : 1.3 +>2.1 : 2.1 +>2.4 : 2.4 >groupBy : { (iterator?: Iterator, context?: any): Dictionary; (propertyName: string): Dictionary; } >(e: number, i?: number, list?: number[]) => Math.floor(e) : (e: number, i?: number, list?: number[]) => number >e : number @@ -385,9 +385,9 @@ _.groupBy([1.3, 2.1, 2.4], (num: number) => Math.floor(num)); >_ : Underscore.Static >groupBy : { (list: T[], iterator?: Iterator, context?: any): Dictionary; (list: Dictionary, iterator?: Iterator, context?: any): Dictionary; (list: T[], propertyName: string): Dictionary; (list: Dictionary, propertyName: string): Dictionary; } >[1.3, 2.1, 2.4] : number[] ->1.3 : number ->2.1 : number ->2.4 : number +>1.3 : 1.3 +>2.1 : 2.1 +>2.4 : 2.4 >(num: number) => Math.floor(num) : (num: number) => number >num : number >Math.floor(num) : number @@ -402,10 +402,10 @@ _.groupBy(['one', 'two', 'three'], 'length'); >_ : Underscore.Static >groupBy : { (list: T[], iterator?: Iterator, context?: any): Dictionary; (list: Dictionary, iterator?: Iterator, context?: any): Dictionary; (list: T[], propertyName: string): Dictionary; (list: Dictionary, propertyName: string): Dictionary; } >['one', 'two', 'three'] : string[] ->'one' : string ->'two' : string ->'three' : string ->'length' : string +>'one' : "one" +>'two' : "two" +>'three' : "three" +>'length' : "length" _.countBy([1, 2, 3, 4, 5], (num) => num % 2 == 0 ? 'even' : 'odd'); >_.countBy([1, 2, 3, 4, 5], (num) => num % 2 == 0 ? 'even' : 'odd') : Dictionary @@ -413,21 +413,21 @@ _.countBy([1, 2, 3, 4, 5], (num) => num % 2 == 0 ? 'even' : 'odd'); >_ : Underscore.Static >countBy : { (list: T[], iterator?: Iterator, context?: any): Dictionary; (list: Dictionary, iterator?: Iterator, context?: any): Dictionary; (list: T[], propertyName: string): Dictionary; (list: Dictionary, propertyName: string): Dictionary; } >[1, 2, 3, 4, 5] : number[] ->1 : number ->2 : number ->3 : number ->4 : number ->5 : number ->(num) => num % 2 == 0 ? 'even' : 'odd' : (num: number) => string +>1 : 1 +>2 : 2 +>3 : 3 +>4 : 4 +>5 : 5 +>(num) => num % 2 == 0 ? 'even' : 'odd' : (num: number) => "even" | "odd" >num : number ->num % 2 == 0 ? 'even' : 'odd' : string +>num % 2 == 0 ? 'even' : 'odd' : "even" | "odd" >num % 2 == 0 : boolean >num % 2 : number >num : number ->2 : number +>2 : 2 >0 : 0 ->'even' : string ->'odd' : string +>'even' : "even" +>'odd' : "odd" _.shuffle([1, 2, 3, 4, 5, 6]); >_.shuffle([1, 2, 3, 4, 5, 6]) : number[] @@ -435,12 +435,12 @@ _.shuffle([1, 2, 3, 4, 5, 6]); >_ : Underscore.Static >shuffle : { (list: T[]): T[]; (list: Dictionary): T[]; } >[1, 2, 3, 4, 5, 6] : number[] ->1 : number ->2 : number ->3 : number ->4 : number ->5 : number ->6 : number +>1 : 1 +>2 : 2 +>3 : 3 +>4 : 4 +>5 : 5 +>6 : 6 // (function(){ return _.toArray(arguments).slice(1); })(1, 2, 3, 4); @@ -451,11 +451,11 @@ _.size({ one: 1, two: 2, three: 3 }); >size : { (list: T[]): number; (list: Dictionary): number; } >{ one: 1, two: 2, three: 3 } : { one: number; two: number; three: number; } >one : number ->1 : number +>1 : 1 >two : number ->2 : number +>2 : 2 >three : number ->3 : number +>3 : 3 /////////////////////////////////////////////////////////////////////////////////////// @@ -465,11 +465,11 @@ _.first([5, 4, 3, 2, 1]); >_ : Underscore.Static >first : { (list: T[]): T; (list: T[], count: number): T[]; } >[5, 4, 3, 2, 1] : number[] ->5 : number ->4 : number ->3 : number ->2 : number ->1 : number +>5 : 5 +>4 : 4 +>3 : 3 +>2 : 2 +>1 : 1 _.initial([5, 4, 3, 2, 1]); >_.initial([5, 4, 3, 2, 1]) : number @@ -477,11 +477,11 @@ _.initial([5, 4, 3, 2, 1]); >_ : Underscore.Static >initial : { (list: T[]): T; (list: T[], count: number): T[]; } >[5, 4, 3, 2, 1] : number[] ->5 : number ->4 : number ->3 : number ->2 : number ->1 : number +>5 : 5 +>4 : 4 +>3 : 3 +>2 : 2 +>1 : 1 _.last([5, 4, 3, 2, 1]); >_.last([5, 4, 3, 2, 1]) : number @@ -489,11 +489,11 @@ _.last([5, 4, 3, 2, 1]); >_ : Underscore.Static >last : { (list: T[]): T; (list: T[], count: number): T[]; } >[5, 4, 3, 2, 1] : number[] ->5 : number ->4 : number ->3 : number ->2 : number ->1 : number +>5 : 5 +>4 : 4 +>3 : 3 +>2 : 2 +>1 : 1 _.rest([5, 4, 3, 2, 1]); >_.rest([5, 4, 3, 2, 1]) : number[] @@ -501,24 +501,24 @@ _.rest([5, 4, 3, 2, 1]); >_ : Underscore.Static >rest : (list: T[], index?: number) => T[] >[5, 4, 3, 2, 1] : number[] ->5 : number ->4 : number ->3 : number ->2 : number ->1 : number +>5 : 5 +>4 : 4 +>3 : 3 +>2 : 2 +>1 : 1 _.compact([0, 1, false, 2, '', 3]); >_.compact([0, 1, false, 2, '', 3]) : (string | number | boolean)[] >_.compact : (list: T[]) => T[] >_ : Underscore.Static >compact : (list: T[]) => T[] ->[0, 1, false, 2, '', 3] : (string | number | boolean)[] ->0 : number ->1 : number ->false : boolean ->2 : number ->'' : string ->3 : number +>[0, 1, false, 2, '', 3] : (false | "" | 0 | 1 | 2 | 3)[] +>0 : 0 +>1 : 1 +>false : false +>2 : 2 +>'' : "" +>3 : 3 _.flatten([1, 2, 3, 4]); >_.flatten([1, 2, 3, 4]) : {}[] @@ -526,10 +526,10 @@ _.flatten([1, 2, 3, 4]); >_ : Underscore.Static >flatten : { (list: T[][]): T[]; (array: any[], shallow?: boolean): T[]; } >[1, 2, 3, 4] : number[] ->1 : number ->2 : number ->3 : number ->4 : number +>1 : 1 +>2 : 2 +>3 : 3 +>4 : 4 _.flatten([1, [2]]); >_.flatten([1, [2]]) : {}[] @@ -537,9 +537,9 @@ _.flatten([1, [2]]); >_ : Underscore.Static >flatten : { (list: T[][]): T[]; (array: any[], shallow?: boolean): T[]; } >[1, [2]] : (number | number[])[] ->1 : number +>1 : 1 >[2] : number[] ->2 : number +>2 : 2 // typescript doesn't like the elements being different _.flatten([1, [2], [3, [[4]]]]); @@ -548,14 +548,14 @@ _.flatten([1, [2], [3, [[4]]]]); >_ : Underscore.Static >flatten : { (list: T[][]): T[]; (array: any[], shallow?: boolean): T[]; } >[1, [2], [3, [[4]]]] : (number | (number | number[][])[])[] ->1 : number +>1 : 1 >[2] : number[] ->2 : number +>2 : 2 >[3, [[4]]] : (number | number[][])[] ->3 : number +>3 : 3 >[[4]] : number[][] >[4] : number[] ->4 : number +>4 : 4 _.flatten([1, [2], [3, [[4]]]], true); >_.flatten([1, [2], [3, [[4]]]], true) : {}[] @@ -563,15 +563,15 @@ _.flatten([1, [2], [3, [[4]]]], true); >_ : Underscore.Static >flatten : { (list: T[][]): T[]; (array: any[], shallow?: boolean): T[]; } >[1, [2], [3, [[4]]]] : (number | (number | number[][])[])[] ->1 : number +>1 : 1 >[2] : number[] ->2 : number +>2 : 2 >[3, [[4]]] : (number | number[][])[] ->3 : number +>3 : 3 >[[4]] : number[][] >[4] : number[] ->4 : number ->true : boolean +>4 : 4 +>true : true _.without([1, 2, 1, 0, 3, 1, 4], 0, 1); >_.without([1, 2, 1, 0, 3, 1, 4], 0, 1) : number[] @@ -579,15 +579,15 @@ _.without([1, 2, 1, 0, 3, 1, 4], 0, 1); >_ : Underscore.Static >without : (list: T[], ...values: T[]) => T[] >[1, 2, 1, 0, 3, 1, 4] : number[] ->1 : number ->2 : number ->1 : number ->0 : number ->3 : number ->1 : number ->4 : number ->0 : number ->1 : number +>1 : 1 +>2 : 2 +>1 : 1 +>0 : 0 +>3 : 3 +>1 : 1 +>4 : 4 +>0 : 0 +>1 : 1 _.union([1, 2, 3], [101, 2, 1, 10], [2, 1]); >_.union([1, 2, 3], [101, 2, 1, 10], [2, 1]) : number[] @@ -595,17 +595,17 @@ _.union([1, 2, 3], [101, 2, 1, 10], [2, 1]); >_ : Underscore.Static >union : (...arrays: T[][]) => T[] >[1, 2, 3] : number[] ->1 : number ->2 : number ->3 : number +>1 : 1 +>2 : 2 +>3 : 3 >[101, 2, 1, 10] : number[] ->101 : number ->2 : number ->1 : number ->10 : number +>101 : 101 +>2 : 2 +>1 : 1 +>10 : 10 >[2, 1] : number[] ->2 : number ->1 : number +>2 : 2 +>1 : 1 _.intersection([1, 2, 3], [101, 2, 1, 10], [2, 1]); >_.intersection([1, 2, 3], [101, 2, 1, 10], [2, 1]) : number[] @@ -613,17 +613,17 @@ _.intersection([1, 2, 3], [101, 2, 1, 10], [2, 1]); >_ : Underscore.Static >intersection : (...arrays: T[][]) => T[] >[1, 2, 3] : number[] ->1 : number ->2 : number ->3 : number +>1 : 1 +>2 : 2 +>3 : 3 >[101, 2, 1, 10] : number[] ->101 : number ->2 : number ->1 : number ->10 : number +>101 : 101 +>2 : 2 +>1 : 1 +>10 : 10 >[2, 1] : number[] ->2 : number ->1 : number +>2 : 2 +>1 : 1 _.difference([1, 2, 3, 4, 5], [5, 2, 10]); >_.difference([1, 2, 3, 4, 5], [5, 2, 10]) : number[] @@ -631,15 +631,15 @@ _.difference([1, 2, 3, 4, 5], [5, 2, 10]); >_ : Underscore.Static >difference : (list: T[], ...others: T[][]) => T[] >[1, 2, 3, 4, 5] : number[] ->1 : number ->2 : number ->3 : number ->4 : number ->5 : number +>1 : 1 +>2 : 2 +>3 : 3 +>4 : 4 +>5 : 5 >[5, 2, 10] : number[] ->5 : number ->2 : number ->10 : number +>5 : 5 +>2 : 2 +>10 : 10 _.uniq([1, 2, 1, 3, 1, 4]); >_.uniq([1, 2, 1, 3, 1, 4]) : number[] @@ -647,12 +647,12 @@ _.uniq([1, 2, 1, 3, 1, 4]); >_ : Underscore.Static >uniq : { (list: T[], isSorted?: boolean): T[]; (list: T[], isSorted: boolean, iterator: Iterator, context?: any): U[]; } >[1, 2, 1, 3, 1, 4] : number[] ->1 : number ->2 : number ->1 : number ->3 : number ->1 : number ->4 : number +>1 : 1 +>2 : 2 +>1 : 1 +>3 : 3 +>1 : 1 +>4 : 4 _.zip(['moe', 'larry', 'curly'], [30, 40, 50], [true, false, false]); >_.zip(['moe', 'larry', 'curly'], [30, 40, 50], [true, false, false]) : Tuple3[] @@ -660,17 +660,17 @@ _.zip(['moe', 'larry', 'curly'], [30, 40, 50], [true, false, false]); >_ : Underscore.Static >zip : { (a0: T0[], a1: T1[]): Tuple2[]; (a0: T0[], a1: T1[], a2: T2[]): Tuple3[]; (a0: T0[], a1: T1[], a2: T2[], a3: T3[]): Tuple4[]; (...arrays: any[][]): any[][]; } >['moe', 'larry', 'curly'] : string[] ->'moe' : string ->'larry' : string ->'curly' : string +>'moe' : "moe" +>'larry' : "larry" +>'curly' : "curly" >[30, 40, 50] : number[] ->30 : number ->40 : number ->50 : number +>30 : 30 +>40 : 40 +>50 : 50 >[true, false, false] : boolean[] ->true : boolean ->false : boolean ->false : boolean +>true : true +>false : false +>false : false _.object(['moe', 'larry', 'curly'], [30, 40, 50]); >_.object(['moe', 'larry', 'curly'], [30, 40, 50]) : any @@ -678,13 +678,13 @@ _.object(['moe', 'larry', 'curly'], [30, 40, 50]); >_ : Underscore.Static >object : { (list: any[][]): any; (keys: string[], values: any[]): any; } >['moe', 'larry', 'curly'] : string[] ->'moe' : string ->'larry' : string ->'curly' : string +>'moe' : "moe" +>'larry' : "larry" +>'curly' : "curly" >[30, 40, 50] : number[] ->30 : number ->40 : number ->50 : number +>30 : 30 +>40 : 40 +>50 : 50 _.object([['moe', 30], ['larry', 40], ['curly', 50]]); >_.object([['moe', 30], ['larry', 40], ['curly', 50]]) : any @@ -693,14 +693,14 @@ _.object([['moe', 30], ['larry', 40], ['curly', 50]]); >object : { (list: any[][]): any; (keys: string[], values: any[]): any; } >[['moe', 30], ['larry', 40], ['curly', 50]] : (string | number)[][] >['moe', 30] : (string | number)[] ->'moe' : string ->30 : number +>'moe' : "moe" +>30 : 30 >['larry', 40] : (string | number)[] ->'larry' : string ->40 : number +>'larry' : "larry" +>40 : 40 >['curly', 50] : (string | number)[] ->'curly' : string ->50 : number +>'curly' : "curly" +>50 : 50 _.indexOf([1, 2, 3], 2); >_.indexOf([1, 2, 3], 2) : number @@ -708,10 +708,10 @@ _.indexOf([1, 2, 3], 2); >_ : Underscore.Static >indexOf : (list: T[], value: T, isSorted?: boolean) => number >[1, 2, 3] : number[] ->1 : number ->2 : number ->3 : number ->2 : number +>1 : 1 +>2 : 2 +>3 : 3 +>2 : 2 _.lastIndexOf([1, 2, 3, 1, 2, 3], 2); >_.lastIndexOf([1, 2, 3, 1, 2, 3], 2) : number @@ -719,13 +719,13 @@ _.lastIndexOf([1, 2, 3, 1, 2, 3], 2); >_ : Underscore.Static >lastIndexOf : (list: T[], value: T, fromIndex?: number) => number >[1, 2, 3, 1, 2, 3] : number[] ->1 : number ->2 : number ->3 : number ->1 : number ->2 : number ->3 : number ->2 : number +>1 : 1 +>2 : 2 +>3 : 3 +>1 : 1 +>2 : 2 +>3 : 3 +>2 : 2 _.sortedIndex([10, 20, 30, 40, 50], 35); >_.sortedIndex([10, 20, 30, 40, 50], 35) : number @@ -733,52 +733,52 @@ _.sortedIndex([10, 20, 30, 40, 50], 35); >_ : Underscore.Static >sortedIndex : { (list: T[], obj: T, propertyName: string): number; (list: T[], obj: T, iterator?: Iterator, context?: any): number; } >[10, 20, 30, 40, 50] : number[] ->10 : number ->20 : number ->30 : number ->40 : number ->50 : number ->35 : number +>10 : 10 +>20 : 20 +>30 : 30 +>40 : 40 +>50 : 50 +>35 : 35 _.range(10); >_.range(10) : number[] >_.range : { (stop: number): number[]; (start: number, stop: number, step?: number): number[]; } >_ : Underscore.Static >range : { (stop: number): number[]; (start: number, stop: number, step?: number): number[]; } ->10 : number +>10 : 10 _.range(1, 11); >_.range(1, 11) : number[] >_.range : { (stop: number): number[]; (start: number, stop: number, step?: number): number[]; } >_ : Underscore.Static >range : { (stop: number): number[]; (start: number, stop: number, step?: number): number[]; } ->1 : number ->11 : number +>1 : 1 +>11 : 11 _.range(0, 30, 5); >_.range(0, 30, 5) : number[] >_.range : { (stop: number): number[]; (start: number, stop: number, step?: number): number[]; } >_ : Underscore.Static >range : { (stop: number): number[]; (start: number, stop: number, step?: number): number[]; } ->0 : number ->30 : number ->5 : number +>0 : 0 +>30 : 30 +>5 : 5 _.range(0, 30, 5); >_.range(0, 30, 5) : number[] >_.range : { (stop: number): number[]; (start: number, stop: number, step?: number): number[]; } >_ : Underscore.Static >range : { (stop: number): number[]; (start: number, stop: number, step?: number): number[]; } ->0 : number ->30 : number ->5 : number +>0 : 0 +>30 : 30 +>5 : 5 _.range(0); >_.range(0) : number[] >_.range : { (stop: number): number[]; (start: number, stop: number, step?: number): number[]; } >_ : Underscore.Static >range : { (stop: number): number[]; (start: number, stop: number, step?: number): number[]; } ->0 : number +>0 : 0 /////////////////////////////////////////////////////////////////////////////////////// @@ -789,7 +789,7 @@ var func = function (greeting) { return greeting + ': ' + this.name }; >greeting + ': ' + this.name : string >greeting + ': ' : string >greeting : any ->': ' : string +>': ' : ": " >this.name : any >this : any >name : any @@ -805,8 +805,8 @@ var func2 = _.bind(func, { name: 'moe' }, 'hi'); >func : (greeting: any) => string >{ name: 'moe' } : { name: string; } >name : string ->'moe' : string ->'hi' : string +>'moe' : "moe" +>'hi' : "hi" func2(); >func2() : any @@ -818,7 +818,7 @@ var buttonView = { label: 'underscore', >label : string ->'underscore' : string +>'underscore' : "underscore" onClick: function () { alert('clicked: ' + this.label); }, >onClick : () => void @@ -826,7 +826,7 @@ var buttonView = { >alert('clicked: ' + this.label) : void >alert : (x: string) => void >'clicked: ' + this.label : string ->'clicked: ' : string +>'clicked: ' : "clicked: " >this.label : any >this : any >label : any @@ -837,7 +837,7 @@ var buttonView = { >alert('hovering: ' + this.label) : void >alert : (x: string) => void >'hovering: ' + this.label : string ->'hovering: ' : string +>'hovering: ' : "hovering: " >this.label : any >this : any >label : any @@ -855,9 +855,9 @@ $('#underscore_button').bind('click', buttonView.onClick); >$('#underscore_button').bind : any >$('#underscore_button') : any >$ : any ->'#underscore_button' : string +>'#underscore_button' : "#underscore_button" >bind : any ->'click' : string +>'click' : "click" >buttonView.onClick : () => void >buttonView : { label: string; onClick: () => void; onHover: () => void; } >onClick : () => void @@ -875,19 +875,19 @@ var fibonacci = _.memoize(function (n) { >n < 2 ? n : fibonacci(n - 1) + fibonacci(n - 2) : any >n < 2 : boolean >n : any ->2 : number +>2 : 2 >n : any >fibonacci(n - 1) + fibonacci(n - 2) : any >fibonacci(n - 1) : any >fibonacci : (n: any) => any >n - 1 : number >n : any ->1 : number +>1 : 1 >fibonacci(n - 2) : any >fibonacci : (n: any) => any >n - 2 : number >n : any ->2 : number +>2 : 2 }); @@ -908,8 +908,8 @@ _.delay(log, 1000, 'logged later'); >_ : Underscore.Static >delay : (func: Function, wait: number, ...args: any[]) => number >log : (message?: string, ...rest: string[]) => void ->1000 : number ->'logged later' : string +>1000 : 1000 +>'logged later' : "logged later" _.defer(function () { alert('deferred'); }); >_.defer(function () { alert('deferred'); }) : number @@ -919,14 +919,14 @@ _.defer(function () { alert('deferred'); }); >function () { alert('deferred'); } : () => void >alert('deferred') : void >alert : (x: string) => void ->'deferred' : string +>'deferred' : "deferred" var updatePosition = () => alert('updating position...'); >updatePosition : () => void >() => alert('updating position...') : () => void >alert('updating position...') : void >alert : (x: string) => void ->'updating position...' : string +>'updating position...' : "updating position..." var throttled = _.throttle(updatePosition, 100); >throttled : () => void @@ -935,7 +935,7 @@ var throttled = _.throttle(updatePosition, 100); >_ : Underscore.Static >throttle : (func: T, wait: number) => T >updatePosition : () => void ->100 : number +>100 : 100 $(null).scroll(throttled); >$(null).scroll(throttled) : any @@ -951,7 +951,7 @@ var calculateLayout = () => alert('calculating layout...'); >() => alert('calculating layout...') : () => void >alert('calculating layout...') : void >alert : (x: string) => void ->'calculating layout...' : string +>'calculating layout...' : "calculating layout..." var lazyLayout = _.debounce(calculateLayout, 300); >lazyLayout : () => void @@ -960,7 +960,7 @@ var lazyLayout = _.debounce(calculateLayout, 300); >_ : Underscore.Static >debounce : (func: T, wait: number, immediate?: boolean) => T >calculateLayout : () => void ->300 : number +>300 : 300 $(null).resize(lazyLayout); >$(null).resize(lazyLayout) : any @@ -976,7 +976,7 @@ var createApplication = () => alert('creating application...'); >() => alert('creating application...') : () => void >alert('creating application...') : void >alert : (x: string) => void ->'creating application...' : string +>'creating application...' : "creating application..." var initialize = _.once(createApplication); >initialize : () => void @@ -1002,7 +1002,7 @@ var render = () => alert("rendering..."); >() => alert("rendering...") : () => void >alert("rendering...") : void >alert : (x: string) => void ->"rendering..." : string +>"rendering..." : "rendering..." var renderNotes = _.after(notes.length, render); >renderNotes : () => void @@ -1036,7 +1036,7 @@ var hello = function (name) { return "hello: " + name; }; >function (name) { return "hello: " + name; } : (name: any) => string >name : any >"hello: " + name : string ->"hello: " : string +>"hello: " : "hello: " >name : any hello = _.wrap(hello, (func, arg) => { return "before, " + func(arg) + ", after"; }); @@ -1052,23 +1052,23 @@ hello = _.wrap(hello, (func, arg) => { return "before, " + func(arg) + ", after" >arg : any >"before, " + func(arg) + ", after" : string >"before, " + func(arg) : string ->"before, " : string +>"before, " : "before, " >func(arg) : string >func : (name: any) => string >arg : any ->", after" : string +>", after" : ", after" hello("moe"); >hello("moe") : string >hello : (name: any) => string ->"moe" : string +>"moe" : "moe" var greet = function (name) { return "hi: " + name; }; >greet : (name: any) => string >function (name) { return "hi: " + name; } : (name: any) => string >name : any >"hi: " + name : string ->"hi: " : string +>"hi: " : "hi: " >name : any var exclaim = function (statement) { return statement + "!"; }; @@ -1077,7 +1077,7 @@ var exclaim = function (statement) { return statement + "!"; }; >statement : any >statement + "!" : string >statement : any ->"!" : string +>"!" : "!" var welcome = _.compose(exclaim, greet); >welcome : Function @@ -1091,7 +1091,7 @@ var welcome = _.compose(exclaim, greet); welcome('moe'); >welcome('moe') : any >welcome : Function ->'moe' : string +>'moe' : "moe" /////////////////////////////////////////////////////////////////////////////////////// @@ -1102,11 +1102,11 @@ _.keys({ one: 1, two: 2, three: 3 }); >keys : (object: any) => string[] >{ one: 1, two: 2, three: 3 } : { one: number; two: number; three: number; } >one : number ->1 : number +>1 : 1 >two : number ->2 : number +>2 : 2 >three : number ->3 : number +>3 : 3 _.values({ one: 1, two: 2, three: 3 }); >_.values({ one: 1, two: 2, three: 3 }) : any[] @@ -1115,11 +1115,11 @@ _.values({ one: 1, two: 2, three: 3 }); >values : (object: any) => any[] >{ one: 1, two: 2, three: 3 } : { one: number; two: number; three: number; } >one : number ->1 : number +>1 : 1 >two : number ->2 : number +>2 : 2 >three : number ->3 : number +>3 : 3 _.pairs({ one: 1, two: 2, three: 3 }); >_.pairs({ one: 1, two: 2, three: 3 }) : any[][] @@ -1128,11 +1128,11 @@ _.pairs({ one: 1, two: 2, three: 3 }); >pairs : (object: any) => any[][] >{ one: 1, two: 2, three: 3 } : { one: number; two: number; three: number; } >one : number ->1 : number +>1 : 1 >two : number ->2 : number +>2 : 2 >three : number ->3 : number +>3 : 3 _.invert({ Moe: "Moses", Larry: "Louis", Curly: "Jerome" }); >_.invert({ Moe: "Moses", Larry: "Louis", Curly: "Jerome" }) : any @@ -1141,11 +1141,11 @@ _.invert({ Moe: "Moses", Larry: "Louis", Curly: "Jerome" }); >invert : (object: any) => any >{ Moe: "Moses", Larry: "Louis", Curly: "Jerome" } : { Moe: string; Larry: string; Curly: string; } >Moe : string ->"Moses" : string +>"Moses" : "Moses" >Larry : string ->"Louis" : string +>"Louis" : "Louis" >Curly : string ->"Jerome" : string +>"Jerome" : "Jerome" _.functions(_); >_.functions(_) : string[] @@ -1161,10 +1161,10 @@ _.extend({ name: 'moe' }, { age: 50 }); >extend : (destination: T, ...sources: any[]) => T >{ name: 'moe' } : { name: string; } >name : string ->'moe' : string +>'moe' : "moe" >{ age: 50 } : { age: number; } >age : number ->50 : number +>50 : 50 _.pick({ name: 'moe', age: 50, userid: 'moe1' }, 'name', 'age'); >_.pick({ name: 'moe', age: 50, userid: 'moe1' }, 'name', 'age') : { name: string; age: number; userid: string; } @@ -1173,13 +1173,13 @@ _.pick({ name: 'moe', age: 50, userid: 'moe1' }, 'name', 'age'); >pick : (object: T, ...keys: string[]) => T >{ name: 'moe', age: 50, userid: 'moe1' } : { name: string; age: number; userid: string; } >name : string ->'moe' : string +>'moe' : "moe" >age : number ->50 : number +>50 : 50 >userid : string ->'moe1' : string ->'name' : string ->'age' : string +>'moe1' : "moe1" +>'name' : "name" +>'age' : "age" _.omit({ name: 'moe', age: 50, userid: 'moe1' }, 'userid'); >_.omit({ name: 'moe', age: 50, userid: 'moe1' }, 'userid') : { name: string; age: number; userid: string; } @@ -1188,18 +1188,18 @@ _.omit({ name: 'moe', age: 50, userid: 'moe1' }, 'userid'); >omit : (object: T, ...keys: string[]) => T >{ name: 'moe', age: 50, userid: 'moe1' } : { name: string; age: number; userid: string; } >name : string ->'moe' : string +>'moe' : "moe" >age : number ->50 : number +>50 : 50 >userid : string ->'moe1' : string ->'userid' : string +>'moe1' : "moe1" +>'userid' : "userid" var iceCream = { flavor: "chocolate" }; >iceCream : { flavor: string; } >{ flavor: "chocolate" } : { flavor: string; } >flavor : string ->"chocolate" : string +>"chocolate" : "chocolate" _.defaults(iceCream, { flavor: "vanilla", sprinkles: "lots" }); >_.defaults(iceCream, { flavor: "vanilla", sprinkles: "lots" }) : { flavor: string; } @@ -1209,9 +1209,9 @@ _.defaults(iceCream, { flavor: "vanilla", sprinkles: "lots" }); >iceCream : { flavor: string; } >{ flavor: "vanilla", sprinkles: "lots" } : { flavor: string; sprinkles: string; } >flavor : string ->"vanilla" : string +>"vanilla" : "vanilla" >sprinkles : string ->"lots" : string +>"lots" : "lots" _.clone({ name: 'moe' }); >_.clone({ name: 'moe' }) : { name: string; } @@ -1220,7 +1220,7 @@ _.clone({ name: 'moe' }); >clone : (object: T) => T >{ name: 'moe' } : { name: string; } >name : string ->'moe' : string +>'moe' : "moe" _.chain([1, 2, 3, 200]) >_.chain([1, 2, 3, 200]) .filter(function (num) { return num % 2 == 0; }) .tap(alert) .map(function (num) { return num * num }) .value() : number[] @@ -1236,10 +1236,10 @@ _.chain([1, 2, 3, 200]) >_ : Underscore.Static >chain : { (list: T[]): Underscore.ChainedArray; (list: Dictionary): Underscore.ChainedDictionary; (obj: T): Underscore.ChainedObject; } >[1, 2, 3, 200] : number[] ->1 : number ->2 : number ->3 : number ->200 : number +>1 : 1 +>2 : 2 +>3 : 3 +>200 : 200 .filter(function (num) { return num % 2 == 0; }) >filter : (iterator: Iterator, context?: any) => Underscore.ChainedArray @@ -1248,7 +1248,7 @@ _.chain([1, 2, 3, 200]) >num % 2 == 0 : boolean >num % 2 : number >num : number ->2 : number +>2 : 2 >0 : 0 .tap(alert) @@ -1274,34 +1274,34 @@ _.has({ a: 1, b: 2, c: 3 }, "b"); >has : (object: any, key: string) => boolean >{ a: 1, b: 2, c: 3 } : { a: number; b: number; c: number; } >a : number ->1 : number +>1 : 1 >b : number ->2 : number +>2 : 2 >c : number ->3 : number ->"b" : string +>3 : 3 +>"b" : "b" var moe = { name: 'moe', luckyNumbers: [13, 27, 34] }; >moe : { name: string; luckyNumbers: number[]; } >{ name: 'moe', luckyNumbers: [13, 27, 34] } : { name: string; luckyNumbers: number[]; } >name : string ->'moe' : string +>'moe' : "moe" >luckyNumbers : number[] >[13, 27, 34] : number[] ->13 : number ->27 : number ->34 : number +>13 : 13 +>27 : 27 +>34 : 34 var clone = { name: 'moe', luckyNumbers: [13, 27, 34] }; >clone : { name: string; luckyNumbers: number[]; } >{ name: 'moe', luckyNumbers: [13, 27, 34] } : { name: string; luckyNumbers: number[]; } >name : string ->'moe' : string +>'moe' : "moe" >luckyNumbers : number[] >[13, 27, 34] : number[] ->13 : number ->27 : number ->34 : number +>13 : 13 +>27 : 27 +>34 : 34 moe == clone; >moe == clone : boolean @@ -1322,9 +1322,9 @@ _.isEmpty([1, 2, 3]); >_ : Underscore.Static >isEmpty : (object: any) => boolean >[1, 2, 3] : number[] ->1 : number ->2 : number ->3 : number +>1 : 1 +>2 : 2 +>3 : 3 _.isEmpty({}); >_.isEmpty({}) : boolean @@ -1341,8 +1341,8 @@ _.isElement($('body')[0]); >$('body')[0] : any >$('body') : any >$ : any ->'body' : string ->0 : number +>'body' : "body" +>0 : 0 (function () { return _.isArray(arguments); })(); >(function () { return _.isArray(arguments); })() : boolean @@ -1360,9 +1360,9 @@ _.isArray([1, 2, 3]); >_ : Underscore.Static >isArray : (object: any) => boolean >[1, 2, 3] : number[] ->1 : number ->2 : number ->3 : number +>1 : 1 +>2 : 2 +>3 : 3 _.isObject({}); >_.isObject({}) : boolean @@ -1376,7 +1376,7 @@ _.isObject(1); >_.isObject : (value: any) => boolean >_ : Underscore.Static >isObject : (value: any) => boolean ->1 : number +>1 : 1 // (() => { return _.isArguments(arguments); })(1, 2, 3); @@ -1386,9 +1386,9 @@ _.isArguments([1, 2, 3]); >_ : Underscore.Static >isArguments : (object: any) => boolean >[1, 2, 3] : number[] ->1 : number ->2 : number ->3 : number +>1 : 1 +>2 : 2 +>3 : 3 _.isFunction(alert); >_.isFunction(alert) : boolean @@ -1402,7 +1402,7 @@ _.isString("moe"); >_.isString : (object: any) => boolean >_ : Underscore.Static >isString : (object: any) => boolean ->"moe" : string +>"moe" : "moe" _.isNumber(8.4 * 5); >_.isNumber(8.4 * 5) : boolean @@ -1410,16 +1410,16 @@ _.isNumber(8.4 * 5); >_ : Underscore.Static >isNumber : (object: any) => boolean >8.4 * 5 : number ->8.4 : number ->5 : number +>8.4 : 8.4 +>5 : 5 _.isFinite(-101); >_.isFinite(-101) : boolean >_.isFinite : (object: any) => boolean >_ : Underscore.Static >isFinite : (object: any) => boolean ->-101 : number ->101 : number +>-101 : -101 +>101 : 101 _.isFinite(-Infinity); >_.isFinite(-Infinity) : boolean @@ -1508,7 +1508,7 @@ var moe2 = { name: 'moe' }; >moe2 : { name: string; } >{ name: 'moe' } : { name: string; } >name : string ->'moe' : string +>'moe' : "moe" moe2 === _.identity(moe); >moe2 === _.identity(moe) : boolean @@ -1527,7 +1527,7 @@ _.times(3, function (n) { genie.grantWishNumber(n); }); >_.times : (n: number, iterator: Iterator, context?: any) => U[] >_ : Underscore.Static >times : (n: number, iterator: Iterator, context?: any) => U[] ->3 : number +>3 : 3 >function (n) { genie.grantWishNumber(n); } : (n: number) => void >n : number >genie.grantWishNumber(n) : any @@ -1541,8 +1541,8 @@ _.random(0, 100); >_.random : { (max: number): number; (min: number, max: number): number; } >_ : Underscore.Static >random : { (max: number): number; (min: number, max: number): number; } ->0 : number ->100 : number +>0 : 0 +>100 : 100 _.mixin({ >_.mixin({ capitalize: function (string) { return string.charAt(0).toUpperCase() + string.substring(1).toLowerCase(); }}) : void @@ -1564,7 +1564,7 @@ _.mixin({ >string.charAt : any >string : any >charAt : any ->0 : number +>0 : 0 >toUpperCase : any >string.substring(1).toLowerCase() : any >string.substring(1).toLowerCase : any @@ -1572,7 +1572,7 @@ _.mixin({ >string.substring : any >string : any >substring : any ->1 : number +>1 : 1 >toLowerCase : any } }); @@ -1583,7 +1583,7 @@ _.mixin({ >_("fabio") : any >_("fabio") : Underscore.WrappedObject >_ : Underscore.Static ->"fabio" : string +>"fabio" : "fabio" >capitalize : any _.uniqueId('contact_'); @@ -1591,23 +1591,23 @@ _.uniqueId('contact_'); >_.uniqueId : { (): number; (prefix: string): string; } >_ : Underscore.Static >uniqueId : { (): number; (prefix: string): string; } ->'contact_' : string +>'contact_' : "contact_" _.escape('Curly, Larry & Moe'); >_.escape('Curly, Larry & Moe') : string >_.escape : (s: string) => string >_ : Underscore.Static >escape : (s: string) => string ->'Curly, Larry & Moe' : string +>'Curly, Larry & Moe' : "Curly, Larry & Moe" var object = { cheese: 'crumpets', stuff: function () { return 'nonsense'; } }; >object : { cheese: string; stuff: () => string; } >{ cheese: 'crumpets', stuff: function () { return 'nonsense'; } } : { cheese: string; stuff: () => string; } >cheese : string ->'crumpets' : string +>'crumpets' : "crumpets" >stuff : () => string >function () { return 'nonsense'; } : () => string ->'nonsense' : string +>'nonsense' : "nonsense" _.result(object, 'cheese'); >_.result(object, 'cheese') : any @@ -1615,7 +1615,7 @@ _.result(object, 'cheese'); >_ : Underscore.Static >result : (object: any, property: string) => any >object : { cheese: string; stuff: () => string; } ->'cheese' : string +>'cheese' : "cheese" _.result(object, 'stuff'); >_.result(object, 'stuff') : any @@ -1623,7 +1623,7 @@ _.result(object, 'stuff'); >_ : Underscore.Static >result : (object: any, property: string) => any >object : { cheese: string; stuff: () => string; } ->'stuff' : string +>'stuff' : "stuff" var compiled = _.template("hello: <%= name %>"); >compiled : (data: any) => string @@ -1631,18 +1631,18 @@ var compiled = _.template("hello: <%= name %>"); >_.template : { (templateString: string): (data: any) => string; (templateString: string, data: any, settings?: Underscore.TemplateSettings): string; } >_ : Underscore.Static >template : { (templateString: string): (data: any) => string; (templateString: string, data: any, settings?: Underscore.TemplateSettings): string; } ->"hello: <%= name %>" : string +>"hello: <%= name %>" : "hello: <%= name %>" compiled({ name: 'moe' }); >compiled({ name: 'moe' }) : string >compiled : (data: any) => string >{ name: 'moe' } : { name: string; } >name : string ->'moe' : string +>'moe' : "moe" var list2 = "<% _.each(people, function(name) { %>
  • <%= name %>
  • <% }); %>"; >list2 : string ->"<% _.each(people, function(name) { %>
  • <%= name %>
  • <% }); %>" : string +>"<% _.each(people, function(name) { %>
  • <%= name %>
  • <% }); %>" : "<% _.each(people, function(name) { %>
  • <%= name %>
  • <% }); %>" _.template(list2, { people: ['moe', 'curly', 'larry'] }); >_.template(list2, { people: ['moe', 'curly', 'larry'] }) : string @@ -1653,9 +1653,9 @@ _.template(list2, { people: ['moe', 'curly', 'larry'] }); >{ people: ['moe', 'curly', 'larry'] } : { people: string[]; } >people : string[] >['moe', 'curly', 'larry'] : string[] ->'moe' : string ->'curly' : string ->'larry' : string +>'moe' : "moe" +>'curly' : "curly" +>'larry' : "larry" var template = _.template("<%- value %>"); >template : (data: any) => string @@ -1663,14 +1663,14 @@ var template = _.template("<%- value %>"); >_.template : { (templateString: string): (data: any) => string; (templateString: string, data: any, settings?: Underscore.TemplateSettings): string; } >_ : Underscore.Static >template : { (templateString: string): (data: any) => string; (templateString: string, data: any, settings?: Underscore.TemplateSettings): string; } ->"<%- value %>" : string +>"<%- value %>" : "<%- value %>" template({ value: '